@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,897 @@
|
|
|
1
|
+
// The canvas data-access layer. The one place that reads/writes the node+edge
|
|
2
|
+
// model. Later phases (spawn, push, lifecycle, daemon) call only this.
|
|
3
|
+
//
|
|
4
|
+
// Source-of-truth split: a node's meta.json is canonical for its own fields;
|
|
5
|
+
// the db row is a queryable index re-derivable from it. The subscribes_to edges
|
|
6
|
+
// are db-authoritative (mutable, many-writers — what WAL is for).
|
|
7
|
+
import { existsSync, readFileSync, readdirSync, rmSync, statSync } from 'node:fs';
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { openDb, withCanvasWrite } from './db.js';
|
|
10
|
+
import { withMetaLock, readMetaObject, writeMetaObjectLocked, writeJsonFileDurably } from './meta-file.js';
|
|
11
|
+
import { isPidAlive, recordedPidLiveness, capturePidIdentities, identitiesMatch, isLegacyTicksIdentity, isBootScopedIdentity, } from './pid.js';
|
|
12
|
+
import { ensureHome, ensureNodeDirs, nodeMetaPath, nodeDir, nodesRoot, jobDir, } from './paths.js';
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// meta.json (durable identity — the source of truth for what PERSISTS)
|
|
15
|
+
//
|
|
16
|
+
// One authoritative store per fact: meta.json holds NodeIdentity only; the six
|
|
17
|
+
// runtime fields (status, intent, pi_pid, window, tmux_session, pane) are
|
|
18
|
+
// authoritative in the WAL'd `nodes` row, each mutated by one atomic setter
|
|
19
|
+
// below. getNode() hydrates the two back into the historical NodeMeta view.
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/** The identity keys meta.json persists. Listed explicitly so no runtime field
|
|
22
|
+
* can ever leak onto disk even when a fully-hydrated NodeMeta is handed in. */
|
|
23
|
+
const IDENTITY_KEYS = [
|
|
24
|
+
'node_id', 'name', 'description', 'cycles', 'created', 'cwd', 'host_kind', 'profile_id', 'kind', 'mode',
|
|
25
|
+
'lifecycle', 'persona_ack', 'parent', 'spawned_by', 'fork_from', 'human_work_target', 'private_fork_phase',
|
|
26
|
+
'private_fork_recipe', 'passive_default', 'pi_session_id', 'pi_session_file', 'cycle_pending', 'model_override',
|
|
27
|
+
'launch', 'managed_worktree',
|
|
28
|
+
];
|
|
29
|
+
/** Project any node object down to its durable-identity subset. */
|
|
30
|
+
function toIdentity(m) {
|
|
31
|
+
const out = {};
|
|
32
|
+
for (const k of IDENTITY_KEYS) {
|
|
33
|
+
if (m[k] !== undefined)
|
|
34
|
+
out[k] = m[k];
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
function readMeta(nodeId) {
|
|
39
|
+
const p = nodeMetaPath(nodeId);
|
|
40
|
+
if (!existsSync(p))
|
|
41
|
+
return null;
|
|
42
|
+
// Legacy metas may still carry runtime fields on disk; toIdentity-on-read is
|
|
43
|
+
// unnecessary (callers go through getNode, which overlays the row), but the
|
|
44
|
+
// raw parse is typed as identity — extra props are ignored.
|
|
45
|
+
//
|
|
46
|
+
// Tolerate an EMPTY or unparseable meta.json by treating it as MISSING (null)
|
|
47
|
+
// rather than throwing. A bare write-temp-then-rename without fsync can leave a
|
|
48
|
+
// 0-byte meta.json on an NFS-backed home after the holding process/sandbox dies
|
|
49
|
+
// (see writeMeta + the guest cold-boot bug it guards against); a single corrupt
|
|
50
|
+
// node must not crash rebuildIndex/revive for the whole canvas. Recovery
|
|
51
|
+
// (re-seed from a durable snapshot) is the caller's job.
|
|
52
|
+
const raw = readFileSync(p, 'utf8');
|
|
53
|
+
if (raw.trim() === '')
|
|
54
|
+
return null;
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(raw);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Serialize ONLY the identity subset → meta.json never holds runtime fields.
|
|
63
|
+
*
|
|
64
|
+
* Durable write: fsync the temp file before the rename, then fsync the parent
|
|
65
|
+
* directory so the rename itself is on disk. A bare writeFileSync+rename is not
|
|
66
|
+
* crash-durable — a host crash or abrupt sandbox teardown shortly after the
|
|
67
|
+
* rename can surface a 0-byte or missing meta.json (observed on a guest home as
|
|
68
|
+
* a cold-boot 0-byte meta.json → rebuild-index/revive JSON.parse('')). meta.json
|
|
69
|
+
* is written rarely (birth, polymorph, session-id capture, naming) so the
|
|
70
|
+
* per-write fsync cost is negligible. */
|
|
71
|
+
function writeMeta(meta) {
|
|
72
|
+
writeJsonFileDurably(nodeMetaPath(meta.node_id), toIdentity(meta));
|
|
73
|
+
}
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
// row index — identity columns are a derived projection of meta; runtime
|
|
76
|
+
// columns are authoritative. The two have DIFFERENT writers: upsertRow only
|
|
77
|
+
// ever touches identity (so a re-index never clobbers live runtime), while
|
|
78
|
+
// createNode seeds runtime once and the atomic setters own it thereafter.
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
/** Upsert the IDENTITY columns of a node's row. ON CONFLICT updates identity
|
|
81
|
+
* ONLY — runtime columns (status/intent/pi_pid/window/tmux_session/pane) are left
|
|
82
|
+
* exactly as they are, so re-indexing or an identity edit never disturbs live
|
|
83
|
+
* state. A fresh insert takes the schema defaults for runtime. */
|
|
84
|
+
function upsertRow(meta) {
|
|
85
|
+
openDb()
|
|
86
|
+
.prepare(`INSERT INTO nodes (node_id, name, kind, mode, lifecycle, cwd, host_kind, profile_id, parent, created)
|
|
87
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
88
|
+
ON CONFLICT(node_id) DO UPDATE SET
|
|
89
|
+
name=excluded.name, kind=excluded.kind, mode=excluded.mode,
|
|
90
|
+
lifecycle=excluded.lifecycle, cwd=excluded.cwd, host_kind=excluded.host_kind,
|
|
91
|
+
profile_id=excluded.profile_id, parent=excluded.parent`)
|
|
92
|
+
.run(meta.node_id, meta.name, meta.kind, meta.mode, meta.lifecycle, meta.cwd, meta.host_kind ?? null, meta.profile_id ?? null, meta.parent ?? null, meta.created);
|
|
93
|
+
}
|
|
94
|
+
/** Seed a node's row at BIRTH: identity columns + runtime columns taken from the
|
|
95
|
+
* incoming meta (defaults: status='active', the rest null). The only writer
|
|
96
|
+
* that sets runtime columns alongside identity in one statement — afterwards
|
|
97
|
+
* the atomic setters are the sole runtime writers. */
|
|
98
|
+
function seedRow(meta) {
|
|
99
|
+
openDb()
|
|
100
|
+
.prepare(`INSERT INTO nodes
|
|
101
|
+
(node_id, name, kind, mode, lifecycle, cwd, host_kind, profile_id, parent, created,
|
|
102
|
+
status, intent, waiting_for, final_report, finalized_at, pi_pid, "window", tmux_session, pane)
|
|
103
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
104
|
+
ON CONFLICT(node_id) DO UPDATE SET
|
|
105
|
+
name=excluded.name, kind=excluded.kind, mode=excluded.mode,
|
|
106
|
+
lifecycle=excluded.lifecycle, cwd=excluded.cwd, host_kind=excluded.host_kind,
|
|
107
|
+
profile_id=excluded.profile_id, parent=excluded.parent,
|
|
108
|
+
status=excluded.status, intent=excluded.intent, waiting_for=excluded.waiting_for,
|
|
109
|
+
final_report=excluded.final_report, finalized_at=excluded.finalized_at,
|
|
110
|
+
pi_pid=excluded.pi_pid, "window"=excluded."window", tmux_session=excluded.tmux_session,
|
|
111
|
+
pane=excluded.pane`)
|
|
112
|
+
.run(meta.node_id, meta.name, meta.kind, meta.mode, meta.lifecycle, meta.cwd, meta.host_kind ?? null, meta.profile_id ?? null, meta.parent ?? null, meta.created, meta.status ?? 'active', meta.intent ?? null, meta.waiting_for ?? null, meta.final_report ?? null, meta.finalized_at ?? null, meta.pi_pid ?? null, meta.window ?? null, meta.tmux_session ?? null, meta.pane ?? null);
|
|
113
|
+
}
|
|
114
|
+
function rowFrom(r) {
|
|
115
|
+
return {
|
|
116
|
+
node_id: r['node_id'],
|
|
117
|
+
name: r['name'],
|
|
118
|
+
kind: r['kind'],
|
|
119
|
+
mode: r['mode'],
|
|
120
|
+
lifecycle: r['lifecycle'],
|
|
121
|
+
status: r['status'],
|
|
122
|
+
cwd: r['cwd'],
|
|
123
|
+
host_kind: r['host_kind'] ?? null,
|
|
124
|
+
profile_id: r['profile_id'] ?? null,
|
|
125
|
+
parent: r['parent'] ?? null,
|
|
126
|
+
created: r['created'],
|
|
127
|
+
intent: r['intent'] ?? null,
|
|
128
|
+
waiting_for: r['waiting_for'] ?? null,
|
|
129
|
+
final_report: r['final_report'] ?? null,
|
|
130
|
+
finalized_at: r['finalized_at'] ?? null,
|
|
131
|
+
pi_pid: r['pi_pid'] ?? null,
|
|
132
|
+
pi_pid_identity: r['pi_pid_identity'] ?? null,
|
|
133
|
+
window: r['window'] ?? null,
|
|
134
|
+
tmux_session: r['tmux_session'] ?? null,
|
|
135
|
+
pane: r['pane'] ?? null,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/** The authoritative runtime fields for `nodeId`, read from its row. Null when
|
|
139
|
+
* no row exists yet (the hydration then falls back to whatever the meta held). */
|
|
140
|
+
function runtimeFromRow(nodeId) {
|
|
141
|
+
const r = openDb()
|
|
142
|
+
.prepare('SELECT status, intent, waiting_for, final_report, finalized_at, pi_pid, pi_pid_identity, "window", tmux_session, pane FROM nodes WHERE node_id = ?')
|
|
143
|
+
.get(nodeId);
|
|
144
|
+
if (r === undefined)
|
|
145
|
+
return null;
|
|
146
|
+
return {
|
|
147
|
+
status: r['status'] ?? 'active',
|
|
148
|
+
intent: r['intent'] ?? null,
|
|
149
|
+
waiting_for: r['waiting_for'] ?? null,
|
|
150
|
+
final_report: r['final_report'] ?? null,
|
|
151
|
+
finalized_at: r['finalized_at'] ?? null,
|
|
152
|
+
pi_pid: r['pi_pid'] ?? null,
|
|
153
|
+
pi_pid_identity: r['pi_pid_identity'] ?? null,
|
|
154
|
+
window: r['window'] ?? null,
|
|
155
|
+
tmux_session: r['tmux_session'] ?? null,
|
|
156
|
+
pane: r['pane'] ?? null,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
// ---------------------------------------------------------------------------
|
|
160
|
+
// Nodes
|
|
161
|
+
// ---------------------------------------------------------------------------
|
|
162
|
+
/** Create a node: scaffold its dirs, persist identity to meta.json, and seed the
|
|
163
|
+
* row (identity + runtime from the incoming meta). Returns the hydrated view. */
|
|
164
|
+
export function createNode(meta) {
|
|
165
|
+
ensureHome();
|
|
166
|
+
ensureNodeDirs(meta.node_id);
|
|
167
|
+
writeMeta(meta);
|
|
168
|
+
seedRow(meta);
|
|
169
|
+
return getNode(meta.node_id);
|
|
170
|
+
}
|
|
171
|
+
/** The canonical node record: durable identity (meta.json) ∪ authoritative
|
|
172
|
+
* runtime (the row). Null if unknown. */
|
|
173
|
+
export function getNode(nodeId) {
|
|
174
|
+
const ident = readMeta(nodeId);
|
|
175
|
+
if (ident === null)
|
|
176
|
+
return null;
|
|
177
|
+
const rt = runtimeFromRow(nodeId);
|
|
178
|
+
// The row is authoritative for runtime; overlay it over identity. When no row
|
|
179
|
+
// exists yet (rare — pre-rebuild), keep whatever the meta carried.
|
|
180
|
+
return { ...ident, ...(rt ?? {}) };
|
|
181
|
+
}
|
|
182
|
+
/** The indexed row (from the db) — cheap for queries that don't need full meta. */
|
|
183
|
+
export function getRow(nodeId) {
|
|
184
|
+
const r = openDb()
|
|
185
|
+
.prepare('SELECT * FROM nodes WHERE node_id = ?')
|
|
186
|
+
.get(nodeId);
|
|
187
|
+
return r ? rowFrom(r) : null;
|
|
188
|
+
}
|
|
189
|
+
/** The node row whose durable LOCATION pane is `pane`, or null. Lets placement
|
|
190
|
+
* resolve "who sits in this pane" by the first-class `%pane_id` handle (e.g.
|
|
191
|
+
* to adopt a caller's pane as a focus). pane is not UNIQUE in the schema, but a
|
|
192
|
+
* live pane backs at most one node, so this returns the single match. */
|
|
193
|
+
export function getRowByPane(pane) {
|
|
194
|
+
const r = openDb()
|
|
195
|
+
.prepare('SELECT * FROM nodes WHERE pane = ?')
|
|
196
|
+
.get(pane);
|
|
197
|
+
return r ? rowFrom(r) : null;
|
|
198
|
+
}
|
|
199
|
+
/** Merge an IDENTITY patch into a node's meta.json and re-index its identity
|
|
200
|
+
* columns. Identity has a single writer per node, so this read-modify-write is
|
|
201
|
+
* safe (the contended runtime fields were moved out — see the atomic setters
|
|
202
|
+
* below). Returns the hydrated view (runtime included). */
|
|
203
|
+
export function updateNode(nodeId, patch) {
|
|
204
|
+
const path = nodeMetaPath(nodeId);
|
|
205
|
+
// The whole read/merge/write runs under the SAME per-node lock a migration
|
|
206
|
+
// takes (meta-file.ts), so a concurrent v15 normalization and an identity edit
|
|
207
|
+
// cannot interleave into a lost write or a restored legacy hook prefix.
|
|
208
|
+
const next = withMetaLock(path, () => {
|
|
209
|
+
const cur = readMetaObject(path);
|
|
210
|
+
if (cur === null)
|
|
211
|
+
throw new Error(`unknown node: ${nodeId}`);
|
|
212
|
+
const identity = toIdentity({ ...cur, ...patch, node_id: nodeId });
|
|
213
|
+
writeMetaObjectLocked(path, identity);
|
|
214
|
+
return identity;
|
|
215
|
+
});
|
|
216
|
+
upsertRow(next);
|
|
217
|
+
return getNode(nodeId);
|
|
218
|
+
}
|
|
219
|
+
// ---------------------------------------------------------------------------
|
|
220
|
+
// Atomic runtime setters — each one a single-statement UPDATE on the WAL'd row,
|
|
221
|
+
// the authoritative store for live state. No read-modify-write, so concurrent
|
|
222
|
+
// writers of DIFFERENT fields (the daemon stamping pi_pid while a node flips
|
|
223
|
+
// status) can never clobber each other: WAL serializes the two statements.
|
|
224
|
+
// `"window"` is quoted defensively — it is a SQLite keyword.
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
/** Set a node's status. Atomic single-column write. */
|
|
227
|
+
export function setStatus(nodeId, status) {
|
|
228
|
+
openDb().prepare('UPDATE nodes SET status = ? WHERE node_id = ?').run(status, nodeId);
|
|
229
|
+
}
|
|
230
|
+
/** Set a node's exit intent. Atomic single-column write. */
|
|
231
|
+
export function setIntent(nodeId, intent) {
|
|
232
|
+
openDb().prepare('UPDATE nodes SET intent = ? WHERE node_id = ?').run(intent ?? null, nodeId);
|
|
233
|
+
}
|
|
234
|
+
/** Set a node's tmux presence in one atomic write: the durable LOCATION anchor
|
|
235
|
+
* `pane` (the `%pane_id`) plus its derived cache (`tmux_session` + `window`).
|
|
236
|
+
* All three move together — `pane` joins the others inside the single UPDATE so
|
|
237
|
+
* a move never half-writes the location. `pane` is optional: a caller that does
|
|
238
|
+
* not yet track it (every caller, until the placement layer lands) writes null,
|
|
239
|
+
* which is harmless because nothing reads `pane` yet. */
|
|
240
|
+
export function setPresence(nodeId, presence) {
|
|
241
|
+
openDb()
|
|
242
|
+
.prepare('UPDATE nodes SET tmux_session = ?, "window" = ?, pane = ? WHERE node_id = ?')
|
|
243
|
+
.run(presence.tmux_session ?? null, presence.window ?? null, presence.pane ?? null, nodeId);
|
|
244
|
+
}
|
|
245
|
+
/** Record the live pi pid (daemon liveness signal) PLUS its launch-time
|
|
246
|
+
* identity fingerprint, in one atomic write (crouter#98 review finding 1):
|
|
247
|
+
* `capturePidIdentities([pid])` is a signal-0-adjacent `ps -p <pid>` probe
|
|
248
|
+
* taken RIGHT NOW, while `pid` is the process we just spawned/bound and
|
|
249
|
+
* therefore definitely still exists — this is the LAUNCH-time baseline
|
|
250
|
+
* `headlessBrokerHost.teardown()` later compares against before signaling
|
|
251
|
+
* anything. A failed probe (rare — `ps` itself misbehaving) or a probe that
|
|
252
|
+
* finds no row for `pid` (raced away in the instant between spawn and this
|
|
253
|
+
* call) both write `NULL`: no baseline recorded, so the teardown guard fails
|
|
254
|
+
* open exactly like a node booted before this column existed — never a false
|
|
255
|
+
* identity that could itself cause a false mismatch later. */
|
|
256
|
+
export function recordPid(nodeId, pid) {
|
|
257
|
+
const identity = capturePidIdentities([pid])?.get(pid) ?? null;
|
|
258
|
+
openDb()
|
|
259
|
+
.prepare('UPDATE nodes SET pi_pid = ?, pi_pid_identity = ? WHERE node_id = ?')
|
|
260
|
+
.run(pid, identity, nodeId);
|
|
261
|
+
}
|
|
262
|
+
/** Clear the pi pid (window-backed relaunch, before the fresh pi re-records it)
|
|
263
|
+
* AND its recorded launch-time identity — the two are written together by
|
|
264
|
+
* `recordPid` and must be cleared together, or a subsequent relaunch that
|
|
265
|
+
* reuses the pid namespace could compare its own fresh pid against a STALE
|
|
266
|
+
* identity left over from the pid this row held before. */
|
|
267
|
+
export function clearPid(nodeId) {
|
|
268
|
+
openDb().prepare('UPDATE nodes SET pi_pid = NULL, pi_pid_identity = NULL WHERE node_id = ?').run(nodeId);
|
|
269
|
+
}
|
|
270
|
+
/** ONE-TIME completion of the boot-scoped-identity format migration, run once
|
|
271
|
+
* at daemon startup (the natural boot-reconciliation chokepoint, right after
|
|
272
|
+
* `reconcileBootLiveness`). It closes the gap the `identitiesMatch` legacy
|
|
273
|
+
* lane only TOLERATES: a broker that survives an in-place crouter upgrade
|
|
274
|
+
* keeps its old `lstart#ticks` row indefinitely (`recordPid` only fires on
|
|
275
|
+
* launch/revive/session_start), so the cross-boot ticks-collision exposure the
|
|
276
|
+
* boot-scoped base was added to close never provably shuts for those rows.
|
|
277
|
+
*
|
|
278
|
+
* For every row whose RECORDED identity is legacy-format while this platform
|
|
279
|
+
* now composes new-format (a readable kernel boot_id):
|
|
280
|
+
* - if the recorded pid's CURRENT live identity matches the recorded one via
|
|
281
|
+
* the migration lane (same live process, `identitiesMatch` true) AND that
|
|
282
|
+
* current identity is itself boot-scoped — re-record it with the new
|
|
283
|
+
* composer, completing the migration in place;
|
|
284
|
+
* - otherwise (pid gone, probe failed, reused — no match, or no readable
|
|
285
|
+
* boot_id for it) — leave the row untouched for the normal liveness
|
|
286
|
+
* handling that already runs each tick.
|
|
287
|
+
*
|
|
288
|
+
* After this runs once, the legacy compare lane only ever engages for
|
|
289
|
+
* genuinely no-boot_id platforms. NOT a per-caller reconciliation layer — a
|
|
290
|
+
* single startup sweep. `captureIdentity` is injectable for unit tests.
|
|
291
|
+
*
|
|
292
|
+
* GATED on proven same-boot provenance by its caller (daemon startup runs it
|
|
293
|
+
* only when `reconcileBootLiveness` returned `sameBootProven` — see
|
|
294
|
+
* `bootProvenSame`). This is what makes a bare ticks match safe to bless as a
|
|
295
|
+
* current-boot identity: without that proof an equal-ticks collision with an
|
|
296
|
+
* unrelated process from a DIFFERENT boot could be rewritten as
|
|
297
|
+
* `<currentBootId>#<ticks>`, permanently baptizing a stranger.
|
|
298
|
+
*
|
|
299
|
+
* Not transactional by design: it never HOLDS the write lock across the (slow,
|
|
300
|
+
* per-row) `ps` probe. Each re-record is a compare-and-swap single-row UPDATE
|
|
301
|
+
* constrained by ALL three snapshotted values (`node_id`, `pi_pid`,
|
|
302
|
+
* `pi_pid_identity`), counted only when a row actually changed. So if the old
|
|
303
|
+
* broker exits and a concurrent revive atomically records a fresh
|
|
304
|
+
* `(pi_pid, pi_pid_identity)` between this sweep's probe and its update, the
|
|
305
|
+
* CAS matches zero rows and the migration is skipped rather than clobbering
|
|
306
|
+
* the newer identity with the stale one. */
|
|
307
|
+
export function migrateLegacyPidIdentities(captureIdentity = (pid) => capturePidIdentities([pid])?.get(pid)) {
|
|
308
|
+
const db = openDb();
|
|
309
|
+
const rows = db
|
|
310
|
+
.prepare('SELECT node_id, pi_pid, pi_pid_identity FROM nodes WHERE pi_pid IS NOT NULL AND pi_pid_identity IS NOT NULL')
|
|
311
|
+
.all();
|
|
312
|
+
// Compare-and-swap: rewrite only if the row STILL carries the exact pid +
|
|
313
|
+
// legacy identity we probed. A concurrent revive between probe and update
|
|
314
|
+
// records a new (pi_pid, pi_pid_identity) pair, so this WHERE fails to match
|
|
315
|
+
// and we skip rather than clobber the fresh baseline.
|
|
316
|
+
const upd = db.prepare('UPDATE nodes SET pi_pid_identity = ? WHERE node_id = ? AND pi_pid = ? AND pi_pid_identity = ?');
|
|
317
|
+
const migrated = [];
|
|
318
|
+
for (const row of rows) {
|
|
319
|
+
if (!isLegacyTicksIdentity(row.pi_pid_identity))
|
|
320
|
+
continue;
|
|
321
|
+
const current = captureIdentity(row.pi_pid);
|
|
322
|
+
if (current === undefined)
|
|
323
|
+
continue; // pid gone / probe failed → normal liveness handling
|
|
324
|
+
if (!isBootScopedIdentity(current))
|
|
325
|
+
continue; // no readable boot_id for it → nothing to upgrade
|
|
326
|
+
if (!identitiesMatch(current, row.pi_pid_identity))
|
|
327
|
+
continue; // reused → leave to liveness
|
|
328
|
+
const res = upd.run(current, row.node_id, row.pi_pid, row.pi_pid_identity);
|
|
329
|
+
if (res.changes > 0)
|
|
330
|
+
migrated.push(row.node_id); // skipped if a concurrent revive re-recorded
|
|
331
|
+
}
|
|
332
|
+
return { migrated };
|
|
333
|
+
}
|
|
334
|
+
/** The one clause that hides unclaimed warm-pool spares from every listing.
|
|
335
|
+
* A spare is a real node with a booted broker, but nobody has been handed it
|
|
336
|
+
* yet — surfacing it would put a phantom empty conversation in the user's
|
|
337
|
+
* sidebar. Claiming deletes the marker, which is what makes the node visible. */
|
|
338
|
+
const NOT_A_SPARE = 'node_id NOT IN (SELECT node_id FROM warm_pool)';
|
|
339
|
+
/** All rows, optionally filtered by status. Unclaimed warm spares are excluded. */
|
|
340
|
+
export function listNodes(filter) {
|
|
341
|
+
const db = openDb();
|
|
342
|
+
let rows;
|
|
343
|
+
if (filter?.status !== undefined) {
|
|
344
|
+
const statuses = Array.isArray(filter.status) ? filter.status : [filter.status];
|
|
345
|
+
const placeholders = statuses.map(() => '?').join(',');
|
|
346
|
+
rows = db
|
|
347
|
+
.prepare(`SELECT * FROM nodes WHERE status IN (${placeholders}) AND ${NOT_A_SPARE} ORDER BY created`)
|
|
348
|
+
.all(...statuses);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
rows = db.prepare(`SELECT * FROM nodes WHERE ${NOT_A_SPARE} ORDER BY created`).all();
|
|
352
|
+
}
|
|
353
|
+
return rows.map(rowFrom);
|
|
354
|
+
}
|
|
355
|
+
// ---------------------------------------------------------------------------
|
|
356
|
+
// Warm pool — spare booted roots awaiting a `prefer_warm` claim (see
|
|
357
|
+
// `runtime/warm-pool.ts` for the recipe key and the mint/refill policy).
|
|
358
|
+
// ---------------------------------------------------------------------------
|
|
359
|
+
/** Mark an already-spawned node as an unclaimed spare for `recipeKey`. Hides it
|
|
360
|
+
* from every listing until it is claimed. */
|
|
361
|
+
export function registerWarmSpare(nodeId, recipeKey) {
|
|
362
|
+
withCanvasWrite((db) => {
|
|
363
|
+
db.prepare('INSERT OR REPLACE INTO warm_pool (node_id, recipe_key, created) VALUES (?, ?, ?)')
|
|
364
|
+
.run(nodeId, recipeKey, new Date().toISOString());
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
/** Take a parked spare OUT of the pool without claiming it — the reaper's
|
|
368
|
+
* first move. Returns false when the marker was already gone (a concurrent
|
|
369
|
+
* claim won it), which is the reaper's signal to leave that node alone: it is
|
|
370
|
+
* somebody's live conversation now, not a spare. Deleting the marker under the
|
|
371
|
+
* write lock is exactly what `claimWarmSpare` does, so the two can never both
|
|
372
|
+
* succeed on the same node. */
|
|
373
|
+
export function unregisterWarmSpare(nodeId) {
|
|
374
|
+
return withCanvasWrite((db) => db.prepare('DELETE FROM warm_pool WHERE node_id = ?').run(nodeId).changes > 0);
|
|
375
|
+
}
|
|
376
|
+
function warmSpareRowsFor(db, recipeKey) {
|
|
377
|
+
const sql = `SELECT w.node_id AS node_id, w.recipe_key AS recipe_key, w.created AS created,
|
|
378
|
+
n.status AS status, n.pi_pid AS pi_pid, n.pi_pid_identity AS pi_pid_identity
|
|
379
|
+
FROM warm_pool w JOIN nodes n ON n.node_id = w.node_id` +
|
|
380
|
+
(recipeKey === undefined ? '' : ' WHERE w.recipe_key = ?') +
|
|
381
|
+
' ORDER BY w.created';
|
|
382
|
+
const rows = (recipeKey === undefined ? db.prepare(sql).all() : db.prepare(sql).all(recipeKey));
|
|
383
|
+
return rows.map((r) => ({
|
|
384
|
+
node_id: r['node_id'],
|
|
385
|
+
recipe_key: r['recipe_key'],
|
|
386
|
+
created: r['created'],
|
|
387
|
+
status: r['status'],
|
|
388
|
+
pi_pid: r['pi_pid'] ?? null,
|
|
389
|
+
pi_pid_identity: r['pi_pid_identity'] ?? null,
|
|
390
|
+
}));
|
|
391
|
+
}
|
|
392
|
+
/** Every parked spare, oldest first — what the reaper (`runtime/warm-pool.ts`
|
|
393
|
+
* `reapStaleSpares`) sweeps. Deliberately NOT filtered by liveness: judging a
|
|
394
|
+
* spare is the caller's job. */
|
|
395
|
+
export function listWarmSpares() {
|
|
396
|
+
return warmSpareRowsFor(openDb());
|
|
397
|
+
}
|
|
398
|
+
/** True while `nodeId` is an UNCLAIMED spare — nobody owns this conversation
|
|
399
|
+
* yet. `registerWarmSpare` runs the instant the row exists and BEFORE the
|
|
400
|
+
* broker launch, and a claim deletes the marker atomically, so this is a
|
|
401
|
+
* reliable read from inside the booting engine (the context-intro extension
|
|
402
|
+
* asks it at `session_start` to withhold bearings that would otherwise assert
|
|
403
|
+
* the spare's placeholder persona instead of its eventual claimant's). */
|
|
404
|
+
export function isWarmSpare(nodeId) {
|
|
405
|
+
const row = openDb().prepare('SELECT 1 FROM warm_pool WHERE node_id = ?').get(nodeId);
|
|
406
|
+
return row !== undefined;
|
|
407
|
+
}
|
|
408
|
+
/** A spare is claimable only when its broker is CONFIRMED alive. Status alone
|
|
409
|
+
* is not enough: a broker torn down by a daemon handover leaves the row at
|
|
410
|
+
* `active`/`idle` with a dead pid, and handing that out would answer a create
|
|
411
|
+
* with a node that has no engine behind it. The probe is identity-aware, so a
|
|
412
|
+
* recycled pid never reads as alive; `indeterminate` (probe failed) is treated
|
|
413
|
+
* as not-claimable — a cold spawn is cheap, a broken node is not. */
|
|
414
|
+
function spareIsClaimable(row) {
|
|
415
|
+
if (row.status !== 'active' && row.status !== 'idle')
|
|
416
|
+
return false;
|
|
417
|
+
return recordedPidLiveness(row.pi_pid, row.pi_pid_identity) === 'alive';
|
|
418
|
+
}
|
|
419
|
+
/** Hand out the oldest CLAIMABLE spare matching `recipeKey`, or null when the
|
|
420
|
+
* pool has none. The select+delete run inside ONE canvas write-lock
|
|
421
|
+
* transaction, so two concurrent creates can never be handed the same spare.
|
|
422
|
+
* A spare whose broker is gone is skipped here and reaped by
|
|
423
|
+
* `reapStaleSpares` — nothing ever resumes a spare (the recovery sweep reads
|
|
424
|
+
* `listNodes`, which hides them), so a dead spare is garbage, not a parked one.
|
|
425
|
+
*
|
|
426
|
+
* The claim also restamps the row's `created` to `created` — birth time is a
|
|
427
|
+
* spare's MINT time, and consumers sort conversations on it, so an hour-old
|
|
428
|
+
* spare must not sort as an hour-old conversation. This is the one sanctioned
|
|
429
|
+
* write of `created` after birth (`upsertRow` deliberately never touches it);
|
|
430
|
+
* the caller mirrors the same stamp into meta.json. */
|
|
431
|
+
export function claimWarmSpare(recipeKey, created) {
|
|
432
|
+
return withCanvasWrite((db) => {
|
|
433
|
+
const row = warmSpareRowsFor(db, recipeKey).find(spareIsClaimable);
|
|
434
|
+
if (row === undefined)
|
|
435
|
+
return null;
|
|
436
|
+
const res = db.prepare('DELETE FROM warm_pool WHERE node_id = ?').run(row.node_id);
|
|
437
|
+
if (res.changes === 0)
|
|
438
|
+
return null;
|
|
439
|
+
db.prepare('UPDATE nodes SET created = ? WHERE node_id = ?').run(created, row.node_id);
|
|
440
|
+
return row.node_id;
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
/** How many CLAIMABLE spares are parked for `recipeKey` (the depth check a
|
|
444
|
+
* refill reads before minting). Uses the same liveness test as the claim, so a
|
|
445
|
+
* spare the claim would skip can never hold the pool at depth 1 and starve
|
|
446
|
+
* every later create of a warm start. */
|
|
447
|
+
export function warmSpareCount(recipeKey) {
|
|
448
|
+
return warmSpareRowsFor(openDb(), recipeKey).filter(spareIsClaimable).length;
|
|
449
|
+
}
|
|
450
|
+
/** Direct children of `id`, oldest first — an indexed point query
|
|
451
|
+
* (`idx_nodes_parent`) instead of a full-table `listNodes()` scan. */
|
|
452
|
+
export function childrenOf(id) {
|
|
453
|
+
return openDb()
|
|
454
|
+
.prepare('SELECT node_id FROM nodes WHERE parent = ? ORDER BY created')
|
|
455
|
+
.all(id).map((r) => r.node_id);
|
|
456
|
+
}
|
|
457
|
+
/** Every node's lean roster row, oldest first — a single scan indexed by
|
|
458
|
+
* `idx_nodes_created`. No per-row `getNode`/meta.json read, no N+1. */
|
|
459
|
+
export function rosterNodes() {
|
|
460
|
+
return openDb()
|
|
461
|
+
.prepare(`SELECT node_id, name, kind, mode, lifecycle, status, cwd, host_kind, parent, created
|
|
462
|
+
FROM nodes WHERE ${NOT_A_SPARE} ORDER BY created`)
|
|
463
|
+
.all().map((r) => ({
|
|
464
|
+
node_id: r['node_id'],
|
|
465
|
+
name: r['name'],
|
|
466
|
+
kind: r['kind'],
|
|
467
|
+
mode: r['mode'],
|
|
468
|
+
lifecycle: r['lifecycle'],
|
|
469
|
+
status: r['status'],
|
|
470
|
+
cwd: r['cwd'],
|
|
471
|
+
host_kind: r['host_kind'] ?? null,
|
|
472
|
+
parent: r['parent'] ?? null,
|
|
473
|
+
created: r['created'],
|
|
474
|
+
}));
|
|
475
|
+
}
|
|
476
|
+
/** Every `subscribes_to` edge (passive + multiple preserved, never collapsed) —
|
|
477
|
+
* a single scan indexed by `idx_edges_from`/`idx_edges_to` (composite
|
|
478
|
+
* `(type, from_id|to_id)`, so a bare `type` predicate still uses one of
|
|
479
|
+
* them). Paired with `rosterNodes()` as the roster's exactly-two-query
|
|
480
|
+
* contract. */
|
|
481
|
+
export function rosterEdges() {
|
|
482
|
+
return openDb()
|
|
483
|
+
.prepare(`SELECT from_id, to_id, active, created FROM edges WHERE type = 'subscribes_to' ORDER BY created`)
|
|
484
|
+
.all().map((r) => ({
|
|
485
|
+
from_id: r['from_id'],
|
|
486
|
+
to_id: r['to_id'],
|
|
487
|
+
active: r['active'] === 1,
|
|
488
|
+
created: r['created'],
|
|
489
|
+
}));
|
|
490
|
+
}
|
|
491
|
+
/** Resumable ROOT conversations pinned to `cwd`, most-recently-created first.
|
|
492
|
+
* A "root" is the top of a spine (`parent IS NULL`) that is a real
|
|
493
|
+
* conversation (not a `kind:'human'` ask) and still resumable (`active`/`idle`,
|
|
494
|
+
* never a `done`/`dead`/`canceled` node). This backs the front-door
|
|
495
|
+
* `crtr -c`/`-r` resume: cwd is the key (the Claude-Code mental model — "my
|
|
496
|
+
* last session HERE"), so it never teleports across projects. */
|
|
497
|
+
export function listResumableRoots(cwd) {
|
|
498
|
+
const rows = openDb()
|
|
499
|
+
.prepare(`SELECT * FROM nodes
|
|
500
|
+
WHERE parent IS NULL AND kind != 'human'
|
|
501
|
+
AND status IN ('active','idle') AND cwd = ?
|
|
502
|
+
AND ${NOT_A_SPARE}
|
|
503
|
+
ORDER BY created DESC`)
|
|
504
|
+
.all(cwd);
|
|
505
|
+
return rows.map(rowFrom);
|
|
506
|
+
}
|
|
507
|
+
// ---------------------------------------------------------------------------
|
|
508
|
+
// Edges
|
|
509
|
+
// ---------------------------------------------------------------------------
|
|
510
|
+
function addEdge(type, from, to, active) {
|
|
511
|
+
openDb()
|
|
512
|
+
.prepare(`INSERT INTO edges (type, from_id, to_id, active, created)
|
|
513
|
+
VALUES (?, ?, ?, ?, ?)
|
|
514
|
+
ON CONFLICT(type, from_id, to_id) DO UPDATE SET active=excluded.active`)
|
|
515
|
+
.run(type, from, to, active ? 1 : 0, new Date().toISOString());
|
|
516
|
+
}
|
|
517
|
+
/** Record `A subscribes_to B` — A receives B's output. active=true wakes A on
|
|
518
|
+
* emit; passive accumulates pointers without a wake. Mutable; callable by anyone. */
|
|
519
|
+
export function subscribe(subscriber, publisher, active = true) {
|
|
520
|
+
addEdge('subscribes_to', subscriber, publisher, active);
|
|
521
|
+
}
|
|
522
|
+
/** Drop a subscription edge. */
|
|
523
|
+
export function unsubscribe(subscriber, publisher) {
|
|
524
|
+
openDb()
|
|
525
|
+
.prepare('DELETE FROM edges WHERE type = ? AND from_id = ? AND to_id = ?')
|
|
526
|
+
.run('subscribes_to', subscriber, publisher);
|
|
527
|
+
}
|
|
528
|
+
/** Flip an existing subscription's wake behavior. */
|
|
529
|
+
export function setSubscriptionActive(subscriber, publisher, active) {
|
|
530
|
+
openDb()
|
|
531
|
+
.prepare('UPDATE edges SET active = ? WHERE type = ? AND from_id = ? AND to_id = ?')
|
|
532
|
+
.run(active ? 1 : 0, 'subscribes_to', subscriber, publisher);
|
|
533
|
+
}
|
|
534
|
+
/** Record the audit-only `child spawned_by parent` edge. */
|
|
535
|
+
export function recordSpawn(child, parent) {
|
|
536
|
+
addEdge('spawned_by', child, parent, true);
|
|
537
|
+
}
|
|
538
|
+
/** Who subscribes to `publisher` — the targets a push fans out to. */
|
|
539
|
+
export function subscribersOf(publisher) {
|
|
540
|
+
return openDb()
|
|
541
|
+
.prepare(`SELECT from_id AS node_id, active, created FROM edges
|
|
542
|
+
WHERE type = 'subscribes_to' AND to_id = ? ORDER BY created`)
|
|
543
|
+
.all(publisher).map((r) => ({
|
|
544
|
+
node_id: r['node_id'],
|
|
545
|
+
active: r['active'] === 1,
|
|
546
|
+
created: r['created'],
|
|
547
|
+
}));
|
|
548
|
+
}
|
|
549
|
+
/** Who `subscriber` subscribes to — its reports / the nodes feeding it. */
|
|
550
|
+
export function subscriptionsOf(subscriber) {
|
|
551
|
+
return openDb()
|
|
552
|
+
.prepare(`SELECT to_id AS node_id, active, created FROM edges
|
|
553
|
+
WHERE type = 'subscribes_to' AND from_id = ? ORDER BY created`)
|
|
554
|
+
.all(subscriber).map((r) => ({
|
|
555
|
+
node_id: r['node_id'],
|
|
556
|
+
active: r['active'] === 1,
|
|
557
|
+
created: r['created'],
|
|
558
|
+
}));
|
|
559
|
+
}
|
|
560
|
+
// ---------------------------------------------------------------------------
|
|
561
|
+
// Graph queries
|
|
562
|
+
// ---------------------------------------------------------------------------
|
|
563
|
+
/** A "view": every node whose output cascades up to `root` via subscriptions —
|
|
564
|
+
* the subscription sub-DAG reachable downward (root → its reports → theirs …).
|
|
565
|
+
* Returns ids excluding root, in BFS order. Cycle-safe. */
|
|
566
|
+
export function view(root) {
|
|
567
|
+
const seen = new Set([root]);
|
|
568
|
+
const out = [];
|
|
569
|
+
const queue = subscriptionsOf(root).map((s) => s.node_id);
|
|
570
|
+
while (queue.length > 0) {
|
|
571
|
+
const id = queue.shift();
|
|
572
|
+
if (seen.has(id))
|
|
573
|
+
continue;
|
|
574
|
+
seen.add(id);
|
|
575
|
+
out.push(id);
|
|
576
|
+
for (const s of subscriptionsOf(id)) {
|
|
577
|
+
if (!seen.has(s.node_id))
|
|
578
|
+
queue.push(s.node_id);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return out;
|
|
582
|
+
}
|
|
583
|
+
/** Stop-guard primitive: does this node hold an *active* subscription to a node
|
|
584
|
+
* that's still live (active|idle) — i.e. something that can actually wake it?
|
|
585
|
+
* If so, stopping is a legitimate await; if not, it must finish or escalate. */
|
|
586
|
+
export function hasActiveLiveSubscription(nodeId) {
|
|
587
|
+
const r = openDb()
|
|
588
|
+
.prepare(`SELECT 1 FROM edges e JOIN nodes n ON n.node_id = e.to_id
|
|
589
|
+
WHERE e.type = 'subscribes_to' AND e.from_id = ? AND e.active = 1
|
|
590
|
+
AND n.status IN ('active', 'idle') LIMIT 1`)
|
|
591
|
+
.get(nodeId);
|
|
592
|
+
return r !== undefined;
|
|
593
|
+
}
|
|
594
|
+
/** Whether a node explicitly awaits a controller that can still deliver. A
|
|
595
|
+
* parent relationship never implies this wait; the node must declare it. */
|
|
596
|
+
export function hasLiveMessageWait(nodeId) {
|
|
597
|
+
const controller = getNode(nodeId)?.waiting_for;
|
|
598
|
+
if (controller == null)
|
|
599
|
+
return false;
|
|
600
|
+
const target = getNode(controller);
|
|
601
|
+
return target !== null && (target.status === 'active' || target.status === 'idle');
|
|
602
|
+
}
|
|
603
|
+
/** Settle an explicit message wait before appending the qualifying delivery.
|
|
604
|
+
* This ordering makes the delivery's one wake observe cleared durable state. */
|
|
605
|
+
export function setMessageWait(nodeId, controller) {
|
|
606
|
+
openDb().prepare('UPDATE nodes SET waiting_for = ?, waiting_for_generation = waiting_for_generation + 1 WHERE node_id = ?').run(controller, nodeId);
|
|
607
|
+
}
|
|
608
|
+
/** Append a qualifying delivery and settle its matching wait while holding the
|
|
609
|
+
* canvas write lock. A concurrent `node wait controller` runs before or after this whole
|
|
610
|
+
* boundary, never between the durable inbox append and its compare-and-clear. */
|
|
611
|
+
export function deliverAndSettleMessageWait(nodeId, from, deliver) {
|
|
612
|
+
return withCanvasWrite((db) => {
|
|
613
|
+
const armed = db.prepare('SELECT waiting_for_generation FROM nodes WHERE node_id = ? AND waiting_for = ?').get(nodeId, from);
|
|
614
|
+
const result = deliver();
|
|
615
|
+
if (from !== null && armed !== undefined) {
|
|
616
|
+
db.prepare('UPDATE nodes SET waiting_for = NULL WHERE node_id = ? AND waiting_for = ? AND waiting_for_generation = ?').run(nodeId, from, armed.waiting_for_generation);
|
|
617
|
+
}
|
|
618
|
+
return result;
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
/** Write one controller-death notice and settle only the still-current dead
|
|
622
|
+
* wait. The check, notice append, and clear share one canvas write boundary. */
|
|
623
|
+
export function settleDeadMessageWait(nodeId, controller, deliver) {
|
|
624
|
+
return withCanvasWrite((db) => {
|
|
625
|
+
const row = db.prepare(`SELECT waiter.waiting_for, waiter.waiting_for_generation, target.status AS controller_status
|
|
626
|
+
FROM nodes AS waiter LEFT JOIN nodes AS target ON target.node_id = waiter.waiting_for
|
|
627
|
+
WHERE waiter.node_id = ?`).get(nodeId);
|
|
628
|
+
const live = row?.controller_status === 'active' || row?.controller_status === 'idle';
|
|
629
|
+
if (row?.waiting_for !== controller || live)
|
|
630
|
+
return null;
|
|
631
|
+
const result = deliver();
|
|
632
|
+
db.prepare('UPDATE nodes SET waiting_for = NULL WHERE node_id = ? AND waiting_for = ? AND waiting_for_generation = ?').run(nodeId, controller, row.waiting_for_generation);
|
|
633
|
+
return result;
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
/** #343: close the TOCTOU between checking a target has a natural cycle ahead
|
|
637
|
+
* of it and the write that depends on that (for example, a deferred inbox
|
|
638
|
+
* append). Fresh-reads `nodeId`'s
|
|
639
|
+
* (status, final_report) and either runs `body` (a write) or short-circuits
|
|
640
|
+
* with a `'terminal'`/`'missing'` outcome — the read and `body`'s write share
|
|
641
|
+
* ONE canvas write-lock boundary (`withCanvasWrite`'s `BEGIN IMMEDIATE`), so
|
|
642
|
+
* a concurrent finish/cancel/finalization/deletion either commits entirely
|
|
643
|
+
* before this reads (observed here, `body` never runs) or entirely after
|
|
644
|
+
* (`body` completes uncontested) — never in the gap a separate check-then-
|
|
645
|
+
* write left open. Pass the shared `hasNoNaturalCycle` predicate rather than
|
|
646
|
+
* a bespoke one so the two never drift.
|
|
647
|
+
*
|
|
648
|
+
* #343 review (Major): a dangling `nodeId` — the row deleted after the
|
|
649
|
+
* caller's own selection but before this guard's fresh read — MUST NEVER run
|
|
650
|
+
* `body`. Reporting `'missing'` distinctly from `'terminal'` (rather than
|
|
651
|
+
* folding it into either the terminal branch or a fabricated "safe" empty
|
|
652
|
+
* snapshot) keeps the two failure shapes from being conflated: a terminal
|
|
653
|
+
* target has a real `status`/`final_report` to report and its own
|
|
654
|
+
* `deferred_no_natural_cycle`-style rejection, while a missing target has
|
|
655
|
+
* nothing to report and belongs to the caller's own not-found contract. */
|
|
656
|
+
export function withFreshTerminalGuard(nodeId, isTerminal, body) {
|
|
657
|
+
return withCanvasWrite((db) => {
|
|
658
|
+
const row = db
|
|
659
|
+
.prepare('SELECT status, final_report FROM nodes WHERE node_id = ?')
|
|
660
|
+
.get(nodeId);
|
|
661
|
+
if (row === undefined) {
|
|
662
|
+
return { kind: 'missing' };
|
|
663
|
+
}
|
|
664
|
+
if (isTerminal(row)) {
|
|
665
|
+
return { kind: 'terminal', status: row.status, final_report: row.final_report };
|
|
666
|
+
}
|
|
667
|
+
return { kind: 'ran', result: body() };
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
// ---------------------------------------------------------------------------
|
|
671
|
+
// Index rebuild
|
|
672
|
+
// ---------------------------------------------------------------------------
|
|
673
|
+
/** Rebuild node rows from on-disk metas (the db node table is a derived index).
|
|
674
|
+
* Only the IDENTITY columns are rebuilt — they are a projection of meta. The
|
|
675
|
+
* runtime columns (status/intent/pi_pid/window/tmux_session/pane) are NOT in meta
|
|
676
|
+
* and NOT re-derivable from it: they describe live process/presence state, so
|
|
677
|
+
* an existing row keeps them and a freshly re-created row takes the schema's
|
|
678
|
+
* quiescent defaults (status='active', the rest null). The daemon reconciles
|
|
679
|
+
* liveness from tmux reality, not from a stale file.
|
|
680
|
+
* Edges are left intact — subscribes_to is db-authoritative; spawned_by is
|
|
681
|
+
* re-derived from each meta's `spawned_by` (fallback: `parent` for legacy metas). */
|
|
682
|
+
export function rebuildIndex() {
|
|
683
|
+
if (!existsSync(nodesRoot()))
|
|
684
|
+
return;
|
|
685
|
+
// Collect every on-disk meta first, then index in TWO passes. Under the
|
|
686
|
+
// edges→nodes FK (migration v4), a `spawned_by` edge insert whose endpoint
|
|
687
|
+
// row isn't present yet violates the constraint — so ALL node rows must exist
|
|
688
|
+
// before ANY edge is added.
|
|
689
|
+
const metas = [];
|
|
690
|
+
for (const id of readdirSync(nodesRoot())) {
|
|
691
|
+
if (!existsSync(join(nodeDir(id), 'meta.json')))
|
|
692
|
+
continue;
|
|
693
|
+
const meta = readMeta(id);
|
|
694
|
+
if (!meta)
|
|
695
|
+
continue;
|
|
696
|
+
metas.push(meta);
|
|
697
|
+
}
|
|
698
|
+
// Pass 1 — upsert every node row (the edge endpoints).
|
|
699
|
+
for (const meta of metas)
|
|
700
|
+
upsertRow(meta);
|
|
701
|
+
// Pass 2 — add the audit-only `spawned_by` provenance edges. Skip any whose
|
|
702
|
+
// provenance node has no on-disk meta (a deleted/pruned ancestor): the FK
|
|
703
|
+
// would reject it, and an orphan provenance edge is exactly what v4 makes
|
|
704
|
+
// unrepresentable.
|
|
705
|
+
const known = new Set(metas.map((m) => m.node_id));
|
|
706
|
+
for (const meta of metas) {
|
|
707
|
+
const prov = meta.spawned_by ?? meta.parent;
|
|
708
|
+
if (prov && known.has(prov))
|
|
709
|
+
recordSpawn(meta.node_id, prov);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
/** True when this node's identity is still required to own a managed checkout. */
|
|
713
|
+
function hasOpenManagedWorktree(nodeId) {
|
|
714
|
+
return getNode(nodeId)?.managed_worktree?.state === 'open';
|
|
715
|
+
}
|
|
716
|
+
/** True when this node still carries a LIVE (`armed`/`pending`) follow-up human-work
|
|
717
|
+
* receipt (design-followup-consult-v2.md §B.4; integrated-review Major-2).
|
|
718
|
+
* An `armed` fork has not yet committed its final report; a `pending` fork
|
|
719
|
+
* HAS committed it (promoted atomically inside `commitCanonicalFinal`'s own
|
|
720
|
+
* transaction) but the receipt has not yet been acknowledged by
|
|
721
|
+
* `submitFollowUpResult` — in both cases the node's on-disk report payload
|
|
722
|
+
* (`reports/<final_report>` once pending) is still needed for delivery, so
|
|
723
|
+
* neither status may ever be pruned/deleted out from under it. Queried via
|
|
724
|
+
* raw SQL against the `consult_outbox` table directly (not the
|
|
725
|
+
* `human-work-outbox.ts` peer module) to avoid a canvas.ts↔human-work-outbox.ts
|
|
726
|
+
* import cycle — that module itself imports `getNode` from here. */
|
|
727
|
+
function hasLiveFollowUpReceipt(nodeId) {
|
|
728
|
+
const r = openDb()
|
|
729
|
+
.prepare("SELECT 1 FROM consult_outbox WHERE node_id = ? AND work_kind = 'follow_up' AND status IN ('armed', 'pending') LIMIT 1")
|
|
730
|
+
.get(nodeId);
|
|
731
|
+
return r !== undefined;
|
|
732
|
+
}
|
|
733
|
+
/** Hard-delete ONE node: drop its row (the edges→nodes FK, ON DELETE CASCADE,
|
|
734
|
+
* GCs its edges) and remove its on-disk `nodes/<id>/` dir. The single-node
|
|
735
|
+
* analogue of {@link pruneNodes}, for IMMEDIATE reaping — e.g. an empty node the
|
|
736
|
+
* user closed or detached from. An open managed worktree is never deleted: its
|
|
737
|
+
* node retains the ownership needed for `node worktree close`. Nor is a node
|
|
738
|
+
* with a LIVE (`armed`/`pending`) follow-up human-work receipt — its report payload
|
|
739
|
+
* is still needed for delivery (integrated-review Major-2). Pure persisted-
|
|
740
|
+
* state removal: the caller MUST have already torn down the broker engine +
|
|
741
|
+
* viewer (this does not signal any process). The node row and its FK-coupled
|
|
742
|
+
* state are removed in one canvas write boundary. Best-effort dir removal
|
|
743
|
+
* follows the commit. */
|
|
744
|
+
export function deleteNode(nodeId) {
|
|
745
|
+
if (hasOpenManagedWorktree(nodeId) || hasLiveFollowUpReceipt(nodeId))
|
|
746
|
+
return { deleted: false };
|
|
747
|
+
const result = withCanvasWrite((db) => {
|
|
748
|
+
db.prepare('DELETE FROM nodes WHERE node_id = ?').run(nodeId);
|
|
749
|
+
return { deleted: true };
|
|
750
|
+
});
|
|
751
|
+
rmSync(nodeDir(nodeId), { recursive: true, force: true });
|
|
752
|
+
return result;
|
|
753
|
+
}
|
|
754
|
+
/** Retention sweep: remove TERMINAL nodes (status dead | done | canceled) whose
|
|
755
|
+
* `created` is older than `ttlDays`, bounding the otherwise-unbounded growth of
|
|
756
|
+
* node rows + dirs. Open managed-worktree nodes are retained so their checkout
|
|
757
|
+
* remains owned until `node worktree close`. The edges→nodes FK (`ON DELETE
|
|
758
|
+
* CASCADE`, migration v4) GCs each pruned node's edges automatically; the
|
|
759
|
+
* on-disk `nodes/<id>/` dir is removed too.
|
|
760
|
+
*
|
|
761
|
+
* With `includeStale`, ALSO prunes nominally-live (active | idle) nodes past the
|
|
762
|
+
* TTL whose process is provably gone — `pi_pid` is NULL or no longer alive. This
|
|
763
|
+
* reaps stale roots (a bare `crtr` whose pi died without the row transitioning),
|
|
764
|
+
* which the daemon's supervision never reconciled. A genuinely-running node keeps
|
|
765
|
+
* a live `pi_pid`, so it is protected, as is the CALLER ($CRTR_NODE_ID). Without
|
|
766
|
+
* the flag, active | idle are NEVER touched (the daemon's domain).
|
|
767
|
+
*
|
|
768
|
+
* Row deletes run in ONE transaction, so the sweep is all-or-nothing. Dir
|
|
769
|
+
* removals follow after COMMIT — the fs isn't transactional, and by then
|
|
770
|
+
* the rows are gone, so a re-run never re-finds a half-deleted node. `dryRun`
|
|
771
|
+
* reports the candidate set and deletes NOTHING. */
|
|
772
|
+
export function pruneNodes(opts) {
|
|
773
|
+
const dryRun = opts.dryRun ?? false;
|
|
774
|
+
const includeStale = opts.includeStale ?? false;
|
|
775
|
+
const cutoff = new Date(Date.now() - opts.ttlDays * 86_400_000).toISOString();
|
|
776
|
+
const selfId = process.env['CRTR_NODE_ID'] ?? '';
|
|
777
|
+
const db = openDb();
|
|
778
|
+
const terminal = db
|
|
779
|
+
.prepare(`SELECT node_id, status, created FROM nodes
|
|
780
|
+
WHERE status IN ('dead', 'done', 'canceled') AND created < ?
|
|
781
|
+
ORDER BY created`)
|
|
782
|
+
.all(cutoff).map((r) => ({
|
|
783
|
+
node_id: r['node_id'],
|
|
784
|
+
status: r['status'],
|
|
785
|
+
created: r['created'],
|
|
786
|
+
}));
|
|
787
|
+
// Stale non-terminal sweep (opt-in): active | idle past the TTL whose process
|
|
788
|
+
// is provably gone (pi_pid NULL or not alive). Never the caller itself.
|
|
789
|
+
const stale = !includeStale ? [] : db
|
|
790
|
+
.prepare(`SELECT node_id, status, created, pi_pid FROM nodes
|
|
791
|
+
WHERE status IN ('active', 'idle') AND created < ?
|
|
792
|
+
ORDER BY created`)
|
|
793
|
+
.all(cutoff)
|
|
794
|
+
.filter((r) => {
|
|
795
|
+
if (r['node_id'] === selfId)
|
|
796
|
+
return false;
|
|
797
|
+
const pid = r['pi_pid'];
|
|
798
|
+
return !isPidAlive(pid);
|
|
799
|
+
})
|
|
800
|
+
.map((r) => ({
|
|
801
|
+
node_id: r['node_id'],
|
|
802
|
+
status: r['status'],
|
|
803
|
+
created: r['created'],
|
|
804
|
+
}));
|
|
805
|
+
const candidates = [...terminal, ...stale].filter((node) => !hasOpenManagedWorktree(node.node_id) && !hasLiveFollowUpReceipt(node.node_id));
|
|
806
|
+
if (dryRun || candidates.length === 0)
|
|
807
|
+
return { pruned: candidates, dryRun };
|
|
808
|
+
deletePrunedNodes(candidates);
|
|
809
|
+
return { pruned: candidates, dryRun };
|
|
810
|
+
}
|
|
811
|
+
/** Hard-delete a set of pruned nodes in one transaction (the edges→nodes and
|
|
812
|
+
* anchored-crons FKs cascade their coupled state), followed by best-effort
|
|
813
|
+
* on-disk `nodes/<id>/` removal. Shared by TTL and count pruning so their
|
|
814
|
+
* delete semantics never drift. */
|
|
815
|
+
function deletePrunedNodes(candidates) {
|
|
816
|
+
if (candidates.length === 0)
|
|
817
|
+
return;
|
|
818
|
+
withCanvasWrite((db) => {
|
|
819
|
+
const del = db.prepare('DELETE FROM nodes WHERE node_id = ?');
|
|
820
|
+
for (const c of candidates)
|
|
821
|
+
del.run(c.node_id);
|
|
822
|
+
});
|
|
823
|
+
for (const c of candidates) {
|
|
824
|
+
rmSync(nodeDir(c.node_id), { recursive: true, force: true });
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
/** "Most recent activity" sort key (epoch ms) read CHEAPLY: a `statSync` (no file
|
|
828
|
+
* read, no parse) of the node's `job/telemetry.json` — rewritten on every
|
|
829
|
+
* turn_end at a deterministic path, so it tracks last-message recency without a
|
|
830
|
+
* meta read. Falls back to `created`'s epoch when a node never ran a turn.
|
|
831
|
+
* Mirrors render.ts's `sessionMtime` (the same key the snapshot roster surfaces
|
|
832
|
+
* as `last_activity`). Never throws. */
|
|
833
|
+
function recencyMs(nodeId, created) {
|
|
834
|
+
try {
|
|
835
|
+
const st = statSync(join(jobDir(nodeId), 'telemetry.json'), { throwIfNoEntry: false });
|
|
836
|
+
if (st !== undefined)
|
|
837
|
+
return st.mtimeMs;
|
|
838
|
+
}
|
|
839
|
+
catch {
|
|
840
|
+
/* fall through to created */
|
|
841
|
+
}
|
|
842
|
+
const t = Date.parse(created);
|
|
843
|
+
return Number.isNaN(t) ? 0 : t;
|
|
844
|
+
}
|
|
845
|
+
/** Count-based retention sweep: retain the `maxNodes` MOST-RECENTLY-ACTIVE
|
|
846
|
+
* nodes plus every protected node, so the real retained floor is
|
|
847
|
+
* `max(maxNodes, protectedCount)`. Bounds the otherwise-unbounded growth the
|
|
848
|
+
* TTL sweep can't (a canvas that never crosses the TTL still grows without
|
|
849
|
+
* limit).
|
|
850
|
+
*
|
|
851
|
+
* Protected (never a prune candidate, regardless of recency rank): any
|
|
852
|
+
* non-terminal node — status active|idle — REGARDLESS of `pi_pid` liveness,
|
|
853
|
+
* a node with an open managed worktree, and a node with a LIVE
|
|
854
|
+
* (`armed`/`pending`) follow-up human-work receipt. A crashed-but-non-terminal row
|
|
855
|
+
* (dead pid, status still active/idle) must survive for daemon crash-recovery
|
|
856
|
+
* to resume, an open worktree must retain its node ownership until
|
|
857
|
+
* `node worktree close`, and a live consult receipt's report payload is still
|
|
858
|
+
* needed for delivery (integrated-review Major-2); none of the three is
|
|
859
|
+
* eligible for count-based pruning. The caller ($CRTR_NODE_ID) is also always
|
|
860
|
+
* protected.
|
|
861
|
+
*
|
|
862
|
+
* Algorithm: order ALL nodes by recency DESC (telemetry.json mtime, falling back
|
|
863
|
+
* to `created`); `target = max(maxNodes, protectedCount)`; delete every node
|
|
864
|
+
* ranked beyond `target` (0-indexed rank >= target) that is NOT protected and
|
|
865
|
+
* NOT the caller. Retained = all protected + the newest terminal nodes up to
|
|
866
|
+
* `target`.
|
|
867
|
+
*
|
|
868
|
+
* Mirrors {@link pruneNodes} exactly for the delete (shared `deletePrunedNodes`:
|
|
869
|
+
* transactioned row sweep + FK edge cascade + best-effort dir removal). `dryRun`
|
|
870
|
+
* reports the candidate set and deletes NOTHING. */
|
|
871
|
+
export function pruneToLimit(opts) {
|
|
872
|
+
const dryRun = opts.dryRun ?? false;
|
|
873
|
+
const selfId = process.env['CRTR_NODE_ID'] ?? '';
|
|
874
|
+
const rows = listNodes();
|
|
875
|
+
// Rank ALL nodes by recency DESC, tagging protection as we go. Protection is
|
|
876
|
+
// status-only (active|idle) — NOT gated on pi_pid liveness — so a node whose
|
|
877
|
+
// broker crashed but whose row is still non-terminal stays protected for
|
|
878
|
+
// crash-recovery instead of being hard-deleted here.
|
|
879
|
+
const ranked = rows
|
|
880
|
+
.map((r) => ({
|
|
881
|
+
node_id: r.node_id,
|
|
882
|
+
status: r.status,
|
|
883
|
+
created: r.created,
|
|
884
|
+
recency: recencyMs(r.node_id, r.created),
|
|
885
|
+
protected: r.status === 'active' || r.status === 'idle' || hasOpenManagedWorktree(r.node_id) || hasLiveFollowUpReceipt(r.node_id),
|
|
886
|
+
}))
|
|
887
|
+
.sort((a, b) => b.recency - a.recency);
|
|
888
|
+
const protectedCount = ranked.filter((r) => r.protected).length;
|
|
889
|
+
const target = Math.max(opts.maxNodes, protectedCount);
|
|
890
|
+
const candidates = ranked
|
|
891
|
+
.filter((r, rank) => rank >= target && !r.protected && r.node_id !== selfId)
|
|
892
|
+
.map((r) => ({ node_id: r.node_id, status: r.status, created: r.created }));
|
|
893
|
+
if (dryRun || candidates.length === 0)
|
|
894
|
+
return { pruned: candidates, dryRun };
|
|
895
|
+
deletePrunedNodes(candidates);
|
|
896
|
+
return { pruned: candidates, dryRun };
|
|
897
|
+
}
|