@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
|
@@ -7,7 +7,7 @@ import { randomUUID } from "node:crypto";
|
|
|
7
7
|
import { closeSync, existsSync, mkdirSync, openSync, readdirSync, rmSync, statSync, } from "node:fs";
|
|
8
8
|
import { basename, dirname, extname, isAbsolute, join, relative, resolve } from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import { isDeepStrictEqual } from "node:util";
|
|
10
|
+
import { isDeepStrictEqual, types as UtilTypes } from "node:util";
|
|
11
11
|
import { writeJsonAtomic } from "./file-state.js";
|
|
12
12
|
import { CURRENT_MODEL_VALUE_KEY, CURRENT_THINKING_VALUE_KEY, describeCurrentPolicyProvenance, } from "./model-context.js";
|
|
13
13
|
import * as Paths from "./paths.js";
|
|
@@ -17,17 +17,22 @@ import * as RecipesUsage from "./recipes-usage.js";
|
|
|
17
17
|
import * as Schema from "./schema.js";
|
|
18
18
|
import { resolveArtifactPaths, } from "./runs-artifacts.js";
|
|
19
19
|
import { safeRunId } from "./runs-identity.js";
|
|
20
|
+
import { recordRunDescendantLaunchIntentUnderLock, recordRunDescendantPreparationUnderLock, RUN_DESCENDANT_PREPARED_META_FILE } from "./runs-descendant-launches.js";
|
|
21
|
+
import { RUN_OUTCOME_PROTOCOL } from "./runs-outcomes.js";
|
|
20
22
|
import { buildTerminalProgress, markTerminalHandled, signalOwnedRunProcess, } from "./runs-control.js";
|
|
21
|
-
import { claimRunStateDirectory } from "./runs-ownership.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
23
|
+
import { assertDistinctRunStateDirectories, assertOwnedRunStateDirectory, claimRunStateDirectory } from "./runs-ownership.js";
|
|
24
|
+
import { reportRunProducerCleanupFailure, revalidateRunWorkAdmission, withRunWorkAdmission } from "./runs-results.js";
|
|
25
|
+
import { retainRun, } from "./runs-retention.js";
|
|
26
|
+
import { captureSpawnedRunProcessIdentity, verifyRunProcessIdentity, } from "./runs-process.js";
|
|
24
27
|
import * as RuntimeIdentity from "./runtime-identity.js";
|
|
25
28
|
import * as RunsStart from "./runs-start.js";
|
|
29
|
+
import { captureRunAdmissionSnapshotReferences } from "./runs-context-exports.js";
|
|
30
|
+
import * as RunSupervision from "./run-supervision.js";
|
|
26
31
|
import { appendRunTraceEvent } from "./runs-trace.js";
|
|
27
32
|
import * as RunsIndex from "./runs-index.js";
|
|
28
33
|
import * as RunsParentTeardown from "./runs-parent-teardown.js";
|
|
29
34
|
import { deliverRunControl, } from "./runs-control-delivery.js";
|
|
30
|
-
import { buildRunStatus, tailFile, } from "./runs-status.js";
|
|
35
|
+
import { buildRunStatus, readRunInventoryStatuses, tailFile, } from "./runs-status.js";
|
|
31
36
|
import { readJsonFileResilient } from "./state-readers.js";
|
|
32
37
|
const RUNNER_IDENTITY_GRACE_MS = 5000;
|
|
33
38
|
export function normalizeRunTransportContext(value) {
|
|
@@ -107,7 +112,7 @@ function resolveStateDir(params, run) {
|
|
|
107
112
|
function assertNoActiveRunState(stateDir) {
|
|
108
113
|
RunsStart.assertNoActiveRunState(stateDir, readJson, RUNNER_PATH);
|
|
109
114
|
}
|
|
110
|
-
function reuseCompatibleSingletonRun(stateDir, startParams, singletonValues) {
|
|
115
|
+
function reuseCompatibleSingletonRun(stateDir, startParams, singletonValues, supervisionPolicy) {
|
|
111
116
|
const existing = RunsStart.readActiveOwnedRunState(stateDir, readJson, RUNNER_PATH);
|
|
112
117
|
if (!existing)
|
|
113
118
|
return undefined;
|
|
@@ -119,6 +124,11 @@ function reuseCompatibleSingletonRun(stateDir, startParams, singletonValues) {
|
|
|
119
124
|
if (!compatible) {
|
|
120
125
|
throw new Error(`Active singleton Run ${String(existing.run ?? stateDir)} has incompatible Recipe identity, owner, startup values, or Control contract. Stop it before changing singleton configuration.`);
|
|
121
126
|
}
|
|
127
|
+
const clock = RunSupervision.readRunSupervisionClock(existing);
|
|
128
|
+
const existingPolicy = clock?.supervision ?? RunSupervision.resolveRunSupervisionPolicy();
|
|
129
|
+
if (!RunSupervision.sameRunSupervisionPolicy(existingPolicy, supervisionPolicy)) {
|
|
130
|
+
throw new Error(`Active singleton Run ${String(existing.run ?? stateDir)} has incompatible supervision policy. Stop it before changing singleton configuration.`);
|
|
131
|
+
}
|
|
122
132
|
return {
|
|
123
133
|
...existing,
|
|
124
134
|
...(startParams.launch_source
|
|
@@ -283,10 +293,46 @@ function prepareStateDirForStart(stateDir) {
|
|
|
283
293
|
RunsStart.prepareStateDirForStart(stateDir, readJson, RUNNER_PATH);
|
|
284
294
|
}
|
|
285
295
|
export function startRun(params, cwd, options = {}) {
|
|
296
|
+
const meta = startRunInternal(params, cwd, options);
|
|
297
|
+
// Internal return includes lifecycle release. Catalog failure must not retry or undo the accepted launch/attachment.
|
|
298
|
+
delete meta.catalog_registration;
|
|
299
|
+
delete meta.catalog_registration_error;
|
|
300
|
+
try {
|
|
301
|
+
RunsIndex.registerRunStateDirectory(DEFAULT_STATE_ROOT, meta.state_dir, meta);
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
meta.catalog_registration = Object.freeze({ state: "unavailable", reason: "catalog_registration_failed" });
|
|
305
|
+
Object.defineProperty(meta, "catalog_registration_error", { value: error, enumerable: false });
|
|
306
|
+
}
|
|
307
|
+
return meta;
|
|
308
|
+
}
|
|
309
|
+
/** Kernel-only prepare path: real generation creation, but no native process, workload, launch receipt, or membership authority. */
|
|
310
|
+
export function prepareDescendantRunGeneration(parentStateDir, producer, params, cwd, options = {}) {
|
|
311
|
+
return withRunWorkAdmission(parentStateDir, producer, () => {
|
|
312
|
+
const parent = Object.freeze({ run: producer.run, run_instance_id: producer.runInstanceId,
|
|
313
|
+
...(producer.ownerId === undefined ? {} : { ownerId: producer.ownerId }),
|
|
314
|
+
state_dir: assertOwnedRunStateDirectory(parentStateDir, producer.run) });
|
|
315
|
+
return startRunInternal(params, cwd, options, {
|
|
316
|
+
parent, producer,
|
|
317
|
+
observe: (meta, preparation) => {
|
|
318
|
+
revalidateRunWorkAdmission(parentStateDir, producer);
|
|
319
|
+
return recordRunDescendantLaunchIntentUnderLock(parent.state_dir, producer, {
|
|
320
|
+
run: meta.run, runInstanceId: meta.run_instance_id, ownerId: meta.ownerId, stateDir: meta.state_dir,
|
|
321
|
+
}, preparation);
|
|
322
|
+
},
|
|
323
|
+
onCleanupFailure: (error) => reportRunProducerCleanupFailure(producer, error),
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
function startRunInternal(params, cwd, options, prepared) {
|
|
286
328
|
const startParams = resolveStartParams(params, cwd, options);
|
|
329
|
+
// Policy ingress stays closed until runtime enforcement is implemented.
|
|
330
|
+
const supervisionPolicy = RunSupervision.resolveRunSupervisionPolicy();
|
|
287
331
|
const resolved = resolveRunTemplate(startParams);
|
|
288
332
|
const run = safeRunId(startParams.run_id);
|
|
289
333
|
const stateDir = resolveStateDir(startParams, run);
|
|
334
|
+
if (prepared)
|
|
335
|
+
assertDistinctRunStateDirectories(prepared.parent.state_dir, stateDir);
|
|
290
336
|
const recipeFile = startParams.file
|
|
291
337
|
? resolveRecipeFile(startParams.file, cwd, options)
|
|
292
338
|
: undefined;
|
|
@@ -324,27 +370,37 @@ export function startRun(params, cwd, options = {}) {
|
|
|
324
370
|
});
|
|
325
371
|
assertCurrentPlaceholderReferencesResolved(resolved.template, startParams.defaults, values, modelPolicy);
|
|
326
372
|
const singletonValues = Object.fromEntries([...declaredArgs].map((key) => [key, values[key]]));
|
|
327
|
-
if (startParams.singleton !== true)
|
|
373
|
+
if (startParams.singleton !== true || prepared)
|
|
328
374
|
assertNoActiveRunState(stateDir);
|
|
375
|
+
if (prepared)
|
|
376
|
+
RunsStart.assertFreshRunPreparationState(stateDir);
|
|
329
377
|
mkdirSync(stateDir, { recursive: true });
|
|
330
378
|
const releaseStartLock = acquireStateStartLock(stateDir, {
|
|
331
379
|
onContention: startParams.lifecycleHooks?.onLockContention,
|
|
332
380
|
});
|
|
333
381
|
try {
|
|
334
382
|
claimRunStateDirectory(stateDir, run);
|
|
335
|
-
if (
|
|
383
|
+
if (prepared)
|
|
384
|
+
RunsStart.assertFreshRunPreparationState(stateDir);
|
|
385
|
+
if (!prepared && recipeFile &&
|
|
336
386
|
isMutableUsageRecipeFile(recipeFile) &&
|
|
337
387
|
!RecipesUsage.recordRecipeLaunch(recipeFile, new Date(), startParams.launch_source === "tool" ? "tool" : "spawn")) {
|
|
338
388
|
throw new Error(`Recipe launch rejected because its source changed during activation: ${recipeFile}. Reload recipe tools and retry.`);
|
|
339
389
|
}
|
|
340
390
|
if (startParams.singleton === true) {
|
|
341
|
-
const existing = reuseCompatibleSingletonRun(stateDir, startParams, singletonValues);
|
|
342
|
-
if (existing)
|
|
391
|
+
const existing = reuseCompatibleSingletonRun(stateDir, startParams, singletonValues, supervisionPolicy);
|
|
392
|
+
if (existing) {
|
|
393
|
+
if (prepared)
|
|
394
|
+
throw new Error("Run descendant preparation requires a new generation, not singleton attachment.");
|
|
343
395
|
return existing;
|
|
396
|
+
}
|
|
344
397
|
}
|
|
345
398
|
else
|
|
346
399
|
assertNoActiveRunState(stateDir);
|
|
347
|
-
|
|
400
|
+
const clockObserver = prepared ? undefined : options.onSupervisionClockCaptured;
|
|
401
|
+
const timeOrigin = clockObserver ? RunSupervision.captureRunSupervisionTimeOrigin() : undefined;
|
|
402
|
+
const capturedGeneration = timeOrigin ? randomUUID() : undefined;
|
|
403
|
+
const clock = RunSupervision.createRunSupervisionClock(supervisionPolicy, timeOrigin?.wall_ms ?? Date.now());
|
|
348
404
|
const stdout = join(stateDir, "stdout.log");
|
|
349
405
|
const stderr = join(stateDir, "stderr.log");
|
|
350
406
|
const recipe = startParams.name || getRunIdFromFile(recipeFile);
|
|
@@ -361,8 +417,6 @@ export function startRun(params, cwd, options = {}) {
|
|
|
361
417
|
}
|
|
362
418
|
: record)
|
|
363
419
|
: undefined;
|
|
364
|
-
const outFd = openSync(stdout, "a");
|
|
365
|
-
const errFd = openSync(stderr, "a");
|
|
366
420
|
const argv = asyncRunnerArgv(stateDir);
|
|
367
421
|
const outputValues = {
|
|
368
422
|
...(startParams.defaults || {}),
|
|
@@ -370,11 +424,13 @@ export function startRun(params, cwd, options = {}) {
|
|
|
370
424
|
};
|
|
371
425
|
const transportContext = normalizeRunTransportContext(startParams.transport_context);
|
|
372
426
|
const artifacts = resolveArtifactPaths(startParams.artifacts, outputValues);
|
|
373
|
-
const runInstanceId = randomUUID();
|
|
427
|
+
const runInstanceId = capturedGeneration ?? randomUUID();
|
|
374
428
|
const deliveryLineage = RunDeliveryLineage.inheritedRunDeliveryLineage(startParams.ownerId);
|
|
375
429
|
const meta = {
|
|
376
430
|
argv: [process.execPath, ...argv],
|
|
377
|
-
createdAt:
|
|
431
|
+
createdAt: clock.started_at,
|
|
432
|
+
...clock,
|
|
433
|
+
supervision_provenance: supervisionPolicy.provenance,
|
|
378
434
|
cwd,
|
|
379
435
|
...(startParams.launch_source
|
|
380
436
|
? {
|
|
@@ -392,6 +448,7 @@ export function startRun(params, cwd, options = {}) {
|
|
|
392
448
|
run_instance_id: runInstanceId,
|
|
393
449
|
state_dir: stateDir,
|
|
394
450
|
state_schema: RuntimeIdentity.RUN_STATE_SCHEMA,
|
|
451
|
+
outcome_protocol: RUN_OUTCOME_PROTOCOL,
|
|
395
452
|
status: "running",
|
|
396
453
|
...(startParams.tool ? { tool: startParams.tool } : {}),
|
|
397
454
|
template: runtimeTemplate,
|
|
@@ -422,7 +479,33 @@ export function startRun(params, cwd, options = {}) {
|
|
|
422
479
|
...(transportContext
|
|
423
480
|
? { transport_context: transportContext } : {}),
|
|
424
481
|
};
|
|
425
|
-
|
|
482
|
+
// Finish fallible metadata assembly before handing off admission, clearing retained evidence or opening captures.
|
|
483
|
+
if (clockObserver && timeOrigin && capturedGeneration) {
|
|
484
|
+
const observation = Object.freeze({ kind: "run_clock_origin_captured", visibility: "kernel_only",
|
|
485
|
+
publication: "unpublished", work_started: false, state_dir: stateDir,
|
|
486
|
+
identity: Object.freeze({ run, run_instance_id: capturedGeneration, ...(startParams.ownerId ? { ownerId: startParams.ownerId } : {}) }),
|
|
487
|
+
clock: Object.freeze({ started_at: clock.started_at, supervision: Object.freeze({ ...clock.supervision }) }), origin: timeOrigin,
|
|
488
|
+
snapshot_references: captureRunAdmissionSnapshotReferences(stateDir, meta, timeOrigin) });
|
|
489
|
+
const returned = clockObserver.call(options, observation);
|
|
490
|
+
if (UtilTypes.isPromise(returned)) {
|
|
491
|
+
// Unsupported async retention may already have started; settle rejection without awaiting it under the lock.
|
|
492
|
+
void Promise.prototype.then.call(returned, undefined, () => undefined);
|
|
493
|
+
throw new Error("Run supervision admission observer must complete synchronously.");
|
|
494
|
+
}
|
|
495
|
+
if (returned && (typeof returned === "object" || typeof returned === "function") && "then" in returned) {
|
|
496
|
+
throw new Error("Run supervision admission observer must complete synchronously.");
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if (!prepared)
|
|
500
|
+
prepareStateDirForStart(stateDir);
|
|
501
|
+
const captureFds = prepared ? undefined : [openSync(stdout, "a"), openSync(stderr, "a")];
|
|
502
|
+
writeJsonAtomic(join(stateDir, prepared ? RUN_DESCENDANT_PREPARED_META_FILE : "run.json"), meta);
|
|
503
|
+
if (prepared) {
|
|
504
|
+
const target = Object.freeze({ run: meta.run, run_instance_id: meta.run_instance_id,
|
|
505
|
+
...(meta.ownerId === undefined ? {} : { ownerId: meta.ownerId }), state_dir: meta.state_dir });
|
|
506
|
+
const preparation = recordRunDescendantPreparationUnderLock(stateDir, target, prepared.parent, prepared.producer);
|
|
507
|
+
return prepared.observe(meta, preparation);
|
|
508
|
+
}
|
|
426
509
|
writeJsonAtomic(join(stateDir, "progress.json"), {
|
|
427
510
|
completed: 0,
|
|
428
511
|
failures: [],
|
|
@@ -430,6 +513,7 @@ export function startRun(params, cwd, options = {}) {
|
|
|
430
513
|
phase: "starting",
|
|
431
514
|
updatedAt: new Date().toISOString(),
|
|
432
515
|
});
|
|
516
|
+
const [outFd, errFd] = captureFds;
|
|
433
517
|
const child = spawn(process.execPath, argv, {
|
|
434
518
|
cwd,
|
|
435
519
|
detached: true,
|
|
@@ -447,7 +531,7 @@ export function startRun(params, cwd, options = {}) {
|
|
|
447
531
|
closeSync(outFd);
|
|
448
532
|
closeSync(errFd);
|
|
449
533
|
meta.pid = child.pid ?? 0;
|
|
450
|
-
const processIdentity =
|
|
534
|
+
const processIdentity = captureSpawnedRunProcessIdentity(child, cwd, stateDir, RUNNER_PATH);
|
|
451
535
|
if (processIdentity)
|
|
452
536
|
meta.process_identity = processIdentity;
|
|
453
537
|
writeJsonAtomic(join(stateDir, "run.json"), meta);
|
|
@@ -463,7 +547,16 @@ export function startRun(params, cwd, options = {}) {
|
|
|
463
547
|
return meta;
|
|
464
548
|
}
|
|
465
549
|
finally {
|
|
466
|
-
|
|
550
|
+
if (prepared) {
|
|
551
|
+
try {
|
|
552
|
+
releaseStartLock();
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
prepared.onCleanupFailure(error);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
else
|
|
559
|
+
releaseStartLock();
|
|
467
560
|
}
|
|
468
561
|
}
|
|
469
562
|
function resolveRunStateDir(runOrDir) {
|
|
@@ -478,6 +571,10 @@ export function getRunStatus(runOrDir) {
|
|
|
478
571
|
throw new Error(`Run not found: ${runOrDir}`);
|
|
479
572
|
return buildRunStatus(stateDir, runOrDir, meta, readJson, RUNNER_PATH, RUNNER_IDENTITY_GRACE_MS);
|
|
480
573
|
}
|
|
574
|
+
/** Internal inventory acquisition; direct status and lifecycle readers remain independently scalar. */
|
|
575
|
+
export function getRunInventoryStatuses(stateDirs) {
|
|
576
|
+
return readRunInventoryStatuses(stateDirs, readJson, getRunStatus);
|
|
577
|
+
}
|
|
481
578
|
export function listRunStateDirs(stateRoot = DEFAULT_STATE_ROOT) {
|
|
482
579
|
return RunsIndex.listRunStateDirs(stateRoot);
|
|
483
580
|
}
|
|
@@ -565,6 +662,7 @@ export function tailRun(runOrDir, lines = 40) {
|
|
|
565
662
|
export async function sendRunControl(runOrDir, request, options = {}) {
|
|
566
663
|
const stateDir = resolveRunStateDir(runOrDir);
|
|
567
664
|
const releaseControlLock = RunsStart.acquireStateStartLock(stateDir);
|
|
665
|
+
let requestFailed = false, requestFailure;
|
|
568
666
|
try {
|
|
569
667
|
const status = getRunStatus(stateDir);
|
|
570
668
|
const run = String(status.run ?? runOrDir);
|
|
@@ -590,8 +688,20 @@ export async function sendRunControl(runOrDir, request, options = {}) {
|
|
|
590
688
|
}
|
|
591
689
|
return await deliverRunControl(run, stateDir, request, options);
|
|
592
690
|
}
|
|
691
|
+
catch (error) {
|
|
692
|
+
requestFailed = true;
|
|
693
|
+
requestFailure = error;
|
|
694
|
+
throw error;
|
|
695
|
+
}
|
|
593
696
|
finally {
|
|
594
|
-
|
|
697
|
+
try {
|
|
698
|
+
releaseControlLock();
|
|
699
|
+
}
|
|
700
|
+
catch (releaseError) {
|
|
701
|
+
if (requestFailed)
|
|
702
|
+
throw new AggregateError([requestFailure, releaseError], "Run Control request and lifecycle release failed; effects may already exist.", { cause: requestFailure });
|
|
703
|
+
throw releaseError;
|
|
704
|
+
}
|
|
595
705
|
}
|
|
596
706
|
}
|
|
597
707
|
export { getRunProcessSignalPlan } from "./runs-control.js";
|
|
@@ -781,52 +891,11 @@ export function cancelRun(runOrDir, expected = {}) {
|
|
|
781
891
|
? { cancelled: result.stopped, ...result }
|
|
782
892
|
: result;
|
|
783
893
|
}
|
|
784
|
-
function retainRun(runOrDir, action, expected, options = {}) {
|
|
785
|
-
const stateDir = resolveRunStateDir(runOrDir);
|
|
786
|
-
const releaseControlLock = RunsStart.acquireStateStartLock(stateDir);
|
|
787
|
-
let status;
|
|
788
|
-
let evidenceId;
|
|
789
|
-
try {
|
|
790
|
-
expected.onLocked?.();
|
|
791
|
-
status = getRunStatus(stateDir);
|
|
792
|
-
if (expected.ownerId !== undefined && status.ownerId !== expected.ownerId) {
|
|
793
|
-
return { [`${action}d`]: false, reason: "ownership changed", status };
|
|
794
|
-
}
|
|
795
|
-
if (expected.runInstanceId !== undefined &&
|
|
796
|
-
status.run_instance_id !== expected.runInstanceId) {
|
|
797
|
-
return { [`${action}d`]: false, reason: "run generation changed", status };
|
|
798
|
-
}
|
|
799
|
-
if (status.status === "running") {
|
|
800
|
-
throw new Error("Only terminal runs can be archived or pruned.");
|
|
801
|
-
}
|
|
802
|
-
evidenceId = appendRunRetentionEvidence(status, action, "queued");
|
|
803
|
-
const result = action === "archive"
|
|
804
|
-
? archiveTerminalRun(status)
|
|
805
|
-
: pruneTerminalRun(status, options);
|
|
806
|
-
appendRunRetentionEvidence(status, action, "handled", {
|
|
807
|
-
id: evidenceId,
|
|
808
|
-
result,
|
|
809
|
-
});
|
|
810
|
-
return { ...result, retention_id: evidenceId };
|
|
811
|
-
}
|
|
812
|
-
catch (error) {
|
|
813
|
-
if (status && evidenceId) {
|
|
814
|
-
appendRunRetentionEvidence(status, action, "failed", {
|
|
815
|
-
error: error instanceof Error ? error.message : String(error),
|
|
816
|
-
id: evidenceId,
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
throw error;
|
|
820
|
-
}
|
|
821
|
-
finally {
|
|
822
|
-
releaseControlLock();
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
894
|
export function archiveRun(runOrDir, expected = {}) {
|
|
826
|
-
return retainRun(runOrDir, "archive", expected);
|
|
895
|
+
return retainRun(resolveRunStateDir(runOrDir), "archive", expected, getRunStatus);
|
|
827
896
|
}
|
|
828
897
|
export function pruneRun(runOrDir, options = {}, expected = {}) {
|
|
829
|
-
return retainRun(runOrDir, "prune", expected, options);
|
|
898
|
+
return retainRun(resolveRunStateDir(runOrDir), "prune", expected, getRunStatus, options);
|
|
830
899
|
}
|
|
831
900
|
export function killRun(runOrDir, expected = {}) {
|
|
832
901
|
const result = stopRun(runOrDir, "SIGKILL", "run.kill", expected);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Zones: session-bound review schedulers, silent reviewer launch adapters, review controls
|
|
4
4
|
* Owns automatic-review lifecycle wiring without owning review decisions or filesystem transactions.
|
|
5
5
|
*/
|
|
6
|
+
import * as AsyncRuns from "./async-runs.ts";
|
|
6
7
|
import type * as Pi from "./pi.ts";
|
|
7
8
|
import * as RecipesReferences from "./recipes-references.ts";
|
|
8
9
|
export interface AutomaticReviewRuntime {
|
|
@@ -15,6 +16,7 @@ export interface AutomaticReviewRuntimeDeps {
|
|
|
15
16
|
getActiveContext(): Pi.ExtensionContext | undefined;
|
|
16
17
|
getRunOwnerId(ctx: Pi.ExtensionContext): string;
|
|
17
18
|
getThinkingLevel(): unknown;
|
|
19
|
+
getRunAdmissionObserver?(ctx: Pi.ExtensionContext): AsyncRuns.AsyncRunStartOptions["onSupervisionClockCaptured"];
|
|
18
20
|
}
|
|
19
21
|
export declare const PACKAGE_RECIPE_MEMORY_CONTEXT: RecipesReferences.ActiveSkillRecipeContext;
|
|
20
22
|
export declare function createAutomaticReviewRuntime(deps: AutomaticReviewRuntimeDeps): AutomaticReviewRuntime;
|
|
@@ -53,6 +53,7 @@ export function createAutomaticReviewRuntime(deps) {
|
|
|
53
53
|
close();
|
|
54
54
|
if (!Paths.isAutomaticRecipeReviewEnabled())
|
|
55
55
|
return;
|
|
56
|
+
const onSupervisionClockCaptured = deps.getRunAdmissionObserver?.(ctx);
|
|
56
57
|
ToolReviewScheduler.applyApprovedToolReviewAtSessionBoundary({
|
|
57
58
|
recipeRoot: Paths.getRecipeRoot(),
|
|
58
59
|
});
|
|
@@ -70,7 +71,7 @@ export function createAutomaticReviewRuntime(deps) {
|
|
|
70
71
|
policy_values: policyValues(ctx),
|
|
71
72
|
run_id: DraftSleep.draftSleepRunId(batch.batchId),
|
|
72
73
|
values: { input_path: batch.reviewerInputPath },
|
|
73
|
-
}, ctx.cwd, { skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT });
|
|
74
|
+
}, ctx.cwd, { skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT, onSupervisionClockCaptured });
|
|
74
75
|
},
|
|
75
76
|
process: (state) => DraftSleep.processDraftSleepReview(state, {
|
|
76
77
|
getRunStatus: AsyncRuns.getRunStatus,
|
|
@@ -91,7 +92,7 @@ export function createAutomaticReviewRuntime(deps) {
|
|
|
91
92
|
policy_values: policyValues(ctx),
|
|
92
93
|
run_id: ToolReviewScheduler.toolReviewRunId(batch.reviewId),
|
|
93
94
|
values: { input_path: batch.reviewerInputPath },
|
|
94
|
-
}, ctx.cwd, { skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT });
|
|
95
|
+
}, ctx.cwd, { skillContext: PACKAGE_RECIPE_MEMORY_CONTEXT, onSupervisionClockCaptured });
|
|
95
96
|
},
|
|
96
97
|
process: (state) => ToolReviewScheduler.processToolReviewResult(state, {
|
|
97
98
|
getRunStatus: AsyncRuns.getRunStatus,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Zones: shell-free command parsing, placeholder expansion, local process execution, composition semantics
|
|
4
4
|
* Owns portable command-template parsing, expansion, risk checks, retries, timeouts, and direct execution.
|
|
5
5
|
*/
|
|
6
|
+
import { type ChildProcess } from "node:child_process";
|
|
6
7
|
export type CommandTemplateFailureScope = "continue" | "branch" | "root";
|
|
7
8
|
export interface CommandTemplateActorRecipeContext {
|
|
8
9
|
alias?: string;
|
|
@@ -40,6 +41,12 @@ export interface CommandTemplateInvocation {
|
|
|
40
41
|
args: string[];
|
|
41
42
|
}
|
|
42
43
|
export interface CommandTemplateExecOptions {
|
|
44
|
+
/** Kernel-only synchronous admission around each native spawn, including retries. */
|
|
45
|
+
admitSpawn?: (start: () => ChildProcess) => ChildProcess;
|
|
46
|
+
/** Kernel-only fresh handle after capture/exit management, inside synchronous spawn admission. Not birth proof. */
|
|
47
|
+
onAttemptManaged?: (context: CommandTemplateManagedAttempt) => void;
|
|
48
|
+
/** Kernel observation of settled attempts only; no receipt exists for a denied spawn. */
|
|
49
|
+
onAttemptComplete?: (receipt: CommandTemplateAttemptReceipt) => void;
|
|
43
50
|
cwd?: string;
|
|
44
51
|
timeout?: number;
|
|
45
52
|
signal?: AbortSignal;
|
|
@@ -60,7 +67,37 @@ export interface CommandTemplateExecResult {
|
|
|
60
67
|
stderrFile?: string;
|
|
61
68
|
stdoutTruncated?: boolean;
|
|
62
69
|
stderrTruncated?: boolean;
|
|
70
|
+
stdoutCaptureIncomplete?: true;
|
|
71
|
+
stderrCaptureIncomplete?: true;
|
|
72
|
+
stdoutFileBytes?: number;
|
|
73
|
+
stderrFileBytes?: number;
|
|
63
74
|
}
|
|
75
|
+
export interface CommandTemplateManagedAttempt {
|
|
76
|
+
readonly attempt: number;
|
|
77
|
+
readonly process: ChildProcess;
|
|
78
|
+
}
|
|
79
|
+
export interface CommandTemplateSpawnAdmission {
|
|
80
|
+
readonly attempt: number;
|
|
81
|
+
}
|
|
82
|
+
/** Available only before this synchronous admission invokes its factory; never retroactively adopt a born process. */
|
|
83
|
+
export declare function readPendingCommandSpawnAdmission(): CommandTemplateSpawnAdmission | undefined;
|
|
84
|
+
/** Kernel-only launch observation capability; copies and references retained past the callback are not authority. */
|
|
85
|
+
export declare function requireFreshManagedCommandAttempt(context: CommandTemplateManagedAttempt, admission?: CommandTemplateSpawnAdmission): CommandTemplateManagedAttempt;
|
|
86
|
+
export interface CommandTemplateAttemptReceipt {
|
|
87
|
+
readonly attempt: number;
|
|
88
|
+
/** Kernel-only digest of observed stdout bytes after complete capture persistence; not exposure/native authority. */
|
|
89
|
+
readonly stdoutSha256?: string;
|
|
90
|
+
readonly result: Readonly<CommandTemplateExecResult>;
|
|
91
|
+
readonly nativeExitCode?: number | null;
|
|
92
|
+
readonly nativeSignal?: NodeJS.Signals | null;
|
|
93
|
+
}
|
|
94
|
+
export interface CommandTemplateNativeClose {
|
|
95
|
+
readonly pid: number;
|
|
96
|
+
readonly nativeExitCode: number | null;
|
|
97
|
+
readonly nativeSignal: NodeJS.Signals | null;
|
|
98
|
+
}
|
|
99
|
+
/** Exact retained process close during its synchronous receipt callback, never a serialized terminal claim. */
|
|
100
|
+
export declare function requireNativeCommandAttemptClose(receipt: CommandTemplateAttemptReceipt, admission: CommandTemplateSpawnAdmission, child: ChildProcess): CommandTemplateNativeClose;
|
|
64
101
|
export type CommandTemplateRiskLabel = "risk.shell" | "risk.eval" | "risk.broad_fs_write" | "risk.destructive_fs" | "risk.network" | "risk.external_side_effect" | "risk.long_running" | "risk.platform_specific" | "risk.secret_touching";
|
|
65
102
|
export type CommandTemplateExecCommand = (command: string, args: string[], options?: CommandTemplateExecOptions) => Promise<CommandTemplateExecResult>;
|
|
66
103
|
export declare function normalizeCommandTemplateConfig(config: CommandTemplateConfig): CommandTemplateObjectConfig;
|