clinkx 0.2.3 → 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 +113 -18
- 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/conf/prompts/json-codereviewer.txt +1 -0
- package/conf/prompts/json.txt +1 -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 +53 -0
- package/dist/allowed-roots.js +216 -0
- package/dist/allowed-roots.js.map +1 -0
- 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 +12 -0
- package/dist/context-builder/anchors.js +22 -0
- package/dist/context-builder/anchors.js.map +1 -0
- package/dist/context-builder/bundle.d.ts +109 -0
- package/dist/context-builder/bundle.js +1498 -0
- package/dist/context-builder/bundle.js.map +1 -0
- package/dist/context-builder/codemap.d.ts +22 -0
- package/dist/context-builder/codemap.js +675 -0
- package/dist/context-builder/codemap.js.map +1 -0
- package/dist/context-builder/config.d.ts +61 -0
- package/dist/context-builder/config.js +216 -0
- package/dist/context-builder/config.js.map +1 -0
- 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 +219 -0
- package/dist/context-builder/delegate-packet.js +1190 -0
- package/dist/context-builder/delegate-packet.js.map +1 -0
- package/dist/context-builder/delegate-reconstruction.d.ts +13 -0
- package/dist/context-builder/delegate-reconstruction.js +220 -0
- package/dist/context-builder/delegate-reconstruction.js.map +1 -0
- package/dist/context-builder/delegate-validation.d.ts +27 -0
- package/dist/context-builder/delegate-validation.js +479 -0
- package/dist/context-builder/delegate-validation.js.map +1 -0
- package/dist/context-builder/delegate.d.ts +26 -0
- package/dist/context-builder/delegate.js +134 -0
- package/dist/context-builder/delegate.js.map +1 -0
- package/dist/context-builder/diagnostics.d.ts +36 -0
- package/dist/context-builder/diagnostics.js +107 -0
- package/dist/context-builder/diagnostics.js.map +1 -0
- package/dist/context-builder/discovery.d.ts +146 -0
- package/dist/context-builder/discovery.js +2129 -0
- package/dist/context-builder/discovery.js.map +1 -0
- package/dist/context-builder/globs.d.ts +14 -0
- package/dist/context-builder/globs.js +175 -0
- package/dist/context-builder/globs.js.map +1 -0
- package/dist/context-builder/handler.d.ts +41 -0
- package/dist/context-builder/handler.js +2590 -0
- package/dist/context-builder/handler.js.map +1 -0
- 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.d.ts +7 -0
- package/dist/context-builder/path-signals.js +70 -0
- package/dist/context-builder/path-signals.js.map +1 -0
- package/dist/context-builder/paths.d.ts +30 -0
- package/dist/context-builder/paths.js +153 -0
- package/dist/context-builder/paths.js.map +1 -0
- package/dist/context-builder/progress.d.ts +17 -0
- package/dist/context-builder/progress.js +93 -0
- package/dist/context-builder/progress.js.map +1 -0
- package/dist/context-builder/receipt.d.ts +91 -0
- package/dist/context-builder/receipt.js +180 -0
- package/dist/context-builder/receipt.js.map +1 -0
- 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/run-id.d.ts +7 -0
- package/dist/context-builder/run-id.js +31 -0
- package/dist/context-builder/run-id.js.map +1 -0
- package/dist/context-builder/schema.d.ts +669 -0
- package/dist/context-builder/schema.js +399 -0
- package/dist/context-builder/schema.js.map +1 -0
- package/dist/context-builder/secrets.d.ts +41 -0
- package/dist/context-builder/secrets.js +1651 -0
- package/dist/context-builder/secrets.js.map +1 -0
- package/dist/context-builder/selection.d.ts +56 -0
- package/dist/context-builder/selection.js +1111 -0
- package/dist/context-builder/selection.js.map +1 -0
- 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 +66 -0
- package/dist/context-builder/status.js +160 -0
- package/dist/context-builder/status.js.map +1 -0
- package/dist/context-builder/storage.d.ts +118 -0
- package/dist/context-builder/storage.js +1003 -0
- package/dist/context-builder/storage.js.map +1 -0
- package/dist/context-builder/token-estimate.d.ts +19 -0
- package/dist/context-builder/token-estimate.js +90 -0
- package/dist/context-builder/token-estimate.js.map +1 -0
- 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/paths.d.ts +8 -0
- package/dist/paths.js +31 -43
- package/dist/paths.js.map +1 -1
- package/dist/pipeline.d.ts +51 -3
- package/dist/pipeline.js +264 -47
- 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 +2 -0
- package/dist/server.js +396 -24
- 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 +47 -5
- package/conf/adapters/gemini.json +0 -44
- package/conf/adapters/hapi/gemini.json +0 -47
- package/dist/artifacts.d.ts +0 -9
- package/dist/artifacts.js +0 -24
- package/dist/artifacts.js.map +0 -1
- 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,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure last-writer overlay for dashboard-only progress-report status pins.
|
|
3
|
+
*
|
|
4
|
+
* The producer document is never consulted here. A pin dies when published
|
|
5
|
+
* `updatedAt` is strictly newer than `setAt`, or when `startedAt` does not
|
|
6
|
+
* bind, or when the pin would not change the published status.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export declare const PROGRESS_REPORT_STATUSES: readonly ["running", "paused", "blocked", "done", "failed"];
|
|
10
|
+
export type ProgressReportStatus = (typeof PROGRESS_REPORT_STATUSES)[number];
|
|
11
|
+
export declare const ProgressReportStatusSchema: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
|
|
12
|
+
export declare const PROGRESS_REPORT_STATUS_OVERRIDE_SCHEMA_VERSION: "progress-report-status-overrides-v1";
|
|
13
|
+
export declare const PROGRESS_REPORT_STATUS_OVERRIDE_FILENAME = "progress-report-status-overrides.json";
|
|
14
|
+
export declare const PROGRESS_REPORT_STATUS_OVERRIDE_SEGMENT = "status-override";
|
|
15
|
+
export declare const ProgressReportStatusOverrideEntrySchema: z.ZodObject<{
|
|
16
|
+
startedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
17
|
+
status: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
|
|
18
|
+
setAt: z.ZodEffects<z.ZodString, string, string>;
|
|
19
|
+
}, "strict", z.ZodTypeAny, {
|
|
20
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
21
|
+
startedAt: string;
|
|
22
|
+
setAt: string;
|
|
23
|
+
}, {
|
|
24
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
25
|
+
startedAt: string;
|
|
26
|
+
setAt: string;
|
|
27
|
+
}>;
|
|
28
|
+
export type ProgressReportStatusOverrideEntry = z.infer<typeof ProgressReportStatusOverrideEntrySchema>;
|
|
29
|
+
export declare const ProgressReportStatusOverrideDocumentSchema: z.ZodObject<{
|
|
30
|
+
schemaVersion: z.ZodLiteral<"progress-report-status-overrides-v1">;
|
|
31
|
+
entries: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
32
|
+
startedAt: z.ZodEffects<z.ZodString, string, string>;
|
|
33
|
+
status: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
|
|
34
|
+
setAt: z.ZodEffects<z.ZodString, string, string>;
|
|
35
|
+
}, "strict", z.ZodTypeAny, {
|
|
36
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
37
|
+
startedAt: string;
|
|
38
|
+
setAt: string;
|
|
39
|
+
}, {
|
|
40
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
41
|
+
startedAt: string;
|
|
42
|
+
setAt: string;
|
|
43
|
+
}>>;
|
|
44
|
+
}, "strict", z.ZodTypeAny, {
|
|
45
|
+
entries: Record<string, {
|
|
46
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
47
|
+
startedAt: string;
|
|
48
|
+
setAt: string;
|
|
49
|
+
}>;
|
|
50
|
+
schemaVersion: "progress-report-status-overrides-v1";
|
|
51
|
+
}, {
|
|
52
|
+
entries: Record<string, {
|
|
53
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
54
|
+
startedAt: string;
|
|
55
|
+
setAt: string;
|
|
56
|
+
}>;
|
|
57
|
+
schemaVersion: "progress-report-status-overrides-v1";
|
|
58
|
+
}>;
|
|
59
|
+
export type ProgressReportStatusOverrideDocument = z.infer<typeof ProgressReportStatusOverrideDocumentSchema>;
|
|
60
|
+
export declare const ProgressReportStatusOverrideRequestSchema: z.ZodDiscriminatedUnion<"action", [z.ZodObject<{
|
|
61
|
+
action: z.ZodLiteral<"set">;
|
|
62
|
+
status: z.ZodEnum<["running", "paused", "blocked", "done", "failed"]>;
|
|
63
|
+
}, "strict", z.ZodTypeAny, {
|
|
64
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
65
|
+
action: "set";
|
|
66
|
+
}, {
|
|
67
|
+
status: "running" | "failed" | "paused" | "blocked" | "done";
|
|
68
|
+
action: "set";
|
|
69
|
+
}>, z.ZodObject<{
|
|
70
|
+
action: z.ZodLiteral<"revert">;
|
|
71
|
+
}, "strict", z.ZodTypeAny, {
|
|
72
|
+
action: "revert";
|
|
73
|
+
}, {
|
|
74
|
+
action: "revert";
|
|
75
|
+
}>]>;
|
|
76
|
+
export type ProgressReportStatusOverrideRequest = z.infer<typeof ProgressReportStatusOverrideRequestSchema>;
|
|
77
|
+
export declare const PROGRESS_REPORT_STATUS_OVERRIDE_PATH_PATTERN: RegExp;
|
|
78
|
+
export declare function progressReportStatusOverridePath(sessionId: string): string;
|
|
79
|
+
export declare function isProgressReportStatusOverrideApiPath(path: string): boolean;
|
|
80
|
+
export declare function isProgressReportStatusOverrideSegments(segments: readonly string[]): boolean;
|
|
81
|
+
export type OverlayApplyResult = Readonly<{
|
|
82
|
+
status: ProgressReportStatus;
|
|
83
|
+
publishedStatus?: ProgressReportStatus;
|
|
84
|
+
}>;
|
|
85
|
+
export declare function applyProgressReportStatusOverlay(published: Readonly<{
|
|
86
|
+
status: ProgressReportStatus;
|
|
87
|
+
startedAt: string;
|
|
88
|
+
updatedAt: string;
|
|
89
|
+
}>, entry: ProgressReportStatusOverrideEntry | undefined): OverlayApplyResult;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure last-writer overlay for dashboard-only progress-report status pins.
|
|
3
|
+
*
|
|
4
|
+
* The producer document is never consulted here. A pin dies when published
|
|
5
|
+
* `updatedAt` is strictly newer than `setAt`, or when `startedAt` does not
|
|
6
|
+
* bind, or when the pin would not change the published status.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { ProgressReportSessionIdSchema, StrictRfc3339TimestampSchema, } from "./progress-report-contract.js";
|
|
10
|
+
export const PROGRESS_REPORT_STATUSES = [
|
|
11
|
+
"running",
|
|
12
|
+
"paused",
|
|
13
|
+
"blocked",
|
|
14
|
+
"done",
|
|
15
|
+
"failed",
|
|
16
|
+
];
|
|
17
|
+
export const ProgressReportStatusSchema = z.enum(PROGRESS_REPORT_STATUSES);
|
|
18
|
+
export const PROGRESS_REPORT_STATUS_OVERRIDE_SCHEMA_VERSION = "progress-report-status-overrides-v1";
|
|
19
|
+
export const PROGRESS_REPORT_STATUS_OVERRIDE_FILENAME = "progress-report-status-overrides.json";
|
|
20
|
+
export const PROGRESS_REPORT_STATUS_OVERRIDE_SEGMENT = "status-override";
|
|
21
|
+
export const ProgressReportStatusOverrideEntrySchema = z.object({
|
|
22
|
+
startedAt: StrictRfc3339TimestampSchema,
|
|
23
|
+
status: ProgressReportStatusSchema,
|
|
24
|
+
setAt: StrictRfc3339TimestampSchema,
|
|
25
|
+
}).strict();
|
|
26
|
+
export const ProgressReportStatusOverrideDocumentSchema = z.object({
|
|
27
|
+
schemaVersion: z.literal(PROGRESS_REPORT_STATUS_OVERRIDE_SCHEMA_VERSION),
|
|
28
|
+
entries: z.record(ProgressReportSessionIdSchema, ProgressReportStatusOverrideEntrySchema),
|
|
29
|
+
}).strict();
|
|
30
|
+
export const ProgressReportStatusOverrideRequestSchema = z.discriminatedUnion("action", [
|
|
31
|
+
z.object({
|
|
32
|
+
action: z.literal("set"),
|
|
33
|
+
status: ProgressReportStatusSchema,
|
|
34
|
+
}).strict(),
|
|
35
|
+
z.object({
|
|
36
|
+
action: z.literal("revert"),
|
|
37
|
+
}).strict(),
|
|
38
|
+
]);
|
|
39
|
+
export const PROGRESS_REPORT_STATUS_OVERRIDE_PATH_PATTERN = /^\/api\/progress-reports\/[A-Za-z0-9][A-Za-z0-9_-]{0,63}\/status-override$/;
|
|
40
|
+
export function progressReportStatusOverridePath(sessionId) {
|
|
41
|
+
return `/api/progress-reports/${sessionId}/${PROGRESS_REPORT_STATUS_OVERRIDE_SEGMENT}`;
|
|
42
|
+
}
|
|
43
|
+
export function isProgressReportStatusOverrideApiPath(path) {
|
|
44
|
+
return PROGRESS_REPORT_STATUS_OVERRIDE_PATH_PATTERN.test(path);
|
|
45
|
+
}
|
|
46
|
+
export function isProgressReportStatusOverrideSegments(segments) {
|
|
47
|
+
return segments.length === 4 &&
|
|
48
|
+
segments[0] === "api" &&
|
|
49
|
+
segments[1] === "progress-reports" &&
|
|
50
|
+
(segments[2]?.length ?? 0) > 0 &&
|
|
51
|
+
ProgressReportSessionIdSchema.safeParse(segments[2]).success &&
|
|
52
|
+
segments[3] === PROGRESS_REPORT_STATUS_OVERRIDE_SEGMENT;
|
|
53
|
+
}
|
|
54
|
+
export function applyProgressReportStatusOverlay(published, entry) {
|
|
55
|
+
if (entry === undefined)
|
|
56
|
+
return { status: published.status };
|
|
57
|
+
if (entry.startedAt !== published.startedAt) {
|
|
58
|
+
return { status: published.status };
|
|
59
|
+
}
|
|
60
|
+
const publishedMs = Date.parse(published.updatedAt);
|
|
61
|
+
const setAtMs = Date.parse(entry.setAt);
|
|
62
|
+
if (!Number.isFinite(publishedMs) || !Number.isFinite(setAtMs)) {
|
|
63
|
+
return { status: published.status };
|
|
64
|
+
}
|
|
65
|
+
if (publishedMs > setAtMs)
|
|
66
|
+
return { status: published.status };
|
|
67
|
+
if (entry.status === published.status)
|
|
68
|
+
return { status: published.status };
|
|
69
|
+
return { status: entry.status, publishedStatus: published.status };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=progress-report-status-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-report-status-overlay.js","sourceRoot":"","sources":["../../src/dashboard/progress-report-status-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,QAAQ;IACR,SAAS;IACT,MAAM;IACN,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAE3E,MAAM,CAAC,MAAM,8CAA8C,GACzD,qCAA8C,CAAC;AACjD,MAAM,CAAC,MAAM,wCAAwC,GACnD,uCAAuC,CAAC;AAC1C,MAAM,CAAC,MAAM,uCAAuC,GAAG,iBAAiB,CAAC;AAEzE,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9D,SAAS,EAAE,4BAA4B;IACvC,MAAM,EAAE,0BAA0B;IAClC,KAAK,EAAE,4BAA4B;CACpC,CAAC,CAAC,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,0CAA0C,GAAG,CAAC,CAAC,MAAM,CAAC;IACjE,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,8CAA8C,CAAC;IACxE,OAAO,EAAE,CAAC,CAAC,MAAM,CACf,6BAA6B,EAC7B,uCAAuC,CACxC;CACF,CAAC,CAAC,MAAM,EAAE,CAAC;AAKZ,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,kBAAkB,CAC3E,QAAQ,EACR;IACE,CAAC,CAAC,MAAM,CAAC;QACP,MAAM,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,SAAS,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/D,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;IACtC,CAAC;IACD,IAAI,WAAW,GAAG,OAAO;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;IAC/D,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QAAE,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;IAC3E,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded sidecar store for dashboard-only progress-report status pins.
|
|
3
|
+
*
|
|
4
|
+
* Lives beside `progress-reports/`, never inside a session directory.
|
|
5
|
+
* Reads fail closed to an empty map. Writes use wx+0o600+rename.
|
|
6
|
+
*/
|
|
7
|
+
import { type ProgressReportStatus, type ProgressReportStatusOverrideEntry, type ProgressReportStatusOverrideRequest } from "./progress-report-status-overlay.js";
|
|
8
|
+
export declare const MAX_PROGRESS_REPORT_STATUS_OVERRIDE_BYTES: number;
|
|
9
|
+
export type ProgressReportStatusOverrideMap = ReadonlyMap<string, ProgressReportStatusOverrideEntry>;
|
|
10
|
+
export type ProgressReportStatusOverrideWriteOutcome = Readonly<{
|
|
11
|
+
kind: "ok";
|
|
12
|
+
}> | Readonly<{
|
|
13
|
+
kind: "unwritable";
|
|
14
|
+
}> | Readonly<{
|
|
15
|
+
kind: "too_large";
|
|
16
|
+
}>;
|
|
17
|
+
export interface ProgressReportStatusOverrideStore {
|
|
18
|
+
readonly read: (progressReportsRoot: string) => Promise<ProgressReportStatusOverrideMap>;
|
|
19
|
+
readonly write: (progressReportsRoot: string, sessionId: string, request: ProgressReportStatusOverrideRequest, session: Readonly<{
|
|
20
|
+
status: ProgressReportStatus;
|
|
21
|
+
startedAt: string;
|
|
22
|
+
updatedAt: string;
|
|
23
|
+
}>) => Promise<ProgressReportStatusOverrideWriteOutcome>;
|
|
24
|
+
}
|
|
25
|
+
export declare function progressReportStatusOverrideFilePath(progressReportsRoot: string): string;
|
|
26
|
+
export declare function createProgressReportStatusOverrideStore(options?: Readonly<{
|
|
27
|
+
now?: (() => Date) | undefined;
|
|
28
|
+
}>): ProgressReportStatusOverrideStore;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded sidecar store for dashboard-only progress-report status pins.
|
|
3
|
+
*
|
|
4
|
+
* Lives beside `progress-reports/`, never inside a session directory.
|
|
5
|
+
* Reads fail closed to an empty map. Writes use wx+0o600+rename.
|
|
6
|
+
*/
|
|
7
|
+
import { randomBytes } from "node:crypto";
|
|
8
|
+
import { open, rename, unlink } from "node:fs/promises";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import { ContainedFileTooLargeError, readContainedRelativeFile, } from "../contained-file.js";
|
|
12
|
+
import { PROGRESS_REPORT_STATUS_OVERRIDE_FILENAME, PROGRESS_REPORT_STATUS_OVERRIDE_SCHEMA_VERSION, ProgressReportStatusOverrideDocumentSchema, } from "./progress-report-status-overlay.js";
|
|
13
|
+
export const MAX_PROGRESS_REPORT_STATUS_OVERRIDE_BYTES = 256 * 1024;
|
|
14
|
+
export function progressReportStatusOverrideFilePath(progressReportsRoot) {
|
|
15
|
+
return join(dirname(progressReportsRoot), PROGRESS_REPORT_STATUS_OVERRIDE_FILENAME);
|
|
16
|
+
}
|
|
17
|
+
export function createProgressReportStatusOverrideStore(options = {}) {
|
|
18
|
+
const now = options.now ?? (() => new Date());
|
|
19
|
+
let writeChain = Promise.resolve();
|
|
20
|
+
const read = async (progressReportsRoot) => {
|
|
21
|
+
const parent = dirname(progressReportsRoot);
|
|
22
|
+
try {
|
|
23
|
+
const result = await readContainedRelativeFile(parent, PROGRESS_REPORT_STATUS_OVERRIDE_FILENAME, {
|
|
24
|
+
containerLabel: "progress-report override parent",
|
|
25
|
+
pathLabel: "progress report status override",
|
|
26
|
+
maxBytes: MAX_PROGRESS_REPORT_STATUS_OVERRIDE_BYTES,
|
|
27
|
+
requireRegular: true,
|
|
28
|
+
requireExactRequestedPath: true,
|
|
29
|
+
wantContent: true,
|
|
30
|
+
});
|
|
31
|
+
if (result.content === undefined)
|
|
32
|
+
return new Map();
|
|
33
|
+
const parsed = ProgressReportStatusOverrideDocumentSchema.safeParse(JSON.parse(result.content));
|
|
34
|
+
if (!parsed.success)
|
|
35
|
+
return new Map();
|
|
36
|
+
return new Map(Object.entries(parsed.data.entries));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
if (error instanceof SyntaxError)
|
|
40
|
+
return new Map();
|
|
41
|
+
if (error instanceof ContainedFileTooLargeError)
|
|
42
|
+
return new Map();
|
|
43
|
+
if (error instanceof z.ZodError)
|
|
44
|
+
return new Map();
|
|
45
|
+
const code = error.code;
|
|
46
|
+
if (code === "ENOENT")
|
|
47
|
+
return new Map();
|
|
48
|
+
return new Map();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const publish = async (progressReportsRoot, document) => {
|
|
52
|
+
const parent = dirname(progressReportsRoot);
|
|
53
|
+
const filePath = progressReportStatusOverrideFilePath(progressReportsRoot);
|
|
54
|
+
const serialized = `${JSON.stringify(document)}\n`;
|
|
55
|
+
if (Buffer.byteLength(serialized, "utf8") > MAX_PROGRESS_REPORT_STATUS_OVERRIDE_BYTES) {
|
|
56
|
+
return { kind: "too_large" };
|
|
57
|
+
}
|
|
58
|
+
const temporaryPath = join(parent, `.${PROGRESS_REPORT_STATUS_OVERRIDE_FILENAME}.${String(process.pid)}.${randomBytes(8).toString("hex")}.tmp`);
|
|
59
|
+
let handle;
|
|
60
|
+
try {
|
|
61
|
+
handle = await open(temporaryPath, "wx", 0o600);
|
|
62
|
+
await handle.writeFile(serialized, "utf8");
|
|
63
|
+
await handle.sync();
|
|
64
|
+
await handle.close();
|
|
65
|
+
handle = undefined;
|
|
66
|
+
await rename(temporaryPath, filePath);
|
|
67
|
+
return { kind: "ok" };
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
if (handle !== undefined)
|
|
71
|
+
await handle.close().catch(() => undefined);
|
|
72
|
+
await unlink(temporaryPath).catch(() => undefined);
|
|
73
|
+
const code = error.code;
|
|
74
|
+
if (code === "EACCES" || code === "EROFS" || code === "ENOENT" || code === "EPERM") {
|
|
75
|
+
return { kind: "unwritable" };
|
|
76
|
+
}
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const write = (progressReportsRoot, sessionId, request, session) => {
|
|
81
|
+
const run = async () => {
|
|
82
|
+
const current = await read(progressReportsRoot);
|
|
83
|
+
const entries = {};
|
|
84
|
+
for (const [id, entry] of current) {
|
|
85
|
+
if (id === sessionId)
|
|
86
|
+
continue;
|
|
87
|
+
entries[id] = entry;
|
|
88
|
+
}
|
|
89
|
+
if (request.action === "set") {
|
|
90
|
+
entries[sessionId] = {
|
|
91
|
+
startedAt: session.startedAt,
|
|
92
|
+
status: request.status,
|
|
93
|
+
setAt: now().toISOString(),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
else if (current.size === 0 || !current.has(sessionId)) {
|
|
97
|
+
return { kind: "ok" };
|
|
98
|
+
}
|
|
99
|
+
return publish(progressReportsRoot, {
|
|
100
|
+
schemaVersion: PROGRESS_REPORT_STATUS_OVERRIDE_SCHEMA_VERSION,
|
|
101
|
+
entries,
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
const queued = writeChain.then(run, run);
|
|
105
|
+
writeChain = queued.then(() => undefined, () => undefined);
|
|
106
|
+
return queued;
|
|
107
|
+
};
|
|
108
|
+
return { read, write };
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=progress-report-status-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-report-status-store.js","sourceRoot":"","sources":["../../src/dashboard/progress-report-status-store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wCAAwC,EACxC,8CAA8C,EAC9C,0CAA0C,GAK3C,MAAM,qCAAqC,CAAC;AAE7C,MAAM,CAAC,MAAM,yCAAyC,GAAG,GAAG,GAAG,IAAI,CAAC;AA4BpE,MAAM,UAAU,oCAAoC,CAClD,mBAA2B;IAE3B,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,wCAAwC,CAAC,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,uCAAuC,CACrD,UAEK,EAAE;IAEP,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,UAAU,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IAErD,MAAM,IAAI,GAAG,KAAK,EAChB,mBAA2B,EACe,EAAE;QAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,yB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,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type FileHandle } from "node:fs/promises";
|
|
2
|
+
import { readContainedRelativeFile, type ContainedFileFingerprint, type OpenedDescriptorPathVerifier } from "../contained-file.js";
|
|
3
|
+
import { type DashboardRunState } from "./contracts.js";
|
|
4
|
+
export declare const DEFAULT_DASHBOARD_MAX_STATE_BYTES = 16777216;
|
|
5
|
+
export interface DashboardAdmissionFileSystem {
|
|
6
|
+
readonly realpath: (path: string) => Promise<string>;
|
|
7
|
+
readonly open: (path: string, flags: number) => Promise<FileHandle>;
|
|
8
|
+
}
|
|
9
|
+
export interface DashboardDirectoryIdentity {
|
|
10
|
+
readonly dev: bigint;
|
|
11
|
+
readonly ino: bigint;
|
|
12
|
+
readonly birthtimeNs: bigint;
|
|
13
|
+
}
|
|
14
|
+
export interface DashboardAdmissionHookContext {
|
|
15
|
+
readonly attempt: 1 | 2;
|
|
16
|
+
readonly canonicalRunsRoot: string;
|
|
17
|
+
readonly runId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface DashboardAdmissionHooks {
|
|
20
|
+
readonly afterDirectoryAdmission?: (context: DashboardAdmissionHookContext) => void | Promise<void>;
|
|
21
|
+
readonly beforeCommitVerification?: (context: DashboardAdmissionHookContext) => void | Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface DashboardRunReaderOptions {
|
|
24
|
+
readonly fileSystem?: DashboardAdmissionFileSystem | undefined;
|
|
25
|
+
readonly descriptorPathVerifier?: OpenedDescriptorPathVerifier | undefined;
|
|
26
|
+
readonly readStateFile?: typeof readContainedRelativeFile | undefined;
|
|
27
|
+
readonly generateRunGeneration?: (() => string) | undefined;
|
|
28
|
+
readonly maxStateBytes?: number | undefined;
|
|
29
|
+
readonly hooks?: DashboardAdmissionHooks | undefined;
|
|
30
|
+
readonly includeUnavailableAdmissionMetadata?: boolean | undefined;
|
|
31
|
+
}
|
|
32
|
+
export type DashboardRunUnavailableReason = "state_unreadable" | "state_invalid" | "too_large_for_dashboard" | "too_complex_for_dashboard" | "path_rejected" | "identity_mismatch" | "run_generation_race";
|
|
33
|
+
export interface AdmittedDashboardRun {
|
|
34
|
+
readonly kind: "admitted";
|
|
35
|
+
readonly runId: string;
|
|
36
|
+
readonly runGeneration: string;
|
|
37
|
+
readonly state: DashboardRunState;
|
|
38
|
+
readonly sourceBytes: number;
|
|
39
|
+
readonly stateFingerprint: ContainedFileFingerprint;
|
|
40
|
+
readonly directoryIdentity: DashboardDirectoryIdentity;
|
|
41
|
+
readonly rootIdentity: DashboardDirectoryIdentity;
|
|
42
|
+
}
|
|
43
|
+
export interface DashboardUnavailableAdmission {
|
|
44
|
+
readonly runGeneration: string;
|
|
45
|
+
readonly sourceBytes: number;
|
|
46
|
+
readonly stateFingerprint?: ContainedFileFingerprint | undefined;
|
|
47
|
+
readonly directoryIdentity: DashboardDirectoryIdentity;
|
|
48
|
+
readonly rootIdentity: DashboardDirectoryIdentity;
|
|
49
|
+
}
|
|
50
|
+
export type DashboardRunReadResult = AdmittedDashboardRun | {
|
|
51
|
+
readonly kind: "missing";
|
|
52
|
+
readonly runId: string;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "unavailable";
|
|
55
|
+
readonly runId: string;
|
|
56
|
+
readonly reason: DashboardRunUnavailableReason;
|
|
57
|
+
readonly admission?: DashboardUnavailableAdmission | undefined;
|
|
58
|
+
};
|
|
59
|
+
export interface DashboardRunReader {
|
|
60
|
+
read(runsRoot: string, runId: string): Promise<DashboardRunReadResult>;
|
|
61
|
+
inspectDirectoryIdentity?(runsRoot: string, runId: string): Promise<{
|
|
62
|
+
readonly kind: "present";
|
|
63
|
+
readonly directoryIdentity: DashboardDirectoryIdentity;
|
|
64
|
+
readonly rootIdentity: DashboardDirectoryIdentity;
|
|
65
|
+
} | {
|
|
66
|
+
readonly kind: "missing";
|
|
67
|
+
}>;
|
|
68
|
+
inspectGeneration?(runsRoot: string, runId: string): Promise<{
|
|
69
|
+
readonly kind: "present";
|
|
70
|
+
readonly runGeneration: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly kind: "missing";
|
|
73
|
+
}>;
|
|
74
|
+
forget(runsRoot: string, runId: string): void;
|
|
75
|
+
}
|
|
76
|
+
export type DashboardOptionalContentResult<T> = {
|
|
77
|
+
readonly kind: "available";
|
|
78
|
+
readonly value: T;
|
|
79
|
+
} | {
|
|
80
|
+
readonly kind: "unavailable";
|
|
81
|
+
readonly reason: "not_found";
|
|
82
|
+
};
|
|
83
|
+
/** Map optional-content deletion without reclassifying the enclosing run. */
|
|
84
|
+
export declare function readDashboardOptionalContent<T>(read: () => Promise<T>): Promise<DashboardOptionalContentResult<T>>;
|
|
85
|
+
export declare function createDashboardRunReader(options?: DashboardRunReaderOptions): DashboardRunReader;
|
|
86
|
+
export declare function readDashboardRun(runsRoot: string, runId: string): Promise<DashboardRunReadResult>;
|