open-multi-agent-kit 0.98.1 → 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.
Files changed (86) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +2 -2
  3. package/dist/cli/mcp-attach.d.ts +15 -0
  4. package/dist/cli/mcp-attach.d.ts.map +1 -0
  5. package/dist/cli/mcp-attach.js +14 -0
  6. package/dist/cli/mcp-attach.js.map +1 -0
  7. package/dist/core/advisory-judge-model.d.ts.map +1 -1
  8. package/dist/core/advisory-judge-model.js +8 -1
  9. package/dist/core/advisory-judge-model.js.map +1 -1
  10. package/dist/core/advisory-judge-types.d.ts +18 -1
  11. package/dist/core/advisory-judge-types.d.ts.map +1 -1
  12. package/dist/core/advisory-judge-types.js.map +1 -1
  13. package/dist/core/advisory-judge.d.ts.map +1 -1
  14. package/dist/core/advisory-judge.js +41 -6
  15. package/dist/core/advisory-judge.js.map +1 -1
  16. package/dist/core/agent-session.d.ts +7 -0
  17. package/dist/core/agent-session.d.ts.map +1 -1
  18. package/dist/core/agent-session.js +66 -14
  19. package/dist/core/agent-session.js.map +1 -1
  20. package/dist/core/auth-storage.d.ts +19 -2
  21. package/dist/core/auth-storage.d.ts.map +1 -1
  22. package/dist/core/auth-storage.js +57 -6
  23. package/dist/core/auth-storage.js.map +1 -1
  24. package/dist/core/compaction/oauth-recovery.d.ts +29 -0
  25. package/dist/core/compaction/oauth-recovery.d.ts.map +1 -0
  26. package/dist/core/compaction/oauth-recovery.js +40 -0
  27. package/dist/core/compaction/oauth-recovery.js.map +1 -0
  28. package/dist/core/model-registry.d.ts +10 -1
  29. package/dist/core/model-registry.d.ts.map +1 -1
  30. package/dist/core/model-registry.js +16 -2
  31. package/dist/core/model-registry.js.map +1 -1
  32. package/dist/core/provider-resilience.d.ts +8 -0
  33. package/dist/core/provider-resilience.d.ts.map +1 -1
  34. package/dist/core/provider-resilience.js +17 -0
  35. package/dist/core/provider-resilience.js.map +1 -1
  36. package/dist/core/provider-usage.d.ts +1 -1
  37. package/dist/core/provider-usage.d.ts.map +1 -1
  38. package/dist/core/provider-usage.js +3 -2
  39. package/dist/core/provider-usage.js.map +1 -1
  40. package/dist/core/session-bash-runtime.d.ts +7 -0
  41. package/dist/core/session-bash-runtime.d.ts.map +1 -1
  42. package/dist/core/session-bash-runtime.js +10 -1
  43. package/dist/core/session-bash-runtime.js.map +1 -1
  44. package/dist/core/session-failure-cause.d.ts.map +1 -1
  45. package/dist/core/session-failure-cause.js +7 -1
  46. package/dist/core/session-failure-cause.js.map +1 -1
  47. package/dist/core/session-termination.d.ts.map +1 -1
  48. package/dist/core/session-termination.js +3 -1
  49. package/dist/core/session-termination.js.map +1 -1
  50. package/dist/core/verified-bash-runtime.d.ts +40 -0
  51. package/dist/core/verified-bash-runtime.d.ts.map +1 -1
  52. package/dist/core/verified-bash-runtime.js +66 -17
  53. package/dist/core/verified-bash-runtime.js.map +1 -1
  54. package/dist/guardrails/workspace-fingerprint.d.ts +2 -0
  55. package/dist/guardrails/workspace-fingerprint.d.ts.map +1 -1
  56. package/dist/guardrails/workspace-fingerprint.js +12 -10
  57. package/dist/guardrails/workspace-fingerprint.js.map +1 -1
  58. package/dist/index.d.ts +2 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +1 -0
  61. package/dist/index.js.map +1 -1
  62. package/dist/main.d.ts.map +1 -1
  63. package/dist/main.js +7 -0
  64. package/dist/main.js.map +1 -1
  65. package/docs/advisory-selection.md +112 -0
  66. package/docs/book-to-skill.md +17 -0
  67. package/docs/docs.json +4 -0
  68. package/docs/index.md +2 -0
  69. package/docs/mcp.md +10 -2
  70. package/docs/release-audit-0.98.3.md +97 -0
  71. package/docs/run-protocol.md +3 -1
  72. package/docs/runtime-algorithms.md +19 -2
  73. package/docs/sdk.md +24 -1
  74. package/docs/security.md +4 -9
  75. package/examples/extensions/custom-provider-anthropic/index.ts +4 -1
  76. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  77. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  78. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  79. package/examples/extensions/gondolin/package-lock.json +2 -2
  80. package/examples/extensions/gondolin/package.json +1 -1
  81. package/examples/extensions/sandbox/package-lock.json +2 -2
  82. package/examples/extensions/sandbox/package.json +1 -1
  83. package/examples/extensions/with-deps/package-lock.json +2 -2
  84. package/examples/extensions/with-deps/package.json +1 -1
  85. package/npm-shrinkwrap.json +18 -18
  86. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-fingerprint.js","sourceRoot":"","sources":["../../src/guardrails/workspace-fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACN,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAYnF,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,yBAAyB,GAAG,yCAAyC,CAAC;AAC5E,MAAM,gBAAgB,GAAG,mDAAmD,CAAC;AAC7E,8CAA8C;AAC9C,MAAM,cAAc,GAAG,iCAAiC,CAAC;AACzD,+DAA+D;AAC/D,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,sBAAsB,GAAG,MAAM,CAAC;AACtC,+FAA+F;AAC/F,MAAM,mBAAmB,GAAG;IAC3B,kCAAkC;IAClC,yBAAyB;IACzB,gBAAgB;IAChB,eAAe;IACf,SAAS;IACT,mBAAmB;IACnB,gBAAgB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CAAC;IAC5D,MAAM,cAAc,GAAmB,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAC5G,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,8BAA8B,CAAC,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IACD,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CACpD,uBAAuB,CAAC,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,CAAC,CACrE,CAAC;IACF,MAAM,WAAW,GAAG;QACnB,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,cAAc,EAAE,8BAA8B,CAAC,cAAc,EAAE,SAAS,CAAC;KACzE,CAAC;IACF,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;AAAA,CAC9C","sourcesContent":["import { spawnSync } from \"node:child_process\";\nimport { createHash, timingSafeEqual } from \"node:crypto\";\nimport type { Stats } from \"node:fs\";\nimport {\n\tcloseSync,\n\tconstants as fsConstants,\n\tfstatSync,\n\tlstatSync,\n\topenSync,\n\treadFileSync,\n\trealpathSync,\n} from \"node:fs\";\nimport { isAbsolute, join, posix, relative, resolve, sep, win32 } from \"node:path\";\nimport type {\n\tArtifactSetWorkspaceFingerprint,\n\tArtifactState,\n\tFileArtifactState,\n\tGitWorkspaceFingerprint,\n\tGitWorkspaceState,\n\tSha256Hex,\n\tWorkspaceFingerprint,\n\tWorkspaceScope,\n} from \"../types/evidence.ts\";\n\nconst SHA256_HEX = /^[0-9a-f]{64}$/;\nconst WORKSPACE_MANIFEST_DOMAIN = \"omk:evidence:workspace-fingerprint:v1\\0\";\nconst GIT_DIRTY_DOMAIN = \"omk:evidence:workspace-fingerprint:git-dirty:v1\\0\";\n/** Full SHA-1 or SHA-256 git object names. */\nconst GIT_COMMIT_HEX = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;\n/** Hard bound on bytes accepted from one git child process. */\nconst MAX_GIT_OUTPUT_BYTES = 16 * 1024 * 1024;\nconst GIT_CAPTURE_TIMEOUT_MS = 30_000;\n/** Inherited variables that could redirect git away from the trusted root; always stripped. */\nconst UNSAFE_GIT_ENV_VARS = [\n\t\"GIT_ALTERNATE_OBJECT_DIRECTORIES\",\n\t\"GIT_CEILING_DIRECTORIES\",\n\t\"GIT_COMMON_DIR\",\n\t\"GIT_DIFF_OPTS\",\n\t\"GIT_DIR\",\n\t\"GIT_EXTERNAL_DIFF\",\n\t\"GIT_INDEX_FILE\",\n\t\"GIT_NAMESPACE\",\n\t\"GIT_OBJECT_DIRECTORY\",\n\t\"GIT_PREFIX\",\n\t\"GIT_WORK_TREE\",\n] as const;\n/** Deterministic scope-limited diff rendering, independent of local prefix/ext-diff config. */\nconst GIT_DIFF_ARGS = [\n\t\"--full-index\",\n\t\"--binary\",\n\t\"--no-color\",\n\t\"--no-ext-diff\",\n\t\"--no-textconv\",\n\t\"--no-renames\",\n\t\"--ignore-submodules=none\",\n\t\"--src-prefix=a/\",\n\t\"--dst-prefix=b/\",\n] as const;\n\ntype FileStat = Stats;\n\nexport type WorkspaceFingerprintCaptureFaultStage = \"before-artifact-open\";\n\nexport interface WorkspaceFingerprintCaptureOptions {\n\t/** Tests only: mutate a selected path immediately before its artifact is opened. */\n\treadonly faultInjector?: (stage: WorkspaceFingerprintCaptureFaultStage, artifactPath: string) => void;\n}\n\ninterface ParentIdentity {\n\treadonly path: string;\n\treadonly stat: FileStat;\n}\n\nfunction errorCode(error: unknown): string | undefined {\n\treturn typeof error === \"object\" && error !== null && \"code\" in error\n\t\t? String((error as { code?: unknown }).code)\n\t\t: undefined;\n}\n\nfunction sha256(value: Uint8Array | string): Sha256Hex {\n\treturn createHash(\"sha256\").update(value).digest(\"hex\") as Sha256Hex;\n}\n\nfunction exactObject(value: unknown, label: string, keys: readonly string[]): Record<string, unknown> {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(`${label} must be an object`);\n\t}\n\tconst descriptors = Object.getOwnPropertyDescriptors(value);\n\tconst actual = Object.entries(descriptors)\n\t\t.filter(([, descriptor]) => descriptor.enumerable)\n\t\t.map(([key]) => key)\n\t\t.sort();\n\tconst expected = [...keys].sort();\n\tif (\n\t\tactual.length !== expected.length ||\n\t\tactual.some((key, index) => key !== expected[index]) ||\n\t\tkeys.some((key) => {\n\t\t\tconst descriptor = descriptors[key];\n\t\t\treturn descriptor === undefined || descriptor.enumerable !== true || !(\"value\" in descriptor);\n\t\t})\n\t) {\n\t\tthrow new Error(`${label} has an invalid key set`);\n\t}\n\tconst snapshot: Record<string, unknown> = {};\n\tfor (const key of actual) {\n\t\tconst descriptor = descriptors[key];\n\t\tif (descriptor === undefined || !(\"value\" in descriptor)) {\n\t\t\tthrow new Error(`${label} has an invalid key set`);\n\t\t}\n\t\tsnapshot[key] = descriptor.value;\n\t}\n\treturn snapshot;\n}\n\nfunction ownEnumerableDataProperty(record: Record<string, unknown>, label: string, key: string): unknown {\n\tconst descriptor = Object.getOwnPropertyDescriptor(record, key);\n\tif (descriptor === undefined || descriptor.enumerable !== true || !(\"value\" in descriptor)) {\n\t\tthrow new Error(`${label} has an invalid key set`);\n\t}\n\treturn descriptor.value;\n}\n\nfunction exactArray(value: unknown, label: string): unknown[] {\n\tif (!Array.isArray(value)) throw new Error(`${label} must be an array`);\n\tconst descriptors = Object.getOwnPropertyDescriptors(value);\n\tconst lengthDescriptor = descriptors.length as PropertyDescriptor | undefined;\n\tif (lengthDescriptor === undefined || !(\"value\" in lengthDescriptor)) {\n\t\tthrow new Error(`${label} has invalid index properties`);\n\t}\n\tconst rawLength = lengthDescriptor.value;\n\tif (!Number.isSafeInteger(rawLength) || (rawLength as number) < 0) {\n\t\tthrow new Error(`${label} has invalid index properties`);\n\t}\n\tconst length = rawLength as number;\n\tconst snapshot: unknown[] = [];\n\tfor (let index = 0; index < length; index++) {\n\t\tconst descriptor = descriptors[String(index)];\n\t\tif (descriptor === undefined || descriptor.enumerable !== true || !(\"value\" in descriptor)) {\n\t\t\tthrow new Error(`${label} must use own enumerable data index properties`);\n\t\t}\n\t\tsnapshot.push(descriptor.value);\n\t}\n\tconst enumerableKeys = Object.entries(descriptors)\n\t\t.filter(([, descriptor]) => descriptor.enumerable)\n\t\t.map(([key]) => key);\n\tif (enumerableKeys.length !== length || enumerableKeys.some((key, index) => key !== String(index))) {\n\t\tthrow new Error(`${label} must use own enumerable data index properties`);\n\t}\n\treturn snapshot;\n}\n\nfunction assertNormalizedArtifactPath(path: unknown, label = \"artifact path\"): asserts path is string {\n\tif (\n\t\ttypeof path !== \"string\" ||\n\t\tpath.length === 0 ||\n\t\tpath.includes(\"\\0\") ||\n\t\tpath.includes(\"\\\\\") ||\n\t\tisAbsolute(path) ||\n\t\twin32.isAbsolute(path) ||\n\t\tpath === \".\" ||\n\t\tposix.normalize(path) !== path ||\n\t\tpath.split(\"/\").some((segment) => segment === \"\" || segment === \".\" || segment === \"..\")\n\t) {\n\t\tthrow new Error(`${label} must be a normalized root-relative path`);\n\t}\n}\n\nfunction assertSortedUniquePaths(paths: readonly string[], label: string): void {\n\tfor (let index = 0; index < paths.length; index++) {\n\t\tassertNormalizedArtifactPath(paths[index], `${label}[${index}]`);\n\t\tif (index > 0 && paths[index - 1] >= paths[index]) {\n\t\t\tthrow new Error(`${label} must be sorted and contain no duplicates`);\n\t\t}\n\t}\n}\n\nfunction parseSha256(value: unknown, label: string): Sha256Hex {\n\tif (typeof value !== \"string\" || !SHA256_HEX.test(value)) {\n\t\tthrow new Error(`${label} must be a lowercase SHA-256 hex digest`);\n\t}\n\treturn value as Sha256Hex;\n}\n\nfunction parseScope(value: unknown): WorkspaceScope {\n\tconst scope = exactObject(value, \"workspace scope\", [\"root\", \"artifactPaths\"]);\n\tif (typeof scope.root !== \"string\" || scope.root.length === 0 || !isAbsolute(scope.root)) {\n\t\tthrow new Error(\"workspace scope root must be an absolute path\");\n\t}\n\tconst rawArtifactPaths = exactArray(scope.artifactPaths, \"workspace scope artifactPaths\");\n\tif (!rawArtifactPaths.every((path) => typeof path === \"string\")) {\n\t\tthrow new Error(\"workspace scope artifactPaths must be a string array\");\n\t}\n\tconst artifactPaths = [...rawArtifactPaths] as string[];\n\tassertSortedUniquePaths(artifactPaths, \"workspace scope artifactPaths\");\n\treturn Object.freeze({ root: scope.root, artifactPaths: Object.freeze(artifactPaths) });\n}\n\nfunction parseArtifact(value: unknown, index: number): ArtifactState {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(`workspace artifact[${index}] must be an object`);\n\t}\n\tconst candidate = value as Record<string, unknown>;\n\tconst state = ownEnumerableDataProperty(candidate, `workspace artifact[${index}]`, \"state\");\n\tif (state === \"missing\") {\n\t\tconst artifact = exactObject(value, `workspace artifact[${index}]`, [\"path\", \"state\"]);\n\t\tassertNormalizedArtifactPath(artifact.path, `workspace artifact[${index}].path`);\n\t\treturn Object.freeze({ path: artifact.path, state: \"missing\" });\n\t}\n\tif (state === \"file\") {\n\t\tconst artifact = exactObject(value, `workspace artifact[${index}]`, [\"path\", \"state\", \"sha256\", \"size\"]);\n\t\tassertNormalizedArtifactPath(artifact.path, `workspace artifact[${index}].path`);\n\t\tif (!Number.isSafeInteger(artifact.size) || (artifact.size as number) < 0) {\n\t\t\tthrow new Error(`workspace artifact[${index}].size must be a non-negative safe integer`);\n\t\t}\n\t\treturn Object.freeze({\n\t\t\tpath: artifact.path,\n\t\t\tstate: \"file\",\n\t\t\tsha256: parseSha256(artifact.sha256, `workspace artifact[${index}].sha256`),\n\t\t\tsize: artifact.size as number,\n\t\t});\n\t}\n\tthrow new Error(`workspace artifact[${index}].state must be file or missing`);\n}\n\nfunction canonicalManifest(scope: WorkspaceScope, artifacts: readonly ArtifactState[]): string {\n\treturn JSON.stringify({\n\t\tkind: \"artifact-set\",\n\t\tscope: { root: scope.root, artifactPaths: scope.artifactPaths },\n\t\tartifacts: artifacts.map((artifact) =>\n\t\t\tartifact.state === \"file\"\n\t\t\t\t? { path: artifact.path, state: artifact.state, sha256: artifact.sha256, size: artifact.size }\n\t\t\t\t: { path: artifact.path, state: artifact.state },\n\t\t),\n\t});\n}\n\n/** Compute the domain-separated digest for an already validated canonical manifest. */\nexport function computeWorkspaceManifestSha256(scope: WorkspaceScope, artifacts: readonly ArtifactState[]): Sha256Hex {\n\treturn sha256(`${WORKSPACE_MANIFEST_DOMAIN}${canonicalManifest(scope, artifacts)}`);\n}\n\n/** Canonical digest committing sorted changed paths, both diff digests, and every selected artifact state. */\nexport function computeGitWorkspaceDirtySha256(\n\tchangedPaths: readonly string[],\n\tstagedDiffSha256: Sha256Hex,\n\tunstagedDiffSha256: Sha256Hex,\n\tartifacts: readonly ArtifactState[],\n): Sha256Hex {\n\tconst canonical = JSON.stringify({\n\t\tchangedPaths,\n\t\tstagedDiffSha256,\n\t\tunstagedDiffSha256,\n\t\tartifacts: artifacts.map((artifact) =>\n\t\t\tartifact.state === \"file\"\n\t\t\t\t? { path: artifact.path, state: artifact.state, sha256: artifact.sha256, size: artifact.size }\n\t\t\t\t: { path: artifact.path, state: artifact.state },\n\t\t),\n\t});\n\treturn sha256(`${GIT_DIRTY_DOMAIN}${canonical}`);\n}\n\n/** Compute the domain-separated digest for an already validated canonical git manifest. */\nexport function computeGitWorkspaceManifestSha256(\n\tscope: WorkspaceScope,\n\tartifacts: readonly ArtifactState[],\n\tgit: GitWorkspaceState,\n): Sha256Hex {\n\tconst canonical = JSON.stringify({\n\t\tkind: \"git\",\n\t\tscope: { root: scope.root, artifactPaths: scope.artifactPaths },\n\t\tartifacts: artifacts.map((artifact) =>\n\t\t\tartifact.state === \"file\"\n\t\t\t\t? { path: artifact.path, state: artifact.state, sha256: artifact.sha256, size: artifact.size }\n\t\t\t\t: { path: artifact.path, state: artifact.state },\n\t\t),\n\t\tgit: {\n\t\t\theadCommit: git.headCommit,\n\t\t\tchangedPaths: git.changedPaths,\n\t\t\tstagedDiffSha256: git.stagedDiffSha256,\n\t\t\tunstagedDiffSha256: git.unstagedDiffSha256,\n\t\t\tdirtySha256: git.dirtySha256,\n\t\t},\n\t});\n\treturn sha256(`${WORKSPACE_MANIFEST_DOMAIN}${canonical}`);\n}\n\n/** A changed path is inside scope when it equals a selected path or lies under a selected directory. */\nfunction isWithinScope(path: string, artifactPaths: readonly string[]): boolean {\n\treturn artifactPaths.some((artifact) => path === artifact || path.startsWith(`${artifact}/`));\n}\n\nfunction digestsEqual(left: Sha256Hex, right: Sha256Hex): boolean {\n\treturn timingSafeEqual(Buffer.from(left, \"hex\"), Buffer.from(right, \"hex\"));\n}\n\nfunction parseGitFingerprint(value: unknown): GitWorkspaceFingerprint {\n\tconst raw = exactObject(value, \"workspace fingerprint\", [\"kind\", \"scope\", \"artifacts\", \"git\", \"manifestSha256\"]);\n\tconst scope = parseScope(raw.scope);\n\tconst rawArtifacts = exactArray(raw.artifacts, \"workspace fingerprint artifacts\");\n\tconst artifacts = rawArtifacts.map((artifact, index) => parseArtifact(artifact, index));\n\tconst artifactPaths = artifacts.map((artifact) => artifact.path);\n\tassertSortedUniquePaths(artifactPaths, \"workspace artifact paths\");\n\tif (\n\t\tartifactPaths.length !== scope.artifactPaths.length ||\n\t\tartifactPaths.some((path, index) => path !== scope.artifactPaths[index])\n\t) {\n\t\tthrow new Error(\"workspace artifacts must exactly match the selected scope paths\");\n\t}\n\tconst rawGit = exactObject(raw.git, \"workspace git state\", [\n\t\t\"headCommit\",\n\t\t\"changedPaths\",\n\t\t\"stagedDiffSha256\",\n\t\t\"unstagedDiffSha256\",\n\t\t\"dirtySha256\",\n\t]);\n\tconst headCommit = rawGit.headCommit;\n\tif (headCommit !== null && (typeof headCommit !== \"string\" || !GIT_COMMIT_HEX.test(headCommit))) {\n\t\tthrow new Error(\"workspace git headCommit must be null or a full lowercase hex object name\");\n\t}\n\tconst rawChangedPaths = exactArray(rawGit.changedPaths, \"workspace git changedPaths\");\n\tif (!rawChangedPaths.every((path) => typeof path === \"string\")) {\n\t\tthrow new Error(\"workspace git changedPaths must be a string array\");\n\t}\n\tconst changedPaths = [...rawChangedPaths] as string[];\n\tassertSortedUniquePaths(changedPaths, \"workspace git changedPaths\");\n\tfor (const path of changedPaths) {\n\t\tif (!isWithinScope(path, scope.artifactPaths)) {\n\t\t\tthrow new Error(`workspace git changed path escapes the selected scope: ${path}`);\n\t\t}\n\t}\n\tconst stagedDiffSha256 = parseSha256(rawGit.stagedDiffSha256, \"workspace git stagedDiffSha256\");\n\tconst unstagedDiffSha256 = parseSha256(rawGit.unstagedDiffSha256, \"workspace git unstagedDiffSha256\");\n\tconst dirtySha256 = parseSha256(rawGit.dirtySha256, \"workspace git dirtySha256\");\n\tif (\n\t\t!digestsEqual(\n\t\t\tdirtySha256,\n\t\t\tcomputeGitWorkspaceDirtySha256(changedPaths, stagedDiffSha256, unstagedDiffSha256, artifacts),\n\t\t)\n\t) {\n\t\tthrow new Error(\"workspace git dirty digest mismatch\");\n\t}\n\tconst git: GitWorkspaceState = Object.freeze({\n\t\theadCommit,\n\t\tchangedPaths: Object.freeze(changedPaths),\n\t\tstagedDiffSha256,\n\t\tunstagedDiffSha256,\n\t\tdirtySha256,\n\t});\n\tconst manifestSha256 = parseSha256(raw.manifestSha256, \"workspace manifestSha256\");\n\tif (!digestsEqual(manifestSha256, computeGitWorkspaceManifestSha256(scope, artifacts, git))) {\n\t\tthrow new Error(\"workspace manifest digest mismatch\");\n\t}\n\treturn Object.freeze({\n\t\tkind: \"git\",\n\t\tscope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tgit,\n\t\tmanifestSha256,\n\t});\n}\n\n/** Strictly parse and validate a fingerprint of either kind, including its canonical digests. */\nexport function parseWorkspaceFingerprint(value: unknown): WorkspaceFingerprint {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(\"workspace fingerprint must be an object\");\n\t}\n\tconst kind = ownEnumerableDataProperty(value as Record<string, unknown>, \"workspace fingerprint\", \"kind\");\n\tif (kind === \"git\") return parseGitFingerprint(value);\n\tif (kind !== \"artifact-set\") {\n\t\tthrow new Error(\"workspace fingerprint kind must be artifact-set or git\");\n\t}\n\treturn parseArtifactSetFingerprint(value);\n}\n\nfunction parseArtifactSetFingerprint(value: unknown): ArtifactSetWorkspaceFingerprint {\n\tconst raw = exactObject(value, \"workspace fingerprint\", [\"kind\", \"scope\", \"artifacts\", \"manifestSha256\"]);\n\tif (raw.kind !== \"artifact-set\") {\n\t\tthrow new Error(\"workspace fingerprint kind must be artifact-set\");\n\t}\n\tconst scope = parseScope(raw.scope);\n\tconst rawArtifacts = exactArray(raw.artifacts, \"workspace fingerprint artifacts\");\n\tconst artifacts = rawArtifacts.map((artifact, index) => parseArtifact(artifact, index));\n\tconst artifactPaths = artifacts.map((artifact) => artifact.path);\n\tassertSortedUniquePaths(artifactPaths, \"workspace artifact paths\");\n\tif (\n\t\tartifactPaths.length !== scope.artifactPaths.length ||\n\t\tartifactPaths.some((path, index) => path !== scope.artifactPaths[index])\n\t) {\n\t\tthrow new Error(\"workspace artifacts must exactly match the selected scope paths\");\n\t}\n\tconst manifestSha256 = parseSha256(raw.manifestSha256, \"workspace manifestSha256\");\n\tconst expected = computeWorkspaceManifestSha256(scope, artifacts);\n\tif (!digestsEqual(manifestSha256, expected)) {\n\t\tthrow new Error(\"workspace manifest digest mismatch\");\n\t}\n\treturn Object.freeze({\n\t\tkind: \"artifact-set\",\n\t\tscope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tmanifestSha256,\n\t});\n}\n\nfunction statPathWithoutSymlinks(root: string, artifactPath: string): FileStat | undefined {\n\tlet current = root;\n\tconst segments = artifactPath.split(\"/\");\n\tfor (let index = 0; index < segments.length; index++) {\n\t\tcurrent = join(current, segments[index]);\n\t\tlet stat: FileStat;\n\t\ttry {\n\t\t\tstat = lstatSync(current);\n\t\t} catch (error) {\n\t\t\tif (errorCode(error) === \"ENOENT\") return undefined;\n\t\t\tthrow error;\n\t\t}\n\t\tif (stat.isSymbolicLink()) {\n\t\t\tthrow new Error(`workspace artifact path contains a symlink: ${artifactPath}`);\n\t\t}\n\t\tif (index < segments.length - 1 && !stat.isDirectory()) {\n\t\t\tthrow new Error(`workspace artifact parent is not a directory: ${artifactPath}`);\n\t\t}\n\t\tif (index === segments.length - 1) return stat;\n\t}\n\treturn undefined;\n}\n\nfunction captureParentIdentities(root: string, artifactPath: string): readonly ParentIdentity[] {\n\tconst parents: ParentIdentity[] = [];\n\tlet current = root;\n\tfor (const segment of artifactPath.split(\"/\").slice(0, -1)) {\n\t\tcurrent = join(current, segment);\n\t\tconst stat = lstatSync(current);\n\t\tif (stat.isSymbolicLink()) {\n\t\t\tthrow new Error(`workspace artifact path contains a symlink: ${artifactPath}`);\n\t\t}\n\t\tif (!stat.isDirectory()) {\n\t\t\tthrow new Error(`workspace artifact parent is not a directory: ${artifactPath}`);\n\t\t}\n\t\tparents.push({ path: current, stat });\n\t}\n\treturn parents;\n}\n\nfunction hasFileIdentity(stat: FileStat): boolean {\n\treturn stat.dev !== 0 || stat.ino !== 0;\n}\n\nfunction sameFileIdentity(expected: FileStat, actual: FileStat): boolean {\n\tconst expectedHasIdentity = hasFileIdentity(expected);\n\tconst actualHasIdentity = hasFileIdentity(actual);\n\treturn (\n\t\t(!expectedHasIdentity && !actualHasIdentity) ||\n\t\t(expectedHasIdentity && actualHasIdentity && expected.dev === actual.dev && expected.ino === actual.ino)\n\t);\n}\n\nfunction isStrictlyUnder(root: string, path: string): boolean {\n\tconst relativePath = relative(root, path);\n\treturn (\n\t\trelativePath !== \"\" && relativePath !== \"..\" && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath)\n\t);\n}\n\nfunction assertTrustedRoot(root: string, trustedRootStat: FileStat): void {\n\tconst liveRootStat = lstatSync(root);\n\tif (\n\t\tliveRootStat.isSymbolicLink() ||\n\t\t!liveRootStat.isDirectory() ||\n\t\trealpathSync(root) !== root ||\n\t\t!sameFileIdentity(trustedRootStat, liveRootStat)\n\t) {\n\t\tthrow new Error(\"workspace root changed while artifacts were captured\");\n\t}\n}\n\nfunction assertParentIdentities(parents: readonly ParentIdentity[], artifactPath: string): void {\n\tfor (const parent of parents) {\n\t\tconst stat = lstatSync(parent.path);\n\t\tif (stat.isSymbolicLink() || !stat.isDirectory() || !sameFileIdentity(parent.stat, stat)) {\n\t\t\tthrow new Error(`workspace artifact parent changed while it was captured: ${artifactPath}`);\n\t\t}\n\t}\n}\n\nfunction assertLiveArtifactPath(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\ttrustedParents: readonly ParentIdentity[],\n\tartifactPath: string,\n\tfdStat: FileStat,\n): void {\n\tassertTrustedRoot(root, trustedRootStat);\n\tassertParentIdentities(trustedParents, artifactPath);\n\tconst pathStat = statPathWithoutSymlinks(root, artifactPath);\n\tif (pathStat === undefined || !pathStat.isFile() || !sameFileIdentity(fdStat, pathStat)) {\n\t\tthrow new Error(`workspace artifact path was rebound while it was captured: ${artifactPath}`);\n\t}\n\tconst fullPath = join(root, ...artifactPath.split(\"/\"));\n\tconst livePath = realpathSync(fullPath);\n\tif (!isStrictlyUnder(root, livePath)) {\n\t\tthrow new Error(`workspace artifact resolved outside the trusted root: ${artifactPath}`);\n\t}\n\tconst livePathStat = lstatSync(livePath);\n\tif (!livePathStat.isFile() || !sameFileIdentity(fdStat, livePathStat)) {\n\t\tthrow new Error(`workspace artifact path was rebound while it was captured: ${artifactPath}`);\n\t}\n\tassertParentIdentities(trustedParents, artifactPath);\n\tassertTrustedRoot(root, trustedRootStat);\n}\n\nfunction captureFile(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\ttrustedParents: readonly ParentIdentity[],\n\tartifactPath: string,\n): FileArtifactState {\n\tconst fullPath = join(root, ...artifactPath.split(\"/\"));\n\tconst flags = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0);\n\tlet fd: number;\n\ttry {\n\t\tfd = openSync(fullPath, flags);\n\t} catch (error) {\n\t\tif (errorCode(error) === \"ELOOP\") {\n\t\t\tthrow new Error(`workspace artifact path contains a symlink: ${artifactPath}`);\n\t\t}\n\t\tthrow error;\n\t}\n\ttry {\n\t\tconst before = fstatSync(fd);\n\t\tif (!before.isFile()) {\n\t\t\tthrow new Error(`workspace artifact is not a regular file: ${artifactPath}`);\n\t\t}\n\t\tassertLiveArtifactPath(root, trustedRootStat, trustedParents, artifactPath, before);\n\t\tconst bytes = readFileSync(fd);\n\t\tconst after = fstatSync(fd);\n\t\tassertLiveArtifactPath(root, trustedRootStat, trustedParents, artifactPath, after);\n\t\tif (\n\t\t\t!after.isFile() ||\n\t\t\t!sameFileIdentity(before, after) ||\n\t\t\tbefore.size !== after.size ||\n\t\t\tbefore.mtimeMs !== after.mtimeMs ||\n\t\t\tbefore.ctimeMs !== after.ctimeMs ||\n\t\t\tafter.size !== bytes.byteLength\n\t\t) {\n\t\t\tthrow new Error(`workspace artifact changed while it was captured: ${artifactPath}`);\n\t\t}\n\t\treturn Object.freeze({ path: artifactPath, state: \"file\", sha256: sha256(bytes), size: bytes.byteLength });\n\t} finally {\n\t\tcloseSync(fd);\n\t}\n}\n\nfunction captureSelectedArtifact(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\tartifactPath: string,\n\toptions: WorkspaceFingerprintCaptureOptions,\n): ArtifactState {\n\tassertTrustedRoot(root, trustedRootStat);\n\tconst stat = statPathWithoutSymlinks(root, artifactPath);\n\tif (stat === undefined) {\n\t\tassertTrustedRoot(root, trustedRootStat);\n\t\treturn Object.freeze({ path: artifactPath, state: \"missing\" });\n\t}\n\tif (!stat.isFile()) {\n\t\tthrow new Error(`workspace artifact is not a regular file: ${artifactPath}`);\n\t}\n\tconst trustedParents = captureParentIdentities(root, artifactPath);\n\toptions.faultInjector?.(\"before-artifact-open\", artifactPath);\n\treturn captureFile(root, trustedRootStat, trustedParents, artifactPath);\n}\n\n/** True when the trusted root itself hosts a `.git` entry; a symlinked `.git` fails closed. */\nfunction isGitWorkspaceRoot(root: string): boolean {\n\tlet stat: FileStat;\n\ttry {\n\t\tstat = lstatSync(join(root, \".git\"));\n\t} catch (error) {\n\t\tif (errorCode(error) === \"ENOENT\") return false;\n\t\tthrow error;\n\t}\n\tif (stat.isSymbolicLink()) {\n\t\tthrow new Error(\"workspace root .git must not be a symlink\");\n\t}\n\treturn true;\n}\n\nfunction gitCaptureEnv(): NodeJS.ProcessEnv {\n\tconst env: NodeJS.ProcessEnv = { ...process.env };\n\tfor (const name of UNSAFE_GIT_ENV_VARS) delete env[name];\n\tenv.GIT_OPTIONAL_LOCKS = \"0\";\n\tenv.LC_ALL = \"C\";\n\treturn env;\n}\n\n/** Run one git subcommand with argv boundaries (never a shell) and bounded, time-limited output. */\nfunction runGitCapture(\n\troot: string,\n\targs: readonly string[],\n\tallowedExitCodes: readonly number[] = [0],\n): { status: number; stdout: Buffer } {\n\tconst result = spawnSync(\"git\", [\"-C\", root, ...args], {\n\t\tenv: gitCaptureEnv(),\n\t\tmaxBuffer: MAX_GIT_OUTPUT_BYTES,\n\t\ttimeout: GIT_CAPTURE_TIMEOUT_MS,\n\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\twindowsHide: true,\n\t});\n\tif (result.error !== undefined) {\n\t\tconst code = errorCode(result.error);\n\t\tthrow new Error(`workspace git capture failed to run git: ${code ?? result.error.message}`);\n\t}\n\tif (result.status === null || !allowedExitCodes.includes(result.status)) {\n\t\tthrow new Error(`workspace git capture: git exited with status ${String(result.status)}`);\n\t}\n\treturn { status: result.status, stdout: result.stdout };\n}\n\ninterface GitScopeStatus {\n\treadonly changedPaths: readonly string[];\n}\n\nfunction parseGitStatusOutput(stdout: Buffer, artifactPaths: readonly string[]): GitScopeStatus {\n\tconst changed = new Set<string>();\n\tfor (const entry of stdout.toString(\"utf8\").split(\"\\0\")) {\n\t\tif (entry.length === 0) continue;\n\t\tif (entry.length < 4 || entry[2] !== \" \") {\n\t\t\tthrow new Error(\"workspace git capture: unexpected status entry shape\");\n\t\t}\n\t\tconst path = entry.slice(3);\n\t\tassertNormalizedArtifactPath(path, \"workspace git status path\");\n\t\tif (!isWithinScope(path, artifactPaths)) {\n\t\t\tthrow new Error(`workspace git status path escapes the selected scope: ${path}`);\n\t\t}\n\t\tchanged.add(path);\n\t}\n\treturn { changedPaths: [...changed].sort() };\n}\n\n/**\n * Capture HEAD plus a scope-limited canonical dirty digest for a git work-tree root.\n * All git invocations are argv-only, env-sanitized, bounded, and pathspec-limited with\n * literal magic. Every exact selected path is also captured with symlink-free,\n * root-contained file reads, independent of ignore rules and index flags.\n */\nfunction captureGitWorkspaceFingerprint(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\tscope: WorkspaceScope,\n\toptions: WorkspaceFingerprintCaptureOptions,\n): GitWorkspaceFingerprint {\n\tconst toplevel = runGitCapture(root, [\"rev-parse\", \"--show-toplevel\"]).stdout.toString(\"utf8\").replace(/\\n$/, \"\");\n\tif (toplevel.length === 0 || realpathSync(toplevel) !== root) {\n\t\tthrow new Error(\"workspace root must be the git work-tree top level\");\n\t}\n\tconst head = runGitCapture(root, [\"rev-parse\", \"--verify\", \"--quiet\", \"HEAD^{commit}\"], [0, 1]);\n\tlet headCommit: string | null = null;\n\tif (head.status === 0) {\n\t\tconst hex = head.stdout.toString(\"utf8\").trim();\n\t\tif (!GIT_COMMIT_HEX.test(hex)) {\n\t\t\tthrow new Error(\"workspace git capture: HEAD is not a full hex object name\");\n\t\t}\n\t\theadCommit = hex;\n\t}\n\tconst pathspecs = scope.artifactPaths.map((path) => `:(literal)${path}`);\n\tlet status: GitScopeStatus = { changedPaths: [] };\n\tlet stagedDiff: Buffer = Buffer.alloc(0);\n\tlet unstagedDiff: Buffer = Buffer.alloc(0);\n\tif (pathspecs.length > 0) {\n\t\tstatus = parseGitStatusOutput(\n\t\t\trunGitCapture(root, [\n\t\t\t\t\"-c\",\n\t\t\t\t\"core.fsmonitor=false\",\n\t\t\t\t\"status\",\n\t\t\t\t\"--porcelain=v1\",\n\t\t\t\t\"-z\",\n\t\t\t\t\"--untracked-files=all\",\n\t\t\t\t\"--no-renames\",\n\t\t\t\t\"--ignore-submodules=none\",\n\t\t\t\t\"--\",\n\t\t\t\t...pathspecs,\n\t\t\t]).stdout,\n\t\t\tscope.artifactPaths,\n\t\t);\n\t\tstagedDiff = runGitCapture(root, [\"diff\", \"--cached\", ...GIT_DIFF_ARGS, \"--\", ...pathspecs]).stdout;\n\t\tunstagedDiff = runGitCapture(root, [\"diff\", ...GIT_DIFF_ARGS, \"--\", ...pathspecs]).stdout;\n\t}\n\tconst artifacts = scope.artifactPaths.map((artifactPath) =>\n\t\tcaptureSelectedArtifact(root, trustedRootStat, artifactPath, options),\n\t);\n\tassertTrustedRoot(root, trustedRootStat);\n\tconst changedPaths = Object.freeze([...status.changedPaths]);\n\tconst stagedDiffSha256 = sha256(stagedDiff);\n\tconst unstagedDiffSha256 = sha256(unstagedDiff);\n\tconst git: GitWorkspaceState = Object.freeze({\n\t\theadCommit,\n\t\tchangedPaths,\n\t\tstagedDiffSha256,\n\t\tunstagedDiffSha256,\n\t\tdirtySha256: computeGitWorkspaceDirtySha256(changedPaths, stagedDiffSha256, unstagedDiffSha256, artifacts),\n\t});\n\tconst parsed = parseWorkspaceFingerprint({\n\t\tkind: \"git\",\n\t\tscope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tgit,\n\t\tmanifestSha256: computeGitWorkspaceManifestSha256(scope, artifacts, git),\n\t});\n\tif (parsed.kind !== \"git\") {\n\t\tthrow new Error(\"workspace git capture produced a non-git fingerprint\");\n\t}\n\treturn parsed;\n}\n\n/**\n * Hash the selected workspace scope. When the trusted root is itself a git work-tree\n * top level, capture HEAD plus a scope-limited canonical dirty digest; otherwise hash\n * the caller-selected artifact set directly and perform no git commands.\n * Phase A assumes a trusted, quiescent workspace: pathname identity checks reject\n * observed rebinds, but do not prove an immutable snapshot against a same-UID adversary.\n */\nexport function captureWorkspaceFingerprint(\n\tscope: WorkspaceScope,\n\toptions: WorkspaceFingerprintCaptureOptions = {},\n): WorkspaceFingerprint {\n\tconst rawScope = exactObject(scope, \"workspace scope\", [\"root\", \"artifactPaths\"]);\n\tconst rawRoot = rawScope.root;\n\tif (typeof rawRoot !== \"string\" || rawRoot.length === 0) {\n\t\tthrow new Error(\"workspace scope root must be a non-empty string\");\n\t}\n\tconst rawArtifactPaths = exactArray(rawScope.artifactPaths, \"workspace scope artifactPaths\");\n\n\tconst seen = new Set<string>();\n\tfor (let index = 0; index < rawArtifactPaths.length; index++) {\n\t\tconst artifactPath = rawArtifactPaths[index];\n\t\tassertNormalizedArtifactPath(artifactPath, `workspace scope artifactPaths[${index}]`);\n\t\tif (seen.has(artifactPath)) {\n\t\t\tthrow new Error(`duplicate workspace artifact path: ${artifactPath}`);\n\t\t}\n\t\tseen.add(artifactPath);\n\t}\n\n\tconst resolvedRoot = resolve(rawRoot);\n\tconst rootStat = lstatSync(resolvedRoot);\n\tif (rootStat.isSymbolicLink()) {\n\t\tthrow new Error(\"workspace root must not be a symlink\");\n\t}\n\tif (!rootStat.isDirectory()) {\n\t\tthrow new Error(\"workspace root must be a directory\");\n\t}\n\tconst root = realpathSync(resolvedRoot);\n\tconst trustedRootStat = lstatSync(root);\n\tconst artifactPaths = (rawArtifactPaths as string[]).sort();\n\tconst canonicalScope: WorkspaceScope = Object.freeze({ root, artifactPaths: Object.freeze(artifactPaths) });\n\tif (isGitWorkspaceRoot(root)) {\n\t\treturn captureGitWorkspaceFingerprint(root, trustedRootStat, canonicalScope, options);\n\t}\n\tconst artifacts = artifactPaths.map((artifactPath) =>\n\t\tcaptureSelectedArtifact(root, trustedRootStat, artifactPath, options),\n\t);\n\tconst fingerprint = {\n\t\tkind: \"artifact-set\",\n\t\tscope: canonicalScope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tmanifestSha256: computeWorkspaceManifestSha256(canonicalScope, artifacts),\n\t};\n\treturn parseWorkspaceFingerprint(fingerprint);\n}\n"]}
1
+ {"version":3,"file":"workspace-fingerprint.js","sourceRoot":"","sources":["../../src/guardrails/workspace-fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACN,SAAS,EACT,SAAS,IAAI,WAAW,EACxB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,YAAY,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAYnF,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,yBAAyB,GAAG,yCAAyC,CAAC;AAC5E,MAAM,gBAAgB,GAAG,mDAAmD,CAAC;AAC7E,8CAA8C;AAC9C,MAAM,cAAc,GAAG,iCAAiC,CAAC;AACzD,+DAA+D;AAC/D,MAAM,oBAAoB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,sBAAsB,GAAG,MAAM,CAAC;AACtC,+FAA+F;AAC/F,MAAM,mBAAmB,GAAG;IAC3B,kCAAkC;IAClC,yBAAyB;IACzB,gBAAgB;IAChB,eAAe;IACf,SAAS;IACT,mBAAmB;IACnB,gBAAgB;IAChB,eAAe;IACf,sBAAsB;IACtB,YAAY;IACZ,eAAe;CACN,CAAC;AACX,+FAA+F;AAC/F,MAAM,aAAa,GAAG;IACrB,cAAc;IACd,UAAU;IACV,YAAY;IACZ,eAAe;IACf,eAAe;IACf,cAAc;IACd,0BAA0B;IAC1B,iBAAiB;IACjB,iBAAiB;CACR,CAAC;AAgBX,SAAS,SAAS,CAAC,KAAc,EAAsB;IACtD,OAAO,OAAO,KAAK,KAAK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I,CAAC,EAAE,CAAC;QAC9B,OAAO,8BAA8B,CAAC,IAAI,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;IACD,MAAM,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CACpD,uBAAuB,CAAC,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,CAAC,CACrE,CAAC;IACF,MAAM,WAAW,GAAG;QACnB,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,cAAc;QACrB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,cAAc,EAAE,8BAA8B,CAAC,cAAc,EAAE,SAAS,CAAC;KACzE,CAAC;IACF,OAAO,yBAAyB,CAAC,WAAW,CAAC,CAAC;AAAA,CAC9C","sourcesContent":["import { spawnSync } from \"node:child_process\";\nimport { createHash, timingSafeEqual } from \"node:crypto\";\nimport type { Stats } from \"node:fs\";\nimport {\n\tcloseSync,\n\tconstants as fsConstants,\n\tfstatSync,\n\tlstatSync,\n\topenSync,\n\treadFileSync,\n\trealpathSync,\n} from \"node:fs\";\nimport { isAbsolute, join, posix, relative, resolve, sep, win32 } from \"node:path\";\nimport type {\n\tArtifactSetWorkspaceFingerprint,\n\tArtifactState,\n\tFileArtifactState,\n\tGitWorkspaceFingerprint,\n\tGitWorkspaceState,\n\tSha256Hex,\n\tWorkspaceFingerprint,\n\tWorkspaceScope,\n} from \"../types/evidence.ts\";\n\nconst SHA256_HEX = /^[0-9a-f]{64}$/;\nconst WORKSPACE_MANIFEST_DOMAIN = \"omk:evidence:workspace-fingerprint:v1\\0\";\nconst GIT_DIRTY_DOMAIN = \"omk:evidence:workspace-fingerprint:git-dirty:v1\\0\";\n/** Full SHA-1 or SHA-256 git object names. */\nconst GIT_COMMIT_HEX = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;\n/** Hard bound on bytes accepted from one git child process. */\nconst MAX_GIT_OUTPUT_BYTES = 16 * 1024 * 1024;\nconst GIT_CAPTURE_TIMEOUT_MS = 30_000;\n/** Inherited variables that could redirect git away from the trusted root; always stripped. */\nconst UNSAFE_GIT_ENV_VARS = [\n\t\"GIT_ALTERNATE_OBJECT_DIRECTORIES\",\n\t\"GIT_CEILING_DIRECTORIES\",\n\t\"GIT_COMMON_DIR\",\n\t\"GIT_DIFF_OPTS\",\n\t\"GIT_DIR\",\n\t\"GIT_EXTERNAL_DIFF\",\n\t\"GIT_INDEX_FILE\",\n\t\"GIT_NAMESPACE\",\n\t\"GIT_OBJECT_DIRECTORY\",\n\t\"GIT_PREFIX\",\n\t\"GIT_WORK_TREE\",\n] as const;\n/** Deterministic scope-limited diff rendering, independent of local prefix/ext-diff config. */\nconst GIT_DIFF_ARGS = [\n\t\"--full-index\",\n\t\"--binary\",\n\t\"--no-color\",\n\t\"--no-ext-diff\",\n\t\"--no-textconv\",\n\t\"--no-renames\",\n\t\"--ignore-submodules=none\",\n\t\"--src-prefix=a/\",\n\t\"--dst-prefix=b/\",\n] as const;\n\ntype FileStat = Stats;\n\nexport type WorkspaceFingerprintCaptureFaultStage = \"before-artifact-open\";\n\nexport interface WorkspaceFingerprintCaptureOptions {\n\t/** Tests only: mutate a selected path immediately before its artifact is opened. */\n\treadonly faultInjector?: (stage: WorkspaceFingerprintCaptureFaultStage, artifactPath: string) => void;\n}\n\ninterface ParentIdentity {\n\treadonly path: string;\n\treadonly stat: FileStat;\n}\n\nfunction errorCode(error: unknown): string | undefined {\n\treturn typeof error === \"object\" && error !== null && \"code\" in error\n\t\t? String((error as { code?: unknown }).code)\n\t\t: undefined;\n}\n\nfunction sha256(value: Uint8Array | string): Sha256Hex {\n\treturn createHash(\"sha256\").update(value).digest(\"hex\") as Sha256Hex;\n}\n\nfunction exactObject(value: unknown, label: string, keys: readonly string[]): Record<string, unknown> {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(`${label} must be an object`);\n\t}\n\tconst descriptors = Object.getOwnPropertyDescriptors(value);\n\tconst actual = Object.entries(descriptors)\n\t\t.filter(([, descriptor]) => descriptor.enumerable)\n\t\t.map(([key]) => key)\n\t\t.sort();\n\tconst expected = [...keys].sort();\n\tif (\n\t\tactual.length !== expected.length ||\n\t\tactual.some((key, index) => key !== expected[index]) ||\n\t\tkeys.some((key) => {\n\t\t\tconst descriptor = descriptors[key];\n\t\t\treturn descriptor === undefined || descriptor.enumerable !== true || !(\"value\" in descriptor);\n\t\t})\n\t) {\n\t\tthrow new Error(`${label} has an invalid key set`);\n\t}\n\tconst snapshot: Record<string, unknown> = {};\n\tfor (const key of actual) {\n\t\tconst descriptor = descriptors[key];\n\t\tif (descriptor === undefined || !(\"value\" in descriptor)) {\n\t\t\tthrow new Error(`${label} has an invalid key set`);\n\t\t}\n\t\tsnapshot[key] = descriptor.value;\n\t}\n\treturn snapshot;\n}\n\nfunction ownEnumerableDataProperty(record: Record<string, unknown>, label: string, key: string): unknown {\n\tconst descriptor = Object.getOwnPropertyDescriptor(record, key);\n\tif (descriptor === undefined || descriptor.enumerable !== true || !(\"value\" in descriptor)) {\n\t\tthrow new Error(`${label} has an invalid key set`);\n\t}\n\treturn descriptor.value;\n}\n\nfunction exactArray(value: unknown, label: string): unknown[] {\n\tif (!Array.isArray(value)) throw new Error(`${label} must be an array`);\n\tconst descriptors = Object.getOwnPropertyDescriptors(value);\n\tconst lengthDescriptor = descriptors.length as PropertyDescriptor | undefined;\n\tif (lengthDescriptor === undefined || !(\"value\" in lengthDescriptor)) {\n\t\tthrow new Error(`${label} has invalid index properties`);\n\t}\n\tconst rawLength = lengthDescriptor.value;\n\tif (!Number.isSafeInteger(rawLength) || (rawLength as number) < 0) {\n\t\tthrow new Error(`${label} has invalid index properties`);\n\t}\n\tconst length = rawLength as number;\n\tconst snapshot: unknown[] = [];\n\tfor (let index = 0; index < length; index++) {\n\t\tconst descriptor = descriptors[String(index)];\n\t\tif (descriptor === undefined || descriptor.enumerable !== true || !(\"value\" in descriptor)) {\n\t\t\tthrow new Error(`${label} must use own enumerable data index properties`);\n\t\t}\n\t\tsnapshot.push(descriptor.value);\n\t}\n\tconst enumerableKeys = Object.entries(descriptors)\n\t\t.filter(([, descriptor]) => descriptor.enumerable)\n\t\t.map(([key]) => key);\n\tif (enumerableKeys.length !== length || enumerableKeys.some((key, index) => key !== String(index))) {\n\t\tthrow new Error(`${label} must use own enumerable data index properties`);\n\t}\n\treturn snapshot;\n}\n\n/** Scope producers filter with this so one stray dirty entry cannot poison every receipt. */\nexport function isNormalizedArtifactPath(path: unknown): path is string {\n\treturn (\n\t\ttypeof path === \"string\" &&\n\t\tpath.length > 0 &&\n\t\t!path.includes(\"\\0\") &&\n\t\t!path.includes(\"\\\\\") &&\n\t\t!isAbsolute(path) &&\n\t\t!win32.isAbsolute(path) &&\n\t\tposix.normalize(path) === path &&\n\t\t!path.split(\"/\").some((segment) => segment === \"\" || segment === \".\" || segment === \"..\")\n\t);\n}\n\nfunction assertNormalizedArtifactPath(path: unknown, label = \"artifact path\"): asserts path is string {\n\tif (!isNormalizedArtifactPath(path)) throw new Error(`${label} must be a normalized root-relative path`);\n}\n\nfunction assertSortedUniquePaths(paths: readonly string[], label: string): void {\n\tfor (let index = 0; index < paths.length; index++) {\n\t\tassertNormalizedArtifactPath(paths[index], `${label}[${index}]`);\n\t\tif (index > 0 && paths[index - 1] >= paths[index]) {\n\t\t\tthrow new Error(`${label} must be sorted and contain no duplicates`);\n\t\t}\n\t}\n}\n\nfunction parseSha256(value: unknown, label: string): Sha256Hex {\n\tif (typeof value !== \"string\" || !SHA256_HEX.test(value)) {\n\t\tthrow new Error(`${label} must be a lowercase SHA-256 hex digest`);\n\t}\n\treturn value as Sha256Hex;\n}\n\nfunction parseScope(value: unknown): WorkspaceScope {\n\tconst scope = exactObject(value, \"workspace scope\", [\"root\", \"artifactPaths\"]);\n\tif (typeof scope.root !== \"string\" || scope.root.length === 0 || !isAbsolute(scope.root)) {\n\t\tthrow new Error(\"workspace scope root must be an absolute path\");\n\t}\n\tconst rawArtifactPaths = exactArray(scope.artifactPaths, \"workspace scope artifactPaths\");\n\tif (!rawArtifactPaths.every((path) => typeof path === \"string\")) {\n\t\tthrow new Error(\"workspace scope artifactPaths must be a string array\");\n\t}\n\tconst artifactPaths = [...rawArtifactPaths] as string[];\n\tassertSortedUniquePaths(artifactPaths, \"workspace scope artifactPaths\");\n\treturn Object.freeze({ root: scope.root, artifactPaths: Object.freeze(artifactPaths) });\n}\n\nfunction parseArtifact(value: unknown, index: number): ArtifactState {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(`workspace artifact[${index}] must be an object`);\n\t}\n\tconst candidate = value as Record<string, unknown>;\n\tconst state = ownEnumerableDataProperty(candidate, `workspace artifact[${index}]`, \"state\");\n\tif (state === \"missing\") {\n\t\tconst artifact = exactObject(value, `workspace artifact[${index}]`, [\"path\", \"state\"]);\n\t\tassertNormalizedArtifactPath(artifact.path, `workspace artifact[${index}].path`);\n\t\treturn Object.freeze({ path: artifact.path, state: \"missing\" });\n\t}\n\tif (state === \"file\") {\n\t\tconst artifact = exactObject(value, `workspace artifact[${index}]`, [\"path\", \"state\", \"sha256\", \"size\"]);\n\t\tassertNormalizedArtifactPath(artifact.path, `workspace artifact[${index}].path`);\n\t\tif (!Number.isSafeInteger(artifact.size) || (artifact.size as number) < 0) {\n\t\t\tthrow new Error(`workspace artifact[${index}].size must be a non-negative safe integer`);\n\t\t}\n\t\treturn Object.freeze({\n\t\t\tpath: artifact.path,\n\t\t\tstate: \"file\",\n\t\t\tsha256: parseSha256(artifact.sha256, `workspace artifact[${index}].sha256`),\n\t\t\tsize: artifact.size as number,\n\t\t});\n\t}\n\tthrow new Error(`workspace artifact[${index}].state must be file or missing`);\n}\n\nfunction canonicalManifest(scope: WorkspaceScope, artifacts: readonly ArtifactState[]): string {\n\treturn JSON.stringify({\n\t\tkind: \"artifact-set\",\n\t\tscope: { root: scope.root, artifactPaths: scope.artifactPaths },\n\t\tartifacts: artifacts.map((artifact) =>\n\t\t\tartifact.state === \"file\"\n\t\t\t\t? { path: artifact.path, state: artifact.state, sha256: artifact.sha256, size: artifact.size }\n\t\t\t\t: { path: artifact.path, state: artifact.state },\n\t\t),\n\t});\n}\n\n/** Compute the domain-separated digest for an already validated canonical manifest. */\nexport function computeWorkspaceManifestSha256(scope: WorkspaceScope, artifacts: readonly ArtifactState[]): Sha256Hex {\n\treturn sha256(`${WORKSPACE_MANIFEST_DOMAIN}${canonicalManifest(scope, artifacts)}`);\n}\n\n/** Canonical digest committing sorted changed paths, both diff digests, and every selected artifact state. */\nexport function computeGitWorkspaceDirtySha256(\n\tchangedPaths: readonly string[],\n\tstagedDiffSha256: Sha256Hex,\n\tunstagedDiffSha256: Sha256Hex,\n\tartifacts: readonly ArtifactState[],\n): Sha256Hex {\n\tconst canonical = JSON.stringify({\n\t\tchangedPaths,\n\t\tstagedDiffSha256,\n\t\tunstagedDiffSha256,\n\t\tartifacts: artifacts.map((artifact) =>\n\t\t\tartifact.state === \"file\"\n\t\t\t\t? { path: artifact.path, state: artifact.state, sha256: artifact.sha256, size: artifact.size }\n\t\t\t\t: { path: artifact.path, state: artifact.state },\n\t\t),\n\t});\n\treturn sha256(`${GIT_DIRTY_DOMAIN}${canonical}`);\n}\n\n/** Compute the domain-separated digest for an already validated canonical git manifest. */\nexport function computeGitWorkspaceManifestSha256(\n\tscope: WorkspaceScope,\n\tartifacts: readonly ArtifactState[],\n\tgit: GitWorkspaceState,\n): Sha256Hex {\n\tconst canonical = JSON.stringify({\n\t\tkind: \"git\",\n\t\tscope: { root: scope.root, artifactPaths: scope.artifactPaths },\n\t\tartifacts: artifacts.map((artifact) =>\n\t\t\tartifact.state === \"file\"\n\t\t\t\t? { path: artifact.path, state: artifact.state, sha256: artifact.sha256, size: artifact.size }\n\t\t\t\t: { path: artifact.path, state: artifact.state },\n\t\t),\n\t\tgit: {\n\t\t\theadCommit: git.headCommit,\n\t\t\tchangedPaths: git.changedPaths,\n\t\t\tstagedDiffSha256: git.stagedDiffSha256,\n\t\t\tunstagedDiffSha256: git.unstagedDiffSha256,\n\t\t\tdirtySha256: git.dirtySha256,\n\t\t},\n\t});\n\treturn sha256(`${WORKSPACE_MANIFEST_DOMAIN}${canonical}`);\n}\n\n/** A changed path is inside scope when it equals a selected path or lies under a selected directory. */\nfunction isWithinScope(path: string, artifactPaths: readonly string[]): boolean {\n\treturn artifactPaths.some((artifact) => path === artifact || path.startsWith(`${artifact}/`));\n}\n\nfunction digestsEqual(left: Sha256Hex, right: Sha256Hex): boolean {\n\treturn timingSafeEqual(Buffer.from(left, \"hex\"), Buffer.from(right, \"hex\"));\n}\n\nfunction parseGitFingerprint(value: unknown): GitWorkspaceFingerprint {\n\tconst raw = exactObject(value, \"workspace fingerprint\", [\"kind\", \"scope\", \"artifacts\", \"git\", \"manifestSha256\"]);\n\tconst scope = parseScope(raw.scope);\n\tconst rawArtifacts = exactArray(raw.artifacts, \"workspace fingerprint artifacts\");\n\tconst artifacts = rawArtifacts.map((artifact, index) => parseArtifact(artifact, index));\n\tconst artifactPaths = artifacts.map((artifact) => artifact.path);\n\tassertSortedUniquePaths(artifactPaths, \"workspace artifact paths\");\n\tif (\n\t\tartifactPaths.length !== scope.artifactPaths.length ||\n\t\tartifactPaths.some((path, index) => path !== scope.artifactPaths[index])\n\t) {\n\t\tthrow new Error(\"workspace artifacts must exactly match the selected scope paths\");\n\t}\n\tconst rawGit = exactObject(raw.git, \"workspace git state\", [\n\t\t\"headCommit\",\n\t\t\"changedPaths\",\n\t\t\"stagedDiffSha256\",\n\t\t\"unstagedDiffSha256\",\n\t\t\"dirtySha256\",\n\t]);\n\tconst headCommit = rawGit.headCommit;\n\tif (headCommit !== null && (typeof headCommit !== \"string\" || !GIT_COMMIT_HEX.test(headCommit))) {\n\t\tthrow new Error(\"workspace git headCommit must be null or a full lowercase hex object name\");\n\t}\n\tconst rawChangedPaths = exactArray(rawGit.changedPaths, \"workspace git changedPaths\");\n\tif (!rawChangedPaths.every((path) => typeof path === \"string\")) {\n\t\tthrow new Error(\"workspace git changedPaths must be a string array\");\n\t}\n\tconst changedPaths = [...rawChangedPaths] as string[];\n\tassertSortedUniquePaths(changedPaths, \"workspace git changedPaths\");\n\tfor (const path of changedPaths) {\n\t\tif (!isWithinScope(path, scope.artifactPaths)) {\n\t\t\tthrow new Error(`workspace git changed path escapes the selected scope: ${path}`);\n\t\t}\n\t}\n\tconst stagedDiffSha256 = parseSha256(rawGit.stagedDiffSha256, \"workspace git stagedDiffSha256\");\n\tconst unstagedDiffSha256 = parseSha256(rawGit.unstagedDiffSha256, \"workspace git unstagedDiffSha256\");\n\tconst dirtySha256 = parseSha256(rawGit.dirtySha256, \"workspace git dirtySha256\");\n\tif (\n\t\t!digestsEqual(\n\t\t\tdirtySha256,\n\t\t\tcomputeGitWorkspaceDirtySha256(changedPaths, stagedDiffSha256, unstagedDiffSha256, artifacts),\n\t\t)\n\t) {\n\t\tthrow new Error(\"workspace git dirty digest mismatch\");\n\t}\n\tconst git: GitWorkspaceState = Object.freeze({\n\t\theadCommit,\n\t\tchangedPaths: Object.freeze(changedPaths),\n\t\tstagedDiffSha256,\n\t\tunstagedDiffSha256,\n\t\tdirtySha256,\n\t});\n\tconst manifestSha256 = parseSha256(raw.manifestSha256, \"workspace manifestSha256\");\n\tif (!digestsEqual(manifestSha256, computeGitWorkspaceManifestSha256(scope, artifacts, git))) {\n\t\tthrow new Error(\"workspace manifest digest mismatch\");\n\t}\n\treturn Object.freeze({\n\t\tkind: \"git\",\n\t\tscope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tgit,\n\t\tmanifestSha256,\n\t});\n}\n\n/** Strictly parse and validate a fingerprint of either kind, including its canonical digests. */\nexport function parseWorkspaceFingerprint(value: unknown): WorkspaceFingerprint {\n\tif (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n\t\tthrow new Error(\"workspace fingerprint must be an object\");\n\t}\n\tconst kind = ownEnumerableDataProperty(value as Record<string, unknown>, \"workspace fingerprint\", \"kind\");\n\tif (kind === \"git\") return parseGitFingerprint(value);\n\tif (kind !== \"artifact-set\") {\n\t\tthrow new Error(\"workspace fingerprint kind must be artifact-set or git\");\n\t}\n\treturn parseArtifactSetFingerprint(value);\n}\n\nfunction parseArtifactSetFingerprint(value: unknown): ArtifactSetWorkspaceFingerprint {\n\tconst raw = exactObject(value, \"workspace fingerprint\", [\"kind\", \"scope\", \"artifacts\", \"manifestSha256\"]);\n\tif (raw.kind !== \"artifact-set\") {\n\t\tthrow new Error(\"workspace fingerprint kind must be artifact-set\");\n\t}\n\tconst scope = parseScope(raw.scope);\n\tconst rawArtifacts = exactArray(raw.artifacts, \"workspace fingerprint artifacts\");\n\tconst artifacts = rawArtifacts.map((artifact, index) => parseArtifact(artifact, index));\n\tconst artifactPaths = artifacts.map((artifact) => artifact.path);\n\tassertSortedUniquePaths(artifactPaths, \"workspace artifact paths\");\n\tif (\n\t\tartifactPaths.length !== scope.artifactPaths.length ||\n\t\tartifactPaths.some((path, index) => path !== scope.artifactPaths[index])\n\t) {\n\t\tthrow new Error(\"workspace artifacts must exactly match the selected scope paths\");\n\t}\n\tconst manifestSha256 = parseSha256(raw.manifestSha256, \"workspace manifestSha256\");\n\tconst expected = computeWorkspaceManifestSha256(scope, artifacts);\n\tif (!digestsEqual(manifestSha256, expected)) {\n\t\tthrow new Error(\"workspace manifest digest mismatch\");\n\t}\n\treturn Object.freeze({\n\t\tkind: \"artifact-set\",\n\t\tscope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tmanifestSha256,\n\t});\n}\n\nfunction statPathWithoutSymlinks(root: string, artifactPath: string): FileStat | undefined {\n\tlet current = root;\n\tconst segments = artifactPath.split(\"/\");\n\tfor (let index = 0; index < segments.length; index++) {\n\t\tcurrent = join(current, segments[index]);\n\t\tlet stat: FileStat;\n\t\ttry {\n\t\t\tstat = lstatSync(current);\n\t\t} catch (error) {\n\t\t\tif (errorCode(error) === \"ENOENT\") return undefined;\n\t\t\tthrow error;\n\t\t}\n\t\tif (stat.isSymbolicLink()) {\n\t\t\tthrow new Error(`workspace artifact path contains a symlink: ${artifactPath}`);\n\t\t}\n\t\tif (index < segments.length - 1 && !stat.isDirectory()) {\n\t\t\tthrow new Error(`workspace artifact parent is not a directory: ${artifactPath}`);\n\t\t}\n\t\tif (index === segments.length - 1) return stat;\n\t}\n\treturn undefined;\n}\n\nfunction captureParentIdentities(root: string, artifactPath: string): readonly ParentIdentity[] {\n\tconst parents: ParentIdentity[] = [];\n\tlet current = root;\n\tfor (const segment of artifactPath.split(\"/\").slice(0, -1)) {\n\t\tcurrent = join(current, segment);\n\t\tconst stat = lstatSync(current);\n\t\tif (stat.isSymbolicLink()) {\n\t\t\tthrow new Error(`workspace artifact path contains a symlink: ${artifactPath}`);\n\t\t}\n\t\tif (!stat.isDirectory()) {\n\t\t\tthrow new Error(`workspace artifact parent is not a directory: ${artifactPath}`);\n\t\t}\n\t\tparents.push({ path: current, stat });\n\t}\n\treturn parents;\n}\n\nfunction hasFileIdentity(stat: FileStat): boolean {\n\treturn stat.dev !== 0 || stat.ino !== 0;\n}\n\nfunction sameFileIdentity(expected: FileStat, actual: FileStat): boolean {\n\tconst expectedHasIdentity = hasFileIdentity(expected);\n\tconst actualHasIdentity = hasFileIdentity(actual);\n\treturn (\n\t\t(!expectedHasIdentity && !actualHasIdentity) ||\n\t\t(expectedHasIdentity && actualHasIdentity && expected.dev === actual.dev && expected.ino === actual.ino)\n\t);\n}\n\nfunction isStrictlyUnder(root: string, path: string): boolean {\n\tconst relativePath = relative(root, path);\n\treturn (\n\t\trelativePath !== \"\" && relativePath !== \"..\" && !relativePath.startsWith(`..${sep}`) && !isAbsolute(relativePath)\n\t);\n}\n\nfunction assertTrustedRoot(root: string, trustedRootStat: FileStat): void {\n\tconst liveRootStat = lstatSync(root);\n\tif (\n\t\tliveRootStat.isSymbolicLink() ||\n\t\t!liveRootStat.isDirectory() ||\n\t\trealpathSync(root) !== root ||\n\t\t!sameFileIdentity(trustedRootStat, liveRootStat)\n\t) {\n\t\tthrow new Error(\"workspace root changed while artifacts were captured\");\n\t}\n}\n\nfunction assertParentIdentities(parents: readonly ParentIdentity[], artifactPath: string): void {\n\tfor (const parent of parents) {\n\t\tconst stat = lstatSync(parent.path);\n\t\tif (stat.isSymbolicLink() || !stat.isDirectory() || !sameFileIdentity(parent.stat, stat)) {\n\t\t\tthrow new Error(`workspace artifact parent changed while it was captured: ${artifactPath}`);\n\t\t}\n\t}\n}\n\nfunction assertLiveArtifactPath(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\ttrustedParents: readonly ParentIdentity[],\n\tartifactPath: string,\n\tfdStat: FileStat,\n): void {\n\tassertTrustedRoot(root, trustedRootStat);\n\tassertParentIdentities(trustedParents, artifactPath);\n\tconst pathStat = statPathWithoutSymlinks(root, artifactPath);\n\tif (pathStat === undefined || !pathStat.isFile() || !sameFileIdentity(fdStat, pathStat)) {\n\t\tthrow new Error(`workspace artifact path was rebound while it was captured: ${artifactPath}`);\n\t}\n\tconst fullPath = join(root, ...artifactPath.split(\"/\"));\n\tconst livePath = realpathSync(fullPath);\n\tif (!isStrictlyUnder(root, livePath)) {\n\t\tthrow new Error(`workspace artifact resolved outside the trusted root: ${artifactPath}`);\n\t}\n\tconst livePathStat = lstatSync(livePath);\n\tif (!livePathStat.isFile() || !sameFileIdentity(fdStat, livePathStat)) {\n\t\tthrow new Error(`workspace artifact path was rebound while it was captured: ${artifactPath}`);\n\t}\n\tassertParentIdentities(trustedParents, artifactPath);\n\tassertTrustedRoot(root, trustedRootStat);\n}\n\nfunction captureFile(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\ttrustedParents: readonly ParentIdentity[],\n\tartifactPath: string,\n): FileArtifactState {\n\tconst fullPath = join(root, ...artifactPath.split(\"/\"));\n\tconst flags = fsConstants.O_RDONLY | (fsConstants.O_NOFOLLOW ?? 0);\n\tlet fd: number;\n\ttry {\n\t\tfd = openSync(fullPath, flags);\n\t} catch (error) {\n\t\tif (errorCode(error) === \"ELOOP\") {\n\t\t\tthrow new Error(`workspace artifact path contains a symlink: ${artifactPath}`);\n\t\t}\n\t\tthrow error;\n\t}\n\ttry {\n\t\tconst before = fstatSync(fd);\n\t\tif (!before.isFile()) {\n\t\t\tthrow new Error(`workspace artifact is not a regular file: ${artifactPath}`);\n\t\t}\n\t\tassertLiveArtifactPath(root, trustedRootStat, trustedParents, artifactPath, before);\n\t\tconst bytes = readFileSync(fd);\n\t\tconst after = fstatSync(fd);\n\t\tassertLiveArtifactPath(root, trustedRootStat, trustedParents, artifactPath, after);\n\t\tif (\n\t\t\t!after.isFile() ||\n\t\t\t!sameFileIdentity(before, after) ||\n\t\t\tbefore.size !== after.size ||\n\t\t\tbefore.mtimeMs !== after.mtimeMs ||\n\t\t\tbefore.ctimeMs !== after.ctimeMs ||\n\t\t\tafter.size !== bytes.byteLength\n\t\t) {\n\t\t\tthrow new Error(`workspace artifact changed while it was captured: ${artifactPath}`);\n\t\t}\n\t\treturn Object.freeze({ path: artifactPath, state: \"file\", sha256: sha256(bytes), size: bytes.byteLength });\n\t} finally {\n\t\tcloseSync(fd);\n\t}\n}\n\nfunction captureSelectedArtifact(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\tartifactPath: string,\n\toptions: WorkspaceFingerprintCaptureOptions,\n): ArtifactState {\n\tassertTrustedRoot(root, trustedRootStat);\n\tconst stat = statPathWithoutSymlinks(root, artifactPath);\n\tif (stat === undefined) {\n\t\tassertTrustedRoot(root, trustedRootStat);\n\t\treturn Object.freeze({ path: artifactPath, state: \"missing\" });\n\t}\n\tif (!stat.isFile()) {\n\t\tthrow new Error(`workspace artifact is not a regular file: ${artifactPath}`);\n\t}\n\tconst trustedParents = captureParentIdentities(root, artifactPath);\n\toptions.faultInjector?.(\"before-artifact-open\", artifactPath);\n\treturn captureFile(root, trustedRootStat, trustedParents, artifactPath);\n}\n\n/** True when the trusted root itself hosts a `.git` entry; a symlinked `.git` fails closed. */\nfunction isGitWorkspaceRoot(root: string): boolean {\n\tlet stat: FileStat;\n\ttry {\n\t\tstat = lstatSync(join(root, \".git\"));\n\t} catch (error) {\n\t\tif (errorCode(error) === \"ENOENT\") return false;\n\t\tthrow error;\n\t}\n\tif (stat.isSymbolicLink()) {\n\t\tthrow new Error(\"workspace root .git must not be a symlink\");\n\t}\n\treturn true;\n}\n\nfunction gitCaptureEnv(): NodeJS.ProcessEnv {\n\tconst env: NodeJS.ProcessEnv = { ...process.env };\n\tfor (const name of UNSAFE_GIT_ENV_VARS) delete env[name];\n\tenv.GIT_OPTIONAL_LOCKS = \"0\";\n\tenv.LC_ALL = \"C\";\n\treturn env;\n}\n\n/** Run one git subcommand with argv boundaries (never a shell) and bounded, time-limited output. */\nfunction runGitCapture(\n\troot: string,\n\targs: readonly string[],\n\tallowedExitCodes: readonly number[] = [0],\n): { status: number; stdout: Buffer } {\n\tconst result = spawnSync(\"git\", [\"-C\", root, ...args], {\n\t\tenv: gitCaptureEnv(),\n\t\tmaxBuffer: MAX_GIT_OUTPUT_BYTES,\n\t\ttimeout: GIT_CAPTURE_TIMEOUT_MS,\n\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\twindowsHide: true,\n\t});\n\tif (result.error !== undefined) {\n\t\tconst code = errorCode(result.error);\n\t\tthrow new Error(`workspace git capture failed to run git: ${code ?? result.error.message}`);\n\t}\n\tif (result.status === null || !allowedExitCodes.includes(result.status)) {\n\t\tthrow new Error(`workspace git capture: git exited with status ${String(result.status)}`);\n\t}\n\treturn { status: result.status, stdout: result.stdout };\n}\n\ninterface GitScopeStatus {\n\treadonly changedPaths: readonly string[];\n}\n\nfunction parseGitStatusOutput(stdout: Buffer, artifactPaths: readonly string[]): GitScopeStatus {\n\tconst changed = new Set<string>();\n\tfor (const entry of stdout.toString(\"utf8\").split(\"\\0\")) {\n\t\tif (entry.length === 0) continue;\n\t\tif (entry.length < 4 || entry[2] !== \" \") {\n\t\t\tthrow new Error(\"workspace git capture: unexpected status entry shape\");\n\t\t}\n\t\tconst path = entry.slice(3);\n\t\tassertNormalizedArtifactPath(path, \"workspace git status path\");\n\t\tif (!isWithinScope(path, artifactPaths)) {\n\t\t\tthrow new Error(`workspace git status path escapes the selected scope: ${path}`);\n\t\t}\n\t\tchanged.add(path);\n\t}\n\treturn { changedPaths: [...changed].sort() };\n}\n\n/**\n * Capture HEAD plus a scope-limited canonical dirty digest for a git work-tree root.\n * All git invocations are argv-only, env-sanitized, bounded, and pathspec-limited with\n * literal magic. Every exact selected path is also captured with symlink-free,\n * root-contained file reads, independent of ignore rules and index flags.\n */\nfunction captureGitWorkspaceFingerprint(\n\troot: string,\n\ttrustedRootStat: FileStat,\n\tscope: WorkspaceScope,\n\toptions: WorkspaceFingerprintCaptureOptions,\n): GitWorkspaceFingerprint {\n\tconst toplevel = runGitCapture(root, [\"rev-parse\", \"--show-toplevel\"]).stdout.toString(\"utf8\").replace(/\\n$/, \"\");\n\tif (toplevel.length === 0 || realpathSync(toplevel) !== root) {\n\t\tthrow new Error(\"workspace root must be the git work-tree top level\");\n\t}\n\tconst head = runGitCapture(root, [\"rev-parse\", \"--verify\", \"--quiet\", \"HEAD^{commit}\"], [0, 1]);\n\tlet headCommit: string | null = null;\n\tif (head.status === 0) {\n\t\tconst hex = head.stdout.toString(\"utf8\").trim();\n\t\tif (!GIT_COMMIT_HEX.test(hex)) {\n\t\t\tthrow new Error(\"workspace git capture: HEAD is not a full hex object name\");\n\t\t}\n\t\theadCommit = hex;\n\t}\n\tconst pathspecs = scope.artifactPaths.map((path) => `:(literal)${path}`);\n\tlet status: GitScopeStatus = { changedPaths: [] };\n\tlet stagedDiff: Buffer = Buffer.alloc(0);\n\tlet unstagedDiff: Buffer = Buffer.alloc(0);\n\tif (pathspecs.length > 0) {\n\t\tstatus = parseGitStatusOutput(\n\t\t\trunGitCapture(root, [\n\t\t\t\t\"-c\",\n\t\t\t\t\"core.fsmonitor=false\",\n\t\t\t\t\"status\",\n\t\t\t\t\"--porcelain=v1\",\n\t\t\t\t\"-z\",\n\t\t\t\t\"--untracked-files=all\",\n\t\t\t\t\"--no-renames\",\n\t\t\t\t\"--ignore-submodules=none\",\n\t\t\t\t\"--\",\n\t\t\t\t...pathspecs,\n\t\t\t]).stdout,\n\t\t\tscope.artifactPaths,\n\t\t);\n\t\tstagedDiff = runGitCapture(root, [\"diff\", \"--cached\", ...GIT_DIFF_ARGS, \"--\", ...pathspecs]).stdout;\n\t\tunstagedDiff = runGitCapture(root, [\"diff\", ...GIT_DIFF_ARGS, \"--\", ...pathspecs]).stdout;\n\t}\n\tconst artifacts = scope.artifactPaths.map((artifactPath) =>\n\t\tcaptureSelectedArtifact(root, trustedRootStat, artifactPath, options),\n\t);\n\tassertTrustedRoot(root, trustedRootStat);\n\tconst changedPaths = Object.freeze([...status.changedPaths]);\n\tconst stagedDiffSha256 = sha256(stagedDiff);\n\tconst unstagedDiffSha256 = sha256(unstagedDiff);\n\tconst git: GitWorkspaceState = Object.freeze({\n\t\theadCommit,\n\t\tchangedPaths,\n\t\tstagedDiffSha256,\n\t\tunstagedDiffSha256,\n\t\tdirtySha256: computeGitWorkspaceDirtySha256(changedPaths, stagedDiffSha256, unstagedDiffSha256, artifacts),\n\t});\n\tconst parsed = parseWorkspaceFingerprint({\n\t\tkind: \"git\",\n\t\tscope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tgit,\n\t\tmanifestSha256: computeGitWorkspaceManifestSha256(scope, artifacts, git),\n\t});\n\tif (parsed.kind !== \"git\") {\n\t\tthrow new Error(\"workspace git capture produced a non-git fingerprint\");\n\t}\n\treturn parsed;\n}\n\n/**\n * Hash the selected workspace scope. When the trusted root is itself a git work-tree\n * top level, capture HEAD plus a scope-limited canonical dirty digest; otherwise hash\n * the caller-selected artifact set directly and perform no git commands.\n * Phase A assumes a trusted, quiescent workspace: pathname identity checks reject\n * observed rebinds, but do not prove an immutable snapshot against a same-UID adversary.\n */\nexport function captureWorkspaceFingerprint(\n\tscope: WorkspaceScope,\n\toptions: WorkspaceFingerprintCaptureOptions = {},\n): WorkspaceFingerprint {\n\tconst rawScope = exactObject(scope, \"workspace scope\", [\"root\", \"artifactPaths\"]);\n\tconst rawRoot = rawScope.root;\n\tif (typeof rawRoot !== \"string\" || rawRoot.length === 0) {\n\t\tthrow new Error(\"workspace scope root must be a non-empty string\");\n\t}\n\tconst rawArtifactPaths = exactArray(rawScope.artifactPaths, \"workspace scope artifactPaths\");\n\n\tconst seen = new Set<string>();\n\tfor (let index = 0; index < rawArtifactPaths.length; index++) {\n\t\tconst artifactPath = rawArtifactPaths[index];\n\t\tassertNormalizedArtifactPath(artifactPath, `workspace scope artifactPaths[${index}]`);\n\t\tif (seen.has(artifactPath)) {\n\t\t\tthrow new Error(`duplicate workspace artifact path: ${artifactPath}`);\n\t\t}\n\t\tseen.add(artifactPath);\n\t}\n\n\tconst resolvedRoot = resolve(rawRoot);\n\tconst rootStat = lstatSync(resolvedRoot);\n\tif (rootStat.isSymbolicLink()) {\n\t\tthrow new Error(\"workspace root must not be a symlink\");\n\t}\n\tif (!rootStat.isDirectory()) {\n\t\tthrow new Error(\"workspace root must be a directory\");\n\t}\n\tconst root = realpathSync(resolvedRoot);\n\tconst trustedRootStat = lstatSync(root);\n\tconst artifactPaths = (rawArtifactPaths as string[]).sort();\n\tconst canonicalScope: WorkspaceScope = Object.freeze({ root, artifactPaths: Object.freeze(artifactPaths) });\n\tif (isGitWorkspaceRoot(root)) {\n\t\treturn captureGitWorkspaceFingerprint(root, trustedRootStat, canonicalScope, options);\n\t}\n\tconst artifacts = artifactPaths.map((artifactPath) =>\n\t\tcaptureSelectedArtifact(root, trustedRootStat, artifactPath, options),\n\t);\n\tconst fingerprint = {\n\t\tkind: \"artifact-set\",\n\t\tscope: canonicalScope,\n\t\tartifacts: Object.freeze(artifacts),\n\t\tmanifestSha256: computeWorkspaceManifestSha256(canonicalScope, artifacts),\n\t};\n\treturn parseWorkspaceFingerprint(fingerprint);\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";
@@ -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,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,K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2B,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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AM,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";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,0BAA0B;AAE1B,OAAO,EAMN,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,oBAAoB,GAEpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAIN,0BAA0B,GAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEN,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,GAKzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,6BAA6B,EAS7B,uBAAuB,EAGvB,uBAAuB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEN,uBAAuB,EAEvB,wBAAwB,GAExB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,0BAA0B;AAC1B,OAAO,EAIN,W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;AAC1B,+BAA+B;AAC/B,OAAO,EACN,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,cAAc,EACd,6BAA6B,EAC7B,iCAAiC,EACjC,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AA4B5C,sBAAsB;AACtB,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,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,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.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,0BAA0B;AAE1B,OAAO,EAMN,4BAA4B,EAC5B,gCAAgC,EAChC,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,oBAAoB,GAEpB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAIN,0BAA0B,GAC1B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEN,2BAA2B,EAC3B,iCAAiC,EACjC,yBAAyB,GAKzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AACrD,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EACN,6BAA6B,EAS7B,uBAAuB,EAGvB,uBAAuB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEN,uBAAuB,EAEvB,wBAAwB,GAExB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,0BAA0B;AAC1B,OAAO,EAIN,WAAW,EAEX,sBAAsB,EACtB,0BAA0B,GAE1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEN,SAAS,EAGT,aAAa,EAEb,uBAAuB,EAWvB,aAAa,EACb,cAAc,EACd,6BAA6B,EAC7B,SAAS,EAST,cAAc,EAKd,qBAAqB,EAErB,cAAc,EAEd,eAAe,EACf,mBAAmB,GAMnB,MAAM,4BAA4B,CAAC;AACpC,aAAa;AACb,OAAO,EAYN,sBAAsB,EAC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ACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AA4B5C,sBAAsB;AACtB,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,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,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"]}