From ad3e4dbcce1a97b331f020608b0ae785de0cb8a8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 07:55:34 +0100 Subject: [PATCH] refactor: trim unused exports --- src/agents/model-selection-resolve.ts | 25 +-- .../models-config.providers.static.test.ts | 86 -------- src/agents/models-config.providers.static.ts | 123 ----------- src/agents/models-config.providers.ts | 9 +- src/agents/pi-embedded-messaging.ts | 2 - src/agents/pi-embedded-runner.ts | 1 - src/config/config-env-vars.ts | 5 - src/config/io.observe-recovery.ts | 202 ------------------ src/config/zod-schema.core.ts | 12 -- src/hooks/types.ts | 6 - src/infra/dispatch-wrapper-resolution.ts | 13 -- src/infra/exec-wrapper-resolution.ts | 23 +- src/infra/session-cost-usage.ts | 1 - src/infra/session-delivery-queue-recovery.ts | 4 +- src/infra/session-delivery-queue-storage.ts | 2 +- src/infra/session-delivery-queue.ts | 13 +- src/infra/shell-wrapper-resolution.ts | 1 - src/model-catalog/index.ts | 6 +- 18 files changed, 27 insertions(+), 507 deletions(-) delete mode 100644 src/agents/models-config.providers.static.test.ts delete mode 100644 src/agents/models-config.providers.static.ts diff --git a/src/agents/model-selection-resolve.ts b/src/agents/model-selection-resolve.ts index 233bb965e58..336f0b153fb 100644 --- a/src/agents/model-selection-resolve.ts +++ b/src/agents/model-selection-resolve.ts @@ -3,7 +3,6 @@ import type { OpenClawConfig } from "../config/types.openclaw.js"; import type { ModelCatalogEntry } from "./model-catalog.types.js"; import type { ModelRef } from "./model-selection-normalize.js"; import { - buildAllowedModelSetWithFallbacks, buildModelAliasIndex, getModelRefStatusWithFallbackModels, resolveAllowedModelRefFromAliasIndex, @@ -12,40 +11,18 @@ import { export { buildConfiguredAllowlistKeys, - buildConfiguredModelCatalog, buildModelAliasIndex, - inferUniqueProviderFromConfiguredModels, normalizeModelSelection, resolveConfiguredModelRef, resolveHooksGmailModel, resolveModelRefFromString, } from "./model-selection-shared.js"; -export type { ModelAliasIndex, ModelRefStatus } from "./model-selection-shared.js"; +export type { ModelRefStatus } from "./model-selection-shared.js"; function resolveDefaultFallbackModels(cfg: OpenClawConfig): string[] { return resolveAgentModelFallbackValues(cfg.agents?.defaults?.model); } -export function buildAllowedModelSet(params: { - cfg: OpenClawConfig; - catalog: ModelCatalogEntry[]; - defaultProvider: string; - defaultModel?: string; -}): { - allowAny: boolean; - allowedCatalog: ModelCatalogEntry[]; - allowedKeys: Set; -} { - const { cfg, catalog, defaultProvider, defaultModel } = params; - return buildAllowedModelSetWithFallbacks({ - cfg, - catalog, - defaultProvider, - defaultModel, - fallbackModels: resolveDefaultFallbackModels(cfg), - }); -} - export function getModelRefStatus(params: { cfg: OpenClawConfig; catalog: ModelCatalogEntry[]; diff --git a/src/agents/models-config.providers.static.test.ts b/src/agents/models-config.providers.static.test.ts deleted file mode 100644 index 52a6e2b4a09..00000000000 --- a/src/agents/models-config.providers.static.test.ts +++ /dev/null @@ -1,86 +0,0 @@ -import fs from "node:fs"; -import { mkdtempSync } from "node:fs"; -import { tmpdir } from "node:os"; -import path from "node:path"; -import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; - -type StaticModule = typeof import("./models-config.providers.static.js"); - -const fixtureRoot = mkdtempSync(path.join(tmpdir(), "openclaw-provider-catalogs-")); -const fixtureExtensionsDir = path.join(fixtureRoot, "dist-runtime", "extensions"); - -function writeFixtureCatalog(dirName: string, exportNames: string[]) { - const pluginDir = path.join(fixtureExtensionsDir, dirName); - fs.mkdirSync(pluginDir, { recursive: true }); - fs.writeFileSync( - path.join(pluginDir, "provider-catalog.js"), - exportNames - .map((exportName) => `export function ${exportName}() { return "${dirName}"; }`) - .join("\n") + "\n", - "utf8", - ); -} - -writeFixtureCatalog("openrouter", ["buildOpenrouterProvider"]); -writeFixtureCatalog("volcengine", ["buildDoubaoProvider", "buildDoubaoCodingProvider"]); - -let staticModule: StaticModule; - -beforeAll(async () => { - vi.resetModules(); - vi.doMock("../plugins/bundled-plugin-metadata.js", () => ({ - listBundledPluginMetadata: (_params: { rootDir: string }) => [ - { - dirName: "openrouter", - publicSurfaceArtifacts: ["provider-catalog.js"], - manifest: { id: "openrouter", providers: ["openrouter"] }, - }, - { - dirName: "volcengine", - publicSurfaceArtifacts: ["provider-catalog.js"], - manifest: { id: "volcengine", providers: ["volcengine", "byteplus"] }, - }, - { - dirName: "ignored", - publicSurfaceArtifacts: ["api.js"], - manifest: { id: "ignored", providers: [] }, - }, - ], - resolveBundledPluginPublicSurfacePath: ({ - rootDir, - dirName, - artifactBasename, - }: { - rootDir: string; - dirName: string; - artifactBasename: string; - }) => path.join(rootDir, "dist-runtime", "extensions", dirName, artifactBasename), - })); - staticModule = await import("./models-config.providers.static.js"); -}); - -afterAll(() => { - vi.doUnmock("../plugins/bundled-plugin-metadata.js"); - vi.resetModules(); - fs.rmSync(fixtureRoot, { recursive: true, force: true }); -}); - -describe("models-config bundled provider catalogs", () => { - it("detects provider catalogs from plugin folders via metadata artifacts", () => { - const entries = staticModule.resolveBundledProviderCatalogEntries({ rootDir: fixtureRoot }); - expect(entries.map((entry) => entry.dirName)).toEqual(["openrouter", "volcengine"]); - expect(entries.find((entry) => entry.dirName === "volcengine")).toMatchObject({ - dirName: "volcengine", - pluginId: "volcengine", - }); - }); - - it("loads provider catalog exports from detected plugin folders", async () => { - const exports = await staticModule.loadBundledProviderCatalogExportMap({ - rootDir: fixtureRoot, - }); - expect(exports.buildOpenrouterProvider).toBeTypeOf("function"); - expect(exports.buildDoubaoProvider).toBeTypeOf("function"); - expect(exports.buildDoubaoCodingProvider).toBeTypeOf("function"); - }); -}); diff --git a/src/agents/models-config.providers.static.ts b/src/agents/models-config.providers.static.ts deleted file mode 100644 index 4ce9c41bc16..00000000000 --- a/src/agents/models-config.providers.static.ts +++ /dev/null @@ -1,123 +0,0 @@ -import path from "node:path"; -import { pathToFileURL } from "node:url"; -import { listBundledPluginMetadata } from "../plugins/bundled-plugin-metadata.js"; -import { resolveBundledPluginPublicSurfacePath } from "../plugins/public-surface-runtime.js"; - -const PROVIDER_CATALOG_ARTIFACT_BASENAME = "provider-catalog.js"; -const DEFAULT_PROVIDER_CATALOG_ROOT = path.resolve(import.meta.dirname, "../.."); - -export type BundledProviderCatalogEntry = { - dirName: string; - pluginId: string; - providers: readonly string[]; - artifactPath: string; -}; - -type ProviderCatalogModule = Record; -type ProviderCatalogExportMap = Record; - -let providerCatalogEntriesCache: ReadonlyArray | null = null; -let providerCatalogModulesPromise: Promise>> | null = - null; -let providerCatalogExportMapPromise: Promise> | null = null; - -export function resolveBundledProviderCatalogEntries(params?: { - rootDir?: string; -}): ReadonlyArray { - const rootDir = params?.rootDir ?? DEFAULT_PROVIDER_CATALOG_ROOT; - if (rootDir === DEFAULT_PROVIDER_CATALOG_ROOT && providerCatalogEntriesCache) { - return providerCatalogEntriesCache; - } - - const entries: BundledProviderCatalogEntry[] = []; - for (const entry of listBundledPluginMetadata({ rootDir })) { - if (!entry.publicSurfaceArtifacts?.includes(PROVIDER_CATALOG_ARTIFACT_BASENAME)) { - continue; - } - const artifactPath = resolveBundledPluginPublicSurfacePath({ - rootDir, - dirName: entry.dirName, - artifactBasename: PROVIDER_CATALOG_ARTIFACT_BASENAME, - }); - if (!artifactPath) { - continue; - } - entries.push({ - dirName: entry.dirName, - pluginId: entry.manifest.id, - providers: entry.manifest.providers ?? [], - artifactPath, - }); - } - entries.sort((left, right) => left.dirName.localeCompare(right.dirName)); - - if (rootDir === DEFAULT_PROVIDER_CATALOG_ROOT) { - providerCatalogEntriesCache = entries; - } - return entries; -} - -export async function loadBundledProviderCatalogModules(params?: { - rootDir?: string; -}): Promise>> { - const rootDir = params?.rootDir ?? DEFAULT_PROVIDER_CATALOG_ROOT; - if (rootDir === DEFAULT_PROVIDER_CATALOG_ROOT && providerCatalogModulesPromise) { - return providerCatalogModulesPromise; - } - - const loadPromise = (async () => { - const entries = resolveBundledProviderCatalogEntries({ rootDir }); - const modules = await Promise.all( - entries.map(async (entry) => { - const module = (await import( - pathToFileURL(entry.artifactPath).href - )) as ProviderCatalogModule; - return [entry.dirName, module] as const; - }), - ); - return Object.freeze(Object.fromEntries(modules)); - })(); - - if (rootDir === DEFAULT_PROVIDER_CATALOG_ROOT) { - providerCatalogModulesPromise = loadPromise; - } - return loadPromise; -} - -export async function loadBundledProviderCatalogExportMap(params?: { - rootDir?: string; -}): Promise> { - const rootDir = params?.rootDir ?? DEFAULT_PROVIDER_CATALOG_ROOT; - if (rootDir === DEFAULT_PROVIDER_CATALOG_ROOT && providerCatalogExportMapPromise) { - return providerCatalogExportMapPromise; - } - - const loadPromise = (async () => { - const modules = await loadBundledProviderCatalogModules({ rootDir }); - const exports: ProviderCatalogExportMap = {}; - const exportOwners = new Map(); - - for (const [dirName, module] of Object.entries(modules)) { - for (const [exportName, exportValue] of Object.entries(module)) { - if (exportName === "default") { - continue; - } - const existingOwner = exportOwners.get(exportName); - if (existingOwner && existingOwner !== dirName) { - throw new Error( - `Duplicate provider catalog export "${exportName}" from folders "${existingOwner}" and "${dirName}"`, - ); - } - exportOwners.set(exportName, dirName); - exports[exportName] = exportValue; - } - } - - return Object.freeze(exports); - })(); - - if (rootDir === DEFAULT_PROVIDER_CATALOG_ROOT) { - providerCatalogExportMapPromise = loadPromise; - } - return loadPromise; -} diff --git a/src/agents/models-config.providers.ts b/src/agents/models-config.providers.ts index 7a3e91ab2b7..44664601979 100644 --- a/src/agents/models-config.providers.ts +++ b/src/agents/models-config.providers.ts @@ -1,12 +1,5 @@ -export * from "./models-config.providers.static.js"; export { resolveImplicitProviders } from "./models-config.providers.implicit.js"; export { normalizeProviders } from "./models-config.providers.normalize.js"; -export type { - ProfileApiKeyResolution, - ProviderApiKeyResolver, - ProviderAuthResolver, - ProviderConfig, - SecretDefaults, -} from "./models-config.providers.secrets.js"; +export type { ProviderConfig } from "./models-config.providers.secrets.js"; export { applyNativeStreamingUsageCompat } from "./models-config.providers.policy.js"; export { enforceSourceManagedProviderSecrets } from "./models-config.providers.source-managed.js"; diff --git a/src/agents/pi-embedded-messaging.ts b/src/agents/pi-embedded-messaging.ts index ad383329f23..0eeef45af7c 100644 --- a/src/agents/pi-embedded-messaging.ts +++ b/src/agents/pi-embedded-messaging.ts @@ -1,5 +1,3 @@ -export type { MessagingToolSend } from "./pi-embedded-messaging.types.js"; - import { getChannelPlugin, normalizeChannelId } from "../channels/plugins/index.js"; import { normalizeOptionalString } from "../shared/string-coerce.js"; diff --git a/src/agents/pi-embedded-runner.ts b/src/agents/pi-embedded-runner.ts index ead720c0a52..efd1c0cce95 100644 --- a/src/agents/pi-embedded-runner.ts +++ b/src/agents/pi-embedded-runner.ts @@ -1,4 +1,3 @@ -export type { MessagingToolSend } from "./pi-embedded-messaging.types.js"; export { compactEmbeddedPiSession, compactEmbeddedPiSession as compactEmbeddedAgentSession, diff --git a/src/config/config-env-vars.ts b/src/config/config-env-vars.ts index 5b5f3092bb1..ec63a63ac74 100644 --- a/src/config/config-env-vars.ts +++ b/src/config/config-env-vars.ts @@ -62,11 +62,6 @@ export function collectConfigServiceEnvVars(cfg?: OpenClawConfig): Record { - return collectConfigRuntimeEnvVars(cfg); -} - export function createConfigRuntimeEnv( cfg: OpenClawConfig, baseEnv: NodeJS.ProcessEnv = process.env, diff --git a/src/config/io.observe-recovery.ts b/src/config/io.observe-recovery.ts index 51a11b3db07..391dbbcf4ab 100644 --- a/src/config/io.observe-recovery.ts +++ b/src/config/io.observe-recovery.ts @@ -77,16 +77,6 @@ export type ObserveRecoveryDeps = { logger: Pick; }; -type ObserveSnapshot = { - path: string; - exists: boolean; - valid: boolean; - raw: string | null; - hash?: string; - parsed: unknown; - resolved?: unknown; -}; - type ConfigHealthFingerprint = { hash: string; bytes: number; @@ -202,17 +192,6 @@ function createConfigObserveAuditAppendParams( }; } -function createConfigObserveAnomalyAuditAppendParams( - deps: ObserveRecoveryDeps, - params: Omit, -) { - return createConfigObserveAuditAppendParams(deps, { - ...params, - restoredFromBackup: false, - restoredBackupPath: null, - }); -} - function hashConfigRaw(raw: string | null): string { return crypto .createHash("sha256") @@ -780,187 +759,6 @@ export function maybeRecoverSuspiciousConfigReadSync(params: { return { raw: backupRaw, parsed: backupParsed }; } -export async function observeConfigSnapshot( - deps: ObserveRecoveryDeps, - snapshot: ObserveSnapshot, -): Promise { - if (!snapshot.exists || typeof snapshot.raw !== "string") { - return; - } - - const stat = await deps.fs.promises.stat(snapshot.path).catch(() => null); - const now = new Date().toISOString(); - const current = createConfigHealthFingerprint({ - hash: resolveConfigSnapshotHash(snapshot) ?? hashConfigRaw(snapshot.raw), - raw: snapshot.raw, - parsed: snapshot.parsed, - gatewaySource: snapshot.resolved, - stat: stat as ConfigStatMetadataSource, - observedAt: now, - }); - - let healthState = await readConfigHealthState(deps); - const entry = getConfigHealthEntry(healthState, snapshot.path); - const backupBaseline = - entry.lastKnownGood ?? - (await readConfigFingerprintForPath(deps, `${snapshot.path}.bak`)) ?? - undefined; - const suspicious = resolveConfigObserveSuspiciousReasons({ - bytes: current.bytes, - hasMeta: current.hasMeta, - gatewayMode: current.gatewayMode, - parsed: snapshot.parsed, - lastKnownGood: backupBaseline, - }); - - if (suspicious.length === 0) { - if (snapshot.valid) { - const nextEntry: ConfigHealthEntry = { - ...entry, - lastKnownGood: current, - lastObservedSuspiciousSignature: null, - }; - const same = - entry.lastKnownGood && - entry.lastKnownGood.hash === current.hash && - entry.lastKnownGood.bytes === current.bytes && - entry.lastKnownGood.mtimeMs === current.mtimeMs && - entry.lastKnownGood.ctimeMs === current.ctimeMs && - entry.lastKnownGood.dev === current.dev && - entry.lastKnownGood.ino === current.ino && - entry.lastKnownGood.mode === current.mode && - entry.lastKnownGood.nlink === current.nlink && - entry.lastKnownGood.uid === current.uid && - entry.lastKnownGood.gid === current.gid && - entry.lastKnownGood.hasMeta === current.hasMeta && - entry.lastKnownGood.gatewayMode === current.gatewayMode; - if (!same || entry.lastObservedSuspiciousSignature !== null) { - healthState = setConfigHealthEntry(healthState, snapshot.path, nextEntry); - await writeConfigHealthState(deps, healthState); - } - } - return; - } - - const suspiciousSignature = resolveSuspiciousSignature(current, suspicious); - if (entry.lastObservedSuspiciousSignature === suspiciousSignature) { - return; - } - - const backup = - (backupBaseline?.hash ? backupBaseline : null) ?? - (await readConfigFingerprintForPath(deps, `${snapshot.path}.bak`)); - const clobberedPath = await persistClobberedConfigSnapshot({ - deps, - configPath: snapshot.path, - raw: snapshot.raw, - observedAt: now, - }); - - deps.logger.warn(`Config observe anomaly: ${snapshot.path} (${suspicious.join(", ")})`); - await appendConfigAuditRecord( - createConfigObserveAnomalyAuditAppendParams(deps, { - ts: now, - configPath: snapshot.path, - valid: snapshot.valid, - current, - suspicious, - lastKnownGood: entry.lastKnownGood, - backup, - clobberedPath, - }), - ); - - healthState = setConfigHealthEntry( - healthState, - snapshot.path, - createLastObservedSuspiciousEntry(entry, suspiciousSignature), - ); - await writeConfigHealthState(deps, healthState); -} - -export function observeConfigSnapshotSync( - deps: ObserveRecoveryDeps, - snapshot: ObserveSnapshot, -): void { - if (!snapshot.exists || typeof snapshot.raw !== "string") { - return; - } - - const stat = deps.fs.statSync(snapshot.path, { throwIfNoEntry: false }) ?? null; - const now = new Date().toISOString(); - const current = createConfigHealthFingerprint({ - hash: resolveConfigSnapshotHash(snapshot) ?? hashConfigRaw(snapshot.raw), - raw: snapshot.raw, - parsed: snapshot.parsed, - gatewaySource: snapshot.resolved, - stat, - observedAt: now, - }); - - let healthState = readConfigHealthStateSync(deps); - const entry = getConfigHealthEntry(healthState, snapshot.path); - const backupBaseline = - entry.lastKnownGood ?? - readConfigFingerprintForPathSync(deps, `${snapshot.path}.bak`) ?? - undefined; - const suspicious = resolveConfigObserveSuspiciousReasons({ - bytes: current.bytes, - hasMeta: current.hasMeta, - gatewayMode: current.gatewayMode, - parsed: snapshot.parsed, - lastKnownGood: backupBaseline, - }); - - if (suspicious.length === 0) { - if (snapshot.valid) { - healthState = setConfigHealthEntry(healthState, snapshot.path, { - ...entry, - lastKnownGood: current, - lastObservedSuspiciousSignature: null, - }); - writeConfigHealthStateSync(deps, healthState); - } - return; - } - - const suspiciousSignature = resolveSuspiciousSignature(current, suspicious); - if (entry.lastObservedSuspiciousSignature === suspiciousSignature) { - return; - } - - const backup = - (backupBaseline?.hash ? backupBaseline : null) ?? - readConfigFingerprintForPathSync(deps, `${snapshot.path}.bak`); - const clobberedPath = persistClobberedConfigSnapshotSync({ - deps, - configPath: snapshot.path, - raw: snapshot.raw, - observedAt: now, - }); - - deps.logger.warn(`Config observe anomaly: ${snapshot.path} (${suspicious.join(", ")})`); - appendConfigAuditRecordSync( - createConfigObserveAnomalyAuditAppendParams(deps, { - ts: now, - configPath: snapshot.path, - valid: snapshot.valid, - current, - suspicious, - lastKnownGood: entry.lastKnownGood, - backup, - clobberedPath, - }), - ); - - healthState = setConfigHealthEntry( - healthState, - snapshot.path, - createLastObservedSuspiciousEntry(entry, suspiciousSignature), - ); - writeConfigHealthStateSync(deps, healthState); -} - export async function promoteConfigSnapshotToLastKnownGood(params: { deps: ObserveRecoveryDeps; snapshot: ConfigFileSnapshot; diff --git a/src/config/zod-schema.core.ts b/src/config/zod-schema.core.ts index 3a0fee2450e..04c284aac3c 100644 --- a/src/config/zod-schema.core.ts +++ b/src/config/zod-schema.core.ts @@ -369,18 +369,6 @@ export const ModelProviderSchema = z }) .strict(); -export const BedrockDiscoverySchema = z - .object({ - enabled: z.boolean().optional(), - region: z.string().optional(), - providerFilter: z.array(z.string()).optional(), - refreshInterval: z.number().int().nonnegative().optional(), - defaultContextWindow: z.number().int().positive().optional(), - defaultMaxTokens: z.number().int().positive().optional(), - }) - .strict() - .optional(); - const ModelPricingConfigSchema = z .object({ enabled: z.boolean().optional(), diff --git a/src/hooks/types.ts b/src/hooks/types.ts index 6675a432630..f44e067b83f 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -59,9 +59,3 @@ export type HookEligibilityContext = { note?: string; }; }; - -export type HookSnapshot = { - hooks: Array<{ name: string; events: string[] }>; - resolvedHooks?: Hook[]; - version?: number; -}; diff --git a/src/infra/dispatch-wrapper-resolution.ts b/src/infra/dispatch-wrapper-resolution.ts index 2b0db746f7b..91b75a38bcc 100644 --- a/src/infra/dispatch-wrapper-resolution.ts +++ b/src/infra/dispatch-wrapper-resolution.ts @@ -82,15 +82,6 @@ function isKnownArchNameToken(token: string): boolean { type WrapperScanDirective = "continue" | "consume-next" | "stop" | "invalid"; -function withWindowsExeAliases(names: readonly string[]): string[] { - const expanded = new Set(); - for (const name of names) { - expanded.add(name); - expanded.add(`${name}.exe`); - } - return Array.from(expanded); -} - export function isEnvAssignment(token: string): boolean { return /^[A-Za-z_][A-Za-z0-9_]*=.*/.test(token); } @@ -540,10 +531,6 @@ const DISPATCH_WRAPPER_SPEC_BY_NAME = new Map( DISPATCH_WRAPPER_SPECS.map((spec) => [spec.name, spec] as const), ); -export const DISPATCH_WRAPPER_EXECUTABLES = new Set( - withWindowsExeAliases(DISPATCH_WRAPPER_SPECS.map((spec) => spec.name)), -); - export type DispatchWrapperUnwrapResult = | { kind: "not-wrapper" } | { kind: "blocked"; wrapper: string } diff --git a/src/infra/exec-wrapper-resolution.ts b/src/infra/exec-wrapper-resolution.ts index 6f435f84943..ad1f3bc9a73 100644 --- a/src/infra/exec-wrapper-resolution.ts +++ b/src/infra/exec-wrapper-resolution.ts @@ -1,4 +1,21 @@ export { basenameLower, normalizeExecutableToken } from "./exec-wrapper-tokens.js"; -export * from "./dispatch-wrapper-resolution.js"; -export * from "./shell-wrapper-resolution.js"; -export * from "./exec-wrapper-trust-plan.js"; +export { + extractEnvAssignmentKeysFromDispatchWrappers, + isDispatchWrapperExecutable, + resolveDispatchWrapperTrustPlan, + unwrapDispatchWrappersForResolution, + unwrapEnvInvocation, + unwrapKnownDispatchWrapperInvocation, +} from "./dispatch-wrapper-resolution.js"; +export { + extractShellWrapperCommand, + extractShellWrapperInlineCommand, + hasEnvManipulationBeforeShellWrapper, + isShellWrapperExecutable, + isShellWrapperInvocation, + POSIX_SHELL_WRAPPERS, + POWERSHELL_WRAPPERS, + resolveShellWrapperTransportArgv, + unwrapKnownShellMultiplexerInvocation, +} from "./shell-wrapper-resolution.js"; +export { resolveExecWrapperTrustPlan } from "./exec-wrapper-trust-plan.js"; diff --git a/src/infra/session-cost-usage.ts b/src/infra/session-cost-usage.ts index e30daac09ce..de691249e57 100644 --- a/src/infra/session-cost-usage.ts +++ b/src/infra/session-cost-usage.ts @@ -46,7 +46,6 @@ import type { } from "./session-cost-usage.types.js"; export type { - CostUsageDailyEntry, CostUsageSummary, CostUsageTotals, DiscoveredSession, diff --git a/src/infra/session-delivery-queue-recovery.ts b/src/infra/session-delivery-queue-recovery.ts index 5ac3121268a..9a893f23123 100644 --- a/src/infra/session-delivery-queue-recovery.ts +++ b/src/infra/session-delivery-queue-recovery.ts @@ -28,7 +28,7 @@ export interface PendingSessionDeliveryDrainDecision { bypassBackoff?: boolean; } -export const MAX_SESSION_DELIVERY_RETRIES = 5; +const MAX_SESSION_DELIVERY_RETRIES = 5; const BACKOFF_MS: readonly number[] = [5_000, 25_000, 120_000, 600_000]; const drainInProgress = new Map(); @@ -61,7 +61,7 @@ function releaseRecoveryEntry(entryId: string): void { entriesInProgress.delete(entryId); } -export function computeSessionDeliveryBackoffMs(retryCount: number): number { +function computeSessionDeliveryBackoffMs(retryCount: number): number { if (retryCount <= 0) { return 0; } diff --git a/src/infra/session-delivery-queue-storage.ts b/src/infra/session-delivery-queue-storage.ts index f6e7a6238f8..502a6b20bf4 100644 --- a/src/infra/session-delivery-queue-storage.ts +++ b/src/infra/session-delivery-queue-storage.ts @@ -121,7 +121,7 @@ function resolveQueueEntryPaths( }; } -export async function ensureSessionDeliveryQueueDir(stateDir?: string): Promise { +async function ensureSessionDeliveryQueueDir(stateDir?: string): Promise { const queueDir = resolveSessionDeliveryQueueDir(stateDir); await fs.promises.mkdir(queueDir, { recursive: true, mode: 0o700 }); await fs.promises.mkdir(resolveFailedDir(stateDir), { recursive: true, mode: 0o700 }); diff --git a/src/infra/session-delivery-queue.ts b/src/infra/session-delivery-queue.ts index 784857798ef..8c0d590d1c6 100644 --- a/src/infra/session-delivery-queue.ts +++ b/src/infra/session-delivery-queue.ts @@ -1,29 +1,18 @@ export { ackSessionDelivery, enqueueSessionDelivery, - ensureSessionDeliveryQueueDir, failSessionDelivery, - loadPendingSessionDelivery, loadPendingSessionDeliveries, - moveSessionDeliveryToFailed, resolveSessionDeliveryQueueDir, } from "./session-delivery-queue-storage.js"; export type { QueuedSessionDelivery, QueuedSessionDeliveryPayload, - SessionDeliveryContext, SessionDeliveryRoute, } from "./session-delivery-queue-storage.js"; export { - computeSessionDeliveryBackoffMs, drainPendingSessionDeliveries, isSessionDeliveryEligibleForRetry, - MAX_SESSION_DELIVERY_RETRIES, recoverPendingSessionDeliveries, } from "./session-delivery-queue-recovery.js"; -export type { - DeliverSessionDeliveryFn, - PendingSessionDeliveryDrainDecision, - SessionDeliveryRecoveryLogger, - SessionDeliveryRecoverySummary, -} from "./session-delivery-queue-recovery.js"; +export type { SessionDeliveryRecoveryLogger } from "./session-delivery-queue-recovery.js"; diff --git a/src/infra/shell-wrapper-resolution.ts b/src/infra/shell-wrapper-resolution.ts index 18cd81748f8..59b2f01f24f 100644 --- a/src/infra/shell-wrapper-resolution.ts +++ b/src/infra/shell-wrapper-resolution.ts @@ -26,7 +26,6 @@ function withWindowsExeAliases(names: readonly string[]): string[] { } export const POSIX_SHELL_WRAPPERS = new Set(POSIX_SHELL_WRAPPER_NAMES); -export const WINDOWS_CMD_WRAPPERS = new Set(withWindowsExeAliases(WINDOWS_CMD_WRAPPER_NAMES)); export const POWERSHELL_WRAPPERS = new Set(withWindowsExeAliases(POWERSHELL_WRAPPER_NAMES)); const POSIX_SHELL_WRAPPER_CANONICAL = new Set(POSIX_SHELL_WRAPPER_NAMES); diff --git a/src/model-catalog/index.ts b/src/model-catalog/index.ts index 6f93133d5a0..bc6b9f3243f 100644 --- a/src/model-catalog/index.ts +++ b/src/model-catalog/index.ts @@ -1,7 +1,4 @@ -export { - compareModelCatalogSourceAuthority, - mergeModelCatalogRowsByAuthority, -} from "./authority.js"; +export { mergeModelCatalogRowsByAuthority } from "./authority.js"; export { buildModelCatalogMergeKey, buildModelCatalogRef, @@ -32,7 +29,6 @@ export type { ManifestModelCatalogPlugin, ManifestModelCatalogRegistry, ManifestModelCatalogSuppressionEntry, - ManifestModelCatalogSuppressionPlan, } from "./manifest-planner.js"; export type { ModelCatalog,