@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
|
@@ -15,12 +15,15 @@ import * as RecipesReferences from "./recipes-references.ts";
|
|
|
15
15
|
import * as RecipesUsage from "./recipes-usage.ts";
|
|
16
16
|
import * as Schema from "./schema.ts";
|
|
17
17
|
import * as ToolsResponse from "./tools-response.ts";
|
|
18
|
+
import { readRunFileNavigationForContext } from "./tools-access.ts";
|
|
18
19
|
|
|
19
20
|
type JsonSchema = Schema.JsonSchema;
|
|
20
21
|
|
|
21
22
|
export interface RuntimeToolContext extends ModelContext.CurrentModelContext {
|
|
22
23
|
recipeResolutionContext?: RecipeResolution.RecipeResolutionContext;
|
|
23
24
|
cwd: string;
|
|
25
|
+
/** Kernel-injected only; never sourced from tool input/actor values. */
|
|
26
|
+
onSupervisionClockCaptured?: AsyncRuns.AsyncRunStartOptions["onSupervisionClockCaptured"];
|
|
24
27
|
sessionManager?: { getSessionId?: () => string };
|
|
25
28
|
}
|
|
26
29
|
|
|
@@ -213,6 +216,11 @@ export function createRuntimeToolDefinition(
|
|
|
213
216
|
_onUpdate: unknown,
|
|
214
217
|
ctx: RuntimeToolContext,
|
|
215
218
|
) {
|
|
219
|
+
let dispatchEntered = false;
|
|
220
|
+
const execute: Execution.RegisteredToolExec = (...args) => {
|
|
221
|
+
dispatchEntered = true;
|
|
222
|
+
return exec(...args);
|
|
223
|
+
};
|
|
216
224
|
try {
|
|
217
225
|
if (
|
|
218
226
|
cfg.sourcePath &&
|
|
@@ -231,37 +239,40 @@ export function createRuntimeToolDefinition(
|
|
|
231
239
|
: typeof run_id === "string" && run_id.trim()
|
|
232
240
|
? run_id.trim()
|
|
233
241
|
: `${cfg.name}-${Date.now()}`;
|
|
242
|
+
const startParams: AsyncRuns.AsyncRunStartParams = {
|
|
243
|
+
...base,
|
|
244
|
+
launch_source: "tool",
|
|
245
|
+
launch_correlation: { tool_call_id: toolCallId },
|
|
246
|
+
...(transport_context &&
|
|
247
|
+
typeof transport_context === "object" &&
|
|
248
|
+
!Array.isArray(transport_context)
|
|
249
|
+
? {
|
|
250
|
+
transport_context: transport_context as Record<string, unknown>,
|
|
251
|
+
} : {}),
|
|
252
|
+
ownerId: getRunOwnerId(ctx),
|
|
253
|
+
run_id: runId,
|
|
254
|
+
tool: cfg.name,
|
|
255
|
+
policy_values: ModelContext.withCurrentModelValues(
|
|
256
|
+
{ ...(cfg.recipe?.values ?? {}), ...values },
|
|
257
|
+
ctx,
|
|
258
|
+
),
|
|
259
|
+
values: resolveRecipeToolValues(cfg, values, ctx),
|
|
260
|
+
};
|
|
261
|
+
dispatchEntered = true;
|
|
234
262
|
const meta = AsyncRuns.startRun(
|
|
235
|
-
|
|
236
|
-
...base,
|
|
237
|
-
launch_source: "tool",
|
|
238
|
-
launch_correlation: { tool_call_id: toolCallId },
|
|
239
|
-
...(transport_context &&
|
|
240
|
-
typeof transport_context === "object" &&
|
|
241
|
-
!Array.isArray(transport_context)
|
|
242
|
-
? {
|
|
243
|
-
transport_context: transport_context as Record<string, unknown>,
|
|
244
|
-
} : {}),
|
|
245
|
-
ownerId: getRunOwnerId(ctx),
|
|
246
|
-
run_id: runId,
|
|
247
|
-
tool: cfg.name,
|
|
248
|
-
policy_values: ModelContext.withCurrentModelValues(
|
|
249
|
-
{ ...(cfg.recipe?.values ?? {}), ...values },
|
|
250
|
-
ctx,
|
|
251
|
-
),
|
|
252
|
-
values: resolveRecipeToolValues(cfg, values, ctx),
|
|
253
|
-
},
|
|
263
|
+
startParams,
|
|
254
264
|
ctx.cwd,
|
|
255
|
-
{ skillContext: ctx.recipeResolutionContext?.activeSkills },
|
|
265
|
+
{ skillContext: ctx.recipeResolutionContext?.activeSkills, onSupervisionClockCaptured: ctx.onSupervisionClockCaptured },
|
|
256
266
|
);
|
|
267
|
+
const details = { ...meta, file_navigation: readRunFileNavigationForContext(meta, ctx) };
|
|
257
268
|
return {
|
|
258
269
|
content: [
|
|
259
270
|
{
|
|
260
271
|
type: "text" as const,
|
|
261
|
-
text: ToolsResponse.compactAsyncRunStatus(
|
|
272
|
+
text: ToolsResponse.compactAsyncRunStatus(details),
|
|
262
273
|
},
|
|
263
274
|
],
|
|
264
|
-
details
|
|
275
|
+
details,
|
|
265
276
|
};
|
|
266
277
|
}
|
|
267
278
|
if (isRecipe && recipeTemplate) {
|
|
@@ -272,7 +283,7 @@ export function createRuntimeToolDefinition(
|
|
|
272
283
|
params as Record<string, unknown>,
|
|
273
284
|
ctx,
|
|
274
285
|
),
|
|
275
|
-
|
|
286
|
+
execute,
|
|
276
287
|
ctx.cwd,
|
|
277
288
|
signal,
|
|
278
289
|
);
|
|
@@ -286,11 +297,13 @@ export function createRuntimeToolDefinition(
|
|
|
286
297
|
),
|
|
287
298
|
cfg.argTypes,
|
|
288
299
|
),
|
|
289
|
-
|
|
300
|
+
execute,
|
|
290
301
|
ctx.cwd,
|
|
291
302
|
signal,
|
|
292
303
|
);
|
|
293
304
|
} catch (error) {
|
|
305
|
+
// Dispatch entry is not effect/closure proof; matching error text cannot justify argument repair or retry.
|
|
306
|
+
if (dispatchEntered) throw error;
|
|
294
307
|
throw formatRuntimeToolArgumentError(
|
|
295
308
|
cfg,
|
|
296
309
|
error,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public Control facade under the stable `message` tool name.
|
|
3
|
-
* Zones: Control request validation, Run/runtime dispatch,
|
|
3
|
+
* Zones: Control request validation, Run/runtime dispatch, recipient-scoped receipts
|
|
4
4
|
* Owns public Control execution; journaling, delivery, and lifecycle mutation stay in Run domains.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -8,6 +8,7 @@ import * as AsyncRuns from "./async-runs.ts";
|
|
|
8
8
|
import * as Control from "./control.ts";
|
|
9
9
|
import * as Schema from "./schema.ts";
|
|
10
10
|
import * as ToolsAccess from "./tools-access.ts";
|
|
11
|
+
import * as Limits from "./limits.ts";
|
|
11
12
|
import * as ToolsResponse from "./tools-response.ts";
|
|
12
13
|
|
|
13
14
|
function asRecord(value: unknown): Record<string, unknown> {
|
|
@@ -16,32 +17,92 @@ function asRecord(value: unknown): Record<string, unknown> {
|
|
|
16
17
|
: {};
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
const controlField = ToolsResponse.formatMarkdownField;
|
|
21
|
+
|
|
22
|
+
/** Only the four compiler-owned guard sites below; never wraps dispatch/dependency errors. */
|
|
23
|
+
function controlGuardText(
|
|
24
|
+
request: Control.ControlRequest,
|
|
25
|
+
result: "unsupported runtime Control action" | "runtime Control is unavailable" | "Run generation unavailable" | "undeclared Run Control action",
|
|
26
|
+
options?: { key: "supported_actions" | "available_actions"; values: readonly string[] },
|
|
27
|
+
): string {
|
|
28
|
+
const key = request.target === "runtime" ? "target" : "run";
|
|
29
|
+
const identity = controlField(key, request.target === "runtime" ? request.target : request.target.slice(4));
|
|
30
|
+
const omittedIdentity = `- ${key}: [omitted]\n- ${key}_omission:\n - reason: response_too_large\n - shown: 0\n - omitted: 1\n - total: 1`;
|
|
31
|
+
const fixed = [controlField("action", request.action), controlField("result", result)];
|
|
32
|
+
let fullOptions = "", omittedOptions = "";
|
|
33
|
+
if (options) {
|
|
34
|
+
const rows: string[] = [];
|
|
35
|
+
let malformed = false;
|
|
36
|
+
// Values were selected by the original string filter, not by a new action grammar.
|
|
37
|
+
for (let index = 0; index < options.values.length; index++) {
|
|
38
|
+
const value = options.values[index];
|
|
39
|
+
if (!value.isWellFormed()) { malformed = true; break; }
|
|
40
|
+
rows.push(" - " + value.replaceAll(/\r\n|\r|\n/gu, newline => newline + " "));
|
|
41
|
+
}
|
|
42
|
+
omittedOptions = `- ${options.key}: [${malformed ? "unavailable" : "omitted"}]\n- ${options.key}_omission:\n - reason: ${malformed ? "malformed_selected_text" : "response_too_large"}\n - shown: 0\n - omitted: ${options.values.length}\n - total: ${options.values.length}`;
|
|
43
|
+
fullOptions = malformed ? omittedOptions : rows.length ? `- ${options.key}:\n${rows.join("\n")}` : controlField(options.key, "none");
|
|
44
|
+
}
|
|
45
|
+
// Start with the shorter complete-or-omitted rendering: adding an omission scaffold must
|
|
46
|
+
// never manufacture overflow when the complete small field would fit. Then grow only.
|
|
47
|
+
let selectedIdentity = Buffer.byteLength(identity) <= Buffer.byteLength(omittedIdentity) ? identity : omittedIdentity;
|
|
48
|
+
let selectedOptions = Buffer.byteLength(fullOptions) <= Buffer.byteLength(omittedOptions) ? fullOptions : omittedOptions;
|
|
49
|
+
const render = (target: string, choices: string) => ToolsResponse.withLeadingLineBreak(
|
|
50
|
+
[target, ...fixed, ...(options ? [choices] : [])].join("\n"));
|
|
51
|
+
if (Buffer.byteLength(render(identity, selectedOptions)) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES) selectedIdentity = identity;
|
|
52
|
+
if (options && Buffer.byteLength(render(selectedIdentity, fullOptions)) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES) selectedOptions = fullOptions;
|
|
53
|
+
return render(selectedIdentity, selectedOptions);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function controlNext(action: string): string {
|
|
57
|
+
const inspect = /^inspect target=([^\s]+) view=([^\s]+)$/u.exec(action);
|
|
58
|
+
return inspect ? ToolsResponse.formatInspectNextAction(inspect[1], inspect[2])
|
|
59
|
+
: "- next:\n" + controlField("instruction", action, 1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Pure first-layer copy; legacy stopped/killed flags are not scope-closure proof. */
|
|
63
|
+
export function compactControlResult(
|
|
20
64
|
request: Control.ControlRequest,
|
|
21
65
|
result: Record<string, unknown>,
|
|
22
66
|
): string {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
67
|
+
const fields = [request.target.startsWith("run:") ? controlField("run", request.target.slice(4)) : controlField("target", request.target),
|
|
68
|
+
controlField("action", request.action)];
|
|
69
|
+
if (result.stopped === false || result.archived === false || result.pruned === false) {
|
|
70
|
+
fields.push(controlField("result", "not applied"));
|
|
71
|
+
if (typeof result.reason === "string") fields.push(controlField("reason", result.reason));
|
|
72
|
+
const observed = asRecord(result.status);
|
|
73
|
+
if (result.reason === "not running" && typeof observed.status === "string") fields.push(controlField("state", observed.status));
|
|
74
|
+
} else if (request.action === "kill" && result.stopped === true) {
|
|
75
|
+
fields.push(controlField("result", "kill attempted"), controlField("termination", "unconfirmed"));
|
|
76
|
+
} else if (result.archived === true) {
|
|
77
|
+
fields.push(controlField("result", "archived"));
|
|
78
|
+
} else if (result.pruned === true) {
|
|
79
|
+
fields.push(controlField("result", "pruned"));
|
|
80
|
+
} else if (result.delivery === "queued" || result.delivery === "delivered") {
|
|
81
|
+
fields.push(controlField("delivery", result.delivery), controlField("handling", "unconfirmed"));
|
|
82
|
+
} else {
|
|
83
|
+
fields.push(controlField(typeof result.delivery === "string" ? "delivery" : "result",
|
|
84
|
+
typeof result.delivery === "string" ? result.delivery : typeof result.status === "string" ? result.status : "accepted"));
|
|
85
|
+
if (typeof result.reason === "string") fields.push(controlField("reason", result.reason));
|
|
36
86
|
}
|
|
37
|
-
|
|
87
|
+
if (typeof result.control_id === "string") fields.push(controlField("control_id", result.control_id));
|
|
88
|
+
const actions = Array.isArray(result.next_actions) ? result.next_actions
|
|
89
|
+
: request.target.startsWith("run:") ? runNextActions(request.target.slice(4), result) : [];
|
|
90
|
+
const next = actions.find((action): action is string => typeof action === "string" && action.length > 0);
|
|
91
|
+
if (next) fields.push(controlNext(next));
|
|
92
|
+
return ToolsResponse.withLeadingLineBreak(fields.join("\n"));
|
|
38
93
|
}
|
|
39
94
|
|
|
40
95
|
function runNextActions(run: string, result: Record<string, unknown>): string[] {
|
|
96
|
+
if (result.stopped === true) return [`inspect target=run:${run} view=trace`];
|
|
97
|
+
if (result.stopped === false || result.archived === false || result.pruned === false) {
|
|
98
|
+
if (result.reason === "ownership changed" || result.reason === "run generation changed") {
|
|
99
|
+
return ["inspect target=runtime view=runs"];
|
|
100
|
+
}
|
|
101
|
+
if (result.stopped === false && result.reason !== "not running") return [`inspect target=run:${run} view=trace`];
|
|
102
|
+
}
|
|
41
103
|
if (result.delivery === "queued" || result.delivery === "delivered") {
|
|
42
104
|
return [`inspect target=run:${run} view=control`];
|
|
43
105
|
}
|
|
44
|
-
if (result.stopped === true) return [`inspect target=run:${run} view=control`];
|
|
45
106
|
return [];
|
|
46
107
|
}
|
|
47
108
|
|
|
@@ -85,12 +146,12 @@ export function createControlToolDefinition<TContext = unknown>(
|
|
|
85
146
|
let result: Record<string, unknown>;
|
|
86
147
|
if (request.target === "runtime") {
|
|
87
148
|
if (request.action !== "review.retry" && request.action !== "review.reset") {
|
|
88
|
-
throw new Error(
|
|
89
|
-
|
|
90
|
-
);
|
|
149
|
+
throw new Error(controlGuardText(request, "unsupported runtime Control action", {
|
|
150
|
+
key: "supported_actions", values: ["review.retry", "review.reset"],
|
|
151
|
+
}));
|
|
91
152
|
}
|
|
92
153
|
if (!deps.handleRuntimeControl) {
|
|
93
|
-
throw new Error("runtime Control is unavailable");
|
|
154
|
+
throw new Error(controlGuardText(request, "runtime Control is unavailable"));
|
|
94
155
|
}
|
|
95
156
|
result = deps.handleRuntimeControl(request.action, request.input);
|
|
96
157
|
} else {
|
|
@@ -106,7 +167,7 @@ export function createControlToolDefinition<TContext = unknown>(
|
|
|
106
167
|
typeof status.run_instance_id === "string"
|
|
107
168
|
? status.run_instance_id
|
|
108
169
|
: undefined;
|
|
109
|
-
if (!runInstanceId) throw new Error(
|
|
170
|
+
if (!runInstanceId) throw new Error(controlGuardText(request, "Run generation unavailable"));
|
|
110
171
|
if (request.action === "kill") {
|
|
111
172
|
result = AsyncRuns.killRun(run, {
|
|
112
173
|
...(typeof status.ownerId === "string"
|
|
@@ -144,23 +205,45 @@ export function createControlToolDefinition<TContext = unknown>(
|
|
|
144
205
|
)
|
|
145
206
|
: [];
|
|
146
207
|
if (!declared.includes(request.action)) {
|
|
147
|
-
throw
|
|
148
|
-
|
|
208
|
+
// The old join/template evaluation may itself throw or have observable hooks.
|
|
209
|
+
// Preserve it before the new presentation; it is not an action-list parser.
|
|
210
|
+
void `${declared.join(",") || "none"}`;
|
|
211
|
+
throw new Error(controlGuardText(request, "undeclared Run Control action", {
|
|
212
|
+
key: "available_actions", values: declared,
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
result = await AsyncRuns.sendRunControl(
|
|
217
|
+
run,
|
|
218
|
+
{
|
|
219
|
+
action: request.action,
|
|
220
|
+
...(request.input !== undefined ? { input: request.input } : {}),
|
|
221
|
+
run_instance_id: runInstanceId,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
...(typeof status.ownerId === "string"
|
|
225
|
+
? { ownerId: status.ownerId }
|
|
226
|
+
: {}),
|
|
227
|
+
},
|
|
149
228
|
);
|
|
229
|
+
} catch (cause) {
|
|
230
|
+
// Admission-era correlation is not current reply-scope proof after an awaited dispatch.
|
|
231
|
+
const summary = [controlField("action", request.action), controlField("result", "request failed"),
|
|
232
|
+
controlField("delivery", "unconfirmed"), controlField("handling", "unconfirmed"),
|
|
233
|
+
controlField("warning", "Effects may already exist.\nDo not repeat automatically."),
|
|
234
|
+
controlNext("inspect target=runtime view=runs")].join("\n");
|
|
235
|
+
// Reserve both line breaks; display one whole caller-owned id or explicit whole-id omission.
|
|
236
|
+
const identity = controlField("run", run);
|
|
237
|
+
const target = Buffer.byteLength(identity) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - Buffer.byteLength(summary) - 2
|
|
238
|
+
? identity
|
|
239
|
+
: "- run: [omitted]\n- run_omission:\n - reason: response_too_large\n - shown: 0\n - omitted: 1\n - total: 1";
|
|
240
|
+
throw new Error(ToolsResponse.withLeadingLineBreak(target + "\n" + summary), { cause });
|
|
150
241
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
run_instance_id: runInstanceId,
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
...(typeof status.ownerId === "string"
|
|
160
|
-
? { ownerId: status.ownerId }
|
|
161
|
-
: {}),
|
|
162
|
-
},
|
|
163
|
-
);
|
|
242
|
+
}
|
|
243
|
+
// A refused identity change must not publish the replacement's status, even in verbose/details.
|
|
244
|
+
if (result.reason === "ownership changed" || result.reason === "run generation changed") {
|
|
245
|
+
result = { ...result };
|
|
246
|
+
delete result.status;
|
|
164
247
|
}
|
|
165
248
|
const nextActions = runNextActions(run, result);
|
|
166
249
|
if (nextActions.length > 0) result = { ...result, next_actions: nextActions };
|