clinkx 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/LICENSE +10 -0
- package/README.md +82 -26
- package/clinkx-workflows/dist/allowed-roots.d.ts +1 -0
- package/clinkx-workflows/dist/allowed-roots.js +5 -0
- package/clinkx-workflows/dist/allowed-roots.js.map +1 -0
- package/clinkx-workflows/dist/artifacts.d.ts +20 -1
- package/clinkx-workflows/dist/artifacts.js +38 -9
- package/clinkx-workflows/dist/artifacts.js.map +1 -1
- package/clinkx-workflows/dist/backend.d.ts +4 -0
- package/clinkx-workflows/dist/citation-check.d.ts +40 -0
- package/clinkx-workflows/dist/citation-check.js +348 -0
- package/clinkx-workflows/dist/citation-check.js.map +1 -0
- package/clinkx-workflows/dist/clink-client.d.ts +2 -1
- package/clinkx-workflows/dist/clink-client.js +17 -4
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +145 -16
- package/clinkx-workflows/dist/config.js +384 -26
- package/clinkx-workflows/dist/config.js.map +1 -1
- package/clinkx-workflows/dist/contained-file.d.ts +172 -0
- package/clinkx-workflows/dist/contained-file.js +483 -0
- package/clinkx-workflows/dist/contained-file.js.map +1 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.d.ts +416 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.js +328 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-contract.js.map +1 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.d.ts +24 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.js +39 -0
- package/clinkx-workflows/dist/context-builder-lifecycle-router.js.map +1 -0
- package/clinkx-workflows/dist/context-cache-key.d.ts +53 -0
- package/clinkx-workflows/dist/context-cache-key.js +91 -0
- package/clinkx-workflows/dist/context-cache-key.js.map +1 -0
- package/clinkx-workflows/dist/context-mode-resolver.d.ts +27 -0
- package/clinkx-workflows/dist/context-mode-resolver.js +126 -0
- package/clinkx-workflows/dist/context-mode-resolver.js.map +1 -0
- package/clinkx-workflows/dist/context-preflight.d.ts +184 -0
- package/clinkx-workflows/dist/context-preflight.js +91 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +1 -1
- package/clinkx-workflows/dist/council-expander.js +2 -1
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +165 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js +105 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.d.ts +25 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.js +34 -0
- package/clinkx-workflows/dist/dashboard/activity-lease.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.d.ts +86 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js +480 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +36 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +1047 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.d.ts +37 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.js +145 -0
- package/clinkx-workflows/dist/dashboard/artifact-index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.d.ts +31 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js +65 -0
- package/clinkx-workflows/dist/dashboard/auth/challenge-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js +596 -0
- package/clinkx-workflows/dist/dashboard/auth/controller.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.d.ts +60 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.js +776 -0
- package/clinkx-workflows/dist/dashboard/auth/credential-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.d.ts +9 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js +44 -0
- package/clinkx-workflows/dist/dashboard/auth/enrollment-gate.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.d.ts +17 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.js +77 -0
- package/clinkx-workflows/dist/dashboard/auth/session-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.d.ts +25 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js +71 -0
- package/clinkx-workflows/dist/dashboard/auth/webauthn-service.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.d.ts +37 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.js +49 -0
- package/clinkx-workflows/dist/dashboard/context-run-liveness.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.d.ts +222 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +1178 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +8936 -0
- package/clinkx-workflows/dist/dashboard/contracts.js +1157 -0
- package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/generation.d.ts +14 -0
- package/clinkx-workflows/dist/dashboard/generation.js +41 -0
- package/clinkx-workflows/dist/dashboard/generation.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/index.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/index.js +16 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +101 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js +748 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +303 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js +221 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.d.ts +50 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js +581 -0
- package/clinkx-workflows/dist/dashboard/progress-report-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +89 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js +71 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +110 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/read-model.d.ts +86 -0
- package/clinkx-workflows/dist/dashboard/read-model.js +440 -0
- package/clinkx-workflows/dist/dashboard/read-model.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/request-admission.d.ts +31 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js +126 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +75 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +1110 -0
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +50 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js +431 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2611 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +480 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.d.ts +21 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.js +101 -0
- package/clinkx-workflows/dist/dashboard/session-log-identity.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.d.ts +43 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.js +522 -0
- package/clinkx-workflows/dist/dashboard/session-log-journal.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.d.ts +61 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.js +378 -0
- package/clinkx-workflows/dist/dashboard/session-log-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +6 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +367 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.d.ts +23 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.js +212 -0
- package/clinkx-workflows/dist/dashboard/session-log-retention.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/static-responses.d.ts +10 -0
- package/clinkx-workflows/dist/dashboard/static-responses.js +94 -0
- package/clinkx-workflows/dist/dashboard/static-responses.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.d.ts +28 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.js +241 -0
- package/clinkx-workflows/dist/dashboard/worker-lock-observer.js.map +1 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DOkMXTfB.js +25 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-ChJsn0KD.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/contracts/council-plan-review-input-v1.json +158 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +15 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Mono-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/IBM-Plex-Sans-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/JetBrains-Mono-OFL.txt +93 -0
- package/clinkx-workflows/dist/dashboard-ui/licenses/NOTICE.md +32 -0
- package/clinkx-workflows/dist/dashboard-ui/theme-init.js +8 -0
- package/clinkx-workflows/dist/definition-normalizer.d.ts +19 -0
- package/clinkx-workflows/dist/definition-normalizer.js.map +1 -1
- package/clinkx-workflows/dist/delegate-validate.d.ts +78 -0
- package/clinkx-workflows/dist/delegate-validate.js +97 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +141 -0
- package/clinkx-workflows/dist/engine.js +882 -28
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +2 -0
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +1 -1
- package/clinkx-workflows/dist/fingerprint.js +1 -1
- package/clinkx-workflows/dist/index.d.ts +19 -0
- package/clinkx-workflows/dist/index.js +15 -0
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/loader.d.ts +9 -3
- package/clinkx-workflows/dist/loader.js +92 -21
- package/clinkx-workflows/dist/loader.js.map +1 -1
- package/clinkx-workflows/dist/plan-review/admission.d.ts +160 -0
- package/clinkx-workflows/dist/plan-review/admission.js +290 -0
- package/clinkx-workflows/dist/plan-review/admission.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/context-policy.d.ts +55 -0
- package/clinkx-workflows/dist/plan-review/context-policy.js +146 -0
- package/clinkx-workflows/dist/plan-review/context-policy.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/contract.d.ts +763 -0
- package/clinkx-workflows/dist/plan-review/contract.js +289 -0
- package/clinkx-workflows/dist/plan-review/contract.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/digest.d.ts +68 -0
- package/clinkx-workflows/dist/plan-review/digest.js +241 -0
- package/clinkx-workflows/dist/plan-review/digest.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/discovery.d.ts +45 -0
- package/clinkx-workflows/dist/plan-review/discovery.js +36 -0
- package/clinkx-workflows/dist/plan-review/discovery.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.d.ts +298 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.js +194 -0
- package/clinkx-workflows/dist/plan-review/execution-contract.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/expander.d.ts +48 -0
- package/clinkx-workflows/dist/plan-review/expander.js +243 -0
- package/clinkx-workflows/dist/plan-review/expander.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/projector.d.ts +126 -0
- package/clinkx-workflows/dist/plan-review/projector.js +437 -0
- package/clinkx-workflows/dist/plan-review/projector.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/publication.d.ts +95 -0
- package/clinkx-workflows/dist/plan-review/publication.js +182 -0
- package/clinkx-workflows/dist/plan-review/publication.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.d.ts +34 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.js +139 -0
- package/clinkx-workflows/dist/plan-review/ranking-reducer.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/resume.d.ts +38 -0
- package/clinkx-workflows/dist/plan-review/resume.js +122 -0
- package/clinkx-workflows/dist/plan-review/resume.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/rubric.d.ts +7 -0
- package/clinkx-workflows/dist/plan-review/rubric.js +24 -0
- package/clinkx-workflows/dist/plan-review/rubric.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/run-state.d.ts +398 -0
- package/clinkx-workflows/dist/plan-review/run-state.js +183 -0
- package/clinkx-workflows/dist/plan-review/run-state.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.d.ts +74 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.js +186 -0
- package/clinkx-workflows/dist/plan-review/runtime-policy.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/snapshot.d.ts +81 -0
- package/clinkx-workflows/dist/plan-review/snapshot.js +170 -0
- package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/stage-error.d.ts +19 -0
- package/clinkx-workflows/dist/plan-review/stage-error.js +20 -0
- package/clinkx-workflows/dist/plan-review/stage-error.js.map +1 -0
- package/clinkx-workflows/dist/post-processors/index.d.ts +20 -0
- package/clinkx-workflows/dist/post-processors/index.js +21 -0
- package/clinkx-workflows/dist/post-processors/index.js.map +1 -0
- package/clinkx-workflows/dist/prompt-budget.d.ts +7 -0
- package/clinkx-workflows/dist/prompt-budget.js +7 -1
- package/clinkx-workflows/dist/prompt-budget.js.map +1 -1
- package/clinkx-workflows/dist/reducers/index.js +2 -0
- package/clinkx-workflows/dist/reducers/index.js.map +1 -1
- package/clinkx-workflows/dist/run-lock-heartbeat.d.ts +2 -0
- package/clinkx-workflows/dist/run-lock-heartbeat.js +3 -0
- package/clinkx-workflows/dist/run-lock-heartbeat.js.map +1 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.d.ts +34 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js +74 -0
- package/clinkx-workflows/dist/run-summary/cards/council-plan-review.js.map +1 -0
- package/clinkx-workflows/dist/run-summary/cards/index.js +5 -0
- package/clinkx-workflows/dist/run-summary/cards/index.js.map +1 -1
- package/clinkx-workflows/dist/run-summary.d.ts +13 -0
- package/clinkx-workflows/dist/run-summary.js +29 -1
- package/clinkx-workflows/dist/run-summary.js.map +1 -1
- package/clinkx-workflows/dist/schema.d.ts +76 -21
- package/clinkx-workflows/dist/schema.js +10 -1
- package/clinkx-workflows/dist/schema.js.map +1 -1
- package/clinkx-workflows/dist/seed-terms.d.ts +30 -0
- package/clinkx-workflows/dist/seed-terms.js +176 -0
- package/clinkx-workflows/dist/seed-terms.js.map +1 -0
- package/clinkx-workflows/dist/server.d.ts +5 -2
- package/clinkx-workflows/dist/server.js +82 -52
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +18 -20
- package/clinkx-workflows/dist/shutdown.js +43 -61
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +38 -0
- package/clinkx-workflows/dist/state.d.ts +170 -3
- package/clinkx-workflows/dist/state.js +1275 -28
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/transport.d.ts +15 -0
- package/clinkx-workflows/dist/transport.js +19 -10
- package/clinkx-workflows/dist/transport.js.map +1 -1
- package/clinkx-workflows/dist/types.d.ts +14 -2
- package/clinkx-workflows/dist/validators/council.d.ts +318 -85
- package/clinkx-workflows/dist/validators/council.js +52 -13
- package/clinkx-workflows/dist/validators/council.js.map +1 -1
- package/clinkx-workflows/dist/validators/index.d.ts +1 -0
- package/clinkx-workflows/dist/validators/index.js +3 -0
- package/clinkx-workflows/dist/validators/index.js.map +1 -1
- package/clinkx-workflows/dist/validators/plan-review.d.ts +398 -0
- package/clinkx-workflows/dist/validators/plan-review.js +316 -0
- package/clinkx-workflows/dist/validators/plan-review.js.map +1 -0
- package/clinkx-workflows/dist/workflow-receipt.js +188 -4
- package/clinkx-workflows/dist/workflow-receipt.js.map +1 -1
- package/clinkx-workflows/dist/workflow-tools.d.ts +48 -3
- package/clinkx-workflows/dist/workflow-tools.js +1402 -59
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/dist/workspace-signature.d.ts +16 -0
- package/clinkx-workflows/dist/workspace-signature.js +388 -0
- package/clinkx-workflows/dist/workspace-signature.js.map +1 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +2 -1
- package/clinkx-workflows/templates/council/code-review-chairman.txt +13 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +4 -1
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +19 -3
- package/clinkx-workflows/templates/council/debug-debugger.txt +2 -1
- package/clinkx-workflows/templates/council/discover-analyst.txt +2 -1
- package/clinkx-workflows/templates/council/member.txt +2 -1
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +68 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +51 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +60 -0
- package/clinkx-workflows/templates/plan-review/chairman.txt +48 -0
- package/clinkx-workflows/templates/plan-review/cross-review.txt +52 -0
- package/clinkx-workflows/templates/plan-review/ranking.txt +16 -0
- package/clinkx-workflows/templates/plan-review/reviewer.txt +57 -0
- package/clinkx-workflows/workflows/council-answer.yaml +97 -8
- package/clinkx-workflows/workflows/council-code-review.yaml +103 -8
- package/clinkx-workflows/workflows/council-debug.yaml +97 -8
- package/clinkx-workflows/workflows/council-default.yaml +97 -8
- package/clinkx-workflows/workflows/council-discover.yaml +97 -8
- package/clinkx-workflows/workflows/council-plan-review.yaml +250 -0
- package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
- package/conf/adapters/agy.json +49 -0
- package/conf/adapters/claude.json +5 -0
- package/conf/adapters/codex-app-server.json +44 -0
- package/conf/adapters/codex.json +7 -2
- package/conf/adapters/glm.json +5 -0
- package/conf/adapters/grok.json +60 -0
- package/conf/adapters/hapi/agy.json +52 -0
- package/conf/adapters/hapi/claude.json +5 -0
- package/conf/adapters/hapi/codex.json +7 -2
- package/conf/adapters/hapi/glm.json +5 -0
- package/dist/activity-journal.d.ts +42 -0
- package/dist/activity-journal.js +381 -0
- package/dist/activity-journal.js.map +1 -0
- package/dist/allowed-roots.d.ts +41 -0
- package/dist/allowed-roots.js +125 -3
- package/dist/allowed-roots.js.map +1 -1
- package/dist/codex/activity-session-log.d.ts +14 -0
- package/dist/codex/activity-session-log.js +206 -0
- package/dist/codex/activity-session-log.js.map +1 -0
- package/dist/codex/agent-tools.d.ts +23 -0
- package/dist/codex/agent-tools.js +1270 -0
- package/dist/codex/agent-tools.js.map +1 -0
- package/dist/codex/app-server-client.d.ts +76 -0
- package/dist/codex/app-server-client.js +582 -0
- package/dist/codex/app-server-client.js.map +1 -0
- package/dist/codex/app-server-registry.d.ts +389 -0
- package/dist/codex/app-server-registry.js +1407 -0
- package/dist/codex/app-server-registry.js.map +1 -0
- package/dist/codex/client-types.d.ts +109 -0
- package/dist/codex/client-types.js +2 -0
- package/dist/codex/client-types.js.map +1 -0
- package/dist/codex/protocol.d.ts +5375 -0
- package/dist/codex/protocol.js +614 -0
- package/dist/codex/protocol.js.map +1 -0
- package/dist/codex/session.d.ts +263 -0
- package/dist/codex/session.js +466 -0
- package/dist/codex/session.js.map +1 -0
- package/dist/config.d.ts +185 -19
- package/dist/config.js +82 -16
- package/dist/config.js.map +1 -1
- package/dist/context-builder/anchors.d.ts +1 -0
- package/dist/context-builder/anchors.js +3 -0
- package/dist/context-builder/anchors.js.map +1 -1
- package/dist/context-builder/bundle.d.ts +35 -2
- package/dist/context-builder/bundle.js +342 -2417
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/codemap.d.ts +5 -0
- package/dist/context-builder/codemap.js +387 -13
- package/dist/context-builder/codemap.js.map +1 -1
- package/dist/context-builder/config.d.ts +1 -0
- package/dist/context-builder/config.js +12 -0
- package/dist/context-builder/config.js.map +1 -1
- package/dist/context-builder/context-run-catalog.d.ts +17 -0
- package/dist/context-builder/context-run-catalog.js +99 -0
- package/dist/context-builder/context-run-catalog.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +37 -0
- package/dist/context-builder/delegate-packet.js +359 -67
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +10 -1
- package/dist/context-builder/delegate-validation.js +153 -41
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +2 -0
- package/dist/context-builder/delegate.js +1 -0
- package/dist/context-builder/delegate.js.map +1 -1
- package/dist/context-builder/diagnostics.d.ts +11 -2
- package/dist/context-builder/diagnostics.js +39 -6
- package/dist/context-builder/diagnostics.js.map +1 -1
- package/dist/context-builder/discovery.d.ts +29 -1
- package/dist/context-builder/discovery.js +475 -175
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/globs.js +10 -10
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +26 -2
- package/dist/context-builder/handler.js +1158 -2416
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/lifecycle-contract.d.ts +424 -0
- package/dist/context-builder/lifecycle-contract.js +523 -0
- package/dist/context-builder/lifecycle-contract.js.map +1 -0
- package/dist/context-builder/lifecycle-journal.d.ts +62 -0
- package/dist/context-builder/lifecycle-journal.js +88 -0
- package/dist/context-builder/lifecycle-journal.js.map +1 -0
- package/dist/context-builder/lifecycle-observer.d.ts +102 -0
- package/dist/context-builder/lifecycle-observer.js +258 -0
- package/dist/context-builder/lifecycle-observer.js.map +1 -0
- package/dist/context-builder/lifecycle-reconcile.d.ts +32 -0
- package/dist/context-builder/lifecycle-reconcile.js +191 -0
- package/dist/context-builder/lifecycle-reconcile.js.map +1 -0
- package/dist/context-builder/lifecycle-recovery.d.ts +2 -0
- package/dist/context-builder/lifecycle-recovery.js +14 -0
- package/dist/context-builder/lifecycle-recovery.js.map +1 -0
- package/dist/context-builder/path-signals.js +9 -5
- package/dist/context-builder/path-signals.js.map +1 -1
- package/dist/context-builder/progress.d.ts +3 -1
- package/dist/context-builder/progress.js +23 -0
- package/dist/context-builder/progress.js.map +1 -1
- package/dist/context-builder/receipt.d.ts +6 -4
- package/dist/context-builder/receipt.js +12 -1
- package/dist/context-builder/receipt.js.map +1 -1
- package/dist/context-builder/refine-handler.d.ts +14 -0
- package/dist/context-builder/refine-handler.js +790 -0
- package/dist/context-builder/refine-handler.js.map +1 -0
- package/dist/context-builder/review-coverage.d.ts +84 -0
- package/dist/context-builder/review-coverage.js +437 -0
- package/dist/context-builder/review-coverage.js.map +1 -0
- package/dist/context-builder/schema.d.ts +239 -1
- package/dist/context-builder/schema.js +112 -6
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +28 -0
- package/dist/context-builder/secrets.js +1473 -44
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/selection.d.ts +7 -3
- package/dist/context-builder/selection.js +200 -738
- package/dist/context-builder/selection.js.map +1 -1
- package/dist/context-builder/session-log-identity.d.ts +1 -0
- package/dist/context-builder/session-log-identity.js +66 -0
- package/dist/context-builder/session-log-identity.js.map +1 -0
- package/dist/context-builder/slice-range-math.d.ts +16 -0
- package/dist/context-builder/slice-range-math.js +137 -0
- package/dist/context-builder/slice-range-math.js.map +1 -0
- package/dist/context-builder/status.d.ts +22 -1
- package/dist/context-builder/status.js +59 -4
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +35 -2
- package/dist/context-builder/storage.js +271 -14
- package/dist/context-builder/storage.js.map +1 -1
- package/dist/context-builder/token-estimate.d.ts +13 -2
- package/dist/context-builder/token-estimate.js +77 -4
- package/dist/context-builder/token-estimate.js.map +1 -1
- package/dist/context-builder/versions.d.ts +29 -0
- package/dist/context-builder/versions.js +30 -0
- package/dist/context-builder/versions.js.map +1 -0
- package/dist/context-builder/workflow-runner.d.ts +69 -0
- package/dist/context-builder/workflow-runner.js +1051 -0
- package/dist/context-builder/workflow-runner.js.map +1 -0
- package/dist/context-builder/write-watchdog.d.ts +14 -0
- package/dist/context-builder/write-watchdog.js +38 -0
- package/dist/context-builder/write-watchdog.js.map +1 -0
- package/dist/dashboard-adapter-catalog.d.ts +9 -0
- package/dist/dashboard-adapter-catalog.js +46 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -0
- package/dist/dashboard-cli.d.ts +79 -0
- package/dist/dashboard-cli.js +585 -0
- package/dist/dashboard-cli.js.map +1 -0
- package/dist/dashboard-companion/client.d.ts +36 -0
- package/dist/dashboard-companion/client.js +210 -0
- package/dist/dashboard-companion/client.js.map +1 -0
- package/dist/dashboard-companion/config.d.ts +8 -0
- package/dist/dashboard-companion/config.js +52 -0
- package/dist/dashboard-companion/config.js.map +1 -0
- package/dist/dashboard-companion/http-proxy.d.ts +10 -0
- package/dist/dashboard-companion/http-proxy.js +234 -0
- package/dist/dashboard-companion/http-proxy.js.map +1 -0
- package/dist/dashboard-companion/protocol.d.ts +80 -0
- package/dist/dashboard-companion/protocol.js +455 -0
- package/dist/dashboard-companion/protocol.js.map +1 -0
- package/dist/dashboard-companion/standalone-assets.d.ts +12 -0
- package/dist/dashboard-companion/standalone-assets.js +72 -0
- package/dist/dashboard-companion/standalone-assets.js.map +1 -0
- package/dist/dashboard-companion/standalone-entry.d.ts +1 -0
- package/dist/dashboard-companion/standalone-entry.js +17 -0
- package/dist/dashboard-companion/standalone-entry.js.map +1 -0
- package/dist/dashboard-gateway/config.d.ts +9 -0
- package/dist/dashboard-gateway/config.js +44 -0
- package/dist/dashboard-gateway/config.js.map +1 -0
- package/dist/dashboard-gateway/index.d.ts +11 -0
- package/dist/dashboard-gateway/index.js +755 -0
- package/dist/dashboard-gateway/index.js.map +1 -0
- package/dist/dashboard-gateway/main.d.ts +1 -0
- package/dist/dashboard-gateway/main.js +25 -0
- package/dist/dashboard-gateway/main.js.map +1 -0
- package/dist/dashboard-pairing-token.d.ts +1 -0
- package/dist/dashboard-pairing-token.js +5 -0
- package/dist/dashboard-pairing-token.js.map +1 -0
- package/dist/elaris/client.d.ts +73 -0
- package/dist/elaris/client.js +825 -0
- package/dist/elaris/client.js.map +1 -0
- package/dist/elaris/config.d.ts +18 -0
- package/dist/elaris/config.js +75 -0
- package/dist/elaris/config.js.map +1 -0
- package/dist/elaris/errors.d.ts +41 -0
- package/dist/elaris/errors.js +205 -0
- package/dist/elaris/errors.js.map +1 -0
- package/dist/elaris/github-repo.d.ts +18 -0
- package/dist/elaris/github-repo.js +89 -0
- package/dist/elaris/github-repo.js.map +1 -0
- package/dist/elaris/index.d.ts +10 -0
- package/dist/elaris/index.js +11 -0
- package/dist/elaris/index.js.map +1 -0
- package/dist/elaris/redact.d.ts +89 -0
- package/dist/elaris/redact.js +423 -0
- package/dist/elaris/redact.js.map +1 -0
- package/dist/elaris/run-id.d.ts +5 -0
- package/dist/elaris/run-id.js +20 -0
- package/dist/elaris/run-id.js.map +1 -0
- package/dist/elaris/status.d.ts +45 -0
- package/dist/elaris/status.js +122 -0
- package/dist/elaris/status.js.map +1 -0
- package/dist/elaris/tool-schemas.d.ts +314 -0
- package/dist/elaris/tool-schemas.js +208 -0
- package/dist/elaris/tool-schemas.js.map +1 -0
- package/dist/elaris/tools.d.ts +73 -0
- package/dist/elaris/tools.js +1065 -0
- package/dist/elaris/tools.js.map +1 -0
- package/dist/elaris/types.d.ts +1541 -0
- package/dist/elaris/types.js +252 -0
- package/dist/elaris/types.js.map +1 -0
- package/dist/errors.d.ts +16 -0
- package/dist/errors.js +19 -0
- package/dist/errors.js.map +1 -1
- package/dist/handler.d.ts +4 -0
- package/dist/handler.js +10 -1
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/local-clink-backend.d.ts +3 -0
- package/dist/local-clink-backend.js +4 -0
- package/dist/local-clink-backend.js.map +1 -1
- package/dist/package-info.d.ts +2 -0
- package/dist/package-info.js +18 -0
- package/dist/package-info.js.map +1 -0
- package/dist/parsers/codex-jsonl.js +48 -3
- package/dist/parsers/codex-jsonl.js.map +1 -1
- package/dist/parsers/extract.d.ts +10 -1
- package/dist/parsers/extract.js +11 -3
- package/dist/parsers/extract.js.map +1 -1
- package/dist/pipeline.d.ts +4 -0
- package/dist/pipeline.js +129 -8
- package/dist/pipeline.js.map +1 -1
- package/dist/run-dir.d.ts +24 -0
- package/dist/run-dir.js +201 -2
- package/dist/run-dir.js.map +1 -1
- package/dist/runner.d.ts +13 -0
- package/dist/runner.js +184 -15
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +4 -4
- package/dist/safety.js +4 -4
- package/dist/schema.d.ts +7 -7
- package/dist/server.d.ts +1 -0
- package/dist/server.js +359 -17
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +18 -0
- package/dist/session-log-stream.js +319 -0
- package/dist/session-log-stream.js.map +1 -0
- package/package.json +46 -5
- package/conf/adapters/gemini.json +0 -44
- package/conf/adapters/hapi/gemini.json +0 -47
- package/dist/parsers/gemini-json.d.ts +0 -2
- package/dist/parsers/gemini-json.js +0 -72
- package/dist/parsers/gemini-json.js.map +0 -1
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import type { ActivityObservation } from "../activity-journal.js";
|
|
2
|
+
import { type ApprovalPolicy, type JsonValue, type ModelListParams, type ModelListResult, type RequestId, type SandboxMode, type SandboxPolicy, type SupportedCommandExecutionApprovalDecision } from "./protocol.js";
|
|
3
|
+
import type { CodexAppServerClient } from "./client-types.js";
|
|
4
|
+
import { type ApprovalType, type EventLogPage, type SessionSnapshot, type SessionStatus } from "./session.js";
|
|
5
|
+
export interface Clock {
|
|
6
|
+
now(): number;
|
|
7
|
+
}
|
|
8
|
+
export type TimerHandle = unknown;
|
|
9
|
+
export interface RegistryConfig {
|
|
10
|
+
maxActiveTurns: number;
|
|
11
|
+
maxRetainedSessions: number;
|
|
12
|
+
sessionTtlMs: number;
|
|
13
|
+
eventBuffer: number;
|
|
14
|
+
turnTimeoutMs: number;
|
|
15
|
+
approvalTimeoutMs: number;
|
|
16
|
+
maxAgentDepth: number;
|
|
17
|
+
/** Depth this ClinkX process is itself running at (from CLINKX_AGENT_DEPTH). */
|
|
18
|
+
currentDepth: number;
|
|
19
|
+
maxResponseChars: number;
|
|
20
|
+
maxEventTextChars: number;
|
|
21
|
+
/** Bounded budget for the interrupt/decline RPC round-trip before escalation. */
|
|
22
|
+
interruptBudgetMs: number;
|
|
23
|
+
/** Bounded budget to await a terminal turn/completed before escalation. */
|
|
24
|
+
terminalWaitBudgetMs: number;
|
|
25
|
+
/** Bounded budget for the pre-turn startup RPC sequence in startSession. */
|
|
26
|
+
startBudgetMs: number;
|
|
27
|
+
}
|
|
28
|
+
type SessionObservationSemantic = {
|
|
29
|
+
readonly kind: "user";
|
|
30
|
+
readonly content: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly kind: "assistant";
|
|
33
|
+
readonly itemId: string;
|
|
34
|
+
readonly content: string;
|
|
35
|
+
readonly phase: string | null;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: "tool_call";
|
|
38
|
+
readonly toolName: string;
|
|
39
|
+
readonly callId: string;
|
|
40
|
+
readonly summary: string;
|
|
41
|
+
} | {
|
|
42
|
+
readonly kind: "tool_result";
|
|
43
|
+
readonly toolName: string;
|
|
44
|
+
readonly callId: string;
|
|
45
|
+
readonly outcome: "succeeded" | "failed" | "cancelled";
|
|
46
|
+
readonly summary: string;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: "approval_request";
|
|
49
|
+
readonly approvalId: RequestId;
|
|
50
|
+
readonly approvalType: ApprovalType;
|
|
51
|
+
readonly action: string;
|
|
52
|
+
} | {
|
|
53
|
+
readonly kind: "approval_resolution";
|
|
54
|
+
readonly approvalId: RequestId;
|
|
55
|
+
readonly decision: SupportedCommandExecutionApprovalDecision;
|
|
56
|
+
} | {
|
|
57
|
+
readonly kind: "error";
|
|
58
|
+
readonly code: "app_server_session_failed";
|
|
59
|
+
readonly message: string;
|
|
60
|
+
readonly retryable: false;
|
|
61
|
+
} | {
|
|
62
|
+
readonly kind: "lifecycle";
|
|
63
|
+
readonly status: SessionStatus;
|
|
64
|
+
readonly failureReason: string | null;
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: "usage";
|
|
67
|
+
readonly inputTokens: number | null;
|
|
68
|
+
readonly cachedInputTokens: number | null;
|
|
69
|
+
readonly outputTokens: number | null;
|
|
70
|
+
readonly reasoningTokens: number | null;
|
|
71
|
+
readonly incomplete: boolean;
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: "reasoning";
|
|
74
|
+
readonly itemId: string;
|
|
75
|
+
readonly summary: string;
|
|
76
|
+
readonly content: string | null;
|
|
77
|
+
};
|
|
78
|
+
export type SessionObservation = SessionObservationSemantic & {
|
|
79
|
+
/** Synchronous per-session ordering authority. */
|
|
80
|
+
readonly sequence: number;
|
|
81
|
+
readonly sessionId: string;
|
|
82
|
+
readonly threadId: string;
|
|
83
|
+
readonly turnId: string | null;
|
|
84
|
+
/** Informational only; never use as the ordering authority. */
|
|
85
|
+
readonly atMs: number;
|
|
86
|
+
};
|
|
87
|
+
export interface SessionTurnBinding {
|
|
88
|
+
readonly sessionId: string;
|
|
89
|
+
readonly threadId: string;
|
|
90
|
+
readonly turnId: string;
|
|
91
|
+
}
|
|
92
|
+
/** Optional, fail-open observer at the reduced app-server session seam. */
|
|
93
|
+
export type SessionObserver = ((observation: SessionObservation) => void | Promise<void>) & {
|
|
94
|
+
/** Optional ordered binding for observations provisionally emitted by turn/start. */
|
|
95
|
+
bindTurn?: (binding: SessionTurnBinding) => void | Promise<void>;
|
|
96
|
+
};
|
|
97
|
+
export interface RegistryDeps {
|
|
98
|
+
client: CodexAppServerClient;
|
|
99
|
+
observer?: SessionObserver | undefined;
|
|
100
|
+
clock?: Clock;
|
|
101
|
+
setTimer?: (cb: () => void, ms: number) => TimerHandle;
|
|
102
|
+
clearTimer?: (handle: TimerHandle) => void;
|
|
103
|
+
config?: Partial<RegistryConfig>;
|
|
104
|
+
}
|
|
105
|
+
export interface StartSessionOptions {
|
|
106
|
+
/** Caller-supplied id (Phase 4 generates these; injected here for determinism). */
|
|
107
|
+
sessionId: string;
|
|
108
|
+
/** turn/start input array (already assembled by the caller). */
|
|
109
|
+
input: unknown[];
|
|
110
|
+
sandbox: SandboxMode;
|
|
111
|
+
/** Human-facing approval label stored on the record. */
|
|
112
|
+
approval: string;
|
|
113
|
+
cwd?: string | undefined;
|
|
114
|
+
model?: string | undefined;
|
|
115
|
+
/** Mapped approval policy sent to thread/start + turn/start (1-4 owns mapping). */
|
|
116
|
+
approvalPolicy?: ApprovalPolicy | undefined;
|
|
117
|
+
/** Tagged-object sandbox policy for turn/start (1-4 owns mapping). */
|
|
118
|
+
sandboxPolicy?: SandboxPolicy | undefined;
|
|
119
|
+
outputSchema?: JsonValue | undefined;
|
|
120
|
+
/** When set, thread/resume {threadId} instead of thread/start (async reuse). */
|
|
121
|
+
resumeThreadId?: string | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Explicit per-call wall-clock turn timeout (ms). Overrides the global
|
|
124
|
+
* `CLINKX_TURN_TIMEOUT_SECONDS` default for THIS session so an adapter's
|
|
125
|
+
* `timeout_seconds` reaches the per-session turn timer (review fix B). A
|
|
126
|
+
* value of 0 disables the turn timeout for this session (same semantics as
|
|
127
|
+
* the global). Omit to inherit the global default/backstop.
|
|
128
|
+
*/
|
|
129
|
+
turnTimeoutMs?: number | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Optional fail-open dashboard observation. The registry owns it once
|
|
132
|
+
* supplied so detached turns still reach a truthful terminal state.
|
|
133
|
+
*/
|
|
134
|
+
activityObservation?: ActivityObservation | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* Optional observer owned by this session. When present it takes precedence
|
|
137
|
+
* over the registry-wide compatibility seam.
|
|
138
|
+
*/
|
|
139
|
+
sessionObserver?: SessionObserver | undefined;
|
|
140
|
+
}
|
|
141
|
+
export interface WaitOptions {
|
|
142
|
+
/** Wall-clock cap for the WAIT itself; the turn keeps running on timeout. */
|
|
143
|
+
timeoutMs?: number | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Abort the WAIT (not the turn): on abort, {@link AppServerRegistry.waitForTurn}
|
|
146
|
+
* resolves promptly with the current snapshot and clears its local race timer
|
|
147
|
+
* and terminal/attention subscriptions. The underlying turn keeps running and
|
|
148
|
+
* retains its lease — cancelling a wait never interrupts the turn.
|
|
149
|
+
*/
|
|
150
|
+
signal?: AbortSignal | undefined;
|
|
151
|
+
}
|
|
152
|
+
export interface CleanupOptions {
|
|
153
|
+
/** Interrupt a running turn before eviction. Default cleanup is non-destructive. */
|
|
154
|
+
force?: boolean | undefined;
|
|
155
|
+
}
|
|
156
|
+
export interface CleanupResult {
|
|
157
|
+
sessionId: string;
|
|
158
|
+
cleanedUp: boolean;
|
|
159
|
+
skippedActive: boolean;
|
|
160
|
+
}
|
|
161
|
+
export interface AppServerRegistryHealth {
|
|
162
|
+
readonly activeLeases: number;
|
|
163
|
+
readonly retainedSessionCount: number;
|
|
164
|
+
readonly appServerProtocol: {
|
|
165
|
+
readonly acceptedVersion: string | null;
|
|
166
|
+
readonly minVersion: string;
|
|
167
|
+
readonly maxVersion: string;
|
|
168
|
+
readonly strictVersion: boolean;
|
|
169
|
+
};
|
|
170
|
+
readonly childRespawnCount: number;
|
|
171
|
+
readonly recentFailures: {
|
|
172
|
+
readonly count: number;
|
|
173
|
+
readonly samples: readonly string[];
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export declare function resolveRegistryConfig(override?: Partial<RegistryConfig>): RegistryConfig;
|
|
177
|
+
/**
|
|
178
|
+
* Registry & lifecycle for long-lived Codex app-server sessions.
|
|
179
|
+
*
|
|
180
|
+
* CORE responsibilities (Phase 2): the active-turn lease (the SOLE concurrency
|
|
181
|
+
* gate — the request {@link Semaphore} is never acquired here), session record
|
|
182
|
+
* accounting, the bounded event ring, retained-cap + TTL reaping, turn and
|
|
183
|
+
* pending-approval timeouts with the shared interrupt → terminal-wait →
|
|
184
|
+
* process-group-kill + respawn escalation path, crash semantics, the recursion
|
|
185
|
+
* depth guard, and a standalone {@link shutdown}.
|
|
186
|
+
*
|
|
187
|
+
* Respawn ownership belongs to the client: the registry only calls
|
|
188
|
+
* {@link CodexAppServerClient.ensureReady} and the client's guarded
|
|
189
|
+
* {@link CodexAppServerClient.killProcessGroup}.
|
|
190
|
+
*/
|
|
191
|
+
export declare class AppServerRegistry {
|
|
192
|
+
private readonly client;
|
|
193
|
+
private readonly observer;
|
|
194
|
+
private readonly clock;
|
|
195
|
+
private readonly setTimer;
|
|
196
|
+
private readonly clearTimer;
|
|
197
|
+
readonly config: RegistryConfig;
|
|
198
|
+
private readonly lease;
|
|
199
|
+
private readonly sessions;
|
|
200
|
+
/**
|
|
201
|
+
* Thread ids with an in-flight resume reservation. Held synchronously across
|
|
202
|
+
* startSession's awaited RPCs so two concurrent resumes of the same thread
|
|
203
|
+
* cannot both pass the in-flight check before either becomes visible as a
|
|
204
|
+
* running session (review fix A — closes the deferred-insertion race).
|
|
205
|
+
*/
|
|
206
|
+
private readonly reservedResumeThreads;
|
|
207
|
+
private readonly unsubscribeProcessDied;
|
|
208
|
+
constructor(deps: RegistryDeps);
|
|
209
|
+
private now;
|
|
210
|
+
get activeLeases(): number;
|
|
211
|
+
get sessionCount(): number;
|
|
212
|
+
health(): AppServerRegistryHealth;
|
|
213
|
+
/**
|
|
214
|
+
* Env marker to ADD to the spawned app-server child so the recursion guard
|
|
215
|
+
* survives the env sanitizer (2-6). The client owns actual env injection
|
|
216
|
+
* into the AppServerSpawnConfig; the registry only supplies the marker.
|
|
217
|
+
*/
|
|
218
|
+
childEnvMarker(): Record<string, string>;
|
|
219
|
+
private require;
|
|
220
|
+
/**
|
|
221
|
+
* Start a new (or resumed) session and its first turn. Returns once the turn
|
|
222
|
+
* is RUNNING (lease held); the turn proceeds asynchronously and the lease is
|
|
223
|
+
* released only on provable terminality — held even if the MCP call detaches
|
|
224
|
+
* (2-3). Use {@link waitForTurn} to await completion without consuming a lease.
|
|
225
|
+
*/
|
|
226
|
+
startSession(opts: StartSessionOptions): Promise<SessionSnapshot>;
|
|
227
|
+
private buildThreadStartParams;
|
|
228
|
+
private buildTurnStartParams;
|
|
229
|
+
/** Snapshot without consuming an active-turn lease (2-4). */
|
|
230
|
+
poll(sessionId: string): SessionSnapshot;
|
|
231
|
+
list(filter?: {
|
|
232
|
+
status?: SessionStatus;
|
|
233
|
+
}): SessionSnapshot[];
|
|
234
|
+
/** Bounded event-log read with a monotonic cursor; never consumes a lease (2-4,2-5). */
|
|
235
|
+
getLog(sessionId: string, cursor?: number, limit?: number): EventLogPage;
|
|
236
|
+
/**
|
|
237
|
+
* Discovery passthrough for `model/list`. Spawns/initializes the app-server
|
|
238
|
+
* child if needed (via the client) but never starts a session or consumes a
|
|
239
|
+
* lease. Bounded by the start budget like other pre-turn RPCs.
|
|
240
|
+
*/
|
|
241
|
+
listModels(params?: ModelListParams): Promise<ModelListResult>;
|
|
242
|
+
/**
|
|
243
|
+
* Await the active turn's terminality WITHOUT consuming a lease. An optional
|
|
244
|
+
* `timeoutMs` bounds the wait only — the underlying turn keeps running and
|
|
245
|
+
* retains its lease on wait-timeout.
|
|
246
|
+
*/
|
|
247
|
+
waitForTurn(sessionId: string, opts?: WaitOptions): Promise<SessionSnapshot>;
|
|
248
|
+
/** Reply to a pending approval. The turn continues; the lease is NOT released. */
|
|
249
|
+
respondApproval(sessionId: string, approvalId: RequestId, decision: SupportedCommandExecutionApprovalDecision): Promise<SessionSnapshot>;
|
|
250
|
+
/**
|
|
251
|
+
* Steer the currently active turn. This never starts a new turn and never
|
|
252
|
+
* acquires a new lease; it targets the active turn id captured in the record.
|
|
253
|
+
*/
|
|
254
|
+
steer(sessionId: string, input: unknown[]): Promise<SessionSnapshot>;
|
|
255
|
+
/** Explicit cancel → interrupted snapshot (decision 4). */
|
|
256
|
+
interrupt(sessionId: string): Promise<SessionSnapshot>;
|
|
257
|
+
/** Remove a session. Running sessions are skipped unless force:true is supplied. */
|
|
258
|
+
cleanup(sessionId: string, opts?: CleanupOptions): Promise<CleanupResult>;
|
|
259
|
+
/**
|
|
260
|
+
* Standalone shutdown: interrupt every active turn, then kill the app-server
|
|
261
|
+
* child by process group via the client's guarded kill.
|
|
262
|
+
*/
|
|
263
|
+
shutdown(reason?: string): Promise<void>;
|
|
264
|
+
/** TTL + retained-cap reaping of idle sessions (2-4). Running sessions are never reaped. */
|
|
265
|
+
reapIdle(): void;
|
|
266
|
+
private handleEvent;
|
|
267
|
+
/**
|
|
268
|
+
* Finalize a turn on PROVABLE terminality. Idempotent. Clears timers,
|
|
269
|
+
* unsubscribes, releases the lease, and resolves the terminal deferred.
|
|
270
|
+
*/
|
|
271
|
+
private finalizeTurn;
|
|
272
|
+
private runSessionObservation;
|
|
273
|
+
private bindSessionObserverTurn;
|
|
274
|
+
private observeUserInput;
|
|
275
|
+
private observeApprovalRequest;
|
|
276
|
+
private observeApprovalResolution;
|
|
277
|
+
private observeError;
|
|
278
|
+
private observeLifecycle;
|
|
279
|
+
private observeRunning;
|
|
280
|
+
private observeTerminal;
|
|
281
|
+
private runActivityObservation;
|
|
282
|
+
/**
|
|
283
|
+
* Shared terminality/escalation path (2-8 / 2-9):
|
|
284
|
+
* 1. bounded interrupt RPC
|
|
285
|
+
* 2. bounded wait for terminal turn/completed
|
|
286
|
+
* 3. on hang/no-terminal → process-group kill + respawn + mark terminal
|
|
287
|
+
*
|
|
288
|
+
* The lease is released only via {@link finalizeTurn}, i.e. only once the
|
|
289
|
+
* turn is provably terminal.
|
|
290
|
+
*/
|
|
291
|
+
private terminateTurn;
|
|
292
|
+
private forceKill;
|
|
293
|
+
/**
|
|
294
|
+
* Finalize every co-active running session after the SHARED child was killed.
|
|
295
|
+
* The client suppresses onProcessDied for intentional kills, so without this
|
|
296
|
+
* their leases leak (review fix). finalizeTurn is idempotent; `except` is the
|
|
297
|
+
* triggering runtime, handled by the caller.
|
|
298
|
+
*/
|
|
299
|
+
private finalizeCoActiveAfterSharedKill;
|
|
300
|
+
private onTurnTimeout;
|
|
301
|
+
private onApprovalTimeout;
|
|
302
|
+
/**
|
|
303
|
+
* Auto-decline a permissions (sandbox-escalation) approval the moment it
|
|
304
|
+
* arrives, with a protocol-valid empty grant. Never surfaced to the user
|
|
305
|
+
* (read-only / approval:never posture). Bounded: the decline RPC is capped by
|
|
306
|
+
* `interruptBudgetMs`.
|
|
307
|
+
*
|
|
308
|
+
* On decline failure/timeout we do NOT merely log: Codex's child is blocked on
|
|
309
|
+
* a response that never lands, and if the operator disabled the wall-clock
|
|
310
|
+
* turn timeout (`CLINKX_TURN_TIMEOUT_SECONDS=0`) there is no backstop until
|
|
311
|
+
* idle reap. So we escalate the turn directly under a bounded budget,
|
|
312
|
+
* independent of the global turn timeout, mirroring the command/file
|
|
313
|
+
* decline-failure recovery in {@link onApprovalTimeout}. terminateTurn is
|
|
314
|
+
* idempotent and no-ops if the turn already finalized, so this never
|
|
315
|
+
* double-finalizes.
|
|
316
|
+
*/
|
|
317
|
+
private autoDeclinePermissionsApproval;
|
|
318
|
+
private handleProcessDied;
|
|
319
|
+
private scheduleTurnTimeout;
|
|
320
|
+
private scheduleApprovalTimeout;
|
|
321
|
+
private clearApprovalTimer;
|
|
322
|
+
private clearTimers;
|
|
323
|
+
private evict;
|
|
324
|
+
/** Reject if `promise` does not settle within `ms`. */
|
|
325
|
+
private withBudget;
|
|
326
|
+
/** Resolve `true` if the terminal deferred settles within `ms`, else `false`. */
|
|
327
|
+
private waitTerminalWithin;
|
|
328
|
+
private notifyAttention;
|
|
329
|
+
/**
|
|
330
|
+
* Await terminality, a wait-local timeout, or newly requested human attention.
|
|
331
|
+
* All outcomes are lease-free: a pending approval returns a running snapshot.
|
|
332
|
+
*/
|
|
333
|
+
private raceTurnWait;
|
|
334
|
+
}
|
|
335
|
+
export type AppServerRegistryFactory = (deps: RegistryDeps) => AppServerRegistry;
|
|
336
|
+
export interface AppServerRegistryTestOverrides {
|
|
337
|
+
client?: CodexAppServerClient;
|
|
338
|
+
registryFactory?: AppServerRegistryFactory;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* The spawn command/args an app-server adapter wants for the process-wide
|
|
342
|
+
* registry. `command` falls back to the default `codex` binary; `args` defaults
|
|
343
|
+
* to `["app-server"]` (the schema default). The registry is a process-wide
|
|
344
|
+
* singleton multiplexing all sessions, so the first creator's spawn config wins
|
|
345
|
+
* and any later conflicting request is rejected (see {@link getAppServerRegistry}).
|
|
346
|
+
*/
|
|
347
|
+
export interface AppServerRegistrySpawnRequest {
|
|
348
|
+
command?: string | undefined;
|
|
349
|
+
args?: string[] | undefined;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Derive the registry spawn request from a resolved app_server adapter:
|
|
353
|
+
* `app_server.command` (falling back to the adapter's top-level `command`) and
|
|
354
|
+
* `app_server.args`.
|
|
355
|
+
*/
|
|
356
|
+
export declare function spawnRequestFor(adapter: {
|
|
357
|
+
command: string;
|
|
358
|
+
app_server?: {
|
|
359
|
+
command?: string | undefined;
|
|
360
|
+
args?: string[] | undefined;
|
|
361
|
+
} | undefined;
|
|
362
|
+
}): AppServerRegistrySpawnRequest;
|
|
363
|
+
/**
|
|
364
|
+
* Get the process-wide app-server registry, creating it on first call.
|
|
365
|
+
*
|
|
366
|
+
* The registry is a singleton: one long-lived `codex app-server` process
|
|
367
|
+
* multiplexes every session. The adapter's `app_server.command/args` therefore
|
|
368
|
+
* take effect only at FIRST creation. A later adapter requesting a spawn config
|
|
369
|
+
* that conflicts with the live one is rejected with {@link InvalidParamsError}
|
|
370
|
+
* (-32602) rather than silently ignored — building a registry-per-config map
|
|
371
|
+
* would be over-engineering for a singleton-by-design subsystem.
|
|
372
|
+
*/
|
|
373
|
+
export declare function getAppServerRegistry(spawn?: AppServerRegistrySpawnRequest): AppServerRegistry;
|
|
374
|
+
/**
|
|
375
|
+
* Return the live process-wide registry WITHOUT creating it. Read-only manage
|
|
376
|
+
* ops (clink_agent_manage) must not lock in a default spawn config before a run
|
|
377
|
+
* has chosen one — otherwise a later run with a custom app_server.command would
|
|
378
|
+
* spuriously hit the spawn-config conflict (-32602). See {@link getAppServerRegistry}.
|
|
379
|
+
*/
|
|
380
|
+
export declare function peekAppServerRegistry(): AppServerRegistry | undefined;
|
|
381
|
+
export declare function shutdownAppServerRegistry(reason: string): Promise<void>;
|
|
382
|
+
/** The spawn command/args the live singleton was created with (test inspection). */
|
|
383
|
+
export declare function appServerRegistrySpawnForTest(): {
|
|
384
|
+
command: string;
|
|
385
|
+
args: string[];
|
|
386
|
+
} | undefined;
|
|
387
|
+
export declare function configureAppServerRegistryForTest(overrides: AppServerRegistryTestOverrides): void;
|
|
388
|
+
export declare function resetAppServerRegistryForTest(reason?: string): Promise<void>;
|
|
389
|
+
export {};
|