@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
|
@@ -10,21 +10,38 @@ import * as Config from "./config.js";
|
|
|
10
10
|
import * as ExecutionOutput from "./execution-output.js";
|
|
11
11
|
import { withFileMutationLock, writeJsonAtomic, writeTextAtomic, } from "./file-state.js";
|
|
12
12
|
import * as Identity from "./identity.js";
|
|
13
|
+
import * as Limits from "./limits.js";
|
|
13
14
|
import * as Paths from "./paths.js";
|
|
14
15
|
import * as RecipesContext from "./recipes-context.js";
|
|
15
16
|
import * as RecipesDiscovery from "./recipes-discovery.js";
|
|
16
17
|
import * as RecipesReferences from "./recipes-references.js";
|
|
17
18
|
import * as Schema from "./schema.js";
|
|
19
|
+
import * as ToolsResponse from "./tools-response.js";
|
|
18
20
|
function textContent(text) {
|
|
19
21
|
return { type: "text", text };
|
|
20
22
|
}
|
|
23
|
+
function registryListText(rows) {
|
|
24
|
+
const coverage = (shown, reason) => "\n- registered_tools_coverage:" +
|
|
25
|
+
(reason ? `\n - reason: ${reason}` : "") + `\n - shown: ${shown}\n - omitted: ${rows.length - shown}\n - total: ${rows.length}`;
|
|
26
|
+
const malformed = rows.some(row => !row.isWellFormed());
|
|
27
|
+
if (!malformed) {
|
|
28
|
+
// Rows already contain the old compiler-owned bullet and selected key coercion.
|
|
29
|
+
const body = rows.length ? "- registered_tools:\n" + rows.map(row => " " + row.replaceAll(/\r\n|\r|\n/gu, newline => newline + " ")).join("\n")
|
|
30
|
+
: "- registered_tools: none";
|
|
31
|
+
const complete = body + coverage(rows.length);
|
|
32
|
+
if (Buffer.byteLength(complete) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
33
|
+
return complete;
|
|
34
|
+
}
|
|
35
|
+
return `- registered_tools: [${malformed ? "unavailable" : "omitted"}]` + coverage(0, malformed ? "malformed_selected_text" : "response_too_large");
|
|
36
|
+
}
|
|
21
37
|
function listTools(deps) {
|
|
22
38
|
const names = [...deps.getTools().keys()].sort();
|
|
39
|
+
const rows = names.length > 0 ? names.map((name) => `- ${name}`) : [];
|
|
40
|
+
// Retain the original conditional map/join observations before read-time projection.
|
|
41
|
+
void (names.length > 0 ? `Registered tools:\n${rows.join("\n")}` : "No registered tools.");
|
|
23
42
|
return {
|
|
24
43
|
content: [
|
|
25
|
-
textContent(ExecutionOutput.formatToolText(
|
|
26
|
-
? `Registered tools:\n${names.map((name) => `- ${name}`).join("\n")}`
|
|
27
|
-
: "No registered tools.")),
|
|
44
|
+
textContent(ExecutionOutput.formatToolText(registryListText(rows))),
|
|
28
45
|
],
|
|
29
46
|
details: { tool: "register_tool" },
|
|
30
47
|
};
|
|
@@ -65,12 +82,153 @@ function registrationNextActions(tool, source, callableNow) {
|
|
|
65
82
|
: [recipeDoctorAction(source)]),
|
|
66
83
|
];
|
|
67
84
|
}
|
|
85
|
+
/** Read-time text only: callers supply the original post-activation selections, not live ports. */
|
|
86
|
+
function registrationReceiptText(data) {
|
|
87
|
+
const field = ToolsResponse.formatMarkdownField;
|
|
88
|
+
const omission = (key, count, malformed) => `- ${key}: [${malformed ? "unavailable" : "omitted"}]\n- ${key}_omission:\n - reason: ${malformed ? "malformed_selected_text" : "response_too_large"}\n - shown: 0\n - omitted: ${count}\n - total: ${count}`;
|
|
89
|
+
const part = (full, omitted) => ({ full, selected: Buffer.byteLength(full) <= Buffer.byteLength(omitted) ? full : omitted });
|
|
90
|
+
const scalar = (key, value, literal = false) => {
|
|
91
|
+
const wellFormed = value.isWellFormed();
|
|
92
|
+
const omitted = omission(key, 1, !wellFormed);
|
|
93
|
+
return part(wellFormed ? field(key, literal ? ToolsResponse.formatLiteralBlock(value) : value) : omitted, omitted);
|
|
94
|
+
};
|
|
95
|
+
const sequence = (key, values) => {
|
|
96
|
+
const rows = [];
|
|
97
|
+
let malformed = false;
|
|
98
|
+
for (let index = 0; index < values.length; index++) {
|
|
99
|
+
const value = values[index];
|
|
100
|
+
if (typeof value !== "string" || !value.isWellFormed()) {
|
|
101
|
+
malformed = true;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
rows.push(" - " + value.replaceAll(/\r\n|\r|\n/gu, newline => newline + " "));
|
|
105
|
+
}
|
|
106
|
+
const omitted = omission(key, values.length, malformed);
|
|
107
|
+
return part(malformed ? omitted : rows.length ? `- ${key}:\n${rows.join("\n")}` : field(key, "none"), omitted);
|
|
108
|
+
};
|
|
109
|
+
const tool = scalar("tool", data.tool);
|
|
110
|
+
const source = scalar("source", data.source, data.source !== "template");
|
|
111
|
+
const required = sequence("required_args", data.required), optional = sequence("optional_args", data.optional);
|
|
112
|
+
const warnings = data.warnings.length ? sequence("warnings", data.warnings) : undefined;
|
|
113
|
+
const nextWellFormed = data.next.isWellFormed();
|
|
114
|
+
const omittedNext = omission("next_action", 1, !nextWellFormed);
|
|
115
|
+
// This producer knows only its existing status hint; invocation advice stays opaque.
|
|
116
|
+
const next = part(nextWellFormed
|
|
117
|
+
? data.callable ? field("instruction", data.next) : ToolsResponse.formatInspectNextAction(`tool:${data.tool}`, "status")
|
|
118
|
+
: omittedNext, omittedNext);
|
|
119
|
+
const render = () => [tool.selected, field("result", data.result), source.selected, field("callable_now", data.callable ? "true" : "false"),
|
|
120
|
+
...(data.boundary === undefined ? [] : [field("activation_boundary", data.boundary)]), required.selected, optional.selected,
|
|
121
|
+
...(warnings ? [warnings.selected] : []), next.selected].join("\n");
|
|
122
|
+
// Preserve complete safety notes before large argument lists; all seeds are monotone.
|
|
123
|
+
for (const current of [...(warnings ? [warnings] : []), tool, source, next, required, optional]) {
|
|
124
|
+
if (current.selected === current.full)
|
|
125
|
+
continue;
|
|
126
|
+
const previous = current.selected;
|
|
127
|
+
current.selected = current.full;
|
|
128
|
+
if (Buffer.byteLength(render()) > Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
129
|
+
current.selected = previous;
|
|
130
|
+
}
|
|
131
|
+
return render();
|
|
132
|
+
}
|
|
133
|
+
function registryNoticeText(kind, name) {
|
|
134
|
+
const report = { activated: "Tool activated", promoted: "Promoted draft recipe", deleted: "Deleted tool" }[kind];
|
|
135
|
+
const selected = name.isWellFormed() ? ToolsResponse.formatMarkdownField("tool", name)
|
|
136
|
+
: "- tool: [unavailable]\n- tool_omission:\n - reason: malformed_selected_text\n - shown: 0\n - omitted: 1\n - total: 1";
|
|
137
|
+
return ToolsResponse.formatMarkdownField("report", report) + "\n" + selected;
|
|
138
|
+
}
|
|
139
|
+
function registrationTransactionFailureText(stage, generation, summary, error) {
|
|
140
|
+
const field = ToolsResponse.formatMarkdownField;
|
|
141
|
+
const part = (key, value) => {
|
|
142
|
+
const wellFormed = value.isWellFormed();
|
|
143
|
+
const omitted = `- ${key}: [${wellFormed ? "omitted" : "unavailable"}]\n- ${key}_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`;
|
|
144
|
+
const full = wellFormed ? field(key, value) : omitted;
|
|
145
|
+
return { full, selected: Buffer.byteLength(full) <= Buffer.byteLength(omitted) ? full : omitted };
|
|
146
|
+
};
|
|
147
|
+
const selectedGeneration = part("resolution_generation", generation);
|
|
148
|
+
const selectedSummary = part("active_skills_summary", summary);
|
|
149
|
+
const selectedError = part("error", error);
|
|
150
|
+
const render = () => [field("result", "Tool registration transaction failed."), field("stage", stage),
|
|
151
|
+
selectedGeneration.selected, selectedSummary.selected, selectedError.selected].join("\n");
|
|
152
|
+
// Keep a fitting surfaced error before large optional resolution metadata.
|
|
153
|
+
for (const current of [selectedError, selectedGeneration, selectedSummary]) {
|
|
154
|
+
if (current.selected === current.full)
|
|
155
|
+
continue;
|
|
156
|
+
const previous = current.selected;
|
|
157
|
+
current.selected = current.full;
|
|
158
|
+
if (Buffer.byteLength(render()) > Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
159
|
+
current.selected = previous;
|
|
160
|
+
}
|
|
161
|
+
return render();
|
|
162
|
+
}
|
|
163
|
+
function candidateAdmissionFailureText(data) {
|
|
164
|
+
const field = ToolsResponse.formatMarkdownField;
|
|
165
|
+
const part = (key, value, literal = false) => {
|
|
166
|
+
const wellFormed = value.isWellFormed();
|
|
167
|
+
const omitted = `- ${key}: [${wellFormed ? "omitted" : "unavailable"}]\n- ${key}_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`;
|
|
168
|
+
const full = wellFormed ? field(key, literal ? ToolsResponse.formatLiteralBlock(value) : value) : omitted;
|
|
169
|
+
return { full, selected: Buffer.byteLength(full) <= Buffer.byteLength(omitted) ? full : omitted };
|
|
170
|
+
};
|
|
171
|
+
const diagnostics = part("diagnostics_summary", data.diagnostics);
|
|
172
|
+
const source = data.kind === "source" ? part("source", data.source, true) : undefined;
|
|
173
|
+
const summary = data.kind === "source" ? part("active_skills_summary", data.summary) : undefined;
|
|
174
|
+
const instruction = data.kind === "source" ? part("instruction", data.instruction) : undefined;
|
|
175
|
+
const render = () => [field("field", "recipe"), ...(source ? [source.selected] : []),
|
|
176
|
+
field("result", data.kind === "source" ? "Recipe source validation failed." : "Tool recipe validation failed."),
|
|
177
|
+
diagnostics.selected, ...(summary ? [summary.selected] : []), ...(instruction ? [instruction.selected] : [])].join("\n");
|
|
178
|
+
// Preserve fitting diagnostics before large optional source/context/advice fields.
|
|
179
|
+
for (const current of [diagnostics, source, summary, instruction]) {
|
|
180
|
+
if (!current || current.selected === current.full)
|
|
181
|
+
continue;
|
|
182
|
+
const previous = current.selected;
|
|
183
|
+
current.selected = current.full;
|
|
184
|
+
if (Buffer.byteLength(render()) > Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
185
|
+
current.selected = previous;
|
|
186
|
+
}
|
|
187
|
+
return render();
|
|
188
|
+
}
|
|
189
|
+
function sourceNormalizationFailureText(source, reason, summary, instruction) {
|
|
190
|
+
const field = ToolsResponse.formatMarkdownField;
|
|
191
|
+
const part = (key, value, literal = false) => {
|
|
192
|
+
const wellFormed = value.isWellFormed();
|
|
193
|
+
const omitted = `- ${key}: [${wellFormed ? "omitted" : "unavailable"}]\n- ${key}_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`;
|
|
194
|
+
const full = wellFormed ? field(key, literal ? ToolsResponse.formatLiteralBlock(value) : value) : omitted;
|
|
195
|
+
return { full, selected: Buffer.byteLength(full) <= Buffer.byteLength(omitted) ? full : omitted };
|
|
196
|
+
};
|
|
197
|
+
const selectedSource = part("source", source, true);
|
|
198
|
+
const selectedReason = part("reason", reason);
|
|
199
|
+
const selectedSummary = part("active_skills_summary", summary);
|
|
200
|
+
const selectedInstruction = part("instruction", instruction);
|
|
201
|
+
const render = () => [field("field", "from"), selectedSource.selected, field("result", "Recipe source is invalid."),
|
|
202
|
+
selectedReason.selected, selectedSummary.selected, selectedInstruction.selected].join("\n");
|
|
203
|
+
for (const current of [selectedSource, selectedReason, selectedSummary, selectedInstruction]) {
|
|
204
|
+
if (current.selected === current.full)
|
|
205
|
+
continue;
|
|
206
|
+
const previous = current.selected;
|
|
207
|
+
current.selected = current.full;
|
|
208
|
+
if (Buffer.byteLength(render()) > Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
209
|
+
current.selected = previous;
|
|
210
|
+
}
|
|
211
|
+
return render();
|
|
212
|
+
}
|
|
68
213
|
function activeSkillSummary(resolutionContext) {
|
|
69
214
|
const names = Object.keys(RecipesReferences.getActiveSkillRecipeNamespaces(resolutionContext.activeSkills))
|
|
70
215
|
.sort()
|
|
71
216
|
.slice(0, 20);
|
|
72
217
|
return names.length > 0 ? names.join(", ") : "<none>";
|
|
73
218
|
}
|
|
219
|
+
function draftPathFailureText(kind, reference) {
|
|
220
|
+
const key = kind === "root" ? "allowed_root" : "path";
|
|
221
|
+
const render = (selected) => "- field: draft\n" + selected + (kind === "root"
|
|
222
|
+
? "\n- result: Draft must be under the allowed root.\n- instruction: Use inspect target=recipes view=summary to list drafts."
|
|
223
|
+
: "\n- result: Draft not found.");
|
|
224
|
+
const wellFormed = reference.isWellFormed();
|
|
225
|
+
if (wellFormed) {
|
|
226
|
+
const complete = render(ToolsResponse.formatMarkdownField(key, ToolsResponse.formatLiteralBlock(reference)));
|
|
227
|
+
if (Buffer.byteLength(complete) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
228
|
+
return complete;
|
|
229
|
+
}
|
|
230
|
+
return render(`- ${key}: [${wellFormed ? "omitted" : "unavailable"}]\n- ${key}_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`);
|
|
231
|
+
}
|
|
74
232
|
function assertDraftPath(deps, draft) {
|
|
75
233
|
const draftRoot = resolve(getRecipeRoot(deps), "drafts");
|
|
76
234
|
const path = resolve(draft);
|
|
@@ -78,13 +236,59 @@ function assertDraftPath(deps, draft) {
|
|
|
78
236
|
if (relation === "" ||
|
|
79
237
|
relation.startsWith("..") ||
|
|
80
238
|
resolve(relation) === relation) {
|
|
81
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
239
|
+
throw new Error(ExecutionOutput.formatToolText(draftPathFailureText("root", `${draftRoot}`)));
|
|
82
240
|
}
|
|
83
241
|
if (!existsSync(path)) {
|
|
84
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
242
|
+
throw new Error(ExecutionOutput.formatToolText(draftPathFailureText("missing", `${path}`)));
|
|
85
243
|
}
|
|
86
244
|
return path;
|
|
87
245
|
}
|
|
246
|
+
function draftReceiptText(result, tool, callable, next) {
|
|
247
|
+
const field = ToolsResponse.formatMarkdownField;
|
|
248
|
+
const part = (key, value, rendered) => {
|
|
249
|
+
const wellFormed = value.isWellFormed();
|
|
250
|
+
const omitted = `- ${key}: [${wellFormed ? "omitted" : "unavailable"}]\n- ${key}_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`;
|
|
251
|
+
const full = wellFormed ? rendered : omitted;
|
|
252
|
+
return { full, selected: Buffer.byteLength(full) <= Buffer.byteLength(omitted) ? full : omitted };
|
|
253
|
+
};
|
|
254
|
+
const identity = part("tool", tool, field("tool", tool));
|
|
255
|
+
const flag = part("callable_now", callable, field("callable_now", callable));
|
|
256
|
+
// Only this producer's exact canonical read-only status hint is typed, never body advice.
|
|
257
|
+
const status = /^inspect target=(tool:[a-z][a-z0-9_]{0,63}) view=status$/u.exec(next);
|
|
258
|
+
const hint = part("next_action", next, status ? ToolsResponse.formatInspectNextAction(status[1], "status") : field("instruction", next));
|
|
259
|
+
const render = () => [identity.selected, field("result", result), field("source", "draft"), flag.selected, hint.selected].join("\n");
|
|
260
|
+
for (const current of [identity, flag, hint]) {
|
|
261
|
+
if (current.selected === current.full)
|
|
262
|
+
continue;
|
|
263
|
+
const previous = current.selected;
|
|
264
|
+
current.selected = current.full;
|
|
265
|
+
if (Buffer.byteLength(render()) > Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
266
|
+
current.selected = previous;
|
|
267
|
+
}
|
|
268
|
+
return render();
|
|
269
|
+
}
|
|
270
|
+
function duplicateRegistrationText(value) {
|
|
271
|
+
const render = (selected) => "- field: name\n" + selected + "\n- result: Tool already registered.\n- instruction: Use update=true to overwrite.";
|
|
272
|
+
const wellFormed = value.isWellFormed();
|
|
273
|
+
if (wellFormed) {
|
|
274
|
+
const complete = render(ToolsResponse.formatMarkdownField("value", value));
|
|
275
|
+
if (Buffer.byteLength(complete) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
276
|
+
return complete;
|
|
277
|
+
}
|
|
278
|
+
return render(`- value: [${wellFormed ? "omitted" : "unavailable"}]\n- value_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`);
|
|
279
|
+
}
|
|
280
|
+
function draftRecipeFailureText(key, value) {
|
|
281
|
+
const header = "- field: draft\n- result: Draft recipe is invalid.";
|
|
282
|
+
if (value === undefined)
|
|
283
|
+
return header;
|
|
284
|
+
const wellFormed = value.isWellFormed();
|
|
285
|
+
if (wellFormed) {
|
|
286
|
+
const complete = header + "\n" + ToolsResponse.formatMarkdownField(key, value);
|
|
287
|
+
if (Buffer.byteLength(complete) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
288
|
+
return complete;
|
|
289
|
+
}
|
|
290
|
+
return header + `\n- ${key}: [${wellFormed ? "omitted" : "unavailable"}]\n- ${key}_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`;
|
|
291
|
+
}
|
|
88
292
|
function promoteDraftRecipe(name, input, ctx, deps) {
|
|
89
293
|
const draftPath = assertDraftPath(deps, String(input.draft ?? ""));
|
|
90
294
|
const targetPath = getToolRecipePath(deps, name);
|
|
@@ -94,12 +298,12 @@ function promoteDraftRecipe(name, input, ctx, deps) {
|
|
|
94
298
|
if (blocker)
|
|
95
299
|
throw new Error(ExecutionOutput.formatToolText(blocker));
|
|
96
300
|
if ((existing || existsSync(targetPath)) && !input.update) {
|
|
97
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
301
|
+
throw new Error(ExecutionOutput.formatToolText(duplicateRegistrationText(`${name}`)));
|
|
98
302
|
}
|
|
99
303
|
const raw = RecipesReferences.readRawRecipeConfig(draftPath);
|
|
100
304
|
if (!raw) {
|
|
101
305
|
const reason = RecipesReferences.diagnoseRawRecipeConfigFailure(draftPath);
|
|
102
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
306
|
+
throw new Error(ExecutionOutput.formatToolText(draftRecipeFailureText("reason", reason ? `${reason}` : undefined)));
|
|
103
307
|
}
|
|
104
308
|
const authoredRecipe = buildAuthoredRecipe({
|
|
105
309
|
...input,
|
|
@@ -109,7 +313,7 @@ function promoteDraftRecipe(name, input, ctx, deps) {
|
|
|
109
313
|
const resolutionContext = getRegistrationResolutionContext(ctx, deps);
|
|
110
314
|
const candidate = RecipesDiscovery.admitUserRecipe(targetPath, resolutionContext, authoredRecipe);
|
|
111
315
|
if (!candidate.validated || !candidate.tool) {
|
|
112
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
316
|
+
throw new Error(ExecutionOutput.formatToolText(draftRecipeFailureText("diagnostics_summary", `${candidate.diagnostics.join("; ")}`)));
|
|
113
317
|
}
|
|
114
318
|
mkdirSync(dirname(targetPath), { recursive: true });
|
|
115
319
|
writeJsonAtomic(targetPath, authoredRecipe);
|
|
@@ -119,10 +323,12 @@ function promoteDraftRecipe(name, input, ctx, deps) {
|
|
|
119
323
|
const argSummary = RecipesDiscovery.summarizeRegisteredToolArgs(promoted);
|
|
120
324
|
const callableNow = activation?.callable_now ?? false;
|
|
121
325
|
const nextActions = registrationNextActions(name, "draft", callableNow);
|
|
122
|
-
deps.notify(ctx,
|
|
326
|
+
deps.notify(ctx, registryNoticeText("promoted", `${name}`), "info");
|
|
123
327
|
return {
|
|
124
328
|
content: [
|
|
125
|
-
textContent(ExecutionOutput.formatToolText(
|
|
329
|
+
textContent(ExecutionOutput.formatToolText(
|
|
330
|
+
// Preserve the old name→flag→hint template conversions here, after notify.
|
|
331
|
+
draftReceiptText(existing ? "updated" : "registered", `${name}`, `${callableNow}`, `${nextActions[0]}`))),
|
|
126
332
|
],
|
|
127
333
|
details: {
|
|
128
334
|
active_tool: activation?.active_tool ?? false,
|
|
@@ -151,12 +357,25 @@ function persistToolRecipe(deps, name, recipe) {
|
|
|
151
357
|
writeJsonAtomic(path, recipe);
|
|
152
358
|
return path;
|
|
153
359
|
}
|
|
360
|
+
function registryDeletionText(name, result) {
|
|
361
|
+
const field = ToolsResponse.formatMarkdownField;
|
|
362
|
+
const facts = [field("result", result), ...(result === "deleted"
|
|
363
|
+
? [field("instruction", "Reload to remove it from the complete registry.")] : [])];
|
|
364
|
+
const render = (identity) => [identity, ...facts].join("\n");
|
|
365
|
+
const wellFormed = name.isWellFormed();
|
|
366
|
+
if (wellFormed) {
|
|
367
|
+
const complete = render(field("tool", name));
|
|
368
|
+
if (Buffer.byteLength(complete) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
369
|
+
return complete;
|
|
370
|
+
}
|
|
371
|
+
return render(`- tool: [${wellFormed ? "omitted" : "unavailable"}]\n- tool_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`);
|
|
372
|
+
}
|
|
154
373
|
function deleteTool(name, ctx, deps) {
|
|
155
374
|
const tools = deps.getTools();
|
|
156
375
|
if (!tools.has(name)) {
|
|
157
376
|
return {
|
|
158
377
|
content: [
|
|
159
|
-
textContent(ExecutionOutput.formatToolText(
|
|
378
|
+
textContent(ExecutionOutput.formatToolText(registryDeletionText(`${name}`, "not found"))),
|
|
160
379
|
],
|
|
161
380
|
details: { tool: name },
|
|
162
381
|
};
|
|
@@ -166,10 +385,10 @@ function deleteTool(name, ctx, deps) {
|
|
|
166
385
|
unlinkSync(recipePath);
|
|
167
386
|
tools.delete(name);
|
|
168
387
|
deps.setActiveTools(deps.getActiveTools().filter((toolName) => toolName !== name));
|
|
169
|
-
deps.notify(ctx,
|
|
388
|
+
deps.notify(ctx, registryNoticeText("deleted", `${name}`), "info");
|
|
170
389
|
return {
|
|
171
390
|
content: [
|
|
172
|
-
textContent(ExecutionOutput.formatToolText(
|
|
391
|
+
textContent(ExecutionOutput.formatToolText(registryDeletionText(`${name}`, "deleted"))),
|
|
173
392
|
],
|
|
174
393
|
details: { tool: name },
|
|
175
394
|
};
|
|
@@ -209,7 +428,7 @@ function assertTemplateIsNotNestedRecipe(value) {
|
|
|
209
428
|
looksLikeRecipeReference(record.template) &&
|
|
210
429
|
(Object.keys(record).length === 1 ||
|
|
211
430
|
["artifacts", "async", "control", "description", "imports", "values"].some((key) => Object.hasOwn(record, key)))) {
|
|
212
|
-
throw new Error(ExecutionOutput.formatToolText("Nested Recipe-shaped templates are not a register_tool source mode
|
|
431
|
+
throw new Error(ExecutionOutput.formatToolText("- field: template\n- result: Nested Recipe-shaped templates are not a register_tool source mode.\n- instruction: retry with from=<skill>/<recipe> and defaults={...}."));
|
|
213
432
|
}
|
|
214
433
|
}
|
|
215
434
|
function getInputTemplate(value) {
|
|
@@ -223,14 +442,14 @@ function getInputTemplate(value) {
|
|
|
223
442
|
template: value,
|
|
224
443
|
});
|
|
225
444
|
if (steps.length === 0)
|
|
226
|
-
throw new Error(ExecutionOutput.formatToolText("Tool template sequence is empty."));
|
|
445
|
+
throw new Error(ExecutionOutput.formatToolText("- field: template\n- result: Tool template sequence is empty."));
|
|
227
446
|
return value;
|
|
228
447
|
}
|
|
229
448
|
if (value && typeof value === "object") {
|
|
230
449
|
CommandTemplates.expandCommandTemplateConfigs(value);
|
|
231
450
|
return value;
|
|
232
451
|
}
|
|
233
|
-
throw new Error(ExecutionOutput.formatToolText("
|
|
452
|
+
throw new Error(ExecutionOutput.formatToolText("- field: template\n- result: unsupported template type\n- supported_types:\n - string\n - object\n - sequence"));
|
|
234
453
|
}
|
|
235
454
|
function getRegistrationResolutionContext(ctx, deps) {
|
|
236
455
|
const runtimeContext = deps.getRecipeResolutionContext?.();
|
|
@@ -247,7 +466,7 @@ function normalizeDefaults(value) {
|
|
|
247
466
|
if (value === undefined)
|
|
248
467
|
return undefined;
|
|
249
468
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
250
|
-
throw new Error(ExecutionOutput.formatToolText("Tool defaults must be an object."));
|
|
469
|
+
throw new Error(ExecutionOutput.formatToolText("- field: defaults\n- result: Tool defaults must be an object."));
|
|
251
470
|
}
|
|
252
471
|
return { ...value };
|
|
253
472
|
}
|
|
@@ -279,13 +498,13 @@ function buildAuthoredRecipe(input, existing, existingRecipe) {
|
|
|
279
498
|
const from = typeof input.from === "string" ? input.from.trim() : "";
|
|
280
499
|
const description = (input.description ?? existing?.description ?? "").trim();
|
|
281
500
|
if (!description && !from) {
|
|
282
|
-
throw new Error(ExecutionOutput.formatToolText("Tool description is required for command-template registration."));
|
|
501
|
+
throw new Error(ExecutionOutput.formatToolText("- field: description\n- result: Tool description is required for command-template registration."));
|
|
283
502
|
}
|
|
284
503
|
const inputDefaults = normalizeDefaults(input.defaults);
|
|
285
504
|
if (from) {
|
|
286
505
|
const runtimeOwnedDefault = Object.keys(inputDefaults ?? {}).find((key) => RecipesReferences.isRuntimeOwnedRecipeInput(key));
|
|
287
506
|
if (runtimeOwnedDefault) {
|
|
288
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
507
|
+
throw new Error(ExecutionOutput.formatToolText(`- field: defaults\n- key: ${runtimeOwnedDefault}\n- result: Tool defaults cannot set runtime-owned input.\n- instruction: remove that default and retry register_tool; the runtime supplies it.`));
|
|
289
508
|
}
|
|
290
509
|
const authored = {
|
|
291
510
|
...(description ? { description } : {}),
|
|
@@ -301,13 +520,13 @@ function buildAuthoredRecipe(input, existing, existingRecipe) {
|
|
|
301
520
|
}
|
|
302
521
|
const template = getInputTemplate(input.template);
|
|
303
522
|
if (template === null) {
|
|
304
|
-
throw new Error(ExecutionOutput.formatToolText("Tool template cannot be null here."));
|
|
523
|
+
throw new Error(ExecutionOutput.formatToolText("- field: template\n- result: Tool template cannot be null here."));
|
|
305
524
|
}
|
|
306
525
|
const finalTemplate = template === undefined || template === ""
|
|
307
526
|
? existingRecipe?.template ?? existing?.template
|
|
308
527
|
: template;
|
|
309
528
|
if (!finalTemplate) {
|
|
310
|
-
throw new Error(ExecutionOutput.formatToolText("Tool template is required."));
|
|
529
|
+
throw new Error(ExecutionOutput.formatToolText("- field: template\n- result: Tool template is required."));
|
|
311
530
|
}
|
|
312
531
|
const authored = {
|
|
313
532
|
...(existingRecipe ?? {}),
|
|
@@ -335,24 +554,34 @@ function buildAuthoredRecipe(input, existing, existingRecipe) {
|
|
|
335
554
|
function assertRegisterToolInputModes(input) {
|
|
336
555
|
const record = input;
|
|
337
556
|
if (Object.hasOwn(record, "values")) {
|
|
338
|
-
throw new Error(ExecutionOutput.formatToolText("register_tool values was removed
|
|
557
|
+
throw new Error(ExecutionOutput.formatToolText("- field: values\n- result: register_tool values was removed.\n- replacement_fields:\n - defaults\n - from\n- instruction: retry register_tool with defaults for caller inputs, or use from=<skill>/<recipe> for maintained composition."));
|
|
339
558
|
}
|
|
340
559
|
const fromProvided = Object.hasOwn(record, "from");
|
|
341
560
|
if (fromProvided &&
|
|
342
561
|
(typeof input.from !== "string" || input.from.trim().length === 0)) {
|
|
343
|
-
throw new Error(ExecutionOutput.formatToolText("Tool from must be a non-empty Recipe reference.
|
|
562
|
+
throw new Error(ExecutionOutput.formatToolText("- field: from\n- result: Tool from must be a non-empty Recipe reference.\n- reference_forms:\n - <skill>/<recipe>\n - explicit .json path\n - explicit .md path\n- instruction: retry register_tool with from=<skill>/<recipe> or an explicit .json/.md path."));
|
|
344
563
|
}
|
|
345
564
|
const draftProvided = typeof input.draft === "string" && input.draft.trim().length > 0;
|
|
346
565
|
const templateProvided = Object.hasOwn(record, "template");
|
|
347
566
|
const modeCount = Number(fromProvided) + Number(draftProvided) + Number(templateProvided);
|
|
348
567
|
if (modeCount > 1) {
|
|
349
|
-
throw new Error(ExecutionOutput.formatToolText("Use exactly one register_tool source mode
|
|
568
|
+
throw new Error(ExecutionOutput.formatToolText("- result: Use exactly one register_tool source mode.\n- source_modes:\n - from\n - template\n - draft\n- instruction: remove the extra source fields and retry register_tool."));
|
|
350
569
|
}
|
|
351
570
|
if (fromProvided &&
|
|
352
571
|
(Object.hasOwn(record, "args") || Object.hasOwn(record, "async"))) {
|
|
353
|
-
throw new Error(ExecutionOutput.formatToolText("register_tool from inherits args and async behavior
|
|
572
|
+
throw new Error(ExecutionOutput.formatToolText("- field: from\n- result: register_tool from inherits args and async behavior.\n- inherited_fields:\n - args\n - async\n- instruction: retry register_tool with from and optional defaults only; omit args and async."));
|
|
354
573
|
}
|
|
355
574
|
}
|
|
575
|
+
function reservedRegistrationNameText(value) {
|
|
576
|
+
const render = (selected) => "- field: name\n" + selected + "\n- result: Reserved tool name.";
|
|
577
|
+
const wellFormed = value.isWellFormed();
|
|
578
|
+
if (wellFormed) {
|
|
579
|
+
const complete = render(ToolsResponse.formatMarkdownField("value", value));
|
|
580
|
+
if (Buffer.byteLength(complete) <= Limits.RUN_DELIVERY_MODEL_MAX_BYTES - 1)
|
|
581
|
+
return complete;
|
|
582
|
+
}
|
|
583
|
+
return render(`- value: [${wellFormed ? "omitted" : "unavailable"}]\n- value_omission:\n - reason: ${wellFormed ? "response_too_large" : "malformed_selected_text"}\n - shown: 0\n - omitted: 1\n - total: 1`);
|
|
584
|
+
}
|
|
356
585
|
function executeRegisterToolUnlocked(params, ctx, deps) {
|
|
357
586
|
const rawInput = params && typeof params === "object"
|
|
358
587
|
? params
|
|
@@ -363,9 +592,9 @@ function executeRegisterToolUnlocked(params, ctx, deps) {
|
|
|
363
592
|
return listTools(deps);
|
|
364
593
|
const name = Identity.normalizeToolName(input.name);
|
|
365
594
|
if (!name)
|
|
366
|
-
throw new Error(ExecutionOutput.formatToolText("Invalid tool name."));
|
|
595
|
+
throw new Error(ExecutionOutput.formatToolText("- field: name\n- result: Invalid tool name."));
|
|
367
596
|
if (deps.reservedToolNames.has(name)) {
|
|
368
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
597
|
+
throw new Error(ExecutionOutput.formatToolText(reservedRegistrationNameText(`${name}`)));
|
|
369
598
|
}
|
|
370
599
|
if (typeof input.draft === "string" && input.draft.trim()) {
|
|
371
600
|
return promoteDraftRecipe(name, input, ctx, deps);
|
|
@@ -384,7 +613,7 @@ function executeRegisterToolUnlocked(params, ctx, deps) {
|
|
|
384
613
|
const diagnosticSource = requestedSource?.startsWith("skill:")
|
|
385
614
|
? requestedSource.slice("skill:".length)
|
|
386
615
|
: requestedSource ?? "";
|
|
387
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
616
|
+
throw new Error(ExecutionOutput.formatToolText(sourceNormalizationFailureText(`${requestedSource}`, `${reason}`, `${activeSkillSummary(resolutionContext)}`, `${recipeDoctorAction(diagnosticSource)}`)));
|
|
388
617
|
}
|
|
389
618
|
}
|
|
390
619
|
const templateProvided = Object.hasOwn(input, "template");
|
|
@@ -398,18 +627,18 @@ function executeRegisterToolUnlocked(params, ctx, deps) {
|
|
|
398
627
|
if (blocker)
|
|
399
628
|
throw new Error(ExecutionOutput.formatToolText(blocker));
|
|
400
629
|
if ((authoritative.exists || existing) && !input.update) {
|
|
401
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
630
|
+
throw new Error(ExecutionOutput.formatToolText(duplicateRegistrationText(`${name}`)));
|
|
402
631
|
}
|
|
403
632
|
if (template === undefined && !input.from && !existing) {
|
|
404
|
-
throw new Error(ExecutionOutput.formatToolText("New registration requires exactly one source mode
|
|
633
|
+
throw new Error(ExecutionOutput.formatToolText("- result: New registration requires exactly one source mode.\n- source_modes:\n - from\n - template\n - draft\n- instruction: retry register_tool with one source field."));
|
|
405
634
|
}
|
|
406
635
|
const recipePath = getToolRecipePath(deps, name);
|
|
407
636
|
const authoredRecipe = buildAuthoredRecipe(input, existing, authoritative.recipe);
|
|
408
637
|
const candidate = RecipesDiscovery.admitUserRecipe(recipePath, resolutionContext, authoredRecipe);
|
|
409
638
|
if (!candidate.validated || !candidate.tool) {
|
|
410
639
|
const sourceDiagnostic = requestedSource
|
|
411
|
-
?
|
|
412
|
-
:
|
|
640
|
+
? candidateAdmissionFailureText({ kind: "source", source: `${requestedSource}`, diagnostics: `${candidate.diagnostics.join("; ")}`, summary: `${activeSkillSummary(resolutionContext)}`, instruction: `${recipeDoctorAction(requestedSource)}` })
|
|
641
|
+
: candidateAdmissionFailureText({ kind: "recipe", diagnostics: `${candidate.diagnostics.join("; ")}` });
|
|
413
642
|
throw new Error(ExecutionOutput.formatToolText(sourceDiagnostic));
|
|
414
643
|
}
|
|
415
644
|
const activeBefore = deps.getActiveTools();
|
|
@@ -451,9 +680,9 @@ function executeRegisterToolUnlocked(params, ctx, deps) {
|
|
|
451
680
|
tools.delete(name);
|
|
452
681
|
}
|
|
453
682
|
deps.setActiveTools(activeBefore);
|
|
454
|
-
throw new Error(ExecutionOutput.formatToolText(
|
|
683
|
+
throw new Error(ExecutionOutput.formatToolText(registrationTransactionFailureText(`${transactionStage}`, `${resolutionContext.generation}`, `${activeSkillSummary(resolutionContext)}`, `${error instanceof Error ? error.message : String(error)}`)));
|
|
455
684
|
}
|
|
456
|
-
deps.notify(ctx,
|
|
685
|
+
deps.notify(ctx, registryNoticeText("activated", `${name}`), "info");
|
|
457
686
|
const templateWarnings = CommandTemplates.getCommandTemplateWarnings(typeof cfg.recipe?.template === "object" && !Array.isArray(cfg.recipe.template)
|
|
458
687
|
? cfg.recipe.template
|
|
459
688
|
: { template: cfg.recipe?.template ?? cfg.template });
|
|
@@ -464,12 +693,17 @@ function executeRegisterToolUnlocked(params, ctx, deps) {
|
|
|
464
693
|
const source = requestedSource ?? "template";
|
|
465
694
|
const argSummary = RecipesDiscovery.summarizeRegisteredToolArgs(cfg);
|
|
466
695
|
const nextActions = registrationNextActions(name, source, callableNow);
|
|
696
|
+
let displayBoundary;
|
|
467
697
|
const outcomeText = callableNow
|
|
468
698
|
? `${existing ? "Updated" : "Registered"} tool "${name}" from ${source}; callable_now=true`
|
|
469
|
-
: `Persisted tool "${name}" from ${source}; callable_now=false; activation_boundary=${activationBoundary(activation)}`;
|
|
699
|
+
: `Persisted tool "${name}" from ${source}; callable_now=false; activation_boundary=${displayBoundary = activationBoundary(activation)}`;
|
|
700
|
+
// Keep original fallible advisory evaluation/order after effects, before the new text.
|
|
701
|
+
void `${outcomeText}; required=${Schema.formatToolArgs(argSummary.required)}; optional=${Schema.formatToolArgs(argSummary.optional)}; next=${nextActions[0]}.${warningText}`;
|
|
470
702
|
return {
|
|
471
703
|
content: [
|
|
472
|
-
textContent(ExecutionOutput.formatToolText(
|
|
704
|
+
textContent(ExecutionOutput.formatToolText(registrationReceiptText({ tool: name, result: callableNow ? existing ? "updated" : "registered" : "persisted",
|
|
705
|
+
source, callable: Boolean(callableNow), boundary: displayBoundary, required: argSummary.required,
|
|
706
|
+
optional: argSummary.optional, warnings: templateWarnings, next: nextActions[0] }))),
|
|
473
707
|
],
|
|
474
708
|
details: {
|
|
475
709
|
active_tool: activation?.active_tool ?? false,
|