@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
|
@@ -10,15 +10,13 @@ import {
|
|
|
10
10
|
existsSync,
|
|
11
11
|
mkdirSync,
|
|
12
12
|
openSync,
|
|
13
|
-
readFileSync,
|
|
14
13
|
readdirSync,
|
|
15
14
|
rmSync,
|
|
16
15
|
statSync,
|
|
17
|
-
writeFileSync,
|
|
18
16
|
} from "node:fs";
|
|
19
17
|
import { basename, dirname, extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
20
18
|
import { fileURLToPath } from "node:url";
|
|
21
|
-
import { isDeepStrictEqual } from "node:util";
|
|
19
|
+
import { isDeepStrictEqual, types as UtilTypes } from "node:util";
|
|
22
20
|
|
|
23
21
|
import type {
|
|
24
22
|
CommandTemplateFailureScope,
|
|
@@ -37,33 +35,32 @@ import * as RecipesReferences from "./recipes-references.ts";
|
|
|
37
35
|
import * as RecipesUsage from "./recipes-usage.ts";
|
|
38
36
|
import * as Schema from "./schema.ts";
|
|
39
37
|
import {
|
|
40
|
-
resolveArtifactManifest,
|
|
41
38
|
resolveArtifactPaths,
|
|
42
39
|
type RunArtifactDeclaration,
|
|
43
|
-
type RunArtifactManifestEntry,
|
|
44
40
|
} from "./runs-artifacts.ts";
|
|
45
41
|
import { safeRunId } from "./runs-identity.ts";
|
|
42
|
+
import { recordRunDescendantLaunchIntentUnderLock, recordRunDescendantPreparationUnderLock, RUN_DESCENDANT_PREPARED_META_FILE, type RunDescendantLaunchIntent, type RunDescendantLaunchTarget, type RunDescendantPreparation } from "./runs-descendant-launches.ts";
|
|
43
|
+
import { RUN_OUTCOME_PROTOCOL } from "./runs-outcomes.ts";
|
|
46
44
|
import {
|
|
47
45
|
buildTerminalProgress,
|
|
48
|
-
getRunProcessSignalPlan,
|
|
49
46
|
markTerminalHandled,
|
|
50
47
|
signalOwnedRunProcess,
|
|
51
48
|
type RunProcessSignalPlan,
|
|
52
49
|
} from "./runs-control.ts";
|
|
53
|
-
import { claimRunStateDirectory } from "./runs-ownership.ts";
|
|
50
|
+
import { assertDistinctRunStateDirectories, assertOwnedRunStateDirectory, claimRunStateDirectory } from "./runs-ownership.ts";
|
|
51
|
+
import { reportRunProducerCleanupFailure, revalidateRunWorkAdmission, withRunWorkAdmission, type RunResultProducer } from "./runs-results.ts";
|
|
54
52
|
import {
|
|
55
|
-
|
|
56
|
-
archiveTerminalRun,
|
|
57
|
-
pruneTerminalRun,
|
|
58
|
-
type RunRetentionAction,
|
|
53
|
+
retainRun,
|
|
59
54
|
} from "./runs-retention.ts";
|
|
60
55
|
import {
|
|
61
|
-
|
|
56
|
+
captureSpawnedRunProcessIdentity,
|
|
62
57
|
verifyRunProcessIdentity,
|
|
63
58
|
type RunProcessIdentity,
|
|
64
59
|
} from "./runs-process.ts";
|
|
65
60
|
import * as RuntimeIdentity from "./runtime-identity.ts";
|
|
66
61
|
import * as RunsStart from "./runs-start.ts";
|
|
62
|
+
import { captureRunAdmissionSnapshotReferences, type RunSnapshotReferenceReader } from "./runs-context-exports.ts";
|
|
63
|
+
import * as RunSupervision from "./run-supervision.ts";
|
|
67
64
|
import { appendRunTraceEvent } from "./runs-trace.ts";
|
|
68
65
|
import * as RunsIndex from "./runs-index.ts";
|
|
69
66
|
import * as RunsParentTeardown from "./runs-parent-teardown.ts";
|
|
@@ -74,6 +71,7 @@ import {
|
|
|
74
71
|
} from "./runs-control-delivery.ts";
|
|
75
72
|
import {
|
|
76
73
|
buildRunStatus,
|
|
74
|
+
readRunInventoryStatuses,
|
|
77
75
|
tailFile,
|
|
78
76
|
type AsyncRunStatus,
|
|
79
77
|
} from "./runs-status.ts";
|
|
@@ -165,6 +163,9 @@ export type { AsyncRunStatus } from "./runs-status.ts";
|
|
|
165
163
|
export interface AsyncRunMeta {
|
|
166
164
|
argv: string[];
|
|
167
165
|
createdAt: string;
|
|
166
|
+
started_at?: string;
|
|
167
|
+
supervision?: RunSupervision.RunSupervisionState;
|
|
168
|
+
supervision_provenance?: RunSupervision.ResolvedRunSupervisionPolicy["provenance"];
|
|
168
169
|
cwd: string;
|
|
169
170
|
launch_kind?: AsyncRunLaunchSource;
|
|
170
171
|
launch_source?: AsyncRunLaunchSource;
|
|
@@ -180,6 +181,7 @@ export interface AsyncRunMeta {
|
|
|
180
181
|
run_instance_id: string;
|
|
181
182
|
state_dir: string;
|
|
182
183
|
state_schema: typeof RuntimeIdentity.RUN_STATE_SCHEMA;
|
|
184
|
+
outcome_protocol?: typeof RUN_OUTCOME_PROTOCOL;
|
|
183
185
|
status: AsyncRunStatus;
|
|
184
186
|
tool?: string;
|
|
185
187
|
template: CommandTemplateValue;
|
|
@@ -199,6 +201,10 @@ export interface AsyncRunMeta {
|
|
|
199
201
|
singleton_recipe_id?: string;
|
|
200
202
|
singleton_values?: Record<string, unknown>;
|
|
201
203
|
transport_context?: Record<string, unknown>;
|
|
204
|
+
/** Launch-return observation only; never persisted Run truth or a navigation/read capability. */
|
|
205
|
+
catalog_registration?: Readonly<{ state: "unavailable"; reason: "catalog_registration_failed" }>;
|
|
206
|
+
/** Original Kernel-local cause, non-enumerable on the return object and excluded from tool details/JSON. */
|
|
207
|
+
catalog_registration_error?: unknown;
|
|
202
208
|
}
|
|
203
209
|
|
|
204
210
|
const DEFAULT_STATE_ROOT = Paths.getRunStateRoot();
|
|
@@ -275,6 +281,7 @@ function reuseCompatibleSingletonRun(
|
|
|
275
281
|
stateDir: string,
|
|
276
282
|
startParams: AsyncRunStartParams,
|
|
277
283
|
singletonValues: Record<string, unknown>,
|
|
284
|
+
supervisionPolicy: RunSupervision.RunSupervisionPolicy,
|
|
278
285
|
): AsyncRunMeta | undefined {
|
|
279
286
|
const existing = RunsStart.readActiveOwnedRunState(
|
|
280
287
|
stateDir,
|
|
@@ -293,6 +300,13 @@ function reuseCompatibleSingletonRun(
|
|
|
293
300
|
`Active singleton Run ${String(existing.run ?? stateDir)} has incompatible Recipe identity, owner, startup values, or Control contract. Stop it before changing singleton configuration.`,
|
|
294
301
|
);
|
|
295
302
|
}
|
|
303
|
+
const clock = RunSupervision.readRunSupervisionClock(existing);
|
|
304
|
+
const existingPolicy = clock?.supervision ?? RunSupervision.resolveRunSupervisionPolicy();
|
|
305
|
+
if (!RunSupervision.sameRunSupervisionPolicy(existingPolicy, supervisionPolicy)) {
|
|
306
|
+
throw new Error(
|
|
307
|
+
`Active singleton Run ${String(existing.run ?? stateDir)} has incompatible supervision policy. Stop it before changing singleton configuration.`,
|
|
308
|
+
);
|
|
309
|
+
}
|
|
296
310
|
return {
|
|
297
311
|
...(existing as unknown as AsyncRunMeta),
|
|
298
312
|
...(startParams.launch_source
|
|
@@ -308,8 +322,21 @@ function reuseCompatibleSingletonRun(
|
|
|
308
322
|
};
|
|
309
323
|
}
|
|
310
324
|
|
|
325
|
+
export interface AsyncRunAdmissionClock {
|
|
326
|
+
readonly kind: "run_clock_origin_captured";
|
|
327
|
+
readonly visibility: "kernel_only";
|
|
328
|
+
readonly publication: "unpublished";
|
|
329
|
+
readonly work_started: false;
|
|
330
|
+
readonly identity: Readonly<{ run: string; run_instance_id: string; ownerId?: string }>;
|
|
331
|
+
readonly state_dir: string;
|
|
332
|
+
readonly clock: Readonly<RunSupervision.RunSupervisionClock>;
|
|
333
|
+
readonly origin: Readonly<RunSupervision.RunSupervisionTimeOrigin>;
|
|
334
|
+
readonly snapshot_references?: Readonly<RunSnapshotReferenceReader>;
|
|
335
|
+
}
|
|
311
336
|
export interface AsyncRunStartOptions {
|
|
312
337
|
skillContext?: RecipesReferences.ActiveSkillRecipeContext;
|
|
338
|
+
/** Ordinary fresh launches only: synchronously retain the exact origin; this is not a published/started Run receipt. */
|
|
339
|
+
onSupervisionClockCaptured?: (event: Readonly<AsyncRunAdmissionClock>) => void;
|
|
313
340
|
}
|
|
314
341
|
|
|
315
342
|
function resolveRecipeFile(
|
|
@@ -555,10 +582,67 @@ export function startRun(
|
|
|
555
582
|
cwd: string,
|
|
556
583
|
options: AsyncRunStartOptions = {},
|
|
557
584
|
): AsyncRunMeta {
|
|
585
|
+
const meta = startRunInternal(params, cwd, options);
|
|
586
|
+
// Internal return includes lifecycle release. Catalog failure must not retry or undo the accepted launch/attachment.
|
|
587
|
+
delete meta.catalog_registration;
|
|
588
|
+
delete meta.catalog_registration_error;
|
|
589
|
+
try { RunsIndex.registerRunStateDirectory(DEFAULT_STATE_ROOT, meta.state_dir, meta as unknown as Record<string, unknown>); }
|
|
590
|
+
catch (error) {
|
|
591
|
+
meta.catalog_registration = Object.freeze({ state: "unavailable", reason: "catalog_registration_failed" });
|
|
592
|
+
Object.defineProperty(meta, "catalog_registration_error", { value: error, enumerable: false });
|
|
593
|
+
}
|
|
594
|
+
return meta;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
interface DescendantGenerationPreparation<T> {
|
|
598
|
+
readonly parent: Readonly<RunDescendantLaunchTarget>;
|
|
599
|
+
readonly producer: RunResultProducer;
|
|
600
|
+
observe(meta: Readonly<AsyncRunMeta>, preparation: Readonly<RunDescendantPreparation>): T;
|
|
601
|
+
onCleanupFailure(error: unknown): void;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/** Kernel-only prepare path: real generation creation, but no native process, workload, launch receipt, or membership authority. */
|
|
605
|
+
export function prepareDescendantRunGeneration(
|
|
606
|
+
parentStateDir: string,
|
|
607
|
+
producer: RunResultProducer,
|
|
608
|
+
params: AsyncRunStartParams,
|
|
609
|
+
cwd: string,
|
|
610
|
+
options: AsyncRunStartOptions = {},
|
|
611
|
+
): Readonly<RunDescendantLaunchIntent> {
|
|
612
|
+
return withRunWorkAdmission(parentStateDir, producer, () => {
|
|
613
|
+
const parent = Object.freeze({ run: producer.run, run_instance_id: producer.runInstanceId,
|
|
614
|
+
...(producer.ownerId === undefined ? {} : { ownerId: producer.ownerId }),
|
|
615
|
+
state_dir: assertOwnedRunStateDirectory(parentStateDir, producer.run) });
|
|
616
|
+
return startRunInternal(params, cwd, options, {
|
|
617
|
+
parent, producer,
|
|
618
|
+
observe: (meta, preparation) => {
|
|
619
|
+
revalidateRunWorkAdmission(parentStateDir, producer);
|
|
620
|
+
return recordRunDescendantLaunchIntentUnderLock(parent.state_dir, producer, {
|
|
621
|
+
run: meta.run, runInstanceId: meta.run_instance_id, ownerId: meta.ownerId, stateDir: meta.state_dir,
|
|
622
|
+
}, preparation);
|
|
623
|
+
},
|
|
624
|
+
onCleanupFailure: (error) => reportRunProducerCleanupFailure(producer, error),
|
|
625
|
+
});
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
function startRunInternal(params: AsyncRunStartParams, cwd: string, options: AsyncRunStartOptions): AsyncRunMeta;
|
|
630
|
+
function startRunInternal<T>(
|
|
631
|
+
params: AsyncRunStartParams, cwd: string, options: AsyncRunStartOptions, prepared: DescendantGenerationPreparation<T>,
|
|
632
|
+
): T;
|
|
633
|
+
function startRunInternal<T>(
|
|
634
|
+
params: AsyncRunStartParams,
|
|
635
|
+
cwd: string,
|
|
636
|
+
options: AsyncRunStartOptions,
|
|
637
|
+
prepared?: DescendantGenerationPreparation<T>,
|
|
638
|
+
): AsyncRunMeta | T {
|
|
558
639
|
const startParams = resolveStartParams(params, cwd, options);
|
|
640
|
+
// Policy ingress stays closed until runtime enforcement is implemented.
|
|
641
|
+
const supervisionPolicy = RunSupervision.resolveRunSupervisionPolicy();
|
|
559
642
|
const resolved = resolveRunTemplate(startParams);
|
|
560
643
|
const run = safeRunId(startParams.run_id);
|
|
561
644
|
const stateDir = resolveStateDir(startParams, run);
|
|
645
|
+
if (prepared) assertDistinctRunStateDirectories(prepared.parent.state_dir, stateDir);
|
|
562
646
|
const recipeFile = startParams.file
|
|
563
647
|
? resolveRecipeFile(startParams.file, cwd, options)
|
|
564
648
|
: undefined;
|
|
@@ -606,15 +690,17 @@ export function startRun(
|
|
|
606
690
|
const singletonValues = Object.fromEntries(
|
|
607
691
|
[...declaredArgs].map((key) => [key, values[key]]),
|
|
608
692
|
);
|
|
609
|
-
if (startParams.singleton !== true) assertNoActiveRunState(stateDir);
|
|
693
|
+
if (startParams.singleton !== true || prepared) assertNoActiveRunState(stateDir);
|
|
694
|
+
if (prepared) RunsStart.assertFreshRunPreparationState(stateDir);
|
|
610
695
|
mkdirSync(stateDir, { recursive: true });
|
|
611
696
|
const releaseStartLock = acquireStateStartLock(stateDir, {
|
|
612
697
|
onContention: startParams.lifecycleHooks?.onLockContention,
|
|
613
698
|
});
|
|
614
699
|
try {
|
|
615
700
|
claimRunStateDirectory(stateDir, run);
|
|
701
|
+
if (prepared) RunsStart.assertFreshRunPreparationState(stateDir);
|
|
616
702
|
if (
|
|
617
|
-
recipeFile &&
|
|
703
|
+
!prepared && recipeFile &&
|
|
618
704
|
isMutableUsageRecipeFile(recipeFile) &&
|
|
619
705
|
!RecipesUsage.recordRecipeLaunch(
|
|
620
706
|
recipeFile,
|
|
@@ -631,10 +717,17 @@ export function startRun(
|
|
|
631
717
|
stateDir,
|
|
632
718
|
startParams,
|
|
633
719
|
singletonValues,
|
|
720
|
+
supervisionPolicy,
|
|
634
721
|
);
|
|
635
|
-
if (existing)
|
|
722
|
+
if (existing) {
|
|
723
|
+
if (prepared) throw new Error("Run descendant preparation requires a new generation, not singleton attachment.");
|
|
724
|
+
return existing;
|
|
725
|
+
}
|
|
636
726
|
} else assertNoActiveRunState(stateDir);
|
|
637
|
-
|
|
727
|
+
const clockObserver = prepared ? undefined : options.onSupervisionClockCaptured;
|
|
728
|
+
const timeOrigin = clockObserver ? RunSupervision.captureRunSupervisionTimeOrigin() : undefined;
|
|
729
|
+
const capturedGeneration = timeOrigin ? randomUUID() : undefined;
|
|
730
|
+
const clock = RunSupervision.createRunSupervisionClock(supervisionPolicy, timeOrigin?.wall_ms ?? Date.now());
|
|
638
731
|
const stdout = join(stateDir, "stdout.log");
|
|
639
732
|
const stderr = join(stateDir, "stderr.log");
|
|
640
733
|
const recipe = startParams.name || getRunIdFromFile(recipeFile);
|
|
@@ -658,8 +751,6 @@ export function startRun(
|
|
|
658
751
|
: record,
|
|
659
752
|
)
|
|
660
753
|
: undefined;
|
|
661
|
-
const outFd = openSync(stdout, "a");
|
|
662
|
-
const errFd = openSync(stderr, "a");
|
|
663
754
|
const argv = asyncRunnerArgv(stateDir);
|
|
664
755
|
const outputValues = {
|
|
665
756
|
...(startParams.defaults || {}),
|
|
@@ -669,13 +760,15 @@ export function startRun(
|
|
|
669
760
|
startParams.transport_context,
|
|
670
761
|
);
|
|
671
762
|
const artifacts = resolveArtifactPaths(startParams.artifacts, outputValues);
|
|
672
|
-
const runInstanceId = randomUUID();
|
|
763
|
+
const runInstanceId = capturedGeneration ?? randomUUID();
|
|
673
764
|
const deliveryLineage = RunDeliveryLineage.inheritedRunDeliveryLineage(
|
|
674
765
|
startParams.ownerId,
|
|
675
766
|
);
|
|
676
767
|
const meta: AsyncRunMeta = {
|
|
677
768
|
argv: [process.execPath, ...argv],
|
|
678
|
-
createdAt:
|
|
769
|
+
createdAt: clock.started_at,
|
|
770
|
+
...clock,
|
|
771
|
+
supervision_provenance: supervisionPolicy.provenance,
|
|
679
772
|
cwd,
|
|
680
773
|
...(startParams.launch_source
|
|
681
774
|
? {
|
|
@@ -693,6 +786,7 @@ export function startRun(
|
|
|
693
786
|
run_instance_id: runInstanceId,
|
|
694
787
|
state_dir: stateDir,
|
|
695
788
|
state_schema: RuntimeIdentity.RUN_STATE_SCHEMA,
|
|
789
|
+
outcome_protocol: RUN_OUTCOME_PROTOCOL,
|
|
696
790
|
status: "running",
|
|
697
791
|
...(startParams.tool ? { tool: startParams.tool } : {}),
|
|
698
792
|
template: runtimeTemplate,
|
|
@@ -723,7 +817,32 @@ export function startRun(
|
|
|
723
817
|
...(transportContext
|
|
724
818
|
? { transport_context: transportContext } : {}),
|
|
725
819
|
};
|
|
726
|
-
|
|
820
|
+
// Finish fallible metadata assembly before handing off admission, clearing retained evidence or opening captures.
|
|
821
|
+
if (clockObserver && timeOrigin && capturedGeneration) {
|
|
822
|
+
const observation: Readonly<AsyncRunAdmissionClock> = Object.freeze({ kind: "run_clock_origin_captured", visibility: "kernel_only",
|
|
823
|
+
publication: "unpublished", work_started: false, state_dir: stateDir,
|
|
824
|
+
identity: Object.freeze({ run, run_instance_id: capturedGeneration, ...(startParams.ownerId ? { ownerId: startParams.ownerId } : {}) }),
|
|
825
|
+
clock: Object.freeze({ started_at: clock.started_at, supervision: Object.freeze({ ...clock.supervision }) }), origin: timeOrigin,
|
|
826
|
+
snapshot_references: captureRunAdmissionSnapshotReferences(stateDir, meta, timeOrigin) });
|
|
827
|
+
const returned: unknown = clockObserver.call(options, observation);
|
|
828
|
+
if (UtilTypes.isPromise(returned)) {
|
|
829
|
+
// Unsupported async retention may already have started; settle rejection without awaiting it under the lock.
|
|
830
|
+
void Promise.prototype.then.call(returned, undefined, () => undefined);
|
|
831
|
+
throw new Error("Run supervision admission observer must complete synchronously.");
|
|
832
|
+
}
|
|
833
|
+
if (returned && (typeof returned === "object" || typeof returned === "function") && "then" in returned) {
|
|
834
|
+
throw new Error("Run supervision admission observer must complete synchronously.");
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
if (!prepared) prepareStateDirForStart(stateDir);
|
|
838
|
+
const captureFds = prepared ? undefined : [openSync(stdout, "a"), openSync(stderr, "a")] as const;
|
|
839
|
+
writeJsonAtomic(join(stateDir, prepared ? RUN_DESCENDANT_PREPARED_META_FILE : "run.json"), meta);
|
|
840
|
+
if (prepared) {
|
|
841
|
+
const target = Object.freeze({ run: meta.run, run_instance_id: meta.run_instance_id,
|
|
842
|
+
...(meta.ownerId === undefined ? {} : { ownerId: meta.ownerId }), state_dir: meta.state_dir });
|
|
843
|
+
const preparation = recordRunDescendantPreparationUnderLock(stateDir, target, prepared.parent, prepared.producer);
|
|
844
|
+
return prepared.observe(meta, preparation);
|
|
845
|
+
}
|
|
727
846
|
writeJsonAtomic(join(stateDir, "progress.json"), {
|
|
728
847
|
completed: 0,
|
|
729
848
|
failures: [],
|
|
@@ -731,6 +850,7 @@ export function startRun(
|
|
|
731
850
|
phase: "starting",
|
|
732
851
|
updatedAt: new Date().toISOString(),
|
|
733
852
|
});
|
|
853
|
+
const [outFd, errFd] = captureFds!;
|
|
734
854
|
const child = spawn(process.execPath, argv, {
|
|
735
855
|
cwd,
|
|
736
856
|
detached: true,
|
|
@@ -748,8 +868,8 @@ export function startRun(
|
|
|
748
868
|
closeSync(outFd);
|
|
749
869
|
closeSync(errFd);
|
|
750
870
|
meta.pid = child.pid ?? 0;
|
|
751
|
-
const processIdentity =
|
|
752
|
-
|
|
871
|
+
const processIdentity = captureSpawnedRunProcessIdentity(
|
|
872
|
+
child,
|
|
753
873
|
cwd,
|
|
754
874
|
stateDir,
|
|
755
875
|
RUNNER_PATH,
|
|
@@ -767,7 +887,10 @@ export function startRun(
|
|
|
767
887
|
child.unref();
|
|
768
888
|
return meta;
|
|
769
889
|
} finally {
|
|
770
|
-
|
|
890
|
+
if (prepared) {
|
|
891
|
+
try { releaseStartLock(); }
|
|
892
|
+
catch (error) { prepared.onCleanupFailure(error); }
|
|
893
|
+
} else releaseStartLock();
|
|
771
894
|
}
|
|
772
895
|
}
|
|
773
896
|
|
|
@@ -793,6 +916,11 @@ export function getRunStatus(runOrDir: string): Record<string, unknown> {
|
|
|
793
916
|
);
|
|
794
917
|
}
|
|
795
918
|
|
|
919
|
+
/** Internal inventory acquisition; direct status and lifecycle readers remain independently scalar. */
|
|
920
|
+
export function getRunInventoryStatuses(stateDirs: readonly string[]): (Record<string, unknown> | undefined)[] {
|
|
921
|
+
return readRunInventoryStatuses(stateDirs, readJson, getRunStatus);
|
|
922
|
+
}
|
|
923
|
+
|
|
796
924
|
export type { RunStateIndexEntry } from "./runs-index.ts";
|
|
797
925
|
|
|
798
926
|
export function listRunStateDirs(
|
|
@@ -942,6 +1070,7 @@ export async function sendRunControl(
|
|
|
942
1070
|
): Promise<Record<string, unknown>> {
|
|
943
1071
|
const stateDir = resolveRunStateDir(runOrDir);
|
|
944
1072
|
const releaseControlLock = RunsStart.acquireStateStartLock(stateDir);
|
|
1073
|
+
let requestFailed = false, requestFailure: unknown;
|
|
945
1074
|
try {
|
|
946
1075
|
const status = getRunStatus(stateDir);
|
|
947
1076
|
const run = String(status.run ?? runOrDir);
|
|
@@ -972,8 +1101,16 @@ export async function sendRunControl(
|
|
|
972
1101
|
);
|
|
973
1102
|
}
|
|
974
1103
|
return await deliverRunControl(run, stateDir, request, options);
|
|
1104
|
+
} catch (error) {
|
|
1105
|
+
requestFailed = true; requestFailure = error;
|
|
1106
|
+
throw error;
|
|
975
1107
|
} finally {
|
|
976
|
-
releaseControlLock();
|
|
1108
|
+
try { releaseControlLock(); }
|
|
1109
|
+
catch (releaseError) {
|
|
1110
|
+
if (requestFailed) throw new AggregateError([requestFailure, releaseError],
|
|
1111
|
+
"Run Control request and lifecycle release failed; effects may already exist.", { cause: requestFailure });
|
|
1112
|
+
throw releaseError;
|
|
1113
|
+
}
|
|
977
1114
|
}
|
|
978
1115
|
}
|
|
979
1116
|
|
|
@@ -1210,58 +1347,12 @@ export function cancelRun(
|
|
|
1210
1347
|
: result;
|
|
1211
1348
|
}
|
|
1212
1349
|
|
|
1213
|
-
function retainRun(
|
|
1214
|
-
runOrDir: string,
|
|
1215
|
-
action: RunRetentionAction,
|
|
1216
|
-
expected: RunControlExpectation,
|
|
1217
|
-
options: { preserveArtifacts?: boolean } = {},
|
|
1218
|
-
): Record<string, unknown> {
|
|
1219
|
-
const stateDir = resolveRunStateDir(runOrDir);
|
|
1220
|
-
const releaseControlLock = RunsStart.acquireStateStartLock(stateDir);
|
|
1221
|
-
let status: Record<string, unknown> | undefined;
|
|
1222
|
-
let evidenceId: string | undefined;
|
|
1223
|
-
try {
|
|
1224
|
-
expected.onLocked?.();
|
|
1225
|
-
status = getRunStatus(stateDir);
|
|
1226
|
-
if (expected.ownerId !== undefined && status.ownerId !== expected.ownerId) {
|
|
1227
|
-
return { [`${action}d`]: false, reason: "ownership changed", status };
|
|
1228
|
-
}
|
|
1229
|
-
if (
|
|
1230
|
-
expected.runInstanceId !== undefined &&
|
|
1231
|
-
status.run_instance_id !== expected.runInstanceId
|
|
1232
|
-
) {
|
|
1233
|
-
return { [`${action}d`]: false, reason: "run generation changed", status };
|
|
1234
|
-
}
|
|
1235
|
-
if (status.status === "running") {
|
|
1236
|
-
throw new Error("Only terminal runs can be archived or pruned.");
|
|
1237
|
-
}
|
|
1238
|
-
evidenceId = appendRunRetentionEvidence(status, action, "queued");
|
|
1239
|
-
const result = action === "archive"
|
|
1240
|
-
? archiveTerminalRun(status)
|
|
1241
|
-
: pruneTerminalRun(status, options);
|
|
1242
|
-
appendRunRetentionEvidence(status, action, "handled", {
|
|
1243
|
-
id: evidenceId,
|
|
1244
|
-
result,
|
|
1245
|
-
});
|
|
1246
|
-
return { ...result, retention_id: evidenceId };
|
|
1247
|
-
} catch (error) {
|
|
1248
|
-
if (status && evidenceId) {
|
|
1249
|
-
appendRunRetentionEvidence(status, action, "failed", {
|
|
1250
|
-
error: error instanceof Error ? error.message : String(error),
|
|
1251
|
-
id: evidenceId,
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
throw error;
|
|
1255
|
-
} finally {
|
|
1256
|
-
releaseControlLock();
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
1350
|
|
|
1260
1351
|
export function archiveRun(
|
|
1261
1352
|
runOrDir: string,
|
|
1262
1353
|
expected: RunControlExpectation = {},
|
|
1263
1354
|
): Record<string, unknown> {
|
|
1264
|
-
return retainRun(runOrDir, "archive", expected);
|
|
1355
|
+
return retainRun(resolveRunStateDir(runOrDir), "archive", expected, getRunStatus);
|
|
1265
1356
|
}
|
|
1266
1357
|
|
|
1267
1358
|
export function pruneRun(
|
|
@@ -1269,7 +1360,7 @@ export function pruneRun(
|
|
|
1269
1360
|
options: { preserveArtifacts?: boolean } = {},
|
|
1270
1361
|
expected: RunControlExpectation = {},
|
|
1271
1362
|
): Record<string, unknown> {
|
|
1272
|
-
return retainRun(runOrDir, "prune", expected, options);
|
|
1363
|
+
return retainRun(resolveRunStateDir(runOrDir), "prune", expected, getRunStatus, options);
|
|
1273
1364
|
}
|
|
1274
1365
|
|
|
1275
1366
|
export function killRun(
|
|
@@ -26,6 +26,7 @@ export interface AutomaticReviewRuntimeDeps {
|
|
|
26
26
|
getActiveContext(): Pi.ExtensionContext | undefined;
|
|
27
27
|
getRunOwnerId(ctx: Pi.ExtensionContext): string;
|
|
28
28
|
getThinkingLevel(): unknown;
|
|
29
|
+
getRunAdmissionObserver?(ctx: Pi.ExtensionContext): AsyncRuns.AsyncRunStartOptions["onSupervisionClockCaptured"];
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export const PACKAGE_RECIPE_MEMORY_CONTEXT =
|
|
@@ -88,6 +89,7 @@ export function createAutomaticReviewRuntime(
|
|
|
88
89
|
start(ctx) {
|
|
89
90
|
close();
|
|
90
91
|
if (!Paths.isAutomaticRecipeReviewEnabled()) return;
|
|
92
|
+
const onSupervisionClockCaptured = deps.getRunAdmissionObserver?.(ctx);
|
|
91
93
|
ToolReviewScheduler.applyApprovedToolReviewAtSessionBoundary({
|
|
92
94
|
recipeRoot: Paths.getRecipeRoot(),
|
|
93
95
|
});
|
|
@@ -108,7 +110,7 @@ export function createAutomaticReviewRuntime(
|
|
|
108
110
|
values: { input_path: batch.reviewerInputPath },
|
|
109
111
|
},
|
|
110
112
|
ctx.cwd,
|
|
111
|
-
{ skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT },
|
|
113
|
+
{ skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT, onSupervisionClockCaptured },
|
|
112
114
|
);
|
|
113
115
|
},
|
|
114
116
|
process: (state) =>
|
|
@@ -134,7 +136,7 @@ export function createAutomaticReviewRuntime(
|
|
|
134
136
|
values: { input_path: batch.reviewerInputPath },
|
|
135
137
|
},
|
|
136
138
|
ctx.cwd,
|
|
137
|
-
{ skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT },
|
|
139
|
+
{ skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT, onSupervisionClockCaptured },
|
|
138
140
|
);
|
|
139
141
|
},
|
|
140
142
|
process: (state) =>
|