@north-light/crouter 0.3.154
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/README.md +48 -0
- package/bin/crouter +4 -0
- package/bin/crtr +4 -0
- package/bin/crtrd +4 -0
- package/bin/runtime-generation-manifest.mjs +263 -0
- package/bin/runtime-selector.mjs +378 -0
- package/dist/api/__tests__/client.test.d.ts +1 -0
- package/dist/api/__tests__/client.test.js +274 -0
- package/dist/api/client.d.ts +249 -0
- package/dist/api/client.js +616 -0
- package/dist/api/dto/attach.d.ts +16 -0
- package/dist/api/dto/attach.js +13 -0
- package/dist/api/dto/broker.d.ts +45 -0
- package/dist/api/dto/broker.js +20 -0
- package/dist/api/dto/canvas.d.ts +253 -0
- package/dist/api/dto/canvas.js +2 -0
- package/dist/api/dto/common.d.ts +27 -0
- package/dist/api/dto/common.js +15 -0
- package/dist/api/dto/config.d.ts +19 -0
- package/dist/api/dto/config.js +3 -0
- package/dist/api/dto/crons.d.ts +124 -0
- package/dist/api/dto/crons.js +10 -0
- package/dist/api/dto/files.d.ts +11 -0
- package/dist/api/dto/files.js +7 -0
- package/dist/api/dto/focus.d.ts +24 -0
- package/dist/api/dto/focus.js +10 -0
- package/dist/api/dto/health.d.ts +41 -0
- package/dist/api/dto/health.js +2 -0
- package/dist/api/dto/human.d.ts +57 -0
- package/dist/api/dto/human.js +4 -0
- package/dist/api/dto/inbox.d.ts +105 -0
- package/dist/api/dto/inbox.js +10 -0
- package/dist/api/dto/lifecycle.d.ts +79 -0
- package/dist/api/dto/lifecycle.js +3 -0
- package/dist/api/dto/messages.d.ts +55 -0
- package/dist/api/dto/messages.js +2 -0
- package/dist/api/dto/modelauth.d.ts +41 -0
- package/dist/api/dto/modelauth.js +3 -0
- package/dist/api/dto/nodes.d.ts +209 -0
- package/dist/api/dto/nodes.js +3 -0
- package/dist/api/dto/profiles.d.ts +14 -0
- package/dist/api/dto/profiles.js +3 -0
- package/dist/api/dto/reports.d.ts +41 -0
- package/dist/api/dto/reports.js +2 -0
- package/dist/api/dto/subscriptions.d.ts +14 -0
- package/dist/api/dto/subscriptions.js +2 -0
- package/dist/api/dto/worktree.d.ts +19 -0
- package/dist/api/dto/worktree.js +6 -0
- package/dist/api/errors.d.ts +19 -0
- package/dist/api/errors.js +30 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/index.js +25 -0
- package/dist/api/routes.d.ts +64 -0
- package/dist/api/routes.js +92 -0
- package/dist/build-root.d.ts +43 -0
- package/dist/build-root.js +96 -0
- package/dist/builtin-memory/00-runtime-base.md +51 -0
- package/dist/builtin-memory/01-spine/00-has-manager.md +23 -0
- package/dist/builtin-memory/01-spine/01-no-manager.md +10 -0
- package/dist/builtin-memory/02-lifecycle/00-terminal.md +19 -0
- package/dist/builtin-memory/02-lifecycle/01-resident.md +10 -0
- package/dist/builtin-memory/04-base-worker.md +18 -0
- package/dist/builtin-memory/04-orchestration-kernel.md +109 -0
- package/dist/builtin-memory/05-kinds/advisor/00-base.md +19 -0
- package/dist/builtin-memory/05-kinds/advisor/01-orchestrator.md +26 -0
- package/dist/builtin-memory/05-kinds/design/00-base.md +20 -0
- package/dist/builtin-memory/05-kinds/design/01-orchestrator.md +13 -0
- package/dist/builtin-memory/05-kinds/developer/00-base.md +22 -0
- package/dist/builtin-memory/05-kinds/developer/01-orchestrator.md +21 -0
- package/dist/builtin-memory/05-kinds/explore/00-base.md +20 -0
- package/dist/builtin-memory/05-kinds/explore/01-orchestrator.md +16 -0
- package/dist/builtin-memory/05-kinds/general/00-base.md +15 -0
- package/dist/builtin-memory/05-kinds/general/01-orchestrator.md +11 -0
- package/dist/builtin-memory/05-kinds/plan/00-base.md +20 -0
- package/dist/builtin-memory/05-kinds/plan/01-orchestrator.md +17 -0
- package/dist/builtin-memory/05-kinds/plan/reviewers/architecture-fit.md +17 -0
- package/dist/builtin-memory/05-kinds/plan/reviewers/code-smells.md +17 -0
- package/dist/builtin-memory/05-kinds/plan/reviewers/pattern-consistency.md +19 -0
- package/dist/builtin-memory/05-kinds/plan/reviewers/requirements-coverage.md +17 -0
- package/dist/builtin-memory/05-kinds/plan/reviewers/security.md +20 -0
- package/dist/builtin-memory/05-kinds/product/00-base.md +25 -0
- package/dist/builtin-memory/05-kinds/product/01-orchestrator.md +15 -0
- package/dist/builtin-memory/05-kinds/product/teardown.md +15 -0
- package/dist/builtin-memory/05-kinds/review/00-base.md +19 -0
- package/dist/builtin-memory/05-kinds/review/01-orchestrator.md +17 -0
- package/dist/builtin-memory/05-kinds/spec/00-base.md +20 -0
- package/dist/builtin-memory/05-kinds/spec/01-orchestrator.md +15 -0
- package/dist/builtin-memory/05-kinds/spec/requirements.md +13 -0
- package/dist/builtin-memory/design.md +62 -0
- package/dist/builtin-memory/development.md +120 -0
- package/dist/builtin-memory/internal/INDEX.md +26 -0
- package/dist/builtin-memory/internal/agent-shaping.md +77 -0
- package/dist/builtin-memory/internal/examples/INDEX.md +15 -0
- package/dist/builtin-memory/internal/examples/imessage-assistant.md +100 -0
- package/dist/builtin-memory/internal/marketplaces.md +164 -0
- package/dist/builtin-memory/internal/nodes-and-canvas.md +51 -0
- package/dist/builtin-memory/internal/plugins.md +249 -0
- package/dist/builtin-memory/internal/storage-tiers.md +41 -0
- package/dist/builtin-memory/planning.md +43 -0
- package/dist/builtin-memory/product.md +80 -0
- package/dist/builtin-memory/spec.md +98 -0
- package/dist/builtin-memory/wedged-child-on-runaway-bash.md +34 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +47 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/claude-plugin-commands.test.ts +49 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/crtr-commands.test.ts +93 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/memory-slash-commands.test.ts +194 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +2632 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/statusline.test.ts +68 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +492 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crouter-help.ts +95 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/filters.json +7 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-commands/index.ts +191 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/index.ts +448 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/test.ts +119 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/memory-slash-commands.ts +195 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +1232 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/statusline.ts +255 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/strip-skills-docs.ts +47 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/sysprompt-window.ts +19 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/lib/package.json +3 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.js +1 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/lib/subscription-state.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/LICENSE +13 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/README.md +172 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/bin.mjs +11 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +225 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/errors.js +57 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/index.js +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/log.js +11 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Alias.js +116 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/util.js +11 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/dist/visit.js +233 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/index.js +5 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/browser/package.json +3 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/cli.d.ts +8 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/cli.mjs +201 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/composer.js +224 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/Document.js +337 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/doc/directives.js +178 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/errors.d.ts +21 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/errors.js +62 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/index.d.ts +25 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/index.js +50 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/log.d.ts +3 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/log.js +19 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/options.d.ts +350 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/cst.js +112 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/parse/parser.js +980 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/public-api.js +107 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/tags.js +99 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/test-events.js +134 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/util.d.ts +16 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/util.js +28 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/visit.d.ts +102 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/dist/visit.js +236 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/package.json +97 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/node_modules/yaml/util.js +2 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/package-lock.json +3385 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/package.json +25 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/tsconfig.json +10 -0
- package/dist/builtin-pi-packages/pi-mode-switch/README.md +36 -0
- package/dist/builtin-pi-packages/pi-mode-switch/bin/mode +36 -0
- package/dist/builtin-pi-packages/pi-mode-switch/extensions/index.ts +449 -0
- package/dist/builtin-pi-packages/pi-mode-switch/package.json +14 -0
- package/dist/builtin-pi-packages/pi-mode-switch/tsconfig.json +9 -0
- package/dist/builtin-views/_lib/states.mjs +161 -0
- package/dist/builtin-views/canvas/core.mjs +657 -0
- package/dist/builtin-views/canvas/text.mjs +58 -0
- package/dist/builtin-views/canvas/tui.mjs +168 -0
- package/dist/builtin-views/canvas/web.jsx +121 -0
- package/dist/builtin-views/chat/core.mjs +684 -0
- package/dist/builtin-views/chat/text.mjs +101 -0
- package/dist/builtin-views/chat/tui.mjs +360 -0
- package/dist/builtin-views/chat/web.jsx +362 -0
- package/dist/builtin-views/git-pr/core.mjs +673 -0
- package/dist/builtin-views/git-pr/text.mjs +84 -0
- package/dist/builtin-views/git-pr/tui.mjs +301 -0
- package/dist/builtin-views/git-pr/web.jsx +216 -0
- package/dist/builtin-views/inbox/_lib/render.mjs +175 -0
- package/dist/builtin-views/inbox/core.mjs +1273 -0
- package/dist/builtin-views/inbox/text.mjs +73 -0
- package/dist/builtin-views/inbox/tui.mjs +314 -0
- package/dist/builtin-views/inbox/web.jsx +188 -0
- package/dist/builtin-views/linkedin/core.mjs +906 -0
- package/dist/builtin-views/linkedin/text.mjs +69 -0
- package/dist/builtin-views/linkedin/tui.mjs +413 -0
- package/dist/builtin-views/linkedin/web.jsx +206 -0
- package/dist/builtin-views/prompt-review/core.mjs +735 -0
- package/dist/builtin-views/prompt-review/text.mjs +15 -0
- package/dist/builtin-views/prompt-review/tui.mjs +196 -0
- package/dist/builtin-views/prompt-review/web.jsx +484 -0
- package/dist/builtin-views/workspace-sidebar/__tests__/core.test.d.ts +1 -0
- package/dist/builtin-views/workspace-sidebar/__tests__/core.test.js +50 -0
- package/dist/builtin-views/workspace-sidebar/__tests__/core.test.ts +53 -0
- package/dist/builtin-views/workspace-sidebar/core.mjs +670 -0
- package/dist/builtin-views/workspace-sidebar/text.mjs +53 -0
- package/dist/builtin-views/workspace-sidebar/tui.mjs +141 -0
- package/dist/builtin-views/workspace-sidebar/web.jsx +109 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +86 -0
- package/dist/clients/attach/__tests__/attach-chrome-remote.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/attach-chrome-remote.test.js +467 -0
- package/dist/clients/attach/__tests__/attach-keybindings.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/attach-keybindings.test.js +141 -0
- package/dist/clients/attach/__tests__/attach-remote-readonly.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/attach-remote-readonly.test.js +191 -0
- package/dist/clients/attach/__tests__/chat-view-snapshot-ordering.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/chat-view-snapshot-ordering.test.js +236 -0
- package/dist/clients/attach/__tests__/context-message.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/context-message.test.js +46 -0
- package/dist/clients/attach/__tests__/crtr-output-coverage.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/crtr-output-coverage.test.js +55 -0
- package/dist/clients/attach/__tests__/crtr-output.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/crtr-output.test.js +2103 -0
- package/dist/clients/attach/__tests__/diagram.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/diagram.test.js +42 -0
- package/dist/clients/attach/__tests__/markdown-headings.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/markdown-headings.test.js +27 -0
- package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/oauth-dialog-lifecycle.test.js +133 -0
- package/dist/clients/attach/__tests__/prompt-preview.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/prompt-preview.test.js +87 -0
- package/dist/clients/attach/__tests__/ref-autocomplete.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/ref-autocomplete.test.js +176 -0
- package/dist/clients/attach/__tests__/titled-editor-preview.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/titled-editor-preview.test.js +271 -0
- package/dist/clients/attach/__tests__/visible-paths.test.d.ts +1 -0
- package/dist/clients/attach/__tests__/visible-paths.test.js +19 -0
- package/dist/clients/attach/chrome/bash-jobs.d.ts +9 -0
- package/dist/clients/attach/chrome/bash-jobs.js +43 -0
- package/dist/clients/attach/chrome/canvas-panels.d.ts +36 -0
- package/dist/clients/attach/chrome/canvas-panels.js +172 -0
- package/dist/clients/attach/chrome/completion-bell.d.ts +10 -0
- package/dist/clients/attach/chrome/completion-bell.js +89 -0
- package/dist/clients/attach/chrome/cron-wait.d.ts +3 -0
- package/dist/clients/attach/chrome/cron-wait.js +34 -0
- package/dist/clients/attach/chrome/git-info.d.ts +20 -0
- package/dist/clients/attach/chrome/git-info.js +44 -0
- package/dist/clients/attach/chrome/roster.d.ts +26 -0
- package/dist/clients/attach/chrome/roster.js +233 -0
- package/dist/clients/attach/chrome/status-line.d.ts +35 -0
- package/dist/clients/attach/chrome/status-line.js +133 -0
- package/dist/clients/attach/chrome/widgets.d.ts +9 -0
- package/dist/clients/attach/chrome/widgets.js +61 -0
- package/dist/clients/attach/command.d.ts +2 -0
- package/dist/clients/attach/command.js +96 -0
- package/dist/clients/attach/config.d.ts +91 -0
- package/dist/clients/attach/config.js +271 -0
- package/dist/clients/attach/input/clipboard-image.d.ts +55 -0
- package/dist/clients/attach/input/clipboard-image.js +237 -0
- package/dist/clients/attach/input/controller.d.ts +210 -0
- package/dist/clients/attach/input/controller.js +689 -0
- package/dist/clients/attach/input/ref-autocomplete.d.ts +75 -0
- package/dist/clients/attach/input/ref-autocomplete.js +135 -0
- package/dist/clients/attach/input/titled-editor.d.ts +209 -0
- package/dist/clients/attach/input/titled-editor.js +801 -0
- package/dist/clients/attach/overlays/auth.d.ts +13 -0
- package/dist/clients/attach/overlays/auth.js +245 -0
- package/dist/clients/attach/overlays/dialogs.d.ts +27 -0
- package/dist/clients/attach/overlays/dialogs.js +102 -0
- package/dist/clients/attach/overlays/file-review.d.ts +9 -0
- package/dist/clients/attach/overlays/file-review.js +181 -0
- package/dist/clients/attach/overlays/graph.d.ts +76 -0
- package/dist/clients/attach/overlays/graph.js +657 -0
- package/dist/clients/attach/overlays/mcp.d.ts +32 -0
- package/dist/clients/attach/overlays/mcp.js +310 -0
- package/dist/clients/attach/overlays/pickers.d.ts +59 -0
- package/dist/clients/attach/overlays/pickers.js +170 -0
- package/dist/clients/attach/render/chat-view.d.ts +185 -0
- package/dist/clients/attach/render/chat-view.js +946 -0
- package/dist/clients/attach/render/context-message.d.ts +14 -0
- package/dist/clients/attach/render/context-message.js +81 -0
- package/dist/clients/attach/render/crtr-output.d.ts +48 -0
- package/dist/clients/attach/render/crtr-output.js +694 -0
- package/dist/clients/attach/render/diagram.d.ts +14 -0
- package/dist/clients/attach/render/diagram.js +135 -0
- package/dist/clients/attach/render/edit-diff.d.ts +6 -0
- package/dist/clients/attach/render/edit-diff.js +263 -0
- package/dist/clients/attach/render/frozen-history.d.ts +38 -0
- package/dist/clients/attach/render/frozen-history.js +100 -0
- package/dist/clients/attach/render/markdown-headings.d.ts +11 -0
- package/dist/clients/attach/render/markdown-headings.js +82 -0
- package/dist/clients/attach/session/banner.d.ts +9 -0
- package/dist/clients/attach/session/banner.js +29 -0
- package/dist/clients/attach/session/bindings.d.ts +12 -0
- package/dist/clients/attach/session/bindings.js +52 -0
- package/dist/clients/attach/session/chrome-refresh.d.ts +34 -0
- package/dist/clients/attach/session/chrome-refresh.js +93 -0
- package/dist/clients/attach/session/connection.d.ts +44 -0
- package/dist/clients/attach/session/connection.js +178 -0
- package/dist/clients/attach/session/context.d.ts +54 -0
- package/dist/clients/attach/session/context.js +16 -0
- package/dist/clients/attach/session/editor-frame.d.ts +43 -0
- package/dist/clients/attach/session/editor-frame.js +136 -0
- package/dist/clients/attach/session/editor-inventory.d.ts +59 -0
- package/dist/clients/attach/session/editor-inventory.js +161 -0
- package/dist/clients/attach/session/focus-events.d.ts +4 -0
- package/dist/clients/attach/session/focus-events.js +12 -0
- package/dist/clients/attach/session/frames.d.ts +43 -0
- package/dist/clients/attach/session/frames.js +170 -0
- package/dist/clients/attach/session/identity.d.ts +16 -0
- package/dist/clients/attach/session/identity.js +25 -0
- package/dist/clients/attach/session/input-wiring.d.ts +31 -0
- package/dist/clients/attach/session/input-wiring.js +128 -0
- package/dist/clients/attach/session/keys.d.ts +22 -0
- package/dist/clients/attach/session/keys.js +60 -0
- package/dist/clients/attach/session/layout.d.ts +20 -0
- package/dist/clients/attach/session/layout.js +56 -0
- package/dist/clients/attach/session/mode.d.ts +25 -0
- package/dist/clients/attach/session/mode.js +97 -0
- package/dist/clients/attach/session/pane-tag.d.ts +15 -0
- package/dist/clients/attach/session/pane-tag.js +43 -0
- package/dist/clients/attach/session/pi-assets.d.ts +1 -0
- package/dist/clients/attach/session/pi-assets.js +24 -0
- package/dist/clients/attach/session/pi-oauth-flows.d.ts +1 -0
- package/dist/clients/attach/session/pi-oauth-flows.js +21 -0
- package/dist/clients/attach/session/reconnect.d.ts +37 -0
- package/dist/clients/attach/session/reconnect.js +127 -0
- package/dist/clients/attach/session/state-sync.d.ts +38 -0
- package/dist/clients/attach/session/state-sync.js +68 -0
- package/dist/clients/attach/session/teardown.d.ts +30 -0
- package/dist/clients/attach/session/teardown.js +96 -0
- package/dist/clients/attach/slash/dispatch.d.ts +124 -0
- package/dist/clients/attach/slash/dispatch.js +696 -0
- package/dist/clients/attach/slash/prompt-preview.d.ts +30 -0
- package/dist/clients/attach/slash/prompt-preview.js +121 -0
- package/dist/clients/attach/viewer.d.ts +8 -0
- package/dist/clients/attach/viewer.js +1559 -0
- package/dist/clients/attach/visible-paths.d.ts +9 -0
- package/dist/clients/attach/visible-paths.js +76 -0
- package/dist/clients/web/__tests__/push-engine.test.d.ts +1 -0
- package/dist/clients/web/__tests__/push-engine.test.js +302 -0
- package/dist/clients/web/__tests__/push-registry.test.d.ts +1 -0
- package/dist/clients/web/__tests__/push-registry.test.js +177 -0
- package/dist/clients/web/dev-server.d.ts +7 -0
- package/dist/clients/web/dev-server.js +60 -0
- package/dist/clients/web/events.d.ts +19 -0
- package/dist/clients/web/events.js +165 -0
- package/dist/clients/web/push-engine.d.ts +108 -0
- package/dist/clients/web/push-engine.js +256 -0
- package/dist/clients/web/push-registry.d.ts +89 -0
- package/dist/clients/web/push-registry.js +378 -0
- package/dist/clients/web/server.d.ts +19 -0
- package/dist/clients/web/server.js +693 -0
- package/dist/clients/web/web-client/shared/protocol.d.ts +322 -0
- package/dist/clients/web/web-client/shared/protocol.js +8 -0
- package/dist/clients/web/web-cmd.d.ts +2 -0
- package/dist/clients/web/web-cmd.js +141 -0
- package/dist/commands/__tests__/api-client-cold-start-diagnostic.test.d.ts +1 -0
- package/dist/commands/__tests__/api-client-cold-start-diagnostic.test.js +96 -0
- package/dist/commands/__tests__/canvas-config.test.d.ts +1 -0
- package/dist/commands/__tests__/canvas-config.test.js +107 -0
- package/dist/commands/__tests__/human.test.d.ts +1 -0
- package/dist/commands/__tests__/human.test.js +344 -0
- package/dist/commands/__tests__/node-no-kickoff-flag.test.d.ts +1 -0
- package/dist/commands/__tests__/node-no-kickoff-flag.test.js +73 -0
- package/dist/commands/__tests__/node-worktree-flag.test.d.ts +1 -0
- package/dist/commands/__tests__/node-worktree-flag.test.js +49 -0
- package/dist/commands/__tests__/revive-now-gate.test.d.ts +1 -0
- package/dist/commands/__tests__/revive-now-gate.test.js +60 -0
- package/dist/commands/api-client.d.ts +100 -0
- package/dist/commands/api-client.js +377 -0
- package/dist/commands/attention.d.ts +2 -0
- package/dist/commands/attention.js +223 -0
- package/dist/commands/canvas-browse.d.ts +2 -0
- package/dist/commands/canvas-browse.js +95 -0
- package/dist/commands/canvas-config.d.ts +2 -0
- package/dist/commands/canvas-config.js +210 -0
- package/dist/commands/canvas-history/grep.d.ts +1 -0
- package/dist/commands/canvas-history/grep.js +104 -0
- package/dist/commands/canvas-history/read.d.ts +1 -0
- package/dist/commands/canvas-history/read.js +48 -0
- package/dist/commands/canvas-history/search.d.ts +1 -0
- package/dist/commands/canvas-history/search.js +118 -0
- package/dist/commands/canvas-history/shared.d.ts +27 -0
- package/dist/commands/canvas-history/shared.js +76 -0
- package/dist/commands/canvas-history.d.ts +2 -0
- package/dist/commands/canvas-history.js +30 -0
- package/dist/commands/canvas-issue.d.ts +2 -0
- package/dist/commands/canvas-issue.js +149 -0
- package/dist/commands/canvas-prune.d.ts +2 -0
- package/dist/commands/canvas-prune.js +108 -0
- package/dist/commands/canvas-rebuild-index.d.ts +2 -0
- package/dist/commands/canvas-rebuild-index.js +46 -0
- package/dist/commands/canvas-roster.d.ts +2 -0
- package/dist/commands/canvas-roster.js +62 -0
- package/dist/commands/canvas-snapshot.d.ts +2 -0
- package/dist/commands/canvas-snapshot.js +34 -0
- package/dist/commands/canvas-use.d.ts +1 -0
- package/dist/commands/canvas-use.js +63 -0
- package/dist/commands/canvas.d.ts +3 -0
- package/dist/commands/canvas.js +50 -0
- package/dist/commands/chord.d.ts +2 -0
- package/dist/commands/chord.js +242 -0
- package/dist/commands/cron.d.ts +2 -0
- package/dist/commands/cron.js +524 -0
- package/dist/commands/dashboard.d.ts +2 -0
- package/dist/commands/dashboard.js +80 -0
- package/dist/commands/human/prompts.d.ts +8 -0
- package/dist/commands/human/prompts.js +427 -0
- package/dist/commands/human/queue.d.ts +12 -0
- package/dist/commands/human/queue.js +531 -0
- package/dist/commands/human/shared.d.ts +80 -0
- package/dist/commands/human/shared.js +194 -0
- package/dist/commands/human.d.ts +2 -0
- package/dist/commands/human.js +44 -0
- package/dist/commands/memory/delete.d.ts +1 -0
- package/dist/commands/memory/delete.js +77 -0
- package/dist/commands/memory/find.d.ts +1 -0
- package/dist/commands/memory/find.js +192 -0
- package/dist/commands/memory/lint.d.ts +9 -0
- package/dist/commands/memory/lint.js +217 -0
- package/dist/commands/memory/list.d.ts +1 -0
- package/dist/commands/memory/list.js +84 -0
- package/dist/commands/memory/origin.d.ts +1 -0
- package/dist/commands/memory/origin.js +100 -0
- package/dist/commands/memory/read.d.ts +1 -0
- package/dist/commands/memory/read.js +72 -0
- package/dist/commands/memory/shared.d.ts +54 -0
- package/dist/commands/memory/shared.js +225 -0
- package/dist/commands/memory/write.d.ts +1 -0
- package/dist/commands/memory/write.js +142 -0
- package/dist/commands/memory.d.ts +2 -0
- package/dist/commands/memory.js +26 -0
- package/dist/commands/node-context.d.ts +2 -0
- package/dist/commands/node-context.js +157 -0
- package/dist/commands/node-inspect-artifacts.d.ts +1 -0
- package/dist/commands/node-inspect-artifacts.js +109 -0
- package/dist/commands/node-lifecycle-revive.d.ts +12 -0
- package/dist/commands/node-lifecycle-revive.js +287 -0
- package/dist/commands/node-snapshot.d.ts +2 -0
- package/dist/commands/node-snapshot.js +37 -0
- package/dist/commands/node-transcript.d.ts +2 -0
- package/dist/commands/node-transcript.js +62 -0
- package/dist/commands/node-worktree.d.ts +2 -0
- package/dist/commands/node-worktree.js +102 -0
- package/dist/commands/node.d.ts +44 -0
- package/dist/commands/node.js +1943 -0
- package/dist/commands/pkg/cli-inspect.d.ts +17 -0
- package/dist/commands/pkg/cli-inspect.js +190 -0
- package/dist/commands/pkg/cli-manage.d.ts +3 -0
- package/dist/commands/pkg/cli-manage.js +206 -0
- package/dist/commands/pkg/cli.d.ts +1 -0
- package/dist/commands/pkg/cli.js +14 -0
- package/dist/commands/pkg/market-inspect.d.ts +2 -0
- package/dist/commands/pkg/market-inspect.js +141 -0
- package/dist/commands/pkg/market-manage.d.ts +3 -0
- package/dist/commands/pkg/market-manage.js +224 -0
- package/dist/commands/pkg/market.d.ts +1 -0
- package/dist/commands/pkg/market.js +14 -0
- package/dist/commands/pkg/plugin-inspect.d.ts +2 -0
- package/dist/commands/pkg/plugin-inspect.js +150 -0
- package/dist/commands/pkg/plugin-manage.d.ts +19 -0
- package/dist/commands/pkg/plugin-manage.js +398 -0
- package/dist/commands/pkg/plugin.d.ts +1 -0
- package/dist/commands/pkg/plugin.js +14 -0
- package/dist/commands/pkg/shared.d.ts +5 -0
- package/dist/commands/pkg/shared.js +61 -0
- package/dist/commands/pkg.d.ts +2 -0
- package/dist/commands/pkg.js +24 -0
- package/dist/commands/profile/default.d.ts +2 -0
- package/dist/commands/profile/default.js +143 -0
- package/dist/commands/profile/delete.d.ts +1 -0
- package/dist/commands/profile/delete.js +39 -0
- package/dist/commands/profile/env.d.ts +2 -0
- package/dist/commands/profile/env.js +194 -0
- package/dist/commands/profile/list.d.ts +1 -0
- package/dist/commands/profile/list.js +35 -0
- package/dist/commands/profile/new.d.ts +1 -0
- package/dist/commands/profile/new.js +75 -0
- package/dist/commands/profile/project.d.ts +2 -0
- package/dist/commands/profile/project.js +97 -0
- package/dist/commands/profile/rename.d.ts +1 -0
- package/dist/commands/profile/rename.js +42 -0
- package/dist/commands/profile/show.d.ts +1 -0
- package/dist/commands/profile/show.js +50 -0
- package/dist/commands/profile.d.ts +2 -0
- package/dist/commands/profile.js +37 -0
- package/dist/commands/push.d.ts +2 -0
- package/dist/commands/push.js +166 -0
- package/dist/commands/revive.d.ts +2 -0
- package/dist/commands/revive.js +174 -0
- package/dist/commands/search/answer.d.ts +1 -0
- package/dist/commands/search/answer.js +50 -0
- package/dist/commands/search/contents.d.ts +1 -0
- package/dist/commands/search/contents.js +96 -0
- package/dist/commands/search/exa.d.ts +53 -0
- package/dist/commands/search/exa.js +157 -0
- package/dist/commands/search/puremd.d.ts +11 -0
- package/dist/commands/search/puremd.js +53 -0
- package/dist/commands/search/web.d.ts +1 -0
- package/dist/commands/search/web.js +65 -0
- package/dist/commands/search.d.ts +2 -0
- package/dist/commands/search.js +24 -0
- package/dist/commands/surface-edit.d.ts +2 -0
- package/dist/commands/surface-edit.js +159 -0
- package/dist/commands/surface-inspect.d.ts +2 -0
- package/dist/commands/surface-inspect.js +38 -0
- package/dist/commands/surface-node.d.ts +2 -0
- package/dist/commands/surface-node.js +16 -0
- package/dist/commands/surface-reload.d.ts +2 -0
- package/dist/commands/surface-reload.js +127 -0
- package/dist/commands/surface-tmux-spread.d.ts +2 -0
- package/dist/commands/surface-tmux-spread.js +220 -0
- package/dist/commands/surface.d.ts +2 -0
- package/dist/commands/surface.js +48 -0
- package/dist/commands/sys/__tests__/config-broker-thresholds.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/config-broker-thresholds.test.js +95 -0
- package/dist/commands/sys/__tests__/config-keybindings.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/config-keybindings.test.js +55 -0
- package/dist/commands/sys/__tests__/config-model-ladders.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/config-model-ladders.test.js +121 -0
- package/dist/commands/sys/__tests__/helpers/setup-runtime.d.ts +5 -0
- package/dist/commands/sys/__tests__/helpers/setup-runtime.js +19 -0
- package/dist/commands/sys/__tests__/setup-core.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/setup-core.test.js +291 -0
- package/dist/commands/sys/__tests__/setup-front-door.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/setup-front-door.test.js +137 -0
- package/dist/commands/sys/__tests__/setup-models.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/setup-models.test.js +205 -0
- package/dist/commands/sys/__tests__/setup-providers-viewport.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/setup-providers-viewport.test.js +155 -0
- package/dist/commands/sys/__tests__/sync-deps.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/sync-deps.test.js +188 -0
- package/dist/commands/sys/__tests__/sync-import.test.d.ts +1 -0
- package/dist/commands/sys/__tests__/sync-import.test.js +314 -0
- package/dist/commands/sys/config.d.ts +1 -0
- package/dist/commands/sys/config.js +292 -0
- package/dist/commands/sys/daemon.d.ts +2 -0
- package/dist/commands/sys/daemon.js +188 -0
- package/dist/commands/sys/doctor.d.ts +1 -0
- package/dist/commands/sys/doctor.js +528 -0
- package/dist/commands/sys/feedback.d.ts +1 -0
- package/dist/commands/sys/feedback.js +174 -0
- package/dist/commands/sys/logs.d.ts +1 -0
- package/dist/commands/sys/logs.js +127 -0
- package/dist/commands/sys/prompt-review.d.ts +1 -0
- package/dist/commands/sys/prompt-review.js +291 -0
- package/dist/commands/sys/promptstudio.d.ts +2 -0
- package/dist/commands/sys/promptstudio.js +65 -0
- package/dist/commands/sys/setup-core.d.ts +138 -0
- package/dist/commands/sys/setup-core.js +582 -0
- package/dist/commands/sys/setup-wizard.d.ts +130 -0
- package/dist/commands/sys/setup-wizard.js +2310 -0
- package/dist/commands/sys/setup.d.ts +6 -0
- package/dist/commands/sys/setup.js +36 -0
- package/dist/commands/sys/shared.d.ts +51 -0
- package/dist/commands/sys/shared.js +81 -0
- package/dist/commands/sys/support/prepare.d.ts +13 -0
- package/dist/commands/sys/support/prepare.js +235 -0
- package/dist/commands/sys/support/submit.d.ts +19 -0
- package/dist/commands/sys/support/submit.js +525 -0
- package/dist/commands/sys/support.d.ts +2 -0
- package/dist/commands/sys/support.js +18 -0
- package/dist/commands/sys/sync-deps.d.ts +19 -0
- package/dist/commands/sys/sync-deps.js +508 -0
- package/dist/commands/sys/sync-project-guidance.d.ts +1 -0
- package/dist/commands/sys/sync-project-guidance.js +345 -0
- package/dist/commands/sys/sync-shared.d.ts +7 -0
- package/dist/commands/sys/sync-shared.js +49 -0
- package/dist/commands/sys/sync-skills.d.ts +1 -0
- package/dist/commands/sys/sync-skills.js +306 -0
- package/dist/commands/sys/sync.d.ts +2 -0
- package/dist/commands/sys/sync.js +18 -0
- package/dist/commands/sys/sysprompt.d.ts +1 -0
- package/dist/commands/sys/sysprompt.js +97 -0
- package/dist/commands/sys/update.d.ts +2 -0
- package/dist/commands/sys/update.js +139 -0
- package/dist/commands/sys.d.ts +2 -0
- package/dist/commands/sys.js +30 -0
- package/dist/commands/view-cycle.d.ts +2 -0
- package/dist/commands/view-cycle.js +130 -0
- package/dist/commands/view-list.d.ts +2 -0
- package/dist/commands/view-list.js +66 -0
- package/dist/commands/view-new.d.ts +2 -0
- package/dist/commands/view-new.js +74 -0
- package/dist/commands/view-pick.d.ts +6 -0
- package/dist/commands/view-pick.js +129 -0
- package/dist/commands/view-run.d.ts +2 -0
- package/dist/commands/view-run.js +214 -0
- package/dist/commands/view.d.ts +2 -0
- package/dist/commands/view.js +31 -0
- package/dist/commands/workspace.d.ts +2 -0
- package/dist/commands/workspace.js +165 -0
- package/dist/core/__tests__/base-worker-prompt.test.d.ts +1 -0
- package/dist/core/__tests__/base-worker-prompt.test.js +60 -0
- package/dist/core/__tests__/boot-fault-attempt.test.d.ts +1 -0
- package/dist/core/__tests__/boot-fault-attempt.test.js +83 -0
- package/dist/core/__tests__/boot.test.d.ts +1 -0
- package/dist/core/__tests__/boot.test.js +275 -0
- package/dist/core/__tests__/branded-host-concurrency.test.d.ts +1 -0
- package/dist/core/__tests__/branded-host-concurrency.test.js +72 -0
- package/dist/core/__tests__/broker-fork-seam.test.d.ts +1 -0
- package/dist/core/__tests__/broker-fork-seam.test.js +118 -0
- package/dist/core/__tests__/broker-launch-candidates.test.d.ts +1 -0
- package/dist/core/__tests__/broker-launch-candidates.test.js +241 -0
- package/dist/core/__tests__/broker-preflight.test.d.ts +1 -0
- package/dist/core/__tests__/broker-preflight.test.js +95 -0
- package/dist/core/__tests__/broker-sdk-wiring.test.d.ts +1 -0
- package/dist/core/__tests__/broker-sdk-wiring.test.js +732 -0
- package/dist/core/__tests__/broker-snapshot-history.test.d.ts +1 -0
- package/dist/core/__tests__/broker-snapshot-history.test.js +213 -0
- package/dist/core/__tests__/canvas-inbox-watcher-hold.test.d.ts +1 -0
- package/dist/core/__tests__/canvas-inbox-watcher-hold.test.js +502 -0
- package/dist/core/__tests__/canvas-inbox-watcher.test.d.ts +1 -0
- package/dist/core/__tests__/canvas-inbox-watcher.test.js +255 -0
- package/dist/core/__tests__/canvas.test.d.ts +1 -0
- package/dist/core/__tests__/canvas.test.js +201 -0
- package/dist/core/__tests__/chat-view-reconnect.test.d.ts +1 -0
- package/dist/core/__tests__/chat-view-reconnect.test.js +105 -0
- package/dist/core/__tests__/child-death-wake.test.d.ts +1 -0
- package/dist/core/__tests__/child-death-wake.test.js +161 -0
- package/dist/core/__tests__/close.test.d.ts +1 -0
- package/dist/core/__tests__/close.test.js +254 -0
- package/dist/core/__tests__/command-plugins-surfaces.test.d.ts +1 -0
- package/dist/core/__tests__/command-plugins-surfaces.test.js +325 -0
- package/dist/core/__tests__/command-plugins.test.d.ts +1 -0
- package/dist/core/__tests__/command-plugins.test.js +448 -0
- package/dist/core/__tests__/connection-reconnect-resume.test.d.ts +1 -0
- package/dist/core/__tests__/connection-reconnect-resume.test.js +36 -0
- package/dist/core/__tests__/context-intro.test.d.ts +1 -0
- package/dist/core/__tests__/context-intro.test.js +256 -0
- package/dist/core/__tests__/cron-broker-capacity.test.d.ts +1 -0
- package/dist/core/__tests__/cron-broker-capacity.test.js +100 -0
- package/dist/core/__tests__/daemon-boot.test.d.ts +1 -0
- package/dist/core/__tests__/daemon-boot.test.js +374 -0
- package/dist/core/__tests__/daemon-wedge.test.d.ts +1 -0
- package/dist/core/__tests__/daemon-wedge.test.js +104 -0
- package/dist/core/__tests__/dead-node-policy-table.test.d.ts +1 -0
- package/dist/core/__tests__/dead-node-policy-table.test.js +103 -0
- package/dist/core/__tests__/deferred-no-wake.test.d.ts +1 -0
- package/dist/core/__tests__/deferred-no-wake.test.js +514 -0
- package/dist/core/__tests__/events-contract.test.d.ts +1 -0
- package/dist/core/__tests__/events-contract.test.js +76 -0
- package/dist/core/__tests__/fault-classifier.test.d.ts +1 -0
- package/dist/core/__tests__/fault-classifier.test.js +71 -0
- package/dist/core/__tests__/finalization-migration.test.d.ts +1 -0
- package/dist/core/__tests__/finalization-migration.test.js +38 -0
- package/dist/core/__tests__/fixtures/api-server-host.d.ts +1 -0
- package/dist/core/__tests__/fixtures/api-server-host.js +47 -0
- package/dist/core/__tests__/fixtures/c3-custom-provider-ext.d.ts +2 -0
- package/dist/core/__tests__/fixtures/c3-custom-provider-ext.js +34 -0
- package/dist/core/__tests__/fixtures/c5-command-boundary-ext.d.ts +2 -0
- package/dist/core/__tests__/fixtures/c5-command-boundary-ext.js +8 -0
- package/dist/core/__tests__/fixtures/extra-extension.d.ts +1 -0
- package/dist/core/__tests__/fixtures/extra-extension.js +3 -0
- package/dist/core/__tests__/fixtures/fake-engine.d.ts +310 -0
- package/dist/core/__tests__/fixtures/fake-engine.js +1210 -0
- package/dist/core/__tests__/fixtures/fake-pi-host.d.ts +2 -0
- package/dist/core/__tests__/fixtures/fake-pi-host.js +311 -0
- package/dist/core/__tests__/fixtures/metadata-migration-race.d.ts +1 -0
- package/dist/core/__tests__/fixtures/metadata-migration-race.js +49 -0
- package/dist/core/__tests__/fixtures/spawn-proof-target.test.d.ts +1 -0
- package/dist/core/__tests__/fixtures/spawn-proof-target.test.js +15 -0
- package/dist/core/__tests__/flagship-lifecycle.test.d.ts +1 -0
- package/dist/core/__tests__/flagship-lifecycle.test.js +303 -0
- package/dist/core/__tests__/focuses.test.d.ts +1 -0
- package/dist/core/__tests__/focuses.test.js +208 -0
- package/dist/core/__tests__/fork.test.d.ts +1 -0
- package/dist/core/__tests__/fork.test.js +108 -0
- package/dist/core/__tests__/full/broker-attach-limits.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-attach-limits.test.js +147 -0
- package/dist/core/__tests__/full/broker-attach-stream.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-attach-stream.test.js +133 -0
- package/dist/core/__tests__/full/broker-crash-teardown.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-crash-teardown.test.js +122 -0
- package/dist/core/__tests__/full/broker-deliver-ack.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-deliver-ack.test.js +73 -0
- package/dist/core/__tests__/full/broker-dialogs.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-dialogs.test.js +180 -0
- package/dist/core/__tests__/full/broker-display-snapshot.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-display-snapshot.test.js +75 -0
- package/dist/core/__tests__/full/broker-dormant-wake.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-dormant-wake.test.js +130 -0
- package/dist/core/__tests__/full/broker-model-changed-broadcast.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-model-changed-broadcast.test.js +57 -0
- package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.js +80 -0
- package/dist/core/__tests__/full/broker-pane-resolution.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-pane-resolution.test.js +155 -0
- package/dist/core/__tests__/full/broker-provider-retry.test.d.ts +1 -0
- package/dist/core/__tests__/full/broker-provider-retry.test.js +387 -0
- package/dist/core/__tests__/full/cascade-close.test.d.ts +1 -0
- package/dist/core/__tests__/full/cascade-close.test.js +240 -0
- package/dist/core/__tests__/full/consult-startup-failure.test.d.ts +1 -0
- package/dist/core/__tests__/full/consult-startup-failure.test.js +124 -0
- package/dist/core/__tests__/full/detach-focus.test.d.ts +1 -0
- package/dist/core/__tests__/full/detach-focus.test.js +126 -0
- package/dist/core/__tests__/full/idle-release-settlement.test.d.ts +1 -0
- package/dist/core/__tests__/full/idle-release-settlement.test.js +108 -0
- package/dist/core/__tests__/full/issue-146-yield-spawn-focus.test.d.ts +1 -0
- package/dist/core/__tests__/full/issue-146-yield-spawn-focus.test.js +107 -0
- package/dist/core/__tests__/full/park-clock-release.test.d.ts +1 -0
- package/dist/core/__tests__/full/park-clock-release.test.js +56 -0
- package/dist/core/__tests__/full/yield-message-transaction.test.d.ts +1 -0
- package/dist/core/__tests__/full/yield-message-transaction.test.js +70 -0
- package/dist/core/__tests__/helpers/broker-clients.d.ts +43 -0
- package/dist/core/__tests__/helpers/broker-clients.js +182 -0
- package/dist/core/__tests__/helpers/fleet.d.ts +12 -0
- package/dist/core/__tests__/helpers/fleet.js +45 -0
- package/dist/core/__tests__/helpers/harness.d.ts +128 -0
- package/dist/core/__tests__/helpers/harness.js +867 -0
- package/dist/core/__tests__/helpers/viewer-panes.d.ts +12 -0
- package/dist/core/__tests__/helpers/viewer-panes.js +133 -0
- package/dist/core/__tests__/history-inbox.test.d.ts +1 -0
- package/dist/core/__tests__/history-inbox.test.js +105 -0
- package/dist/core/__tests__/host-teardown-process-group.test.d.ts +1 -0
- package/dist/core/__tests__/host-teardown-process-group.test.js +476 -0
- package/dist/core/__tests__/human-cancel-guard.test.d.ts +1 -0
- package/dist/core/__tests__/human-cancel-guard.test.js +71 -0
- package/dist/core/__tests__/human-deliver-e2e.test.d.ts +1 -0
- package/dist/core/__tests__/human-deliver-e2e.test.js +123 -0
- package/dist/core/__tests__/human-deliver.test.d.ts +1 -0
- package/dist/core/__tests__/human-deliver.test.js +399 -0
- package/dist/core/__tests__/human-node-not-supervised.test.d.ts +1 -0
- package/dist/core/__tests__/human-node-not-supervised.test.js +94 -0
- package/dist/core/__tests__/inline-memory-refs.test.d.ts +1 -0
- package/dist/core/__tests__/inline-memory-refs.test.js +320 -0
- package/dist/core/__tests__/kickoff.test.d.ts +1 -0
- package/dist/core/__tests__/kickoff.test.js +148 -0
- package/dist/core/__tests__/lifecycle.test.d.ts +1 -0
- package/dist/core/__tests__/lifecycle.test.js +165 -0
- package/dist/core/__tests__/live-lifecycle-prompt.test.d.ts +1 -0
- package/dist/core/__tests__/live-lifecycle-prompt.test.js +51 -0
- package/dist/core/__tests__/live-mutation-verbs.test.d.ts +1 -0
- package/dist/core/__tests__/live-mutation-verbs.test.js +195 -0
- package/dist/core/__tests__/live-mutation.test.d.ts +1 -0
- package/dist/core/__tests__/live-mutation.test.js +197 -0
- package/dist/core/__tests__/memory-index-render.test.d.ts +1 -0
- package/dist/core/__tests__/memory-index-render.test.js +60 -0
- package/dist/core/__tests__/memory-resolver-precedence.test.d.ts +1 -0
- package/dist/core/__tests__/memory-resolver-precedence.test.js +169 -0
- package/dist/core/__tests__/migration.test.d.ts +1 -0
- package/dist/core/__tests__/migration.test.js +717 -0
- package/dist/core/__tests__/model-pin-durability.test.d.ts +1 -0
- package/dist/core/__tests__/model-pin-durability.test.js +124 -0
- package/dist/core/__tests__/on-read-crouter-home-fence.test.d.ts +1 -0
- package/dist/core/__tests__/on-read-crouter-home-fence.test.js +67 -0
- package/dist/core/__tests__/on-read-dedup-resume.test.d.ts +1 -0
- package/dist/core/__tests__/on-read-dedup-resume.test.js +121 -0
- package/dist/core/__tests__/on-read-identity.test.d.ts +1 -0
- package/dist/core/__tests__/on-read-identity.test.js +68 -0
- package/dist/core/__tests__/parse-argv-stdin-secret.test.d.ts +1 -0
- package/dist/core/__tests__/parse-argv-stdin-secret.test.js +26 -0
- package/dist/core/__tests__/passive-subscription.test.d.ts +1 -0
- package/dist/core/__tests__/passive-subscription.test.js +212 -0
- package/dist/core/__tests__/pid-identity-match.test.d.ts +1 -0
- package/dist/core/__tests__/pid-identity-match.test.js +145 -0
- package/dist/core/__tests__/pid-zombie.test.d.ts +1 -0
- package/dist/core/__tests__/pid-zombie.test.js +42 -0
- package/dist/core/__tests__/preview-registry-sync.test.d.ts +1 -0
- package/dist/core/__tests__/preview-registry-sync.test.js +65 -0
- package/dist/core/__tests__/prune-to-limit.test.d.ts +1 -0
- package/dist/core/__tests__/prune-to-limit.test.js +126 -0
- package/dist/core/__tests__/prune.test.d.ts +1 -0
- package/dist/core/__tests__/prune.test.js +135 -0
- package/dist/core/__tests__/push-final-guard.test.d.ts +1 -0
- package/dist/core/__tests__/push-final-guard.test.js +184 -0
- package/dist/core/__tests__/refresh-stall-recycle.test.d.ts +1 -0
- package/dist/core/__tests__/refresh-stall-recycle.test.js +101 -0
- package/dist/core/__tests__/relaunch-root.test.d.ts +1 -0
- package/dist/core/__tests__/relaunch-root.test.js +114 -0
- package/dist/core/__tests__/remote-canvas-target.test.d.ts +1 -0
- package/dist/core/__tests__/remote-canvas-target.test.js +87 -0
- package/dist/core/__tests__/reset.test.d.ts +1 -0
- package/dist/core/__tests__/reset.test.js +69 -0
- package/dist/core/__tests__/respawn-throttle.test.d.ts +1 -0
- package/dist/core/__tests__/respawn-throttle.test.js +154 -0
- package/dist/core/__tests__/review-model-floor.test.d.ts +1 -0
- package/dist/core/__tests__/review-model-floor.test.js +104 -0
- package/dist/core/__tests__/revive-all.test.d.ts +1 -0
- package/dist/core/__tests__/revive-all.test.js +147 -0
- package/dist/core/__tests__/revive.test.d.ts +1 -0
- package/dist/core/__tests__/revive.test.js +575 -0
- package/dist/core/__tests__/scope-crouter-home-fence.test.d.ts +1 -0
- package/dist/core/__tests__/scope-crouter-home-fence.test.js +55 -0
- package/dist/core/__tests__/secrets.test.d.ts +1 -0
- package/dist/core/__tests__/secrets.test.js +55 -0
- package/dist/core/__tests__/session-branch.test.d.ts +1 -0
- package/dist/core/__tests__/session-branch.test.js +61 -0
- package/dist/core/__tests__/session-cycles.test.d.ts +1 -0
- package/dist/core/__tests__/session-cycles.test.js +77 -0
- package/dist/core/__tests__/session-model.test.d.ts +1 -0
- package/dist/core/__tests__/session-model.test.js +129 -0
- package/dist/core/__tests__/spawn-no-kickoff.test.d.ts +1 -0
- package/dist/core/__tests__/spawn-no-kickoff.test.js +119 -0
- package/dist/core/__tests__/spawn-root.test.d.ts +1 -0
- package/dist/core/__tests__/spawn-root.test.js +320 -0
- package/dist/core/__tests__/spawn-worktree-id-conflict.test.d.ts +1 -0
- package/dist/core/__tests__/spawn-worktree-id-conflict.test.js +59 -0
- package/dist/core/__tests__/stdin-body-no-discard.test.d.ts +1 -0
- package/dist/core/__tests__/stdin-body-no-discard.test.js +33 -0
- package/dist/core/__tests__/stdout-errors.test.d.ts +1 -0
- package/dist/core/__tests__/stdout-errors.test.js +16 -0
- package/dist/core/__tests__/steer-note.test.d.ts +1 -0
- package/dist/core/__tests__/steer-note.test.js +41 -0
- package/dist/core/__tests__/stop-guard.test.d.ts +1 -0
- package/dist/core/__tests__/stop-guard.test.js +157 -0
- package/dist/core/__tests__/stream-watchdog.test.d.ts +1 -0
- package/dist/core/__tests__/stream-watchdog.test.js +154 -0
- package/dist/core/__tests__/subcommand-tier.test.d.ts +1 -0
- package/dist/core/__tests__/subcommand-tier.test.js +99 -0
- package/dist/core/__tests__/subscription-delivery.test.d.ts +1 -0
- package/dist/core/__tests__/subscription-delivery.test.js +211 -0
- package/dist/core/__tests__/subscription-pool-credential-guard.test.d.ts +1 -0
- package/dist/core/__tests__/subscription-pool-credential-guard.test.js +94 -0
- package/dist/core/__tests__/test-runner-cheap-sharding.test.d.ts +1 -0
- package/dist/core/__tests__/test-runner-cheap-sharding.test.js +97 -0
- package/dist/core/__tests__/tmux-surface.test.d.ts +1 -0
- package/dist/core/__tests__/tmux-surface.test.js +470 -0
- package/dist/core/__tests__/wake-bearings.test.d.ts +1 -0
- package/dist/core/__tests__/wake-bearings.test.js +102 -0
- package/dist/core/__tests__/worktree.test.d.ts +1 -0
- package/dist/core/__tests__/worktree.test.js +876 -0
- package/dist/core/__tests__/yield-ensures-daemon.test.d.ts +1 -0
- package/dist/core/__tests__/yield-ensures-daemon.test.js +54 -0
- package/dist/core/auth-file.d.ts +40 -0
- package/dist/core/auth-file.js +177 -0
- package/dist/core/auth-interaction.d.ts +19 -0
- package/dist/core/auth-interaction.js +94 -0
- package/dist/core/auto-update.d.ts +1 -0
- package/dist/core/auto-update.js +93 -0
- package/dist/core/bash-jobs.d.ts +55 -0
- package/dist/core/bash-jobs.js +150 -0
- package/dist/core/bootstrap.d.ts +5 -0
- package/dist/core/bootstrap.js +98 -0
- package/dist/core/broker-client/__tests__/transport-relay.test.d.ts +1 -0
- package/dist/core/broker-client/__tests__/transport-relay.test.js +213 -0
- package/dist/core/broker-client/client.d.ts +97 -0
- package/dist/core/broker-client/client.js +189 -0
- package/dist/core/broker-client/index.d.ts +1 -0
- package/dist/core/broker-client/index.js +13 -0
- package/dist/core/broker-client/transport-relay.d.ts +51 -0
- package/dist/core/broker-client/transport-relay.js +169 -0
- package/dist/core/broker-client/transport-socket.d.ts +29 -0
- package/dist/core/broker-client/transport-socket.js +164 -0
- package/dist/core/broker-client/transport.d.ts +32 -0
- package/dist/core/broker-client/transport.js +26 -0
- package/dist/core/canvas/__tests__/attention.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/attention.test.js +97 -0
- package/dist/core/canvas/__tests__/human-work-outbox.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/human-work-outbox.test.js +123 -0
- package/dist/core/canvas/__tests__/remote-canvas-source.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/remote-canvas-source.test.js +372 -0
- package/dist/core/canvas/__tests__/remote-event-stream.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/remote-event-stream.test.js +146 -0
- package/dist/core/canvas/__tests__/render-remote.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/render-remote.test.js +241 -0
- package/dist/core/canvas/__tests__/source-resolve.test.d.ts +1 -0
- package/dist/core/canvas/__tests__/source-resolve.test.js +77 -0
- package/dist/core/canvas/attention.d.ts +19 -0
- package/dist/core/canvas/attention.js +87 -0
- package/dist/core/canvas/boot-id.d.ts +6 -0
- package/dist/core/canvas/boot-id.js +26 -0
- package/dist/core/canvas/boot.d.ts +93 -0
- package/dist/core/canvas/boot.js +190 -0
- package/dist/core/canvas/browse/__tests__/model.test.d.ts +1 -0
- package/dist/core/canvas/browse/__tests__/model.test.js +290 -0
- package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.d.ts +1 -0
- package/dist/core/canvas/browse/__tests__/rebuild-coalescer.test.js +134 -0
- package/dist/core/canvas/browse/__tests__/render.test.d.ts +1 -0
- package/dist/core/canvas/browse/__tests__/render.test.js +111 -0
- package/dist/core/canvas/browse/app.d.ts +41 -0
- package/dist/core/canvas/browse/app.js +916 -0
- package/dist/core/canvas/browse/model.d.ts +169 -0
- package/dist/core/canvas/browse/model.js +485 -0
- package/dist/core/canvas/browse/pins.d.ts +4 -0
- package/dist/core/canvas/browse/pins.js +29 -0
- package/dist/core/canvas/browse/rebuild-coalescer.d.ts +7 -0
- package/dist/core/canvas/browse/rebuild-coalescer.js +61 -0
- package/dist/core/canvas/browse/render.d.ts +59 -0
- package/dist/core/canvas/browse/render.js +550 -0
- package/dist/core/canvas/canvas.d.ts +358 -0
- package/dist/core/canvas/canvas.js +897 -0
- package/dist/core/canvas/crons.d.ts +222 -0
- package/dist/core/canvas/crons.js +367 -0
- package/dist/core/canvas/daemon-owner.d.ts +67 -0
- package/dist/core/canvas/daemon-owner.js +141 -0
- package/dist/core/canvas/db.d.ts +30 -0
- package/dist/core/canvas/db.js +1167 -0
- package/dist/core/canvas/extensions.d.ts +5 -0
- package/dist/core/canvas/extensions.js +39 -0
- package/dist/core/canvas/focuses.d.ts +22 -0
- package/dist/core/canvas/focuses.js +81 -0
- package/dist/core/canvas/history.d.ts +91 -0
- package/dist/core/canvas/history.js +490 -0
- package/dist/core/canvas/human-work-outbox.d.ts +73 -0
- package/dist/core/canvas/human-work-outbox.js +261 -0
- package/dist/core/canvas/index.d.ts +11 -0
- package/dist/core/canvas/index.js +13 -0
- package/dist/core/canvas/install-id.d.ts +9 -0
- package/dist/core/canvas/install-id.js +84 -0
- package/dist/core/canvas/labels.d.ts +28 -0
- package/dist/core/canvas/labels.js +38 -0
- package/dist/core/canvas/meta-file.d.ts +20 -0
- package/dist/core/canvas/meta-file.js +98 -0
- package/dist/core/canvas/nav-model.d.ts +55 -0
- package/dist/core/canvas/nav-model.js +284 -0
- package/dist/core/canvas/nav-render.d.ts +124 -0
- package/dist/core/canvas/nav-render.js +266 -0
- package/dist/core/canvas/paths.d.ts +81 -0
- package/dist/core/canvas/paths.js +164 -0
- package/dist/core/canvas/pid.d.ts +335 -0
- package/dist/core/canvas/pid.js +636 -0
- package/dist/core/canvas/remote-canvas-source.d.ts +62 -0
- package/dist/core/canvas/remote-canvas-source.js +231 -0
- package/dist/core/canvas/remote-event-stream.d.ts +24 -0
- package/dist/core/canvas/remote-event-stream.js +94 -0
- package/dist/core/canvas/render-source.d.ts +132 -0
- package/dist/core/canvas/render-source.js +457 -0
- package/dist/core/canvas/render.d.ts +47 -0
- package/dist/core/canvas/render.js +237 -0
- package/dist/core/canvas/source.d.ts +35 -0
- package/dist/core/canvas/source.js +44 -0
- package/dist/core/canvas/status-glyph.d.ts +42 -0
- package/dist/core/canvas/status-glyph.js +116 -0
- package/dist/core/canvas/telemetry.d.ts +14 -0
- package/dist/core/canvas/telemetry.js +35 -0
- package/dist/core/canvas/types.d.ts +302 -0
- package/dist/core/canvas/types.js +8 -0
- package/dist/core/clipboard-text.d.ts +3 -0
- package/dist/core/clipboard-text.js +39 -0
- package/dist/core/command-manifests/registry.d.ts +43 -0
- package/dist/core/command-manifests/registry.js +103 -0
- package/dist/core/command-manifests/schema.d.ts +87 -0
- package/dist/core/command-manifests/schema.js +849 -0
- package/dist/core/command-plugins/adapter.d.ts +22 -0
- package/dist/core/command-plugins/adapter.js +160 -0
- package/dist/core/command-plugins/compose.d.ts +11 -0
- package/dist/core/command-plugins/compose.js +88 -0
- package/dist/core/command-plugins/discovery.d.ts +74 -0
- package/dist/core/command-plugins/discovery.js +291 -0
- package/dist/core/command.d.ts +175 -0
- package/dist/core/command.js +636 -0
- package/dist/core/config.d.ts +125 -0
- package/dist/core/config.js +620 -0
- package/dist/core/configured-clis/cache.d.ts +16 -0
- package/dist/core/configured-clis/cache.js +57 -0
- package/dist/core/configured-clis/compose.d.ts +14 -0
- package/dist/core/configured-clis/compose.js +60 -0
- package/dist/core/configured-clis/discovery.d.ts +47 -0
- package/dist/core/configured-clis/discovery.js +173 -0
- package/dist/core/configured-clis/fetch.d.ts +51 -0
- package/dist/core/configured-clis/fetch.js +156 -0
- package/dist/core/configured-clis/invoker.d.ts +36 -0
- package/dist/core/configured-clis/invoker.js +547 -0
- package/dist/core/configured-clis/manifest.d.ts +24 -0
- package/dist/core/configured-clis/manifest.js +284 -0
- package/dist/core/configured-clis/registration.d.ts +40 -0
- package/dist/core/configured-clis/registration.js +201 -0
- package/dist/core/errors.d.ts +27 -0
- package/dist/core/errors.js +48 -0
- package/dist/core/events/emit.d.ts +4 -0
- package/dist/core/events/emit.js +17 -0
- package/dist/core/events/envelope.d.ts +2 -0
- package/dist/core/events/envelope.js +84 -0
- package/dist/core/events/errors.d.ts +4 -0
- package/dist/core/events/errors.js +69 -0
- package/dist/core/events/index.d.ts +5 -0
- package/dist/core/events/index.js +4 -0
- package/dist/core/events/operation-id.d.ts +4 -0
- package/dist/core/events/operation-id.js +24 -0
- package/dist/core/events/read.d.ts +40 -0
- package/dist/core/events/read.js +639 -0
- package/dist/core/events/serialize.d.ts +4 -0
- package/dist/core/events/serialize.js +199 -0
- package/dist/core/events/source.d.ts +18 -0
- package/dist/core/events/source.js +47 -0
- package/dist/core/events/types.d.ts +68 -0
- package/dist/core/events/types.js +11 -0
- package/dist/core/fault-classifier.d.ts +43 -0
- package/dist/core/fault-classifier.js +143 -0
- package/dist/core/feed/__tests__/coalesce-human.test.d.ts +1 -0
- package/dist/core/feed/__tests__/coalesce-human.test.js +36 -0
- package/dist/core/feed/__tests__/empty-node-guard.test.d.ts +1 -0
- package/dist/core/feed/__tests__/empty-node-guard.test.js +45 -0
- package/dist/core/feed/__tests__/inbox-migrate.test.d.ts +1 -0
- package/dist/core/feed/__tests__/inbox-migrate.test.js +53 -0
- package/dist/core/feed/feed.d.ts +31 -0
- package/dist/core/feed/feed.js +159 -0
- package/dist/core/feed/inbox-migrate.d.ts +11 -0
- package/dist/core/feed/inbox-migrate.js +135 -0
- package/dist/core/feed/inbox.d.ts +84 -0
- package/dist/core/feed/inbox.js +407 -0
- package/dist/core/feed/passive.d.ts +14 -0
- package/dist/core/feed/passive.js +114 -0
- package/dist/core/frontmatter.d.ts +8 -0
- package/dist/core/frontmatter.js +35 -0
- package/dist/core/fs-utils.d.ts +21 -0
- package/dist/core/fs-utils.js +149 -0
- package/dist/core/git.d.ts +22 -0
- package/dist/core/git.js +72 -0
- package/dist/core/help.d.ts +223 -0
- package/dist/core/help.js +275 -0
- package/dist/core/host-exports/__tests__/export-prunes-boot-skill.test.d.ts +1 -0
- package/dist/core/host-exports/__tests__/export-prunes-boot-skill.test.js +84 -0
- package/dist/core/host-exports/builtins.d.ts +50 -0
- package/dist/core/host-exports/builtins.js +68 -0
- package/dist/core/host-exports/export.d.ts +32 -0
- package/dist/core/host-exports/export.js +128 -0
- package/dist/core/inspector/core.d.ts +23 -0
- package/dist/core/inspector/core.js +148 -0
- package/dist/core/inspector/model.d.ts +54 -0
- package/dist/core/inspector/model.js +182 -0
- package/dist/core/inspector/text.d.ts +5 -0
- package/dist/core/inspector/text.js +32 -0
- package/dist/core/inspector/tui.d.ts +3 -0
- package/dist/core/inspector/tui.js +220 -0
- package/dist/core/io.d.ts +73 -0
- package/dist/core/io.js +254 -0
- package/dist/core/keybindings/__tests__/bespoke-consumers.test.d.ts +1 -0
- package/dist/core/keybindings/__tests__/bespoke-consumers.test.js +40 -0
- package/dist/core/keybindings/__tests__/inbox-affordance.test.d.ts +1 -0
- package/dist/core/keybindings/__tests__/inbox-affordance.test.js +38 -0
- package/dist/core/keybindings/__tests__/resolve.test.d.ts +1 -0
- package/dist/core/keybindings/__tests__/resolve.test.js +233 -0
- package/dist/core/keybindings/background-bash.d.ts +13 -0
- package/dist/core/keybindings/background-bash.js +34 -0
- package/dist/core/keybindings/catalog.d.ts +15 -0
- package/dist/core/keybindings/catalog.js +285 -0
- package/dist/core/keybindings/inbox.d.ts +21 -0
- package/dist/core/keybindings/inbox.js +35 -0
- package/dist/core/keybindings/index.d.ts +7 -0
- package/dist/core/keybindings/index.js +6 -0
- package/dist/core/keybindings/match.d.ts +29 -0
- package/dist/core/keybindings/match.js +105 -0
- package/dist/core/keybindings/persistence.d.ts +14 -0
- package/dist/core/keybindings/persistence.js +31 -0
- package/dist/core/keybindings/resolve.d.ts +22 -0
- package/dist/core/keybindings/resolve.js +333 -0
- package/dist/core/keybindings/types.d.ts +37 -0
- package/dist/core/keybindings/types.js +1 -0
- package/dist/core/locked-file.d.ts +24 -0
- package/dist/core/locked-file.js +91 -0
- package/dist/core/log.d.ts +3 -0
- package/dist/core/log.js +27 -0
- package/dist/core/manifest.d.ts +5 -0
- package/dist/core/manifest.js +15 -0
- package/dist/core/memory/inline-ref-grammar.d.ts +53 -0
- package/dist/core/memory/inline-ref-grammar.js +99 -0
- package/dist/core/memory/inline-ref-guidance.d.ts +8 -0
- package/dist/core/memory/inline-ref-guidance.js +35 -0
- package/dist/core/memory/inline-ref-inventory.d.ts +13 -0
- package/dist/core/memory/inline-ref-inventory.js +79 -0
- package/dist/core/memory-resolver.d.ts +106 -0
- package/dist/core/memory-resolver.js +422 -0
- package/dist/core/output.d.ts +35 -0
- package/dist/core/output.js +99 -0
- package/dist/core/pagination.d.ts +33 -0
- package/dist/core/pagination.js +89 -0
- package/dist/core/pool-credential-store.d.ts +34 -0
- package/dist/core/pool-credential-store.js +116 -0
- package/dist/core/predicate.d.ts +65 -0
- package/dist/core/predicate.js +191 -0
- package/dist/core/preview-registry.d.ts +25 -0
- package/dist/core/preview-registry.js +2841 -0
- package/dist/core/profiles/__tests__/env-store.test.d.ts +1 -0
- package/dist/core/profiles/__tests__/env-store.test.js +97 -0
- package/dist/core/profiles/__tests__/root-profile.test.d.ts +1 -0
- package/dist/core/profiles/__tests__/root-profile.test.js +69 -0
- package/dist/core/profiles/default-binding.d.ts +6 -0
- package/dist/core/profiles/default-binding.js +46 -0
- package/dist/core/profiles/env-store.d.ts +22 -0
- package/dist/core/profiles/env-store.js +157 -0
- package/dist/core/profiles/manifest.d.ts +35 -0
- package/dist/core/profiles/manifest.js +371 -0
- package/dist/core/profiles/select.d.ts +42 -0
- package/dist/core/profiles/select.js +673 -0
- package/dist/core/profiles/state-block.d.ts +4 -0
- package/dist/core/profiles/state-block.js +16 -0
- package/dist/core/provider-management.d.ts +12 -0
- package/dist/core/provider-management.js +22 -0
- package/dist/core/render.d.ts +12 -0
- package/dist/core/render.js +127 -0
- package/dist/core/resolver.d.ts +14 -0
- package/dist/core/resolver.js +136 -0
- package/dist/core/runtime/__tests__/command-expansion.test.d.ts +1 -0
- package/dist/core/runtime/__tests__/command-expansion.test.js +25 -0
- package/dist/core/runtime/__tests__/engine-route.test.d.ts +1 -0
- package/dist/core/runtime/__tests__/engine-route.test.js +36 -0
- package/dist/core/runtime/__tests__/install-id-cache-scoping.test.d.ts +1 -0
- package/dist/core/runtime/__tests__/install-id-cache-scoping.test.js +41 -0
- package/dist/core/runtime/__tests__/node-env.test.d.ts +1 -0
- package/dist/core/runtime/__tests__/node-env.test.js +73 -0
- package/dist/core/runtime/__tests__/spawn-at-given-id.test.d.ts +1 -0
- package/dist/core/runtime/__tests__/spawn-at-given-id.test.js +34 -0
- package/dist/core/runtime/__tests__/spawn-env.test.d.ts +1 -0
- package/dist/core/runtime/__tests__/spawn-env.test.js +268 -0
- package/dist/core/runtime/auth-reload.d.ts +7 -0
- package/dist/core/runtime/auth-reload.js +67 -0
- package/dist/core/runtime/banner.d.ts +13 -0
- package/dist/core/runtime/banner.js +51 -0
- package/dist/core/runtime/bearings.d.ts +99 -0
- package/dist/core/runtime/bearings.js +429 -0
- package/dist/core/runtime/boot-root.d.ts +24 -0
- package/dist/core/runtime/boot-root.js +102 -0
- package/dist/core/runtime/branded-host.d.ts +25 -0
- package/dist/core/runtime/branded-host.js +342 -0
- package/dist/core/runtime/broker-cli.d.ts +1 -0
- package/dist/core/runtime/broker-cli.js +81 -0
- package/dist/core/runtime/broker-protocol.d.ts +642 -0
- package/dist/core/runtime/broker-protocol.js +146 -0
- package/dist/core/runtime/broker-request.d.ts +37 -0
- package/dist/core/runtime/broker-request.js +85 -0
- package/dist/core/runtime/broker-sdk.d.ts +36 -0
- package/dist/core/runtime/broker-sdk.js +128 -0
- package/dist/core/runtime/broker.d.ts +245 -0
- package/dist/core/runtime/broker.js +3711 -0
- package/dist/core/runtime/busy.d.ts +32 -0
- package/dist/core/runtime/busy.js +107 -0
- package/dist/core/runtime/canvas-extensions.d.ts +20 -0
- package/dist/core/runtime/canvas-extensions.js +70 -0
- package/dist/core/runtime/close.d.ts +34 -0
- package/dist/core/runtime/close.js +223 -0
- package/dist/core/runtime/command-expansion.d.ts +19 -0
- package/dist/core/runtime/command-expansion.js +104 -0
- package/dist/core/runtime/connectivity.d.ts +12 -0
- package/dist/core/runtime/connectivity.js +73 -0
- package/dist/core/runtime/deliver-live.d.ts +26 -0
- package/dist/core/runtime/deliver-live.js +63 -0
- package/dist/core/runtime/fault-recovery-nudge.d.ts +3 -0
- package/dist/core/runtime/fault-recovery-nudge.js +3 -0
- package/dist/core/runtime/fault-recovery.d.ts +23 -0
- package/dist/core/runtime/fault-recovery.js +83 -0
- package/dist/core/runtime/fault.d.ts +64 -0
- package/dist/core/runtime/fault.js +260 -0
- package/dist/core/runtime/fleet.d.ts +57 -0
- package/dist/core/runtime/fleet.js +35 -0
- package/dist/core/runtime/front-door.d.ts +16 -0
- package/dist/core/runtime/front-door.js +186 -0
- package/dist/core/runtime/host.d.ts +43 -0
- package/dist/core/runtime/host.js +432 -0
- package/dist/core/runtime/interactive-deliver.d.ts +15 -0
- package/dist/core/runtime/interactive-deliver.js +41 -0
- package/dist/core/runtime/kickoff.d.ts +53 -0
- package/dist/core/runtime/kickoff.js +289 -0
- package/dist/core/runtime/launch-prompt.d.ts +8 -0
- package/dist/core/runtime/launch-prompt.js +13 -0
- package/dist/core/runtime/launch.d.ts +191 -0
- package/dist/core/runtime/launch.js +442 -0
- package/dist/core/runtime/lifecycle.d.ts +12 -0
- package/dist/core/runtime/lifecycle.js +121 -0
- package/dist/core/runtime/managed-provider-cooling.d.ts +38 -0
- package/dist/core/runtime/managed-provider-cooling.js +81 -0
- package/dist/core/runtime/memory.d.ts +3 -0
- package/dist/core/runtime/memory.js +18 -0
- package/dist/core/runtime/model-selection.d.ts +41 -0
- package/dist/core/runtime/model-selection.js +118 -0
- package/dist/core/runtime/model-swap.d.ts +27 -0
- package/dist/core/runtime/model-swap.js +70 -0
- package/dist/core/runtime/naming-persist.d.ts +11 -0
- package/dist/core/runtime/naming-persist.js +41 -0
- package/dist/core/runtime/naming.d.ts +26 -0
- package/dist/core/runtime/naming.js +174 -0
- package/dist/core/runtime/node-read.d.ts +36 -0
- package/dist/core/runtime/node-read.js +255 -0
- package/dist/core/runtime/nodes.d.ts +113 -0
- package/dist/core/runtime/nodes.js +330 -0
- package/dist/core/runtime/package-health.d.ts +49 -0
- package/dist/core/runtime/package-health.js +217 -0
- package/dist/core/runtime/persona.d.ts +25 -0
- package/dist/core/runtime/persona.js +132 -0
- package/dist/core/runtime/pi-cli.d.ts +8 -0
- package/dist/core/runtime/pi-cli.js +65 -0
- package/dist/core/runtime/pi-vendored.d.ts +26 -0
- package/dist/core/runtime/pi-vendored.js +77 -0
- package/dist/core/runtime/placement-tmux.d.ts +42 -0
- package/dist/core/runtime/placement-tmux.js +151 -0
- package/dist/core/runtime/placement.d.ts +97 -0
- package/dist/core/runtime/placement.js +394 -0
- package/dist/core/runtime/promote.d.ts +44 -0
- package/dist/core/runtime/promote.js +176 -0
- package/dist/core/runtime/recap.d.ts +8 -0
- package/dist/core/runtime/recap.js +136 -0
- package/dist/core/runtime/recycle.d.ts +14 -0
- package/dist/core/runtime/recycle.js +158 -0
- package/dist/core/runtime/reopen.d.ts +32 -0
- package/dist/core/runtime/reopen.js +119 -0
- package/dist/core/runtime/reset.d.ts +68 -0
- package/dist/core/runtime/reset.js +198 -0
- package/dist/core/runtime/resume-root.d.ts +6 -0
- package/dist/core/runtime/resume-root.js +292 -0
- package/dist/core/runtime/revive-all.d.ts +61 -0
- package/dist/core/runtime/revive-all.js +106 -0
- package/dist/core/runtime/revive.d.ts +58 -0
- package/dist/core/runtime/revive.js +357 -0
- package/dist/core/runtime/roadmap.d.ts +13 -0
- package/dist/core/runtime/roadmap.js +45 -0
- package/dist/core/runtime/session-branch.d.ts +13 -0
- package/dist/core/runtime/session-branch.js +46 -0
- package/dist/core/runtime/session-cycles.d.ts +30 -0
- package/dist/core/runtime/session-cycles.js +77 -0
- package/dist/core/runtime/session-list-cache.d.ts +53 -0
- package/dist/core/runtime/session-list-cache.js +406 -0
- package/dist/core/runtime/situational-context.d.ts +12 -0
- package/dist/core/runtime/situational-context.js +48 -0
- package/dist/core/runtime/situational-live.d.ts +9 -0
- package/dist/core/runtime/situational-live.js +40 -0
- package/dist/core/runtime/spawn-env.d.ts +31 -0
- package/dist/core/runtime/spawn-env.js +179 -0
- package/dist/core/runtime/spawn.d.ts +118 -0
- package/dist/core/runtime/spawn.js +473 -0
- package/dist/core/runtime/stop-guard.d.ts +18 -0
- package/dist/core/runtime/stop-guard.js +77 -0
- package/dist/core/runtime/stop-signals.d.ts +14 -0
- package/dist/core/runtime/stop-signals.js +46 -0
- package/dist/core/runtime/stream-watchdog.d.ts +55 -0
- package/dist/core/runtime/stream-watchdog.js +140 -0
- package/dist/core/runtime/structured-output.d.ts +12 -0
- package/dist/core/runtime/structured-output.js +90 -0
- package/dist/core/runtime/surface-bg.d.ts +11 -0
- package/dist/core/runtime/surface-bg.js +68 -0
- package/dist/core/runtime/tmux-chrome.d.ts +1 -0
- package/dist/core/runtime/tmux-chrome.js +4 -0
- package/dist/core/runtime/tmux.d.ts +247 -0
- package/dist/core/runtime/tmux.js +858 -0
- package/dist/core/runtime/warm-pool.d.ts +51 -0
- package/dist/core/runtime/warm-pool.js +373 -0
- package/dist/core/scope.d.ts +47 -0
- package/dist/core/scope.js +255 -0
- package/dist/core/secrets.d.ts +25 -0
- package/dist/core/secrets.js +55 -0
- package/dist/core/self-update.d.ts +21 -0
- package/dist/core/self-update.js +105 -0
- package/dist/core/session-model/session-state.d.ts +51 -0
- package/dist/core/session-model/session-state.js +170 -0
- package/dist/core/spawn.d.ts +16 -0
- package/dist/core/spawn.js +30 -0
- package/dist/core/stdout-errors.d.ts +3 -0
- package/dist/core/stdout-errors.js +14 -0
- package/dist/core/subscription-state.d.ts +138 -0
- package/dist/core/subscription-state.js +918 -0
- package/dist/core/substrate/ceiling.d.ts +20 -0
- package/dist/core/substrate/ceiling.js +69 -0
- package/dist/core/substrate/gate.d.ts +13 -0
- package/dist/core/substrate/gate.js +21 -0
- package/dist/core/substrate/index.d.ts +11 -0
- package/dist/core/substrate/index.js +25 -0
- package/dist/core/substrate/injected-store.d.ts +10 -0
- package/dist/core/substrate/injected-store.js +55 -0
- package/dist/core/substrate/on-read.d.ts +14 -0
- package/dist/core/substrate/on-read.js +404 -0
- package/dist/core/substrate/render-node.d.ts +11 -0
- package/dist/core/substrate/render-node.js +29 -0
- package/dist/core/substrate/render.d.ts +21 -0
- package/dist/core/substrate/render.js +547 -0
- package/dist/core/substrate/schema.d.ts +125 -0
- package/dist/core/substrate/schema.js +191 -0
- package/dist/core/substrate/session-cache.d.ts +25 -0
- package/dist/core/substrate/session-cache.js +101 -0
- package/dist/core/substrate/subject-fields.d.ts +45 -0
- package/dist/core/substrate/subject-fields.js +38 -0
- package/dist/core/substrate/subject.d.ts +12 -0
- package/dist/core/substrate/subject.js +47 -0
- package/dist/core/timing.d.ts +11 -0
- package/dist/core/timing.js +94 -0
- package/dist/core/tui/__tests__/host-keybindings.test.d.ts +1 -0
- package/dist/core/tui/__tests__/host-keybindings.test.js +113 -0
- package/dist/core/tui/draw.d.ts +100 -0
- package/dist/core/tui/draw.js +359 -0
- package/dist/core/tui/host.d.ts +66 -0
- package/dist/core/tui/host.js +689 -0
- package/dist/core/tui/terminal.d.ts +23 -0
- package/dist/core/tui/terminal.js +101 -0
- package/dist/core/view/__tests__/transport-cache.test.d.ts +1 -0
- package/dist/core/view/__tests__/transport-cache.test.js +62 -0
- package/dist/core/view/__tests__/transport-remote.test.d.ts +1 -0
- package/dist/core/view/__tests__/transport-remote.test.js +98 -0
- package/dist/core/view/bridge.d.ts +10 -0
- package/dist/core/view/bridge.js +31 -0
- package/dist/core/view/chrome.d.ts +9 -0
- package/dist/core/view/chrome.js +22 -0
- package/dist/core/view/contract.d.ts +205 -0
- package/dist/core/view/contract.js +23 -0
- package/dist/core/view/loader.d.ts +31 -0
- package/dist/core/view/loader.js +188 -0
- package/dist/core/view/remote-canvas-target.d.ts +4 -0
- package/dist/core/view/remote-canvas-target.js +30 -0
- package/dist/core/view/stream-local.d.ts +3 -0
- package/dist/core/view/stream-local.js +231 -0
- package/dist/core/view/transport-cache.d.ts +8 -0
- package/dist/core/view/transport-cache.js +38 -0
- package/dist/core/view/transport-local.d.ts +7 -0
- package/dist/core/view/transport-local.js +83 -0
- package/dist/core/view/transport-remote.d.ts +2 -0
- package/dist/core/view/transport-remote.js +58 -0
- package/dist/core/view/transport.d.ts +10 -0
- package/dist/core/view/transport.js +15 -0
- package/dist/core/wake.d.ts +86 -0
- package/dist/core/wake.js +307 -0
- package/dist/core/worktree.d.ts +111 -0
- package/dist/core/worktree.js +732 -0
- package/dist/daemon/__tests__/broker-ownership.test.d.ts +1 -0
- package/dist/daemon/__tests__/broker-ownership.test.js +25 -0
- package/dist/daemon/__tests__/daemon-ownership.test.d.ts +1 -0
- package/dist/daemon/__tests__/daemon-ownership.test.js +27 -0
- package/dist/daemon/api/__tests__/error-seam.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/error-seam.test.js +56 -0
- package/dist/daemon/api/__tests__/full/api-server.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/full/api-server.test.js +369 -0
- package/dist/daemon/api/__tests__/full/b10-attach-modelauth.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/full/b10-attach-modelauth.test.js +220 -0
- package/dist/daemon/api/__tests__/full/push-parity.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/full/push-parity.test.js +199 -0
- package/dist/daemon/api/__tests__/full/worktree-parity.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/full/worktree-parity.test.js +160 -0
- package/dist/daemon/api/__tests__/inbox.test.d.ts +1 -0
- package/dist/daemon/api/__tests__/inbox.test.js +578 -0
- package/dist/daemon/api/bridge.d.ts +21 -0
- package/dist/daemon/api/bridge.js +351 -0
- package/dist/daemon/api/handlers/attach.d.ts +2 -0
- package/dist/daemon/api/handlers/attach.js +56 -0
- package/dist/daemon/api/handlers/canvas.d.ts +2 -0
- package/dist/daemon/api/handlers/canvas.js +463 -0
- package/dist/daemon/api/handlers/crons.d.ts +2 -0
- package/dist/daemon/api/handlers/crons.js +354 -0
- package/dist/daemon/api/handlers/daemon.d.ts +2 -0
- package/dist/daemon/api/handlers/daemon.js +35 -0
- package/dist/daemon/api/handlers/files.d.ts +2 -0
- package/dist/daemon/api/handlers/files.js +64 -0
- package/dist/daemon/api/handlers/focus.d.ts +2 -0
- package/dist/daemon/api/handlers/focus.js +92 -0
- package/dist/daemon/api/handlers/health.d.ts +2 -0
- package/dist/daemon/api/handlers/health.js +65 -0
- package/dist/daemon/api/handlers/human.d.ts +12 -0
- package/dist/daemon/api/handlers/human.js +741 -0
- package/dist/daemon/api/handlers/inbox.d.ts +2 -0
- package/dist/daemon/api/handlers/inbox.js +423 -0
- package/dist/daemon/api/handlers/messages.d.ts +2 -0
- package/dist/daemon/api/handlers/messages.js +290 -0
- package/dist/daemon/api/handlers/modelauth.d.ts +2 -0
- package/dist/daemon/api/handlers/modelauth.js +116 -0
- package/dist/daemon/api/handlers/nodes.d.ts +2 -0
- package/dist/daemon/api/handlers/nodes.js +540 -0
- package/dist/daemon/api/handlers/profiles.d.ts +2 -0
- package/dist/daemon/api/handlers/profiles.js +69 -0
- package/dist/daemon/api/handlers/reports.d.ts +2 -0
- package/dist/daemon/api/handlers/reports.js +144 -0
- package/dist/daemon/api/handlers/subscriptions.d.ts +2 -0
- package/dist/daemon/api/handlers/subscriptions.js +53 -0
- package/dist/daemon/api/handlers/worktree.d.ts +2 -0
- package/dist/daemon/api/handlers/worktree.js +40 -0
- package/dist/daemon/api/map.d.ts +100 -0
- package/dist/daemon/api/map.js +360 -0
- package/dist/daemon/api/router.d.ts +56 -0
- package/dist/daemon/api/router.js +190 -0
- package/dist/daemon/api/server.d.ts +23 -0
- package/dist/daemon/api/server.js +258 -0
- package/dist/daemon/control.d.ts +21 -0
- package/dist/daemon/control.js +22 -0
- package/dist/daemon/cron-run.d.ts +64 -0
- package/dist/daemon/cron-run.js +944 -0
- package/dist/daemon/cron-sink.d.ts +26 -0
- package/dist/daemon/cron-sink.js +43 -0
- package/dist/daemon/crtrd-cli.d.ts +1 -0
- package/dist/daemon/crtrd-cli.js +18 -0
- package/dist/daemon/crtrd.d.ts +89 -0
- package/dist/daemon/crtrd.js +1953 -0
- package/dist/daemon/fleet.d.ts +81 -0
- package/dist/daemon/fleet.js +405 -0
- package/dist/daemon/manage.d.ts +103 -0
- package/dist/daemon/manage.js +389 -0
- package/dist/daemon/pidfile.d.ts +8 -0
- package/dist/daemon/pidfile.js +37 -0
- package/dist/daemon/supervise-cadence.d.ts +1 -0
- package/dist/daemon/supervise-cadence.js +6 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +44 -0
- package/dist/pi-extensions/__tests__/canvas-bash-valve.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-bash-valve.test.js +31 -0
- package/dist/pi-extensions/__tests__/canvas-context-intro.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-context-intro.test.js +182 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-agentend.test.js +467 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.d.ts +1 -0
- package/dist/pi-extensions/__tests__/canvas-stophook-context-nudge.test.js +121 -0
- package/dist/pi-extensions/canvas-bash-valve.d.ts +8 -0
- package/dist/pi-extensions/canvas-bash-valve.js +297 -0
- package/dist/pi-extensions/canvas-context-intro.d.ts +91 -0
- package/dist/pi-extensions/canvas-context-intro.js +230 -0
- package/dist/pi-extensions/canvas-doc-substrate.d.ts +44 -0
- package/dist/pi-extensions/canvas-doc-substrate.js +151 -0
- package/dist/pi-extensions/canvas-goal-capture.d.ts +21 -0
- package/dist/pi-extensions/canvas-goal-capture.js +83 -0
- package/dist/pi-extensions/canvas-inbox-watcher.d.ts +25 -0
- package/dist/pi-extensions/canvas-inbox-watcher.js +942 -0
- package/dist/pi-extensions/canvas-passive-context.d.ts +32 -0
- package/dist/pi-extensions/canvas-passive-context.js +134 -0
- package/dist/pi-extensions/canvas-recap.d.ts +41 -0
- package/dist/pi-extensions/canvas-recap.js +263 -0
- package/dist/pi-extensions/canvas-stophook.d.ts +53 -0
- package/dist/pi-extensions/canvas-stophook.js +985 -0
- package/dist/pi-extensions/canvas-structured-output.d.ts +9 -0
- package/dist/pi-extensions/canvas-structured-output.js +155 -0
- package/dist/prompts/review.d.ts +2 -0
- package/dist/prompts/review.js +130 -0
- package/dist/prompts/view.d.ts +7 -0
- package/dist/prompts/view.js +172 -0
- package/dist/suppress-experimental-warnings.d.ts +1 -0
- package/dist/suppress-experimental-warnings.js +15 -0
- package/dist/types.d.ts +297 -0
- package/dist/types.js +153 -0
- package/dist/web/ViewChrome.d.ts +7 -0
- package/dist/web/ViewChrome.js +28 -0
- package/dist/web/ViewPane.d.ts +39 -0
- package/dist/web/ViewPane.js +48 -0
- package/dist/web/index.d.ts +8 -0
- package/dist/web/index.js +22 -0
- package/dist/web/runtime.d.ts +39 -0
- package/dist/web/runtime.js +232 -0
- package/dist/web/states.d.ts +24 -0
- package/dist/web/states.js +24 -0
- package/dist/web/transport-http.d.ts +5 -0
- package/dist/web/transport-http.js +34 -0
- package/dist/web/transport-stream.d.ts +3 -0
- package/dist/web/transport-stream.js +204 -0
- package/dist/web-client/apple-touch-icon.png +0 -0
- package/dist/web-client/assets/fragment-mono-latin-400-normal-BYwT3kSJ.woff +0 -0
- package/dist/web-client/assets/fragment-mono-latin-400-normal-yxdJ5AmL.woff2 +0 -0
- package/dist/web-client/assets/fragment-mono-latin-ext-400-normal-BbKYyvR9.woff2 +0 -0
- package/dist/web-client/assets/fragment-mono-latin-ext-400-normal-CT4YFKeK.woff +0 -0
- package/dist/web-client/assets/index-BpyZGBhI.js +79 -0
- package/dist/web-client/assets/index-CpEl9LTS.css +2 -0
- package/dist/web-client/assets/martian-mono-cyrillic-wght-normal-B84CD5C_.woff2 +0 -0
- package/dist/web-client/assets/martian-mono-latin-ext-wght-normal-DlL6xMw5.woff2 +0 -0
- package/dist/web-client/assets/martian-mono-latin-wght-normal-5W32yIyr.woff2 +0 -0
- package/dist/web-client/assets/workbox-window.prod.es5-Bd17z0YL.js +2 -0
- package/dist/web-client/icon-192.png +0 -0
- package/dist/web-client/icon-512.png +0 -0
- package/dist/web-client/icon-maskable-512.png +0 -0
- package/dist/web-client/index.html +17 -0
- package/dist/web-client/manifest.webmanifest +1 -0
- package/dist/web-client/sw.js +1 -0
- package/docs/compat/hearth-crtr-v1.md +187 -0
- package/docs/compat/hearth-crtr-v2.md +185 -0
- package/docs/compat/hearth-crtr-v3.md +184 -0
- package/docs/compat/hearth-crtr-v4.md +188 -0
- package/docs/compat/hearth-crtr-v5.md +175 -0
- package/docs/public-api.md +77 -0
- package/package.json +156 -0
- package/runtime.lock.json +12919 -0
- package/scripts/install-runtime.mjs +308 -0
- package/scripts/patch-pi-tree-root-ordering.mjs +57 -0
- package/scripts/postinstall.mjs +33 -0
- package/scripts/runtime-lock.mjs +26 -0
|
@@ -0,0 +1,985 @@
|
|
|
1
|
+
// canvas-stophook.ts — pi extension for pi-native canvas agent nodes.
|
|
2
|
+
//
|
|
3
|
+
// Loaded into every canvas node's pi process via the node's launch.extensions
|
|
4
|
+
// list. INERT when CRTR_NODE_ID is absent (plain pi session or legacy job agent).
|
|
5
|
+
//
|
|
6
|
+
// In the canvas model each node owns a dedicated pi window (one-window-per-node),
|
|
7
|
+
// so the tmux pane-relocation swap-back guard of the legacy stophook is omitted —
|
|
8
|
+
// there are no shared pane slots to restore.
|
|
9
|
+
//
|
|
10
|
+
// Responsibilities:
|
|
11
|
+
//
|
|
12
|
+
// turn_end — accumulate token usage and flush telemetry.json under the node's
|
|
13
|
+
// job/ dir so the dashboard shows live counts.
|
|
14
|
+
//
|
|
15
|
+
// agent_end — stage the completed attempt for Pi's settlement boundary.
|
|
16
|
+
//
|
|
17
|
+
// agent_settled — decide what happens after recovery and queued continuations:
|
|
18
|
+
// (a) stopReason is 'aborted' or 'error' → stay alive for re-steering; return.
|
|
19
|
+
// (b) node.status is already 'done' (agent called `crtr push --final` this
|
|
20
|
+
// turn, which sets status synchronously) → shut down; work is complete.
|
|
21
|
+
// (c) Natural stop ('stop' | 'length') — run the stop-guard (the node is
|
|
22
|
+
// NEVER auto-pushed; it reports only via its own explicit `crtr push`):
|
|
23
|
+
// • 'reprompt' → pi.sendUserMessage so the node finishes or escalates.
|
|
24
|
+
// • 'allow' (awaiting) → idle-release: free the tmux window and shut
|
|
25
|
+
// down; the daemon watches the inbox and revives it
|
|
26
|
+
// (resume) when a subscribed worker delivers.
|
|
27
|
+
// • 'allow' (attended root) → stay alive, dormant; the human wakes it.
|
|
28
|
+
//
|
|
29
|
+
// Plain TS-with-types — no imports from @earendil-works/* so this compiles inside
|
|
30
|
+
// crouter's own tsc build without a dep on the pi packages.
|
|
31
|
+
import { writeFileSync, mkdirSync, existsSync, readFileSync } from 'node:fs';
|
|
32
|
+
import { join } from 'node:path';
|
|
33
|
+
import { publishFollowUpProgress } from '@crouton-kit/humanloop';
|
|
34
|
+
import { getNode, jobDir, updateNode, recordPid, setPresence, dispatchFollowUpWork, dispatchVisualWork, getFollowUpWorkRow, getHumanWorkRow, reconcileFollowUpWork, reconcileVisualWork } from '../core/canvas/index.js';
|
|
35
|
+
import { transition } from '../core/runtime/lifecycle.js';
|
|
36
|
+
import { markBusy, clearBusy, touchBusy, isBusy } from '../core/runtime/busy.js';
|
|
37
|
+
import { clearFault, readFault } from '../core/runtime/fault.js';
|
|
38
|
+
import { nextFaultRetry } from '../core/runtime/fault-recovery.js';
|
|
39
|
+
import { evaluateStop } from '../core/runtime/stop-guard.js';
|
|
40
|
+
import { personaDrift, commitPersonaAck } from '../core/runtime/persona.js';
|
|
41
|
+
import { clearYieldMessage } from '../core/runtime/kickoff.js';
|
|
42
|
+
import { handleNewSession, markCleanExitDone } from '../core/runtime/reset.js';
|
|
43
|
+
import { clearStopSignals, consumeStopSignals } from '../core/runtime/stop-signals.js';
|
|
44
|
+
import { cliClient } from '../commands/api-client.js';
|
|
45
|
+
import { focusOf, tearDownNode } from '../core/runtime/placement.js';
|
|
46
|
+
import { readCursor, readInboxSince } from '../core/feed/inbox.js';
|
|
47
|
+
/** Universal upper bound for an unfocused broker parked without runnable work. */
|
|
48
|
+
export const UNATTENDED_PARK_MS = (() => {
|
|
49
|
+
const testOverride = process.env['CRTR_TEST_UNATTENDED_PARK_MS'];
|
|
50
|
+
if (testOverride === undefined)
|
|
51
|
+
return 15 * 60_000;
|
|
52
|
+
const parsed = Number(testOverride);
|
|
53
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : 15 * 60_000;
|
|
54
|
+
})();
|
|
55
|
+
/** Production cadence for the bounded-release clock. A shorter test bound also
|
|
56
|
+
* shortens the cadence, so the full-tier regression need not sleep for a minute. */
|
|
57
|
+
export const PARK_POLL_MS = Math.min(60_000, UNATTENDED_PARK_MS);
|
|
58
|
+
/** Condense a tool call into one short line for the activity cue. Picks the most
|
|
59
|
+
* identifying arg (command / path / pattern / description), collapses whitespace,
|
|
60
|
+
* and hard-caps the length so a giant bash command can't bloat telemetry.json. */
|
|
61
|
+
const ACTIVITY_CAP = 80;
|
|
62
|
+
function summarizeActivity(toolName, args) {
|
|
63
|
+
const a = (args ?? {});
|
|
64
|
+
const pick = (v) => (typeof v === 'string' ? v : '');
|
|
65
|
+
const detail = pick(a['command']) || pick(a['path']) || pick(a['file_path']) || pick(a['pattern']) || pick(a['description']) || pick(a['prompt']);
|
|
66
|
+
const line = (detail !== '' ? `${toolName}: ${detail}` : toolName).replace(/\s+/g, ' ').trim();
|
|
67
|
+
return line.length > ACTIVITY_CAP ? line.slice(0, ACTIVITY_CAP) : line;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Merge accumulated token counts into nodes/<nodeId>/job/telemetry.json.
|
|
71
|
+
* Creates the directory when it doesn't yet exist. Best-effort; never throws.
|
|
72
|
+
* `contextTokens` is the live window gauge for THIS turn; when null (pi can't
|
|
73
|
+
* size the window yet) the last recorded value is preserved.
|
|
74
|
+
*/
|
|
75
|
+
function flushTelemetry(jobDirPath, tokensIn, tokensOut, model, contextTokens, activity) {
|
|
76
|
+
try {
|
|
77
|
+
if (!existsSync(jobDirPath))
|
|
78
|
+
mkdirSync(jobDirPath, { recursive: true });
|
|
79
|
+
const filePath = join(jobDirPath, 'telemetry.json');
|
|
80
|
+
// Merge with any existing record so concurrent readers always see a complete
|
|
81
|
+
// picture. Model name falls back to whatever was last recorded.
|
|
82
|
+
let existing = {};
|
|
83
|
+
if (existsSync(filePath)) {
|
|
84
|
+
try {
|
|
85
|
+
existing = JSON.parse(readFileSync(filePath, 'utf8'));
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
/* start fresh on a corrupt file */
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const record = {
|
|
92
|
+
tokens_in: tokensIn,
|
|
93
|
+
tokens_out: tokensOut,
|
|
94
|
+
context_tokens: contextTokens ?? existing.context_tokens,
|
|
95
|
+
last_activity: activity ?? existing.last_activity,
|
|
96
|
+
model: model !== '' ? model : (existing.model ?? ''),
|
|
97
|
+
updated_at: new Date().toISOString(),
|
|
98
|
+
};
|
|
99
|
+
writeFileSync(filePath, JSON.stringify(record, null, 2), 'utf8');
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
/* telemetry is best-effort; never surface */
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// ---------------------------------------------------------------------------
|
|
106
|
+
// Message-extraction helpers
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
/** Walk backwards through the agent_end messages array to find the last
|
|
109
|
+
* assistant turn. */
|
|
110
|
+
function lastAssistantMessage(messages) {
|
|
111
|
+
for (let i = messages.length - 1; i >= 0; i--) {
|
|
112
|
+
if (messages[i]?.role === 'assistant')
|
|
113
|
+
return messages[i];
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
// ---------------------------------------------------------------------------
|
|
118
|
+
// Context-size steering bands — a single shared schedule of thresholds that
|
|
119
|
+
// ESCALATE in tone as input context grows. The first band is a gentle
|
|
120
|
+
// "consider it"; a later band turns firm. The schedule TIGHTENS as it climbs:
|
|
121
|
+
// 130k, 150k, 170k, 185k, 200k, then every 10k (210k, 220k, …) so a long-lived
|
|
122
|
+
// node keeps getting reminded, more often the deeper it goes.
|
|
123
|
+
//
|
|
124
|
+
// The band schedule is shared across all node shapes; only the MESSAGE differs
|
|
125
|
+
// (steerNote), keyed on MODE first, then LIFECYCLE — three reachable personas:
|
|
126
|
+
// orchestrator (terminal OR resident): HAS a roadmap (promotion / orchestrator
|
|
127
|
+
// birth seeds context/roadmap.md), so it is steered to checkpoint +
|
|
128
|
+
// yield — 130k gentle (consider yielding) → 150k firm (do it now) →
|
|
129
|
+
// 185k+ pushy. Keyed on mode, NOT lifecycle: a terminal/orchestrator
|
|
130
|
+
// yields against its roadmap exactly like a resident one (the
|
|
131
|
+
// daemon's refresh-revive keys on intent='refresh', not lifecycle).
|
|
132
|
+
// resident/base (a root conversation): NO roadmap on disk yet, so it is not
|
|
133
|
+
// told to checkpoint one. `crtr node yield` is still its continue
|
|
134
|
+
// verb — mode-preserving, continuing fresh against its goal and its
|
|
135
|
+
// note — offered against wrap-up, since a root chat can simply end.
|
|
136
|
+
// `--promote` is mentioned only once the chat has genuinely grown
|
|
137
|
+
// into phases to delegate. Gentle → firm → pushy.
|
|
138
|
+
// terminal/base (a worker): steered to `crtr node yield` to continue in a
|
|
139
|
+
// fresh window, mode-preserving, when work remains, or `push final`
|
|
140
|
+
// when close. Gentle → firm → pushy.
|
|
141
|
+
//
|
|
142
|
+
// Every persona's "keep going" verb is `crtr node yield` — NEVER a bare `node
|
|
143
|
+
// promote`, which framed promotion as a heavy "become an orchestrator" step and
|
|
144
|
+
// bred yield-avoidance. A plain yield is always mode-preserving — a base node's
|
|
145
|
+
// yield never auto-promotes, so the agent is never steered to decide about
|
|
146
|
+
// promotion at all; `--promote` is a separate opt-in mentioned only for
|
|
147
|
+
// became-multi-phase work. Only a terminal node is ever told `push final` (a
|
|
148
|
+
// resident finishes by yielding or being closed); only an orchestrator already
|
|
149
|
+
// HAS a roadmap to checkpoint before it yields.
|
|
150
|
+
// ---------------------------------------------------------------------------
|
|
151
|
+
const STEER_STEP = 10_000;
|
|
152
|
+
// Shared escalation schedule (both lifecycles). Tightens as it climbs:
|
|
153
|
+
// 130k, 150k, 170k, 185k, 200k, then every 10k (210k, 220k, …).
|
|
154
|
+
const BANDS = [130_000, 150_000, 170_000, 185_000, 200_000];
|
|
155
|
+
/** The highest band threshold at or below `tokens`. Below the first band →
|
|
156
|
+
* null. At/past the last listed band, bands continue every STEER_STEP (so the
|
|
157
|
+
* firmest nudge keeps recurring). */
|
|
158
|
+
function steerBand(tokens) {
|
|
159
|
+
const first = BANDS[0];
|
|
160
|
+
const last = BANDS[BANDS.length - 1];
|
|
161
|
+
if (tokens < first)
|
|
162
|
+
return null;
|
|
163
|
+
if (tokens >= last)
|
|
164
|
+
return last + Math.floor((tokens - last) / STEER_STEP) * STEER_STEP;
|
|
165
|
+
let chosen = first;
|
|
166
|
+
for (const b of BANDS)
|
|
167
|
+
if (tokens >= b)
|
|
168
|
+
chosen = b;
|
|
169
|
+
return chosen;
|
|
170
|
+
}
|
|
171
|
+
/** The nudge text for a crossed band, specialized to the node's (mode,
|
|
172
|
+
* lifecycle) persona + how far along the escalation it is. `crtr node yield` is
|
|
173
|
+
* the single "keep going past this window" verb for every persona: it refreshes
|
|
174
|
+
* the node into a clean window, MODE-PRESERVING — a base node stays base,
|
|
175
|
+
* continuing fresh against its goal and its note. `--promote` is a separate,
|
|
176
|
+
* explicit opt-in (never steered here as auto-behavior) for when what remains
|
|
177
|
+
* has genuinely grown into phases to delegate across children — so no persona
|
|
178
|
+
* is ever steered at a bare `node promote` (which framed promotion as a heavy
|
|
179
|
+
* "become an orchestrator" step and bred yield-avoidance).
|
|
180
|
+
*
|
|
181
|
+
* - orchestrator (terminal OR resident): checkpoint context/roadmap.md, then
|
|
182
|
+
* yield (it already has a roadmap to bring current first).
|
|
183
|
+
* - resident/base (root conversation): yield to continue fresh if the chat is
|
|
184
|
+
* growing into a job, else wrap up — a root can simply end.
|
|
185
|
+
* - terminal/base (worker): yield to continue if work remains, or `push final`
|
|
186
|
+
* when close.
|
|
187
|
+
*
|
|
188
|
+
* The wording strengthens with depth: gentle < 150k → firm < 185k → pushy at/
|
|
189
|
+
* past 185k, where drifting further risks an overflow. */
|
|
190
|
+
export function steerNote(at, lifecycle, mode) {
|
|
191
|
+
const k = Math.round(at / 1000);
|
|
192
|
+
const pushy = at >= 185_000;
|
|
193
|
+
// Keyed on MODE first: any orchestrator (terminal or resident) has a roadmap
|
|
194
|
+
// to checkpoint + yield against.
|
|
195
|
+
if (mode === 'orchestrator') {
|
|
196
|
+
if (at < 150_000) {
|
|
197
|
+
return `Context ~${k}k and growing. When you reach a good stopping point, consider updating context/roadmap.md and running \`crtr node yield\` to refresh against it — no rush yet.`;
|
|
198
|
+
}
|
|
199
|
+
if (!pushy) {
|
|
200
|
+
return `Context ~${k}k. Update context/roadmap.md so a fresh revive can continue, delegate any outstanding work, then \`crtr node yield\` to refresh.`;
|
|
201
|
+
}
|
|
202
|
+
return `Context ~${k}k — this is getting long. Stop taking on new work now: checkpoint context/roadmap.md, hand off anything outstanding, and \`crtr node yield\` immediately to refresh before this context overflows.`;
|
|
203
|
+
}
|
|
204
|
+
if (lifecycle === 'resident') {
|
|
205
|
+
// resident/base — a root conversation, mode-preserving `crtr node yield` is
|
|
206
|
+
// the natural "carry this forward" verb: it refreshes into a clean window
|
|
207
|
+
// and continues fresh against your goal and your note — no "become
|
|
208
|
+
// something" decision. Only mention --promote once the chat has genuinely
|
|
209
|
+
// grown into phases to delegate. Offer wrap-up as the alternative — a root
|
|
210
|
+
// chat can simply end.
|
|
211
|
+
const grow = `If this is turning into a multi-phase job, \`crtr node yield\` to continue fresh against your goal and your note — add --promote only once it has genuinely grown into phases you need to delegate across children.`;
|
|
212
|
+
if (at < 150_000) {
|
|
213
|
+
return `Context ~${k}k and growing. ${grow} Otherwise no rush — wrap up when you reach a good stopping point.`;
|
|
214
|
+
}
|
|
215
|
+
if (!pushy) {
|
|
216
|
+
return `Context ~${k}k. ${grow} If you're near done, just finish here; if there's more open-ended work, \`crtr node yield\` rather than letting this context grow.`;
|
|
217
|
+
}
|
|
218
|
+
return `Context ~${k}k — this is getting long. Wrap up now before this context overflows: finish what's in hand, or \`crtr node yield\` immediately to continue fresh against your goal and your note if substantial work remains.`;
|
|
219
|
+
}
|
|
220
|
+
// terminal/base — a worker. The natural "keep going past this window" verb is
|
|
221
|
+
// `crtr node yield`: it refreshes into a clean window, mode-preserving, and
|
|
222
|
+
// continues fresh against your goal and your note. --promote is a separate
|
|
223
|
+
// opt-in for when what remains needs delegating across children — mentioned
|
|
224
|
+
// only for became-multi-phase work, never steered as automatic. Steer it to
|
|
225
|
+
// yield-or-finish, never a bare promote.
|
|
226
|
+
if (at < 150_000) {
|
|
227
|
+
return `Context ~${k}k and growing. If you're near done, finish with \`crtr push final\`. If real work remains, \`crtr node yield\` to continue in a fresh window against your goal and your note — no rush yet.`;
|
|
228
|
+
}
|
|
229
|
+
if (!pushy) {
|
|
230
|
+
return `Context ~${k}k. If you're close, finish with \`crtr push final\`; otherwise \`crtr node yield\` now to refresh into a clean window and keep going against your goal and your note.`;
|
|
231
|
+
}
|
|
232
|
+
return `Context ~${k}k — this is getting long. Wrap up now before this context overflows: \`crtr push final\` if you're close, otherwise \`crtr node yield\` immediately to continue in a fresh window against your goal and your note.`;
|
|
233
|
+
}
|
|
234
|
+
// ---------------------------------------------------------------------------
|
|
235
|
+
// Extension
|
|
236
|
+
// ---------------------------------------------------------------------------
|
|
237
|
+
/**
|
|
238
|
+
* Register the canvas turn and settlement handlers on `pi`.
|
|
239
|
+
*
|
|
240
|
+
* Returns immediately when CRTR_NODE_ID is absent — the extension is fully
|
|
241
|
+
* inert in a non-canvas pi session. Safe to call multiple times (each call
|
|
242
|
+
* re-registers on the same `pi` instance, so it should only be called once
|
|
243
|
+
* per node lifecycle, matching how pi loads extensions).
|
|
244
|
+
*/
|
|
245
|
+
export function registerCanvasStophook(pi) {
|
|
246
|
+
const nodeId = process.env['CRTR_NODE_ID'];
|
|
247
|
+
if (nodeId === undefined || nodeId.trim() === '')
|
|
248
|
+
return; // not a canvas node
|
|
249
|
+
const jobDirPath = jobDir(nodeId);
|
|
250
|
+
// Cumulative throughput across all turns in this pi session, for telemetry
|
|
251
|
+
// (job/telemetry.json) only — both turn_end and agent_end accumulate so tokens
|
|
252
|
+
// emitted in the final partial turn (if pi fires agent_end without a preceding
|
|
253
|
+
// turn_end for it) are captured. NOT used for context-size steering: that is a
|
|
254
|
+
// per-turn gauge (see contextTokens), not a running sum.
|
|
255
|
+
let totalIn = 0;
|
|
256
|
+
let totalOut = 0;
|
|
257
|
+
let model = '';
|
|
258
|
+
// Last live context-window gauge + last tool summary, tracked across handlers so
|
|
259
|
+
// a tool_execution_start flush (activity-only) preserves the latest token figure.
|
|
260
|
+
let lastContext = null;
|
|
261
|
+
let lastActivity = null;
|
|
262
|
+
// If this node IS a follow-up consult fork, its ticket binding never changes,
|
|
263
|
+
// so resolve it once and reuse it to narrate live activity back into the
|
|
264
|
+
// waiting ticket. `undefined` = not yet looked up, `null` = not a consult.
|
|
265
|
+
let consultTicket;
|
|
266
|
+
function narrateToTicket(line) {
|
|
267
|
+
if (line === null || line === '')
|
|
268
|
+
return;
|
|
269
|
+
if (consultTicket === undefined) {
|
|
270
|
+
const row = getFollowUpWorkRow(String(nodeId));
|
|
271
|
+
consultTicket = row === null ? null : { root: row.root, dir: row.dir, requestId: row.request_id };
|
|
272
|
+
}
|
|
273
|
+
if (consultTicket === null)
|
|
274
|
+
return;
|
|
275
|
+
// humanloop itself gates on the request still being the running one, so a
|
|
276
|
+
// superseded or already-answered ticket silently ignores this.
|
|
277
|
+
publishFollowUpProgress(consultTicket.root, consultTicket.dir, { requestId: consultTicket.requestId, line });
|
|
278
|
+
}
|
|
279
|
+
// Context-size steering. As input context grows we nudge the node once per
|
|
280
|
+
// band on an escalating, persona-specific schedule (see steerBand/steerNote).
|
|
281
|
+
// The node's (lifecycle, mode) persona is read at fire time, since a terminal
|
|
282
|
+
// worker can promote mid-session: an orchestrator is steered to checkpoint
|
|
283
|
+
// its roadmap + yield; a resident base (root chat) to yield-or-wrap-up (or
|
|
284
|
+
// yield --promote only once it has grown into phases to delegate); a terminal
|
|
285
|
+
// worker to yield-or-push-final.
|
|
286
|
+
const firedBands = new Set();
|
|
287
|
+
// Every broker enters this bounded-release path at session_start, including a
|
|
288
|
+
// boot-revived settled node that never produces another agent_settled event.
|
|
289
|
+
// Focus, real work, pending inbox delivery, and bounded in-process fault retry
|
|
290
|
+
// justify parking; anything else gets at most UNATTENDED_PARK_MS before the
|
|
291
|
+
// existing release transition + shutdown path makes it process-free.
|
|
292
|
+
let sessionBound = false;
|
|
293
|
+
let agentRunning = false;
|
|
294
|
+
let parkedSince = null;
|
|
295
|
+
let parkTimer = null;
|
|
296
|
+
let parkContext = null;
|
|
297
|
+
const resetParkClock = () => { parkedSince = null; };
|
|
298
|
+
const hasActiveAutoFaultRetry = (now) => {
|
|
299
|
+
const fault = readFault(nodeId);
|
|
300
|
+
if (fault === null || fault.retry.disposition !== 'auto' || fault.retry.by !== 'daemon')
|
|
301
|
+
return false;
|
|
302
|
+
if (fault.kind !== 'connection' && fault.kind !== 'rate-limit' && fault.kind !== 'overloaded')
|
|
303
|
+
return false;
|
|
304
|
+
return fault.retry.nextAt !== undefined || nextFaultRetry(fault, now) !== null;
|
|
305
|
+
};
|
|
306
|
+
const pollParkClock = () => {
|
|
307
|
+
try {
|
|
308
|
+
if (!sessionBound || agentRunning || parkContext === null) {
|
|
309
|
+
resetParkClock();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const row = getNode(nodeId);
|
|
313
|
+
if (row === null || row.intent !== null || row.status === 'done' || row.status === 'canceled' || row.status === 'dead') {
|
|
314
|
+
resetParkClock();
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
if (isBusy(nodeId)) {
|
|
318
|
+
resetParkClock();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (focusOf(nodeId) !== null) {
|
|
322
|
+
resetParkClock();
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (readInboxSince(nodeId, readCursor(nodeId)).some((entry) => entry.tier !== 'deferred')) {
|
|
326
|
+
resetParkClock();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const now = Date.now();
|
|
330
|
+
if (hasActiveAutoFaultRetry(now)) {
|
|
331
|
+
resetParkClock();
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
parkedSince ??= now;
|
|
335
|
+
if (now - parkedSince < UNATTENDED_PARK_MS)
|
|
336
|
+
return;
|
|
337
|
+
transition(nodeId, 'release');
|
|
338
|
+
resetParkClock();
|
|
339
|
+
try {
|
|
340
|
+
parkContext?.shutdown?.();
|
|
341
|
+
}
|
|
342
|
+
catch { /* best-effort */ }
|
|
343
|
+
}
|
|
344
|
+
catch {
|
|
345
|
+
// A policy read failure must stay visible on the next poll rather than
|
|
346
|
+
// releasing from incomplete evidence.
|
|
347
|
+
resetParkClock();
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
const armParkClock = (ctx) => {
|
|
351
|
+
sessionBound = true;
|
|
352
|
+
parkContext = ctx;
|
|
353
|
+
resetParkClock();
|
|
354
|
+
if (parkTimer !== null)
|
|
355
|
+
return;
|
|
356
|
+
parkTimer = setInterval(pollParkClock, PARK_POLL_MS);
|
|
357
|
+
if (typeof parkTimer.unref === 'function')
|
|
358
|
+
parkTimer.unref();
|
|
359
|
+
};
|
|
360
|
+
// Wedge-heartbeat throttle: message_update/tool_execution_update can fire many
|
|
361
|
+
// times per second while streaming, and touchBusy is a disk write — rate-limit
|
|
362
|
+
// it to at most once per HEARTBEAT_THROTTLE_MS. The daemon's wedge grace is
|
|
363
|
+
// measured in minutes, so this throttle costs it nothing. Also clears any
|
|
364
|
+
// stale `daemon→node` wedge fault at the same throttled cadence: a sign of
|
|
365
|
+
// life should both refresh the heartbeat marker AND clear a stale wedge
|
|
366
|
+
// notice as one coherent act, same as every coarser progress site below
|
|
367
|
+
// (tool execution, turn_end, agent_settled) already does. clearFault is
|
|
368
|
+
// a cheap no-op when no fault exists, so this stays safe to call every time.
|
|
369
|
+
const HEARTBEAT_THROTTLE_MS = 3_000;
|
|
370
|
+
let lastHeartbeatAt = 0;
|
|
371
|
+
const heartbeat = () => {
|
|
372
|
+
const now = Date.now();
|
|
373
|
+
if (now - lastHeartbeatAt < HEARTBEAT_THROTTLE_MS)
|
|
374
|
+
return;
|
|
375
|
+
lastHeartbeatAt = now;
|
|
376
|
+
touchBusy(nodeId);
|
|
377
|
+
clearFault(nodeId, { link: 'daemon→node' });
|
|
378
|
+
};
|
|
379
|
+
// ---------------------------------------------------------------------------
|
|
380
|
+
// session_start — capture pi's session id, and detect `/new`.
|
|
381
|
+
//
|
|
382
|
+
// pi tags each session_start with a `reason`: 'startup' on boot (a fresh
|
|
383
|
+
// launch or a daemon revive — both new processes), 'new' when the user runs
|
|
384
|
+
// `/new` (a brand-new conversation in the SAME process), and 'resume' /
|
|
385
|
+
// 'reload' / 'fork' for the in-place conversation swaps that keep the same
|
|
386
|
+
// node. We branch on that reason — NOT on a remembered session id.
|
|
387
|
+
//
|
|
388
|
+
// Why reason, not a closure flag: pi RE-ACTIVATES extensions on every session
|
|
389
|
+
// swap, so any id we stash on boot is reset to its initial value before the
|
|
390
|
+
// next session_start fires and can never observe the change — a `/new` then
|
|
391
|
+
// looks identical to a boot. The event reason is delivered fresh on every fire
|
|
392
|
+
// and is immune to the re-activation.
|
|
393
|
+
//
|
|
394
|
+
// `/new` splits by who ran it: a ROOT relaunches into a genuinely new node
|
|
395
|
+
// (relaunchRoot — park the old root `done`, boot a fresh node, re-point this
|
|
396
|
+
// pane), a non-root CHILD just refreshes its session id (handleNewSession).
|
|
397
|
+
// ---------------------------------------------------------------------------
|
|
398
|
+
pi.on('session_start', (event, ctx) => {
|
|
399
|
+
try {
|
|
400
|
+
// This clock bounds every boot, including one whose durable bookkeeping
|
|
401
|
+
// below fails transiently; never leave it behind a swallowed handler error.
|
|
402
|
+
armParkClock(ctx);
|
|
403
|
+
const id = ctx?.sessionManager?.getSessionId?.();
|
|
404
|
+
if (typeof id !== 'string' || id === '')
|
|
405
|
+
return;
|
|
406
|
+
// The absolute path to this session's .jsonl, captured alongside the id.
|
|
407
|
+
// Resuming by path is immune to a cwd discrepancy (pi opens it directly),
|
|
408
|
+
// whereas a bare id is resolved cwd-relative and forks across projects.
|
|
409
|
+
const filed = ctx?.sessionManager?.getSessionFile?.();
|
|
410
|
+
const sessionFile = typeof filed === 'string' && filed !== '' ? filed : null;
|
|
411
|
+
// `/new` — a brand-new conversation in the same process. The broker already
|
|
412
|
+
// drove the engine-side new_session (the viewer's /new → broker
|
|
413
|
+
// new_session frame); the runtime side then splits on root-ness: a ROOT
|
|
414
|
+
// relaunches into a freshly-minted node (park the old root `done`, boot a
|
|
415
|
+
// new broker, re-point the viewer pane), a non-root CHILD just refreshes
|
|
416
|
+
// its session id on the SAME node.
|
|
417
|
+
if (event?.reason === 'new') {
|
|
418
|
+
try {
|
|
419
|
+
const m = getNode(nodeId);
|
|
420
|
+
// A root relaunch LAUNCHES a broker, and launches are daemon-owned
|
|
421
|
+
// (fleet-bound) — so the broker never runs relaunchRoot in-process.
|
|
422
|
+
// It asks crtrd via POST /v1/nodes/:id/relaunch-root instead; the
|
|
423
|
+
// rejection is swallowed here (the enclosing sync catch can't catch
|
|
424
|
+
// an async one) to keep `/new` best-effort.
|
|
425
|
+
if (m?.parent == null)
|
|
426
|
+
void cliClient().relaunchRoot(nodeId).catch(() => { });
|
|
427
|
+
else
|
|
428
|
+
handleNewSession(nodeId, id, sessionFile);
|
|
429
|
+
}
|
|
430
|
+
catch { /* best-effort */ }
|
|
431
|
+
// Clear in-memory context-steering so the fresh conversation starts clean.
|
|
432
|
+
totalIn = 0;
|
|
433
|
+
totalOut = 0;
|
|
434
|
+
firedBands.clear();
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
// Boot / startup / resume / reload / fork → (re)bind this process to its
|
|
438
|
+
// session id, record our OS pid (the daemon's broker-liveness signal), and
|
|
439
|
+
// CONFIRM any pending refresh-yield / pending cycle. Reaching session_start
|
|
440
|
+
// proves a fresh engine actually booted, so it is now safe to clear
|
|
441
|
+
// intent='refresh' — a refresh shuts the broker down and the daemon
|
|
442
|
+
// relaunches it FRESH, which leaves intent='refresh' set until this boot
|
|
443
|
+
// clears it (the only proof the relaunch worked; otherwise a failed relaunch
|
|
444
|
+
// would look like a success). Clearing `cycle_pending` here is the same
|
|
445
|
+
// proof for reviveNode's cycling-attempt marker and the one-shot yield
|
|
446
|
+
// note — both remain pending through any pre-session_start failure and are
|
|
447
|
+
// safe to clear on any confirmed boot (cycling, resuming, or fresh).
|
|
448
|
+
const existing = getNode(nodeId);
|
|
449
|
+
// A pending private fork is not bound until Pi exposes BOTH the fresh child
|
|
450
|
+
// id and its writable session file. Persist those identities and the phase
|
|
451
|
+
// flip in one meta write: recovery sees either fork_pending with no child,
|
|
452
|
+
// or session_started with the complete child coordinate, never a mixed
|
|
453
|
+
// state that could fork provenance twice.
|
|
454
|
+
if (existing?.private_fork_phase === 'fork_pending' && sessionFile === null) {
|
|
455
|
+
try {
|
|
456
|
+
ctx?.shutdown?.();
|
|
457
|
+
}
|
|
458
|
+
catch { /* best-effort */ }
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
// Identity (session id/file/phase) → meta; runtime (pid, intent) → atomic
|
|
462
|
+
// row setters. Any confirmed boot owns the one-shot yield note, if any;
|
|
463
|
+
// clear it once here so a pre-session_start retry preserves it, but a
|
|
464
|
+
// successful revival can still only consume it once.
|
|
465
|
+
clearYieldMessage(nodeId);
|
|
466
|
+
updateNode(nodeId, existing?.private_fork_phase === 'fork_pending'
|
|
467
|
+
? {
|
|
468
|
+
pi_session_id: id,
|
|
469
|
+
pi_session_file: sessionFile,
|
|
470
|
+
private_fork_phase: 'session_started',
|
|
471
|
+
cycle_pending: false,
|
|
472
|
+
}
|
|
473
|
+
: {
|
|
474
|
+
pi_session_id: id,
|
|
475
|
+
pi_session_file: sessionFile,
|
|
476
|
+
cycle_pending: false,
|
|
477
|
+
});
|
|
478
|
+
recordPid(nodeId, process.pid);
|
|
479
|
+
if (existing?.intent === 'refresh')
|
|
480
|
+
transition(nodeId, 'revive');
|
|
481
|
+
}
|
|
482
|
+
catch {
|
|
483
|
+
/* best-effort; never surface from an extension handler */
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
// ---------------------------------------------------------------------------
|
|
487
|
+
// agent_start — pi entered a turn. Mark the node mid-turn (busy) so a
|
|
488
|
+
// focus-away while it is genuinely working backstages it (Invariant F2)
|
|
489
|
+
// rather than reaping it. Cleared only after the whole run settles.
|
|
490
|
+
// ---------------------------------------------------------------------------
|
|
491
|
+
pi.on('agent_start', () => {
|
|
492
|
+
// A fresh turn started. Keep any active fault marker in place so the daemon's
|
|
493
|
+
// retry accounting survives a failed retry cycle; just mark the turn busy.
|
|
494
|
+
agentRunning = true;
|
|
495
|
+
resetParkClock();
|
|
496
|
+
try {
|
|
497
|
+
markBusy(nodeId);
|
|
498
|
+
}
|
|
499
|
+
catch { /* best-effort */ }
|
|
500
|
+
});
|
|
501
|
+
// ---------------------------------------------------------------------------
|
|
502
|
+
// input — a new user-directed run is beginning. This is the ONLY place stop
|
|
503
|
+
// signals are cleared: `agent_start` re-fires for pi's automatic retries and
|
|
504
|
+
// post-compaction continuations within the SAME run, so clearing there would
|
|
505
|
+
// erase the `crtr human ask` / `crtr push final` marker written earlier in the
|
|
506
|
+
// run and make the eventual settlement fall back to a canvas read (exactly the
|
|
507
|
+
// read the marker exists to avoid). One run's markers survive until the one
|
|
508
|
+
// `agent_settled` consumes them; a leftover from an errored or interrupted run
|
|
509
|
+
// of this same broker is discarded here, when the next prompt arrives (the pid
|
|
510
|
+
// stamp only rules out a PRIOR broker's markers, not this broker's own).
|
|
511
|
+
// ---------------------------------------------------------------------------
|
|
512
|
+
pi.on('input', () => {
|
|
513
|
+
try {
|
|
514
|
+
clearStopSignals(nodeId);
|
|
515
|
+
}
|
|
516
|
+
catch { /* best-effort */ }
|
|
517
|
+
});
|
|
518
|
+
// ---------------------------------------------------------------------------
|
|
519
|
+
// tool_execution_start — capture the live "what is it doing" cue. Writes the
|
|
520
|
+
// one-line tool summary to telemetry.json so out-of-process readers (the nav
|
|
521
|
+
// chrome) show it inline without a second file or any extra read on their side.
|
|
522
|
+
// ---------------------------------------------------------------------------
|
|
523
|
+
pi.on('tool_execution_start', (event) => {
|
|
524
|
+
try {
|
|
525
|
+
lastActivity = summarizeActivity(String(event?.toolName ?? ''), event?.args);
|
|
526
|
+
flushTelemetry(jobDirPath, totalIn, totalOut, model, lastContext, lastActivity);
|
|
527
|
+
narrateToTicket(lastActivity); // a consult fork streams its activity to the waiting ticket
|
|
528
|
+
touchBusy(nodeId); // wedge heartbeat: a fresh tool starting is a sign of life
|
|
529
|
+
clearFault(nodeId, { link: 'daemon→node' }); // a tool actually starting clears any prior wedge notice
|
|
530
|
+
}
|
|
531
|
+
catch { /* best-effort */ }
|
|
532
|
+
});
|
|
533
|
+
// ---------------------------------------------------------------------------
|
|
534
|
+
// tool_execution_update — wedge heartbeat + fault clear only. Fired with
|
|
535
|
+
// partial/streaming tool output (when a tool reports progress); throttled via
|
|
536
|
+
// `heartbeat()` since it can arrive many times per second. Most tools (e.g.
|
|
537
|
+
// bash) don't stream progress today, so this is currently a light-touch no-op
|
|
538
|
+
// for them — it exists so any tool that DOES stream partial output (now or in
|
|
539
|
+
// the future) counts as live progress instead of tripping the wedge detector,
|
|
540
|
+
// AND clears any wedge notice that already fired before this progress resumed.
|
|
541
|
+
// ---------------------------------------------------------------------------
|
|
542
|
+
pi.on('tool_execution_update', () => {
|
|
543
|
+
try {
|
|
544
|
+
heartbeat();
|
|
545
|
+
}
|
|
546
|
+
catch { /* best-effort */ }
|
|
547
|
+
});
|
|
548
|
+
// ---------------------------------------------------------------------------
|
|
549
|
+
// message_update — wedge heartbeat + fault clear only. Fired token-by-token
|
|
550
|
+
// while the assistant is actively streaming a reply — genuine progress,
|
|
551
|
+
// throttled the same way, and equally clears a stale wedge notice if streaming
|
|
552
|
+
// resumes before a coarser boundary. A node stuck streaming forever without
|
|
553
|
+
// ever firing this is exactly the daemon's busy+quiet wedge signature.
|
|
554
|
+
// ---------------------------------------------------------------------------
|
|
555
|
+
pi.on('message_update', () => {
|
|
556
|
+
try {
|
|
557
|
+
heartbeat();
|
|
558
|
+
}
|
|
559
|
+
catch { /* best-effort */ }
|
|
560
|
+
});
|
|
561
|
+
// ---------------------------------------------------------------------------
|
|
562
|
+
// tool_execution_end — IMMEDIATE refresh-yield. When a tool this turn set
|
|
563
|
+
// intent='refresh' (the node ran `crtr node yield`), shut the broker down NOW
|
|
564
|
+
// instead of letting the model keep burning its bloated context to the turn's
|
|
565
|
+
// natural end (the settlement backstop would only catch it there). The yield
|
|
566
|
+
// command persists the yield-message + any existing roadmap checkpoint BEFORE
|
|
567
|
+
// it returns, so by the time this fires nothing is lost. Abort the live turn,
|
|
568
|
+
// then request shutdown; the broker exits after pi's settle boundary. The
|
|
569
|
+
// daemon then sees the dead pid + intent='refresh' and revives the node FRESH
|
|
570
|
+
// against its roadmap if it has one, else its original goal.
|
|
571
|
+
// intent only flips to 'refresh' via `node yield`, so this can't false-fire.
|
|
572
|
+
// (A node that somehow boots already carrying intent='refresh' correctly
|
|
573
|
+
// refreshes on its first tool — the desired outcome.)
|
|
574
|
+
pi.on('tool_execution_end', (_event, ctx) => {
|
|
575
|
+
try {
|
|
576
|
+
touchBusy(nodeId); // wedge heartbeat: the tool returning is a sign of life
|
|
577
|
+
clearFault(nodeId, { link: 'daemon→node' }); // a tool that was "stuck" just returned — the wedge notice was resolved
|
|
578
|
+
if (getNode(nodeId)?.intent === 'refresh') {
|
|
579
|
+
try {
|
|
580
|
+
ctx?.abort?.();
|
|
581
|
+
}
|
|
582
|
+
catch { /* ignore */ }
|
|
583
|
+
try {
|
|
584
|
+
ctx?.shutdown?.();
|
|
585
|
+
}
|
|
586
|
+
catch { /* ignore */ }
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
catch { /* best-effort */ }
|
|
590
|
+
});
|
|
591
|
+
// ---------------------------------------------------------------------------
|
|
592
|
+
// session_shutdown — clean exit → done.
|
|
593
|
+
//
|
|
594
|
+
// pi hands us a reason as a session tears down. Only 'quit' is a node-ending
|
|
595
|
+
// event we record (markCleanExitDone guards against clobbering a node
|
|
596
|
+
// settlement already routed to done/refresh/idle-release). 'new' is owned by
|
|
597
|
+
// the session_start trigger above; reload/resume/fork keep the SAME node id on
|
|
598
|
+
// a swapped conversation. A true crash fires NO session_shutdown and falls
|
|
599
|
+
// through to the daemon's window-gone 'dead'.
|
|
600
|
+
//
|
|
601
|
+
// MUST stay synchronous (no await): the synchronous DatabaseSync write then
|
|
602
|
+
// lands within pi's awaited shutdown emit, before pi exits.
|
|
603
|
+
// ---------------------------------------------------------------------------
|
|
604
|
+
pi.on('session_shutdown', (event, _ctx) => {
|
|
605
|
+
sessionBound = false;
|
|
606
|
+
agentRunning = false;
|
|
607
|
+
parkContext = null;
|
|
608
|
+
resetParkClock();
|
|
609
|
+
if (parkTimer !== null) {
|
|
610
|
+
clearInterval(parkTimer);
|
|
611
|
+
parkTimer = null;
|
|
612
|
+
}
|
|
613
|
+
try {
|
|
614
|
+
clearBusy(nodeId); // turn marker is meaningless once pi is exiting
|
|
615
|
+
clearFault(nodeId); // ditto the active fault marker
|
|
616
|
+
// Clean /quit (reason='quit') resolves the node to done; if it held the
|
|
617
|
+
// user's viewport, Q1-close it (tearDownNode kills the frozen focus pane +
|
|
618
|
+
// closes the focus row → returns the user to a shell, §1.5/flow (e)). pi is
|
|
619
|
+
// already exiting here, so killing its own pane is not a self-saw.
|
|
620
|
+
if (markCleanExitDone(nodeId, event?.reason))
|
|
621
|
+
tearDownNode(nodeId);
|
|
622
|
+
}
|
|
623
|
+
catch { /* best-effort; never throw out of an extension handler */ }
|
|
624
|
+
});
|
|
625
|
+
/** Absorb usage + model from any assistant message (turn or final batch). */
|
|
626
|
+
const accumulate = (msg) => {
|
|
627
|
+
if (msg?.role !== 'assistant' || msg.usage == null)
|
|
628
|
+
return;
|
|
629
|
+
totalIn += Number(msg.usage.input ?? 0) || 0;
|
|
630
|
+
totalOut += Number(msg.usage.output ?? 0) || 0;
|
|
631
|
+
if (typeof msg.model === 'string' && msg.model !== '')
|
|
632
|
+
model = msg.model;
|
|
633
|
+
};
|
|
634
|
+
// ---------------------------------------------------------------------------
|
|
635
|
+
// turn_end — live telemetry refresh.
|
|
636
|
+
// event shape: { message: AssistantMessage, ... }
|
|
637
|
+
// ---------------------------------------------------------------------------
|
|
638
|
+
pi.on('turn_end', (event, ctx) => {
|
|
639
|
+
accumulate(event?.message);
|
|
640
|
+
// The CURRENT context size via ctx.getContextUsage() — the exact figure pi's
|
|
641
|
+
// footer shows. Captured once here for two consumers: the telemetry flush
|
|
642
|
+
// (so out-of-process readers like `crtr node new` can size this node) and
|
|
643
|
+
// the context-size steering below.
|
|
644
|
+
// .tokens is null/undefined only when pi can't know the size yet (no model,
|
|
645
|
+
// or right after a compaction before the next reply) — telemetry then keeps
|
|
646
|
+
// its last value and steering is skipped for the turn.
|
|
647
|
+
let contextTokens = null;
|
|
648
|
+
try {
|
|
649
|
+
const t = ctx.getContextUsage()?.tokens;
|
|
650
|
+
if (typeof t === 'number')
|
|
651
|
+
contextTokens = t;
|
|
652
|
+
}
|
|
653
|
+
catch { /* gauge unavailable this turn */ }
|
|
654
|
+
if (contextTokens !== null)
|
|
655
|
+
lastContext = contextTokens;
|
|
656
|
+
// Fire-and-forget: flushTelemetry uses synchronous fs writes and never throws.
|
|
657
|
+
flushTelemetry(jobDirPath, totalIn, totalOut, model, contextTokens, lastActivity);
|
|
658
|
+
touchBusy(nodeId); // wedge heartbeat: a turn ending is a sign of life
|
|
659
|
+
clearFault(nodeId, { link: 'daemon→node' }); // reaching turn_end proves this turn wasn't wedged
|
|
660
|
+
clearFault(nodeId, { link: 'pi→provider' }); // a completed provider round-trip proves this episode is over
|
|
661
|
+
// Will the agent run CONTINUE past this turn? Deterministic at turn_end:
|
|
662
|
+
// the loop keeps going exactly when this assistant message carried tool
|
|
663
|
+
// calls and the run wasn't aborted/errored (those end unconditionally,
|
|
664
|
+
// before tools execute). A tool-calling turn ends with stopReason
|
|
665
|
+
// 'toolUse' — or 'length' when truncation failed the calls, which still
|
|
666
|
+
// continues the loop — NEVER 'stop', so gate on the abort/error reasons,
|
|
667
|
+
// not on an allowlist that excludes 'toolUse'.
|
|
668
|
+
// This handler runs BEFORE the loop drains the steering queue, so the read
|
|
669
|
+
// is race-free: zero tool calls ⇒ this is the run's FINAL message, and a
|
|
670
|
+
// steer sent now would not redirect at a boundary — it would EXTEND the run
|
|
671
|
+
// past the agent's closing reply, burying the summary the human comes back
|
|
672
|
+
// to read once the conversation goes quiet.
|
|
673
|
+
const turnContent = Array.isArray(event?.message?.content) ? event.message.content : [];
|
|
674
|
+
const turnStopReason = event?.message?.stopReason ?? '';
|
|
675
|
+
const runContinues = turnStopReason !== 'error' &&
|
|
676
|
+
turnStopReason !== 'aborted' &&
|
|
677
|
+
turnContent.some((c) => c?.type === 'toolCall');
|
|
678
|
+
// Context-size steering: fire the current band once, with lifecycle-specific
|
|
679
|
+
// guidance (lifecycle is read live — a terminal worker may have promoted to
|
|
680
|
+
// resident since launch).
|
|
681
|
+
// Delivery splits on runContinues:
|
|
682
|
+
// • mid-run → STEER, not a followUp: guidance to become an orchestrator /
|
|
683
|
+
// delegate / yield must redirect the node at the turn boundary, not queue
|
|
684
|
+
// behind whatever it does next (where it rides along, easy to ignore).
|
|
685
|
+
// • final message → HOLD via pi's 'nextTurn' queue: it injects alongside
|
|
686
|
+
// the next user message without triggering a turn, so the nudge is read
|
|
687
|
+
// at the start of the next engagement instead of spawning a phantom
|
|
688
|
+
// continuation after the agent already said its piece.
|
|
689
|
+
// Never the cumulative totalIn: under prompt caching that never grows (input
|
|
690
|
+
// is a ~2-token uncached delta each turn), so the bands were unreachable and
|
|
691
|
+
// the nudge never fired.
|
|
692
|
+
try {
|
|
693
|
+
const node = getNode(nodeId);
|
|
694
|
+
const lifecycle = node?.lifecycle ?? 'terminal';
|
|
695
|
+
const mode = node?.mode ?? 'base';
|
|
696
|
+
const at = contextTokens !== null ? steerBand(contextTokens) : null;
|
|
697
|
+
if (at !== null && !firedBands.has(at)) {
|
|
698
|
+
firedBands.add(at);
|
|
699
|
+
const note = `[crtr] ${steerNote(at, lifecycle, mode)}`;
|
|
700
|
+
if (runContinues) {
|
|
701
|
+
pi.sendUserMessage(note, { deliverAs: 'steer' });
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
pi.sendMessage({ customType: 'crtr-context-nudge', content: note, display: true }, { deliverAs: 'nextTurn' });
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
catch {
|
|
709
|
+
/* steering is best-effort */
|
|
710
|
+
}
|
|
711
|
+
// Persona-transition steering. When this node's mode or lifecycle changed
|
|
712
|
+
// since it was last GIVEN guidance (it ran `crtr node promote` / `node
|
|
713
|
+
// lifecycle` this turn, or a sibling/human flipped it while the node was
|
|
714
|
+
// active), inject the guidance for its NEW persona once, then commit the
|
|
715
|
+
// ack so the next turn sees no drift. This is the single delivery site for
|
|
716
|
+
// in-session transitions — state-changing commands never hand-emit guidance.
|
|
717
|
+
// Delivered as a STEER (like the context nudge): a persona change must
|
|
718
|
+
// redirect the node at the turn boundary, not queue behind its next action.
|
|
719
|
+
try {
|
|
720
|
+
const drift = personaDrift(nodeId);
|
|
721
|
+
if (drift !== null) {
|
|
722
|
+
pi.sendUserMessage(drift.guidance, { deliverAs: 'steer' });
|
|
723
|
+
commitPersonaAck(nodeId, drift.to);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
catch {
|
|
727
|
+
/* persona steering is best-effort */
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
// Pi may emit several agent_end attempts while it compacts, retries, and
|
|
731
|
+
// drains queued continuations. Keep only the latest attempt here; no lifecycle
|
|
732
|
+
// effect is committed until Pi declares the whole run settled.
|
|
733
|
+
let stagedAgentEnd = null;
|
|
734
|
+
pi.on('agent_end', (event) => {
|
|
735
|
+
stagedAgentEnd = event;
|
|
736
|
+
try {
|
|
737
|
+
const messages = Array.isArray(event?.messages) ? event.messages : [];
|
|
738
|
+
for (const message of messages)
|
|
739
|
+
accumulate(message);
|
|
740
|
+
}
|
|
741
|
+
catch { /* best-effort */ }
|
|
742
|
+
});
|
|
743
|
+
// ---------------------------------------------------------------------------
|
|
744
|
+
// agent_settled — whole-run lifecycle commit after recovery and continuations.
|
|
745
|
+
// ---------------------------------------------------------------------------
|
|
746
|
+
pi.on('agent_settled', (_event, ctx) => {
|
|
747
|
+
agentRunning = false;
|
|
748
|
+
resetParkClock();
|
|
749
|
+
const event = stagedAgentEnd;
|
|
750
|
+
stagedAgentEnd = null;
|
|
751
|
+
// Busy and wedge state describe the whole run, so settlement clears them
|
|
752
|
+
// even when an abnormal engine path produced no stageable agent_end payload.
|
|
753
|
+
clearBusy(nodeId);
|
|
754
|
+
clearFault(nodeId, { link: 'daemon→node' });
|
|
755
|
+
if (event === null)
|
|
756
|
+
return;
|
|
757
|
+
// All routing here is synchronous fs. Provider-fault publication belongs to
|
|
758
|
+
// the broker's richer AgentSession event stream and commits at the same
|
|
759
|
+
// settlement boundary before its retry/notification scheduling proceeds.
|
|
760
|
+
try {
|
|
761
|
+
const messages = Array.isArray(event?.messages) ? event.messages : [];
|
|
762
|
+
const last = lastAssistantMessage(messages);
|
|
763
|
+
const stopReason = last?.stopReason ?? '';
|
|
764
|
+
// Interrupted or errored runs stay alive for re-steering. The broker
|
|
765
|
+
// publishes any settled provider fault from its subscriber event stream.
|
|
766
|
+
//
|
|
767
|
+
// EXCEPT a follow-up consultation fork (design-followup-consult-v2.md
|
|
768
|
+
// §B.2/§B.4; integrated-review Major-2): it is born `parent:null` with
|
|
769
|
+
// no subscriber and nothing left to re-steer it — there is no human or
|
|
770
|
+
// sibling that will ever send it another message. An exact-model turn
|
|
771
|
+
// failure (the broker's `modelExact` fail-closed gates deliberately
|
|
772
|
+
// refuse to substitute a different model/provider, so the turn just
|
|
773
|
+
// errors) would otherwise leave it parked here forever: `armed`/`pending`
|
|
774
|
+
// in the outbox with no future event guaranteed to reach it (the daemon
|
|
775
|
+
// only reconciles at its own startup, and `_consult`/`_deliver` only
|
|
776
|
+
// fire on a LATER human action on this SAME ticket). Identify it by the
|
|
777
|
+
// presence of its own outbox row (the delivery record) and settle it
|
|
778
|
+
// right here instead: crash the
|
|
779
|
+
// node (frees it from the daemon's supervised LIVE set) and reconcile
|
|
780
|
+
// its outbox immediately — `reconcileFollowUpWork`'s armed+dead branch
|
|
781
|
+
// turns this into the ticket's `error` result, event-driven, no polling.
|
|
782
|
+
if (stopReason !== 'stop' && stopReason !== 'length') {
|
|
783
|
+
let isConsultFork = false;
|
|
784
|
+
let isVisualFork = false;
|
|
785
|
+
try {
|
|
786
|
+
const work = getHumanWorkRow(nodeId);
|
|
787
|
+
isConsultFork = work?.work_kind === 'follow_up';
|
|
788
|
+
isVisualFork = work?.work_kind === 'visual';
|
|
789
|
+
}
|
|
790
|
+
catch {
|
|
791
|
+
/* best-effort read — treat as ordinary work on storage failure */
|
|
792
|
+
}
|
|
793
|
+
if (isConsultFork || isVisualFork) {
|
|
794
|
+
// Minor-6 (integrated review): shutdown must fire even when
|
|
795
|
+
// transition/reconcile throws — sharing one try with the shutdown
|
|
796
|
+
// call let a reconciliation exception skip it entirely, stranding
|
|
797
|
+
// an already-crashed consult broker (settlement then waits on
|
|
798
|
+
// NOTHING, since this fork has no subscriber to ever retry it).
|
|
799
|
+
// `finally` guarantees the shutdown regardless of the outcome
|
|
800
|
+
// above; the outbox row itself is unaffected either way —
|
|
801
|
+
// `reconcileFollowUpWork` is retried at the next
|
|
802
|
+
// daemon-crash/startup/_consult/_deliver touchpoint.
|
|
803
|
+
try {
|
|
804
|
+
const cur = getNode(nodeId);
|
|
805
|
+
if (cur !== null && (cur.status === 'active' || cur.status === 'idle'))
|
|
806
|
+
transition(nodeId, 'crash');
|
|
807
|
+
reconcileFollowUpWork();
|
|
808
|
+
reconcileVisualWork();
|
|
809
|
+
}
|
|
810
|
+
catch {
|
|
811
|
+
/* best-effort — reconcileFollowUpWork is retried at the next daemon-crash/startup/_consult/_deliver touchpoint */
|
|
812
|
+
}
|
|
813
|
+
finally {
|
|
814
|
+
try {
|
|
815
|
+
ctx?.shutdown?.();
|
|
816
|
+
}
|
|
817
|
+
catch { /* ignore */ }
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
// TRULY-DONE (pushed `final` this turn). The engine is a detached
|
|
823
|
+
// broker, not a pane, so there is no engine to hand off — just close
|
|
824
|
+
// this node's VIEWER pane (if any) and shut the broker down. The daemon
|
|
825
|
+
// won't revive a done node. tearDownNode closes the viewer focus row +
|
|
826
|
+
// pane; ctx.shutdown() exits the broker process.
|
|
827
|
+
//
|
|
828
|
+
// EVERY step here is best-effort and the shutdown lives in `finally`: the
|
|
829
|
+
// `pushedFinal` marker path exists precisely so a broker need not read
|
|
830
|
+
// canvas state to know it finished, so a failing local canvas read/write
|
|
831
|
+
// (focusOf/setPresence) must not be what keeps a finalized broker alive.
|
|
832
|
+
// The enclosing agent_settled catch would swallow the throw and leave the
|
|
833
|
+
// process running forever.
|
|
834
|
+
const shutDownFinished = () => {
|
|
835
|
+
try {
|
|
836
|
+
try {
|
|
837
|
+
clearFault(nodeId);
|
|
838
|
+
}
|
|
839
|
+
catch { /* best-effort */ }
|
|
840
|
+
try {
|
|
841
|
+
if (focusOf(nodeId) !== null)
|
|
842
|
+
tearDownNode(nodeId);
|
|
843
|
+
}
|
|
844
|
+
catch { /* best-effort */ }
|
|
845
|
+
try {
|
|
846
|
+
setPresence(nodeId, { pane: null, tmux_session: null, window: null });
|
|
847
|
+
}
|
|
848
|
+
catch { /* best-effort */ }
|
|
849
|
+
// Consult-outbox dispatch (design-followup-consult-v2.md §B.4): if this
|
|
850
|
+
// node is a follow-up consultation fork, its outbox row was promoted
|
|
851
|
+
// armed→pending inside the SAME transaction that just committed this
|
|
852
|
+
// final (feed.ts commitCanonicalFinal). Deliver it now, in-process, on
|
|
853
|
+
// this fork's own settlement — the happy-path dispatch, event-driven,
|
|
854
|
+
// no polling. A no-op for every non-consult node (no outbox row).
|
|
855
|
+
try {
|
|
856
|
+
dispatchFollowUpWork(nodeId);
|
|
857
|
+
dispatchVisualWork(nodeId);
|
|
858
|
+
}
|
|
859
|
+
catch { /* best-effort — durable reconcilers retry */ }
|
|
860
|
+
}
|
|
861
|
+
finally {
|
|
862
|
+
try {
|
|
863
|
+
ctx?.shutdown?.();
|
|
864
|
+
}
|
|
865
|
+
catch { /* ignore */ }
|
|
866
|
+
}
|
|
867
|
+
};
|
|
868
|
+
// A successful command records its own outcome before it returns to pi.
|
|
869
|
+
// Consume that outcome before any canvas read: a broker must not re-read
|
|
870
|
+
// state which crtrd just committed in order to decide whether this turn
|
|
871
|
+
// can finish or wait for the human.
|
|
872
|
+
const stopSignals = consumeStopSignals(nodeId);
|
|
873
|
+
if (stopSignals.pushedFinal) {
|
|
874
|
+
shutDownFinished();
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
if (stopSignals.askedHuman) {
|
|
878
|
+
try {
|
|
879
|
+
clearFault(nodeId);
|
|
880
|
+
}
|
|
881
|
+
catch { /* best-effort */ }
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
// (b) Already done: `crtr push --final` was called this turn, which
|
|
885
|
+
// transitions node.status → 'done' synchronously. Shut down cleanly.
|
|
886
|
+
const node = getNode(nodeId);
|
|
887
|
+
if (node?.status === 'done') {
|
|
888
|
+
shutDownFinished();
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
// (b') Refresh-yield BACKSTOP: the node ran `crtr node yield` this turn,
|
|
892
|
+
// setting intent='refresh'. The primary exit is the tool_execution_end
|
|
893
|
+
// handler above, which shuts down the instant the yield tool returns
|
|
894
|
+
// (so the model never burns more context finishing the turn); this
|
|
895
|
+
// branch only fires if that shutdown was missed. Either way: shut the
|
|
896
|
+
// broker down — the daemon sees the dead pid + intent='refresh' and
|
|
897
|
+
// reviveNode relaunches the broker FRESH (no resume) so the node
|
|
898
|
+
// re-reads its roadmap. (The daemon also force-recycles a stuck
|
|
899
|
+
// refresh whose engine never exits, so a stale in-process stophook
|
|
900
|
+
// can't strand the yield — see crtrd.)
|
|
901
|
+
if (node?.intent === 'refresh') {
|
|
902
|
+
// A yield is SILENT to subscribers: the node keeps its identity and
|
|
903
|
+
// subscription edges across the revive and reports only through its own
|
|
904
|
+
// explicit `crtr push` calls, so there is no checkpoint push here.
|
|
905
|
+
try {
|
|
906
|
+
ctx?.shutdown?.();
|
|
907
|
+
}
|
|
908
|
+
catch { /* ignore */ }
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
// (c) Natural stop — run the stop-guard to classify this stop. Nothing
|
|
912
|
+
// is auto-pushed: the node reaches its subscribers only through its
|
|
913
|
+
// own explicit `crtr push` calls this turn. The guard decides
|
|
914
|
+
// whether the stop is a legitimate dormancy (idle-release, or an
|
|
915
|
+
// attended root staying live) or a stall to reprompt.
|
|
916
|
+
const decision = evaluateStop(nodeId, stopSignals);
|
|
917
|
+
if (decision.action === 'reprompt') {
|
|
918
|
+
// Stalled — re-prompt so the node finishes or escalates with an
|
|
919
|
+
// explicit `crtr push final` (or `crtr human ask`). Deliver as a
|
|
920
|
+
// followUp: the turn just ended but pi may still be flushing, so an
|
|
921
|
+
// unqualified sendUserMessage races with 'already processing'.
|
|
922
|
+
pi.sendUserMessage(decision.message, { deliverAs: 'followUp' });
|
|
923
|
+
try {
|
|
924
|
+
clearFault(nodeId);
|
|
925
|
+
}
|
|
926
|
+
catch { /* best-effort */ }
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
929
|
+
// 'allow' — the node legitimately stopped. The active-fault marker can
|
|
930
|
+
// clear now; any report it owed its subscribers was sent by an explicit
|
|
931
|
+
// `crtr push` during the turn.
|
|
932
|
+
try {
|
|
933
|
+
clearFault(nodeId);
|
|
934
|
+
}
|
|
935
|
+
catch { /* best-effort */ }
|
|
936
|
+
if (decision.reason === 'finished') {
|
|
937
|
+
try {
|
|
938
|
+
ctx?.shutdown?.();
|
|
939
|
+
}
|
|
940
|
+
catch { /* ignore */ }
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
//
|
|
944
|
+
// Idle-release: a node awaiting its workers (reason 'awaiting') is holding
|
|
945
|
+
// a tmux window for nothing. Free it — mark it idle-released and shut pi
|
|
946
|
+
// down; the daemon watches its inbox and revives it (resume) the moment a
|
|
947
|
+
// subscribed worker delivers. An 'attended' root never releases: the human
|
|
948
|
+
// is its wake source, so we keep its window live and dormant.
|
|
949
|
+
if (decision.reason === 'awaiting' || decision.reason === 'scheduled') {
|
|
950
|
+
// AWAITING ≠ done (no manager-takeover). What happens next splits on
|
|
951
|
+
// whether the user is WATCHING this node:
|
|
952
|
+
// • FOCUSED → it holds the user's viewport, so keep pi LIVE and
|
|
953
|
+
// dormant (exactly like a resident root): do NOT release or shut
|
|
954
|
+
// down. The in-process inbox-watcher (still alive) wakes it the
|
|
955
|
+
// instant a worker pushes — no respawn, no frozen pane, the pane
|
|
956
|
+
// stays interactive. When the user later focuses AWAY, placement's
|
|
957
|
+
// retarget reclassifies it as a parked terminal viewer and releases
|
|
958
|
+
// it then (transition 'release' + pane reaped), so the kept-alive
|
|
959
|
+
// pi is reclaimed on focus-away, never held forever.
|
|
960
|
+
// • UNFOCUSED → no one is watching, so holding a live pi for a window
|
|
961
|
+
// is waste. Release it (idle + idle-release) and shut pi down; its
|
|
962
|
+
// backstage pane closes and the daemon revives it (resume) on the
|
|
963
|
+
// next unseen inbox entry.
|
|
964
|
+
if (focusOf(nodeId) !== null)
|
|
965
|
+
return; // focused → stay alive, dormant
|
|
966
|
+
// Match the daemon's idle-release wake gate: a resume wake does not
|
|
967
|
+
// drainBearings, so a non-deferred entry past the durable cursor must
|
|
968
|
+
// keep this broker alive for the watcher to deliver and commit it.
|
|
969
|
+
// Deferred entries ride the next natural cycle (#341).
|
|
970
|
+
if (readInboxSince(nodeId, readCursor(nodeId)).some((entry) => entry.tier !== 'deferred'))
|
|
971
|
+
return;
|
|
972
|
+
transition(nodeId, 'release');
|
|
973
|
+
try {
|
|
974
|
+
ctx?.shutdown?.();
|
|
975
|
+
}
|
|
976
|
+
catch { /* ignore */ }
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
catch {
|
|
981
|
+
/* agent_settled handler must never throw out of the extension */
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
export default registerCanvasStophook;
|