open-multi-agent-kit 0.98.2 → 0.98.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/dist/core/advisory-judge-model.d.ts.map +1 -1
- package/dist/core/advisory-judge-model.js +8 -1
- package/dist/core/advisory-judge-model.js.map +1 -1
- package/dist/core/advisory-judge-types.d.ts +18 -1
- package/dist/core/advisory-judge-types.d.ts.map +1 -1
- package/dist/core/advisory-judge-types.js.map +1 -1
- package/dist/core/advisory-judge.d.ts.map +1 -1
- package/dist/core/advisory-judge.js +41 -6
- package/dist/core/advisory-judge.js.map +1 -1
- package/dist/core/session-bash-runtime.d.ts +7 -0
- package/dist/core/session-bash-runtime.d.ts.map +1 -1
- package/dist/core/session-bash-runtime.js +10 -1
- package/dist/core/session-bash-runtime.js.map +1 -1
- package/dist/core/verified-bash-runtime.d.ts +40 -0
- package/dist/core/verified-bash-runtime.d.ts.map +1 -1
- package/dist/core/verified-bash-runtime.js +60 -13
- package/dist/core/verified-bash-runtime.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/docs/advisory-selection.md +112 -0
- package/docs/release-audit-0.98.3.md +97 -0
- package/docs/run-protocol.md +3 -1
- package/docs/runtime-algorithms.md +19 -2
- package/docs/sdk.md +24 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +18 -18
- package/package.json +6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Ac,EAAE,IAAI,CAAC,cAAc,EAAE;YACrC,QAAQ,EAAE,WAAW;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,GAAG,oBAAoB,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxG,IAAI,CAAC,IAAI;oBAAE,OAAO;gBAClB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACxB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAAA,CACtB;SACD,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7C,2EAA2E;QAC3E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QACjE,OAAO;YACN,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC;YAChF,SAAS;YACT,SAAS,EAAE,KAAK;SAChB,CAAC;IAAA,CACF;CACD","sourcesContent":["/**\n * Session bash runtime: verified-evidence executor, default sandbox preflight,\n * and git-aware workspace scope in one cohesive, lazily-initialized unit.\n *\n * Extracted from AgentSession so the session class stays a coordinator; every\n * default-on behavior here keeps its opt-out:\n * - `OMK_VERIFIED_BASH=0` disables the receipt-bound executor.\n * - OS sandbox enforcement and network isolation are enabled by default.\n * - `OMK_BASH_SANDBOX=audit` keeps only the ledger preflight; `=0` disables it.\n */\nimport { join } from \"node:path\";\nimport { EvidenceReceiptStore } from \"../guardrails/evidence-receipt-store.ts\";\nimport type { ReplayLedgerManager } from \"../guardrails/evidence-system.ts\";\nimport { VerifiedEvidenceExecutor } from \"../guardrails/verified-executor.ts\";\nimport type { ReplayEventType } from \"../types/evidence.ts\";\nimport { stripAnsi } from \"../utils/ansi.ts\";\nimport { getShellConfig, sanitizeBinaryOutput } from \"../utils/shell.ts\";\nimport type { BashResult } from \"./bash-executor.ts\";\nimport { detectSandboxBackend } from \"./sandbox/backend.ts\";\nimport { createWorkspaceSandboxPolicy, resolveBashSandboxMode } from \"./sandbox/default-policy.ts\";\nimport type { SandboxBackendStatus, SandboxMode } from \"./sandbox/policy.ts\";\nimport type { BashOperations, BashSandboxPreflight } from \"./tools/bash.ts\";\nimport { executeVerifiedBash } from \"./verified-bash-adapter.ts\";\nimport { isVerifiedBashEnabled, resolveSessionWorkspaceScope } from \"./verified-bash-runtime.ts\";\n\nexport interface SessionBashRuntimeOptions {\n\treadonly cwd: string;\n\t/** Actual execution cwd authority (session manager). */\n\treadonly getExecutionCwd: () => string;\n\t/** Session file anchor for the receipt store; undefined for ephemeral sessions. */\n\treadonly getSessionFile: () => string | undefined;\n\treadonly replayLedger: ReplayLedgerManager | undefined;\n\treadonly replayGoalId: string | undefined;\n\treadonly replayLaneId: string | undefined;\n\treadonly configuredSandboxPreflight: BashSandboxPreflight | undefined;\n\treadonly appendReplayEvent: (type: ReplayEventType, payload: unknown) => void;\n}\n\nexport class SessionBashRuntime {\n\tprivate verifiedExecutor: VerifiedEvidenceExecutor | undefined;\n\tprivate detectedBackend: SandboxBackendStatus | undefined;\n\tprivate defaultSandboxPreflight: BashSandboxPreflight | null | undefined;\n\tprivate sandboxModeOverride: SandboxMode | undefined;\n\tprivate readonly options: SessionBashRuntimeOptions;\n\n\tconstructor(options: SessionBashRuntimeOptions) {\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * Interactive promotion: switch the default sandbox mode at runtime\n\t * (audit ↔ enforce ↔ off) without restarting the session. `undefined`\n\t * restores env-based resolution.\n\t */\n\tsetSandboxMode(mode: SandboxMode | undefined): void {\n\t\tthis.sandboxModeOverride = mode;\n\t\tthis.defaultSandboxPreflight = undefined;\n\t}\n\n\tget sandboxMode(): SandboxMode {\n\t\treturn this.sandboxModeOverride ?? resolveBashSandboxMode();\n\t}\n\n\t/** Lazy receipt executor bound to the session replay ledger (default-on path). */\n\tverifiedEvidenceExecutor(): VerifiedEvidenceExecutor | undefined {\n\t\tconst { replayLedger, replayGoalId, getSessionFile, cwd } = this.options;\n\t\tif (!replayLedger || !replayGoalId || !isVerifiedBashEnabled()) return undefined;\n\t\tif (!this.verifiedExecutor) {\n\t\t\tconst sessionFile = getSessionFile();\n\t\t\tconst evidenceRoot = sessionFile\n\t\t\t\t? `${sessionFile}.evidence`\n\t\t\t\t: join(cwd, \".omk\", \"session-evidence\", replayGoalId);\n\t\t\tthis.verifiedExecutor = new VerifiedEvidenceExecutor({\n\t\t\t\tstore: new EvidenceReceiptStore(join(evidenceRoot, \"receipts\")),\n\t\t\t\tledger: replayLedger,\n\t\t\t});\n\t\t}\n\t\treturn this.verifiedExecutor;\n\t}\n\n\t/** Configured preflight wins; otherwise use the default enforce preflight. */\n\tsandboxPreflight(override?: BashSandboxPreflight): BashSandboxPreflight | undefined {\n\t\tconst preflight = override ?? this.options.configuredSandboxPreflight ?? this.getDefaultSandboxPreflight();\n\t\tif (!preflight || preflight.policy.mode === \"off\" || preflight.backend) {\n\t\t\treturn preflight;\n\t\t}\n\t\tthis.detectedBackend ??= detectSandboxBackend();\n\t\treturn { ...preflight, backend: this.detectedBackend };\n\t}\n\n\t/**\n\t * Default-on sandbox preflight. `enforce` wraps every local spawn with the\n\t * OS backend and fails closed when none is available. Explicit `audit` keeps\n\t * the spawn unwrapped but still reports decisions to the replay ledger.\n\t */\n\tprivate getDefaultSandboxPreflight(): BashSandboxPreflight | undefined {\n\t\tif (this.defaultSandboxPreflight !== undefined) {\n\t\t\treturn this.defaultSandboxPreflight ?? undefined;\n\t\t}\n\t\tconst mode = this.sandboxMode;\n\t\tif (mode === \"off\") {\n\t\t\tthis.defaultSandboxPreflight = null;\n\t\t\treturn undefined;\n\t\t}\n\t\tthis.detectedBackend ??= detectSandboxBackend();\n\t\tconst detected = this.detectedBackend;\n\t\tconst backend: SandboxBackendStatus =\n\t\t\tmode === \"enforce\"\n\t\t\t\t? detected\n\t\t\t\t: { platform: detected.platform, backendAvailable: false, domainAllowlistAvailable: false };\n\t\t// Root must cover the actual execution cwd (session manager), not just the\n\t\t// session workspace: in-memory or RPC sessions can legitimately differ.\n\t\tconst policy = createWorkspaceSandboxPolicy(this.options.getExecutionCwd() || this.options.cwd, mode);\n\t\tthis.defaultSandboxPreflight = {\n\t\t\tpolicy,\n\t\t\tbackend,\n\t\t\tonSpawnDecision: (decision) => {\n\t\t\t\tif (decision.rule === \"sandbox.off\") return;\n\t\t\t\tthis.options.appendReplayEvent(\"sandbox_audit\", {\n\t\t\t\t\tmode,\n\t\t\t\t\trule: decision.rule,\n\t\t\t\t\treason: decision.reason,\n\t\t\t\t\twrapped: \"wrapped\" in decision ? decision.wrapped : false,\n\t\t\t\t\tbackendAvailable: backend.backendAvailable,\n\t\t\t\t\tplatform: backend.platform,\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t\treturn this.defaultSandboxPreflight;\n\t}\n\n\t/** Git-aware workspace scope for verified bash receipts (TTL-cached). */\n\tworkspaceScope() {\n\t\treturn resolveSessionWorkspaceScope(this.options.cwd);\n\t}\n\n\tget goalId(): string | undefined {\n\t\treturn this.options.replayGoalId;\n\t}\n\n\tget laneId(): string | undefined {\n\t\treturn this.options.replayLaneId;\n\t}\n\n\t/**\n\t * Receipt-bound bash execution. Returns `undefined` when the verified path\n\t * is unavailable (no ledger / opted out) so the caller falls back to the\n\t * legacy executor. Streams sanitized text through `onChunk` while the\n\t * adapter owns the raw receipt bytes.\n\t */\n\tasync executeVerified(request: {\n\t\tresolvedCommand: string;\n\t\tcwd: string;\n\t\tshellPath: string | undefined;\n\t\toperations: BashOperations;\n\t\tsignal: AbortSignal;\n\t\tonChunk: (delta: string) => void;\n\t}): Promise<BashResult | undefined> {\n\t\tconst evidenceExecutor = this.verifiedEvidenceExecutor();\n\t\tconst goalId = this.options.replayGoalId;\n\t\tif (!evidenceExecutor || !goalId) return undefined;\n\t\tconst { shell } = getShellConfig(request.shellPath);\n\t\tconst command = request.resolvedCommand;\n\t\tconst claim = command.length > 200 ? `bash: ${command.slice(0, 197)}...` : `bash: ${command}`;\n\t\tconst outputChunks: string[] = [];\n\t\tconst decoder = new TextDecoder();\n\t\tconst execution = await executeVerifiedBash({\n\t\t\tevidenceExecutor,\n\t\t\toperations: request.operations,\n\t\t\tgoalId,\n\t\t\t...(this.options.replayLaneId !== undefined ? { laneId: this.options.replayLaneId } : {}),\n\t\t\tclaim,\n\t\t\tshell,\n\t\t\tscript: command,\n\t\t\tcwd: request.cwd,\n\t\t\ttimeoutMs: null,\n\t\t\tworkspaceScope: this.workspaceScope(),\n\t\t\texecutor: \"bash-tool\",\n\t\t\tsignal: request.signal,\n\t\t\tonData: (data) => {\n\t\t\t\tconst text = sanitizeBinaryOutput(stripAnsi(decoder.decode(data, { stream: true }))).replace(/\\r/g, \"\");\n\t\t\t\tif (!text) return;\n\t\t\t\toutputChunks.push(text);\n\t\t\t\trequest.onChunk(text);\n\t\t\t},\n\t\t});\n\t\tconst status = execution.receipt.core.status;\n\t\t// Preserve pre-adapter timeout throw semantics after the receipt is bound.\n\t\tif (status === \"timeout\") {\n\t\t\tthrow new Error(\"timeout:0\");\n\t\t}\n\t\tconst cancelled = status === \"aborted\" || request.signal.aborted;\n\t\treturn {\n\t\t\toutput: outputChunks.join(\"\"),\n\t\t\texitCode: cancelled ? undefined : (execution.receipt.core.exitCode ?? undefined),\n\t\t\tcancelled,\n\t\t\ttruncated: false,\n\t\t};\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"session-bash-runtime.js","sourceRoot":"","sources":["../../src/core/session-bash-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGnG,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,kCAAkC,GAClC,MAAM,4BAA4B,CAAC;AAepC,MAAM,OAAO,kBAAkB;IACtB,gBAAgB,CAAuC;IACvD,eAAe,CAAmC;IAClD,uBAAuB,CAA0C;IACjE,mBAAmB,CAA0B;IACpC,OAAO,CAA4B;IAEpD,YAAY,OAAkC,EAAE;QAC/C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAAA,CACvB;IAED;;;;OAIG;IACH,cAAc,CAAC,IAA6B,EAAQ;QACnD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC;IAAA,CACzC;IAED,IAAI,WAAW,GAAgB;QAC9B,OAAO,IAAI,CAAC,mBAAmB,IAAI,sBAAsB,EAAE,CAAC;IAAA,CAC5D;IAED,kFAAkF;IAClF,wBAAwB,GAAyC;QAChE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG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,CAAC,CAAC,EAAE,CAAC;YACzF,KAAK;YACL,KAAK;YACL,MAAM,EAAE,OAAO;YACf,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,SAAS,EAAE,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE;YACrC,QAAQ,EAAE,WAAW;YACrB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,GAAG,oBAAoB,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACxG,IAAI,CAAC,IAAI;oBAAE,OAAO;gBAClB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACxB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAAA,CACtB;SACD,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7C,2EAA2E;QAC3E,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC;QAC9B,CAAC;QACD,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QACjE,OAAO;YACN,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7B,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC;YAChF,SAAS;YACT,SAAS,EAAE,KAAK;SAChB,CAAC;IAAA,CACF;CACD","sourcesContent":["/**\n * Session bash runtime: verified-evidence executor, default sandbox preflight,\n * and git-aware workspace scope in one cohesive, lazily-initialized unit.\n *\n * Extracted from AgentSession so the session class stays a coordinator; every\n * default-on behavior here keeps its opt-out:\n * - `OMK_VERIFIED_BASH=0` disables the receipt-bound executor.\n * - OS sandbox enforcement and network isolation are enabled by default.\n * - `OMK_BASH_SANDBOX=audit` keeps only the ledger preflight; `=0` disables it.\n */\nimport { join } from \"node:path\";\nimport { EvidenceReceiptStore } from \"../guardrails/evidence-receipt-store.ts\";\nimport type { ReplayLedgerManager } from \"../guardrails/evidence-system.ts\";\nimport { VerifiedEvidenceExecutor } from \"../guardrails/verified-executor.ts\";\nimport type { ReplayEventType } from \"../types/evidence.ts\";\nimport { stripAnsi } from \"../utils/ansi.ts\";\nimport { getShellConfig, sanitizeBinaryOutput } from \"../utils/shell.ts\";\nimport type { BashResult } from \"./bash-executor.ts\";\nimport { detectSandboxBackend } from \"./sandbox/backend.ts\";\nimport { createWorkspaceSandboxPolicy, resolveBashSandboxMode } from \"./sandbox/default-policy.ts\";\nimport type { SandboxBackendStatus, SandboxMode } from \"./sandbox/policy.ts\";\nimport type { BashOperations, BashSandboxPreflight } from \"./tools/bash.ts\";\nimport { executeVerifiedBash } from \"./verified-bash-adapter.ts\";\nimport {\n\tisVerifiedBashEnabled,\n\tresolveSessionWorkspaceScope,\n\tresolveSessionWorkspaceScopeReport,\n} from \"./verified-bash-runtime.ts\";\n\nexport interface SessionBashRuntimeOptions {\n\treadonly cwd: string;\n\t/** Actual execution cwd authority (session manager). */\n\treadonly getExecutionCwd: () => string;\n\t/** Session file anchor for the receipt store; undefined for ephemeral sessions. */\n\treadonly getSessionFile: () => string | undefined;\n\treadonly replayLedger: ReplayLedgerManager | undefined;\n\treadonly replayGoalId: string | undefined;\n\treadonly replayLaneId: string | undefined;\n\treadonly configuredSandboxPreflight: BashSandboxPreflight | undefined;\n\treadonly appendReplayEvent: (type: ReplayEventType, payload: unknown) => void;\n}\n\nexport class SessionBashRuntime {\n\tprivate verifiedExecutor: VerifiedEvidenceExecutor | undefined;\n\tprivate detectedBackend: SandboxBackendStatus | undefined;\n\tprivate defaultSandboxPreflight: BashSandboxPreflight | null | undefined;\n\tprivate sandboxModeOverride: SandboxMode | undefined;\n\tprivate readonly options: SessionBashRuntimeOptions;\n\n\tconstructor(options: SessionBashRuntimeOptions) {\n\t\tthis.options = options;\n\t}\n\n\t/**\n\t * Interactive promotion: switch the default sandbox mode at runtime\n\t * (audit ↔ enforce ↔ off) without restarting the session. `undefined`\n\t * restores env-based resolution.\n\t */\n\tsetSandboxMode(mode: SandboxMode | undefined): void {\n\t\tthis.sandboxModeOverride = mode;\n\t\tthis.defaultSandboxPreflight = undefined;\n\t}\n\n\tget sandboxMode(): SandboxMode {\n\t\treturn this.sandboxModeOverride ?? resolveBashSandboxMode();\n\t}\n\n\t/** Lazy receipt executor bound to the session replay ledger (default-on path). */\n\tverifiedEvidenceExecutor(): VerifiedEvidenceExecutor | undefined {\n\t\tconst { replayLedger, replayGoalId, getSessionFile, cwd } = this.options;\n\t\tif (!replayLedger || !replayGoalId || !isVerifiedBashEnabled()) return undefined;\n\t\tif (!this.verifiedExecutor) {\n\t\t\tconst sessionFile = getSessionFile();\n\t\t\tconst evidenceRoot = sessionFile\n\t\t\t\t? `${sessionFile}.evidence`\n\t\t\t\t: join(cwd, \".omk\", \"session-evidence\", replayGoalId);\n\t\t\tthis.verifiedExecutor = new VerifiedEvidenceExecutor({\n\t\t\t\tstore: new EvidenceReceiptStore(join(evidenceRoot, \"receipts\")),\n\t\t\t\tledger: replayLedger,\n\t\t\t});\n\t\t}\n\t\treturn this.verifiedExecutor;\n\t}\n\n\t/** Configured preflight wins; otherwise use the default enforce preflight. */\n\tsandboxPreflight(override?: BashSandboxPreflight): BashSandboxPreflight | undefined {\n\t\tconst preflight = override ?? this.options.configuredSandboxPreflight ?? this.getDefaultSandboxPreflight();\n\t\tif (!preflight || preflight.policy.mode === \"off\" || preflight.backend) {\n\t\t\treturn preflight;\n\t\t}\n\t\tthis.detectedBackend ??= detectSandboxBackend();\n\t\treturn { ...preflight, backend: this.detectedBackend };\n\t}\n\n\t/**\n\t * Default-on sandbox preflight. `enforce` wraps every local spawn with the\n\t * OS backend and fails closed when none is available. Explicit `audit` keeps\n\t * the spawn unwrapped but still reports decisions to the replay ledger.\n\t */\n\tprivate getDefaultSandboxPreflight(): BashSandboxPreflight | undefined {\n\t\tif (this.defaultSandboxPreflight !== undefined) {\n\t\t\treturn this.defaultSandboxPreflight ?? undefined;\n\t\t}\n\t\tconst mode = this.sandboxMode;\n\t\tif (mode === \"off\") {\n\t\t\tthis.defaultSandboxPreflight = null;\n\t\t\treturn undefined;\n\t\t}\n\t\tthis.detectedBackend ??= detectSandboxBackend();\n\t\tconst detected = this.detectedBackend;\n\t\tconst backend: SandboxBackendStatus =\n\t\t\tmode === \"enforce\"\n\t\t\t\t? detected\n\t\t\t\t: { platform: detected.platform, backendAvailable: false, domainAllowlistAvailable: false };\n\t\t// Root must cover the actual execution cwd (session manager), not just the\n\t\t// session workspace: in-memory or RPC sessions can legitimately differ.\n\t\tconst policy = createWorkspaceSandboxPolicy(this.options.getExecutionCwd() || this.options.cwd, mode);\n\t\tthis.defaultSandboxPreflight = {\n\t\t\tpolicy,\n\t\t\tbackend,\n\t\t\tonSpawnDecision: (decision) => {\n\t\t\t\tif (decision.rule === \"sandbox.off\") return;\n\t\t\t\tthis.options.appendReplayEvent(\"sandbox_audit\", {\n\t\t\t\t\tmode,\n\t\t\t\t\trule: decision.rule,\n\t\t\t\t\treason: decision.reason,\n\t\t\t\t\twrapped: \"wrapped\" in decision ? decision.wrapped : false,\n\t\t\t\t\tbackendAvailable: backend.backendAvailable,\n\t\t\t\t\tplatform: backend.platform,\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t\treturn this.defaultSandboxPreflight;\n\t}\n\n\t/** Git-aware workspace scope for verified bash receipts (TTL-cached). */\n\tworkspaceScope() {\n\t\treturn resolveSessionWorkspaceScope(this.options.cwd);\n\t}\n\n\t/**\n\t * The same scope plus what it could not bind. A receipt captured from a\n\t * `partial_truncated` or `partial_excluded` scope proves only its selected\n\t * paths, so a caller that presents a receipt as workspace-wide evidence must\n\t * read this first.\n\t */\n\tworkspaceScopeReport() {\n\t\treturn resolveSessionWorkspaceScopeReport(this.options.cwd);\n\t}\n\n\tget goalId(): string | undefined {\n\t\treturn this.options.replayGoalId;\n\t}\n\n\tget laneId(): string | undefined {\n\t\treturn this.options.replayLaneId;\n\t}\n\n\t/**\n\t * Receipt-bound bash execution. Returns `undefined` when the verified path\n\t * is unavailable (no ledger / opted out) so the caller falls back to the\n\t * legacy executor. Streams sanitized text through `onChunk` while the\n\t * adapter owns the raw receipt bytes.\n\t */\n\tasync executeVerified(request: {\n\t\tresolvedCommand: string;\n\t\tcwd: string;\n\t\tshellPath: string | undefined;\n\t\toperations: BashOperations;\n\t\tsignal: AbortSignal;\n\t\tonChunk: (delta: string) => void;\n\t}): Promise<BashResult | undefined> {\n\t\tconst evidenceExecutor = this.verifiedEvidenceExecutor();\n\t\tconst goalId = this.options.replayGoalId;\n\t\tif (!evidenceExecutor || !goalId) return undefined;\n\t\tconst { shell } = getShellConfig(request.shellPath);\n\t\tconst command = request.resolvedCommand;\n\t\tconst claim = command.length > 200 ? `bash: ${command.slice(0, 197)}...` : `bash: ${command}`;\n\t\tconst outputChunks: string[] = [];\n\t\tconst decoder = new TextDecoder();\n\t\tconst execution = await executeVerifiedBash({\n\t\t\tevidenceExecutor,\n\t\t\toperations: request.operations,\n\t\t\tgoalId,\n\t\t\t...(this.options.replayLaneId !== undefined ? { laneId: this.options.replayLaneId } : {}),\n\t\t\tclaim,\n\t\t\tshell,\n\t\t\tscript: command,\n\t\t\tcwd: request.cwd,\n\t\t\ttimeoutMs: null,\n\t\t\tworkspaceScope: this.workspaceScope(),\n\t\t\texecutor: \"bash-tool\",\n\t\t\tsignal: request.signal,\n\t\t\tonData: (data) => {\n\t\t\t\tconst text = sanitizeBinaryOutput(stripAnsi(decoder.decode(data, { stream: true }))).replace(/\\r/g, \"\");\n\t\t\t\tif (!text) return;\n\t\t\t\toutputChunks.push(text);\n\t\t\t\trequest.onChunk(text);\n\t\t\t},\n\t\t});\n\t\tconst status = execution.receipt.core.status;\n\t\t// Preserve pre-adapter timeout throw semantics after the receipt is bound.\n\t\tif (status === \"timeout\") {\n\t\t\tthrow new Error(\"timeout:0\");\n\t\t}\n\t\tconst cancelled = status === \"aborted\" || request.signal.aborted;\n\t\treturn {\n\t\t\toutput: outputChunks.join(\"\"),\n\t\t\texitCode: cancelled ? undefined : (execution.receipt.core.exitCode ?? undefined),\n\t\t\tcancelled,\n\t\t\ttruncated: false,\n\t\t};\n\t}\n}\n"]}
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import type { WorkspaceScope } from "../types/evidence.ts";
|
|
2
2
|
export declare function isVerifiedBashEnabled(env?: Record<string, string | undefined>): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Why a session scope is not a complete view of the workspace dirty set.
|
|
5
|
+
*
|
|
6
|
+
* `unavailable` is not `complete`: outside a worktree, or when git cannot be
|
|
7
|
+
* read, nothing was enumerated, so an empty artifact set is an absence of
|
|
8
|
+
* evidence rather than evidence of a clean tree.
|
|
9
|
+
*/
|
|
10
|
+
export type SessionScopeCompleteness = "complete" | "partial_truncated" | "partial_excluded" | "unavailable";
|
|
11
|
+
/**
|
|
12
|
+
* A session scope plus what it could not bind.
|
|
13
|
+
*
|
|
14
|
+
* The scope drops dirty paths two ways — a hard cap for availability, and the
|
|
15
|
+
* normalized-path filter the receipt parser forces — and both were previously
|
|
16
|
+
* silent, so a receipt built on a partial view read exactly like one that saw
|
|
17
|
+
* the whole workspace. Dropping stays deliberate; hiding it was the defect.
|
|
18
|
+
*/
|
|
19
|
+
export interface SessionWorkspaceScopeReport {
|
|
20
|
+
readonly scope: WorkspaceScope;
|
|
21
|
+
/** Unique dirty entries git reported, before the cap and the path filter. */
|
|
22
|
+
readonly totalDirtyPathCount: number;
|
|
23
|
+
/** Entries the scope binds: always `scope.artifactPaths.length`. */
|
|
24
|
+
readonly selectedPathCount: number;
|
|
25
|
+
/** Unique dirty entries no receipt can bind, such as a name carrying a backslash. */
|
|
26
|
+
readonly excludedPathCount: number;
|
|
27
|
+
/** True when the cap, not the filter, kept an eligible path out of the scope. */
|
|
28
|
+
readonly truncated: boolean;
|
|
29
|
+
readonly completeness: SessionScopeCompleteness;
|
|
30
|
+
/** Digest of the sorted excluded set, so two different losses are distinguishable. Absent when nothing was excluded. */
|
|
31
|
+
readonly excludedPathSetSha256?: string;
|
|
32
|
+
}
|
|
3
33
|
/**
|
|
4
34
|
* Workspace scope for session bash receipts. Inside a git worktree the scope
|
|
5
35
|
* root is the toplevel and `artifactPaths` is the current dirty set (staged,
|
|
@@ -10,4 +40,14 @@ export declare function isVerifiedBashEnabled(env?: Record<string, string | unde
|
|
|
10
40
|
export declare function resolveSessionWorkspaceScope(cwd: string, options?: {
|
|
11
41
|
maxPaths?: number;
|
|
12
42
|
}): WorkspaceScope;
|
|
43
|
+
/**
|
|
44
|
+
* The scope a receipt would bind, together with the completeness facts that say
|
|
45
|
+
* whether binding it proves anything about the whole workspace.
|
|
46
|
+
*
|
|
47
|
+
* Cached per `(cwd, maxPaths)` for {@link SCOPE_TTL_MS}: keying the cap in too
|
|
48
|
+
* keeps a capped probe from serving a later full request a truncated answer.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveSessionWorkspaceScopeReport(cwd: string, options?: {
|
|
51
|
+
maxPaths?: number;
|
|
52
|
+
}): SessionWorkspaceScopeReport;
|
|
13
53
|
//# sourceMappingURL=verified-bash-runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verified-bash-runtime.d.ts","sourceRoot":"","sources":["../../src/core/verified-bash-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verified-bash-runtime.d.ts","sourceRoot":"","sources":["../../src/core/verified-bash-runtime.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,wBAAgB,qBAAqB,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,OAAO,CAGvF;AAeD;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,aAAa,CAAC;AAE7G;;;;;;;GAOG;AACH,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,oEAAoE;IACpE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,qFAAqF;IACrF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,wBAAwB,CAAC;IAChD,wHAAwH;IACxH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,CAEzG;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CACjD,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7B,2BAA2B,CAY7B","sourcesContent":["/**\n * Default-on gate for the verified bash adapter (opt-out via OMK_VERIFIED_BASH=0).\n *\n * Mirrors ADR-OMP-009: the receipt-bound path is the default experience; the\n * exact legacy unverified path remains available as a byte-identical rollback.\n */\nimport { spawnSync } from \"node:child_process\";\nimport { createHash } from \"node:crypto\";\nimport { isNormalizedArtifactPath } from \"../guardrails/workspace-fingerprint.ts\";\nimport type { WorkspaceScope } from \"../types/evidence.ts\";\n\nexport function isVerifiedBashEnabled(env?: Record<string, string | undefined>): boolean {\n\tconst source: Record<string, string | undefined> = env ?? process.env;\n\treturn source.OMK_VERIFIED_BASH !== \"0\";\n}\n\n// ---------------------------------------------------------------------------\n// Git-aware session workspace scope (bounded, TTL-cached)\n// ---------------------------------------------------------------------------\n\nconst SCOPE_TTL_MS = 1_000;\nconst SCOPE_CACHE_MAX = 8;\nconst SCOPE_MAX_PATHS = 32;\nconst GIT_TIMEOUT_MS = 1_500;\n/** Domain separator so an excluded-set digest can never collide with another digest. */\nconst EXCLUDED_SET_DOMAIN = \"omk:evidence:session-scope-excluded:v1\\0\";\n\nconst scopeCache = new Map<string, { at: number; report: SessionWorkspaceScopeReport }>();\n\n/**\n * Why a session scope is not a complete view of the workspace dirty set.\n *\n * `unavailable` is not `complete`: outside a worktree, or when git cannot be\n * read, nothing was enumerated, so an empty artifact set is an absence of\n * evidence rather than evidence of a clean tree.\n */\nexport type SessionScopeCompleteness = \"complete\" | \"partial_truncated\" | \"partial_excluded\" | \"unavailable\";\n\n/**\n * A session scope plus what it could not bind.\n *\n * The scope drops dirty paths two ways — a hard cap for availability, and the\n * normalized-path filter the receipt parser forces — and both were previously\n * silent, so a receipt built on a partial view read exactly like one that saw\n * the whole workspace. Dropping stays deliberate; hiding it was the defect.\n */\nexport interface SessionWorkspaceScopeReport {\n\treadonly scope: WorkspaceScope;\n\t/** Unique dirty entries git reported, before the cap and the path filter. */\n\treadonly totalDirtyPathCount: number;\n\t/** Entries the scope binds: always `scope.artifactPaths.length`. */\n\treadonly selectedPathCount: number;\n\t/** Unique dirty entries no receipt can bind, such as a name carrying a backslash. */\n\treadonly excludedPathCount: number;\n\t/** True when the cap, not the filter, kept an eligible path out of the scope. */\n\treadonly truncated: boolean;\n\treadonly completeness: SessionScopeCompleteness;\n\t/** Digest of the sorted excluded set, so two different losses are distinguishable. Absent when nothing was excluded. */\n\treadonly excludedPathSetSha256?: string;\n}\n\n/**\n * Workspace scope for session bash receipts. Inside a git worktree the scope\n * root is the toplevel and `artifactPaths` is the current dirty set (staged,\n * modified, untracked; capped and sorted), which lets `captureWorkspaceFingerprint`\n * bind HEAD plus a scope-limited dirty digest. Outside git, falls back to an\n * empty artifact set under `cwd`. Never throws.\n */\nexport function resolveSessionWorkspaceScope(cwd: string, options?: { maxPaths?: number }): WorkspaceScope {\n\treturn resolveSessionWorkspaceScopeReport(cwd, options).scope;\n}\n\n/**\n * The scope a receipt would bind, together with the completeness facts that say\n * whether binding it proves anything about the whole workspace.\n *\n * Cached per `(cwd, maxPaths)` for {@link SCOPE_TTL_MS}: keying the cap in too\n * keeps a capped probe from serving a later full request a truncated answer.\n */\nexport function resolveSessionWorkspaceScopeReport(\n\tcwd: string,\n\toptions?: { maxPaths?: number },\n): SessionWorkspaceScopeReport {\n\tconst maxPaths = options?.maxPaths ?? SCOPE_MAX_PATHS;\n\tconst key = `${maxPaths}\\0${cwd}`;\n\tconst cached = scopeCache.get(key);\n\tif (cached && Date.now() - cached.at < SCOPE_TTL_MS) return cached.report;\n\tconst report = computeSessionWorkspaceScope(cwd, maxPaths);\n\tif (scopeCache.size >= SCOPE_CACHE_MAX) {\n\t\tconst oldest = scopeCache.keys().next().value;\n\t\tif (oldest !== undefined) scopeCache.delete(oldest);\n\t}\n\tscopeCache.set(key, { at: Date.now(), report });\n\treturn report;\n}\n\n/** Nothing was enumerated, so the empty artifact set proves nothing about the tree. */\nfunction unavailableScope(root: string): SessionWorkspaceScopeReport {\n\treturn {\n\t\tscope: { root, artifactPaths: [] },\n\t\ttotalDirtyPathCount: 0,\n\t\tselectedPathCount: 0,\n\t\texcludedPathCount: 0,\n\t\ttruncated: false,\n\t\tcompleteness: \"unavailable\",\n\t};\n}\n\nfunction computeSessionWorkspaceScope(cwd: string, maxPaths: number): SessionWorkspaceScopeReport {\n\ttry {\n\t\tconst top = spawnSync(\"git\", [\"-C\", cwd, \"rev-parse\", \"--show-toplevel\"], {\n\t\t\tencoding: \"utf8\",\n\t\t\ttimeout: GIT_TIMEOUT_MS,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\tif (top.status !== 0 || typeof top.stdout !== \"string\") return unavailableScope(cwd);\n\t\tconst root = top.stdout.trim();\n\t\tif (root.length === 0) return unavailableScope(cwd);\n\t\t// File-granular untracked listing: -unormal emits untracked directories as\n\t\t// `dir/`, whose trailing slash fails assertNormalizedArtifactPath downstream\n\t\t// and kills every verified bash call in the session.\n\t\tconst status = spawnSync(\"git\", [\"-C\", cwd, \"status\", \"--porcelain=v1\", \"-z\", \"--untracked-files=all\"], {\n\t\t\ttimeout: GIT_TIMEOUT_MS,\n\t\t\tmaxBuffer: 4 * 1024 * 1024,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\tif (status.status !== 0 || !status.stdout) return unavailableScope(root);\n\t\tconst fields = status.stdout.toString(\"utf8\").split(\"\\0\");\n\t\tconst paths = new Set<string>();\n\t\tconst excluded = new Set<string>();\n\t\tfor (let index = 0; index < fields.length; index++) {\n\t\t\tconst field = fields[index];\n\t\t\tif (field.length < 4) continue;\n\t\t\tconst xy = field.slice(0, 2);\n\t\t\tif (xy === \"!!\") continue;\n\t\t\tif (xy.includes(\"R\") || xy.includes(\"C\")) index++; // rename/copy: consume the source path field too\n\t\t\tconst artifact = field.slice(3);\n\t\t\t// Keep only entries the fingerprint can bind. This drops trailing-slash\n\t\t\t// survivors (untracked nested repositories, whose contents are outside\n\t\t\t// the parent's dirty digest) and names the receipt parser rejects, such\n\t\t\t// as a mangled `\\\\wsl.localhost\\...` directory containing a backslash.\n\t\t\tif (isNormalizedArtifactPath(artifact)) paths.add(artifact);\n\t\t\telse excluded.add(artifact);\n\t\t}\n\t\tconst eligible = [...paths].sort();\n\t\tconst artifactPaths = eligible.slice(0, maxPaths);\n\t\tconst truncated = artifactPaths.length < eligible.length;\n\t\treturn {\n\t\t\tscope: { root, artifactPaths },\n\t\t\ttotalDirtyPathCount: eligible.length + excluded.size,\n\t\t\tselectedPathCount: artifactPaths.length,\n\t\t\texcludedPathCount: excluded.size,\n\t\t\ttruncated,\n\t\t\t// Truncation outranks exclusion: an excluded path is named by the digest\n\t\t\t// below, a capped one is an unbounded unknown.\n\t\t\tcompleteness: truncated ? \"partial_truncated\" : excluded.size > 0 ? \"partial_excluded\" : \"complete\",\n\t\t\t...(excluded.size === 0\n\t\t\t\t? {}\n\t\t\t\t: {\n\t\t\t\t\t\texcludedPathSetSha256: createHash(\"sha256\")\n\t\t\t\t\t\t\t.update(`${EXCLUDED_SET_DOMAIN}${JSON.stringify([...excluded].sort())}`)\n\t\t\t\t\t\t\t.digest(\"hex\"),\n\t\t\t\t\t}),\n\t\t};\n\t} catch {\n\t\treturn unavailableScope(cwd);\n\t}\n}\n"]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* exact legacy unverified path remains available as a byte-identical rollback.
|
|
6
6
|
*/
|
|
7
7
|
import { spawnSync } from "node:child_process";
|
|
8
|
+
import { createHash } from "node:crypto";
|
|
8
9
|
import { isNormalizedArtifactPath } from "../guardrails/workspace-fingerprint.js";
|
|
9
10
|
export function isVerifiedBashEnabled(env) {
|
|
10
11
|
const source = env ?? process.env;
|
|
@@ -17,6 +18,8 @@ const SCOPE_TTL_MS = 1_000;
|
|
|
17
18
|
const SCOPE_CACHE_MAX = 8;
|
|
18
19
|
const SCOPE_MAX_PATHS = 32;
|
|
19
20
|
const GIT_TIMEOUT_MS = 1_500;
|
|
21
|
+
/** Domain separator so an excluded-set digest can never collide with another digest. */
|
|
22
|
+
const EXCLUDED_SET_DOMAIN = "omk:evidence:session-scope-excluded:v1\0";
|
|
20
23
|
const scopeCache = new Map();
|
|
21
24
|
/**
|
|
22
25
|
* Workspace scope for session bash receipts. Inside a git worktree the scope
|
|
@@ -26,17 +29,40 @@ const scopeCache = new Map();
|
|
|
26
29
|
* empty artifact set under `cwd`. Never throws.
|
|
27
30
|
*/
|
|
28
31
|
export function resolveSessionWorkspaceScope(cwd, options) {
|
|
29
|
-
|
|
32
|
+
return resolveSessionWorkspaceScopeReport(cwd, options).scope;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The scope a receipt would bind, together with the completeness facts that say
|
|
36
|
+
* whether binding it proves anything about the whole workspace.
|
|
37
|
+
*
|
|
38
|
+
* Cached per `(cwd, maxPaths)` for {@link SCOPE_TTL_MS}: keying the cap in too
|
|
39
|
+
* keeps a capped probe from serving a later full request a truncated answer.
|
|
40
|
+
*/
|
|
41
|
+
export function resolveSessionWorkspaceScopeReport(cwd, options) {
|
|
42
|
+
const maxPaths = options?.maxPaths ?? SCOPE_MAX_PATHS;
|
|
43
|
+
const key = `${maxPaths}\0${cwd}`;
|
|
44
|
+
const cached = scopeCache.get(key);
|
|
30
45
|
if (cached && Date.now() - cached.at < SCOPE_TTL_MS)
|
|
31
|
-
return cached.
|
|
32
|
-
const
|
|
46
|
+
return cached.report;
|
|
47
|
+
const report = computeSessionWorkspaceScope(cwd, maxPaths);
|
|
33
48
|
if (scopeCache.size >= SCOPE_CACHE_MAX) {
|
|
34
49
|
const oldest = scopeCache.keys().next().value;
|
|
35
50
|
if (oldest !== undefined)
|
|
36
51
|
scopeCache.delete(oldest);
|
|
37
52
|
}
|
|
38
|
-
scopeCache.set(
|
|
39
|
-
return
|
|
53
|
+
scopeCache.set(key, { at: Date.now(), report });
|
|
54
|
+
return report;
|
|
55
|
+
}
|
|
56
|
+
/** Nothing was enumerated, so the empty artifact set proves nothing about the tree. */
|
|
57
|
+
function unavailableScope(root) {
|
|
58
|
+
return {
|
|
59
|
+
scope: { root, artifactPaths: [] },
|
|
60
|
+
totalDirtyPathCount: 0,
|
|
61
|
+
selectedPathCount: 0,
|
|
62
|
+
excludedPathCount: 0,
|
|
63
|
+
truncated: false,
|
|
64
|
+
completeness: "unavailable",
|
|
65
|
+
};
|
|
40
66
|
}
|
|
41
67
|
function computeSessionWorkspaceScope(cwd, maxPaths) {
|
|
42
68
|
try {
|
|
@@ -46,10 +72,10 @@ function computeSessionWorkspaceScope(cwd, maxPaths) {
|
|
|
46
72
|
stdio: ["ignore", "pipe", "ignore"],
|
|
47
73
|
});
|
|
48
74
|
if (top.status !== 0 || typeof top.stdout !== "string")
|
|
49
|
-
return
|
|
75
|
+
return unavailableScope(cwd);
|
|
50
76
|
const root = top.stdout.trim();
|
|
51
77
|
if (root.length === 0)
|
|
52
|
-
return
|
|
78
|
+
return unavailableScope(cwd);
|
|
53
79
|
// File-granular untracked listing: -unormal emits untracked directories as
|
|
54
80
|
// `dir/`, whose trailing slash fails assertNormalizedArtifactPath downstream
|
|
55
81
|
// and kills every verified bash call in the session.
|
|
@@ -59,9 +85,10 @@ function computeSessionWorkspaceScope(cwd, maxPaths) {
|
|
|
59
85
|
stdio: ["ignore", "pipe", "ignore"],
|
|
60
86
|
});
|
|
61
87
|
if (status.status !== 0 || !status.stdout)
|
|
62
|
-
return
|
|
88
|
+
return unavailableScope(root);
|
|
63
89
|
const fields = status.stdout.toString("utf8").split("\0");
|
|
64
|
-
const paths =
|
|
90
|
+
const paths = new Set();
|
|
91
|
+
const excluded = new Set();
|
|
65
92
|
for (let index = 0; index < fields.length; index++) {
|
|
66
93
|
const field = fields[index];
|
|
67
94
|
if (field.length < 4)
|
|
@@ -77,13 +104,33 @@ function computeSessionWorkspaceScope(cwd, maxPaths) {
|
|
|
77
104
|
// the parent's dirty digest) and names the receipt parser rejects, such
|
|
78
105
|
// as a mangled `\\wsl.localhost\...` directory containing a backslash.
|
|
79
106
|
if (isNormalizedArtifactPath(artifact))
|
|
80
|
-
paths.
|
|
107
|
+
paths.add(artifact);
|
|
108
|
+
else
|
|
109
|
+
excluded.add(artifact);
|
|
81
110
|
}
|
|
82
|
-
const
|
|
83
|
-
|
|
111
|
+
const eligible = [...paths].sort();
|
|
112
|
+
const artifactPaths = eligible.slice(0, maxPaths);
|
|
113
|
+
const truncated = artifactPaths.length < eligible.length;
|
|
114
|
+
return {
|
|
115
|
+
scope: { root, artifactPaths },
|
|
116
|
+
totalDirtyPathCount: eligible.length + excluded.size,
|
|
117
|
+
selectedPathCount: artifactPaths.length,
|
|
118
|
+
excludedPathCount: excluded.size,
|
|
119
|
+
truncated,
|
|
120
|
+
// Truncation outranks exclusion: an excluded path is named by the digest
|
|
121
|
+
// below, a capped one is an unbounded unknown.
|
|
122
|
+
completeness: truncated ? "partial_truncated" : excluded.size > 0 ? "partial_excluded" : "complete",
|
|
123
|
+
...(excluded.size === 0
|
|
124
|
+
? {}
|
|
125
|
+
: {
|
|
126
|
+
excludedPathSetSha256: createHash("sha256")
|
|
127
|
+
.update(`${EXCLUDED_SET_DOMAIN}${JSON.stringify([...excluded].sort())}`)
|
|
128
|
+
.digest("hex"),
|
|
129
|
+
}),
|
|
130
|
+
};
|
|
84
131
|
}
|
|
85
132
|
catch {
|
|
86
|
-
return
|
|
133
|
+
return unavailableScope(cwd);
|
|
87
134
|
}
|
|
88
135
|
}
|
|
89
136
|
//# sourceMappingURL=verified-bash-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verified-bash-runtime.js","sourceRoot":"","sources":["../../src/core/verified-bash-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAGlF,MAAM,UAAU,qBAAqB,CAAC,GAAwC,EAAW;IACxF,MAAM,MAAM,GAAuC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACtE,OAAO,MAAM,CAAC,iBAAiB,KAAK,GAAG,CAAC;AAAA,CACxC;AAED,8EAA8E;AAC9E,0DAA0D;AAC1D,8EAA8E;AAE9E,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,cAAc,GAA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EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,KAAK,EAAE,CAAC,CAAC,iDAAiD;YACpG,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAChC,wEAAwE;YACxE,uEAAuE;YACvE,wEAAwE;YACxE,uEAAuE;YACvE,IAAI,wBAAwB,CAAC,QAAQ,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9D,CAAC;QACD,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;QACpE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC;IACzC,CAAC;AAAA,CACD","sourcesContent":["/**\n * Default-on gate for the verified bash adapter (opt-out via OMK_VERIFIED_BASH=0).\n *\n * Mirrors ADR-OMP-009: the receipt-bound path is the default experience; the\n * exact legacy unverified path remains available as a byte-identical rollback.\n */\nimport { spawnSync } from \"node:child_process\";\nimport { isNormalizedArtifactPath } from \"../guardrails/workspace-fingerprint.ts\";\nimport type { WorkspaceScope } from \"../types/evidence.ts\";\n\nexport function isVerifiedBashEnabled(env?: Record<string, string | undefined>): boolean {\n\tconst source: Record<string, string | undefined> = env ?? process.env;\n\treturn source.OMK_VERIFIED_BASH !== \"0\";\n}\n\n// ---------------------------------------------------------------------------\n// Git-aware session workspace scope (bounded, TTL-cached)\n// ---------------------------------------------------------------------------\n\nconst SCOPE_TTL_MS = 1_000;\nconst SCOPE_CACHE_MAX = 8;\nconst SCOPE_MAX_PATHS = 32;\nconst GIT_TIMEOUT_MS = 1_500;\n\nconst scopeCache = new Map<string, { at: number; scope: WorkspaceScope }>();\n\n/**\n * Workspace scope for session bash receipts. Inside a git worktree the scope\n * root is the toplevel and `artifactPaths` is the current dirty set (staged,\n * modified, untracked; capped and sorted), which lets `captureWorkspaceFingerprint`\n * bind HEAD plus a scope-limited dirty digest. Outside git, falls back to an\n * empty artifact set under `cwd`. Never throws.\n */\nexport function resolveSessionWorkspaceScope(cwd: string, options?: { maxPaths?: number }): WorkspaceScope {\n\tconst cached = scopeCache.get(cwd);\n\tif (cached && Date.now() - cached.at < SCOPE_TTL_MS) return cached.scope;\n\tconst scope = computeSessionWorkspaceScope(cwd, options?.maxPaths ?? SCOPE_MAX_PATHS);\n\tif (scopeCache.size >= SCOPE_CACHE_MAX) {\n\t\tconst oldest = scopeCache.keys().next().value;\n\t\tif (oldest !== undefined) scopeCache.delete(oldest);\n\t}\n\tscopeCache.set(cwd, { at: Date.now(), scope });\n\treturn scope;\n}\n\nfunction computeSessionWorkspaceScope(cwd: string, maxPaths: number): WorkspaceScope {\n\ttry {\n\t\tconst top = spawnSync(\"git\", [\"-C\", cwd, \"rev-parse\", \"--show-toplevel\"], {\n\t\t\tencoding: \"utf8\",\n\t\t\ttimeout: GIT_TIMEOUT_MS,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\tif (top.status !== 0 || typeof top.stdout !== \"string\") return { root: cwd, artifactPaths: [] };\n\t\tconst root = top.stdout.trim();\n\t\tif (root.length === 0) return { root: cwd, artifactPaths: [] };\n\t\t// File-granular untracked listing: -unormal emits untracked directories as\n\t\t// `dir/`, whose trailing slash fails assertNormalizedArtifactPath downstream\n\t\t// and kills every verified bash call in the session.\n\t\tconst status = spawnSync(\"git\", [\"-C\", cwd, \"status\", \"--porcelain=v1\", \"-z\", \"--untracked-files=all\"], {\n\t\t\ttimeout: GIT_TIMEOUT_MS,\n\t\t\tmaxBuffer: 4 * 1024 * 1024,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\tif (status.status !== 0 || !status.stdout) return { root, artifactPaths: [] };\n\t\tconst fields = status.stdout.toString(\"utf8\").split(\"\\0\");\n\t\tconst paths: string[] = [];\n\t\tfor (let index = 0; index < fields.length; index++) {\n\t\t\tconst field = fields[index];\n\t\t\tif (field.length < 4) continue;\n\t\t\tconst xy = field.slice(0, 2);\n\t\t\tif (xy === \"!!\") continue;\n\t\t\tif (xy.includes(\"R\") || xy.includes(\"C\")) index++; // rename/copy: consume the source path field too\n\t\t\tconst artifact = field.slice(3);\n\t\t\t// Keep only entries the fingerprint can bind. This drops trailing-slash\n\t\t\t// survivors (untracked nested repositories, whose contents are outside\n\t\t\t// the parent's dirty digest) and names the receipt parser rejects, such\n\t\t\t// as a mangled `\\\\wsl.localhost\\...` directory containing a backslash.\n\t\t\tif (isNormalizedArtifactPath(artifact)) paths.push(artifact);\n\t\t}\n\t\tconst artifactPaths = [...new Set(paths)].sort().slice(0, maxPaths);\n\t\treturn { root, artifactPaths };\n\t} catch {\n\t\treturn { root: cwd, artifactPaths: [] };\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"verified-bash-runtime.js","sourceRoot":"","sources":["../../src/core/verified-bash-runtime.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAGlF,MAAM,UAAU,qBAAqB,CAAC,GAAwC,EAAW;IACxF,MAAM,MAAM,GAAuC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACtE,OAAO,MAAM,CAAC,iBAAiB,KAAK,GAAG,CAAC;AAAA,CACxC;AAED,8EAA8E;AAC9E,0DAA0D;AAC1D,8EAA8E;AAE9E,MAAM,YAAY,GAAG,KAAK,CAAC;AAC3B,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,cAAc,GAAG,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EAAE,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI;YACpD,iBAAiB,EAAE,aAAa,CAAC,MAAM;YACvC,iBAAiB,EAAE,QAAQ,CAAC,IAAI;YAChC,SAAS;YACT,yEAAyE;YACzE,+CAA+C;YAC/C,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,UAAU;YACnG,GAAG,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;gBACtB,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACA,qBAAqB,EAAE,UAAU,CAAC,QAAQ,CAAC;yBACzC,MAAM,CAAC,GAAG,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;yBACvE,MAAM,CAAC,KAAK,CAAC;iBACf,CAAC;SACJ,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;AAAA,CACD","sourcesContent":["/**\n * Default-on gate for the verified bash adapter (opt-out via OMK_VERIFIED_BASH=0).\n *\n * Mirrors ADR-OMP-009: the receipt-bound path is the default experience; the\n * exact legacy unverified path remains available as a byte-identical rollback.\n */\nimport { spawnSync } from \"node:child_process\";\nimport { createHash } from \"node:crypto\";\nimport { isNormalizedArtifactPath } from \"../guardrails/workspace-fingerprint.ts\";\nimport type { WorkspaceScope } from \"../types/evidence.ts\";\n\nexport function isVerifiedBashEnabled(env?: Record<string, string | undefined>): boolean {\n\tconst source: Record<string, string | undefined> = env ?? process.env;\n\treturn source.OMK_VERIFIED_BASH !== \"0\";\n}\n\n// ---------------------------------------------------------------------------\n// Git-aware session workspace scope (bounded, TTL-cached)\n// ---------------------------------------------------------------------------\n\nconst SCOPE_TTL_MS = 1_000;\nconst SCOPE_CACHE_MAX = 8;\nconst SCOPE_MAX_PATHS = 32;\nconst GIT_TIMEOUT_MS = 1_500;\n/** Domain separator so an excluded-set digest can never collide with another digest. */\nconst EXCLUDED_SET_DOMAIN = \"omk:evidence:session-scope-excluded:v1\\0\";\n\nconst scopeCache = new Map<string, { at: number; report: SessionWorkspaceScopeReport }>();\n\n/**\n * Why a session scope is not a complete view of the workspace dirty set.\n *\n * `unavailable` is not `complete`: outside a worktree, or when git cannot be\n * read, nothing was enumerated, so an empty artifact set is an absence of\n * evidence rather than evidence of a clean tree.\n */\nexport type SessionScopeCompleteness = \"complete\" | \"partial_truncated\" | \"partial_excluded\" | \"unavailable\";\n\n/**\n * A session scope plus what it could not bind.\n *\n * The scope drops dirty paths two ways — a hard cap for availability, and the\n * normalized-path filter the receipt parser forces — and both were previously\n * silent, so a receipt built on a partial view read exactly like one that saw\n * the whole workspace. Dropping stays deliberate; hiding it was the defect.\n */\nexport interface SessionWorkspaceScopeReport {\n\treadonly scope: WorkspaceScope;\n\t/** Unique dirty entries git reported, before the cap and the path filter. */\n\treadonly totalDirtyPathCount: number;\n\t/** Entries the scope binds: always `scope.artifactPaths.length`. */\n\treadonly selectedPathCount: number;\n\t/** Unique dirty entries no receipt can bind, such as a name carrying a backslash. */\n\treadonly excludedPathCount: number;\n\t/** True when the cap, not the filter, kept an eligible path out of the scope. */\n\treadonly truncated: boolean;\n\treadonly completeness: SessionScopeCompleteness;\n\t/** Digest of the sorted excluded set, so two different losses are distinguishable. Absent when nothing was excluded. */\n\treadonly excludedPathSetSha256?: string;\n}\n\n/**\n * Workspace scope for session bash receipts. Inside a git worktree the scope\n * root is the toplevel and `artifactPaths` is the current dirty set (staged,\n * modified, untracked; capped and sorted), which lets `captureWorkspaceFingerprint`\n * bind HEAD plus a scope-limited dirty digest. Outside git, falls back to an\n * empty artifact set under `cwd`. Never throws.\n */\nexport function resolveSessionWorkspaceScope(cwd: string, options?: { maxPaths?: number }): WorkspaceScope {\n\treturn resolveSessionWorkspaceScopeReport(cwd, options).scope;\n}\n\n/**\n * The scope a receipt would bind, together with the completeness facts that say\n * whether binding it proves anything about the whole workspace.\n *\n * Cached per `(cwd, maxPaths)` for {@link SCOPE_TTL_MS}: keying the cap in too\n * keeps a capped probe from serving a later full request a truncated answer.\n */\nexport function resolveSessionWorkspaceScopeReport(\n\tcwd: string,\n\toptions?: { maxPaths?: number },\n): SessionWorkspaceScopeReport {\n\tconst maxPaths = options?.maxPaths ?? SCOPE_MAX_PATHS;\n\tconst key = `${maxPaths}\\0${cwd}`;\n\tconst cached = scopeCache.get(key);\n\tif (cached && Date.now() - cached.at < SCOPE_TTL_MS) return cached.report;\n\tconst report = computeSessionWorkspaceScope(cwd, maxPaths);\n\tif (scopeCache.size >= SCOPE_CACHE_MAX) {\n\t\tconst oldest = scopeCache.keys().next().value;\n\t\tif (oldest !== undefined) scopeCache.delete(oldest);\n\t}\n\tscopeCache.set(key, { at: Date.now(), report });\n\treturn report;\n}\n\n/** Nothing was enumerated, so the empty artifact set proves nothing about the tree. */\nfunction unavailableScope(root: string): SessionWorkspaceScopeReport {\n\treturn {\n\t\tscope: { root, artifactPaths: [] },\n\t\ttotalDirtyPathCount: 0,\n\t\tselectedPathCount: 0,\n\t\texcludedPathCount: 0,\n\t\ttruncated: false,\n\t\tcompleteness: \"unavailable\",\n\t};\n}\n\nfunction computeSessionWorkspaceScope(cwd: string, maxPaths: number): SessionWorkspaceScopeReport {\n\ttry {\n\t\tconst top = spawnSync(\"git\", [\"-C\", cwd, \"rev-parse\", \"--show-toplevel\"], {\n\t\t\tencoding: \"utf8\",\n\t\t\ttimeout: GIT_TIMEOUT_MS,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\tif (top.status !== 0 || typeof top.stdout !== \"string\") return unavailableScope(cwd);\n\t\tconst root = top.stdout.trim();\n\t\tif (root.length === 0) return unavailableScope(cwd);\n\t\t// File-granular untracked listing: -unormal emits untracked directories as\n\t\t// `dir/`, whose trailing slash fails assertNormalizedArtifactPath downstream\n\t\t// and kills every verified bash call in the session.\n\t\tconst status = spawnSync(\"git\", [\"-C\", cwd, \"status\", \"--porcelain=v1\", \"-z\", \"--untracked-files=all\"], {\n\t\t\ttimeout: GIT_TIMEOUT_MS,\n\t\t\tmaxBuffer: 4 * 1024 * 1024,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t});\n\t\tif (status.status !== 0 || !status.stdout) return unavailableScope(root);\n\t\tconst fields = status.stdout.toString(\"utf8\").split(\"\\0\");\n\t\tconst paths = new Set<string>();\n\t\tconst excluded = new Set<string>();\n\t\tfor (let index = 0; index < fields.length; index++) {\n\t\t\tconst field = fields[index];\n\t\t\tif (field.length < 4) continue;\n\t\t\tconst xy = field.slice(0, 2);\n\t\t\tif (xy === \"!!\") continue;\n\t\t\tif (xy.includes(\"R\") || xy.includes(\"C\")) index++; // rename/copy: consume the source path field too\n\t\t\tconst artifact = field.slice(3);\n\t\t\t// Keep only entries the fingerprint can bind. This drops trailing-slash\n\t\t\t// survivors (untracked nested repositories, whose contents are outside\n\t\t\t// the parent's dirty digest) and names the receipt parser rejects, such\n\t\t\t// as a mangled `\\\\wsl.localhost\\...` directory containing a backslash.\n\t\t\tif (isNormalizedArtifactPath(artifact)) paths.add(artifact);\n\t\t\telse excluded.add(artifact);\n\t\t}\n\t\tconst eligible = [...paths].sort();\n\t\tconst artifactPaths = eligible.slice(0, maxPaths);\n\t\tconst truncated = artifactPaths.length < eligible.length;\n\t\treturn {\n\t\t\tscope: { root, artifactPaths },\n\t\t\ttotalDirtyPathCount: eligible.length + excluded.size,\n\t\t\tselectedPathCount: artifactPaths.length,\n\t\t\texcludedPathCount: excluded.size,\n\t\t\ttruncated,\n\t\t\t// Truncation outranks exclusion: an excluded path is named by the digest\n\t\t\t// below, a capped one is an unbounded unknown.\n\t\t\tcompleteness: truncated ? \"partial_truncated\" : excluded.size > 0 ? \"partial_excluded\" : \"complete\",\n\t\t\t...(excluded.size === 0\n\t\t\t\t? {}\n\t\t\t\t: {\n\t\t\t\t\t\texcludedPathSetSha256: createHash(\"sha256\")\n\t\t\t\t\t\t\t.update(`${EXCLUDED_SET_DOMAIN}${JSON.stringify([...excluded].sort())}`)\n\t\t\t\t\t\t\t.digest(\"hex\"),\n\t\t\t\t\t}),\n\t\t};\n\t} catch {\n\t\treturn unavailableScope(cwd);\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
|
50
50
|
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, type LocalBashOperationsOptions, createDiagnosticsTool, createDiagnosticsToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type DiagnosticLine, type DiagnosticsToolDetails, type DiagnosticsToolInput, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
51
51
|
export { createVerifiedBashOperations, executeVerifiedBash, executeVerifiedLocalBash, VERIFIED_BASH_REDACTION_POLICY_ID, VerifiedBashAdapterError, type VerifiedBashExecutionRequest, type VerifiedBashOperationsBinding, type VerifiedLocalBashExecutionRequest, } from "./core/verified-bash-adapter.ts";
|
|
52
52
|
export { isVerifiedBashEnabled, resolveSessionWorkspaceScope } from "./core/verified-bash-runtime.ts";
|
|
53
|
+
export { resolveSessionWorkspaceScopeReport } from "./core/verified-bash-runtime.ts";
|
|
54
|
+
export type { SessionScopeCompleteness, SessionWorkspaceScopeReport } from "./core/verified-bash-runtime.ts";
|
|
53
55
|
export { type CommandHmacBinder, CommandRedactionError, createCommandHmacBinder, EVIDENCE_COMMAND_REDACTION_POLICY_ID, MAX_COMMAND_REDACTION_PLACEHOLDERS, parseCommandHmacBinding, parseCommandRedactionSummary, type RedactedCommandDescriptor, redactCommandDescriptor, } from "./guardrails/command-redaction.ts";
|
|
54
56
|
export { evidenceReceiptToObservation } from "./guardrails/evidence-protocol.ts";
|
|
55
57
|
export { computeEvidenceCommandSha256, computeEvidenceReceiptCoreSha256, constantTimeSha256Equal, createEvidenceReceipt, evidenceReceiptReplayPayload, isSafeEvidenceReceiptId, isSha256Hex, parseEvidenceReceipt, parseSha256Hex, validateEvidenceReceipt, withEvidenceReceiptEnvelope, } from "./guardrails/evidence-receipt.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,oBAAoB,EACpB,KAAK,0BAA0B,GAC/B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,0BAA0B,GAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,KAAK,gBAAgB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,KAAK,gCA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B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,KAAK,oBAAoB,GACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,EACL,KAAK,UAAU,GACf,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACX,+BAA+B,EAC/B,aAAa,EACb,kBAAkB,EAClB,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,0BAA0B,EAC1B,4BAA4B,EAC5B,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,0BAA0B,EAC1B,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// biome-ignore-all assist/source/organizeImports: Public exports are grouped by API domain.\n// Core session management\n\nexport {\n\ttype ApprovalContentDigest,\n\ttype ApprovalDecision,\n\ttype ApprovalPlanDigest,\n\ttype ApprovalReceipt,\n\ttype ApprovalReceiptCore,\n\tcomputeApprovalContentDigest,\n\tcomputeApprovalReceiptCoreSha256,\n\tcreateApprovalReceipt,\n\tparseApprovalReceipt,\n\tserializeApprovalReceipt,\n\tvalidateApprovalReceipt,\n} from \"./approvals/approval-receipt.ts\";\nexport {\n\tApprovalReceiptStore,\n\ttype ApprovalReceiptWriteResult,\n} from \"./approvals/approval-receipt-store.ts\";\nexport {\n\ttype ApprovalExecutionBinding,\n\ttype ApprovalVerificationFailure,\n\ttype ApprovalVerificationResult,\n\tverifyApprovalForExecution,\n} from \"./approvals/approval-verifier.ts\";\nexport {\n\ttype ApprovalEventBus,\n\tPLANNOTATOR_REQUEST_CHANNEL,\n\tPLANNOTATOR_REVIEW_RESULT_CHANNEL,\n\tPlannotatorApprovalBridge,\n\ttype PlannotatorApprovalBridgeOptions,\n\ttype PlanReviewCorrelation,\n\ttype PlanReviewRequest,\n\ttype ReviewResultOutcome,\n} from \"./approvals/plannotator-approval-bridge.ts\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tADVISORY_JUDGE_PROMPT_VERSION,\n\ttype AdvisoryJudge,\n\ttype AdvisoryJudgeCandidate,\n\ttype AdvisoryJudgeCandidateScore,\n\ttype AdvisoryJudgeCriterion,\n\ttype AdvisoryJudgeDecision,\n\ttype AdvisoryJudgeDecisionReason,\n\ttype AdvisoryJudgeDecisionStatus,\n\ttype AdvisoryJudgeInput,\n\tAdvisoryJudgeInputError,\n\ttype AdvisoryJudgeRequest,\n\ttype AdvisoryJudgeRequestCandidate,\n\tchooseWithAdvisoryJudge,\n} from \"./core/advisory-judge.ts\";\nexport {\n\ttype AdvisoryJudgeCompletion,\n\tAdvisoryJudgeModelError,\n\ttype AdvisoryJudgeModelErrorCode,\n\tcreateModelAdvisoryJudge,\n\ttype ModelAdvisoryJudgeOptions,\n} from \"./core/advisory-judge-model.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\nexport {\n\ttype ApiAction,\n\tApiBroker,\n\ttype ApiMethod,\n\ttype ApiOutcome,\n\tAUTOPILOT_MAX,\n\ttype AutomationHarnessScoreInput,\n\tAutomationHarnessScorer,\n\ttype AutomationScoreBreakdown,\n\ttype AutomationTrace,\n\ttype AutomationTraceAction,\n\ttype AutomationTraceContextPlan,\n\ttype AutomationTraceEnvApiUse,\n\ttype AutonomyProfile,\n\ttype BrokerFetcher,\n\ttype BrokerFetchRequest,\n\ttype BrokerFetchResponse,\n\ttype Capability,\n\tcanonicalHash,\n\tclassifyEnvKey,\n\tDynamicToolPortfolioOptimizer,\n\tEnvBroker,\n\ttype EnvBrokerLedger,\n\ttype EnvMode,\n\ttype EnvRecord,\n\ttype EnvResolutionRequest,\n\ttype EnvUseEvent,\n\ttype EvidenceActor,\n\ttype EvidenceEvent,\n\ttype EvidenceEventInput,\n\tEvidenceLedger,\n\ttype EvidenceOutcome,\n\ttype EvidencePointer,\n\ttype ExecutionStrategy,\n\ttype Postcondition,\n\tPostconditionVerifier,\n\ttype RiskLevel,\n\tredactForModel,\n\ttype Sensitivity,\n\tstrategyForRisk,\n\tToolExecutionBroker,\n\ttype ToolExecutionCandidate,\n\ttype ToolExecutionChoice,\n\ttype ToolExecutionNeed,\n\ttype VerificationContext,\n\ttype VerificationResult,\n} from \"./core/automation/index.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionBarrierResult,\n\ttype CompactionCommitDecision,\n\ttype CompactionEnvelope,\n\ttype CompactionHysteresisConfig,\n\ttype CompactionHysteresisState,\n\ttype CompactionResult,\n\ttype CompactionTransaction,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tcreateCompactionEnvelope,\n\tcreateCompactionHysteresisConfig,\n\tcreateCompactionHysteresisState,\n\tcreateCompactionSourceIdentity,\n\tcreateCompactionTransaction,\n\tcreateSessionRevisionToken,\n\tDEFAULT_COMPACTION_SETTINGS,\n\tdecideCompactionCommit,\n\testimateTokens,\n\tevaluateCompactionBarrier,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n\tstepCompactionHysteresis,\n\tvalidateCompactionEnvelope,\n} from \"./core/compaction/index.ts\";\nexport {\n\tapplyContextCacheInvalidation,\n\tbuildContextBudgetMaterializedRepresentationCacheKeyV2,\n\tbuildContextBudgetPlanCacheKeyV2,\n\tCONTEXT_BUDGET_POLICY_VERSION_V2,\n\tCONTEXT_BUDGET_SELECTION_POLICY_V2,\n\ttype ContextBudgetCacheProviderV2,\n\ttype ContextCacheInvalidationEvent,\n\ttype ContextCacheInvalidationSnapshot,\n\tcreateContextBudgetCacheKeyBaseV2,\n\tcreateContextCacheInvalidationSnapshot,\n\tcreateDiskContextBudgetCacheProviderV2,\n\tcreateMemoryContextBudgetCacheProviderV2,\n\ttype DiskContextBudgetCacheOptionsV2,\n\tDiskContextBudgetCacheProviderV2,\n\tplanPromptContextBudgetV2,\n\tserializeContextCacheSnapshot,\n} from \"./core/context-budget-governor-v2.ts\";\nexport {\n\tcomputeReservedTokenBudget,\n\testimateToolResultReserve,\n\tReservedTokenBudgetError,\n\ttype ReservedTokenBudgetInput,\n\ttype ReservedTokenBudgetResult,\n\ttype ToolResultReserveRequest,\n} from \"./core/context-budget-reserved-tokens.ts\";\nexport {\n\tcomputeDurableGoalGeneration,\n\tcreateDurableGoal,\n\tDURABLE_GOAL_CHECKPOINT_SCHEMA_VERSION,\n\tDURABLE_GOAL_SCHEMA_VERSION,\n\tDURABLE_GOAL_STATUS_VALUES,\n\ttype DurableGoalCheckpoint,\n\ttype DurableGoalCheckpointInput,\n\ttype DurableGoalCommand,\n\tDurableGoalError,\n\ttype DurableGoalErrorCode,\n\ttype DurableGoalEvidence,\n\ttype DurableGoalRef,\n\ttype DurableGoalSnapshot,\n\ttype DurableGoalStatus,\n\tfreshDurableGoalEvidence,\n} from \"./core/durable-goal.ts\";\nexport {\n\tcreateDurableGoalCheckpoint,\n\tformatDurableGoalCheckpoint,\n\tparseDurableGoalCheckpoint,\n\tparseDurableGoalCheckpointCommand,\n} from \"./core/durable-goal-checkpoint.ts\";\nexport { parseDurableGoalSnapshot } from \"./core/durable-goal-parse.ts\";\nexport { applyDurableGoalCommand } from \"./core/durable-goal-reducer.ts\";\nexport {\n\ttype GoalContinuationDecision,\n\ttype GoalContinuationInput,\n\tdecideGoalContinuation,\n} from \"./core/goal-continuation.ts\";\nexport { isSessionModelOverflow, shouldSkipCompactionCheck } from \"./core/compaction-gate.ts\";\nexport {\n\tdetectIdenticalLoop,\n\ttype LoopDetection,\n\ttype LoopPolicy,\n\ttype LoopRecord,\n} from \"./core/identical-loop.ts\";\nexport {\n\ttype PromptPreset,\n\ttype PromptPresetId,\n\tPROMPT_PRESET_IDS,\n\tresolvePromptPreset,\n} from \"./core/prompt-preset.ts\";\nexport {\n\tcomputeRetryDelayMs,\n\tfailoverModelKey,\n\tisFailoverTriggerError,\n\tisRetryableAssistantError,\n\tnextRetryAttempt,\n} from \"./core/provider-retry.ts\";\nexport { computePromptTokenBudget, computeResponseReserveTokens } from \"./core/prompt-budget.ts\";\nexport {\n\tclassifyPromptCacheTransition,\n\ttype PromptCacheTransition,\n\ttype PromptCacheTransitionKind,\n} from \"./core/prompt-cache.ts\";\nexport {\n\ttype SessionSystemPromptAssembly,\n\ttype SessionSystemPromptInput,\n\tassembleSessionSystemPrompt,\n} from \"./core/session-system-prompt.ts\";\nexport {\n\tapplyToolPairRepair,\n\ttype ToolContentBlock,\n\ttype ToolPairMessage,\n} from \"./core/tool-pair-repair.ts\";\nexport {\n\ttype SpillInput,\n\ttype SpillResult,\n\tspillTruncatedOutput,\n} from \"./core/tools/artifact-spill.ts\";\nexport {\n\tDURABLE_GOAL_JOURNAL_SCHEMA_VERSION,\n\ttype DurableGoalJournal,\n\tDurableGoalStore,\n} from \"./core/durable-goal-store.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionMode,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport { extractNpmPackageTarball } from \"./core/package-archive.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\textractReverseSkillFactsFromMarkdown,\n\tformatReverseSkillFromSource,\n\tformatReverseSkillMarkdown,\n\tformatReverseSkillRouteDecision,\n\tgetReverseSkillToolAliases,\n\tnormalizeReverseSkillName,\n\tnormalizeReverseSkillText,\n\tplanReverseSkillToolChecks,\n\tREVERSE_SKILL_ROUTES,\n\ttype ReverseSkillPlatform,\n\ttype ReverseSkillRisk,\n\ttype ReverseSkillRoute,\n\ttype ReverseSkillRouteDecision,\n\ttype ReverseSkillRouteInput,\n\ttype ReverseSkillRouteScore,\n\ttype ReverseSkillSourceFacts,\n\ttype ReverseSkillSourceInput,\n\ttype ReverseSkillSpecInput,\n\trouteReverseSkill,\n} from \"./core/reverse-skill.ts\";\nexport {\n\tappendRunJournalRecordDurably,\n\ttype OpenRunJournalStoreOptions,\n\ttype RunJournalQuarantineReport,\n\tRunJournalStore,\n\tRunJournalStoreCorruptionError,\n\twriteQuarantineBytesDurably,\n} from \"./core/run-journal-store.ts\";\nexport {\n\ttype BashSandboxMode,\n\tcreateWorkspaceSandboxPolicy,\n\tresolveBashSandboxMode,\n} from \"./core/sandbox/default-policy.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\ttype CompactionProvenanceDetails,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionQuarantineReport,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\tclassifySessionTermination,\n\tformatSessionTermination,\n\ttype SessionTermination,\n\ttype SessionTerminationCause,\n\tSessionTerminationError,\n\ttype SessionTerminationKind,\n} from \"./core/session-termination.ts\";\nexport {\n\ttype AgentRuntimeSettings,\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype ToolSchedulerSetting,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\ttype LocalBashOperationsOptions,\n\tcreateDiagnosticsTool,\n\tcreateDiagnosticsToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype DiagnosticLine,\n\ttype DiagnosticsToolDetails,\n\ttype DiagnosticsToolInput,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\tcreateVerifiedBashOperations,\n\texecuteVerifiedBash,\n\texecuteVerifiedLocalBash,\n\tVERIFIED_BASH_REDACTION_POLICY_ID,\n\tVerifiedBashAdapterError,\n\ttype VerifiedBashExecutionRequest,\n\ttype VerifiedBashOperationsBinding,\n\ttype VerifiedLocalBashExecutionRequest,\n} from \"./core/verified-bash-adapter.ts\";\nexport { isVerifiedBashEnabled, resolveSessionWorkspaceScope } from \"./core/verified-bash-runtime.ts\";\n// Execution-bound evidence\nexport {\n\ttype CommandHmacBinder,\n\tCommandRedactionError,\n\tcreateCommandHmacBinder,\n\tEVIDENCE_COMMAND_REDACTION_POLICY_ID,\n\tMAX_COMMAND_REDACTION_PLACEHOLDERS,\n\tparseCommandHmacBinding,\n\tparseCommandRedactionSummary,\n\ttype RedactedCommandDescriptor,\n\tredactCommandDescriptor,\n} from \"./guardrails/command-redaction.ts\";\nexport { evidenceReceiptToObservation } from \"./guardrails/evidence-protocol.ts\";\nexport {\n\tcomputeEvidenceCommandSha256,\n\tcomputeEvidenceReceiptCoreSha256,\n\tconstantTimeSha256Equal,\n\tcreateEvidenceReceipt,\n\tevidenceReceiptReplayPayload,\n\tisSafeEvidenceReceiptId,\n\tisSha256Hex,\n\tparseEvidenceReceipt,\n\tparseSha256Hex,\n\tvalidateEvidenceReceipt,\n\twithEvidenceReceiptEnvelope,\n} from \"./guardrails/evidence-receipt.ts\";\nexport {\n\tEvidenceReceiptStore,\n\ttype EvidenceReceiptStoreFaultStage,\n\ttype EvidenceReceiptStoreOptions,\n} from \"./guardrails/evidence-receipt-store.ts\";\nexport {\n\tEvidenceGate,\n\ttype EvidenceGateOptions,\n\tFailClosedMergeGate,\n\tlatestRelevantWorkspaceMutationSeq,\n\tReplayLedgerManager,\n\tTaskContractBuilder,\n} from \"./guardrails/evidence-system.ts\";\nexport {\n\ttype VerifiedEvidenceExecutionOutcome,\n\ttype VerifiedEvidenceExecutionRequest,\n\ttype VerifiedEvidenceExecutionResult,\n\tVerifiedEvidenceExecutor,\n\tVerifiedEvidenceExecutorError,\n\ttype VerifiedEvidenceExecutorOptions,\n\ttype VerifiedEvidenceMetadata,\n} from \"./guardrails/verified-executor.ts\";\nexport {\n\tcaptureWorkspaceFingerprint,\n\tcomputeGitWorkspaceDirtySha256,\n\tcomputeGitWorkspaceManifestSha256,\n\tcomputeWorkspaceManifestSha256,\n\tparseWorkspaceFingerprint,\n} from \"./guardrails/workspace-fingerprint.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\nexport type {\n\tArtifactSetWorkspaceFingerprint,\n\tArtifactState,\n\tCommandHmacBinding,\n\tCommandRedactionPlaceholder,\n\tCommandRedactionPlaceholderType,\n\tCommandRedactionSummary,\n\tEvidenceCommandDescriptor,\n\tEvidenceExecutor,\n\tEvidenceItem,\n\tEvidenceReceipt,\n\tEvidenceReceiptDisposition,\n\tEvidenceReceiptLedgerBinding,\n\tEvidenceReceiptMode,\n\tFileArtifactState,\n\tGitWorkspaceFingerprint,\n\tGitWorkspaceState,\n\tMissingArtifactState,\n\tReplayEvent,\n\tReplayEventType,\n\tReplayPayloadHashAlgorithm,\n\tSha256Hex,\n\tTaskContract,\n\tWorkspaceFingerprint,\n\tWorkspaceMutationReplayPayload,\n\tWorkspaceScope,\n} from \"./types/evidence.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,oBAAoB,EACpB,KAAK,0BAA0B,GAC/B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACN,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,0BAA0B,GAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACN,KAAK,gBAAgB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,EACzB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,GACxB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,6BAA6B,EAC7B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,kBAAkB,E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EACL,KAAK,UAAU,GACf,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACX,+BAA+B,EAC/B,aAAa,EACb,kBAAkB,EAClB,2BAA2B,EAC3B,+BAA+B,EAC/B,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,0BAA0B,EAC1B,4BAA4B,EAC5B,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,eAAe,EACf,0BAA0B,EAC1B,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// biome-ignore-all assist/source/organizeImports: Public exports are grouped by API domain.\n// Core session management\n\nexport {\n\ttype ApprovalContentDigest,\n\ttype ApprovalDecision,\n\ttype ApprovalPlanDigest,\n\ttype ApprovalReceipt,\n\ttype ApprovalReceiptCore,\n\tcomputeApprovalContentDigest,\n\tcomputeApprovalReceiptCoreSha256,\n\tcreateApprovalReceipt,\n\tparseApprovalReceipt,\n\tserializeApprovalReceipt,\n\tvalidateApprovalReceipt,\n} from \"./approvals/approval-receipt.ts\";\nexport {\n\tApprovalReceiptStore,\n\ttype ApprovalReceiptWriteResult,\n} from \"./approvals/approval-receipt-store.ts\";\nexport {\n\ttype ApprovalExecutionBinding,\n\ttype ApprovalVerificationFailure,\n\ttype ApprovalVerificationResult,\n\tverifyApprovalForExecution,\n} from \"./approvals/approval-verifier.ts\";\nexport {\n\ttype ApprovalEventBus,\n\tPLANNOTATOR_REQUEST_CHANNEL,\n\tPLANNOTATOR_REVIEW_RESULT_CHANNEL,\n\tPlannotatorApprovalBridge,\n\ttype PlannotatorApprovalBridgeOptions,\n\ttype PlanReviewCorrelation,\n\ttype PlanReviewRequest,\n\ttype ReviewResultOutcome,\n} from \"./approvals/plannotator-approval-bridge.ts\";\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n// Config paths\nexport { getAgentDir, VERSION } from \"./config.ts\";\nexport {\n\tADVISORY_JUDGE_PROMPT_VERSION,\n\ttype AdvisoryJudge,\n\ttype AdvisoryJudgeCandidate,\n\ttype AdvisoryJudgeCandidateScore,\n\ttype AdvisoryJudgeCriterion,\n\ttype AdvisoryJudgeDecision,\n\ttype AdvisoryJudgeDecisionReason,\n\ttype AdvisoryJudgeDecisionStatus,\n\ttype AdvisoryJudgeInput,\n\tAdvisoryJudgeInputError,\n\ttype AdvisoryJudgeRequest,\n\ttype AdvisoryJudgeRequestCandidate,\n\tchooseWithAdvisoryJudge,\n} from \"./core/advisory-judge.ts\";\nexport {\n\ttype AdvisoryJudgeCompletion,\n\tAdvisoryJudgeModelError,\n\ttype AdvisoryJudgeModelErrorCode,\n\tcreateModelAdvisoryJudge,\n\ttype ModelAdvisoryJudgeOptions,\n} from \"./core/advisory-judge-model.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\n// Auth and model registry\nexport {\n\ttype ApiKeyCredential,\n\ttype AuthCredential,\n\ttype AuthStatus,\n\tAuthStorage,\n\ttype AuthStorageBackend,\n\tFileAuthStorageBackend,\n\tInMemoryAuthStorageBackend,\n\ttype OAuthCredential,\n} from \"./core/auth-storage.ts\";\nexport {\n\ttype ApiAction,\n\tApiBroker,\n\ttype ApiMethod,\n\ttype ApiOutcome,\n\tAUTOPILOT_MAX,\n\ttype AutomationHarnessScoreInput,\n\tAutomationHarnessScorer,\n\ttype AutomationScoreBreakdown,\n\ttype AutomationTrace,\n\ttype AutomationTraceAction,\n\ttype AutomationTraceContextPlan,\n\ttype AutomationTraceEnvApiUse,\n\ttype AutonomyProfile,\n\ttype BrokerFetcher,\n\ttype BrokerFetchRequest,\n\ttype BrokerFetchResponse,\n\ttype Capability,\n\tcanonicalHash,\n\tclassifyEnvKey,\n\tDynamicToolPortfolioOptimizer,\n\tEnvBroker,\n\ttype EnvBrokerLedger,\n\ttype EnvMode,\n\ttype EnvRecord,\n\ttype EnvResolutionRequest,\n\ttype EnvUseEvent,\n\ttype EvidenceActor,\n\ttype EvidenceEvent,\n\ttype EvidenceEventInput,\n\tEvidenceLedger,\n\ttype EvidenceOutcome,\n\ttype EvidencePointer,\n\ttype ExecutionStrategy,\n\ttype Postcondition,\n\tPostconditionVerifier,\n\ttype RiskLevel,\n\tredactForModel,\n\ttype Sensitivity,\n\tstrategyForRisk,\n\tToolExecutionBroker,\n\ttype ToolExecutionCandidate,\n\ttype ToolExecutionChoice,\n\ttype ToolExecutionNeed,\n\ttype VerificationContext,\n\ttype VerificationResult,\n} from \"./core/automation/index.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionBarrierResult,\n\ttype CompactionCommitDecision,\n\ttype CompactionEnvelope,\n\ttype CompactionHysteresisConfig,\n\ttype CompactionHysteresisState,\n\ttype CompactionResult,\n\ttype CompactionTransaction,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tcreateCompactionEnvelope,\n\tcreateCompactionHysteresisConfig,\n\tcreateCompactionHysteresisState,\n\tcreateCompactionSourceIdentity,\n\tcreateCompactionTransaction,\n\tcreateSessionRevisionToken,\n\tDEFAULT_COMPACTION_SETTINGS,\n\tdecideCompactionCommit,\n\testimateTokens,\n\tevaluateCompactionBarrier,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n\tstepCompactionHysteresis,\n\tvalidateCompactionEnvelope,\n} from \"./core/compaction/index.ts\";\nexport {\n\tapplyContextCacheInvalidation,\n\tbuildContextBudgetMaterializedRepresentationCacheKeyV2,\n\tbuildContextBudgetPlanCacheKeyV2,\n\tCONTEXT_BUDGET_POLICY_VERSION_V2,\n\tCONTEXT_BUDGET_SELECTION_POLICY_V2,\n\ttype ContextBudgetCacheProviderV2,\n\ttype ContextCacheInvalidationEvent,\n\ttype ContextCacheInvalidationSnapshot,\n\tcreateContextBudgetCacheKeyBaseV2,\n\tcreateContextCacheInvalidationSnapshot,\n\tcreateDiskContextBudgetCacheProviderV2,\n\tcreateMemoryContextBudgetCacheProviderV2,\n\ttype DiskContextBudgetCacheOptionsV2,\n\tDiskContextBudgetCacheProviderV2,\n\tplanPromptContextBudgetV2,\n\tserializeContextCacheSnapshot,\n} from \"./core/context-budget-governor-v2.ts\";\nexport {\n\tcomputeReservedTokenBudget,\n\testimateToolResultReserve,\n\tReservedTokenBudgetError,\n\ttype ReservedTokenBudgetInput,\n\ttype ReservedTokenBudgetResult,\n\ttype ToolResultReserveRequest,\n} from \"./core/context-budget-reserved-tokens.ts\";\nexport {\n\tcomputeDurableGoalGeneration,\n\tcreateDurableGoal,\n\tDURABLE_GOAL_CHECKPOINT_SCHEMA_VERSION,\n\tDURABLE_GOAL_SCHEMA_VERSION,\n\tDURABLE_GOAL_STATUS_VALUES,\n\ttype DurableGoalCheckpoint,\n\ttype DurableGoalCheckpointInput,\n\ttype DurableGoalCommand,\n\tDurableGoalError,\n\ttype DurableGoalErrorCode,\n\ttype DurableGoalEvidence,\n\ttype DurableGoalRef,\n\ttype DurableGoalSnapshot,\n\ttype DurableGoalStatus,\n\tfreshDurableGoalEvidence,\n} from \"./core/durable-goal.ts\";\nexport {\n\tcreateDurableGoalCheckpoint,\n\tformatDurableGoalCheckpoint,\n\tparseDurableGoalCheckpoint,\n\tparseDurableGoalCheckpointCommand,\n} from \"./core/durable-goal-checkpoint.ts\";\nexport { parseDurableGoalSnapshot } from \"./core/durable-goal-parse.ts\";\nexport { applyDurableGoalCommand } from \"./core/durable-goal-reducer.ts\";\nexport {\n\ttype GoalContinuationDecision,\n\ttype GoalContinuationInput,\n\tdecideGoalContinuation,\n} from \"./core/goal-continuation.ts\";\nexport { isSessionModelOverflow, shouldSkipCompactionCheck } from \"./core/compaction-gate.ts\";\nexport {\n\tdetectIdenticalLoop,\n\ttype LoopDetection,\n\ttype LoopPolicy,\n\ttype LoopRecord,\n} from \"./core/identical-loop.ts\";\nexport {\n\ttype PromptPreset,\n\ttype PromptPresetId,\n\tPROMPT_PRESET_IDS,\n\tresolvePromptPreset,\n} from \"./core/prompt-preset.ts\";\nexport {\n\tcomputeRetryDelayMs,\n\tfailoverModelKey,\n\tisFailoverTriggerError,\n\tisRetryableAssistantError,\n\tnextRetryAttempt,\n} from \"./core/provider-retry.ts\";\nexport { computePromptTokenBudget, computeResponseReserveTokens } from \"./core/prompt-budget.ts\";\nexport {\n\tclassifyPromptCacheTransition,\n\ttype PromptCacheTransition,\n\ttype PromptCacheTransitionKind,\n} from \"./core/prompt-cache.ts\";\nexport {\n\ttype SessionSystemPromptAssembly,\n\ttype SessionSystemPromptInput,\n\tassembleSessionSystemPrompt,\n} from \"./core/session-system-prompt.ts\";\nexport {\n\tapplyToolPairRepair,\n\ttype ToolContentBlock,\n\ttype ToolPairMessage,\n} from \"./core/tool-pair-repair.ts\";\nexport {\n\ttype SpillInput,\n\ttype SpillResult,\n\tspillTruncatedOutput,\n} from \"./core/tools/artifact-spill.ts\";\nexport {\n\tDURABLE_GOAL_JOURNAL_SCHEMA_VERSION,\n\ttype DurableGoalJournal,\n\tDurableGoalStore,\n} from \"./core/durable-goal-store.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionMode,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport { extractNpmPackageTarball } from \"./core/package-archive.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\nexport {\n\textractReverseSkillFactsFromMarkdown,\n\tformatReverseSkillFromSource,\n\tformatReverseSkillMarkdown,\n\tformatReverseSkillRouteDecision,\n\tgetReverseSkillToolAliases,\n\tnormalizeReverseSkillName,\n\tnormalizeReverseSkillText,\n\tplanReverseSkillToolChecks,\n\tREVERSE_SKILL_ROUTES,\n\ttype ReverseSkillPlatform,\n\ttype ReverseSkillRisk,\n\ttype ReverseSkillRoute,\n\ttype ReverseSkillRouteDecision,\n\ttype ReverseSkillRouteInput,\n\ttype ReverseSkillRouteScore,\n\ttype ReverseSkillSourceFacts,\n\ttype ReverseSkillSourceInput,\n\ttype ReverseSkillSpecInput,\n\trouteReverseSkill,\n} from \"./core/reverse-skill.ts\";\nexport {\n\tappendRunJournalRecordDurably,\n\ttype OpenRunJournalStoreOptions,\n\ttype RunJournalQuarantineReport,\n\tRunJournalStore,\n\tRunJournalStoreCorruptionError,\n\twriteQuarantineBytesDurably,\n} from \"./core/run-journal-store.ts\";\nexport {\n\ttype BashSandboxMode,\n\tcreateWorkspaceSandboxPolicy,\n\tresolveBashSandboxMode,\n} from \"./core/sandbox/default-policy.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\ttype CompactionProvenanceDetails,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionQuarantineReport,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\tclassifySessionTermination,\n\tformatSessionTermination,\n\ttype SessionTermination,\n\ttype SessionTerminationCause,\n\tSessionTerminationError,\n\ttype SessionTerminationKind,\n} from \"./core/session-termination.ts\";\nexport {\n\ttype AgentRuntimeSettings,\n\ttype CompactionSettings,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype ToolSchedulerSetting,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\ttype LocalBashOperationsOptions,\n\tcreateDiagnosticsTool,\n\tcreateDiagnosticsToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype DiagnosticLine,\n\ttype DiagnosticsToolDetails,\n\ttype DiagnosticsToolInput,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\tcreateVerifiedBashOperations,\n\texecuteVerifiedBash,\n\texecuteVerifiedLocalBash,\n\tVERIFIED_BASH_REDACTION_POLICY_ID,\n\tVerifiedBashAdapterError,\n\ttype VerifiedBashExecutionRequest,\n\ttype VerifiedBashOperationsBinding,\n\ttype VerifiedLocalBashExecutionRequest,\n} from \"./core/verified-bash-adapter.ts\";\nexport { isVerifiedBashEnabled, resolveSessionWorkspaceScope } from \"./core/verified-bash-runtime.ts\";\nexport { resolveSessionWorkspaceScopeReport } from \"./core/verified-bash-runtime.ts\";\nexport type { SessionScopeCompleteness, SessionWorkspaceScopeReport } from \"./core/verified-bash-runtime.ts\";\n// Execution-bound evidence\nexport {\n\ttype CommandHmacBinder,\n\tCommandRedactionError,\n\tcreateCommandHmacBinder,\n\tEVIDENCE_COMMAND_REDACTION_POLICY_ID,\n\tMAX_COMMAND_REDACTION_PLACEHOLDERS,\n\tparseCommandHmacBinding,\n\tparseCommandRedactionSummary,\n\ttype RedactedCommandDescriptor,\n\tredactCommandDescriptor,\n} from \"./guardrails/command-redaction.ts\";\nexport { evidenceReceiptToObservation } from \"./guardrails/evidence-protocol.ts\";\nexport {\n\tcomputeEvidenceCommandSha256,\n\tcomputeEvidenceReceiptCoreSha256,\n\tconstantTimeSha256Equal,\n\tcreateEvidenceReceipt,\n\tevidenceReceiptReplayPayload,\n\tisSafeEvidenceReceiptId,\n\tisSha256Hex,\n\tparseEvidenceReceipt,\n\tparseSha256Hex,\n\tvalidateEvidenceReceipt,\n\twithEvidenceReceiptEnvelope,\n} from \"./guardrails/evidence-receipt.ts\";\nexport {\n\tEvidenceReceiptStore,\n\ttype EvidenceReceiptStoreFaultStage,\n\ttype EvidenceReceiptStoreOptions,\n} from \"./guardrails/evidence-receipt-store.ts\";\nexport {\n\tEvidenceGate,\n\ttype EvidenceGateOptions,\n\tFailClosedMergeGate,\n\tlatestRelevantWorkspaceMutationSeq,\n\tReplayLedgerManager,\n\tTaskContractBuilder,\n} from \"./guardrails/evidence-system.ts\";\nexport {\n\ttype VerifiedEvidenceExecutionOutcome,\n\ttype VerifiedEvidenceExecutionRequest,\n\ttype VerifiedEvidenceExecutionResult,\n\tVerifiedEvidenceExecutor,\n\tVerifiedEvidenceExecutorError,\n\ttype VerifiedEvidenceExecutorOptions,\n\ttype VerifiedEvidenceMetadata,\n} from \"./guardrails/verified-executor.ts\";\nexport {\n\tcaptureWorkspaceFingerprint,\n\tcomputeGitWorkspaceDirtySha256,\n\tcomputeGitWorkspaceManifestSha256,\n\tcomputeWorkspaceManifestSha256,\n\tparseWorkspaceFingerprint,\n} from \"./guardrails/workspace-fingerprint.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\nexport type {\n\tArtifactSetWorkspaceFingerprint,\n\tArtifactState,\n\tCommandHmacBinding,\n\tCommandRedactionPlaceholder,\n\tCommandRedactionPlaceholderType,\n\tCommandRedactionSummary,\n\tEvidenceCommandDescriptor,\n\tEvidenceExecutor,\n\tEvidenceItem,\n\tEvidenceReceipt,\n\tEvidenceReceiptDisposition,\n\tEvidenceReceiptLedgerBinding,\n\tEvidenceReceiptMode,\n\tFileArtifactState,\n\tGitWorkspaceFingerprint,\n\tGitWorkspaceState,\n\tMissingArtifactState,\n\tReplayEvent,\n\tReplayEventType,\n\tReplayPayloadHashAlgorithm,\n\tSha256Hex,\n\tTaskContract,\n\tWorkspaceFingerprint,\n\tWorkspaceMutationReplayPayload,\n\tWorkspaceScope,\n} from \"./types/evidence.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
package/dist/index.js
CHANGED
|
@@ -58,6 +58,7 @@ export { createSyntheticSourceInfo } from "./core/source-info.js";
|
|
|
58
58
|
export { createBashToolDefinition, createDiagnosticsTool, createDiagnosticsToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
59
59
|
export { createVerifiedBashOperations, executeVerifiedBash, executeVerifiedLocalBash, VERIFIED_BASH_REDACTION_POLICY_ID, VerifiedBashAdapterError, } from "./core/verified-bash-adapter.js";
|
|
60
60
|
export { isVerifiedBashEnabled, resolveSessionWorkspaceScope } from "./core/verified-bash-runtime.js";
|
|
61
|
+
export { resolveSessionWorkspaceScopeReport } from "./core/verified-bash-runtime.js";
|
|
61
62
|
// Execution-bound evidence
|
|
62
63
|
export { CommandRedactionError, createCommandHmacBinder, EVIDENCE_COMMAND_REDACTION_POLICY_ID, MAX_COMMAND_REDACTION_PLACEHOLDERS, parseCommandHmacBinding, parseCommandRedactionSummary, redactCommandDescriptor, } from "./guardrails/command-redaction.js";
|
|
63
64
|
export { evidenceReceiptToObservation } from "./guardrails/evidence-protocol.js";
|