@llblab/pi-kit 0.38.3 → 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 +10 -0
- package/README.md +2 -2
- 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/@llblab/pi-codex-usage/AGENTS.md +2 -2
- package/node_modules/@llblab/pi-codex-usage/CHANGELOG.md +6 -0
- package/node_modules/@llblab/pi-codex-usage/README.md +9 -5
- package/node_modules/@llblab/pi-codex-usage/lib/query.ts +229 -50
- package/node_modules/@llblab/pi-codex-usage/lib/usage.ts +9 -1
- package/node_modules/@llblab/pi-codex-usage/package.json +1 -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 +3 -3
- 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
|
@@ -25,9 +25,14 @@ import {
|
|
|
25
25
|
|
|
26
26
|
import * as AsyncRuns from "./async-runs.ts";
|
|
27
27
|
import * as Paths from "./paths.ts";
|
|
28
|
+
import * as Limits from "./limits.ts";
|
|
28
29
|
import * as RunsTrace from "./runs-trace.ts";
|
|
29
30
|
import type { RunCompletionBatchMember } from "./run-delivery.ts";
|
|
31
|
+
import { readRunCompletionTextSource, readRunResultArtifactInventory, readRunResultDiagnosticOutcome } from "./runs-context-exports.ts";
|
|
32
|
+
import type { RunPrimaryTextBinding } from "./runs-outcomes.ts";
|
|
30
33
|
import { readJsonlFileResilient } from "./state-readers.ts";
|
|
34
|
+
import { Document } from "yaml";
|
|
35
|
+
import { formatLiteralBlock, formatMarkdownField } from "./tools-response.ts";
|
|
31
36
|
|
|
32
37
|
export type RunObservedStatus =
|
|
33
38
|
| "running"
|
|
@@ -125,11 +130,14 @@ export function readRunUiSnapshot(
|
|
|
125
130
|
ownerId: string,
|
|
126
131
|
options: { includeAttention?: boolean; stateRoot?: string } = {},
|
|
127
132
|
): RunUiSnapshot {
|
|
128
|
-
|
|
133
|
+
return projectRunUiSnapshot(state, summarizeRuns(options.stateRoot, ownerId), options.includeAttention);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function projectRunUiSnapshot(state: RunUiObservationState, summary: RunSummary, includeAttention?: boolean): RunUiSnapshot {
|
|
129
137
|
const status = renderRunStatus(summary, state.frame++);
|
|
130
138
|
return {
|
|
131
139
|
attentionEvents:
|
|
132
|
-
|
|
140
|
+
includeAttention === false
|
|
133
141
|
? []
|
|
134
142
|
: detectRunAttentionEvents(
|
|
135
143
|
state.legacyEventLines,
|
|
@@ -148,7 +156,10 @@ export function readRunDeliverySnapshot(
|
|
|
148
156
|
deliveryOwnerId: string,
|
|
149
157
|
stateRoot?: string,
|
|
150
158
|
): RunUiSnapshot {
|
|
151
|
-
|
|
159
|
+
return projectRunDeliverySnapshot(state, summarizeRuns(stateRoot, undefined, deliveryOwnerId));
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function projectRunDeliverySnapshot(state: RunUiObservationState, summary: RunSummary): RunUiSnapshot {
|
|
152
163
|
return {
|
|
153
164
|
attentionEvents: [],
|
|
154
165
|
status: undefined,
|
|
@@ -157,6 +168,18 @@ export function readRunDeliverySnapshot(
|
|
|
157
168
|
};
|
|
158
169
|
}
|
|
159
170
|
|
|
171
|
+
/** Same-pass display/candidate projections only. No frame escapes or native fact is reused by flush/publication/control. */
|
|
172
|
+
export function readRunUiAndDeliverySnapshots(
|
|
173
|
+
uiState: RunUiObservationState, deliveryState: RunUiObservationState, ownerId: string,
|
|
174
|
+
stateRoot = Paths.getRunStateRoot(),
|
|
175
|
+
): { ui: RunUiSnapshot; delivery: RunUiSnapshot } {
|
|
176
|
+
const runs = readRunObservations(stateRoot);
|
|
177
|
+
return {
|
|
178
|
+
ui: projectRunUiSnapshot(uiState, summarizeRunObservations(runs, stateRoot, ownerId)),
|
|
179
|
+
delivery: projectRunDeliverySnapshot(deliveryState, summarizeRunObservations(runs, stateRoot, undefined, ownerId)),
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
160
183
|
export function pruneRunUiObservationState(
|
|
161
184
|
state: RunUiObservationState,
|
|
162
185
|
snapshot: Pick<RunUiSnapshot, "summary" | "transitions">,
|
|
@@ -270,7 +293,10 @@ export function createRunStateWatcher(input: {
|
|
|
270
293
|
diagnostics.push({
|
|
271
294
|
code,
|
|
272
295
|
id: ++diagnosticId,
|
|
273
|
-
message:
|
|
296
|
+
message: [formatMarkdownField("watcher", code), formatMarkdownField("scope", scope),
|
|
297
|
+
formatMarkdownField("path", formatLiteralBlock(path)),
|
|
298
|
+
...(detail ? [formatMarkdownField("diagnostic", detail.slice(2))] : []),
|
|
299
|
+
formatMarkdownField("recovery", recovery.slice(2))].join("\n"),
|
|
274
300
|
path,
|
|
275
301
|
scope,
|
|
276
302
|
ts: new Date().toISOString(),
|
|
@@ -404,6 +430,7 @@ export interface RunRetirementExecutorOptions {
|
|
|
404
430
|
}
|
|
405
431
|
|
|
406
432
|
export interface RunTransition {
|
|
433
|
+
ownerId?: string;
|
|
407
434
|
deliveryParent?: {
|
|
408
435
|
run: string;
|
|
409
436
|
run_instance_id: string;
|
|
@@ -427,6 +454,10 @@ export interface RunTransition {
|
|
|
427
454
|
|
|
428
455
|
export interface RunTerminalSemanticResult {
|
|
429
456
|
body?: string;
|
|
457
|
+
/** Marker hints only; source admission belongs to eligible packet collection, never ambient observation. */
|
|
458
|
+
hasPrimaryText?: true;
|
|
459
|
+
hasArtifactInventory?: true;
|
|
460
|
+
hasResultDiagnostics?: true;
|
|
430
461
|
correlationId?: string;
|
|
431
462
|
metadata: Record<string, unknown>;
|
|
432
463
|
summary: string;
|
|
@@ -569,12 +600,14 @@ function terminalSemanticResult(
|
|
|
569
600
|
const type = reviewCompleted
|
|
570
601
|
? "review.completed"
|
|
571
602
|
: observedStatus === "done" ? "run.done" : "run.failed";
|
|
572
|
-
const
|
|
573
|
-
|
|
603
|
+
const hasPrimary = Object.hasOwn(result, "primary_text_protocol");
|
|
604
|
+
const hasDiagnostics = Object.hasOwn(result, "result_diagnostics_protocol");
|
|
605
|
+
const stdoutBody = !hasPrimary && !hasDiagnostics && observedStatus === "done" ? semanticBodyFromStdout(stateDir) : undefined;
|
|
574
606
|
return {
|
|
575
|
-
...(
|
|
576
|
-
|
|
577
|
-
|
|
607
|
+
...(hasPrimary ? { hasPrimaryText: true as const } : {}),
|
|
608
|
+
...(Object.hasOwn(result, "artifact_inventory_protocol") ? { hasArtifactInventory: true as const } : {}),
|
|
609
|
+
...(hasDiagnostics ? { hasResultDiagnostics: true as const } : {}),
|
|
610
|
+
...(!hasDiagnostics && (stdoutBody || typeof result.error === "string") ? { body: stdoutBody ?? result.error as string } : {}),
|
|
578
611
|
...(correlationId ? { correlationId } : {}),
|
|
579
612
|
metadata: {
|
|
580
613
|
...(status.transport_context &&
|
|
@@ -592,9 +625,9 @@ function terminalSemanticResult(
|
|
|
592
625
|
};
|
|
593
626
|
}
|
|
594
627
|
|
|
595
|
-
function observeRun(stateDir: string): RunObservation | undefined {
|
|
628
|
+
function observeRun(stateDir: string, observed?: Record<string, unknown>): RunObservation | undefined {
|
|
596
629
|
try {
|
|
597
|
-
const status = AsyncRuns.getRunStatus(stateDir);
|
|
630
|
+
const status = observed ?? AsyncRuns.getRunStatus(stateDir);
|
|
598
631
|
const progress = getProgress(status);
|
|
599
632
|
const run = typeof status.run === "string" ? status.run : undefined;
|
|
600
633
|
if (!run) return undefined;
|
|
@@ -670,12 +703,26 @@ function observeRun(stateDir: string): RunObservation | undefined {
|
|
|
670
703
|
}
|
|
671
704
|
}
|
|
672
705
|
|
|
706
|
+
function readRunObservations(stateRoot: string): RunObservation[] | undefined {
|
|
707
|
+
if (!existsSync(stateRoot)) return undefined;
|
|
708
|
+
const directories = AsyncRuns.readRunStateIndex(stateRoot)?.map((entry) => entry.state_dir) ?? scanRunStateDirs(stateRoot);
|
|
709
|
+
return AsyncRuns.getRunInventoryStatuses(directories)
|
|
710
|
+
.map((status, index) => status ? observeRun(directories[index], status) : undefined)
|
|
711
|
+
.filter((run): run is RunObservation => Boolean(run));
|
|
712
|
+
}
|
|
713
|
+
|
|
673
714
|
export function summarizeRuns(
|
|
674
715
|
stateRoot = Paths.getRunStateRoot(),
|
|
675
716
|
ownerId?: string,
|
|
676
717
|
deliveryOwnerId?: string,
|
|
677
718
|
): RunSummary {
|
|
678
|
-
|
|
719
|
+
return summarizeRunObservations(readRunObservations(stateRoot), stateRoot, ownerId, deliveryOwnerId);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
function summarizeRunObservations(
|
|
723
|
+
observations: RunObservation[] | undefined, stateRoot: string, ownerId?: string, deliveryOwnerId?: string,
|
|
724
|
+
): RunSummary {
|
|
725
|
+
if (observations === undefined) {
|
|
679
726
|
return {
|
|
680
727
|
cancelled: 0,
|
|
681
728
|
done: 0,
|
|
@@ -688,12 +735,7 @@ export function summarizeRuns(
|
|
|
688
735
|
total: 0,
|
|
689
736
|
};
|
|
690
737
|
}
|
|
691
|
-
const runs =
|
|
692
|
-
AsyncRuns.readRunStateIndex(stateRoot)?.map((entry) => entry.state_dir) ??
|
|
693
|
-
scanRunStateDirs(stateRoot)
|
|
694
|
-
)
|
|
695
|
-
.map((stateDir) => observeRun(stateDir))
|
|
696
|
-
.filter((run): run is RunObservation => Boolean(run))
|
|
738
|
+
const runs = observations
|
|
697
739
|
.filter((run) => deliveryOwnerId !== undefined
|
|
698
740
|
? run.deliveryOwnerId === deliveryOwnerId ||
|
|
699
741
|
(run.deliveryOwnerId === undefined && run.ownerId === deliveryOwnerId)
|
|
@@ -829,8 +871,11 @@ export function countRunningSubagentsByRun(
|
|
|
829
871
|
stateRoot = Paths.getRunStateRoot(),
|
|
830
872
|
ownerId?: string,
|
|
831
873
|
): Map<string, number> {
|
|
874
|
+
// This backend cannot contribute without procfs; do not pay for native Run
|
|
875
|
+
// identity probes (notably synchronous Windows/macOS probes) just to discard them.
|
|
876
|
+
if (!existsSync("/proc")) return new Map();
|
|
832
877
|
const runPidMap = getRunningRunPidMap(stateRoot, ownerId);
|
|
833
|
-
if (runPidMap.size === 0
|
|
878
|
+
if (runPidMap.size === 0) return new Map();
|
|
834
879
|
const signature = [...runPidMap.keys()].sort().join(",");
|
|
835
880
|
const cacheKey = `${stateRoot}\0${ownerId ?? ""}`;
|
|
836
881
|
const cached = procDescendantScanCache.get(cacheKey);
|
|
@@ -960,6 +1005,15 @@ export function findRunRetirementCandidates(
|
|
|
960
1005
|
}));
|
|
961
1006
|
}
|
|
962
1007
|
|
|
1008
|
+
function formatRunRetirementNotice(run: string, action: RunRetirementExecution["action"], message = ""): string {
|
|
1009
|
+
const fields = [formatMarkdownField("run", run.startsWith("run:") ? run.slice(4) : run), formatMarkdownField("retirement", action)];
|
|
1010
|
+
if (action === "stop") fields.push(formatMarkdownField("result", "request returned"), formatMarkdownField("reason", "child runs reached terminal state"));
|
|
1011
|
+
else if (action === "cancel") fields.push(formatMarkdownField("result", "cancellation reported"), formatMarkdownField("reason", "stop path failed"));
|
|
1012
|
+
else fields.push(formatMarkdownField("result", action === "skip" ? "skipped" : "failed"), formatMarkdownField("diagnostic", message));
|
|
1013
|
+
fields.push(formatMarkdownField("closure", "unconfirmed"));
|
|
1014
|
+
return fields.join("\n");
|
|
1015
|
+
}
|
|
1016
|
+
|
|
963
1017
|
export async function executeRunRetirements(
|
|
964
1018
|
summary: RunSummary,
|
|
965
1019
|
options: RunRetirementExecutorOptions,
|
|
@@ -978,7 +1032,7 @@ export async function executeRunRetirements(
|
|
|
978
1032
|
try {
|
|
979
1033
|
await options.sendStop(candidate);
|
|
980
1034
|
options.notify?.(
|
|
981
|
-
|
|
1035
|
+
formatRunRetirementNotice(candidate.run, "stop"),
|
|
982
1036
|
"info",
|
|
983
1037
|
);
|
|
984
1038
|
results.push({
|
|
@@ -995,8 +1049,8 @@ export async function executeRunRetirements(
|
|
|
995
1049
|
);
|
|
996
1050
|
options.notify?.(
|
|
997
1051
|
cancelled
|
|
998
|
-
?
|
|
999
|
-
:
|
|
1052
|
+
? formatRunRetirementNotice(candidate.run, "cancel")
|
|
1053
|
+
: formatRunRetirementNotice(candidate.run, "skip", `${error instanceof Error ? error.message : String(error)}`),
|
|
1000
1054
|
cancelled ? "warning" : "error",
|
|
1001
1055
|
);
|
|
1002
1056
|
results.push({
|
|
@@ -1015,7 +1069,7 @@ export async function executeRunRetirements(
|
|
|
1015
1069
|
? cancelError.message
|
|
1016
1070
|
: String(cancelError);
|
|
1017
1071
|
options.notify?.(
|
|
1018
|
-
|
|
1072
|
+
formatRunRetirementNotice(candidate.run, "failed", `${message}`),
|
|
1019
1073
|
"error",
|
|
1020
1074
|
);
|
|
1021
1075
|
results.push({
|
|
@@ -1052,6 +1106,7 @@ export function detectRunTransitions(
|
|
|
1052
1106
|
transitions.push({
|
|
1053
1107
|
from: old ?? "running",
|
|
1054
1108
|
run: run.run,
|
|
1109
|
+
...(run.ownerId === undefined ? {} : { ownerId: run.ownerId }),
|
|
1055
1110
|
...(run.deliveryParent ? { deliveryParent: run.deliveryParent } : {}),
|
|
1056
1111
|
...(run.stateDir ? { stateDir: run.stateDir } : {}),
|
|
1057
1112
|
...(run.artifacts ? { artifacts: run.artifacts } : {}),
|
|
@@ -1260,35 +1315,6 @@ function relativeName(base: string | undefined, path: string): string {
|
|
|
1260
1315
|
return name && !name.startsWith("..") ? name : basename(path) || path;
|
|
1261
1316
|
}
|
|
1262
1317
|
|
|
1263
|
-
function formatPathGroup(label: string, paths: string[]): string {
|
|
1264
|
-
const unique = [...new Set(paths.filter(Boolean))].slice(0, 8);
|
|
1265
|
-
if (unique.length === 0) return "";
|
|
1266
|
-
const base = commonDirectory(unique);
|
|
1267
|
-
const names = unique
|
|
1268
|
-
.map((path) => `\`${relativeName(base, path)}\``)
|
|
1269
|
-
.join(", ");
|
|
1270
|
-
return `\n${label}:\n- Base: ${base ? `\`${base}\`` : "current run"}\n- Files: ${names}`;
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
function formatRunFileList(files: unknown): string {
|
|
1274
|
-
if (!Array.isArray(files)) return "";
|
|
1275
|
-
return formatPathGroup(
|
|
1276
|
-
"Run files",
|
|
1277
|
-
files.filter((file): file is string => typeof file === "string"),
|
|
1278
|
-
);
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
function formatNamedArtifacts(artifacts: unknown): string {
|
|
1282
|
-
if (!artifacts || typeof artifacts !== "object" || Array.isArray(artifacts))
|
|
1283
|
-
return "";
|
|
1284
|
-
return formatPathGroup(
|
|
1285
|
-
"Artifacts",
|
|
1286
|
-
Object.values(artifacts as Record<string, unknown>).filter(
|
|
1287
|
-
(path): path is string => typeof path === "string",
|
|
1288
|
-
),
|
|
1289
|
-
);
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
1318
|
function getAttentionDataField(event: RunAttentionEvent, key: string): unknown {
|
|
1293
1319
|
return event.data &&
|
|
1294
1320
|
typeof event.data === "object" &&
|
|
@@ -1297,18 +1323,98 @@ function getAttentionDataField(event: RunAttentionEvent, key: string): unknown {
|
|
|
1297
1323
|
: undefined;
|
|
1298
1324
|
}
|
|
1299
1325
|
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1326
|
+
type AttentionPaths = { shown: number; omitted: number; total: number; paths?: string[] };
|
|
1327
|
+
type AttentionMetadata = {
|
|
1328
|
+
run: string; checkpoint: string;
|
|
1329
|
+
body?: "unavailable"; body_reason?: string; body_omission?: string; body_basis?: string; body_upstream?: string;
|
|
1330
|
+
artifacts?: AttentionPaths; run_files?: AttentionPaths;
|
|
1331
|
+
};
|
|
1332
|
+
type AttentionCheckpoint = { metadata: AttentionMetadata; body?: string };
|
|
1333
|
+
|
|
1334
|
+
/** Only selected shallow compiler fields enter YAML; the selected body stays opaque and unindented. */
|
|
1335
|
+
function renderAttention({ metadata, body }: AttentionCheckpoint): string {
|
|
1336
|
+
const header = new Document(metadata).toString({ lineWidth: 0, defaultStringType: "QUOTE_DOUBLE", defaultKeyType: "PLAIN" }).slice(0, -1);
|
|
1337
|
+
return body === undefined ? header : `---\n${header}\n---\n${body}`;
|
|
1306
1338
|
}
|
|
1307
1339
|
|
|
1340
|
+
/** Ordinary selection has no urgent-steer or compact-output byte/depth allowance. */
|
|
1308
1341
|
export function formatRunAttentionMessage(event: RunAttentionEvent): string {
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1342
|
+
const checkpoint = formatAXAttentionCheckpoint(event);
|
|
1343
|
+
if (event.kind === "command.done") return renderAttention(checkpoint);
|
|
1344
|
+
for (const section of attentionPathSections(event)) {
|
|
1345
|
+
checkpoint.metadata[section.key] = formatAXAttentionPaths(
|
|
1346
|
+
section.paths.slice(0, 8).filter(path => Buffer.from(path).toString("utf8") === path), section.paths.length);
|
|
1347
|
+
}
|
|
1348
|
+
return renderAttention(checkpoint);
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
function formatAXAttentionCheckpoint(event: RunAttentionEvent): AttentionCheckpoint {
|
|
1352
|
+
const run = event.run.startsWith("run:") ? event.run.slice(4) : event.run;
|
|
1353
|
+
const metadata: AttentionMetadata = { run, checkpoint: event.summary };
|
|
1354
|
+
const checkpoint: AttentionCheckpoint = { metadata };
|
|
1355
|
+
if (event.kind === "command.done" || event.body === undefined) return checkpoint;
|
|
1356
|
+
const rendered = typeof event.body === "string" ? event.body : JSON.stringify(event.body);
|
|
1357
|
+
if (!rendered.trim()) return checkpoint;
|
|
1358
|
+
let end = Math.min(rendered.length, 500);
|
|
1359
|
+
const last = rendered.charCodeAt(end - 1), next = rendered.charCodeAt(end);
|
|
1360
|
+
if (last >= 0xd800 && last <= 0xdbff && next >= 0xdc00 && next <= 0xdfff) end--;
|
|
1361
|
+
const preview = rendered.slice(0, end), clipped = end < rendered.length;
|
|
1362
|
+
if (Buffer.from(preview).toString("utf8") !== preview) {
|
|
1363
|
+
metadata.body = "unavailable";
|
|
1364
|
+
metadata.body_reason = "malformed_legacy_preview";
|
|
1365
|
+
metadata.body_omission = "[omitted: unknown]";
|
|
1366
|
+
} else {
|
|
1367
|
+
// Retain the old final body observation and structured-preview ellipsis placement, not its compiler fence.
|
|
1368
|
+
checkpoint.body = typeof event.body === "string" ? preview + (clipped ? "…" : "") : preview + (clipped ? "\n…" : "");
|
|
1369
|
+
if (clipped) metadata.body_omission = "[omitted: unknown]";
|
|
1370
|
+
}
|
|
1371
|
+
metadata.body_basis = "Legacy record; original completeness/privacy unproven.";
|
|
1372
|
+
metadata.body_upstream = "[omitted: unknown]";
|
|
1373
|
+
return checkpoint;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
function attentionPathSections(event: RunAttentionEvent): Array<{ key: "artifacts" | "run_files"; paths: string[] }> {
|
|
1377
|
+
const artifacts = getAttentionDataField(event, "artifacts"), files = getAttentionDataField(event, "run_files");
|
|
1378
|
+
if (event.kind === "command.done") return [];
|
|
1379
|
+
return [
|
|
1380
|
+
{ key: "artifacts" as const, values: artifacts && typeof artifacts === "object" && !Array.isArray(artifacts) ? Object.values(artifacts) : [] },
|
|
1381
|
+
{ key: "run_files" as const, values: Array.isArray(files) ? files : [] },
|
|
1382
|
+
].map(({ key, values }) => ({ key,
|
|
1383
|
+
paths: [...new Set(values.filter((value): value is string => typeof value === "string" && value.length > 0))],
|
|
1384
|
+
})).filter(section => section.paths.length > 0);
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
function formatAXAttentionPaths(paths: string[], total: number): AttentionPaths {
|
|
1388
|
+
return { shown: paths.length, omitted: total - paths.length, total, ...(paths.length ? { paths } : {}) };
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/** Saved envelope.content is replayed before this formatter; only fresh complete candidates are fitted. */
|
|
1392
|
+
export function formatRunSteerMessage(event: RunAttentionEvent): string {
|
|
1393
|
+
const limit = Limits.RUN_DELIVERY_STEER_MAX_BYTES;
|
|
1394
|
+
const checkpoint = formatAXAttentionCheckpoint(event);
|
|
1395
|
+
// YAML can escape malformed UTF-16: validate essential source values before serialization or reference reads.
|
|
1396
|
+
if ([checkpoint.metadata.run, checkpoint.metadata.checkpoint].some(value => Buffer.from(value).toString("utf8") !== value)
|
|
1397
|
+
|| Buffer.byteLength(renderAttention(checkpoint)) > limit) {
|
|
1398
|
+
throw new Error("Urgent steer checkpoint text exceeds its Unicode/byte delivery limits");
|
|
1399
|
+
}
|
|
1400
|
+
const sections = attentionPathSections(event);
|
|
1401
|
+
if (event.kind === "command.done") return renderAttention(checkpoint);
|
|
1402
|
+
const selected: AttentionMetadata = { ...checkpoint.metadata };
|
|
1403
|
+
for (const [index, section] of sections.entries()) {
|
|
1404
|
+
const reserve: Partial<AttentionMetadata> = {};
|
|
1405
|
+
for (const next of sections.slice(index + 1)) reserve[next.key] = formatAXAttentionPaths([], next.paths.length);
|
|
1406
|
+
const candidates = section.paths.slice(0, 8).filter(path => Buffer.from(path).toString("utf8") === path);
|
|
1407
|
+
let fitted = false;
|
|
1408
|
+
for (let shown = candidates.length; shown >= 0; shown -= 1) {
|
|
1409
|
+
const group = formatAXAttentionPaths(candidates.slice(0, shown), section.paths.length);
|
|
1410
|
+
const candidate = { ...selected, [section.key]: group, ...reserve };
|
|
1411
|
+
if (Buffer.byteLength(renderAttention({ ...checkpoint, metadata: candidate })) <= limit) {
|
|
1412
|
+
selected[section.key] = group; fitted = true; break;
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
if (!fitted) throw new Error("Urgent steer checkpoint and reference coverage exceed the delivery byte limit");
|
|
1416
|
+
}
|
|
1417
|
+
return renderAttention({ ...checkpoint, metadata: selected });
|
|
1312
1418
|
}
|
|
1313
1419
|
|
|
1314
1420
|
export function getRunTransitionNotificationType(
|
|
@@ -1366,72 +1472,85 @@ function deliveryTreePosition(
|
|
|
1366
1472
|
return { depth, rootIdentity };
|
|
1367
1473
|
}
|
|
1368
1474
|
|
|
1369
|
-
/**
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
deliveryRuns: RunObservation[] = [],
|
|
1373
|
-
): RunCompletionBatchMember[] {
|
|
1374
|
-
const runsByIdentity = new Map(deliveryRuns.flatMap((run) => {
|
|
1475
|
+
/** Eligibility is metadata-only; ambient candidate checks must not read full primary bodies. */
|
|
1476
|
+
function readyRunCompletions(transitions: RunTransition[], deliveryRuns: RunObservation[]) {
|
|
1477
|
+
const runsByIdentity = new Map(deliveryRuns.flatMap(run => {
|
|
1375
1478
|
const identity = deliveryGenerationIdentity(run);
|
|
1376
1479
|
return identity ? [[identity, run] as const] : [];
|
|
1377
1480
|
}));
|
|
1378
|
-
const incompleteRoots = new Set(deliveryRuns.flatMap(
|
|
1481
|
+
const incompleteRoots = new Set(deliveryRuns.flatMap(run => {
|
|
1379
1482
|
if (TERMINAL.has(run.status)) return [];
|
|
1380
1483
|
const position = deliveryTreePosition(run, runsByIdentity);
|
|
1381
1484
|
return position ? [position.rootIdentity] : [];
|
|
1382
1485
|
}));
|
|
1383
|
-
|
|
1384
|
-
if (
|
|
1385
|
-
!
|
|
1386
|
-
!transition.stateDir ||
|
|
1387
|
-
!transition.runInstanceId ||
|
|
1388
|
-
!transition.terminalAt ||
|
|
1389
|
-
Number.isNaN(Date.parse(transition.terminalAt))
|
|
1390
|
-
) return [];
|
|
1486
|
+
return transitions.flatMap(transition => {
|
|
1487
|
+
if (!shouldNotifyRunTransition(transition) || !transition.stateDir || !transition.runInstanceId ||
|
|
1488
|
+
!transition.terminalAt || Number.isNaN(Date.parse(transition.terminalAt))) return [];
|
|
1391
1489
|
const position = deliveryTreePosition(transition, runsByIdentity);
|
|
1392
1490
|
if (!position || incompleteRoots.has(position.rootIdentity)) return [];
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
...(transition.
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1491
|
+
return [{ transition: { ...transition, stateDir: transition.stateDir, runInstanceId: transition.runInstanceId,
|
|
1492
|
+
terminalAt: transition.terminalAt }, depth: position.depth }];
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
export function hasRunCompletionBatchMembers(transitions: RunTransition[], deliveryRuns: RunObservation[] = []): boolean {
|
|
1497
|
+
return readyRunCompletions(transitions, deliveryRuns).length > 0;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
/** Freeze primary/artifact source observations only for eligible members entering packet admission. */
|
|
1501
|
+
export function collectRunCompletionBatchMembers(
|
|
1502
|
+
transitions: RunTransition[],
|
|
1503
|
+
deliveryRuns: RunObservation[] = [],
|
|
1504
|
+
): RunCompletionBatchMember[] {
|
|
1505
|
+
const admitted = readyRunCompletions(transitions, deliveryRuns).map(({ transition, depth }) => {
|
|
1506
|
+
const hasPrimary = transition.semanticResult?.hasPrimaryText === true;
|
|
1507
|
+
const hasDiagnostics = transition.semanticResult?.hasResultDiagnostics === true;
|
|
1508
|
+
const diagnosticReading = hasDiagnostics ? readRunResultDiagnosticOutcome(transition.stateDir, { run: transition.run,
|
|
1509
|
+
run_instance_id: transition.runInstanceId, ...(transition.ownerId === undefined ? {} : { ownerId: transition.ownerId }) }, transition.to) : undefined;
|
|
1510
|
+
const diagnostics = diagnosticReading?.state === "available" && diagnosticReading.terminal_status === transition.to && diagnosticReading.unchanged()
|
|
1511
|
+
? { ...diagnosticReading.binding, diagnostic_excerpt: diagnosticReading.excerpt } : diagnosticReading
|
|
1512
|
+
? { result_diagnostics: null, result_diagnostics_unavailable: diagnosticReading.state === "unavailable"
|
|
1513
|
+
? diagnosticReading.result_diagnostics_unavailable ?? diagnosticReading.reason : diagnosticReading.terminal_status !== transition.to ? "outcome_mismatch" : "observation_changed" } : undefined;
|
|
1514
|
+
const reading = hasPrimary ? readRunCompletionTextSource(transition.stateDir, { run: transition.run,
|
|
1515
|
+
run_instance_id: transition.runInstanceId, ...(transition.ownerId === undefined ? {} : { ownerId: transition.ownerId }) }) : undefined;
|
|
1516
|
+
const primary: Readonly<RunPrimaryTextBinding> | undefined = !reading ? undefined
|
|
1517
|
+
: reading.state === "available" && reading.result_acceptance === "natural" && transition.to === "done" && reading.unchanged()
|
|
1518
|
+
? Object.freeze({ output: reading.original_output ?? reading.output })
|
|
1519
|
+
: Object.freeze({ output: null, output_unavailable: reading.state === "unavailable"
|
|
1520
|
+
? reading.output_unavailable ?? reading.reason : reading.result_acceptance !== "natural" ? "nonterminal_capture" : "observation_changed" });
|
|
1521
|
+
// Existing unsupported session/composition/failure displays stay diagnostics, never substitute for a lost source.
|
|
1522
|
+
const legacyDisplay = !hasPrimary || (reading?.state === "unavailable" && reading.reason === "output_unavailable" &&
|
|
1523
|
+
["not_selected", "selection_not_supported", "primary_not_selected_for_failure"].includes(reading.output_unavailable ?? ""));
|
|
1524
|
+
const body = !hasDiagnostics && legacyDisplay ? transition.semanticResult?.body ??
|
|
1525
|
+
(hasPrimary && transition.to === "done" ? semanticBodyFromStdout(transition.stateDir) : undefined) : undefined;
|
|
1526
|
+
const hasInventory = transition.semanticResult?.hasArtifactInventory === true;
|
|
1527
|
+
const inventoryReading = hasInventory ? readRunResultArtifactInventory(transition.stateDir, { run: transition.run,
|
|
1528
|
+
run_instance_id: transition.runInstanceId, ...(transition.ownerId === undefined ? {} : { ownerId: transition.ownerId }) }) : undefined;
|
|
1529
|
+
const inventory = inventoryReading?.state === "available" && inventoryReading.terminal_status === transition.to && inventoryReading.unchanged() ? inventoryReading.binding : inventoryReading
|
|
1530
|
+
? { artifact_inventory: null, artifact_inventory_unavailable: inventoryReading.state === "unavailable"
|
|
1531
|
+
? inventoryReading.artifact_inventory_unavailable ?? inventoryReading.reason : inventoryReading.terminal_status !== transition.to ? "outcome_mismatch" : "observation_changed" } : undefined;
|
|
1532
|
+
const artifactEntries = hasInventory ? [] : Object.entries(transition.artifacts ?? {})
|
|
1533
|
+
.filter((entry): entry is [string, string] => typeof entry[1] === "string" && Boolean(entry[1])).slice(0, 4);
|
|
1534
|
+
const rawSummary = transition.semanticResult?.summary.trim() || `Run ${transition.to}.`;
|
|
1535
|
+
return {
|
|
1536
|
+
...(artifactEntries.length > 0 ? { artifacts: Object.fromEntries(artifactEntries) } : {}),
|
|
1537
|
+
...(primary ? { primary_text: primary } : {}),
|
|
1538
|
+
...(primary?.output && reading?.state === "available" ? { completion_text: Object.freeze({ text: reading.output.preview,
|
|
1539
|
+
shown_bytes: reading.output.shown_bytes }) } : {}),
|
|
1540
|
+
...inventory,
|
|
1541
|
+
...diagnostics,
|
|
1542
|
+
...(body?.trim() ? { output: body.trim().length > 4_000 ? `${body.trim().slice(0, 3_999)}…` : body.trim() } : {}),
|
|
1543
|
+
...(transition.deliveryParent ? { parent_run: transition.deliveryParent.run,
|
|
1544
|
+
parent_run_instance_id: transition.deliveryParent.run_instance_id, parent_state_dir: transition.deliveryParent.state_dir } : {}),
|
|
1545
|
+
run: transition.run, run_instance_id: transition.runInstanceId, state_dir: transition.stateDir,
|
|
1421
1546
|
status: transition.to as RunCompletionBatchMember["status"],
|
|
1422
|
-
summary: rawSummary.length > 1_000
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
terminal_at: transition.terminalAt,
|
|
1426
|
-
tree_depth: depth,
|
|
1427
|
-
}];
|
|
1547
|
+
summary: rawSummary.length > 1_000 ? `${rawSummary.slice(0, 999)}…` : rawSummary,
|
|
1548
|
+
terminal_at: transition.terminalAt, tree_depth: depth,
|
|
1549
|
+
};
|
|
1428
1550
|
});
|
|
1429
|
-
return admitted.sort((left, right) =>
|
|
1430
|
-
left.
|
|
1431
|
-
left.
|
|
1432
|
-
left.run.localeCompare(right.run) ||
|
|
1433
|
-
left.run_instance_id.localeCompare(right.run_instance_id) ||
|
|
1434
|
-
left.state_dir.localeCompare(right.state_dir)
|
|
1551
|
+
return admitted.sort((left, right) => left.tree_depth - right.tree_depth ||
|
|
1552
|
+
left.terminal_at.localeCompare(right.terminal_at) || left.run.localeCompare(right.run) ||
|
|
1553
|
+
left.run_instance_id.localeCompare(right.run_instance_id) || left.state_dir.localeCompare(right.state_dir)
|
|
1435
1554
|
).map(({ tree_depth: _depth, ...member }) => member);
|
|
1436
1555
|
}
|
|
1437
1556
|
|