@llblab/pi-kit 0.38.4 → 0.39.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 +5 -0
- package/README.md +1 -1
- package/node_modules/@llblab/pi-actors/AGENTS.md +108 -20
- package/node_modules/@llblab/pi-actors/BACKLOG.md +207 -4
- package/node_modules/@llblab/pi-actors/CHANGELOG.md +13 -0
- package/node_modules/@llblab/pi-actors/README.md +31 -1
- package/node_modules/@llblab/pi-actors/dist/index.js +1 -1
- package/node_modules/@llblab/pi-actors/dist/lib/async-runs.d.ts +37 -0
- package/node_modules/@llblab/pi-actors/dist/lib/async-runs.js +131 -62
- package/node_modules/@llblab/pi-actors/dist/lib/automatic-review-runtime.d.ts +2 -0
- package/node_modules/@llblab/pi-actors/dist/lib/automatic-review-runtime.js +3 -2
- package/node_modules/@llblab/pi-actors/dist/lib/command-templates.d.ts +37 -0
- package/node_modules/@llblab/pi-actors/dist/lib/command-templates.js +263 -129
- package/node_modules/@llblab/pi-actors/dist/lib/execution-files.d.ts +32 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution-files.js +128 -0
- package/node_modules/@llblab/pi-actors/dist/lib/execution-output.js +5 -4
- package/node_modules/@llblab/pi-actors/dist/lib/execution-sessions.d.ts +19 -1
- package/node_modules/@llblab/pi-actors/dist/lib/execution-sessions.js +62 -26
- package/node_modules/@llblab/pi-actors/dist/lib/execution.d.ts +4 -1
- package/node_modules/@llblab/pi-actors/dist/lib/execution.js +6 -1
- package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.d.ts +9 -2
- package/node_modules/@llblab/pi-actors/dist/lib/extension-runtime.js +92 -14
- package/node_modules/@llblab/pi-actors/dist/lib/file-state.js +21 -2
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-command.js +2 -2
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-overlay.d.ts +25 -7
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-overlay.js +562 -262
- package/node_modules/@llblab/pi-actors/dist/lib/inspector.d.ts +20 -10
- package/node_modules/@llblab/pi-actors/dist/lib/inspector.js +80 -91
- package/node_modules/@llblab/pi-actors/dist/lib/limits.d.ts +1 -0
- package/node_modules/@llblab/pi-actors/dist/lib/limits.js +1 -0
- package/node_modules/@llblab/pi-actors/dist/lib/observability.d.ts +15 -1
- package/node_modules/@llblab/pi-actors/dist/lib/observability.js +216 -99
- package/node_modules/@llblab/pi-actors/dist/lib/pi.d.ts +5 -4
- package/node_modules/@llblab/pi-actors/dist/lib/pi.js +64 -10
- package/node_modules/@llblab/pi-actors/dist/lib/recipe-projection.d.ts +18 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipe-projection.js +220 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-context.d.ts +2 -0
- package/node_modules/@llblab/pi-actors/dist/lib/recipes-context.js +30 -6
- package/node_modules/@llblab/pi-actors/dist/lib/registry.js +270 -36
- package/node_modules/@llblab/pi-actors/dist/lib/run-delivery.d.ts +213 -5
- package/node_modules/@llblab/pi-actors/dist/lib/run-delivery.js +1909 -40
- package/node_modules/@llblab/pi-actors/dist/lib/run-supervision.d.ts +107 -0
- package/node_modules/@llblab/pi-actors/dist/lib/run-supervision.js +412 -0
- package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.d.ts +9 -2
- package/node_modules/@llblab/pi-actors/dist/lib/run-ui-runtime.js +283 -60
- package/node_modules/@llblab/pi-actors/dist/lib/runs-artifacts.d.ts +26 -1
- package/node_modules/@llblab/pi-actors/dist/lib/runs-artifacts.js +68 -2
- package/node_modules/@llblab/pi-actors/dist/lib/runs-context-exports.d.ts +451 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-context-exports.js +2315 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-context-index.d.ts +97 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-context-index.js +368 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control-delivery.js +46 -7
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control.d.ts +78 -2
- package/node_modules/@llblab/pi-actors/dist/lib/runs-control.js +334 -2
- package/node_modules/@llblab/pi-actors/dist/lib/runs-controls.js +4 -1
- package/node_modules/@llblab/pi-actors/dist/lib/runs-descendant-launches.d.ts +80 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-descendant-launches.js +287 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-execution-evidence.d.ts +110 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-execution-evidence.js +282 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-index.d.ts +66 -1
- package/node_modules/@llblab/pi-actors/dist/lib/runs-index.js +349 -13
- package/node_modules/@llblab/pi-actors/dist/lib/runs-native-launches.d.ts +73 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-native-launches.js +227 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-outcomes.d.ts +141 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-outcomes.js +292 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-ownership.d.ts +10 -1
- package/node_modules/@llblab/pi-actors/dist/lib/runs-ownership.js +36 -4
- package/node_modules/@llblab/pi-actors/dist/lib/runs-process-windows-mi.d.ts +46 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-process-windows-mi.js +114 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-process.d.ts +34 -1
- package/node_modules/@llblab/pi-actors/dist/lib/runs-process.js +158 -26
- package/node_modules/@llblab/pi-actors/dist/lib/runs-results.d.ts +116 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-results.js +518 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-retention.d.ts +15 -2
- package/node_modules/@llblab/pi-actors/dist/lib/runs-retention.js +148 -9
- package/node_modules/@llblab/pi-actors/dist/lib/runs-session-exports.d.ts +95 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-session-exports.js +470 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-snapshot.d.ts +58 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-snapshot.js +92 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-start.d.ts +2 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-start.js +44 -3
- package/node_modules/@llblab/pi-actors/dist/lib/runs-status.d.ts +15 -1
- package/node_modules/@llblab/pi-actors/dist/lib/runs-status.js +337 -13
- package/node_modules/@llblab/pi-actors/dist/lib/runs-supervision.d.ts +105 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-supervision.js +501 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-trace.d.ts +1 -0
- package/node_modules/@llblab/pi-actors/dist/lib/runs-trace.js +14 -3
- package/node_modules/@llblab/pi-actors/dist/lib/runtime.js +22 -3
- package/node_modules/@llblab/pi-actors/dist/lib/session-evidence.d.ts +37 -0
- package/node_modules/@llblab/pi-actors/dist/lib/session-evidence.js +59 -3
- package/node_modules/@llblab/pi-actors/dist/lib/state-readers.d.ts +4 -1
- package/node_modules/@llblab/pi-actors/dist/lib/state-readers.js +14 -8
- package/node_modules/@llblab/pi-actors/dist/lib/temp.d.ts +2 -4
- package/node_modules/@llblab/pi-actors/dist/lib/temp.js +4 -56
- package/node_modules/@llblab/pi-actors/dist/lib/tools-access.d.ts +3 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-access.js +13 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-inspect.d.ts +1 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-inspect.js +110 -43
- package/node_modules/@llblab/pi-actors/dist/lib/tools-local.d.ts +3 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-local.js +18 -6
- package/node_modules/@llblab/pi-actors/dist/lib/tools-message.d.ts +4 -1
- package/node_modules/@llblab/pi-actors/dist/lib/tools-message.js +126 -31
- package/node_modules/@llblab/pi-actors/dist/lib/tools-response.d.ts +31 -3
- package/node_modules/@llblab/pi-actors/dist/lib/tools-response.js +311 -47
- package/node_modules/@llblab/pi-actors/dist/lib/tools-spawn.d.ts +3 -0
- package/node_modules/@llblab/pi-actors/dist/lib/tools-spawn.js +29 -7
- package/node_modules/@llblab/pi-actors/dist/lib/trace-projection.d.ts +20 -0
- package/node_modules/@llblab/pi-actors/dist/lib/trace-projection.js +192 -43
- package/node_modules/@llblab/pi-actors/dist/scripts/async-runner.mjs +272 -194
- package/node_modules/@llblab/pi-actors/dist/scripts/conformance.mjs +14 -2
- package/node_modules/@llblab/pi-actors/dist/skills/actors/SKILL.md +46 -2
- package/node_modules/@llblab/pi-actors/dist/skills/actors/references/diagnostics.md +40 -0
- package/node_modules/@llblab/pi-actors/dist/skills/actors/references/runs.md +55 -1
- package/node_modules/@llblab/pi-actors/docs/README.md +9 -1
- package/node_modules/@llblab/pi-actors/docs/actor-inspector.md +84 -15
- package/node_modules/@llblab/pi-actors/docs/agent-experience.md +216 -0
- package/node_modules/@llblab/pi-actors/docs/async-runs.md +18 -2
- package/node_modules/@llblab/pi-actors/docs/composition-transport.md +103 -0
- package/node_modules/@llblab/pi-actors/docs/coordinator-delivery.md +204 -4
- package/node_modules/@llblab/pi-actors/docs/inspection.md +38 -2
- package/node_modules/@llblab/pi-actors/docs/output-projection-map.md +130 -0
- package/node_modules/@llblab/pi-actors/docs/releasing.md +19 -2
- package/node_modules/@llblab/pi-actors/docs/run-supervision.md +1622 -0
- package/node_modules/@llblab/pi-actors/docs/template-recipes.md +4 -0
- package/node_modules/@llblab/pi-actors/docs/windows-process-observation.md +248 -0
- package/node_modules/@llblab/pi-actors/index.ts +1 -1
- package/node_modules/@llblab/pi-actors/lib/async-runs.ts +164 -73
- package/node_modules/@llblab/pi-actors/lib/automatic-review-runtime.ts +4 -2
- package/node_modules/@llblab/pi-actors/lib/command-templates.ts +287 -138
- package/node_modules/@llblab/pi-actors/lib/execution-files.ts +118 -0
- package/node_modules/@llblab/pi-actors/lib/execution-output.ts +4 -4
- package/node_modules/@llblab/pi-actors/lib/execution-sessions.ts +57 -27
- package/node_modules/@llblab/pi-actors/lib/execution.ts +8 -0
- package/node_modules/@llblab/pi-actors/lib/extension-runtime.ts +102 -12
- package/node_modules/@llblab/pi-actors/lib/file-state.ts +16 -2
- package/node_modules/@llblab/pi-actors/lib/inspector-command.ts +2 -2
- package/node_modules/@llblab/pi-actors/lib/inspector-overlay.ts +524 -261
- package/node_modules/@llblab/pi-actors/lib/inspector.ts +101 -130
- package/node_modules/@llblab/pi-actors/lib/limits.ts +1 -0
- package/node_modules/@llblab/pi-actors/lib/observability.ts +235 -116
- package/node_modules/@llblab/pi-actors/lib/pi.ts +59 -11
- package/node_modules/@llblab/pi-actors/lib/recipe-projection.ts +232 -0
- package/node_modules/@llblab/pi-actors/lib/recipes-context.ts +27 -6
- package/node_modules/@llblab/pi-actors/lib/registry.ts +266 -36
- package/node_modules/@llblab/pi-actors/lib/run-delivery.ts +1737 -49
- package/node_modules/@llblab/pi-actors/lib/run-supervision.ts +411 -0
- package/node_modules/@llblab/pi-actors/lib/run-ui-runtime.ts +237 -73
- package/node_modules/@llblab/pi-actors/lib/runs-artifacts.ts +73 -1
- package/node_modules/@llblab/pi-actors/lib/runs-context-exports.ts +1871 -0
- package/node_modules/@llblab/pi-actors/lib/runs-context-index.ts +372 -0
- package/node_modules/@llblab/pi-actors/lib/runs-control-delivery.ts +36 -18
- package/node_modules/@llblab/pi-actors/lib/runs-control.ts +297 -1
- package/node_modules/@llblab/pi-actors/lib/runs-controls.ts +3 -1
- package/node_modules/@llblab/pi-actors/lib/runs-descendant-launches.ts +338 -0
- package/node_modules/@llblab/pi-actors/lib/runs-execution-evidence.ts +302 -0
- package/node_modules/@llblab/pi-actors/lib/runs-index.ts +345 -17
- package/node_modules/@llblab/pi-actors/lib/runs-native-launches.ts +270 -0
- package/node_modules/@llblab/pi-actors/lib/runs-outcomes.ts +377 -0
- package/node_modules/@llblab/pi-actors/lib/runs-ownership.ts +37 -4
- package/node_modules/@llblab/pi-actors/lib/runs-process-windows-mi.ts +113 -0
- package/node_modules/@llblab/pi-actors/lib/runs-process.ts +210 -34
- package/node_modules/@llblab/pi-actors/lib/runs-results.ts +601 -0
- package/node_modules/@llblab/pi-actors/lib/runs-retention.ts +134 -10
- package/node_modules/@llblab/pi-actors/lib/runs-session-exports.ts +406 -0
- package/node_modules/@llblab/pi-actors/lib/runs-snapshot.ts +143 -0
- package/node_modules/@llblab/pi-actors/lib/runs-start.ts +44 -2
- package/node_modules/@llblab/pi-actors/lib/runs-status.ts +252 -10
- package/node_modules/@llblab/pi-actors/lib/runs-supervision.ts +394 -0
- package/node_modules/@llblab/pi-actors/lib/runs-trace.ts +14 -3
- package/node_modules/@llblab/pi-actors/lib/runtime.ts +22 -3
- package/node_modules/@llblab/pi-actors/lib/session-evidence.ts +76 -4
- package/node_modules/@llblab/pi-actors/lib/state-readers.ts +16 -7
- package/node_modules/@llblab/pi-actors/lib/temp.ts +3 -56
- package/node_modules/@llblab/pi-actors/lib/tools-access.ts +13 -0
- package/node_modules/@llblab/pi-actors/lib/tools-inspect.ts +110 -51
- package/node_modules/@llblab/pi-actors/lib/tools-local.ts +37 -24
- package/node_modules/@llblab/pi-actors/lib/tools-message.ts +120 -37
- package/node_modules/@llblab/pi-actors/lib/tools-response.ts +273 -50
- package/node_modules/@llblab/pi-actors/lib/tools-spawn.ts +31 -10
- package/node_modules/@llblab/pi-actors/lib/trace-projection.ts +165 -42
- package/node_modules/@llblab/pi-actors/package.json +10 -6
- package/node_modules/@llblab/pi-actors/scripts/async-runner.mjs +272 -194
- package/node_modules/@llblab/pi-actors/scripts/conformance.mjs +14 -2
- package/node_modules/@llblab/pi-actors/skills/actors/SKILL.md +46 -2
- package/node_modules/@llblab/pi-actors/skills/actors/references/diagnostics.md +40 -0
- package/node_modules/@llblab/pi-actors/skills/actors/references/runs.md +55 -1
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +2 -2
- package/node_modules/@llblab/pi-actors/banner.jpg +0 -0
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-actions.d.ts +0 -16
- package/node_modules/@llblab/pi-actors/dist/lib/inspector-actions.js +0 -57
- package/node_modules/@llblab/pi-actors/lib/inspector-actions.ts +0 -79
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owned-generation execution evidence and explicit kernel source selection.
|
|
3
|
+
* Owns: data-only manifest projection, recorded capture/session reference admission and checked canonical runner stream input.
|
|
4
|
+
* Excludes: raw-body exposure permission, session discovery, primary-source completeness, producer/work authority and native closure.
|
|
5
|
+
*/
|
|
6
|
+
import { lstatSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
import { observeExecutionFileReference, readExecutionRunnerStreamText } from "./execution-files.js";
|
|
9
|
+
import { createRunRecipeEvidenceRedactor } from "./recipe-projection.js";
|
|
10
|
+
import { readRunContextIdentity, RUN_CONTEXT_SOURCE_METADATA_MAX_BYTES } from "./runs-context-index.js";
|
|
11
|
+
import { readJsonFileResilient } from "./state-readers.js";
|
|
12
|
+
function manifestField(value, key) { return Object.hasOwn(value, key) ? value[key] : undefined; }
|
|
13
|
+
function count(value) { return typeof value === "number" && Number.isSafeInteger(value) && value >= 0; }
|
|
14
|
+
function code(value) { return typeof value === "number" && Number.isSafeInteger(value); }
|
|
15
|
+
function timestamp(value) {
|
|
16
|
+
const time = typeof value === "string" ? Date.parse(value) : NaN;
|
|
17
|
+
return Number.isSafeInteger(time) && new Date(time).toISOString() === value;
|
|
18
|
+
}
|
|
19
|
+
function capture(value) {
|
|
20
|
+
const source = record(value);
|
|
21
|
+
if (!source)
|
|
22
|
+
return undefined;
|
|
23
|
+
const saved = manifestField(source, "bytes");
|
|
24
|
+
const observed = manifestField(source, "bytes_observed");
|
|
25
|
+
const complete = manifestField(source, "complete");
|
|
26
|
+
const error = manifestField(source, "error");
|
|
27
|
+
if ((saved !== null && !count(saved)) || (observed !== undefined && !count(observed)) ||
|
|
28
|
+
(complete !== undefined && typeof complete !== "boolean") || (error !== undefined && error !== "capture_write_failed") ||
|
|
29
|
+
(typeof saved === "number" && typeof observed === "number" && saved > observed) || (error !== undefined && complete !== false))
|
|
30
|
+
return undefined;
|
|
31
|
+
return Object.freeze({ reported_saved_bytes: saved,
|
|
32
|
+
persistence: complete === false ? "incomplete" : saved === null ? "unproven" : "reported_complete",
|
|
33
|
+
...(typeof observed === "number" ? { reported_observed_bytes: observed } : {}), ...(error ? { error } : {}) });
|
|
34
|
+
}
|
|
35
|
+
function attempt(value, ordinal) {
|
|
36
|
+
const source = record(value);
|
|
37
|
+
if (!source || manifestField(source, "attempt") !== ordinal || !code(manifestField(source, "code")))
|
|
38
|
+
return undefined;
|
|
39
|
+
const nativeCode = manifestField(source, "native_exit_code");
|
|
40
|
+
const signal = manifestField(source, "native_signal");
|
|
41
|
+
const killed = manifestField(source, "killed");
|
|
42
|
+
if ((nativeCode !== undefined && nativeCode !== null && !code(nativeCode)) ||
|
|
43
|
+
(signal !== undefined && (typeof signal !== "string" || !/^SIG[A-Z0-9]{1,31}$/u.test(signal))) ||
|
|
44
|
+
(killed !== undefined && typeof killed !== "boolean"))
|
|
45
|
+
return undefined;
|
|
46
|
+
const stdout = capture(manifestField(source, "stdout"));
|
|
47
|
+
const stderr = capture(manifestField(source, "stderr"));
|
|
48
|
+
if (!stdout || !stderr)
|
|
49
|
+
return undefined;
|
|
50
|
+
return Object.freeze({ attempt: ordinal, code: source.code, stdout, stderr,
|
|
51
|
+
...(nativeCode !== undefined ? { native_exit_code: nativeCode } : {}),
|
|
52
|
+
...(typeof signal === "string" ? { native_signal: signal } : {}),
|
|
53
|
+
...(typeof killed === "boolean" ? { reported_killed: killed } : {}) });
|
|
54
|
+
}
|
|
55
|
+
/** Already-captured metadata is data, never a reconstructed producer/work/close capability. */
|
|
56
|
+
export function projectRunExecutionManifest(expected, value, recipe = {}, redactEvidence) {
|
|
57
|
+
const invalid = () => Object.freeze({ state: "unavailable", reason: "manifest_invalid" });
|
|
58
|
+
const identity = record(expected);
|
|
59
|
+
const source = record(value);
|
|
60
|
+
if (!identity || typeof manifestField(identity, "run") !== "string" || !identity.run ||
|
|
61
|
+
typeof manifestField(identity, "run_instance_id") !== "string" || !identity.run_instance_id || !source || manifestField(source, "version") !== 1)
|
|
62
|
+
return invalid();
|
|
63
|
+
if (manifestField(source, "run") !== expected.run || manifestField(source, "run_instance_id") !== expected.run_instance_id) {
|
|
64
|
+
return Object.freeze({ state: "unavailable", reason: "identity_mismatch" });
|
|
65
|
+
}
|
|
66
|
+
const status = manifestField(source, "status");
|
|
67
|
+
const updated = manifestField(source, "updated_at");
|
|
68
|
+
const active = manifestField(source, "active_subagents");
|
|
69
|
+
const records = manifestField(source, "commands");
|
|
70
|
+
if (typeof status !== "string" || !["running", "stopping", "done", "failed"].includes(status) || !timestamp(updated) ||
|
|
71
|
+
!count(active) || !Array.isArray(records))
|
|
72
|
+
return invalid();
|
|
73
|
+
const redact = redactEvidence ?? createRunRecipeEvidenceRedactor(recipe);
|
|
74
|
+
const commands = [];
|
|
75
|
+
const ids = new Set();
|
|
76
|
+
let attemptsReported = 0;
|
|
77
|
+
for (const value of records) {
|
|
78
|
+
const command = record(value);
|
|
79
|
+
if (!command)
|
|
80
|
+
return invalid();
|
|
81
|
+
const id = manifestField(command, "id");
|
|
82
|
+
const state = manifestField(command, "status");
|
|
83
|
+
const rows = manifestField(command, "attempts");
|
|
84
|
+
if (typeof id !== "string" || !/^command-[0-9]{3,}$/u.test(id) || !count(Number(id.slice(8))) || Number(id.slice(8)) === 0 || ids.has(id) ||
|
|
85
|
+
typeof state !== "string" || !["running", "done", "failed", "interrupted"].includes(state) || !Array.isArray(rows))
|
|
86
|
+
return invalid();
|
|
87
|
+
ids.add(id);
|
|
88
|
+
const attempts = [];
|
|
89
|
+
for (const [index, row] of rows.entries()) {
|
|
90
|
+
const item = attempt(row, index + 1);
|
|
91
|
+
if (!item)
|
|
92
|
+
return invalid();
|
|
93
|
+
attempts.push(item);
|
|
94
|
+
}
|
|
95
|
+
const details = {};
|
|
96
|
+
for (const key of ["stage", "command", "label"]) {
|
|
97
|
+
const item = manifestField(command, key);
|
|
98
|
+
if (item !== undefined) {
|
|
99
|
+
if (typeof item !== "string")
|
|
100
|
+
return invalid();
|
|
101
|
+
details[key] = redact(item);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (const key of ["occurrence", "branch_index", "prompt_bytes"]) {
|
|
105
|
+
const item = manifestField(command, key);
|
|
106
|
+
if (item !== undefined) {
|
|
107
|
+
if (!count(item) || (key === "occurrence" && item === 0))
|
|
108
|
+
return invalid();
|
|
109
|
+
details[key] = item;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const key of ["started_at", "completed_at"]) {
|
|
113
|
+
const item = manifestField(command, key);
|
|
114
|
+
if (item !== undefined) {
|
|
115
|
+
if (!timestamp(item))
|
|
116
|
+
return invalid();
|
|
117
|
+
details[key] = item;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
for (const key of ["exit_code", "effective_exit_code", "native_exit_code"]) {
|
|
121
|
+
const item = manifestField(command, key);
|
|
122
|
+
if (item !== undefined) {
|
|
123
|
+
if (!(key === "native_exit_code" && item === null) && !code(item))
|
|
124
|
+
return invalid();
|
|
125
|
+
details[key] = item;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const semantic = manifestField(command, "semantic_acceptance");
|
|
129
|
+
if (semantic !== undefined) {
|
|
130
|
+
if (typeof semantic !== "string" || !["pending", "accepted", "rejected", "not_required", "unavailable"].includes(semantic))
|
|
131
|
+
return invalid();
|
|
132
|
+
details.semantic_acceptance = semantic;
|
|
133
|
+
}
|
|
134
|
+
const killed = manifestField(command, "killed");
|
|
135
|
+
if (killed !== undefined) {
|
|
136
|
+
if (typeof killed !== "boolean")
|
|
137
|
+
return invalid();
|
|
138
|
+
details.reported_killed = killed;
|
|
139
|
+
}
|
|
140
|
+
const sessions = manifestField(command, "session_files");
|
|
141
|
+
if (sessions !== undefined) {
|
|
142
|
+
if (!Array.isArray(sessions) || sessions.some(file => typeof file !== "string"))
|
|
143
|
+
return invalid();
|
|
144
|
+
details.reported_session_file_count = sessions.length;
|
|
145
|
+
}
|
|
146
|
+
const interruption = record(manifestField(command, "interruption"));
|
|
147
|
+
const message = interruption ? manifestField(interruption, "message") : undefined;
|
|
148
|
+
if (typeof message === "string")
|
|
149
|
+
details.interruption = redact(message);
|
|
150
|
+
commands.push(Object.freeze({ id, reported_status: state, attempts: Object.freeze(attempts), ...details }));
|
|
151
|
+
attemptsReported += attempts.length;
|
|
152
|
+
}
|
|
153
|
+
return Object.freeze({ state: "available", view: Object.freeze({ reported_status: status, updated_at: updated,
|
|
154
|
+
reported_active_subagents: active, commands_total: commands.length, settled_attempts_reported: attemptsReported,
|
|
155
|
+
commands: Object.freeze(commands) }) });
|
|
156
|
+
}
|
|
157
|
+
function streamUnavailable(reason) { return Object.freeze({ state: "unavailable", reason }); }
|
|
158
|
+
/** Never serialize this raw source as tool/model evidence: an export owner still owes a fixed privacy projection. */
|
|
159
|
+
export function readRunStreamSource(stateDir, expected, stream) {
|
|
160
|
+
if (stream !== "stdout" && stream !== "stderr")
|
|
161
|
+
return streamUnavailable("stream_invalid");
|
|
162
|
+
const owner = readRunContextIdentity(stateDir, expected);
|
|
163
|
+
if (owner.state === "unavailable")
|
|
164
|
+
return owner;
|
|
165
|
+
const source = readExecutionRunnerStreamText(owner.local_path, stream);
|
|
166
|
+
if (!owner.unchanged())
|
|
167
|
+
return streamUnavailable("observation_changed");
|
|
168
|
+
if (source.availability === "unavailable")
|
|
169
|
+
return streamUnavailable(source.reason === "reference_changed" ? "observation_changed"
|
|
170
|
+
: source.reason === "reference_missing" ? "stream_missing" : source.reason === "reference_too_large" ? "stream_too_large"
|
|
171
|
+
: source.reason === "reference_invalid_text" ? "stream_invalid_text" : "stream_unavailable");
|
|
172
|
+
const { reference, text } = source;
|
|
173
|
+
const unchanged = () => owner.unchanged() && reference.unchanged();
|
|
174
|
+
if (!unchanged())
|
|
175
|
+
return streamUnavailable("observation_changed");
|
|
176
|
+
return Object.freeze({ state: "available", identity: owner.identity, stream, source_scope: "canonical_runner_stream",
|
|
177
|
+
visibility: "kernel_only", capture_completeness: "not_asserted", bytes_total: reference.bytes_total, text, unchanged });
|
|
178
|
+
}
|
|
179
|
+
function unavailable(reason) { return Object.freeze({ state: "unavailable", reason }); }
|
|
180
|
+
function record(value) {
|
|
181
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
182
|
+
}
|
|
183
|
+
function own(value, key) { return Object.getOwnPropertyDescriptor(value, key)?.value; }
|
|
184
|
+
function request(value) {
|
|
185
|
+
const source = record(value);
|
|
186
|
+
if (!source)
|
|
187
|
+
return undefined;
|
|
188
|
+
const kind = own(source, "kind");
|
|
189
|
+
const command = own(source, "command_id");
|
|
190
|
+
if (typeof command !== "string" || !/^command-[0-9]{3,}$/u.test(command) || !Number.isSafeInteger(Number(command.slice(8))) || Number(command.slice(8)) < 1)
|
|
191
|
+
return undefined;
|
|
192
|
+
if (kind === "capture") {
|
|
193
|
+
const attempt = own(source, "attempt");
|
|
194
|
+
const stream = own(source, "stream");
|
|
195
|
+
return typeof attempt === "number" && Number.isSafeInteger(attempt) && attempt > 0 && (stream === "stdout" || stream === "stderr") &&
|
|
196
|
+
Object.keys(source).every(key => ["kind", "command_id", "attempt", "stream"].includes(key))
|
|
197
|
+
? Object.freeze({ kind, command_id: command, attempt, stream }) : undefined;
|
|
198
|
+
}
|
|
199
|
+
const path = own(source, "path");
|
|
200
|
+
return kind === "session" && typeof path === "string" && path.length > 0 && Object.keys(source).every(key => ["kind", "command_id", "path"].includes(key))
|
|
201
|
+
? Object.freeze({ kind, command_id: command, path }) : undefined;
|
|
202
|
+
}
|
|
203
|
+
function sameFile(left, right) {
|
|
204
|
+
return right.isFile() && left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
|
|
205
|
+
}
|
|
206
|
+
/** Local paths and unchanged callbacks describe data only, never readable-body exposure or native capabilities. */
|
|
207
|
+
export function readRunExecutionReference(stateDir, expected, query) {
|
|
208
|
+
const selected = request(query);
|
|
209
|
+
if (!selected)
|
|
210
|
+
return unavailable("request_invalid");
|
|
211
|
+
const owner = readRunContextIdentity(stateDir, expected);
|
|
212
|
+
if (owner.state === "unavailable")
|
|
213
|
+
return unavailable(owner.reason);
|
|
214
|
+
const sourcePath = join(owner.local_path, "execution.json");
|
|
215
|
+
try {
|
|
216
|
+
let before;
|
|
217
|
+
try {
|
|
218
|
+
before = lstatSync(sourcePath, { bigint: true });
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
return unavailable(error.code === "ENOENT" ? "manifest_absent" : "manifest_unavailable");
|
|
222
|
+
}
|
|
223
|
+
if (!before.isFile() || before.size > BigInt(RUN_CONTEXT_SOURCE_METADATA_MAX_BYTES))
|
|
224
|
+
return unavailable("manifest_unavailable");
|
|
225
|
+
const captured = readJsonFileResilient(sourcePath, undefined, { maxBytes: RUN_CONTEXT_SOURCE_METADATA_MAX_BYTES, strictUtf8: true });
|
|
226
|
+
const sourceUnchanged = () => {
|
|
227
|
+
try {
|
|
228
|
+
return owner.unchanged() && sameFile(before, lstatSync(sourcePath, { bigint: true }));
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
if (!sourceUnchanged())
|
|
235
|
+
return unavailable("observation_changed");
|
|
236
|
+
if (captured.diagnostics.length)
|
|
237
|
+
return unavailable("manifest_invalid");
|
|
238
|
+
const projected = projectRunExecutionManifest(owner.identity, captured.value);
|
|
239
|
+
if (projected.state === "unavailable")
|
|
240
|
+
return unavailable(projected.reason === "identity_mismatch" ? "manifest_identity_mismatch" : "manifest_invalid");
|
|
241
|
+
const index = projected.view.commands.findIndex(command => command.id === selected.command_id);
|
|
242
|
+
if (index < 0)
|
|
243
|
+
return unavailable("reference_not_recorded");
|
|
244
|
+
const command = record(captured.value).commands[index];
|
|
245
|
+
const view = projected.view.commands[index];
|
|
246
|
+
let relative;
|
|
247
|
+
let capture;
|
|
248
|
+
if (selected.kind === "capture") {
|
|
249
|
+
const attempt = command.attempts[selected.attempt - 1];
|
|
250
|
+
const reported = record(attempt?.[selected.stream]);
|
|
251
|
+
if (!reported || !Object.hasOwn(reported, "path"))
|
|
252
|
+
return unavailable("reference_not_recorded");
|
|
253
|
+
relative = `captures/${selected.command_id}/attempt-${String(selected.attempt).padStart(3, "0")}/${selected.stream}.log`;
|
|
254
|
+
if (reported.path !== relative)
|
|
255
|
+
return unavailable("reference_invalid");
|
|
256
|
+
capture = view.attempts[selected.attempt - 1][selected.stream];
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
if (!Array.isArray(command.session_files) || !command.session_files.includes(selected.path))
|
|
260
|
+
return unavailable("reference_not_recorded");
|
|
261
|
+
relative = selected.path;
|
|
262
|
+
}
|
|
263
|
+
const observed = observeExecutionFileReference(owner.local_path, { kind: selected.kind, path: relative });
|
|
264
|
+
if (!sourceUnchanged())
|
|
265
|
+
return unavailable("observation_changed");
|
|
266
|
+
if (observed.availability === "unavailable")
|
|
267
|
+
return unavailable(observed.reason === "invalid_reference" ? "reference_invalid" : observed.reason);
|
|
268
|
+
if (!observed.unchanged())
|
|
269
|
+
return unavailable("reference_changed");
|
|
270
|
+
if (capture && capture.reported_saved_bytes !== null && capture.reported_saved_bytes !== observed.bytes_total)
|
|
271
|
+
return unavailable("capture_size_mismatch");
|
|
272
|
+
const base = { command_id: selected.command_id, path: observed.path, local_path: observed.local_path, bytes_total: observed.bytes_total, mutable: true };
|
|
273
|
+
const reference = selected.kind === "capture"
|
|
274
|
+
? Object.freeze({ ...base, kind: "capture", attempt: selected.attempt, stream: selected.stream, capture: capture })
|
|
275
|
+
: Object.freeze({ ...base, kind: "session" });
|
|
276
|
+
return Object.freeze({ state: "available", identity: owner.identity, source_updated_at: projected.view.updated_at,
|
|
277
|
+
reference, unchanged: () => sourceUnchanged() && observed.unchanged() });
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
return unavailable("manifest_unavailable");
|
|
281
|
+
}
|
|
282
|
+
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Async run state index.
|
|
3
|
-
* Owns:
|
|
3
|
+
* Owns: directory discovery, locked catalog registration/rebuild, same-session location navigation, and legacy inventory.
|
|
4
|
+
* Excludes: launch wiring, model delivery, work/native authority, and retained-generation storage.
|
|
4
5
|
*/
|
|
6
|
+
import { type RunContextIndexIdentity } from "./runs-context-index.ts";
|
|
5
7
|
export interface RunStateIndexEntry {
|
|
6
8
|
ownerId?: string;
|
|
7
9
|
recipe?: string;
|
|
8
10
|
run: string;
|
|
11
|
+
run_instance_id?: string;
|
|
9
12
|
state_dir: string;
|
|
10
13
|
status: string;
|
|
11
14
|
tool?: string;
|
|
@@ -22,6 +25,68 @@ export interface RunStateDiscoveryResult {
|
|
|
22
25
|
}
|
|
23
26
|
export declare function discoverRunStateDirs(stateRoot: string, maxDepth?: number): RunStateDiscoveryResult;
|
|
24
27
|
export declare function listRunStateDirs(stateRoot: string): string[];
|
|
28
|
+
/** Kernel metadata registration only; never a producer, work or visibility capability. */
|
|
29
|
+
export declare function registerRunStateDirectory(stateRoot: string, stateDir: string, status: Record<string, unknown>): void;
|
|
25
30
|
export declare function rebuildRunStateIndex(stateRoot: string, getRunStatus: RunStatusReader): RunStateIndexEntry[];
|
|
31
|
+
export interface RunNavigationFile {
|
|
32
|
+
readonly role: string;
|
|
33
|
+
readonly format_hint: "json" | "jsonl" | "text";
|
|
34
|
+
readonly state: "present" | "missing" | "unavailable";
|
|
35
|
+
readonly path: string | null;
|
|
36
|
+
readonly bytes_total?: number;
|
|
37
|
+
readonly mutable: true;
|
|
38
|
+
}
|
|
39
|
+
export interface RunNavigationItem {
|
|
40
|
+
readonly run: string;
|
|
41
|
+
readonly run_instance_id: string | null;
|
|
42
|
+
readonly state: "available" | "unavailable";
|
|
43
|
+
readonly directory: string | null;
|
|
44
|
+
readonly depth: number;
|
|
45
|
+
readonly files: readonly Readonly<RunNavigationFile>[];
|
|
46
|
+
readonly reason?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface RunNavigationPriority {
|
|
49
|
+
readonly root_order: "latest_registration" | "failed_subtrees_first";
|
|
50
|
+
/** Observed data for ordering only; exact map identity admission remains independent. */
|
|
51
|
+
readonly failed: readonly Readonly<RunContextIndexIdentity & {
|
|
52
|
+
state_dir: string;
|
|
53
|
+
}>[];
|
|
54
|
+
}
|
|
55
|
+
export type RunSessionNavigation = {
|
|
56
|
+
readonly state: "unavailable";
|
|
57
|
+
readonly reason: "session_unavailable" | "catalog_unavailable" | "response_too_large";
|
|
58
|
+
} | {
|
|
59
|
+
readonly state: "available";
|
|
60
|
+
readonly session_id: string;
|
|
61
|
+
readonly content_scope: "file_locations_only";
|
|
62
|
+
readonly lineage_scope: "direct_session_owned_rows";
|
|
63
|
+
readonly file_inventory_scope: "canonical_starting_locations";
|
|
64
|
+
readonly priority?: Readonly<{
|
|
65
|
+
root_order: RunNavigationPriority["root_order"];
|
|
66
|
+
basis: "observed_failed_rows";
|
|
67
|
+
}>;
|
|
68
|
+
readonly items: readonly Readonly<RunNavigationItem>[];
|
|
69
|
+
readonly shown: number;
|
|
70
|
+
readonly omitted: number;
|
|
71
|
+
readonly total: number;
|
|
72
|
+
};
|
|
73
|
+
export type RunDirectoryNavigation = {
|
|
74
|
+
readonly state: "unavailable";
|
|
75
|
+
readonly reason: "session_unavailable" | "session_mismatch" | "session_changed" | "identity_unavailable" | "identity_mismatch" | "observation_changed" | "navigation_unavailable" | "response_too_large";
|
|
76
|
+
} | {
|
|
77
|
+
readonly state: "available";
|
|
78
|
+
readonly content_scope: "file_locations_only";
|
|
79
|
+
readonly file_inventory_scope: "canonical_starting_locations";
|
|
80
|
+
readonly run: string;
|
|
81
|
+
readonly run_instance_id: string;
|
|
82
|
+
readonly directory: string;
|
|
83
|
+
readonly files: readonly Readonly<RunNavigationFile>[];
|
|
84
|
+
};
|
|
85
|
+
/** Pure data decoder for frozen location packets; schema validity never grants read/publication/work authority. */
|
|
86
|
+
export declare function decodeRunDirectoryNavigation(value: unknown): Readonly<RunDirectoryNavigation>;
|
|
87
|
+
/** One exact current-session Run's physical starting locations; no catalog/body reads or authority recovery. */
|
|
88
|
+
export declare function readRunDirectoryNavigation(stateDir: string, expected: unknown, sessionId: string | undefined): Readonly<RunDirectoryNavigation>;
|
|
89
|
+
/** Current Kernel session selection only; no body reads, scans, producer key or old manager retention. */
|
|
90
|
+
export declare function readRunSessionNavigation(stateRoot: string, sessionId: string, priority?: RunNavigationPriority): Readonly<RunSessionNavigation>;
|
|
26
91
|
export declare function readRunStateIndex(stateRoot: string, readJson: (path: string) => Record<string, unknown> | undefined): RunStateIndexEntry[] | undefined;
|
|
27
92
|
export declare function listRuns(stateRoot: string, getRunStatus: RunStatusReader, readJson: (path: string) => Record<string, unknown> | undefined, statusFilter?: string): Array<Record<string, unknown>>;
|