@oscharko-dev/keiko 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -1
- package/dist/ui/csp-hashes.json +7 -7
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/__next.__PAGE__.txt +4 -4
- package/dist/ui/static/__next._full.txt +4 -4
- package/dist/ui/static/__next._tree.txt +1 -1
- package/dist/ui/static/_next/static/chunks/01f2r2l4gzscm.css +4 -0
- package/dist/ui/static/_next/static/chunks/{3_10vm9g45_8y.js → 06j35fs_cota7.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0egrai9cigb1t.js +1 -0
- package/dist/ui/static/_next/static/chunks/0gzualdhleagc.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3_qhvykv4ncye.js → 0wsxu0g-c4dbf.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{1jh83l6i471hs.js → 1axubnnxhxh-s.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1gnjh00dyjkye.js +1 -0
- package/dist/ui/static/_next/static/chunks/{21yx7habl0roe.js → 1jgm4793jm1pv.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1livbv_zx95bb.js +1 -0
- package/dist/ui/static/_next/static/chunks/1lpdde9w2vl93.js +1 -0
- package/dist/ui/static/_next/static/chunks/2muaa_i0plkwf.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3dgn8o9f1kc8m.js → 3_2d222-16b9x.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{3jgowfcbukuu6.js → 3__pdxfo3bpc1.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{3tl76hukh2-pb.js → 3hw8-lgs3prjc.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{26dysjhfplkru.js → 3pe5ji2-axln6.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{1nz7wziy2b21i.js → 3qgbq3-b3p7a3.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{3e-3pvlfnqvhc.js → 3ts6g_psw2r__.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3ulj-p08q5sh1.js +1 -0
- package/dist/ui/static/_next/static/chunks/3yaa0g7ymbq5e.js +1 -0
- package/dist/ui/static/_not-found/__next._full.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/ui/static/_not-found/__next._tree.txt +1 -1
- package/dist/ui/static/_not-found.html +1 -1
- package/dist/ui/static/_not-found.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._full.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +1 -1
- package/dist/ui/static/atlassian-connectors.html +1 -1
- package/dist/ui/static/atlassian-connectors.txt +1 -1
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +4 -4
- package/dist/ui/static/launch/__next._full.txt +4 -4
- package/dist/ui/static/launch/__next._tree.txt +1 -1
- package/dist/ui/static/launch/__next.launch.__PAGE__.txt +4 -4
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +4 -4
- package/dist/ui/static/local-knowledge/__next._full.txt +4 -4
- package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +4 -4
- package/dist/ui/static/local-knowledge/capsule/__next._full.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +1 -1
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +4 -4
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory-data.generated.json +14 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.js +6 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.js +9 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.js +38 -2
- package/node_modules/@oscharko-dev/keiko-cli/package.json +15 -15
- package/node_modules/@oscharko-dev/keiko-connectors/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-connectors/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts +24 -4
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.js +29 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-coverage.generated.json +128 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-identity.generated.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-identity.generated.js +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operation-surfaces.generated.json +2 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts +103 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.js +107 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.js +8 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/editor-agent.d.ts +48 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/editor-agent.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/editor-agent.js +85 -6
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-bridge.d.ts +14 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-bridge.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-bridge.js +23 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.d.ts +23 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.js +29 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/version.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/version.js +2 -2
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-git/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-git/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +7 -7
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +10 -7
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +20 -4
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.js +24 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +8 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts +7 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.js +70 -12
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.js +24 -6
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction-code.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction-code.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction-diff.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction-diff.js +77 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction.d.ts +12 -3
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction.js +32 -5
- package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/agent-run-governance.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/agent-run-governance.js +4 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/browser.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/browser.js +5 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.js +4 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/codingRunSessionLease.d.ts +13 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/codingRunSessionLease.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/codingRunSessionLease.js +8 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionStreamWriter.d.ts +3 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionStreamWriter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionStreamWriter.js +4 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.js +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.d.ts +25 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.js +127 -28
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRoutes.js +3 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.js +25 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.js +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.d.ts +12 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.js +14 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.js +14 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolNativeEffect.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolNativeEffect.js +6 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.d.ts +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.js +28 -13
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessTree.d.ts +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessTree.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessTree.js +53 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeHttpClient.js +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.d.ts +7 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.js +8 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativePolicy.d.ts +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativePolicy.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativePolicy.js +4 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeProtocol.d.ts +17 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeProtocol.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeProtocol.js +36 -16
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRipgrepLaunch.d.ts +9 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRipgrepLaunch.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRipgrepLaunch.js +53 -12
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRunStateSweep.d.ts +27 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRunStateSweep.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRunStateSweep.js +114 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts +12 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.js +62 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.js +52 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.d.ts +7 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.js +7 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.d.ts +23 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.js +145 -55
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.js +35 -11
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.js +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeHost.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.js +10 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.js +13 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.js +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.js +21 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +96 -23
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.js +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/command-runner-routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/command-runner-routes.js +4 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +1 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +2 -80
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +8 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.js +12 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/dap/dapDebugRoutes.js +5 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/settings/editorSettingsEvents.js +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/snippets/workspaceSnippetsRoutes.js +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRoutes.js +9 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/watch/workspaceWatchRoutes.js +6 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +89 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDiffTruncation.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDiffTruncation.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDiffTruncation.js +78 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDiffView.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDiffView.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDiffView.js +54 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gitRoutes.js +27 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/qualityIntelligence/runRoutes.js +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/redaction-secrets.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/redaction-secrets.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/redaction-secrets.js +85 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-activity-broadcast.js +4 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/relationship-handlers.js +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/run-handlers.js +4 -14
- package/node_modules/@oscharko-dev/keiko-server/dist/runtime/containerRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/runtime/containerRoutes.js +4 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.d.ts +42 -18
- package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/sse-write.js +122 -35
- package/node_modules/@oscharko-dev/keiko-server/dist/sse.d.ts +6 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/sse.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/sse.js +13 -29
- package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/terminal-routes.js +5 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.js +4 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolLifecycle.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolLifecycle.js +15 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.js +19 -5
- package/node_modules/@oscharko-dev/keiko-server/package.json +23 -23
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/arguments.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/arguments.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/arguments.js +2 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/descriptor.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/descriptor.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/descriptor.js +6 -5
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/json.d.ts +9 -3
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/json.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/json.js +19 -8
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.js +6 -4
- package/node_modules/@oscharko-dev/keiko-tool-catalog/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +7 -7
- package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
- package/package.json +27 -27
- package/release-impact.catalog.json +70 -0
- package/vendor/oscharko-dev-keiko-activity-log-1.3.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-cli-1.3.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-connectors-1.3.1.tgz → oscharko-dev-keiko-connectors-1.3.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-contracts-1.3.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-evaluations-1.3.1.tgz → oscharko-dev-keiko-evaluations-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-evidence-1.3.1.tgz → oscharko-dev-keiko-evidence-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-git-1.3.1.tgz → oscharko-dev-keiko-git-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-harness-1.3.1.tgz → oscharko-dev-keiko-harness-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-local-knowledge-1.3.1.tgz → oscharko-dev-keiko-local-knowledge-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-capture-1.3.1.tgz → oscharko-dev-keiko-memory-capture-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-consolidation-1.3.1.tgz → oscharko-dev-keiko-memory-consolidation-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-governance-1.3.1.tgz → oscharko-dev-keiko-memory-governance-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-retrieval-1.3.1.tgz → oscharko-dev-keiko-memory-retrieval-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-vault-1.3.1.tgz → oscharko-dev-keiko-memory-vault-1.3.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-1.3.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-quality-intelligence-1.3.1.tgz → oscharko-dev-keiko-quality-intelligence-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sandbox-1.3.1.tgz → oscharko-dev-keiko-sandbox-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sdk-1.3.1.tgz → oscharko-dev-keiko-sdk-1.3.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-security-1.3.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-1.3.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-tool-catalog-1.3.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-tools-1.3.1.tgz → oscharko-dev-keiko-tools-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-verification-1.3.1.tgz → oscharko-dev-keiko-verification-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workflows-1.3.1.tgz → oscharko-dev-keiko-workflows-1.3.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workspace-1.3.1.tgz → oscharko-dev-keiko-workspace-1.3.2.tgz} +0 -0
- package/dist/ui/static/_next/static/chunks/0dq9bimpknhi-.js +0 -1
- package/dist/ui/static/_next/static/chunks/1cirwobl5ywpw.js +0 -1
- package/dist/ui/static/_next/static/chunks/1ufe9d586c16n.js +0 -1
- package/dist/ui/static/_next/static/chunks/1xyltb603pg9u.css +0 -4
- package/dist/ui/static/_next/static/chunks/2ajat_rv2v0wp.js +0 -1
- package/dist/ui/static/_next/static/chunks/2bm_bps837c8s.js +0 -1
- package/dist/ui/static/_next/static/chunks/2l0_e_qyhvve_.js +0 -1
- package/dist/ui/static/_next/static/chunks/3-ejbbkmhwal-.js +0 -1
- package/dist/ui/static/_next/static/chunks/4598s2z_w_1la.js +0 -1
- package/vendor/oscharko-dev-keiko-activity-log-1.3.1.tgz +0 -0
- package/vendor/oscharko-dev-keiko-cli-1.3.1.tgz +0 -0
- package/vendor/oscharko-dev-keiko-contracts-1.3.1.tgz +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-1.3.1.tgz +0 -0
- package/vendor/oscharko-dev-keiko-security-1.3.1.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-1.3.1.tgz +0 -0
- package/vendor/oscharko-dev-keiko-tool-catalog-1.3.1.tgz +0 -0
- /package/dist/ui/static/_next/static/{UsrqVgAeCxovpV7C_di1N → xKDN0SO4oRp9dU6qR6ood}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{UsrqVgAeCxovpV7C_di1N → xKDN0SO4oRp9dU6qR6ood}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/static/_next/static/{UsrqVgAeCxovpV7C_di1N → xKDN0SO4oRp9dU6qR6ood}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { CODING_WORKBENCH_APPROVAL_REVIEW_MAX_PATHS, CODING_WORKBENCH_APPROVAL_REVIEW_PATH_MAX_CHARS, } from "@oscharko-dev/keiko-contracts/runtime/coding-workbench-runtime-approval-review";
|
|
3
|
-
import {
|
|
3
|
+
import { toolArgumentLimitsByToolName } from "@oscharko-dev/keiko-contracts/runtime/governed-tool-bridge";
|
|
4
|
+
import { CHANGESET_EDIT_ARGUMENT_LIMITS, TOOL_CATALOG_LIMITS, } from "@oscharko-dev/keiko-contracts/runtime/governed-tool-catalog";
|
|
4
5
|
import { ToolCatalogError, captureCatalogJson } from "@oscharko-dev/keiko-tool-catalog";
|
|
5
6
|
import { parseCodingSidecarEventLine, } from "./codingSidecarEventParser.js";
|
|
6
7
|
import { isAdmissibleOpenCodeToolName, openCodeToolLogLabel } from "./opencodeNativeTools.js";
|
|
@@ -28,28 +29,46 @@ const MAX_HISTORY_INFO_DEPTH = 8;
|
|
|
28
29
|
/**
|
|
29
30
|
* A durable tool part records the governed call's arguments twice: parsed as `state.input` (every
|
|
30
31
|
* status) and as the provider's raw text `state.raw` (pending). Both were admitted upstream under
|
|
31
|
-
* the catalog ceilings (ADR-0175 D4, `TOOL_CATALOG_LIMITS
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* the catalog ceilings (ADR-0175 D4, `TOOL_CATALOG_LIMITS`; the governed changeset edit and the
|
|
33
|
+
* native file-content tools carry their own, `CHANGESET_EDIT_ARGUMENT_LIMITS`), so the same
|
|
34
|
+
* ceilings -- not the 4096-character metadata bound -- re-bound them here, and this is the largest
|
|
35
|
+
* part one call can therefore leave: the metadata budget plus two argument bodies of the largest
|
|
36
|
+
* ceiling. Run 2026-09-10: a 19 KiB `keiko_changeset_edit` patch, inside the patch contract of the
|
|
37
|
+
* time, failed the metadata bound, the whole `POST /sync/history` pull threw, and the run ended
|
|
38
|
+
* `runtime-failed` on its first edit.
|
|
36
39
|
*/
|
|
37
|
-
export const OPENCODE_HISTORY_TOOL_PART_MAX_BYTES = MAX_HISTORY_INFO_BYTES + 2 *
|
|
40
|
+
export const OPENCODE_HISTORY_TOOL_PART_MAX_BYTES = MAX_HISTORY_INFO_BYTES + 2 * CHANGESET_EDIT_ARGUMENT_LIMITS.maxArgumentBytes;
|
|
38
41
|
// One governed call leaves at most three argument-bearing rows (pending, running, settled): the
|
|
39
42
|
// pending row carries both bodies, the other two carry `state.input` once each.
|
|
40
|
-
|
|
43
|
+
function historyToolCallRowsMaxBytes(argumentLimits) {
|
|
44
|
+
return 3 * MAX_HISTORY_INFO_BYTES + 4 * argumentLimits.maxArgumentBytes;
|
|
45
|
+
}
|
|
41
46
|
/** Argument-bearing calls one catch-up pull is budgeted for after a stream reconnect. */
|
|
42
47
|
export const OPENCODE_HISTORY_CATCH_UP_TOOL_CALLS = 8;
|
|
48
|
+
/**
|
|
49
|
+
* Of those calls, how many may be changeset-edit calls (or native file-content calls) at their own,
|
|
50
|
+
* far larger argument ceiling (owner decision 2026-10-28: an edit of up to 8 MiB is never
|
|
51
|
+
* refused). One whole such call fits a pull; the rest of the budget is ordinary calls, so the
|
|
52
|
+
* response bound grows by one call's rows, not by a multiple of the whole catch-up allowance.
|
|
53
|
+
*/
|
|
54
|
+
export const OPENCODE_HISTORY_CATCH_UP_CHANGESET_EDIT_CALLS = 1;
|
|
43
55
|
// The per-pull budget every non-argument row shared before tool bodies were admitted at all.
|
|
44
56
|
const HISTORY_METADATA_ROWS_MAX_BYTES = 1024 * 1024;
|
|
45
57
|
/**
|
|
46
58
|
* `POST /sync/history` returns every durable row after the checkpoints, so one pull after a stream
|
|
47
59
|
* reconnect can carry a whole turn. The response budget therefore covers the ordinary metadata rows
|
|
48
|
-
* plus the argument-bearing rows of OPENCODE_HISTORY_CATCH_UP_TOOL_CALLS calls
|
|
49
|
-
*
|
|
60
|
+
* plus the argument-bearing rows of OPENCODE_HISTORY_CATCH_UP_TOOL_CALLS calls, of which
|
|
61
|
+
* OPENCODE_HISTORY_CATCH_UP_CHANGESET_EDIT_CALLS may be at the changeset-edit ceiling; a pull above
|
|
62
|
+
* it still fails closed (`opencode-history-oversized`) and is recorded by its closed reason.
|
|
50
63
|
*/
|
|
51
64
|
export const OPENCODE_HISTORY_RESPONSE_MAX_BYTES = HISTORY_METADATA_ROWS_MAX_BYTES +
|
|
52
|
-
OPENCODE_HISTORY_CATCH_UP_TOOL_CALLS *
|
|
65
|
+
(OPENCODE_HISTORY_CATCH_UP_TOOL_CALLS - OPENCODE_HISTORY_CATCH_UP_CHANGESET_EDIT_CALLS) *
|
|
66
|
+
historyToolCallRowsMaxBytes({
|
|
67
|
+
maxArgumentBytes: TOOL_CATALOG_LIMITS.maxArgumentBytes,
|
|
68
|
+
maxStringBytes: TOOL_CATALOG_LIMITS.maxStringBytes,
|
|
69
|
+
}) +
|
|
70
|
+
OPENCODE_HISTORY_CATCH_UP_CHANGESET_EDIT_CALLS *
|
|
71
|
+
historyToolCallRowsMaxBytes(CHANGESET_EDIT_ARGUMENT_LIMITS);
|
|
53
72
|
const MAX_JSON_DEPTH = 64;
|
|
54
73
|
const ID = /^(?:evt_|ses_|per|que)[A-Za-z0-9_-]+$/u;
|
|
55
74
|
const PERMISSION_ID = /^per_[A-Za-z0-9_-]+$/u;
|
|
@@ -1113,7 +1132,8 @@ function partBodyGate(part) {
|
|
|
1113
1132
|
* metadata, times, ids -- keeps the metadata bound. The admitted bodies never reach the projection.
|
|
1114
1133
|
*/
|
|
1115
1134
|
function toolPartBodyGate(part, state) {
|
|
1116
|
-
|
|
1135
|
+
const limits = toolArgumentLimitsByToolName(typeof part.tool === "string" ? part.tool : "");
|
|
1136
|
+
if (!boundedToolArguments(state.input, limits) || !boundedRawToolArguments(state.raw, limits)) {
|
|
1117
1137
|
return "argument-bound";
|
|
1118
1138
|
}
|
|
1119
1139
|
const bodiless = { ...part, state: { ...state, ...blankedToolArguments(state) } };
|
|
@@ -1131,11 +1151,11 @@ function toolPartBodyGate(part, state) {
|
|
|
1131
1151
|
}
|
|
1132
1152
|
// A non-record is left to the tool-state gate, which refuses it under its own name; a record is
|
|
1133
1153
|
// validated exactly as the gateway validated it (byte, string-byte, depth, key and item ceilings).
|
|
1134
|
-
function boundedToolArguments(input) {
|
|
1154
|
+
function boundedToolArguments(input, limits) {
|
|
1135
1155
|
if (!isRecord(input))
|
|
1136
1156
|
return true;
|
|
1137
1157
|
try {
|
|
1138
|
-
captureCatalogJson(input);
|
|
1158
|
+
captureCatalogJson(input, undefined, limits);
|
|
1139
1159
|
return true;
|
|
1140
1160
|
}
|
|
1141
1161
|
catch (error) {
|
|
@@ -1146,8 +1166,8 @@ function boundedToolArguments(input) {
|
|
|
1146
1166
|
}
|
|
1147
1167
|
// The raw text is the canonical argument JSON the gateway handed the runtime, so it can never
|
|
1148
1168
|
// legitimately exceed the argument ceiling; a non-string is again the tool-state gate's refusal.
|
|
1149
|
-
function boundedRawToolArguments(raw) {
|
|
1150
|
-
return typeof raw !== "string" || bytes(raw) <=
|
|
1169
|
+
function boundedRawToolArguments(raw, limits) {
|
|
1170
|
+
return typeof raw !== "string" || bytes(raw) <= limits.maxArgumentBytes;
|
|
1151
1171
|
}
|
|
1152
1172
|
function blankedToolArguments(state) {
|
|
1153
1173
|
return {
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRipgrepLaunch.d.ts
CHANGED
|
@@ -65,16 +65,18 @@ export interface OpenCodeRipgrepRequest {
|
|
|
65
65
|
*/
|
|
66
66
|
export declare function resolveOpenCodeRipgrep(request: OpenCodeRipgrepRequest): OpenCodeRipgrepResolution;
|
|
67
67
|
/**
|
|
68
|
-
* The PATH the native profile's child and its kernel read allowlist share
|
|
69
|
-
* in front of what the launcher already had.
|
|
70
|
-
*
|
|
68
|
+
* The PATH the native profile's child and its kernel read allowlist share. A verified executable's
|
|
69
|
+
* directory goes in front of what the launcher already had. An unverified one removes every entry
|
|
70
|
+
* that provides a host `rg`, so search degrades instead of running an unverified executable; the
|
|
71
|
+
* read allowlist follows the same PATH. `undefined` only when the launcher had no PATH.
|
|
71
72
|
*/
|
|
72
73
|
export declare function ripgrepNativePath(launcherPath: string | undefined, resolution: OpenCodeRipgrepResolution): string | undefined;
|
|
73
74
|
/**
|
|
74
|
-
* The environment the manager copies the launch's allowlisted names from.
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* the verified directory alone
|
|
75
|
+
* The environment the manager copies the launch's allowlisted names from. The native profile
|
|
76
|
+
* inherits the launcher's PATH, so its child PATH is the verified directory followed by that PATH,
|
|
77
|
+
* or, for an unverified ripgrep, that PATH without any `rg` provider. The mapped profiles inherit
|
|
78
|
+
* nothing else, so theirs is the verified directory alone, or no PATH at all when unverified; no
|
|
79
|
+
* entry of the launcher's PATH is ever relied on to find ripgrep.
|
|
78
80
|
*/
|
|
79
81
|
export declare function ripgrepLaunchEnvironment(processEnv: NodeJS.ProcessEnv | undefined, resolution: OpenCodeRipgrepResolution, native: boolean): NodeJS.ProcessEnv | undefined;
|
|
80
82
|
/** The mapped profiles inherit no names; they inherit PATH only to carry the verified directory. */
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRipgrepLaunch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencodeRipgrepLaunch.d.ts","sourceRoot":"","sources":["../../src/coding-runtime/opencodeRipgrepLaunch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"opencodeRipgrepLaunch.d.ts","sourceRoot":"","sources":["../../src/coding-runtime/opencodeRipgrepLaunch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAMtE,OAAO,EAQL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAE7B,MAAM,qBAAqB,CAAC;AAY7B,qEAAqE;AACrE,eAAO,MAAM,mCAAmC,YAC9C,oBAAoB,EACpB,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,WAAW,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|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRipgrepLaunch.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { statSync } from "node:fs";
|
|
2
|
+
import { delimiter, dirname, isAbsolute, join } from "node:path";
|
|
2
3
|
import { activityLogEvent, defineActivityLogOperation, } from "@oscharko-dev/keiko-contracts/runtime/observability";
|
|
3
4
|
import { RIPGREP_OVERRIDE_ENV, RIPGREP_RUNTIME_MANIFEST, resolveVerifiedRipgrep, ripgrepActivationDigest, ripgrepRuntimeApproval, ripgrepTargetKeyForPortableTarget, verifyRipgrepExecutable, } from "./ripgrepRuntime.js";
|
|
4
5
|
// OpenCode's glob and grep tools and its file finder run ripgrep. The runtime looks for `rg` on its
|
|
@@ -6,7 +7,10 @@ import { RIPGREP_OVERRIDE_ENV, RIPGREP_RUNTIME_MANIFEST, resolveVerifiedRipgrep,
|
|
|
6
7
|
// never lets the runtime reach that third step: at every launch it resolves the one pinned
|
|
7
8
|
// executable through the verifier, and only a verified executable's directory is put on the child
|
|
8
9
|
// PATH. An unverified one leaves the run starting with search degraded, and the closed reason is
|
|
9
|
-
// recorded on the Activity Log (never a path).
|
|
10
|
+
// recorded on the Activity Log (never a path). A degraded native launch also loses every inherited
|
|
11
|
+
// PATH entry that provides an `rg`: an unverified host ripgrep (Homebrew, a workspace-planted one)
|
|
12
|
+
// is never executed in the pinned one's place. The pinned OpenCode runtime has no switch that turns
|
|
13
|
+
// its own ripgrep download off; below Full access the loopback-only egress refuses it.
|
|
10
14
|
/** The closed vocabulary of why a launch has no verified ripgrep. */
|
|
11
15
|
export const OPENCODE_RIPGREP_UNVERIFIED_REASONS = [
|
|
12
16
|
"unsupported-target",
|
|
@@ -189,25 +193,62 @@ function prependDirectory(directory, path) {
|
|
|
189
193
|
: path.split(delimiter).filter((entry) => entry !== directory);
|
|
190
194
|
return [directory, ...inherited].join(delimiter);
|
|
191
195
|
}
|
|
196
|
+
const RIPGREP_EXECUTABLE_NAMES = process.platform === "win32" ? ["rg.exe", "rg.com", "rg.bat", "rg.cmd"] : ["rg"];
|
|
197
|
+
function isAbsentError(error) {
|
|
198
|
+
return (error instanceof Error &&
|
|
199
|
+
"code" in error &&
|
|
200
|
+
(error.code === "ENOENT" || error.code === "ENOTDIR"));
|
|
201
|
+
}
|
|
202
|
+
function isFile(path) {
|
|
203
|
+
try {
|
|
204
|
+
return statSync(path).isFile();
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
// Only a missing path proves the file is absent; any other failure cannot prove it, so the
|
|
208
|
+
// directory is treated as a possible provider (fail closed).
|
|
209
|
+
return !isAbsentError(error);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// An empty or relative entry resolves against the child's working directory, the workspace, which
|
|
213
|
+
// can plant an `rg`; it cannot be proven free of one from here.
|
|
214
|
+
function mayProvideRipgrep(entry) {
|
|
215
|
+
if (!isAbsolute(entry))
|
|
216
|
+
return true;
|
|
217
|
+
return RIPGREP_EXECUTABLE_NAMES.some((name) => isFile(join(entry, name)));
|
|
218
|
+
}
|
|
219
|
+
/** The inherited PATH without any entry that provides an `rg`; every other entry keeps its order. */
|
|
220
|
+
function withoutRipgrepProviders(path) {
|
|
221
|
+
if (path === undefined)
|
|
222
|
+
return undefined;
|
|
223
|
+
return path
|
|
224
|
+
.split(delimiter)
|
|
225
|
+
.filter((entry) => !mayProvideRipgrep(entry))
|
|
226
|
+
.join(delimiter);
|
|
227
|
+
}
|
|
192
228
|
/**
|
|
193
|
-
* The PATH the native profile's child and its kernel read allowlist share
|
|
194
|
-
* in front of what the launcher already had.
|
|
195
|
-
*
|
|
229
|
+
* The PATH the native profile's child and its kernel read allowlist share. A verified executable's
|
|
230
|
+
* directory goes in front of what the launcher already had. An unverified one removes every entry
|
|
231
|
+
* that provides a host `rg`, so search degrades instead of running an unverified executable; the
|
|
232
|
+
* read allowlist follows the same PATH. `undefined` only when the launcher had no PATH.
|
|
196
233
|
*/
|
|
197
234
|
export function ripgrepNativePath(launcherPath, resolution) {
|
|
198
235
|
return resolution.outcome === "verified"
|
|
199
236
|
? prependDirectory(resolution.directory, launcherPath)
|
|
200
|
-
:
|
|
237
|
+
: withoutRipgrepProviders(launcherPath);
|
|
201
238
|
}
|
|
202
239
|
/**
|
|
203
|
-
* The environment the manager copies the launch's allowlisted names from.
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* the verified directory alone
|
|
240
|
+
* The environment the manager copies the launch's allowlisted names from. The native profile
|
|
241
|
+
* inherits the launcher's PATH, so its child PATH is the verified directory followed by that PATH,
|
|
242
|
+
* or, for an unverified ripgrep, that PATH without any `rg` provider. The mapped profiles inherit
|
|
243
|
+
* nothing else, so theirs is the verified directory alone, or no PATH at all when unverified; no
|
|
244
|
+
* entry of the launcher's PATH is ever relied on to find ripgrep.
|
|
207
245
|
*/
|
|
208
246
|
export function ripgrepLaunchEnvironment(processEnv, resolution, native) {
|
|
209
|
-
if (resolution.outcome !== "verified")
|
|
210
|
-
|
|
247
|
+
if (resolution.outcome !== "verified") {
|
|
248
|
+
if (!native || processEnv?.PATH === undefined)
|
|
249
|
+
return processEnv;
|
|
250
|
+
return { ...processEnv, PATH: withoutRipgrepProviders(processEnv.PATH) };
|
|
251
|
+
}
|
|
211
252
|
const path = native
|
|
212
253
|
? prependDirectory(resolution.directory, processEnv?.PATH)
|
|
213
254
|
: resolution.directory;
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRunStateSweep.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ServerDiagnosticSink } from "../diagnostics-log.js";
|
|
2
|
+
export interface OrphanedRunStateSweepInput {
|
|
3
|
+
/** The owned directory that holds one subdirectory per run: `<state>/coding-runtime/opencode`. */
|
|
4
|
+
readonly stateBaseRoot: string;
|
|
5
|
+
/** Whether a run is live or can still be recovered; its directory is then left alone. */
|
|
6
|
+
readonly isRetained: (runId: string) => boolean;
|
|
7
|
+
readonly diagnostics?: ServerDiagnosticSink | undefined;
|
|
8
|
+
/** Removal seam for fault injection; production removes with `rmSync`. */
|
|
9
|
+
readonly remove?: ((path: string) => void) | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface OrphanedRunStateSweepResult {
|
|
12
|
+
readonly scanned: number;
|
|
13
|
+
readonly removed: number;
|
|
14
|
+
readonly retained: number;
|
|
15
|
+
readonly skipped: number;
|
|
16
|
+
readonly failed: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Removes the per-run state directories that belong to no live or recoverable run: a crash or a
|
|
20
|
+
* disposal that failed leaves the run's OpenCode database, configuration and temporary files behind
|
|
21
|
+
* (audit 2026-10, finding 8). Only the owned base directory is scanned, only real directories with
|
|
22
|
+
* a run-shaped name inside it are removed, a symbolic link is never followed or removed, and a
|
|
23
|
+
* directory owned by another user is left alone. The result is counts only; nothing a directory
|
|
24
|
+
* held, and no path, is ever recorded.
|
|
25
|
+
*/
|
|
26
|
+
export declare function sweepOrphanedOpenCodeRunState(input: OrphanedRunStateSweepInput): OrphanedRunStateSweepResult;
|
|
27
|
+
//# sourceMappingURL=opencodeRunStateSweep.d.ts.map
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRunStateSweep.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencodeRunStateSweep.d.ts","sourceRoot":"","sources":["../../src/coding-runtime/opencodeRunStateSweep.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAM/B,MAAM,WAAW,0BAA0B;IACzC,kGAAkG;IAClG,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IAChD,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;IACxD,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CACxD;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAiBD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,0BAA0B,GAChC,2BAA2B,CAc7B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { lstatSync, readdirSync, rmSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { UNKNOWN_CORRELATION_ID } from "../correlation.js";
|
|
4
|
+
import { describeError, emitServerDiagnostic, } from "../diagnostics-log.js";
|
|
5
|
+
// A run id as the composition mints it (`run-<decimal>`) and as every fixture spells it; nothing
|
|
6
|
+
// else under the owned directory is ever treated as a run's state.
|
|
7
|
+
const RUN_STATE_DIRECTORY_NAME = /^[A-Za-z0-9_-]{1,128}$/u;
|
|
8
|
+
const NOTHING = {
|
|
9
|
+
scanned: 0,
|
|
10
|
+
removed: 0,
|
|
11
|
+
retained: 0,
|
|
12
|
+
skipped: 0,
|
|
13
|
+
failed: 0,
|
|
14
|
+
};
|
|
15
|
+
function isOwnedDirectory(path) {
|
|
16
|
+
const stat = lstatSync(path, { throwIfNoEntry: false });
|
|
17
|
+
if (stat === undefined || !stat.isDirectory() || stat.isSymbolicLink())
|
|
18
|
+
return false;
|
|
19
|
+
const uid = process.getuid?.();
|
|
20
|
+
return uid === undefined || stat.uid === uid;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Removes the per-run state directories that belong to no live or recoverable run: a crash or a
|
|
24
|
+
* disposal that failed leaves the run's OpenCode database, configuration and temporary files behind
|
|
25
|
+
* (audit 2026-10, finding 8). Only the owned base directory is scanned, only real directories with
|
|
26
|
+
* a run-shaped name inside it are removed, a symbolic link is never followed or removed, and a
|
|
27
|
+
* directory owned by another user is left alone. The result is counts only; nothing a directory
|
|
28
|
+
* held, and no path, is ever recorded.
|
|
29
|
+
*/
|
|
30
|
+
export function sweepOrphanedOpenCodeRunState(input) {
|
|
31
|
+
let names;
|
|
32
|
+
try {
|
|
33
|
+
if (!isOwnedDirectory(input.stateBaseRoot))
|
|
34
|
+
return NOTHING;
|
|
35
|
+
names = readdirSync(input.stateBaseRoot, { withFileTypes: true })
|
|
36
|
+
.filter((entry) => entry.isDirectory())
|
|
37
|
+
.map((entry) => entry.name);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
recordSweep(input.diagnostics, { ...NOTHING, failed: 1 }, error);
|
|
41
|
+
return { ...NOTHING, failed: 1 };
|
|
42
|
+
}
|
|
43
|
+
const result = sweepEntries(input, names);
|
|
44
|
+
if (result.removed > 0 || result.failed > 0)
|
|
45
|
+
recordSweep(input.diagnostics, result, undefined);
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
// The failures that are recorded one by one; the summary line still counts all of them.
|
|
49
|
+
const MAX_RECORDED_REMOVAL_FAILURES = 8;
|
|
50
|
+
function sweepEntries(input, names) {
|
|
51
|
+
let removed = 0;
|
|
52
|
+
let retained = 0;
|
|
53
|
+
let skipped = 0;
|
|
54
|
+
let failed = 0;
|
|
55
|
+
for (const name of names) {
|
|
56
|
+
if (!RUN_STATE_DIRECTORY_NAME.test(name)) {
|
|
57
|
+
skipped += 1;
|
|
58
|
+
}
|
|
59
|
+
else if (input.isRetained(name)) {
|
|
60
|
+
retained += 1;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
try {
|
|
64
|
+
removeRunDirectory(join(input.stateBaseRoot, name), input.remove);
|
|
65
|
+
removed += 1;
|
|
66
|
+
}
|
|
67
|
+
catch (cause) {
|
|
68
|
+
failed += 1;
|
|
69
|
+
if (failed <= MAX_RECORDED_REMOVAL_FAILURES)
|
|
70
|
+
recordRemovalFailure(input.diagnostics, cause);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { scanned: names.length, removed, retained, skipped, failed };
|
|
75
|
+
}
|
|
76
|
+
function removeRunDirectory(path, remove) {
|
|
77
|
+
// Re-checked at removal: an entry replaced by a link or a foreign directory since the scan stays.
|
|
78
|
+
if (!isOwnedDirectory(path))
|
|
79
|
+
throw new Error("opencode-run-state-not-owned");
|
|
80
|
+
const removal = remove ??
|
|
81
|
+
((target) => {
|
|
82
|
+
rmSync(target, { recursive: true, force: true });
|
|
83
|
+
});
|
|
84
|
+
removal(path);
|
|
85
|
+
}
|
|
86
|
+
function recordSweep(diagnostics, counts, error) {
|
|
87
|
+
const detail = error === undefined ? undefined : describeError(error);
|
|
88
|
+
emitServerDiagnostic(diagnostics, {
|
|
89
|
+
correlationId: UNKNOWN_CORRELATION_ID,
|
|
90
|
+
timestamp: new Date().toISOString(),
|
|
91
|
+
operation: "coding-runtime.run-state",
|
|
92
|
+
source: "opencode.run-state.sweep",
|
|
93
|
+
errorClass: detail?.errorClass ?? "OpenCodeOrphanedRunState",
|
|
94
|
+
message: "runtime-lifecycle-failed",
|
|
95
|
+
code: `stage=startup:reason=orphaned-run-state:scanned=${String(counts.scanned)}:removed=${String(counts.removed)}:retained=${String(counts.retained)}:skipped=${String(counts.skipped)}:failed=${String(counts.failed)}`,
|
|
96
|
+
...(detail?.frames === undefined ? {} : { frames: detail.frames }),
|
|
97
|
+
...(detail?.causeChain === undefined ? {} : { causeChain: detail.causeChain }),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// One removal that failed: its error class and Keiko frames, never the path or the error text.
|
|
101
|
+
function recordRemovalFailure(diagnostics, error) {
|
|
102
|
+
const detail = describeError(error);
|
|
103
|
+
emitServerDiagnostic(diagnostics, {
|
|
104
|
+
correlationId: UNKNOWN_CORRELATION_ID,
|
|
105
|
+
timestamp: new Date().toISOString(),
|
|
106
|
+
operation: "coding-runtime.run-state",
|
|
107
|
+
source: "opencode.run-state.sweep",
|
|
108
|
+
errorClass: detail.errorClass,
|
|
109
|
+
message: "runtime-lifecycle-failed",
|
|
110
|
+
code: "stage=startup:reason=orphaned-run-state-remove-failed",
|
|
111
|
+
...(detail.frames === undefined ? {} : { frames: detail.frames }),
|
|
112
|
+
...(detail.causeChain === undefined ? {} : { causeChain: detail.causeChain }),
|
|
113
|
+
});
|
|
114
|
+
}
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ServerLogSink } from "@oscharko-dev/keiko-activity-log";
|
|
2
|
+
import { type ServerDiagnosticSink } from "../diagnostics-log.js";
|
|
2
3
|
import type { CodingSafeActivitySignal } from "./codingSafeActivityProjection.js";
|
|
3
4
|
import { type OpenCodeNativeContextProfile } from "./opencodeNativeContext.js";
|
|
4
5
|
import { type OpenCodeContextGeometry } from "./opencodeLaunchProfile.js";
|
|
@@ -68,11 +69,20 @@ export interface GeneratedOpenCodeBundle {
|
|
|
68
69
|
};
|
|
69
70
|
readonly toolSources: Readonly<Record<string, string>>;
|
|
70
71
|
}
|
|
72
|
+
export interface OpenCodeReconnectPorts {
|
|
73
|
+
readonly delay?: ((ms: number, signal: AbortSignal) => Promise<void>) | undefined;
|
|
74
|
+
readonly random?: (() => number) | undefined;
|
|
75
|
+
readonly now?: (() => number) | undefined;
|
|
76
|
+
readonly budgetMs?: number | undefined;
|
|
77
|
+
}
|
|
71
78
|
export interface OpenCodeRuntimeAdapterPorts {
|
|
72
79
|
readonly activityLog?: ServerLogSink | undefined;
|
|
73
80
|
readonly correlationId?: string | undefined;
|
|
74
81
|
/** The run's envelope duration (`budget.maxRuntimeMs`); absent keeps the default backstop. */
|
|
75
82
|
readonly maxTurnWaitMs?: number | undefined;
|
|
83
|
+
readonly diagnostics?: ServerDiagnosticSink | undefined;
|
|
84
|
+
/** Test seams for the monitor's reconnect backoff; production uses real timers and `Math.random`. */
|
|
85
|
+
readonly reconnect?: OpenCodeReconnectPorts | undefined;
|
|
76
86
|
readonly contextGeometry?: OpenCodeContextGeometry | undefined;
|
|
77
87
|
readonly readiness: {
|
|
78
88
|
readonly verifiedTarget: {
|
|
@@ -145,6 +155,8 @@ export interface OpenCodeRuntimeAdapter {
|
|
|
145
155
|
readonly waitForTerminal: (signal: AbortSignal) => Promise<OpenCodeTurnOutcome>;
|
|
146
156
|
}
|
|
147
157
|
export declare function createOpenCodeRuntimeAdapter(ports: OpenCodeRuntimeAdapterPorts): OpenCodeRuntimeAdapter;
|
|
158
|
+
/** Equal jitter: half the exponential ceiling, plus a random share of the other half. */
|
|
159
|
+
export declare function reconnectDelayMs(attempt: number, random: () => number): number;
|
|
148
160
|
interface CompactionActivityLogPorts {
|
|
149
161
|
readonly activityLog?: ServerLogSink | undefined;
|
|
150
162
|
readonly correlationId?: string | undefined;
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencodeRuntimeAdapter.d.ts","sourceRoot":"","sources":["../../src/coding-runtime/opencodeRuntimeAdapter.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"opencodeRuntimeAdapter.d.ts","sourceRoot":"","sources":["../../src/coding-runtime/opencodeRuntimeAdapter.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAOxF,OAAO,KAAK,EAAE,wBAAwB,EAAE,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O,CAAC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACjF;AAcD,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,2BAA2B,GACjC,sBAAsB,CA6ZxB;AA4QD,yFAAyF;AACzF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,MAAM,GAAG,MAAM,CAO9E;AA4BD,UAAU,0BAA0B;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,0BAA0B,EACjC,WAAW,EAAE,SAAS,IAAI,CAAC,OAAO,yBAAyB,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,GAC/F,IAAI,CAyBN;AA8PD,wBAAgB,6BAA6B,IAAI,uBAAuB,CAiBvE;AAID,gGAAgG;AAChG,wBAAgB,gCAAgC,CAC9C,OAAO,GAAE,mBAA8B,GACtC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBlC"}
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.js
CHANGED
|
@@ -3,6 +3,7 @@ import { DEFAULT_SANDBOX_POLICY, GOVERNED_TOOL_HUMAN_DECISION_WAIT_MS, GOVERNED_
|
|
|
3
3
|
import { isAbsolute } from "node:path";
|
|
4
4
|
import { correlationIdOrUnknown } from "../correlation.js";
|
|
5
5
|
import { causeChain, keikoStackFrames } from "@oscharko-dev/keiko-activity-log";
|
|
6
|
+
import { emitServerDiagnostic } from "../diagnostics-log.js";
|
|
6
7
|
import { processServerLogSink } from "../process-log-sink.js";
|
|
7
8
|
import { activityLogEvent, defineActivityLogOperation, } from "@oscharko-dev/keiko-contracts/runtime/observability";
|
|
8
9
|
import { CODING_TOOL_MAX_BODY_BYTES } from "./codingToolIpc.js";
|
|
@@ -23,7 +24,13 @@ const MAX_HISTORY_BYTES = 1024 * 1024;
|
|
|
23
24
|
const MAX_AGGREGATE_CHECKPOINTS = 256;
|
|
24
25
|
const MAX_RECENT_IDENTITIES = 2_048;
|
|
25
26
|
const MAX_HISTORY_CATCH_UP_ATTEMPTS = 4;
|
|
26
|
-
|
|
27
|
+
// A live stream that keeps failing is retried with exponential backoff and jitter inside a time
|
|
28
|
+
// budget, not three times back to back: a refused connection or a deterministic history error used
|
|
29
|
+
// to burn the whole budget in milliseconds (audit 2026-10, finding 15). The count is a hard backstop.
|
|
30
|
+
const MAX_STREAM_RECONNECTS = 16;
|
|
31
|
+
const RECONNECT_BASE_DELAY_MS = 250;
|
|
32
|
+
const RECONNECT_MAX_DELAY_MS = 8_000;
|
|
33
|
+
const RECONNECT_BUDGET_MS = 30_000;
|
|
27
34
|
// The generated client must outlive the server-owned 30 s governed tool-bridge deadline.
|
|
28
35
|
const OPEN_CODE_TOOL_CLIENT_TIMEOUT_MS = 35_000;
|
|
29
36
|
const OPEN_CODE_READINESS_PHASES = [
|
|
@@ -232,6 +239,8 @@ export function createOpenCodeRuntimeAdapter(ports) {
|
|
|
232
239
|
let activeAbort;
|
|
233
240
|
let monitorTask;
|
|
234
241
|
let monitoring = false;
|
|
242
|
+
// Aborted when the monitor is disposed, so a reconnect backoff never outlives its monitor.
|
|
243
|
+
let monitorStop = new AbortController();
|
|
235
244
|
let closed = false;
|
|
236
245
|
let turnGeneration = 0;
|
|
237
246
|
let turnArmed = false;
|
|
@@ -280,28 +289,34 @@ export function createOpenCodeRuntimeAdapter(ports) {
|
|
|
280
289
|
}
|
|
281
290
|
if (monitorTask === undefined) {
|
|
282
291
|
monitoring = true;
|
|
292
|
+
monitorStop = new AbortController();
|
|
283
293
|
monitorTask = monitorLoop().finally(() => {
|
|
284
294
|
monitorTask = undefined;
|
|
285
295
|
});
|
|
286
296
|
}
|
|
287
297
|
return () => {
|
|
288
298
|
monitoring = false;
|
|
299
|
+
monitorStop.abort();
|
|
289
300
|
cancelTurn();
|
|
290
301
|
activeAbort?.abort();
|
|
291
302
|
};
|
|
292
303
|
async function monitorLoop() {
|
|
293
304
|
let reconnects = 0;
|
|
305
|
+
let failingSince;
|
|
294
306
|
while (isMonitoring()) {
|
|
295
307
|
try {
|
|
296
308
|
await observeNextHint();
|
|
297
309
|
reconnects = 0;
|
|
310
|
+
failingSince = undefined;
|
|
298
311
|
}
|
|
299
312
|
catch {
|
|
300
313
|
if (!isMonitoring())
|
|
301
314
|
return;
|
|
302
315
|
await cancelSubscription();
|
|
303
316
|
reconnects += 1;
|
|
304
|
-
|
|
317
|
+
const nowMs = (ports.reconnect?.now ?? Date.now)();
|
|
318
|
+
failingSince ??= nowMs;
|
|
319
|
+
if (!(await backOff(ports, monitorStop.signal, reconnects, nowMs - failingSince))) {
|
|
305
320
|
onFailure();
|
|
306
321
|
return;
|
|
307
322
|
}
|
|
@@ -330,6 +345,7 @@ export function createOpenCodeRuntimeAdapter(ports) {
|
|
|
330
345
|
close: async () => {
|
|
331
346
|
closed = true;
|
|
332
347
|
monitoring = false;
|
|
348
|
+
monitorStop.abort();
|
|
333
349
|
cancelTurn();
|
|
334
350
|
await cancelSubscription();
|
|
335
351
|
await monitorTask;
|
|
@@ -786,6 +802,50 @@ async function applyHistoryPlan(ports, state, planned, prepared) {
|
|
|
786
802
|
ports.safeActivitySink?.ingest(signal);
|
|
787
803
|
}
|
|
788
804
|
}
|
|
805
|
+
// Waits before the next reconnect; false when the failure budget is spent (count or time).
|
|
806
|
+
async function backOff(ports, stop, attempt, failingForMs) {
|
|
807
|
+
const delayMs = reconnectDelayMs(attempt, ports.reconnect?.random ?? Math.random);
|
|
808
|
+
const budgetMs = ports.reconnect?.budgetMs ?? RECONNECT_BUDGET_MS;
|
|
809
|
+
const exhausted = attempt > MAX_STREAM_RECONNECTS || failingForMs + delayMs > budgetMs;
|
|
810
|
+
const outcome = exhausted ? "budget-exhausted" : "backoff";
|
|
811
|
+
recordMonitorReconnect(ports, { attempt, outcome, delayMs, failingForMs });
|
|
812
|
+
if (exhausted)
|
|
813
|
+
return false;
|
|
814
|
+
await (ports.reconnect?.delay ?? abortableDelay)(delayMs, stop);
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
function recordMonitorReconnect(ports, facts) {
|
|
818
|
+
emitServerDiagnostic(ports.diagnostics, {
|
|
819
|
+
correlationId: correlationIdOrUnknown(ports.correlationId),
|
|
820
|
+
timestamp: new Date().toISOString(),
|
|
821
|
+
operation: "coding-runtime.monitor",
|
|
822
|
+
source: "opencode.monitor.reconnect",
|
|
823
|
+
errorClass: "OpenCodeMonitorReconnect",
|
|
824
|
+
message: "runtime-lifecycle-failed",
|
|
825
|
+
code: `stage=monitor:reason=${facts.outcome}:attempt=${String(facts.attempt)}:delayMs=${String(facts.delayMs)}:failingForMs=${String(facts.failingForMs)}`,
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
/** Equal jitter: half the exponential ceiling, plus a random share of the other half. */
|
|
829
|
+
export function reconnectDelayMs(attempt, random) {
|
|
830
|
+
const ceiling = Math.min(RECONNECT_MAX_DELAY_MS, RECONNECT_BASE_DELAY_MS * 2 ** Math.max(0, attempt - 1));
|
|
831
|
+
const jitter = Math.min(1, Math.max(0, random()));
|
|
832
|
+
return Math.round(ceiling / 2 + (ceiling / 2) * jitter);
|
|
833
|
+
}
|
|
834
|
+
function abortableDelay(ms, signal) {
|
|
835
|
+
return new Promise((resolve) => {
|
|
836
|
+
if (signal.aborted) {
|
|
837
|
+
resolve();
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
const timer = setTimeout(done, ms);
|
|
841
|
+
function done() {
|
|
842
|
+
clearTimeout(timer);
|
|
843
|
+
signal.removeEventListener("abort", done);
|
|
844
|
+
resolve();
|
|
845
|
+
}
|
|
846
|
+
signal.addEventListener("abort", done, { once: true });
|
|
847
|
+
});
|
|
848
|
+
}
|
|
789
849
|
function recordTurnInterrupted(ports, settledAfterMs) {
|
|
790
850
|
(ports.activityLog ?? processServerLogSink()).write(activityLogEvent(CODING_RUNTIME_TURN_INTERRUPTED_OPERATION, { level: "info", correlationId: correlationIdOrUnknown(ports.correlationId) }, { settledAfterMs }));
|
|
791
851
|
}
|
package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts
CHANGED
|
@@ -49,6 +49,13 @@ export type McpOAuthIssuerPort = (server: string, oauth: McpRemoteOAuth, correla
|
|
|
49
49
|
export interface OpenCodeRuntimeCompositionInput {
|
|
50
50
|
/** Captured server-only observation profile. Absent retains the direct native history contract. */
|
|
51
51
|
readonly toolProfile?: OpenCodeToolProfile | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* False when this launch's pinned ripgrep did not verify (ADR-0163). The run's private OpenCode
|
|
54
|
+
* tool directory then holds a refusing `rg`, so the runtime's own lookup finds it before its
|
|
55
|
+
* GitHub download: search fails visibly instead of fetching an unverified binary at run time.
|
|
56
|
+
* Absent or true leaves that directory untouched.
|
|
57
|
+
*/
|
|
58
|
+
readonly ripgrepVerified?: boolean | undefined;
|
|
52
59
|
/**
|
|
53
60
|
* The host environment the manager may copy the launch's allowlisted names from (#3897). The
|
|
54
61
|
* mapped profiles allowlist nothing, so they keep launching with an empty inheritance; the native
|
|
@@ -342,6 +349,7 @@ export declare function createOpenCodeRuntimeComposition(configured: OpenCodeRun
|
|
|
342
349
|
*/
|
|
343
350
|
export declare function coalescedSyncHints(events: AsyncIterable<Readonly<Record<string, unknown>>>, toHint: (event: Readonly<Record<string, unknown>>) => OpenCodeSyncHint, onMerged?: (mergedEvents: number) => void, minimumIntervalMs?: number): AsyncGenerator<OpenCodeSyncHint>;
|
|
344
351
|
export declare function v2SyncHint(event: Readonly<Record<string, unknown>>, fixedSessionId: string, onQuestionObserved: ((identity: string) => void) | undefined): OpenCodeSyncHint;
|
|
352
|
+
export declare function openCodeRipgrepPlaceholderPath(runRoot: string, platform?: NodeJS.Platform): string;
|
|
345
353
|
/**
|
|
346
354
|
* The deadline the tool bridge admits a request under. A tool the catalog settles beyond the
|
|
347
355
|
* sandbox default (the verification tool at its derived work budget, the four proposal tools at the
|