clinkx 0.3.0 → 1.1.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 +119 -0
- package/LICENSE +10 -0
- package/README.md +154 -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/chairman-knobs.d.ts +24 -0
- package/clinkx-workflows/dist/chairman-knobs.js +27 -0
- package/clinkx-workflows/dist/chairman-knobs.js.map +1 -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 +12 -1
- package/clinkx-workflows/dist/clink-client.js +56 -5
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +173 -16
- package/clinkx-workflows/dist/config.js +417 -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 +189 -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-execution-policy.d.ts +68 -0
- package/clinkx-workflows/dist/council-execution-policy.js +110 -0
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -0
- package/clinkx-workflows/dist/council-expander.d.ts +10 -9
- package/clinkx-workflows/dist/council-expander.js +20 -10
- package/clinkx-workflows/dist/council-expander.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +5718 -0
- package/clinkx-workflows/dist/dashboard/activity-contract.js +157 -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 +90 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js +493 -0
- package/clinkx-workflows/dist/dashboard/activity-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/api-routes.d.ts +40 -0
- package/clinkx-workflows/dist/dashboard/api-routes.js +1155 -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-builder-invocation-contract.d.ts +3865 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.js +69 -0
- package/clinkx-workflows/dist/dashboard/context-builder-invocation-contract.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 +256 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js +1301 -0
- package/clinkx-workflows/dist/dashboard/context-run-reader.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +28483 -0
- package/clinkx-workflows/dist/dashboard/contracts.js +1284 -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 +32 -0
- package/clinkx-workflows/dist/dashboard/index.js +20 -0
- package/clinkx-workflows/dist/dashboard/index.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.d.ts +786 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js +201 -0
- package/clinkx-workflows/dist/dashboard/invocation-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.d.ts +114 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js +799 -0
- package/clinkx-workflows/dist/dashboard/lazy-content.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.d.ts +90 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js +31 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.d.ts +12 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js +286 -0
- package/clinkx-workflows/dist/dashboard/native-transcript/projection.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +446 -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 +529 -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 +29 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js +111 -0
- package/clinkx-workflows/dist/dashboard/progress-report-status-store.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.d.ts +194 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js +89 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.d.ts +26 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-store.js +102 -0
- package/clinkx-workflows/dist/dashboard/prompt-builder-library-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 +130 -0
- package/clinkx-workflows/dist/dashboard/request-admission.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +78 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +1154 -0
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/server-factory.d.ts +63 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js +483 -0
- package/clinkx-workflows/dist/dashboard/server-factory.js.map +1 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +2778 -0
- package/clinkx-workflows/dist/dashboard/session-log-contract.js +506 -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 +529 -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 +14 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +1101 -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-JPHQVtn9.js +106 -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-DOMHk-j6.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-finalizer-policy.d.ts +26 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js +72 -0
- package/clinkx-workflows/dist/delegate-finalizer-policy.js.map +1 -0
- package/clinkx-workflows/dist/delegate-signature.d.ts +14 -0
- package/clinkx-workflows/dist/delegate-signature.js +14 -0
- package/clinkx-workflows/dist/delegate-signature.js.map +1 -0
- package/clinkx-workflows/dist/delegate-validate.d.ts +108 -0
- package/clinkx-workflows/dist/delegate-validate.js +148 -0
- package/clinkx-workflows/dist/delegate-validate.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +251 -0
- package/clinkx-workflows/dist/engine.js +1342 -92
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/errors.d.ts +24 -2
- package/clinkx-workflows/dist/errors.js +30 -2
- package/clinkx-workflows/dist/errors.js.map +1 -1
- package/clinkx-workflows/dist/fidelity.d.ts +47 -1
- package/clinkx-workflows/dist/fidelity.js +54 -1
- package/clinkx-workflows/dist/fidelity.js.map +1 -1
- package/clinkx-workflows/dist/fingerprint.d.ts +25 -7
- package/clinkx-workflows/dist/fingerprint.js +33 -10
- package/clinkx-workflows/dist/fingerprint.js.map +1 -1
- package/clinkx-workflows/dist/index.d.ts +19 -0
- package/clinkx-workflows/dist/index.js +68 -1
- 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/logger.d.ts +1 -1
- package/clinkx-workflows/dist/logger.js +17 -3
- package/clinkx-workflows/dist/logger.js.map +1 -1
- package/clinkx-workflows/dist/monotonic-clock.d.ts +19 -0
- package/clinkx-workflows/dist/monotonic-clock.js +22 -0
- package/clinkx-workflows/dist/monotonic-clock.js.map +1 -0
- 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/roster-contract.d.ts +889 -0
- package/clinkx-workflows/dist/roster-contract.js +180 -0
- package/clinkx-workflows/dist/roster-contract.js.map +1 -0
- package/clinkx-workflows/dist/rosters.d.ts +14 -0
- package/clinkx-workflows/dist/rosters.js +169 -0
- package/clinkx-workflows/dist/rosters.js.map +1 -0
- package/clinkx-workflows/dist/run-health.d.ts +7 -0
- package/clinkx-workflows/dist/run-health.js +25 -0
- package/clinkx-workflows/dist/run-health.js.map +1 -0
- 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 +140 -21
- package/clinkx-workflows/dist/schema.js +34 -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 +84 -52
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/shutdown.d.ts +29 -18
- package/clinkx-workflows/dist/shutdown.js +90 -64
- package/clinkx-workflows/dist/shutdown.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +61 -0
- package/clinkx-workflows/dist/state.d.ts +175 -3
- package/clinkx-workflows/dist/state.js +1398 -44
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/stdio-watchdog.d.ts +52 -0
- package/clinkx-workflows/dist/stdio-watchdog.js +212 -0
- package/clinkx-workflows/dist/stdio-watchdog.js.map +1 -0
- 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 +20 -2
- package/clinkx-workflows/dist/validators/council.d.ts +334 -101
- 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 +118 -3
- package/clinkx-workflows/dist/workflow-tools.js +2110 -175
- 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-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/answer-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/answer-specialist.txt +5 -1
- package/clinkx-workflows/templates/council/chairman.txt +3 -0
- package/clinkx-workflows/templates/council/code-review-chairman.txt +16 -0
- package/clinkx-workflows/templates/council/code-review-cross-reviewer.txt +7 -1
- package/clinkx-workflows/templates/council/code-review-reviewer.txt +22 -3
- package/clinkx-workflows/templates/council/debug-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/debug-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/debug-debugger.txt +5 -1
- package/clinkx-workflows/templates/council/discover-analyst.txt +5 -1
- package/clinkx-workflows/templates/council/discover-chairman.txt +3 -0
- package/clinkx-workflows/templates/council/discover-cross-reviewer.txt +3 -0
- package/clinkx-workflows/templates/council/member.txt +5 -1
- package/clinkx-workflows/templates/council/plan-review-chairman.txt +71 -0
- package/clinkx-workflows/templates/council/plan-review-cross-reviewer.txt +54 -0
- package/clinkx-workflows/templates/council/plan-review-reviewer.txt +63 -0
- package/clinkx-workflows/templates/council/reviewer.txt +3 -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 +100 -8
- package/clinkx-workflows/workflows/council-code-review.yaml +106 -8
- package/clinkx-workflows/workflows/council-debug.yaml +100 -8
- package/clinkx-workflows/workflows/council-default.yaml +104 -8
- package/clinkx-workflows/workflows/council-discover.yaml +100 -8
- package/clinkx-workflows/workflows/council-plan-review.yaml +253 -0
- package/clinkx-workflows/workflows/plan-review-receipts.yaml +230 -0
- package/conf/adapters/agy.json +56 -0
- package/conf/adapters/claude.json +12 -0
- package/conf/adapters/codex-app-server.json +44 -0
- package/conf/adapters/codex.json +14 -2
- package/conf/adapters/glm.json +24 -3
- package/conf/adapters/grok.json +67 -0
- package/conf/adapters/hapi/agy.json +59 -0
- package/conf/adapters/hapi/claude.json +12 -0
- package/conf/adapters/hapi/codex.json +14 -2
- package/conf/adapters/hapi/glm.json +25 -4
- package/conf/rosters/default-council.json +21 -0
- package/dist/activity-journal.d.ts +56 -0
- package/dist/activity-journal.js +706 -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 +1306 -0
- package/dist/codex/agent-tools.js.map +1 -0
- package/dist/codex/app-server-client.d.ts +79 -0
- package/dist/codex/app-server-client.js +593 -0
- package/dist/codex/app-server-client.js.map +1 -0
- package/dist/codex/app-server-registry.d.ts +407 -0
- package/dist/codex/app-server-registry.js +1493 -0
- package/dist/codex/app-server-registry.js.map +1 -0
- package/dist/codex/client-types.d.ts +115 -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 +386 -23
- package/dist/config.js +184 -15
- 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 +48 -2
- package/dist/context-builder/bundle.js +388 -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-finalizer-effective.d.ts +33 -0
- package/dist/context-builder/delegate-finalizer-effective.js +82 -0
- package/dist/context-builder/delegate-finalizer-effective.js.map +1 -0
- package/dist/context-builder/delegate-packet.d.ts +55 -0
- package/dist/context-builder/delegate-packet.js +430 -74
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-reconstruction.d.ts +29 -0
- package/dist/context-builder/delegate-reconstruction.js +110 -41
- package/dist/context-builder/delegate-reconstruction.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +41 -1
- package/dist/context-builder/delegate-validation.js +237 -48
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/delegate.d.ts +11 -0
- package/dist/context-builder/delegate.js +210 -58
- 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-progress.d.ts +25 -0
- package/dist/context-builder/discovery-progress.js +64 -0
- package/dist/context-builder/discovery-progress.js.map +1 -0
- package/dist/context-builder/discovery-watchdog.d.ts +15 -0
- package/dist/context-builder/discovery-watchdog.js +39 -0
- package/dist/context-builder/discovery-watchdog.js.map +1 -0
- package/dist/context-builder/discovery.d.ts +36 -1
- package/dist/context-builder/discovery.js +584 -172
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/external-gaps.d.ts +73 -0
- package/dist/context-builder/external-gaps.js +248 -0
- package/dist/context-builder/external-gaps.js.map +1 -0
- package/dist/context-builder/globs.d.ts +1 -0
- package/dist/context-builder/globs.js +25 -10
- package/dist/context-builder/globs.js.map +1 -1
- package/dist/context-builder/handler.d.ts +67 -2
- package/dist/context-builder/handler.js +1810 -2440
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/invocation-sidecar.d.ts +41 -0
- package/dist/context-builder/invocation-sidecar.js +189 -0
- package/dist/context-builder/invocation-sidecar.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/mutation-lock.d.ts +32 -0
- package/dist/context-builder/mutation-lock.js +321 -0
- package/dist/context-builder/mutation-lock.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 +116 -0
- package/dist/context-builder/review-coverage.js +544 -0
- package/dist/context-builder/review-coverage.js.map +1 -0
- package/dist/context-builder/schema.d.ts +315 -2
- package/dist/context-builder/schema.js +133 -7
- package/dist/context-builder/schema.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +59 -0
- package/dist/context-builder/secrets.js +2255 -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 +23 -2
- package/dist/context-builder/status.js +60 -4
- package/dist/context-builder/status.js.map +1 -1
- package/dist/context-builder/storage.d.ts +59 -2
- package/dist/context-builder/storage.js +500 -168
- 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 +44 -0
- package/dist/context-builder/versions.js +45 -0
- package/dist/context-builder/versions.js.map +1 -0
- package/dist/context-builder/workflow-runner.d.ts +75 -0
- package/dist/context-builder/workflow-runner.js +1241 -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 +53 -0
- package/dist/dashboard-adapter-catalog.js.map +1 -0
- package/dist/dashboard-cli.d.ts +81 -0
- package/dist/dashboard-cli.js +623 -0
- package/dist/dashboard-cli.js.map +1 -0
- package/dist/dashboard-companion/client.d.ts +37 -0
- package/dist/dashboard-companion/client.js +229 -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 +458 -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 +12 -0
- package/dist/dashboard-gateway/index.js +786 -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 +15 -2
- package/dist/handler.js.map +1 -1
- package/dist/index.d.ts +20 -2
- package/dist/index.js +154 -6
- 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/logger.d.ts +1 -1
- package/dist/logger.js +18 -3
- package/dist/logger.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/agy-stream-json.d.ts +14 -0
- package/dist/parsers/agy-stream-json.js +172 -0
- package/dist/parsers/agy-stream-json.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 +16 -4
- package/dist/parsers/extract.js.map +1 -1
- package/dist/parsers/observed-invocation.d.ts +20 -0
- package/dist/parsers/observed-invocation.js +42 -0
- package/dist/parsers/observed-invocation.js.map +1 -0
- package/dist/pipeline.d.ts +17 -0
- package/dist/pipeline.js +181 -10
- package/dist/pipeline.js.map +1 -1
- package/dist/progress-report/lock.d.ts +74 -0
- package/dist/progress-report/lock.js +343 -0
- package/dist/progress-report/lock.js.map +1 -0
- package/dist/progress-report/schema.d.ts +808 -0
- package/dist/progress-report/schema.js +119 -0
- package/dist/progress-report/schema.js.map +1 -0
- package/dist/progress-report/store.d.ts +66 -0
- package/dist/progress-report/store.js +766 -0
- package/dist/progress-report/store.js.map +1 -0
- package/dist/progress-report/tools.d.ts +20 -0
- package/dist/progress-report/tools.js +141 -0
- package/dist/progress-report/tools.js.map +1 -0
- package/dist/prompt-mode.d.ts +1 -1
- package/dist/prompt-mode.js +7 -2
- package/dist/prompt-mode.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 +20 -0
- package/dist/runner.js +192 -16
- package/dist/runner.js.map +1 -1
- package/dist/safety.d.ts +54 -4
- package/dist/safety.js +186 -5
- package/dist/safety.js.map +1 -1
- package/dist/schema.d.ts +15 -7
- package/dist/schema.js +20 -0
- package/dist/schema.js.map +1 -1
- package/dist/server.d.ts +7 -1
- package/dist/server.js +451 -23
- package/dist/server.js.map +1 -1
- package/dist/session-log-stream.d.ts +18 -0
- package/dist/session-log-stream.js +566 -0
- package/dist/session-log-stream.js.map +1 -0
- package/dist/stdio-activity.d.ts +28 -0
- package/dist/stdio-activity.js +72 -0
- package/dist/stdio-activity.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/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,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded sidecar store for the dashboard-private prompt-builder library.
|
|
3
|
+
*
|
|
4
|
+
* Lives beside `progress-report-status-overrides.json` under the dashboard
|
|
5
|
+
* private writable parent. Reads distinguish absent / present / unreadable
|
|
6
|
+
* and never collapse errors to an empty document. Writes use wx+0o600+rename.
|
|
7
|
+
*/
|
|
8
|
+
import { randomBytes } from "node:crypto";
|
|
9
|
+
import { open, rename, unlink } from "node:fs/promises";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { ContainedFilePolicyError, ContainedFileTooLargeError, readContainedRelativeFile, } from "../contained-file.js";
|
|
13
|
+
import { MAX_PROMPT_BUILDER_LIBRARY_DOCUMENT_BYTES, MAX_PROMPT_BUILDER_LIBRARY_READ_BYTES, PROMPT_BUILDER_LIBRARY_FILENAME, PROMPT_BUILDER_LIBRARY_SCHEMA_VERSION, PromptBuilderLibraryDocumentSchema, } from "./prompt-builder-library-contract.js";
|
|
14
|
+
export function promptBuilderLibraryFilePath(parentDir) {
|
|
15
|
+
return join(parentDir, PROMPT_BUILDER_LIBRARY_FILENAME);
|
|
16
|
+
}
|
|
17
|
+
function errnoCode(error) {
|
|
18
|
+
return error.code;
|
|
19
|
+
}
|
|
20
|
+
export function createPromptBuilderLibraryStore(options = {}) {
|
|
21
|
+
const now = options.now ?? (() => new Date());
|
|
22
|
+
let writeChain = Promise.resolve();
|
|
23
|
+
const read = async (parentDir) => {
|
|
24
|
+
try {
|
|
25
|
+
const result = await readContainedRelativeFile(parentDir, PROMPT_BUILDER_LIBRARY_FILENAME, {
|
|
26
|
+
containerLabel: "prompt-builder library parent",
|
|
27
|
+
pathLabel: "prompt builder library",
|
|
28
|
+
maxBytes: MAX_PROMPT_BUILDER_LIBRARY_READ_BYTES,
|
|
29
|
+
requireRegular: true,
|
|
30
|
+
requireExactRequestedPath: true,
|
|
31
|
+
wantContent: true,
|
|
32
|
+
});
|
|
33
|
+
if (result.content === undefined) {
|
|
34
|
+
return { kind: "unreadable", reason: "empty_read" };
|
|
35
|
+
}
|
|
36
|
+
const parsed = PromptBuilderLibraryDocumentSchema.safeParse(JSON.parse(result.content));
|
|
37
|
+
if (!parsed.success) {
|
|
38
|
+
return { kind: "unreadable", reason: "invalid_document" };
|
|
39
|
+
}
|
|
40
|
+
return { kind: "present", document: parsed.data };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (errnoCode(error) === "ENOENT")
|
|
44
|
+
return { kind: "absent" };
|
|
45
|
+
if (error instanceof SyntaxError) {
|
|
46
|
+
return { kind: "unreadable", reason: "invalid_json" };
|
|
47
|
+
}
|
|
48
|
+
if (error instanceof ContainedFileTooLargeError) {
|
|
49
|
+
return { kind: "unreadable", reason: "too_large" };
|
|
50
|
+
}
|
|
51
|
+
if (error instanceof ContainedFilePolicyError) {
|
|
52
|
+
return { kind: "unreadable", reason: "policy" };
|
|
53
|
+
}
|
|
54
|
+
if (error instanceof z.ZodError) {
|
|
55
|
+
return { kind: "unreadable", reason: "invalid_document" };
|
|
56
|
+
}
|
|
57
|
+
return { kind: "unreadable", reason: "read_failed" };
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const publish = async (parentDir, document) => {
|
|
61
|
+
const filePath = promptBuilderLibraryFilePath(parentDir);
|
|
62
|
+
const serialized = `${JSON.stringify(document)}\n`;
|
|
63
|
+
if (Buffer.byteLength(serialized, "utf8") > MAX_PROMPT_BUILDER_LIBRARY_DOCUMENT_BYTES) {
|
|
64
|
+
return { kind: "too_large" };
|
|
65
|
+
}
|
|
66
|
+
const temporaryPath = join(parentDir, `.${PROMPT_BUILDER_LIBRARY_FILENAME}.${String(process.pid)}.${randomBytes(8).toString("hex")}.tmp`);
|
|
67
|
+
let handle;
|
|
68
|
+
try {
|
|
69
|
+
handle = await open(temporaryPath, "wx", 0o600);
|
|
70
|
+
await handle.writeFile(serialized, "utf8");
|
|
71
|
+
await handle.sync();
|
|
72
|
+
await handle.close();
|
|
73
|
+
handle = undefined;
|
|
74
|
+
await rename(temporaryPath, filePath);
|
|
75
|
+
return { kind: "ok", document };
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
if (handle !== undefined)
|
|
79
|
+
await handle.close().catch(() => undefined);
|
|
80
|
+
await unlink(temporaryPath).catch(() => undefined);
|
|
81
|
+
const code = errnoCode(error);
|
|
82
|
+
if (code === "EACCES" || code === "EROFS" || code === "ENOENT" || code === "EPERM") {
|
|
83
|
+
return { kind: "unwritable" };
|
|
84
|
+
}
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const write = (parentDir, request) => {
|
|
89
|
+
const document = {
|
|
90
|
+
schemaVersion: PROMPT_BUILDER_LIBRARY_SCHEMA_VERSION,
|
|
91
|
+
updatedAt: now().toISOString(),
|
|
92
|
+
models: request.models,
|
|
93
|
+
requests: request.requests,
|
|
94
|
+
stances: request.stances,
|
|
95
|
+
};
|
|
96
|
+
const queued = writeChain.then(() => publish(parentDir, document), () => publish(parentDir, document));
|
|
97
|
+
writeChain = queued.then(() => undefined, () => undefined);
|
|
98
|
+
return queued;
|
|
99
|
+
};
|
|
100
|
+
return { read, write };
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=prompt-builder-library-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder-library-store.js","sourceRoot":"","sources":["../../src/dashboard/prompt-builder-library-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAA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KAAK,QAAQ,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACnF,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;YAChC,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,KAAK,GAAG,CACZ,SAAiB,EACjB,OAAwC,EACG,EAAE;QAC7C,MAAM,QAAQ,GAAiC;YAC7C,aAAa,EAAE,qCAAqC;YACpD,SAAS,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;YAC9B,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;SACzB,CAAC;QACF,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAC5B,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,EAClC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CACnC,CAAC;QACF,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC3D,OAAO,MAAM,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>;
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { constants as fsConstants } from "node:fs";
|
|
2
|
+
import { open, realpath } from "node:fs/promises";
|
|
3
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { ContainedFileChangedError, ContainedFilePolicyError, ContainedFileTooLargeError, readContainedRelativeFile, resolveOpenedDescriptorPath, } from "../contained-file.js";
|
|
5
|
+
import { validateRunId } from "../run-id.js";
|
|
6
|
+
import { logger } from "../logger.js";
|
|
7
|
+
import { DEFAULT_DASHBOARD_MAX_STATE_BYTES as CONFIGURED_DEFAULT_DASHBOARD_MAX_STATE_BYTES } from "../config.js";
|
|
8
|
+
import { parseDashboardRunState, } from "./contracts.js";
|
|
9
|
+
import { deriveWorkflowRunGeneration } from "./generation.js";
|
|
10
|
+
export const DEFAULT_DASHBOARD_MAX_STATE_BYTES = CONFIGURED_DEFAULT_DASHBOARD_MAX_STATE_BYTES;
|
|
11
|
+
class DashboardGenerationRaceError extends Error {
|
|
12
|
+
}
|
|
13
|
+
const defaultFileSystem = { open, realpath };
|
|
14
|
+
function hasErrorCode(error, code) {
|
|
15
|
+
return error?.code === code;
|
|
16
|
+
}
|
|
17
|
+
/** Map optional-content deletion without reclassifying the enclosing run. */
|
|
18
|
+
export async function readDashboardOptionalContent(read) {
|
|
19
|
+
try {
|
|
20
|
+
return { kind: "available", value: await read() };
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
if (hasErrorCode(error, "ENOENT")) {
|
|
24
|
+
return { kind: "unavailable", reason: "not_found" };
|
|
25
|
+
}
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function directoryIdentity(stats) {
|
|
30
|
+
return {
|
|
31
|
+
dev: stats.dev,
|
|
32
|
+
ino: stats.ino,
|
|
33
|
+
birthtimeNs: stats.birthtimeNs,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function directoryIdentitiesEqual(left, right) {
|
|
37
|
+
return left.dev === right.dev &&
|
|
38
|
+
left.ino === right.ino &&
|
|
39
|
+
left.birthtimeNs === right.birthtimeNs;
|
|
40
|
+
}
|
|
41
|
+
function isProperDescendant(root, candidate) {
|
|
42
|
+
const pathFromRoot = relative(root, candidate);
|
|
43
|
+
return pathFromRoot !== "" &&
|
|
44
|
+
pathFromRoot !== ".." &&
|
|
45
|
+
!pathFromRoot.startsWith(`..${sep}`) &&
|
|
46
|
+
!isAbsolute(pathFromRoot);
|
|
47
|
+
}
|
|
48
|
+
async function inspectOpenedDirectory(handle) {
|
|
49
|
+
const stats = await handle.stat({ bigint: true });
|
|
50
|
+
if (!stats.isDirectory() ||
|
|
51
|
+
stats.nlink === 0n) {
|
|
52
|
+
throw new DashboardGenerationRaceError();
|
|
53
|
+
}
|
|
54
|
+
return directoryIdentity(stats);
|
|
55
|
+
}
|
|
56
|
+
async function verifyCurrentDirectoryIdentity(fileSystem, path, flags, expected) {
|
|
57
|
+
let current;
|
|
58
|
+
try {
|
|
59
|
+
// Opening the exact path with O_NOFOLLOW proves the current directory entry
|
|
60
|
+
// still names a real directory; comparing the opened identity to the
|
|
61
|
+
// transaction's live handle detects rename/recycle without a Darwin `lsof`
|
|
62
|
+
// subprocess. Directory hard links are not available to unprivileged callers,
|
|
63
|
+
// while the state-file descriptor retains its stricter initial/final
|
|
64
|
+
// authoritative path checks.
|
|
65
|
+
current = await fileSystem.open(path, flags);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
throw new DashboardGenerationRaceError();
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const identity = await inspectOpenedDirectory(current);
|
|
72
|
+
if (!directoryIdentitiesEqual(identity, expected)) {
|
|
73
|
+
throw new DashboardGenerationRaceError();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
await current.close();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function generationFor(cache, runId, identity, generate) {
|
|
81
|
+
const current = cache.generations.get(runId);
|
|
82
|
+
if (current !== undefined && directoryIdentitiesEqual(current.identity, identity)) {
|
|
83
|
+
return current.generation;
|
|
84
|
+
}
|
|
85
|
+
const generation = generate();
|
|
86
|
+
cache.generations.set(runId, { identity, generation });
|
|
87
|
+
return generation;
|
|
88
|
+
}
|
|
89
|
+
export function createDashboardRunReader(options = {}) {
|
|
90
|
+
const fileSystem = options.fileSystem ?? defaultFileSystem;
|
|
91
|
+
const verifyDescriptorPath = options.descriptorPathVerifier ??
|
|
92
|
+
resolveOpenedDescriptorPath;
|
|
93
|
+
const readStateFile = options.readStateFile ?? readContainedRelativeFile;
|
|
94
|
+
const generateRunGeneration = options.generateRunGeneration;
|
|
95
|
+
const maxStateBytes = options.maxStateBytes ?? DEFAULT_DASHBOARD_MAX_STATE_BYTES;
|
|
96
|
+
const rootCache = new Map();
|
|
97
|
+
const directoryFlags = fsConstants.O_RDONLY |
|
|
98
|
+
(fsConstants.O_DIRECTORY ?? 0) |
|
|
99
|
+
(fsConstants.O_NOFOLLOW ?? 0);
|
|
100
|
+
function runGeneration(cache, runId, rootIdentity, directoryIdentity) {
|
|
101
|
+
if (generateRunGeneration === undefined) {
|
|
102
|
+
return deriveWorkflowRunGeneration(runId, rootIdentity, directoryIdentity);
|
|
103
|
+
}
|
|
104
|
+
return generationFor(cache, runId, directoryIdentity, generateRunGeneration);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* `runPath` is the exact canonical path `handle` was opened on — the CHILD run
|
|
108
|
+
* directory, never `canonicalRoot`. Passing it lets the darwin verifier take
|
|
109
|
+
* its fast `realpath`+`fstat`/`lstat` path instead of falling through to the
|
|
110
|
+
* `lsof` subprocess, which is both slower and hardlink-blind. Passing
|
|
111
|
+
* `canonicalRoot` here would compare two different inodes and reject every run.
|
|
112
|
+
* `canonicalRoot` is still required for the containment re-assert below, which
|
|
113
|
+
* is the upgrade the fast path relies on.
|
|
114
|
+
*/
|
|
115
|
+
async function inspectInitiallyOpenedRunDirectory(handle, canonicalRoot, runPath) {
|
|
116
|
+
const identity = await inspectOpenedDirectory(handle);
|
|
117
|
+
let descriptorPath;
|
|
118
|
+
try {
|
|
119
|
+
descriptorPath = await verifyDescriptorPath(handle.fd, runPath);
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
throw new DashboardGenerationRaceError();
|
|
123
|
+
}
|
|
124
|
+
if (descriptorPath === undefined ||
|
|
125
|
+
!isProperDescendant(canonicalRoot, descriptorPath)) {
|
|
126
|
+
throw new DashboardGenerationRaceError();
|
|
127
|
+
}
|
|
128
|
+
return identity;
|
|
129
|
+
}
|
|
130
|
+
async function inspectCurrentDirectoryIdentity(configuredRoot, runId) {
|
|
131
|
+
try {
|
|
132
|
+
const canonicalRoot = await fileSystem.realpath(configuredRoot);
|
|
133
|
+
const rootHandle = await fileSystem.open(canonicalRoot, directoryFlags);
|
|
134
|
+
try {
|
|
135
|
+
const rootIdentity = await inspectOpenedDirectory(rootHandle);
|
|
136
|
+
const runPath = resolve(canonicalRoot, runId);
|
|
137
|
+
const runHandle = await fileSystem.open(runPath, directoryFlags);
|
|
138
|
+
try {
|
|
139
|
+
const runIdentity = await inspectInitiallyOpenedRunDirectory(runHandle, canonicalRoot, runPath);
|
|
140
|
+
await verifyCurrentDirectoryIdentity(fileSystem, runPath, directoryFlags, runIdentity);
|
|
141
|
+
await verifyCurrentDirectoryIdentity(fileSystem, canonicalRoot, directoryFlags, rootIdentity);
|
|
142
|
+
return {
|
|
143
|
+
kind: "present",
|
|
144
|
+
directoryIdentity: runIdentity,
|
|
145
|
+
rootIdentity,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
finally {
|
|
149
|
+
await runHandle.close();
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
await rootHandle.close();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return { kind: "missing" };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
function unavailable(runId, reason, admission) {
|
|
161
|
+
return {
|
|
162
|
+
kind: "unavailable",
|
|
163
|
+
runId,
|
|
164
|
+
reason,
|
|
165
|
+
...(options.includeUnavailableAdmissionMetadata === true && admission !== undefined
|
|
166
|
+
? { admission }
|
|
167
|
+
: {}),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
async function admitUnavailableDirectory(configuredRoot, runId) {
|
|
171
|
+
try {
|
|
172
|
+
const cacheKey = resolve(configuredRoot);
|
|
173
|
+
const canonicalRoot = await fileSystem.realpath(configuredRoot);
|
|
174
|
+
const rootHandle = await fileSystem.open(canonicalRoot, directoryFlags);
|
|
175
|
+
try {
|
|
176
|
+
const rootIdentity = await inspectOpenedDirectory(rootHandle);
|
|
177
|
+
let cache = rootCache.get(cacheKey);
|
|
178
|
+
if (cache === undefined ||
|
|
179
|
+
cache.canonicalRoot !== canonicalRoot ||
|
|
180
|
+
!directoryIdentitiesEqual(cache.identity, rootIdentity)) {
|
|
181
|
+
cache = {
|
|
182
|
+
canonicalRoot,
|
|
183
|
+
identity: rootIdentity,
|
|
184
|
+
generations: new Map(),
|
|
185
|
+
};
|
|
186
|
+
rootCache.set(cacheKey, cache);
|
|
187
|
+
}
|
|
188
|
+
const runPath = resolve(canonicalRoot, runId);
|
|
189
|
+
const runHandleA = await fileSystem.open(runPath, directoryFlags);
|
|
190
|
+
try {
|
|
191
|
+
const identityA = await inspectInitiallyOpenedRunDirectory(runHandleA, canonicalRoot, runPath);
|
|
192
|
+
const runHandleB = await fileSystem.open(runPath, directoryFlags);
|
|
193
|
+
try {
|
|
194
|
+
const identityB = await inspectOpenedDirectory(runHandleB);
|
|
195
|
+
if (!directoryIdentitiesEqual(identityA, identityB))
|
|
196
|
+
return undefined;
|
|
197
|
+
await verifyCurrentDirectoryIdentity(fileSystem, canonicalRoot, directoryFlags, rootIdentity);
|
|
198
|
+
return {
|
|
199
|
+
runGeneration: runGeneration(cache, runId, rootIdentity, identityA),
|
|
200
|
+
sourceBytes: 0,
|
|
201
|
+
directoryIdentity: identityA,
|
|
202
|
+
rootIdentity,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
finally {
|
|
206
|
+
await runHandleB.close();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
await runHandleA.close();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
finally {
|
|
214
|
+
await rootHandle.close();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async function readAttempt(configuredRoot, runId, attempt) {
|
|
222
|
+
const cacheKey = resolve(configuredRoot);
|
|
223
|
+
let canonicalRoot;
|
|
224
|
+
try {
|
|
225
|
+
canonicalRoot = await fileSystem.realpath(configuredRoot);
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
if (hasErrorCode(error, "ENOENT")) {
|
|
229
|
+
rootCache.delete(cacheKey);
|
|
230
|
+
return { kind: "missing", runId };
|
|
231
|
+
}
|
|
232
|
+
logger.debug({ err: error, runId }, "dashboard runs root could not be canonicalized");
|
|
233
|
+
return { kind: "unavailable", runId, reason: "state_unreadable" };
|
|
234
|
+
}
|
|
235
|
+
let rootHandle;
|
|
236
|
+
try {
|
|
237
|
+
rootHandle = await fileSystem.open(canonicalRoot, directoryFlags);
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
if (hasErrorCode(error, "ENOENT")) {
|
|
241
|
+
rootCache.delete(cacheKey);
|
|
242
|
+
return { kind: "missing", runId };
|
|
243
|
+
}
|
|
244
|
+
logger.debug({ err: error, runId }, "dashboard runs root could not be opened");
|
|
245
|
+
return { kind: "unavailable", runId, reason: "path_rejected" };
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
const rootIdentity = await inspectOpenedDirectory(rootHandle);
|
|
249
|
+
let cache = rootCache.get(cacheKey);
|
|
250
|
+
if (cache === undefined ||
|
|
251
|
+
cache.canonicalRoot !== canonicalRoot ||
|
|
252
|
+
!directoryIdentitiesEqual(cache.identity, rootIdentity)) {
|
|
253
|
+
cache = {
|
|
254
|
+
canonicalRoot,
|
|
255
|
+
identity: rootIdentity,
|
|
256
|
+
generations: new Map(),
|
|
257
|
+
};
|
|
258
|
+
rootCache.set(cacheKey, cache);
|
|
259
|
+
}
|
|
260
|
+
const runPath = resolve(canonicalRoot, runId);
|
|
261
|
+
let runHandle;
|
|
262
|
+
try {
|
|
263
|
+
runHandle = await fileSystem.open(runPath, directoryFlags);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
if (hasErrorCode(error, "ENOENT")) {
|
|
267
|
+
cache.generations.delete(runId);
|
|
268
|
+
return { kind: "missing", runId };
|
|
269
|
+
}
|
|
270
|
+
logger.debug({ err: error, runId }, "dashboard run directory could not be opened");
|
|
271
|
+
return { kind: "unavailable", runId, reason: "path_rejected" };
|
|
272
|
+
}
|
|
273
|
+
try {
|
|
274
|
+
const identityA = await inspectInitiallyOpenedRunDirectory(runHandle, canonicalRoot, runPath);
|
|
275
|
+
const hookContext = { attempt, canonicalRunsRoot: canonicalRoot, runId };
|
|
276
|
+
await options.hooks?.afterDirectoryAdmission?.(hookContext);
|
|
277
|
+
const verifyCurrentDirectory = async () => {
|
|
278
|
+
let currentRunHandle;
|
|
279
|
+
try {
|
|
280
|
+
currentRunHandle = await fileSystem.open(runPath, directoryFlags);
|
|
281
|
+
}
|
|
282
|
+
catch {
|
|
283
|
+
throw new DashboardGenerationRaceError();
|
|
284
|
+
}
|
|
285
|
+
try {
|
|
286
|
+
const identityB = await inspectOpenedDirectory(currentRunHandle);
|
|
287
|
+
if (!directoryIdentitiesEqual(identityA, identityB)) {
|
|
288
|
+
throw new DashboardGenerationRaceError();
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
finally {
|
|
292
|
+
await currentRunHandle.close();
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
const verifyStateBeforeClose = async (stateHandle) => {
|
|
296
|
+
await options.hooks?.beforeCommitVerification?.(hookContext);
|
|
297
|
+
await verifyCurrentDirectory();
|
|
298
|
+
const currentStatePath = await stateHandle.resolveRealPath();
|
|
299
|
+
if (stateHandle.fingerprint.nlink === 0n ||
|
|
300
|
+
currentStatePath !== resolve(runPath, "state.json")) {
|
|
301
|
+
throw new DashboardGenerationRaceError();
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
const verifyRootStillCurrent = async () => {
|
|
305
|
+
await verifyCurrentDirectoryIdentity(fileSystem, canonicalRoot, directoryFlags, rootIdentity);
|
|
306
|
+
};
|
|
307
|
+
const unavailableAdmission = (sourceBytes, stateFingerprint) => ({
|
|
308
|
+
runGeneration: runGeneration(cache, runId, rootIdentity, identityA),
|
|
309
|
+
sourceBytes,
|
|
310
|
+
...(stateFingerprint === undefined ? {} : { stateFingerprint }),
|
|
311
|
+
directoryIdentity: identityA,
|
|
312
|
+
rootIdentity,
|
|
313
|
+
});
|
|
314
|
+
let stateRead;
|
|
315
|
+
try {
|
|
316
|
+
stateRead = await readStateFile(canonicalRoot, `${runId}/state.json`, {
|
|
317
|
+
wantBytes: true,
|
|
318
|
+
requireRegular: true,
|
|
319
|
+
maxBytes: maxStateBytes,
|
|
320
|
+
descriptorPathVerifier: verifyDescriptorPath,
|
|
321
|
+
requireExactRequestedPath: true,
|
|
322
|
+
beforeClose: verifyStateBeforeClose,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
catch (error) {
|
|
326
|
+
if (error instanceof DashboardGenerationRaceError)
|
|
327
|
+
throw error;
|
|
328
|
+
if (error instanceof ContainedFileChangedError) {
|
|
329
|
+
throw new DashboardGenerationRaceError();
|
|
330
|
+
}
|
|
331
|
+
if (hasErrorCode(error, "ENOENT")) {
|
|
332
|
+
return { kind: "missing", runId };
|
|
333
|
+
}
|
|
334
|
+
if (error instanceof ContainedFileTooLargeError) {
|
|
335
|
+
if (error.size !== undefined && error.fingerprint !== undefined) {
|
|
336
|
+
await verifyRootStillCurrent();
|
|
337
|
+
return unavailable(runId, "too_large_for_dashboard", unavailableAdmission(error.size, error.fingerprint));
|
|
338
|
+
}
|
|
339
|
+
await verifyCurrentDirectory();
|
|
340
|
+
await verifyRootStillCurrent();
|
|
341
|
+
return unavailable(runId, "state_unreadable", unavailableAdmission(0));
|
|
342
|
+
}
|
|
343
|
+
if (error instanceof ContainedFilePolicyError) {
|
|
344
|
+
await verifyCurrentDirectory();
|
|
345
|
+
await verifyRootStillCurrent();
|
|
346
|
+
return unavailable(runId, "path_rejected", unavailableAdmission(0));
|
|
347
|
+
}
|
|
348
|
+
logger.debug({ err: error, runId }, "dashboard state could not be read");
|
|
349
|
+
await verifyCurrentDirectory();
|
|
350
|
+
await verifyRootStillCurrent();
|
|
351
|
+
return unavailable(runId, "state_unreadable", unavailableAdmission(0));
|
|
352
|
+
}
|
|
353
|
+
await verifyRootStillCurrent();
|
|
354
|
+
let rawState;
|
|
355
|
+
try {
|
|
356
|
+
rawState = JSON.parse(stateRead.bytes.toString("utf-8"));
|
|
357
|
+
}
|
|
358
|
+
catch {
|
|
359
|
+
return unavailable(runId, "state_invalid", unavailableAdmission(stateRead.size, stateRead.fingerprint));
|
|
360
|
+
}
|
|
361
|
+
const decoded = parseDashboardRunState(rawState, runId);
|
|
362
|
+
if (!decoded.ok) {
|
|
363
|
+
return unavailable(runId, decoded.reason, unavailableAdmission(stateRead.size, stateRead.fingerprint));
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
kind: "admitted",
|
|
367
|
+
runId,
|
|
368
|
+
runGeneration: runGeneration(cache, runId, rootIdentity, identityA),
|
|
369
|
+
state: decoded.state,
|
|
370
|
+
sourceBytes: stateRead.size,
|
|
371
|
+
stateFingerprint: stateRead.fingerprint,
|
|
372
|
+
directoryIdentity: identityA,
|
|
373
|
+
rootIdentity,
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
finally {
|
|
377
|
+
await runHandle.close();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
finally {
|
|
381
|
+
await rootHandle.close();
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return {
|
|
385
|
+
async read(runsRoot, runId) {
|
|
386
|
+
try {
|
|
387
|
+
validateRunId(runId);
|
|
388
|
+
}
|
|
389
|
+
catch {
|
|
390
|
+
return { kind: "unavailable", runId, reason: "path_rejected" };
|
|
391
|
+
}
|
|
392
|
+
for (const attempt of [1, 2]) {
|
|
393
|
+
try {
|
|
394
|
+
return await readAttempt(runsRoot, runId, attempt);
|
|
395
|
+
}
|
|
396
|
+
catch (error) {
|
|
397
|
+
if (!(error instanceof DashboardGenerationRaceError)) {
|
|
398
|
+
logger.warn({ err: error, runId }, "dashboard run admission failed unexpectedly");
|
|
399
|
+
return { kind: "unavailable", runId, reason: "state_unreadable" };
|
|
400
|
+
}
|
|
401
|
+
if (attempt === 2) {
|
|
402
|
+
return unavailable(runId, "run_generation_race", options.includeUnavailableAdmissionMetadata === true
|
|
403
|
+
? await admitUnavailableDirectory(runsRoot, runId)
|
|
404
|
+
: undefined);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return { kind: "unavailable", runId, reason: "run_generation_race" };
|
|
409
|
+
},
|
|
410
|
+
async inspectDirectoryIdentity(runsRoot, runId) {
|
|
411
|
+
try {
|
|
412
|
+
validateRunId(runId);
|
|
413
|
+
}
|
|
414
|
+
catch {
|
|
415
|
+
return { kind: "missing" };
|
|
416
|
+
}
|
|
417
|
+
return await inspectCurrentDirectoryIdentity(runsRoot, runId);
|
|
418
|
+
},
|
|
419
|
+
async inspectGeneration(runsRoot, runId) {
|
|
420
|
+
try {
|
|
421
|
+
validateRunId(runId);
|
|
422
|
+
}
|
|
423
|
+
catch {
|
|
424
|
+
return { kind: "missing" };
|
|
425
|
+
}
|
|
426
|
+
const admission = await admitUnavailableDirectory(runsRoot, runId);
|
|
427
|
+
return admission === undefined
|
|
428
|
+
? { kind: "missing" }
|
|
429
|
+
: { kind: "present", runGeneration: admission.runGeneration };
|
|
430
|
+
},
|
|
431
|
+
forget(runsRoot, runId) {
|
|
432
|
+
rootCache.get(resolve(runsRoot))?.generations.delete(runId);
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
const defaultDashboardRunReader = createDashboardRunReader();
|
|
437
|
+
export async function readDashboardRun(runsRoot, runId) {
|
|
438
|
+
return await defaultDashboardRunReader.read(runsRoot, runId);
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=read-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read-model.js","sourceRoot":"","sources":["../../src/dashboard/read-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,WAAW,EAAoB,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAmB,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,GAG5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,iCAAiC,IAAI,4CAA4C,EAAE,MAAM,cAAc,CAAC;AACjH,OAAO,EACL,sBAAsB,GAEvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAE9D,MAAM,CAAC,MAAM,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