@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,944 @@
|
|
|
1
|
+
// src/daemon/cron-run.ts — the daemon-owned cron run executor: subprocess
|
|
2
|
+
// spawn/capture/timeout/lease mechanics for due `crons` rows (the cron-spec
|
|
3
|
+
// scheduler) PLUS the full settle surface — output dispositions, delivery
|
|
4
|
+
// sinks, overlap policies, expiry, and failure escalation.
|
|
5
|
+
//
|
|
6
|
+
// A cron RUN is the enactment — there is no separate action to fire —
|
|
7
|
+
// so a recurrence advances `fire_at` BEFORE the run (crash-safe: a crash
|
|
8
|
+
// mid-run never re-fires a settled slot) while a one-shot row is deleted only
|
|
9
|
+
// AFTER its run settles, so the run can still be observed while in flight.
|
|
10
|
+
//
|
|
11
|
+
// SETTLE RULES (the cron spec's output disposition + failure sections):
|
|
12
|
+
// silent — record only, never deliver, never escalate.
|
|
13
|
+
// on-failure — (default) no success delivery; a failure pauses the cron and
|
|
14
|
+
// spawns a terminal escalation node to deal with it.
|
|
15
|
+
// always — stdout becomes a delivery every run, at the cron's tier.
|
|
16
|
+
// on-change — deliver only when stdout's hash differs from the previous
|
|
17
|
+
// run's (including the very first run); the hash is updated
|
|
18
|
+
// after EVERY settled run, delivered or not.
|
|
19
|
+
// A FAILURE is: timeout kill, process error, nonzero exit, or an undeliverable
|
|
20
|
+
// sink (target node gone/terminal, spawn threw, human submit threw). Every
|
|
21
|
+
// disposition except `silent` escalates: pause + spawn — pausing is the
|
|
22
|
+
// natural dedup (a paused row never refires). An out-of-band run (`cron run`)
|
|
23
|
+
// never escalates or pauses: the invoker sees the result directly.
|
|
24
|
+
//
|
|
25
|
+
// Fire-and-forget contract: runDueCrons
|
|
26
|
+
// NEVER awaits a subprocess in the tick — it kicks each child off
|
|
27
|
+
// synchronously and returns one settlement promise per admitted run, each
|
|
28
|
+
// resolving only after its subprocess has closed and its durable
|
|
29
|
+
// record/lease/consume transition is written. The daemon tick registers those
|
|
30
|
+
// promises for graceful-teardown drain but never blocks on a slow run.
|
|
31
|
+
import { spawn } from 'node:child_process';
|
|
32
|
+
import { createHash, randomBytes, randomUUID } from 'node:crypto';
|
|
33
|
+
import { mkdirSync } from 'node:fs';
|
|
34
|
+
import { join } from 'node:path';
|
|
35
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
36
|
+
import { notifyDeck, submitDeck } from '@crouton-kit/humanloop';
|
|
37
|
+
import { dueClockCrons, dueOverlapCrons, expiredIdleCrons, runningCrons, acquireCronRunLease, releaseCronRunLease, recordCronRun, listCronRuns, advanceCron, consumeCron, cancelCron, killLeasedCronRun, verifyLeasedCronRun, getCron, setCronState, setCronLastOutputHash, } from '../core/canvas/crons.js';
|
|
38
|
+
import { getNode } from '../core/canvas/canvas.js';
|
|
39
|
+
import { fullName } from '../core/canvas/labels.js';
|
|
40
|
+
import { nodeDir } from '../core/canvas/paths.js';
|
|
41
|
+
import { killProcessGroup } from '../core/canvas/pid.js';
|
|
42
|
+
import { appendInbox } from '../core/feed/inbox.js';
|
|
43
|
+
import { atomicWriteJson } from '../core/fs-utils.js';
|
|
44
|
+
import { emitEvent } from '../core/events/emit.js';
|
|
45
|
+
import { loadProfileManifest } from '../core/profiles/manifest.js';
|
|
46
|
+
import { hasNoNaturalCycle } from '../core/runtime/revive-all.js';
|
|
47
|
+
import { spawnChild } from '../core/runtime/spawn.js';
|
|
48
|
+
import { cronWakeOrigin } from '../core/runtime/bearings.js';
|
|
49
|
+
import { nextSlotAfter, cadenceDisplay } from '../core/wake.js';
|
|
50
|
+
import { buildOperationalEnvBase } from '../core/runtime/spawn-env.js';
|
|
51
|
+
import { parseSink } from './cron-sink.js';
|
|
52
|
+
import { readProfileEnvVars } from '../core/profiles/env-store.js';
|
|
53
|
+
import { registerCrouterRoot } from '../commands/human/shared.js';
|
|
54
|
+
/** Output head caps for the run log (spec: "capped, e.g. 4KB"). */
|
|
55
|
+
export const CRON_OUTPUT_HEAD_BYTES = 4 * 1024;
|
|
56
|
+
/** A byte-capped capture of one output stream's head. Bytes are buffered and
|
|
57
|
+
* decoded exactly once, at the end — decoding per chunk both mis-measured the
|
|
58
|
+
* cap (UTF-16 code units, not bytes) and corrupted any multi-byte sequence
|
|
59
|
+
* that straddled a chunk boundary. Truncation is MARKED, never silent: a
|
|
60
|
+
* clipped body reads as complete output to whoever receives the delivery. */
|
|
61
|
+
function newHeadCapture() {
|
|
62
|
+
const chunks = [];
|
|
63
|
+
let bytes = 0;
|
|
64
|
+
let truncated = false;
|
|
65
|
+
return {
|
|
66
|
+
take(chunk) {
|
|
67
|
+
const room = CRON_OUTPUT_HEAD_BYTES - bytes;
|
|
68
|
+
if (room <= 0) {
|
|
69
|
+
truncated = true;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (chunk.length > room) {
|
|
73
|
+
chunks.push(chunk.subarray(0, room));
|
|
74
|
+
bytes = CRON_OUTPUT_HEAD_BYTES;
|
|
75
|
+
truncated = true;
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
chunks.push(chunk);
|
|
79
|
+
bytes += chunk.length;
|
|
80
|
+
},
|
|
81
|
+
decode() {
|
|
82
|
+
const text = Buffer.concat(chunks).toString('utf8');
|
|
83
|
+
return truncated ? `${text}\n[… output truncated at ${CRON_OUTPUT_HEAD_BYTES} bytes]` : text;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/** Bound between the run-timeout SIGTERM and a forced SIGKILL escalation, so
|
|
88
|
+
* a signal-trapping command cannot stall teardown's detached drain. */
|
|
89
|
+
const CRON_KILL_GRACE_MS = 2000;
|
|
90
|
+
/** Poll interval while waiting for a SIGTERMed stale-lease run to actually die
|
|
91
|
+
* (each probe is a `ps` call, so this is deliberately coarse). */
|
|
92
|
+
const CRON_DEATH_POLL_MS = 250;
|
|
93
|
+
/** sha256 of empty stdout — the change-detection hash a run that produced no
|
|
94
|
+
* output carries (a failed spawn, a recovered stale lease). */
|
|
95
|
+
const EMPTY_STDOUT_SHA256 = createHash('sha256').update('').digest('hex');
|
|
96
|
+
/** Lead of a `cron_runs.delivered` string written by the overlap=skip pass.
|
|
97
|
+
* Matched (not just written) — see `latestRunIsSkip`. */
|
|
98
|
+
const SKIP_MARKER = 'skipped (overlap=skip)';
|
|
99
|
+
/** One id per daemon process instance — distinguishes THIS process's own
|
|
100
|
+
* in-flight run leases from a stale 'running' row a prior (crashed/restarted)
|
|
101
|
+
* daemon left behind. */
|
|
102
|
+
export const cronDaemonInstanceId = randomUUID();
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Broker-capacity admission — the fleet-safety invariant the retired clock pass
|
|
105
|
+
// enforced (it reserved capacity before a due fresh revive and left an
|
|
106
|
+
// unadmitted one due for the next poll, so a fleet of simultaneous alarms was
|
|
107
|
+
// never stampeded). A cron's enactment is an opaque shell command, so the only
|
|
108
|
+
// structural signals the daemon has are the armed sink and the crtr verb the
|
|
109
|
+
// command invokes. Both misreadings are safe: a false negative behaves exactly
|
|
110
|
+
// as an ungated run does today, and a false positive only DEFERS one poll while
|
|
111
|
+
// the fleet is already at its hard cap.
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
/** crtr verbs that launch a broker: a node revive (single or graph-wide) and a
|
|
114
|
+
* node birth. `node message send` is deliberately absent — a message is not a
|
|
115
|
+
* launch (its wake rides the daemon's own capacity-gated inbox pass) — EXCEPT
|
|
116
|
+
* in its `--fresh` form, which is a revive wearing the message verb. */
|
|
117
|
+
const NODE_LAUNCHING_COMMAND = /\bcrtr\b[^\n]*?\bnode\s+lifecycle\s+revive\b|\bcrtr\b[^\n]*?\bnode\s+new\b|\bcrtr\b[^\n]*?\bcanvas\s+revive\b|\bcrtr\b[^\n]*?\bnode\s+message\s+send\b[^\n]*?\s--fresh\b/;
|
|
118
|
+
/** Will this cron's run consume broker capacity? True when its armed sink
|
|
119
|
+
* births a node, or its command invokes a node-launching crtr verb. A cron
|
|
120
|
+
* that merely runs a shell command or sends a message reads false and is
|
|
121
|
+
* never gated. */
|
|
122
|
+
export function cronLaunchesNode(c) {
|
|
123
|
+
if (parseSink(c.sink)?.kind === 'spawn')
|
|
124
|
+
return true;
|
|
125
|
+
return NODE_LAUNCHING_COMMAND.test(c.command);
|
|
126
|
+
}
|
|
127
|
+
const liveRuns = new Map();
|
|
128
|
+
/** The cron's profile, re-validated at delivery time and returned in canonical
|
|
129
|
+
* id form when its manifest still resolves, else null (root fallback per spec). */
|
|
130
|
+
function resolveLiveProfile(c) {
|
|
131
|
+
if (c.profile == null)
|
|
132
|
+
return null;
|
|
133
|
+
try {
|
|
134
|
+
return loadProfileManifest(c.profile).profileId;
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// Delivery sinks
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
/** Deliver stdout to a living node's inbox. Throws when the target is gone or
|
|
144
|
+
* has no natural cycle ahead (finalized/terminal-done) — an undeliverable
|
|
145
|
+
* sink is a FAILURE per spec, never a silent drop. */
|
|
146
|
+
function deliverNodeSink(c, target, stdout) {
|
|
147
|
+
const meta = getNode(target);
|
|
148
|
+
if (meta === null)
|
|
149
|
+
throw new Error(`node sink ${target} is gone`);
|
|
150
|
+
if (hasNoNaturalCycle(meta)) {
|
|
151
|
+
throw new Error(`node sink ${target} has no natural cycle ahead (done or finalized)`);
|
|
152
|
+
}
|
|
153
|
+
const from = c.created_by != null && getNode(c.created_by) !== null ? c.created_by : null;
|
|
154
|
+
appendInbox(target, {
|
|
155
|
+
from,
|
|
156
|
+
tier: c.tier,
|
|
157
|
+
kind: 'message',
|
|
158
|
+
label: `⏰ cron ${c.name}`,
|
|
159
|
+
data: { body: stdout },
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/** Birth a fresh node with stdout as its kickoff (the recommended sink for
|
|
163
|
+
* jobs meant to outlive their creator). Returns the newborn's node id. */
|
|
164
|
+
async function deliverSpawnSink(c, kind, stdout) {
|
|
165
|
+
const creatorAlive = c.created_by != null && getNode(c.created_by) !== null;
|
|
166
|
+
const prompt = [
|
|
167
|
+
`Scheduled cron "${c.name}" (${c.cron_id}) fired and delivered its output to you as your kickoff.`,
|
|
168
|
+
'',
|
|
169
|
+
'## Command output',
|
|
170
|
+
'',
|
|
171
|
+
stdout,
|
|
172
|
+
].join('\n');
|
|
173
|
+
const res = await spawnChild({
|
|
174
|
+
kind,
|
|
175
|
+
cwd: c.cwd,
|
|
176
|
+
prompt,
|
|
177
|
+
// Creator alive → a managed terminal child of it. Creator gone → a
|
|
178
|
+
// PARENTLESS TERMINAL node: nobody to report to, but it still owes a final
|
|
179
|
+
// so it reaps, and it is never brought forefront. A resident root here
|
|
180
|
+
// would leave an hourly cron accreting ~24 permanently-live nodes a day
|
|
181
|
+
// (the count-based prune never deletes live nodes) and would steal the
|
|
182
|
+
// human's tmux focus on every unattended fire.
|
|
183
|
+
...(creatorAlive ? { parent: c.created_by } : { root: true, rootLifecycle: 'terminal' }),
|
|
184
|
+
readiness: 'launch',
|
|
185
|
+
profile: resolveLiveProfile(c),
|
|
186
|
+
wakeOrigin: cronWakeOrigin(c, 'node_birth'),
|
|
187
|
+
});
|
|
188
|
+
return res.node.node_id;
|
|
189
|
+
}
|
|
190
|
+
/** Deliver stdout through humanloop as a durable notify deck (fire-and-forget
|
|
191
|
+
* inbox state — jobs whose output is a person's call). Mirrors `crtr human
|
|
192
|
+
* notify` minus the CLI-env source stamp: the deck names the cron instead. */
|
|
193
|
+
function deliverHumanSink(c, stdout) {
|
|
194
|
+
const id = `nfy-${randomBytes(4).toString('hex')}`;
|
|
195
|
+
const idir = nodeDir(id);
|
|
196
|
+
mkdirSync(idir, { recursive: true });
|
|
197
|
+
const rc = { mode: 'notify' };
|
|
198
|
+
atomicWriteJson(join(idir, 'run.json'), rc);
|
|
199
|
+
let deck = notifyDeck(`⏰ cron ${c.name}`, {
|
|
200
|
+
subtitle: `Scheduled cron "${c.name}" delivered output for your attention.`,
|
|
201
|
+
body: stdout,
|
|
202
|
+
});
|
|
203
|
+
deck = { ...deck, source: { sessionName: `cron ${c.name} (${c.cron_id})` } };
|
|
204
|
+
submitDeck({ root: registerCrouterRoot(), id, deck });
|
|
205
|
+
}
|
|
206
|
+
/** Route stdout to the cron's armed sink. Returns the delivered string on
|
|
207
|
+
* success; throws on an undeliverable sink (the caller's failure path). */
|
|
208
|
+
async function deliverToSink(c, stdout) {
|
|
209
|
+
const sink = parseSink(c.sink);
|
|
210
|
+
if (sink === null)
|
|
211
|
+
return 'no sink armed — nothing delivered';
|
|
212
|
+
if (sink.kind === 'node') {
|
|
213
|
+
deliverNodeSink(c, sink.node, stdout);
|
|
214
|
+
return `delivered: node ${sink.node}`;
|
|
215
|
+
}
|
|
216
|
+
if (sink.kind === 'spawn') {
|
|
217
|
+
const nodeId = await deliverSpawnSink(c, sink.spawn, stdout);
|
|
218
|
+
return `delivered: spawned ${nodeId}`;
|
|
219
|
+
}
|
|
220
|
+
deliverHumanSink(c, stdout);
|
|
221
|
+
return 'delivered: human notify';
|
|
222
|
+
}
|
|
223
|
+
function failureSummary(ctx, deliveryFailure) {
|
|
224
|
+
if (deliveryFailure !== null)
|
|
225
|
+
return deliveryFailure;
|
|
226
|
+
if (ctx.timedOut)
|
|
227
|
+
return `run timed out after ${ctx.runTimeoutS}s (killed; recorded exit -1)`;
|
|
228
|
+
if (ctx.processErrorMessage !== null)
|
|
229
|
+
return `run process error: ${ctx.processErrorMessage}`;
|
|
230
|
+
return `command exited ${ctx.exitCode ?? '(no exit observed)'}`;
|
|
231
|
+
}
|
|
232
|
+
/** The escalation node's kickoff: the cron's identity/config, this failure,
|
|
233
|
+
* the run-log ring, the creating-node reference, and a mandate that names its
|
|
234
|
+
* actual options (resume after verifying / cancel / ask the human). */
|
|
235
|
+
function buildEscalationKickoff(c, ctx, deliveryFailure) {
|
|
236
|
+
const creator = c.created_by != null ? getNode(c.created_by) : null;
|
|
237
|
+
const creatorLine = c.created_by == null
|
|
238
|
+
? 'created by: (no creating node recorded)'
|
|
239
|
+
: creator !== null
|
|
240
|
+
? `created by: node ${c.created_by} ("${fullName(creator)}") — still on the canvas; consider telling it what happened`
|
|
241
|
+
: `created by: node ${c.created_by} (now gone)`;
|
|
242
|
+
const schedule = c.recur != null ? `every ${cadenceDisplay(c.recur)}` : `one-shot at ${c.fire_at}`;
|
|
243
|
+
const priorRuns = listCronRuns(c.cron_id)
|
|
244
|
+
.slice(0, 10)
|
|
245
|
+
.map((r) => {
|
|
246
|
+
const exit = r.exit_code === null ? 'no exit' : `exit ${r.exit_code}`;
|
|
247
|
+
const head = (r.stderr_head ?? r.stdout_head ?? '').split('\n')[0]?.slice(0, 120) ?? '';
|
|
248
|
+
return `- ${r.started} — ${exit}, ${r.duration_ms}ms — ${r.delivered ?? ''}${head !== '' ? ` — ${head}` : ''}`;
|
|
249
|
+
});
|
|
250
|
+
return [
|
|
251
|
+
`A scheduled cron FAILED and has paused itself. You were spawned to deal with it.`,
|
|
252
|
+
'',
|
|
253
|
+
`- cron: "${c.name}" (${c.cron_id})`,
|
|
254
|
+
`- schedule: ${schedule}${c.tz != null ? ` (tz ${c.tz})` : ''}`,
|
|
255
|
+
`- context: cwd ${c.cwd}${c.profile != null ? `, profile ${c.profile}` : ''}`,
|
|
256
|
+
`- ${creatorLine}`,
|
|
257
|
+
`- this failure: ${failureSummary(ctx, deliveryFailure)}`,
|
|
258
|
+
'',
|
|
259
|
+
'## The command',
|
|
260
|
+
'',
|
|
261
|
+
'```bash',
|
|
262
|
+
c.command,
|
|
263
|
+
'```',
|
|
264
|
+
'',
|
|
265
|
+
'## This run',
|
|
266
|
+
'',
|
|
267
|
+
`- exit: ${ctx.timedOut ? '-1 (timeout)' : String(ctx.exitCode)}`,
|
|
268
|
+
`- stdout (head): ${ctx.stdoutHead === '' ? '(empty)' : ''}`,
|
|
269
|
+
...(ctx.stdoutHead !== '' ? ['```', ctx.stdoutHead, '```'] : []),
|
|
270
|
+
`- stderr (head): ${ctx.stderrHead === '' ? '(empty)' : ''}`,
|
|
271
|
+
...(ctx.stderrHead !== '' ? ['```', ctx.stderrHead, '```'] : []),
|
|
272
|
+
'',
|
|
273
|
+
'## Recent runs (most recent first, this failure not yet recorded)',
|
|
274
|
+
'',
|
|
275
|
+
...(priorRuns.length > 0 ? priorRuns : ['(no prior runs recorded)']),
|
|
276
|
+
'',
|
|
277
|
+
'## Your mandate',
|
|
278
|
+
'',
|
|
279
|
+
`Diagnose why it failed and decide what to do:`,
|
|
280
|
+
`- Transient or fixable: fix the environment/command context, verify with \`crtr cron run ${c.cron_id}\` (fires now, out of band, shows you the result), then \`crtr cron resume ${c.cron_id}\` to re-arm it.`,
|
|
281
|
+
`- Obsolete: \`crtr cron cancel ${c.cron_id}\`.`,
|
|
282
|
+
`- The user's call (or the fix needs a change you cannot make): \`crtr human ask\`.`,
|
|
283
|
+
'',
|
|
284
|
+
'The cron stays paused until someone resumes it — nothing refires while you work.',
|
|
285
|
+
].join('\n');
|
|
286
|
+
}
|
|
287
|
+
/** Pause the cron and spawn the escalation node in the cron's originating
|
|
288
|
+
* profile (root fallback). Returns the run-log `delivered` string. Never
|
|
289
|
+
* throws: an escalation spawn failure is recorded and logged, the pause
|
|
290
|
+
* stands (the row must not keep refiring a broken command). */
|
|
291
|
+
async function escalateFailure(c, ctx, deliveryFailure) {
|
|
292
|
+
setCronState(c.cron_id, 'paused');
|
|
293
|
+
const creatorAlive = c.created_by != null && getNode(c.created_by) !== null;
|
|
294
|
+
try {
|
|
295
|
+
const res = await spawnChild({
|
|
296
|
+
kind: 'general',
|
|
297
|
+
cwd: c.cwd,
|
|
298
|
+
prompt: buildEscalationKickoff(c, ctx, deliveryFailure),
|
|
299
|
+
// The spec's word is TERMINAL: a node that deals with this failure and
|
|
300
|
+
// reaps. With the creator gone there is nobody to parent it, but
|
|
301
|
+
// parentless must not mean resident-and-forefront — see deliverSpawnSink.
|
|
302
|
+
...(creatorAlive ? { parent: c.created_by } : { root: true, rootLifecycle: 'terminal' }),
|
|
303
|
+
readiness: 'launch',
|
|
304
|
+
profile: resolveLiveProfile(c),
|
|
305
|
+
wakeOrigin: cronWakeOrigin(c, 'node_birth'),
|
|
306
|
+
});
|
|
307
|
+
emitEvent({
|
|
308
|
+
level: 'info',
|
|
309
|
+
event: 'cron.failure.escalated',
|
|
310
|
+
fields: { cron_id: c.cron_id, name: c.name, escalation_node: res.node.node_id },
|
|
311
|
+
});
|
|
312
|
+
return `failure: cron paused, escalation node ${res.node.node_id} spawned`;
|
|
313
|
+
}
|
|
314
|
+
catch (err) {
|
|
315
|
+
emitEvent({
|
|
316
|
+
level: 'error',
|
|
317
|
+
event: 'cron.escalation.spawn_failed',
|
|
318
|
+
error: err,
|
|
319
|
+
fields: { cron_id: c.cron_id, name: c.name },
|
|
320
|
+
});
|
|
321
|
+
return `failure: cron paused; escalation spawn failed: ${err.message}`;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
/** Apply the cron's output disposition to one settled run: hash bookkeeping,
|
|
325
|
+
* sink delivery, and the failure path. `outOfBand` runs deliver but never
|
|
326
|
+
* pause/escalate — the invoker sees the result directly. */
|
|
327
|
+
async function disposeSettledRun(c, ctx, outOfBand) {
|
|
328
|
+
const prefix = outOfBand ? 'out-of-band: ' : '';
|
|
329
|
+
// Re-read the row: last_output_hash/state must be current, and a cron
|
|
330
|
+
// canceled mid-run must not deliver (its record no-ops anyway).
|
|
331
|
+
const fresh = getCron(c.cron_id);
|
|
332
|
+
if (fresh === null)
|
|
333
|
+
return { delivered: `${prefix}cron canceled mid-run — nothing delivered`, paused: false };
|
|
334
|
+
const failed = ctx.timedOut || ctx.processErrorMessage !== null || ctx.exitCode !== 0;
|
|
335
|
+
// on-change bookkeeping happens for every SCHEDULED settled run (delivered or
|
|
336
|
+
// not, failed or not) so the next comparison is against the latest
|
|
337
|
+
// observation. An out-of-band run COMPARES but never WRITES: `cron run` is a
|
|
338
|
+
// verification, and a baseline it rewrote would make the next scheduled run
|
|
339
|
+
// report "unchanged" and skip a delivery the user should have received.
|
|
340
|
+
let changed = true;
|
|
341
|
+
if (fresh.on_output === 'on-change') {
|
|
342
|
+
changed = fresh.last_output_hash !== ctx.stdoutSha256;
|
|
343
|
+
if (!outOfBand)
|
|
344
|
+
setCronLastOutputHash(c.cron_id, ctx.stdoutSha256);
|
|
345
|
+
}
|
|
346
|
+
if (failed) {
|
|
347
|
+
if (fresh.on_output === 'silent')
|
|
348
|
+
return { delivered: `${prefix}silent`, paused: false };
|
|
349
|
+
if (outOfBand)
|
|
350
|
+
return { delivered: `out-of-band: ${failureSummary(ctx, null)} — not escalated`, paused: false };
|
|
351
|
+
return { delivered: await escalateFailure(fresh, ctx, null), paused: true };
|
|
352
|
+
}
|
|
353
|
+
switch (fresh.on_output) {
|
|
354
|
+
case 'silent':
|
|
355
|
+
return { delivered: `${prefix}silent`, paused: false };
|
|
356
|
+
case 'on-failure':
|
|
357
|
+
return { delivered: `${prefix}ok — nothing to deliver (on-failure)`, paused: false };
|
|
358
|
+
case 'on-change':
|
|
359
|
+
if (!changed)
|
|
360
|
+
return { delivered: `${prefix}unchanged — not delivered (on-change)`, paused: false };
|
|
361
|
+
return deliverOrEscalate(fresh, ctx, outOfBand, prefix);
|
|
362
|
+
case 'always':
|
|
363
|
+
return deliverOrEscalate(fresh, ctx, outOfBand, prefix);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/** The shared delivering tail of `always` and a CHANGED `on-change`: push
|
|
367
|
+
* stdout to the armed sink, or take the failure path when the sink is
|
|
368
|
+
* undeliverable. (The two cases used to share a commented, lint-suppressed
|
|
369
|
+
* switch fallthrough.) */
|
|
370
|
+
async function deliverOrEscalate(c, ctx, outOfBand, prefix) {
|
|
371
|
+
if (ctx.stdoutHead.trim() === '') {
|
|
372
|
+
return { delivered: `${prefix}empty stdout — nothing delivered`, paused: false };
|
|
373
|
+
}
|
|
374
|
+
try {
|
|
375
|
+
return { delivered: `${prefix}${await deliverToSink(c, ctx.stdoutHead)}`, paused: false };
|
|
376
|
+
}
|
|
377
|
+
catch (err) {
|
|
378
|
+
const why = `delivery failed: ${err.message}`;
|
|
379
|
+
if (outOfBand)
|
|
380
|
+
return { delivered: `out-of-band: ${why} — not escalated`, paused: false };
|
|
381
|
+
return { delivered: await escalateFailure(c, ctx, why), paused: true };
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
// ---------------------------------------------------------------------------
|
|
385
|
+
// Stale-lease recovery
|
|
386
|
+
// ---------------------------------------------------------------------------
|
|
387
|
+
/** Recover stale 'running' rows left by a PRIOR daemon instance: a pid that is
|
|
388
|
+
* not VERIFIABLY still the process this lease launched resets straight to
|
|
389
|
+
* idle; a confirmed-live process group past its own run_timeout_s is killed
|
|
390
|
+
* and settled as a timeout run through the SAME failure path a live timeout
|
|
391
|
+
* takes (pause + escalation unless silent). Rows this SAME instance owns are
|
|
392
|
+
* genuinely in flight and left alone.
|
|
393
|
+
*
|
|
394
|
+
* The verification is `verifyLeasedCronRun`, not `isPidAlive`, and it is
|
|
395
|
+
* FAIL-CLOSED: this row was written by a daemon life that has since ended, so
|
|
396
|
+
* after a host reboot its `run_pid` names a slot in a dead kernel's pid space
|
|
397
|
+
* that the OS has probably recycled, and the timeout comparison below is
|
|
398
|
+
* trivially satisfied by any downtime. Liveness alone would therefore SIGTERM
|
|
399
|
+
* a stranger's process group. Only a matching launch-time identity authorizes
|
|
400
|
+
* the signal; everything else releases the lease. */
|
|
401
|
+
export function recoverStaleCronLeases(now, options = {}) {
|
|
402
|
+
for (const c of runningCrons()) {
|
|
403
|
+
if (c.run_lease_owner === cronDaemonInstanceId)
|
|
404
|
+
continue;
|
|
405
|
+
if (!verifyLeasedCronRun(c)) {
|
|
406
|
+
settleCrashedRun(c, now, options);
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const startedAtMs = c.run_started_at != null ? new Date(c.run_started_at).getTime() : now;
|
|
410
|
+
if (now - startedAtMs < c.run_timeout_s * 1000)
|
|
411
|
+
continue; // within its own window
|
|
412
|
+
if (!killLeasedCronRun(c)) {
|
|
413
|
+
// The process exited (or was re-identified) between the two probes: there
|
|
414
|
+
// is nothing to signal, so settle it as the unobserved run it now is.
|
|
415
|
+
settleCrashedRun(c, now, options);
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
const ctx = {
|
|
419
|
+
runId: randomUUID(),
|
|
420
|
+
startedAtIso: c.run_started_at ?? new Date(now).toISOString(),
|
|
421
|
+
exitCode: -1,
|
|
422
|
+
timedOut: true,
|
|
423
|
+
runTimeoutS: c.run_timeout_s,
|
|
424
|
+
processErrorMessage: null,
|
|
425
|
+
stdoutHead: '',
|
|
426
|
+
stdoutSha256: EMPTY_STDOUT_SHA256,
|
|
427
|
+
stderrHead: `run timed out after ${c.run_timeout_s}s (recovered stale lease from a prior daemon instance)`,
|
|
428
|
+
};
|
|
429
|
+
const settlement = (async () => {
|
|
430
|
+
await awaitLeasedRunDeath(c);
|
|
431
|
+
const disposition = await disposeSettledRun(c, ctx, false);
|
|
432
|
+
recordCronRun({
|
|
433
|
+
run_id: ctx.runId,
|
|
434
|
+
cron_id: c.cron_id,
|
|
435
|
+
started: ctx.startedAtIso,
|
|
436
|
+
finished: new Date(now).toISOString(),
|
|
437
|
+
duration_ms: now - startedAtMs,
|
|
438
|
+
exit_code: -1,
|
|
439
|
+
stdout_head: null,
|
|
440
|
+
stderr_head: ctx.stderrHead,
|
|
441
|
+
delivered: disposition.delivered,
|
|
442
|
+
});
|
|
443
|
+
releaseCronRunLease(c.cron_id);
|
|
444
|
+
if (c.recur == null && !disposition.paused)
|
|
445
|
+
consumeCron(c.cron_id);
|
|
446
|
+
})();
|
|
447
|
+
options.register?.(settlement);
|
|
448
|
+
void settlement.catch((err) => {
|
|
449
|
+
emitEvent({ level: 'error', event: 'cron.stale_lease.settle_failed', error: err, fields: { cron_id: c.cron_id } });
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
/** Wait for a SIGTERMed stale-lease run to actually die, escalating to SIGKILL
|
|
454
|
+
* if it does not — the same bound `killWithEscalation` gives a live timeout.
|
|
455
|
+
* Recovery used to record the run as finished the instant it signaled, while a
|
|
456
|
+
* signal-trapping command was still running and still producing side effects. */
|
|
457
|
+
async function awaitLeasedRunDeath(c) {
|
|
458
|
+
const deadline = Date.now() + CRON_KILL_GRACE_MS;
|
|
459
|
+
while (Date.now() < deadline) {
|
|
460
|
+
await delay(CRON_DEATH_POLL_MS);
|
|
461
|
+
if (!verifyLeasedCronRun(c))
|
|
462
|
+
return; // gone
|
|
463
|
+
}
|
|
464
|
+
killLeasedCronRun(c, 'SIGKILL');
|
|
465
|
+
}
|
|
466
|
+
/** Settle a stale lease whose process can no longer be observed: the daemon
|
|
467
|
+
* life that owned this run ended (SIGKILL, host reboot) and nothing recorded
|
|
468
|
+
* the outcome. Releasing the lease — all this used to do — is wrong twice.
|
|
469
|
+
*
|
|
470
|
+
* 1. The run must leave a RECORD. The run log's whole justification is "it
|
|
471
|
+
* silently stopped working Tuesday"; a hole exactly where the crash
|
|
472
|
+
* happened is the one gap it cannot afford.
|
|
473
|
+
* 2. A ONE-SHOT must not RE-FIRE. A recurrence advanced `fire_at` before its
|
|
474
|
+
* run, so releasing it to idle costs at most a missed slot. A one-shot's
|
|
475
|
+
* `fire_at` is still past-due and it is deleted only after a settle that
|
|
476
|
+
* never came — so releasing it re-runs a command whose real-world effect
|
|
477
|
+
* (post the report, send the money, open the PR) may already have completed
|
|
478
|
+
* in full. It is PAUSED instead (the same dedup the failure path uses: a
|
|
479
|
+
* paused row is never due) and escalated, so a node decides whether the
|
|
480
|
+
* effect landed — `cron run` to redo it, `cron cancel` to drop it.
|
|
481
|
+
*
|
|
482
|
+
* A `silent` cron pauses without an escalation node: silent means record only,
|
|
483
|
+
* never deliver, never escalate. */
|
|
484
|
+
function settleCrashedRun(c, now, options) {
|
|
485
|
+
const oneShot = c.recur == null;
|
|
486
|
+
const startedAtMs = c.run_started_at != null ? new Date(c.run_started_at).getTime() : now;
|
|
487
|
+
const why = 'the daemon life that owned this run ended before it settled — the process is gone and its outcome was never observed';
|
|
488
|
+
const ctx = {
|
|
489
|
+
runId: randomUUID(),
|
|
490
|
+
startedAtIso: c.run_started_at ?? new Date(now).toISOString(),
|
|
491
|
+
exitCode: null,
|
|
492
|
+
timedOut: false,
|
|
493
|
+
runTimeoutS: c.run_timeout_s,
|
|
494
|
+
processErrorMessage: why,
|
|
495
|
+
stdoutHead: '',
|
|
496
|
+
stdoutSha256: EMPTY_STDOUT_SHA256,
|
|
497
|
+
stderrHead: `run outcome unobserved: ${why}`,
|
|
498
|
+
};
|
|
499
|
+
const settlement = (async () => {
|
|
500
|
+
let delivered = `crashed: ${why}${oneShot ? '' : ' — the next occurrence is unaffected'}`;
|
|
501
|
+
if (oneShot) {
|
|
502
|
+
// Stop the re-fire FIRST, so even a throwing escalation cannot leave the
|
|
503
|
+
// row active with a past-due fire_at. (escalateFailure pauses too; the
|
|
504
|
+
// second write is a harmless no-op.)
|
|
505
|
+
setCronState(c.cron_id, 'paused');
|
|
506
|
+
delivered =
|
|
507
|
+
c.on_output === 'silent'
|
|
508
|
+
? `crashed: ${why} — one-shot paused, not re-fired (silent: not escalated)`
|
|
509
|
+
: `crashed one-shot: ${await escalateFailure(c, ctx, crashedOneShotSummary(why))}`;
|
|
510
|
+
}
|
|
511
|
+
recordCronRun({
|
|
512
|
+
run_id: ctx.runId,
|
|
513
|
+
cron_id: c.cron_id,
|
|
514
|
+
started: ctx.startedAtIso,
|
|
515
|
+
finished: new Date(now).toISOString(),
|
|
516
|
+
duration_ms: Math.max(0, now - startedAtMs),
|
|
517
|
+
exit_code: null,
|
|
518
|
+
stdout_head: null,
|
|
519
|
+
stderr_head: ctx.stderrHead,
|
|
520
|
+
delivered,
|
|
521
|
+
});
|
|
522
|
+
releaseCronRunLease(c.cron_id);
|
|
523
|
+
emitEvent({
|
|
524
|
+
level: 'warn',
|
|
525
|
+
event: 'cron.run.unobserved',
|
|
526
|
+
fields: { cron_id: c.cron_id, name: c.name, one_shot: oneShot },
|
|
527
|
+
});
|
|
528
|
+
})();
|
|
529
|
+
options.register?.(settlement);
|
|
530
|
+
void settlement.catch((err) => {
|
|
531
|
+
emitEvent({ level: 'error', event: 'cron.crashed_run.settle_failed', error: err, fields: { cron_id: c.cron_id } });
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
function crashedOneShotSummary(why) {
|
|
535
|
+
return [
|
|
536
|
+
`${why}.`,
|
|
537
|
+
'This is a ONE-SHOT, so it has been PAUSED rather than released: its side effects may have completed in full,',
|
|
538
|
+
'and re-firing would enact them a second time. Determine whether the work actually landed, then either',
|
|
539
|
+
'`crtr cron run` it to redo it deliberately, or `crtr cron cancel` it.',
|
|
540
|
+
].join(' ');
|
|
541
|
+
}
|
|
542
|
+
// ---------------------------------------------------------------------------
|
|
543
|
+
// The run executor
|
|
544
|
+
// ---------------------------------------------------------------------------
|
|
545
|
+
/** Kick off ONE cron run and return its settlement promise, resolving with
|
|
546
|
+
* the settled run record (null = the idle→running lease was lost, or the row
|
|
547
|
+
* was quarantined — nothing was recorded by THIS call). The subprocess
|
|
548
|
+
* starts synchronously (spawn + lease + recurrence advance happen before
|
|
549
|
+
* this returns); the promise resolves only after the child has CLOSED and
|
|
550
|
+
* every durable transition — disposition/delivery, run record, lease
|
|
551
|
+
* release, one-shot consumption — is written.
|
|
552
|
+
*
|
|
553
|
+
* `outOfBand` (the `cron run` verb) takes the same lease but does NOT
|
|
554
|
+
* advance a recurrence, does NOT consume a one-shot, and never
|
|
555
|
+
* escalates/pauses — it delivers per disposition and hands the record back
|
|
556
|
+
* to the invoker. */
|
|
557
|
+
export function executeCron(c, opts) {
|
|
558
|
+
const { outOfBand } = opts;
|
|
559
|
+
return new Promise((resolve, reject) => {
|
|
560
|
+
let extraEnv = {};
|
|
561
|
+
if (c.env_json != null) {
|
|
562
|
+
try {
|
|
563
|
+
const parsed = JSON.parse(c.env_json);
|
|
564
|
+
for (const [k, v] of Object.entries(parsed)) {
|
|
565
|
+
if (typeof v === 'string')
|
|
566
|
+
extraEnv[k] = v;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
catch {
|
|
570
|
+
extraEnv = {}; // a malformed snapshot never blocks the run itself
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const runId = randomUUID();
|
|
574
|
+
// The cron RUNS UNDER THE PROFILE IT WAS ARMED UNDER (re-validated here, root
|
|
575
|
+
// fallback when the manifest is gone). The spec's central promise is that
|
|
576
|
+
// "messaging a node, reviving one, birthing one is `crtr node …` inside the
|
|
577
|
+
// command" — and every one of those resolves against a profile. Passing the
|
|
578
|
+
// profile to buildOperationalEnvBase only steers `spawnEnv.allow` config
|
|
579
|
+
// resolution; the child also needs CRTR_PROFILE_ID itself (not an
|
|
580
|
+
// operational literal name, so it never crosses on its own) and the
|
|
581
|
+
// profile's own env store, exactly as buildBrokerEnv gives a broker — storing
|
|
582
|
+
// a value there IS the operator's consent for it to cross this boundary.
|
|
583
|
+
// Layering: profile store < the arm-time `--env` snapshot (an explicit
|
|
584
|
+
// choice) < crtr's own constructed CRTR_* names, which always win.
|
|
585
|
+
const profileId = resolveLiveProfile(c);
|
|
586
|
+
const env = {
|
|
587
|
+
...buildOperationalEnvBase({ targetCwd: c.cwd, targetProfileId: profileId }),
|
|
588
|
+
...readProfileEnvVars(profileId),
|
|
589
|
+
...extraEnv,
|
|
590
|
+
...(profileId !== null ? { CRTR_PROFILE_ID: profileId } : {}),
|
|
591
|
+
CRTR_CRON_ID: c.cron_id,
|
|
592
|
+
CRTR_CRON_NAME: c.name,
|
|
593
|
+
CRTR_RUN_ID: runId,
|
|
594
|
+
};
|
|
595
|
+
// An explicit canvas home is part of the runtime's own identity, not host
|
|
596
|
+
// state a `spawnEnv.allow` list opts into: a cron command's whole promise
|
|
597
|
+
// is that `crtr node …` inside it talks to THIS daemon. Without it the
|
|
598
|
+
// child crtr resolves the default `~/.crouter/canvas`, so every crtr call
|
|
599
|
+
// in a cron body fails to reach the daemon that spawned it. Same
|
|
600
|
+
// propagation the broker/child-node boundary does (`core/runtime/nodes.ts`).
|
|
601
|
+
const canvasHomeOverride = process.env['CRTR_HOME'];
|
|
602
|
+
if (canvasHomeOverride !== undefined && canvasHomeOverride !== '') {
|
|
603
|
+
env['CRTR_HOME'] = canvasHomeOverride;
|
|
604
|
+
}
|
|
605
|
+
if (c.anchor_node != null)
|
|
606
|
+
env['CRTR_ANCHOR'] = c.anchor_node;
|
|
607
|
+
const startedAtMs = Date.now();
|
|
608
|
+
const startedAtIso = new Date(startedAtMs).toISOString();
|
|
609
|
+
let child;
|
|
610
|
+
try {
|
|
611
|
+
child = spawn('bash', ['-c', c.command], {
|
|
612
|
+
cwd: c.cwd,
|
|
613
|
+
env,
|
|
614
|
+
detached: true, // own process group — killProcessGroup(-pid) reaps the whole tree
|
|
615
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
catch (err) {
|
|
619
|
+
// Synchronous spawn failure — no child exists (and no lease was taken).
|
|
620
|
+
// Settle through the failure path so a broken cron pauses + escalates
|
|
621
|
+
// instead of refiring every tick.
|
|
622
|
+
const ctx = {
|
|
623
|
+
runId,
|
|
624
|
+
startedAtIso,
|
|
625
|
+
exitCode: null,
|
|
626
|
+
timedOut: false,
|
|
627
|
+
runTimeoutS: c.run_timeout_s,
|
|
628
|
+
processErrorMessage: err.message,
|
|
629
|
+
stdoutHead: '',
|
|
630
|
+
stdoutSha256: EMPTY_STDOUT_SHA256,
|
|
631
|
+
stderrHead: `run failed to spawn: ${err.message}`.slice(0, CRON_OUTPUT_HEAD_BYTES),
|
|
632
|
+
};
|
|
633
|
+
void (async () => {
|
|
634
|
+
const disposition = await disposeSettledRun(c, ctx, outOfBand);
|
|
635
|
+
const record = {
|
|
636
|
+
run_id: runId,
|
|
637
|
+
cron_id: c.cron_id,
|
|
638
|
+
started: startedAtIso,
|
|
639
|
+
finished: new Date().toISOString(),
|
|
640
|
+
duration_ms: Date.now() - startedAtMs,
|
|
641
|
+
exit_code: null,
|
|
642
|
+
stdout_head: null,
|
|
643
|
+
stderr_head: ctx.stderrHead,
|
|
644
|
+
delivered: disposition.delivered,
|
|
645
|
+
};
|
|
646
|
+
recordCronRun(record);
|
|
647
|
+
if (!outOfBand && c.recur == null && !disposition.paused)
|
|
648
|
+
consumeCron(c.cron_id);
|
|
649
|
+
resolve(record);
|
|
650
|
+
})().catch(reject);
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
let settled = false;
|
|
654
|
+
let timer;
|
|
655
|
+
let killTimer;
|
|
656
|
+
let timedOut = false;
|
|
657
|
+
let leaseLost = false;
|
|
658
|
+
let processError = null;
|
|
659
|
+
// Output capture. The head is accumulated as raw BYTES and decoded ONCE at
|
|
660
|
+
// close: decoding per chunk and slicing by `String.length` capped in UTF-16
|
|
661
|
+
// code units despite the `_BYTES` name, and split any multi-byte sequence
|
|
662
|
+
// straddling a chunk boundary into replacement characters. The change-
|
|
663
|
+
// detection hash runs over the FULL stdout stream rather than the head, so
|
|
664
|
+
// output differing only past the cap is still seen to have changed (it used
|
|
665
|
+
// to report "unchanged" forever).
|
|
666
|
+
const stdout = newHeadCapture();
|
|
667
|
+
const stderr = newHeadCapture();
|
|
668
|
+
const stdoutHash = createHash('sha256');
|
|
669
|
+
child.stdout?.on('data', (chunk) => {
|
|
670
|
+
stdoutHash.update(chunk);
|
|
671
|
+
stdout.take(chunk);
|
|
672
|
+
});
|
|
673
|
+
child.stderr?.on('data', (chunk) => {
|
|
674
|
+
stderr.take(chunk);
|
|
675
|
+
});
|
|
676
|
+
const killWithEscalation = (pid) => {
|
|
677
|
+
killProcessGroup(pid);
|
|
678
|
+
if (killTimer === undefined) {
|
|
679
|
+
killTimer = setTimeout(() => killProcessGroup(pid, 'SIGKILL'), CRON_KILL_GRACE_MS);
|
|
680
|
+
killTimer.unref?.();
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
// A signal, not settlement: 'close' always follows 'error'.
|
|
684
|
+
child.on('error', (err) => {
|
|
685
|
+
if (processError == null)
|
|
686
|
+
processError = err;
|
|
687
|
+
});
|
|
688
|
+
child.on('close', (code) => {
|
|
689
|
+
if (settled)
|
|
690
|
+
return;
|
|
691
|
+
settled = true;
|
|
692
|
+
if (timer !== undefined)
|
|
693
|
+
clearTimeout(timer);
|
|
694
|
+
if (killTimer !== undefined)
|
|
695
|
+
clearTimeout(killTimer);
|
|
696
|
+
const stdoutHead = stdout.decode();
|
|
697
|
+
const stderrHead = stderr.decode();
|
|
698
|
+
const live = liveRuns.get(c.cron_id);
|
|
699
|
+
const wasReplaced = live !== undefined && live.runId === runId && live.replaced;
|
|
700
|
+
if (live !== undefined && live.runId === runId)
|
|
701
|
+
liveRuns.delete(c.cron_id);
|
|
702
|
+
void (async () => {
|
|
703
|
+
if (leaseLost) {
|
|
704
|
+
// Lost the idle→running race (explicit cancel or another daemon's
|
|
705
|
+
// lease) — whoever won owns the row's disposition; abandon silently.
|
|
706
|
+
resolve(null);
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
const finishedAtMs = Date.now();
|
|
710
|
+
let delivered;
|
|
711
|
+
let paused = false;
|
|
712
|
+
if (wasReplaced) {
|
|
713
|
+
// overlap=replace killed this run so the next fire could start
|
|
714
|
+
// fresh: record it, no disposition, no escalation.
|
|
715
|
+
delivered = 'replaced (overlap=replace)';
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
const disposition = await disposeSettledRun(c, {
|
|
719
|
+
runId,
|
|
720
|
+
startedAtIso,
|
|
721
|
+
exitCode: timedOut ? -1 : code,
|
|
722
|
+
timedOut,
|
|
723
|
+
runTimeoutS: c.run_timeout_s,
|
|
724
|
+
processErrorMessage: processError != null ? processError.message : null,
|
|
725
|
+
stdoutHead,
|
|
726
|
+
stdoutSha256: stdoutHash.digest('hex'),
|
|
727
|
+
stderrHead,
|
|
728
|
+
}, outOfBand);
|
|
729
|
+
delivered = disposition.delivered;
|
|
730
|
+
paused = disposition.paused;
|
|
731
|
+
}
|
|
732
|
+
const record = {
|
|
733
|
+
run_id: runId,
|
|
734
|
+
cron_id: c.cron_id,
|
|
735
|
+
started: startedAtIso,
|
|
736
|
+
finished: new Date(finishedAtMs).toISOString(),
|
|
737
|
+
duration_ms: finishedAtMs - startedAtMs,
|
|
738
|
+
exit_code: timedOut ? -1 : code,
|
|
739
|
+
stdout_head: stdoutHead === '' ? null : stdoutHead,
|
|
740
|
+
stderr_head: processError != null
|
|
741
|
+
? `run process error: ${processError.message}`.slice(0, CRON_OUTPUT_HEAD_BYTES)
|
|
742
|
+
: stderrHead === ''
|
|
743
|
+
? null
|
|
744
|
+
: stderrHead,
|
|
745
|
+
delivered,
|
|
746
|
+
};
|
|
747
|
+
recordCronRun(record);
|
|
748
|
+
if (!outOfBand && c.recur == null && !paused) {
|
|
749
|
+
// One-shot: the run is done, delete the row (its history cascades
|
|
750
|
+
// with it — matching one-shot consumption). A failing
|
|
751
|
+
// one-shot that PAUSED for escalation is kept, so `cron resume` can
|
|
752
|
+
// re-arm its still-due fire_at. A racing explicit cancel already
|
|
753
|
+
// removed it; consumeCron no-ops.
|
|
754
|
+
consumeCron(c.cron_id);
|
|
755
|
+
}
|
|
756
|
+
else {
|
|
757
|
+
releaseCronRunLease(c.cron_id);
|
|
758
|
+
}
|
|
759
|
+
resolve(record);
|
|
760
|
+
})().catch(reject);
|
|
761
|
+
});
|
|
762
|
+
if (child.pid == null ||
|
|
763
|
+
!acquireCronRunLease(c.cron_id, cronDaemonInstanceId, child.pid, startedAtIso, outOfBand)) {
|
|
764
|
+
if (child.pid != null)
|
|
765
|
+
killWithEscalation(child.pid);
|
|
766
|
+
leaseLost = true;
|
|
767
|
+
return; // 'close' above performs the actual settlement.
|
|
768
|
+
}
|
|
769
|
+
liveRuns.set(c.cron_id, {
|
|
770
|
+
runId,
|
|
771
|
+
replaced: false,
|
|
772
|
+
kill: () => {
|
|
773
|
+
if (child.pid != null)
|
|
774
|
+
killWithEscalation(child.pid);
|
|
775
|
+
},
|
|
776
|
+
});
|
|
777
|
+
// Settle the schedule BEFORE the run: a recurrence advances to its next
|
|
778
|
+
// slot now, so a crash mid-run never re-fires this slot (the lease guards
|
|
779
|
+
// the intra-life overlap; the advanced fire_at guards the crash window).
|
|
780
|
+
// An out-of-band run never touches the schedule.
|
|
781
|
+
if (!outOfBand && c.recur != null) {
|
|
782
|
+
let nextFire;
|
|
783
|
+
try {
|
|
784
|
+
nextFire = nextSlotAfter(c.recur, new Date(startedAtMs));
|
|
785
|
+
}
|
|
786
|
+
catch (err) {
|
|
787
|
+
// Unparseable recurrence. This row can never be scheduled again as
|
|
788
|
+
// written — but DELETING it (what this used to do) destroys the user's
|
|
789
|
+
// config AND its whole run history with no record and no escalation, the
|
|
790
|
+
// one outcome the spec has no vocabulary for. Take the failure path
|
|
791
|
+
// instead: kill the just-started run and hand `close` a process error, so
|
|
792
|
+
// the row PAUSES and an escalation node arrives holding the parse error.
|
|
793
|
+
// `fire_at` is deliberately left past-due: a paused row is not due, and
|
|
794
|
+
// once someone fixes the recurrence a `cron resume` fires immediately.
|
|
795
|
+
emitEvent({
|
|
796
|
+
level: 'error',
|
|
797
|
+
event: 'cron.recur.unparseable',
|
|
798
|
+
error: err,
|
|
799
|
+
fields: { cron_id: c.cron_id, name: c.name, recur: c.recur },
|
|
800
|
+
});
|
|
801
|
+
processError = new Error(`unparseable recurrence ${JSON.stringify(c.recur)}: ${err.message} — this cron cannot be rescheduled until its recurrence is fixed (\`crtr cron cancel\` and re-arm it), so it has been paused.`);
|
|
802
|
+
// Pause HERE, not only via the escalation: `fire_at` was never advanced,
|
|
803
|
+
// so an on_output='silent' row (whose failure path never escalates and
|
|
804
|
+
// never pauses) would otherwise re-fire this unschedulable command on
|
|
805
|
+
// every single tick, forever.
|
|
806
|
+
setCronState(c.cron_id, 'paused');
|
|
807
|
+
killWithEscalation(child.pid);
|
|
808
|
+
return; // 'close' settles it through the ordinary failure path.
|
|
809
|
+
}
|
|
810
|
+
advanceCron(c.cron_id, nextFire);
|
|
811
|
+
}
|
|
812
|
+
timer = setTimeout(() => {
|
|
813
|
+
if (settled)
|
|
814
|
+
return;
|
|
815
|
+
timedOut = true;
|
|
816
|
+
killWithEscalation(child.pid);
|
|
817
|
+
// Signal only — 'close' above performs the actual settlement.
|
|
818
|
+
}, c.run_timeout_s * 1000);
|
|
819
|
+
timer.unref?.();
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
// ---------------------------------------------------------------------------
|
|
823
|
+
// The per-tick passes: expiry, overlap policy, due runs
|
|
824
|
+
// ---------------------------------------------------------------------------
|
|
825
|
+
/** Delete idle crons whose clock bound has passed. A running expired row is
|
|
826
|
+
* left for a later tick (its run settles first). */
|
|
827
|
+
function expireDueCrons(nowIso) {
|
|
828
|
+
for (const c of expiredIdleCrons(nowIso)) {
|
|
829
|
+
cancelCron(c.cron_id);
|
|
830
|
+
emitEvent({
|
|
831
|
+
level: 'info',
|
|
832
|
+
event: 'cron.expired',
|
|
833
|
+
fields: { cron_id: c.cron_id, name: c.name, expires_at: c.expires_at },
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
/** Apply each recurring cron's overlap policy to a next fire that has landed
|
|
838
|
+
* while its previous run is still leased:
|
|
839
|
+
* skip — advance fire_at past the missed slot and record a skip entry
|
|
840
|
+
* (the observable evidence a fire was deliberately not started).
|
|
841
|
+
* queue — do nothing: fire_at stays past-due, so the moment the running
|
|
842
|
+
* lease releases, the next tick fires immediately. Multiple
|
|
843
|
+
* missed fires collapse structurally (fire_at holds ONE
|
|
844
|
+
* occurrence) — the spec's depth cap of 1.
|
|
845
|
+
* replace — mark THIS instance's in-flight run replaced and kill it; its
|
|
846
|
+
* close handler records the replacement (no escalation) and
|
|
847
|
+
* releases the lease, and the still-due fire_at starts fresh on
|
|
848
|
+
* the next tick. A stale other-instance lease is left to
|
|
849
|
+
* recoverStaleCronLeases. */
|
|
850
|
+
/** True when this cron's most recent run record is already a skip marker — the
|
|
851
|
+
* streak guard in the overlap=skip pass. */
|
|
852
|
+
function latestRunIsSkip(cronId) {
|
|
853
|
+
return listCronRuns(cronId)[0]?.delivered?.startsWith(SKIP_MARKER) === true;
|
|
854
|
+
}
|
|
855
|
+
function applyOverlapPolicies(now, nowIso) {
|
|
856
|
+
for (const c of dueOverlapCrons(nowIso)) {
|
|
857
|
+
if (c.overlap === 'queue')
|
|
858
|
+
continue;
|
|
859
|
+
if (c.overlap === 'skip') {
|
|
860
|
+
let nextFire;
|
|
861
|
+
try {
|
|
862
|
+
nextFire = nextSlotAfter(c.recur, new Date(now));
|
|
863
|
+
}
|
|
864
|
+
catch {
|
|
865
|
+
continue; // paused + escalated by the run path when it next fires
|
|
866
|
+
}
|
|
867
|
+
advanceCron(c.cron_id, nextFire);
|
|
868
|
+
// Record only the FIRST skip of a streak. A run that overruns its cadence
|
|
869
|
+
// produces one skipped occurrence per period, and recorded
|
|
870
|
+
// unconditionally a 25-minute run on a 1-minute cadence writes 25 skip
|
|
871
|
+
// markers — evicting every real run record from the 20-entry ring, which
|
|
872
|
+
// is the exact loss the ring exists to prevent. The next settled run ends
|
|
873
|
+
// the streak, so the next overlap after it records again.
|
|
874
|
+
if (!latestRunIsSkip(c.cron_id)) {
|
|
875
|
+
recordCronRun({
|
|
876
|
+
run_id: randomUUID(),
|
|
877
|
+
cron_id: c.cron_id,
|
|
878
|
+
started: nowIso,
|
|
879
|
+
finished: nowIso,
|
|
880
|
+
duration_ms: 0,
|
|
881
|
+
exit_code: null,
|
|
882
|
+
stdout_head: null,
|
|
883
|
+
stderr_head: null,
|
|
884
|
+
delivered: `${SKIP_MARKER}: fire landed while the previous run was in flight (consecutive skips are not re-recorded until a run settles)`,
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
// replace
|
|
890
|
+
const live = liveRuns.get(c.cron_id);
|
|
891
|
+
if (c.run_lease_owner === cronDaemonInstanceId && live !== undefined && !live.replaced) {
|
|
892
|
+
live.replaced = true;
|
|
893
|
+
live.kill();
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
/** The daemon's cron pass: expire clock-bounded rows, apply overlap policies,
|
|
898
|
+
* then kick off every due active idle cron. Each child starts synchronously
|
|
899
|
+
* but is NEVER awaited in the tick; returns one settlement promise per
|
|
900
|
+
* admitted run.
|
|
901
|
+
*
|
|
902
|
+
* A run that would launch or revive a node (`cronLaunchesNode`) is admitted
|
|
903
|
+
* only while the fleet is under its automatic-revive cap. An unadmitted run is
|
|
904
|
+
* DEFERRED, never consumed: nothing is recorded, no recurrence advances, no
|
|
905
|
+
* one-shot is deleted, and no failure escalates — the row keeps its past-due
|
|
906
|
+
* `fire_at` and is retried on the next poll once capacity frees up. */
|
|
907
|
+
export function runDueCrons(now, options = {}) {
|
|
908
|
+
const nowIso = new Date(now).toISOString();
|
|
909
|
+
expireDueCrons(nowIso);
|
|
910
|
+
applyOverlapPolicies(now, nowIso);
|
|
911
|
+
const settlements = [];
|
|
912
|
+
let deferred = 0;
|
|
913
|
+
for (const c of dueClockCrons(nowIso)) {
|
|
914
|
+
if (options.hasBrokerCapacity !== undefined && cronLaunchesNode(c) && !options.hasBrokerCapacity()) {
|
|
915
|
+
deferred += 1;
|
|
916
|
+
continue; // still due — retried next poll, at no cost to the row
|
|
917
|
+
}
|
|
918
|
+
const settlement = executeCron(c, { outOfBand: false }).then(() => undefined);
|
|
919
|
+
settlements.push(settlement);
|
|
920
|
+
options.register?.(settlement);
|
|
921
|
+
}
|
|
922
|
+
// Backstop: even an unregistered settlement's rejection must never surface
|
|
923
|
+
// as a process-level unhandled rejection.
|
|
924
|
+
for (const s of settlements)
|
|
925
|
+
void s.catch(() => { });
|
|
926
|
+
if (deferred > 0)
|
|
927
|
+
emitCapacityDeferral(now, deferred);
|
|
928
|
+
return settlements;
|
|
929
|
+
}
|
|
930
|
+
/** Throttled record of capacity-deferred runs. Unthrottled this would fire on
|
|
931
|
+
* every 2s poll for as long as the fleet stays at its cap — the same flood the
|
|
932
|
+
* daemon's own capacity event guards against. */
|
|
933
|
+
const CAPACITY_DEFER_LOG_THROTTLE_MS = 30_000;
|
|
934
|
+
let lastCapacityDeferLogAt = Number.NEGATIVE_INFINITY;
|
|
935
|
+
function emitCapacityDeferral(now, deferred) {
|
|
936
|
+
if (now - lastCapacityDeferLogAt < CAPACITY_DEFER_LOG_THROTTLE_MS)
|
|
937
|
+
return;
|
|
938
|
+
lastCapacityDeferLogAt = now;
|
|
939
|
+
emitEvent({
|
|
940
|
+
level: 'warn',
|
|
941
|
+
event: 'cron.capacity.run_deferred',
|
|
942
|
+
fields: { deferred_runs: deferred },
|
|
943
|
+
});
|
|
944
|
+
}
|