@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,876 @@
|
|
|
1
|
+
import { test, before, after, beforeEach } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtempSync, mkdirSync, rmSync, existsSync, readdirSync, statSync, writeFileSync, chmodSync } from 'node:fs';
|
|
4
|
+
import { spawn } from 'node:child_process';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { gitSync } from '../git.js';
|
|
8
|
+
import { push } from '../feed/feed.js';
|
|
9
|
+
import { createManagedWorktree, closeManagedWorktree, managedWorktreePath, rollbackManagedWorktree, setWorktreeCleanupRunnerForTest } from '../worktree.js';
|
|
10
|
+
import { createNode, getNode } from '../canvas/canvas.js';
|
|
11
|
+
import { closeDb } from '../canvas/db.js';
|
|
12
|
+
let home;
|
|
13
|
+
let remoteDir;
|
|
14
|
+
let sourceDir;
|
|
15
|
+
function run(args, cwd) {
|
|
16
|
+
const res = gitSync(args, cwd);
|
|
17
|
+
if (res.status !== 0) {
|
|
18
|
+
throw new Error(`git ${args.join(' ')} failed in ${cwd}: ${res.stderr || res.stdout}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function node(id, over = {}) {
|
|
22
|
+
return {
|
|
23
|
+
node_id: id,
|
|
24
|
+
name: id,
|
|
25
|
+
created: new Date().toISOString(),
|
|
26
|
+
cwd: '/tmp/work',
|
|
27
|
+
kind: 'general',
|
|
28
|
+
mode: 'base',
|
|
29
|
+
lifecycle: 'terminal',
|
|
30
|
+
status: 'active',
|
|
31
|
+
...over,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
before(() => {
|
|
35
|
+
home = mkdtempSync(join(tmpdir(), 'crtr-worktree-home-'));
|
|
36
|
+
process.env['CRTR_HOME'] = home;
|
|
37
|
+
// Bare "remote" wired up as origin so the test can prove landing NEVER pushes
|
|
38
|
+
// to it (managed worktrees are based on and land onto local `main` only).
|
|
39
|
+
remoteDir = mkdtempSync(join(tmpdir(), 'crtr-worktree-remote-'));
|
|
40
|
+
run(['init', '--bare'], remoteDir);
|
|
41
|
+
sourceDir = mkdtempSync(join(tmpdir(), 'crtr-worktree-source-'));
|
|
42
|
+
run(['init', '-b', 'main'], sourceDir);
|
|
43
|
+
run(['config', 'user.email', 'test@example.com'], sourceDir);
|
|
44
|
+
run(['config', 'user.name', 'Test'], sourceDir);
|
|
45
|
+
writeFileSync(join(sourceDir, 'README.md'), 'hello\n');
|
|
46
|
+
run(['add', '.'], sourceDir);
|
|
47
|
+
run(['commit', '-m', 'init'], sourceDir);
|
|
48
|
+
run(['remote', 'add', 'origin', remoteDir], sourceDir);
|
|
49
|
+
run(['push', '-u', 'origin', 'main'], sourceDir);
|
|
50
|
+
});
|
|
51
|
+
beforeEach(() => {
|
|
52
|
+
closeDb();
|
|
53
|
+
rmSync(home, { recursive: true, force: true });
|
|
54
|
+
process.env['CRTR_HOME'] = home;
|
|
55
|
+
});
|
|
56
|
+
after(() => {
|
|
57
|
+
closeDb();
|
|
58
|
+
rmSync(home, { recursive: true, force: true });
|
|
59
|
+
rmSync(remoteDir, { recursive: true, force: true });
|
|
60
|
+
rmSync(sourceDir, { recursive: true, force: true });
|
|
61
|
+
delete process.env['CRTR_HOME'];
|
|
62
|
+
});
|
|
63
|
+
// Regression for #120: `git worktree remove` deletes the checkout directory
|
|
64
|
+
// that IS the calling node's own pi-process cwd. A process can never chdir
|
|
65
|
+
// itself out of a directory that vanishes out from under it, so once that
|
|
66
|
+
// dir is gone every subsequent bash in that node fails permanently and the
|
|
67
|
+
// mandated post-close `crtr push final` can never run. closeManagedWorktree
|
|
68
|
+
// must leave the path resolvable (as an empty tombstone dir) even though the
|
|
69
|
+
// git worktree registration itself is gone.
|
|
70
|
+
test('closeManagedWorktree recreates the worktree path as a tombstone dir so the node cwd still resolves', () => {
|
|
71
|
+
const nodeId = 'wt-close-1';
|
|
72
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
73
|
+
assert.equal(wt.base_ref, 'main', 'default base must remain backward-compatible with persisted main worktrees');
|
|
74
|
+
assert.equal(wt.path, managedWorktreePath(nodeId));
|
|
75
|
+
assert.ok(existsSync(wt.path), 'worktree checkout should exist after create');
|
|
76
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
77
|
+
const result = closeManagedWorktree(nodeId);
|
|
78
|
+
assert.equal(result.worktree_removed, true);
|
|
79
|
+
// The path must still resolve as a directory — this is the actual fix: a
|
|
80
|
+
// node whose cwd was wt.path can still chdir there / run bash / push final.
|
|
81
|
+
assert.ok(existsSync(wt.path), 'worktree path must still exist after close (tombstone)');
|
|
82
|
+
assert.ok(statSync(wt.path).isDirectory(), 'recreated path must be a directory');
|
|
83
|
+
assert.deepEqual(readdirSync(wt.path), [], 'tombstone dir should be empty — git already removed the real checkout');
|
|
84
|
+
// git itself no longer tracks it as a worktree.
|
|
85
|
+
const list = gitSync(['worktree', 'list', '--porcelain'], sourceDir);
|
|
86
|
+
assert.ok(!list.stdout.includes(wt.path), 'git should no longer register the removed worktree');
|
|
87
|
+
const meta = getNode(nodeId);
|
|
88
|
+
assert.equal(meta?.managed_worktree?.state, 'closed');
|
|
89
|
+
// Regression for #519: a later park/revive must relaunch from the durable
|
|
90
|
+
// base checkout, not the torn-down worktree dir (best-effort tombstone —
|
|
91
|
+
// reapable by concurrent git GC, and not a real repo checkout even while
|
|
92
|
+
// it survives). closeManagedWorktree must repoint the persisted cwd.
|
|
93
|
+
assert.equal(meta?.cwd, wt.repo_root, 'closed node cwd must repoint to the repo root, not the removed worktree path');
|
|
94
|
+
});
|
|
95
|
+
test('two concurrent creates from linked worktrees serialize on their shared repository', async () => {
|
|
96
|
+
const worktreeModule = new URL('../worktree.ts', import.meta.url).href;
|
|
97
|
+
const createFrom = (cwd, nodeId) => new Promise((resolve, reject) => {
|
|
98
|
+
const script = `import { createManagedWorktree } from ${JSON.stringify(worktreeModule)}; createManagedWorktree(${JSON.stringify(cwd)}, ${JSON.stringify(nodeId)});`;
|
|
99
|
+
const child = spawn(process.execPath, ['--import', 'tsx/esm', '--input-type=module', '--eval', script], { env: { ...process.env, CRTR_HOME: home }, stdio: 'pipe' });
|
|
100
|
+
let stderr = '';
|
|
101
|
+
child.stderr.on('data', (chunk) => { stderr += chunk; });
|
|
102
|
+
child.on('error', reject);
|
|
103
|
+
child.on('exit', (code) => code === 0 ? resolve() : reject(new Error(`concurrent create exited ${code}: ${stderr}`)));
|
|
104
|
+
});
|
|
105
|
+
const linkedCheckout = mkdtempSync(join(tmpdir(), 'crtr-worktree-linked-'));
|
|
106
|
+
rmSync(linkedCheckout, { recursive: true, force: true });
|
|
107
|
+
run(['worktree', 'add', '-b', 'wt-concurrent-source', linkedCheckout], sourceDir);
|
|
108
|
+
try {
|
|
109
|
+
await Promise.all([createFrom(sourceDir, 'wt-concurrent-1'), createFrom(linkedCheckout, 'wt-concurrent-2')]);
|
|
110
|
+
for (const nodeId of ['wt-concurrent-1', 'wt-concurrent-2']) {
|
|
111
|
+
const path = managedWorktreePath(nodeId);
|
|
112
|
+
assert.ok(existsSync(path), `${nodeId} checkout should exist`);
|
|
113
|
+
assert.equal(gitSync(['rev-parse', '--abbrev-ref', 'HEAD'], path).stdout.trim(), `crtr/${nodeId}`);
|
|
114
|
+
rollbackManagedWorktree({
|
|
115
|
+
state: 'open', path, branch: `crtr/${nodeId}`, repo_root: sourceDir, base_ref: 'main',
|
|
116
|
+
base_sha: gitSync(['rev-parse', 'main'], sourceDir).stdout.trim(), created: new Date().toISOString(),
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
finally {
|
|
121
|
+
run(['worktree', 'remove', '--force', linkedCheckout], sourceDir);
|
|
122
|
+
run(['branch', '-D', 'wt-concurrent-source'], sourceDir);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
test('failure after branch creation removes only the failed attempt resources', () => {
|
|
126
|
+
// A file at the managed-worktree root makes `git worktree add` fail only
|
|
127
|
+
// after this attempt created its branch. No checkout can be registered.
|
|
128
|
+
mkdirSync(home, { recursive: true });
|
|
129
|
+
writeFileSync(join(home, 'worktrees'), 'blocked');
|
|
130
|
+
const nodeId = 'wt-failed-checkout';
|
|
131
|
+
assert.throws(() => createManagedWorktree(sourceDir, nodeId));
|
|
132
|
+
assert.equal(gitSync(['show-ref', '--verify', '--quiet', `refs/heads/crtr/${nodeId}`], sourceDir).status, 1, 'failed attempt branch must be removed');
|
|
133
|
+
assert.ok(!gitSync(['worktree', 'list', '--porcelain'], sourceDir).stdout.includes(`crtr/${nodeId}`), 'failed attempt must not leave a worktree registration');
|
|
134
|
+
assert.ok(!existsSync(managedWorktreePath(nodeId)), 'failed attempt must not leave a checkout directory');
|
|
135
|
+
});
|
|
136
|
+
// Landing is purely local: a commit made in the managed worktree must advance
|
|
137
|
+
// the source repo's LOCAL main to that commit, and origin/main must stay put
|
|
138
|
+
// (close never pushes to origin).
|
|
139
|
+
test('closeManagedWorktree fast-forwards local main to the worktree tip without touching origin', () => {
|
|
140
|
+
const nodeId = 'wt-close-2';
|
|
141
|
+
const originMainBefore = gitSync(['rev-parse', 'origin/main'], sourceDir).stdout.trim();
|
|
142
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
143
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
144
|
+
// Commit real work inside the managed worktree.
|
|
145
|
+
writeFileSync(join(wt.path, 'feature.txt'), 'work\n');
|
|
146
|
+
run(['add', '.'], wt.path);
|
|
147
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'feature'], wt.path);
|
|
148
|
+
const workSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
149
|
+
const result = closeManagedWorktree(nodeId);
|
|
150
|
+
assert.equal(result.landed_sha, workSha, 'landed_sha should be the committed work');
|
|
151
|
+
// Local main in the source (primary) checkout advanced to the work.
|
|
152
|
+
const localMainAfter = gitSync(['rev-parse', 'main'], sourceDir).stdout.trim();
|
|
153
|
+
assert.equal(localMainAfter, workSha, 'local main must fast-forward to the worktree tip');
|
|
154
|
+
// origin/main is untouched — nothing was pushed.
|
|
155
|
+
const originMainAfter = gitSync(['rev-parse', 'origin/main'], sourceDir).stdout.trim();
|
|
156
|
+
assert.equal(originMainAfter, originMainBefore, 'origin/main must not move — landing is local-only');
|
|
157
|
+
});
|
|
158
|
+
test('custom local base is recorded and fast-forwarded without touching main or origin', () => {
|
|
159
|
+
const nodeId = 'wt-custom-base';
|
|
160
|
+
run(['branch', 'feature/custom-base'], sourceDir);
|
|
161
|
+
const baseSha = gitSync(['rev-parse', 'feature/custom-base'], sourceDir).stdout.trim();
|
|
162
|
+
const mainBefore = gitSync(['rev-parse', 'main'], sourceDir).stdout.trim();
|
|
163
|
+
const originMainBefore = gitSync(['rev-parse', 'origin/main'], sourceDir).stdout.trim();
|
|
164
|
+
const wt = createManagedWorktree(sourceDir, nodeId, 'feature/custom-base');
|
|
165
|
+
assert.equal(wt.base_ref, 'feature/custom-base');
|
|
166
|
+
assert.equal(wt.base_sha, baseSha);
|
|
167
|
+
assert.equal(gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim(), baseSha, 'dedicated branch starts at the custom base');
|
|
168
|
+
assert.equal(gitSync(['rev-parse', '--abbrev-ref', 'HEAD'], wt.path).stdout.trim(), `crtr/${nodeId}`, 'the worktree checks out its own dedicated crtr/<node-id> branch, not the base branch');
|
|
169
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
170
|
+
writeFileSync(join(wt.path, 'custom-base.txt'), 'work\n');
|
|
171
|
+
run(['add', '.'], wt.path);
|
|
172
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'custom base work'], wt.path);
|
|
173
|
+
// The base can advance while the child works. Close must rebase onto that
|
|
174
|
+
// new tip before atomically advancing the base to the child work.
|
|
175
|
+
run(['checkout', 'feature/custom-base'], sourceDir);
|
|
176
|
+
writeFileSync(join(sourceDir, 'base-advance.txt'), 'base work\n');
|
|
177
|
+
run(['add', '.'], sourceDir);
|
|
178
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'base advance'], sourceDir);
|
|
179
|
+
const advancedBaseSha = gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim();
|
|
180
|
+
run(['checkout', 'main'], sourceDir);
|
|
181
|
+
const originalWorkSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
182
|
+
const result = closeManagedWorktree(nodeId);
|
|
183
|
+
assert.equal(gitSync(['merge-base', '--is-ancestor', originalWorkSha, result.landed_sha], sourceDir).status, 1, 'rebasing onto an advanced base must rewrite the child commit');
|
|
184
|
+
assert.equal(gitSync(['merge-base', '--is-ancestor', advancedBaseSha, result.landed_sha], sourceDir).status, 0, 'landed work must be rebased onto the latest base tip');
|
|
185
|
+
assert.equal(gitSync(['rev-parse', 'feature/custom-base'], sourceDir).stdout.trim(), result.landed_sha, 'custom base must fast-forward to the worktree tip');
|
|
186
|
+
assert.equal(gitSync(['rev-parse', 'main'], sourceDir).stdout.trim(), mainBefore, 'main must remain untouched');
|
|
187
|
+
assert.equal(gitSync(['rev-parse', 'origin/main'], sourceDir).stdout.trim(), originMainBefore, 'origin/main must remain untouched');
|
|
188
|
+
});
|
|
189
|
+
test('refuses a custom-base close when its unchecked base advances after rebase', () => {
|
|
190
|
+
const nodeId = 'wt-custom-base-cas-race';
|
|
191
|
+
const base = 'feature/cas-race-base';
|
|
192
|
+
run(['branch', base], sourceDir);
|
|
193
|
+
const baseSha = gitSync(['rev-parse', base], sourceDir).stdout.trim();
|
|
194
|
+
const wt = createManagedWorktree(sourceDir, nodeId, base);
|
|
195
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
196
|
+
writeFileSync(join(wt.path, 'cas-child.txt'), 'child work\n');
|
|
197
|
+
run(['add', '.'], wt.path);
|
|
198
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'cas child work'], wt.path);
|
|
199
|
+
// Pre-create the other writer's commit, then reset the base so the rebase
|
|
200
|
+
// begins from baseSha. A test-only git wrapper advances it when close calls
|
|
201
|
+
// its final update-ref CAS, immediately before the real git receives that
|
|
202
|
+
// CAS request.
|
|
203
|
+
run(['checkout', base], sourceDir);
|
|
204
|
+
writeFileSync(join(sourceDir, 'cas-base.txt'), 'base work\n');
|
|
205
|
+
run(['add', '.'], sourceDir);
|
|
206
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'cas base work'], sourceDir);
|
|
207
|
+
const advancedBaseSha = gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim();
|
|
208
|
+
run(['checkout', 'main'], sourceDir);
|
|
209
|
+
run(['update-ref', `refs/heads/${base}`, baseSha], sourceDir);
|
|
210
|
+
const wrapperDir = mkdtempSync(join(tmpdir(), 'crtr-git-wrapper-'));
|
|
211
|
+
const wrapperPath = join(wrapperDir, 'git');
|
|
212
|
+
const originalPath = process.env['PATH'] ?? '';
|
|
213
|
+
writeFileSync(wrapperPath, `#!/bin/sh
|
|
214
|
+
if [ "$1" = "update-ref" ] && [ "$2" = "refs/heads/${base}" ] && [ "$4" = "${baseSha}" ]; then
|
|
215
|
+
PATH="$CRTR_TEST_REAL_PATH" git -C "${sourceDir}" update-ref "refs/heads/${base}" "${advancedBaseSha}"
|
|
216
|
+
fi
|
|
217
|
+
PATH="$CRTR_TEST_REAL_PATH" exec git "$@"
|
|
218
|
+
`);
|
|
219
|
+
chmodSync(wrapperPath, 0o755);
|
|
220
|
+
process.env['CRTR_TEST_REAL_PATH'] = originalPath;
|
|
221
|
+
process.env['PATH'] = `${wrapperDir}:${originalPath}`;
|
|
222
|
+
try {
|
|
223
|
+
assert.throws(() => closeManagedWorktree(nodeId), (error) => error instanceof Error && 'code' in error && error.code === 'land_base_failed');
|
|
224
|
+
}
|
|
225
|
+
finally {
|
|
226
|
+
process.env['PATH'] = originalPath;
|
|
227
|
+
delete process.env['CRTR_TEST_REAL_PATH'];
|
|
228
|
+
rmSync(wrapperDir, { recursive: true, force: true });
|
|
229
|
+
}
|
|
230
|
+
assert.equal(gitSync(['rev-parse', base], sourceDir).stdout.trim(), advancedBaseSha, 'CAS failure must preserve the concurrent base advance');
|
|
231
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'failed landing must leave the worktree open for retry or human resolution');
|
|
232
|
+
});
|
|
233
|
+
test('rebases onto the captured SHA when an unchecked base advances before rebase starts', () => {
|
|
234
|
+
const nodeId = 'wt-custom-base-rebase-race';
|
|
235
|
+
const base = 'feature/rebase-race-base';
|
|
236
|
+
run(['branch', base], sourceDir);
|
|
237
|
+
const baseSha = gitSync(['rev-parse', base], sourceDir).stdout.trim();
|
|
238
|
+
const wt = createManagedWorktree(sourceDir, nodeId, base);
|
|
239
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
240
|
+
writeFileSync(join(wt.path, 'rebase-race-child.txt'), 'child work\n');
|
|
241
|
+
run(['add', '.'], wt.path);
|
|
242
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'rebase race child work'], wt.path);
|
|
243
|
+
// Prepare another writer's commit, then move the unchecked base back to the
|
|
244
|
+
// SHA close will capture. The wrapper advances the base immediately before
|
|
245
|
+
// the real rebase starts. Close must still rebase onto its captured SHA, not
|
|
246
|
+
// resolve the now-advanced symbolic branch, and the stale landing CAS fails.
|
|
247
|
+
run(['checkout', base], sourceDir);
|
|
248
|
+
writeFileSync(join(sourceDir, 'rebase-race-base.txt'), 'base work\n');
|
|
249
|
+
run(['add', '.'], sourceDir);
|
|
250
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'rebase race base work'], sourceDir);
|
|
251
|
+
const advancedBaseSha = gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim();
|
|
252
|
+
run(['checkout', 'main'], sourceDir);
|
|
253
|
+
run(['update-ref', `refs/heads/${base}`, baseSha], sourceDir);
|
|
254
|
+
const wrapperDir = mkdtempSync(join(tmpdir(), 'crtr-git-wrapper-'));
|
|
255
|
+
const wrapperPath = join(wrapperDir, 'git');
|
|
256
|
+
const originalPath = process.env['PATH'] ?? '';
|
|
257
|
+
writeFileSync(wrapperPath, `#!/bin/sh
|
|
258
|
+
if [ "$1" = "rebase" ] && [ "$2" = "${baseSha}" ]; then
|
|
259
|
+
PATH="$CRTR_TEST_REAL_PATH" git -C "${sourceDir}" update-ref "refs/heads/${base}" "${advancedBaseSha}"
|
|
260
|
+
fi
|
|
261
|
+
PATH="$CRTR_TEST_REAL_PATH" exec git "$@"
|
|
262
|
+
`);
|
|
263
|
+
chmodSync(wrapperPath, 0o755);
|
|
264
|
+
process.env['CRTR_TEST_REAL_PATH'] = originalPath;
|
|
265
|
+
process.env['PATH'] = `${wrapperDir}:${originalPath}`;
|
|
266
|
+
try {
|
|
267
|
+
assert.throws(() => closeManagedWorktree(nodeId), (error) => error instanceof Error && 'code' in error && error.code === 'land_base_failed');
|
|
268
|
+
}
|
|
269
|
+
finally {
|
|
270
|
+
process.env['PATH'] = originalPath;
|
|
271
|
+
delete process.env['CRTR_TEST_REAL_PATH'];
|
|
272
|
+
rmSync(wrapperDir, { recursive: true, force: true });
|
|
273
|
+
}
|
|
274
|
+
const rebasedChildSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
275
|
+
assert.equal(gitSync(['rev-parse', base], sourceDir).stdout.trim(), advancedBaseSha, 'CAS failure must preserve the advance that raced with rebase');
|
|
276
|
+
assert.equal(gitSync(['merge-base', '--is-ancestor', advancedBaseSha, rebasedChildSha], sourceDir).status, 1, 'the child must not rebase onto a symbolic base advance after baseSha was captured');
|
|
277
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'failed landing must leave the worktree open for retry or human resolution');
|
|
278
|
+
});
|
|
279
|
+
test('refuses to land when a checked-out base is reset after its SHA is captured', () => {
|
|
280
|
+
const nodeId = 'wt-custom-base-checked-out-reset-race';
|
|
281
|
+
const base = 'feature/checked-out-reset-race-base';
|
|
282
|
+
run(['checkout', '-b', base], sourceDir);
|
|
283
|
+
const resetSha = gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim();
|
|
284
|
+
writeFileSync(join(sourceDir, 'checked-out-reset-base.txt'), 'base work\n');
|
|
285
|
+
run(['add', '.'], sourceDir);
|
|
286
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'checked out reset base work'], sourceDir);
|
|
287
|
+
const baseSha = gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim();
|
|
288
|
+
const wt = createManagedWorktree(sourceDir, nodeId, base);
|
|
289
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
290
|
+
writeFileSync(join(wt.path, 'checked-out-reset-child.txt'), 'child work\n');
|
|
291
|
+
run(['add', '.'], wt.path);
|
|
292
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'checked out reset child work'], wt.path);
|
|
293
|
+
// Reset the checked-out base backward immediately before the child rebases.
|
|
294
|
+
// The real rebase still targets captured baseSha, so only the explicit HEAD
|
|
295
|
+
// equality check can prevent an ff-only merge from restoring discarded work.
|
|
296
|
+
const wrapperDir = mkdtempSync(join(tmpdir(), 'crtr-git-wrapper-'));
|
|
297
|
+
const wrapperPath = join(wrapperDir, 'git');
|
|
298
|
+
const originalPath = process.env['PATH'] ?? '';
|
|
299
|
+
writeFileSync(wrapperPath, `#!/bin/sh
|
|
300
|
+
if [ "$1" = "rebase" ] && [ "$2" = "${baseSha}" ]; then
|
|
301
|
+
PATH="$CRTR_TEST_REAL_PATH" git -C "${sourceDir}" reset --hard "${resetSha}"
|
|
302
|
+
fi
|
|
303
|
+
PATH="$CRTR_TEST_REAL_PATH" exec git "$@"
|
|
304
|
+
`);
|
|
305
|
+
chmodSync(wrapperPath, 0o755);
|
|
306
|
+
process.env['CRTR_TEST_REAL_PATH'] = originalPath;
|
|
307
|
+
process.env['PATH'] = `${wrapperDir}:${originalPath}`;
|
|
308
|
+
try {
|
|
309
|
+
assert.throws(() => closeManagedWorktree(nodeId), (error) => error instanceof Error && 'code' in error && error.code === 'land_base_failed');
|
|
310
|
+
}
|
|
311
|
+
finally {
|
|
312
|
+
process.env['PATH'] = originalPath;
|
|
313
|
+
delete process.env['CRTR_TEST_REAL_PATH'];
|
|
314
|
+
rmSync(wrapperDir, { recursive: true, force: true });
|
|
315
|
+
}
|
|
316
|
+
assert.equal(gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim(), resetSha, 'failed landing must leave the checked-out base at the concurrent reset SHA');
|
|
317
|
+
assert.equal(gitSync(['rev-parse', base], sourceDir).stdout.trim(), resetSha, 'failed landing must not restore discarded base commits');
|
|
318
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'failed landing must leave the worktree open for retry or human resolution');
|
|
319
|
+
run(['checkout', 'main'], sourceDir);
|
|
320
|
+
});
|
|
321
|
+
test('close fast-forwards a custom base in its checked-out worktree', () => {
|
|
322
|
+
const nodeId = 'wt-custom-base-checked-out';
|
|
323
|
+
run(['checkout', '-b', 'feature/checked-out-base'], sourceDir);
|
|
324
|
+
const wt = createManagedWorktree(sourceDir, nodeId, 'feature/checked-out-base');
|
|
325
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
326
|
+
writeFileSync(join(wt.path, 'checked-out-base.txt'), 'work\n');
|
|
327
|
+
run(['add', '.'], wt.path);
|
|
328
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'checked out base work'], wt.path);
|
|
329
|
+
const workSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
330
|
+
closeManagedWorktree(nodeId);
|
|
331
|
+
assert.equal(gitSync(['rev-parse', 'feature/checked-out-base'], sourceDir).stdout.trim(), workSha);
|
|
332
|
+
assert.equal(gitSync(['rev-parse', 'HEAD'], sourceDir).stdout.trim(), workSha, 'checked-out base worktree must advance with its ref');
|
|
333
|
+
run(['checkout', 'main'], sourceDir);
|
|
334
|
+
});
|
|
335
|
+
test('rejects remote and nonexistent worktree bases before creating any resources', () => {
|
|
336
|
+
for (const [nodeId, base] of [['wt-remote-base', 'origin/main'], ['wt-bogus-base', 'feature/does-not-exist']]) {
|
|
337
|
+
assert.throws(() => createManagedWorktree(sourceDir, nodeId, base), (error) => error instanceof Error
|
|
338
|
+
&& 'code' in error
|
|
339
|
+
&& error.code === 'missing_base_branch'
|
|
340
|
+
&& error.message.includes(base));
|
|
341
|
+
assert.ok(!existsSync(managedWorktreePath(nodeId)), `${base} must not leave a worktree directory`);
|
|
342
|
+
assert.equal(gitSync(['show-ref', '--verify', '--quiet', `refs/heads/crtr/${nodeId}`], sourceDir).status, 1, `${base} must not leave a dedicated branch`);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
test('refuses to close when the recorded base was deleted and leaves the worktree open', () => {
|
|
346
|
+
const nodeId = 'wt-deleted-base';
|
|
347
|
+
run(['branch', 'feature/deleted-base'], sourceDir);
|
|
348
|
+
const mainBefore = gitSync(['rev-parse', 'main'], sourceDir).stdout.trim();
|
|
349
|
+
const wt = createManagedWorktree(sourceDir, nodeId, 'feature/deleted-base');
|
|
350
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
351
|
+
writeFileSync(join(wt.path, 'deleted-base.txt'), 'work\n');
|
|
352
|
+
run(['add', '.'], wt.path);
|
|
353
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'deleted base work'], wt.path);
|
|
354
|
+
run(['branch', '-D', 'feature/deleted-base'], sourceDir);
|
|
355
|
+
assert.throws(() => closeManagedWorktree(nodeId), (error) => error instanceof Error && 'code' in error && error.code === 'missing_base_branch');
|
|
356
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'a missing base must not silently close or retarget the worktree');
|
|
357
|
+
assert.ok(existsSync(wt.path), 'the worktree must remain available for a human decision');
|
|
358
|
+
assert.equal(gitSync(['rev-parse', 'main'], sourceDir).stdout.trim(), mainBefore, 'missing base must never auto-land onto main');
|
|
359
|
+
});
|
|
360
|
+
// Regression for #330/#331: crtr's own untracked `.crouter/config.json` /
|
|
361
|
+
// `state.json` bookkeeping (written by ordinary project-scope init) must
|
|
362
|
+
// never block `close`'s dirty check — Fix A seeds `.git/info/exclude` for
|
|
363
|
+
// exactly those two filenames at worktree-creation time.
|
|
364
|
+
test('close ignores crtr\'s own untracked .crouter/config.json and state.json bookkeeping', () => {
|
|
365
|
+
const nodeId = 'wt-crtr-bookkeeping';
|
|
366
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
367
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
368
|
+
mkdirSync(join(wt.path, '.crouter'), { recursive: true });
|
|
369
|
+
writeFileSync(join(wt.path, '.crouter', 'config.json'), '{}\n');
|
|
370
|
+
writeFileSync(join(wt.path, '.crouter', 'state.json'), '{}\n');
|
|
371
|
+
// The seeded exclude is on the SHARED common git dir — assert git itself
|
|
372
|
+
// reports a clean tree, not just that close happens not to notice.
|
|
373
|
+
assert.equal(gitSync(['status', '--porcelain'], wt.path).stdout.trim(), '', 'git status must already be clean with only crtr bookkeeping present');
|
|
374
|
+
const result = closeManagedWorktree(nodeId);
|
|
375
|
+
assert.equal(result.worktree_removed, true);
|
|
376
|
+
});
|
|
377
|
+
// The exclude must be narrow: it must NEVER hide real, committable node work
|
|
378
|
+
// that merely happens to live under `.crouter/` — this mirrors crouter's OWN
|
|
379
|
+
// repo, which tracks `.crouter/memory/`. Set up a dedicated repo (not the
|
|
380
|
+
// shared sourceDir, which never tracks `.crouter/`) that already tracks a
|
|
381
|
+
// memory doc, then prove BOTH a modification to it and a brand-new untracked
|
|
382
|
+
// doc beside it still block close exactly as before Fix A.
|
|
383
|
+
test('close still blocks on real .crouter/memory/ work — a tracked-file edit and a new untracked doc', () => {
|
|
384
|
+
const memoryRepo = mkdtempSync(join(tmpdir(), 'crtr-worktree-memoryrepo-'));
|
|
385
|
+
run(['init', '-b', 'main'], memoryRepo);
|
|
386
|
+
run(['config', 'user.email', 'test@example.com'], memoryRepo);
|
|
387
|
+
run(['config', 'user.name', 'Test'], memoryRepo);
|
|
388
|
+
mkdirSync(join(memoryRepo, '.crouter', 'memory'), { recursive: true });
|
|
389
|
+
writeFileSync(join(memoryRepo, '.crouter', 'memory', 'AGENTS.md'), 'tracked memory doc\n');
|
|
390
|
+
run(['add', '.'], memoryRepo);
|
|
391
|
+
run(['commit', '-m', 'init with tracked memory'], memoryRepo);
|
|
392
|
+
const editNodeId = 'wt-real-crouter-memory-edit';
|
|
393
|
+
const editWt = createManagedWorktree(memoryRepo, editNodeId);
|
|
394
|
+
createNode(node(editNodeId, { cwd: editWt.path, managed_worktree: editWt }));
|
|
395
|
+
writeFileSync(join(editWt.path, '.crouter', 'memory', 'AGENTS.md'), 'edited tracked memory doc\n');
|
|
396
|
+
const editStatus = gitSync(['status', '--porcelain'], editWt.path).stdout;
|
|
397
|
+
assert.ok(editStatus.includes('M .crouter/memory/AGENTS.md'), 'a tracked .crouter/memory/ edit must still show as modified — exclude can never hide a tracked-file change');
|
|
398
|
+
assert.throws(() => closeManagedWorktree(editNodeId), (error) => error instanceof Error && 'code' in error && error.code === 'dirty_worktree');
|
|
399
|
+
const newDocNodeId = 'wt-real-crouter-memory-new-doc';
|
|
400
|
+
const newDocWt = createManagedWorktree(memoryRepo, newDocNodeId);
|
|
401
|
+
createNode(node(newDocNodeId, { cwd: newDocWt.path, managed_worktree: newDocWt }));
|
|
402
|
+
writeFileSync(join(newDocWt.path, '.crouter', 'memory', 'new-doc.md'), 'a legitimate new memory doc\n');
|
|
403
|
+
const newDocStatus = gitSync(['status', '--porcelain'], newDocWt.path).stdout;
|
|
404
|
+
assert.ok(newDocStatus.includes('.crouter/memory/new-doc.md'), 'a brand-new untracked doc under an already-tracked .crouter/memory/ must still show as dirty');
|
|
405
|
+
assert.throws(() => closeManagedWorktree(newDocNodeId), (error) => error instanceof Error && 'code' in error && error.code === 'dirty_worktree');
|
|
406
|
+
rmSync(memoryRepo, { recursive: true, force: true });
|
|
407
|
+
});
|
|
408
|
+
// Fix B (#327/#333): a managed worktree with zero commits ahead of its base
|
|
409
|
+
// and nothing uncommitted has nothing to land — push-final's auto-drop path
|
|
410
|
+
// (autoDropCleanManagedWorktree) must close it without requiring an explicit
|
|
411
|
+
// `node worktree close`.
|
|
412
|
+
test('autoDropCleanManagedWorktree drops a clean, zero-commit worktree', async () => {
|
|
413
|
+
const { autoDropCleanManagedWorktree } = await import('../worktree.js');
|
|
414
|
+
const nodeId = 'wt-auto-drop-empty';
|
|
415
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
416
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
417
|
+
const result = autoDropCleanManagedWorktree(nodeId);
|
|
418
|
+
assert.ok(result !== null, 'a worktree with zero commits and a clean tree must be droppable');
|
|
419
|
+
assert.equal(result?.worktree_removed, true);
|
|
420
|
+
const meta = getNode(nodeId);
|
|
421
|
+
assert.equal(meta?.managed_worktree?.state, 'closed');
|
|
422
|
+
assert.ok(!gitSync(['worktree', 'list', '--porcelain'], sourceDir).stdout.includes(wt.path), 'git must no longer register the dropped worktree');
|
|
423
|
+
// Regression for #519: auto-drop must persist the SAME closed-worktree
|
|
424
|
+
// transition explicit close does — repointing `cwd` to the durable base
|
|
425
|
+
// checkout, atomically with `state: 'closed'`. Before the fix, auto-drop
|
|
426
|
+
// left `cwd` at the removed worktree path; that path is recreated as an
|
|
427
|
+
// empty tombstone dir (see `bestEffortRemoveWorktreeCheckout`), so a later
|
|
428
|
+
// `--reopen` revive's `existsSync(meta.cwd)` preflight passed anyway and
|
|
429
|
+
// launched into a non-checkout instead of failing loud or landing somewhere
|
|
430
|
+
// real. `cwd` must be durable: a real git checkout, not a reapable stand-in.
|
|
431
|
+
assert.equal(meta?.cwd, wt.repo_root, 'auto-dropped node cwd must repoint to the repo root, not the removed worktree path');
|
|
432
|
+
assert.equal(gitSync(['rev-parse', '--git-dir'], meta.cwd).status, 0, 'repointed cwd must resolve to a real git checkout a reopen/revive can launch from');
|
|
433
|
+
assert.equal(existsSync(join(wt.path, '.git')), false, 'the tombstoned worktree path must NOT itself resolve as a git checkout');
|
|
434
|
+
});
|
|
435
|
+
// The same real-commit case close already protects: a worktree with actual
|
|
436
|
+
// unlanded work must NEVER be auto-dropped by push-final.
|
|
437
|
+
test('autoDropCleanManagedWorktree refuses a worktree with a real commit ahead of base', async () => {
|
|
438
|
+
const { autoDropCleanManagedWorktree } = await import('../worktree.js');
|
|
439
|
+
const nodeId = 'wt-auto-drop-real-work';
|
|
440
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
441
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
442
|
+
writeFileSync(join(wt.path, 'real-work.txt'), 'work\n');
|
|
443
|
+
run(['add', '.'], wt.path);
|
|
444
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'real work'], wt.path);
|
|
445
|
+
const result = autoDropCleanManagedWorktree(nodeId);
|
|
446
|
+
assert.equal(result, null, 'a worktree with a real commit ahead of base must never be silently dropped');
|
|
447
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'the worktree must remain open for an explicit close');
|
|
448
|
+
assert.ok(existsSync(wt.path), 'the checkout with real work must remain intact');
|
|
449
|
+
});
|
|
450
|
+
// Real uncommitted (non-crtr-bookkeeping) changes must also refuse auto-drop,
|
|
451
|
+
// even with zero commits.
|
|
452
|
+
test('autoDropCleanManagedWorktree refuses a worktree with real uncommitted changes', async () => {
|
|
453
|
+
const { autoDropCleanManagedWorktree } = await import('../worktree.js');
|
|
454
|
+
const nodeId = 'wt-auto-drop-dirty';
|
|
455
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
456
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
457
|
+
writeFileSync(join(wt.path, 'uncommitted.txt'), 'not yet committed\n');
|
|
458
|
+
const result = autoDropCleanManagedWorktree(nodeId);
|
|
459
|
+
assert.equal(result, null, 'real uncommitted changes must never be silently dropped');
|
|
460
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open');
|
|
461
|
+
});
|
|
462
|
+
// The actual #327 positive case: a branch with REAL commits whose tip is
|
|
463
|
+
// already contained in a base that moved forward past this worktree's
|
|
464
|
+
// original base_sha (a manager landed the same change another way, without
|
|
465
|
+
// ever going through crtr's own close path). This must auto-drop and, above
|
|
466
|
+
// all, must never lose the work — it stays reachable from the moved base.
|
|
467
|
+
test('autoDropCleanManagedWorktree drops a branch with real commits already contained in a moved base (#327)', async () => {
|
|
468
|
+
const { autoDropCleanManagedWorktree } = await import('../worktree.js');
|
|
469
|
+
const repo = mkdtempSync(join(tmpdir(), 'crtr-worktree-327-'));
|
|
470
|
+
run(['init', '-b', 'main'], repo);
|
|
471
|
+
run(['config', 'user.email', 'test@example.com'], repo);
|
|
472
|
+
run(['config', 'user.name', 'Test'], repo);
|
|
473
|
+
writeFileSync(join(repo, 'README.md'), 'hello\n');
|
|
474
|
+
run(['add', '.'], repo);
|
|
475
|
+
run(['commit', '-m', 'init'], repo);
|
|
476
|
+
const nodeId = 'wt-327-positive';
|
|
477
|
+
const wt = createManagedWorktree(repo, nodeId);
|
|
478
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
479
|
+
writeFileSync(join(wt.path, 'feature.txt'), 'landed elsewhere\n');
|
|
480
|
+
run(['add', '.'], wt.path);
|
|
481
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'feature'], wt.path);
|
|
482
|
+
const branchSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
483
|
+
// A manager fast-forwards main past this branch's own tip directly in the
|
|
484
|
+
// primary checkout — the base moved AFTER the worktree was created, and
|
|
485
|
+
// this branch's commits are now redundant, not lost.
|
|
486
|
+
run(['merge', '--ff-only', branchSha], repo);
|
|
487
|
+
assert.equal(gitSync(['rev-parse', 'main'], repo).stdout.trim(), branchSha);
|
|
488
|
+
const result = autoDropCleanManagedWorktree(nodeId);
|
|
489
|
+
assert.ok(result !== null, 'a branch whose commits are already contained in a moved base has nothing left to land');
|
|
490
|
+
assert.equal(result?.branch_deleted, true);
|
|
491
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'closed');
|
|
492
|
+
assert.equal(gitSync(['show-ref', '--verify', '--quiet', `refs/heads/${wt.branch}`], repo).status, 1, 'the now-redundant branch ref must actually be gone');
|
|
493
|
+
// The work itself is NOT lost — it stays reachable from main, which is the point.
|
|
494
|
+
assert.equal(gitSync(['merge-base', '--is-ancestor', branchSha, 'main'], repo).status, 0, 'the landed commit must remain reachable from main after the drop');
|
|
495
|
+
rmSync(repo, { recursive: true, force: true });
|
|
496
|
+
});
|
|
497
|
+
// A base that no longer resolves (renamed/deleted local branch) must refuse
|
|
498
|
+
// auto-drop rather than guess — the SAME guard `resolveLandableBase` already
|
|
499
|
+
// gives the explicit close path.
|
|
500
|
+
test('autoDropCleanManagedWorktree refuses when the recorded base branch no longer resolves', async () => {
|
|
501
|
+
const { autoDropCleanManagedWorktree } = await import('../worktree.js');
|
|
502
|
+
const repo = mkdtempSync(join(tmpdir(), 'crtr-worktree-missingbase-'));
|
|
503
|
+
run(['init', '-b', 'main'], repo);
|
|
504
|
+
run(['config', 'user.email', 'test@example.com'], repo);
|
|
505
|
+
run(['config', 'user.name', 'Test'], repo);
|
|
506
|
+
writeFileSync(join(repo, 'README.md'), 'hello\n');
|
|
507
|
+
run(['add', '.'], repo);
|
|
508
|
+
run(['commit', '-m', 'init'], repo);
|
|
509
|
+
const nodeId = 'wt-missing-base';
|
|
510
|
+
const wt = createManagedWorktree(repo, nodeId);
|
|
511
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
512
|
+
// The recorded base branch ('main') has been renamed away since creation.
|
|
513
|
+
run(['branch', '-m', 'main', 'renamed-main'], repo);
|
|
514
|
+
const result = autoDropCleanManagedWorktree(nodeId);
|
|
515
|
+
assert.equal(result, null, 'an unresolvable base must never be treated as safe to drop');
|
|
516
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open');
|
|
517
|
+
assert.ok(existsSync(wt.path));
|
|
518
|
+
rmSync(repo, { recursive: true, force: true });
|
|
519
|
+
});
|
|
520
|
+
// ---------------------------------------------------------------------------
|
|
521
|
+
// The Critical fix: the TOCTOU race between proving clean-and-contained and
|
|
522
|
+
// the destructive branch delete. `proveCleanEmptyManagedWorktree` and
|
|
523
|
+
// `autoDropCleanManagedWorktreeLocked` are exported specifically so these
|
|
524
|
+
// tests can inject a race deterministically in the window between them —
|
|
525
|
+
// exactly the window the repository lock does NOT close (it only serializes
|
|
526
|
+
// crtr's own worktree mutations, not ordinary `git commit`/`git reset`/an
|
|
527
|
+
// external base rewrite run by any other process against the checkout).
|
|
528
|
+
// ---------------------------------------------------------------------------
|
|
529
|
+
// A concurrent commit lands on the managed branch after the predicate proved
|
|
530
|
+
// it clean-and-contained, but before cleanup deletes it. The atomic
|
|
531
|
+
// compare-and-delete must refuse, leaving the branch (and the new commit)
|
|
532
|
+
// fully intact.
|
|
533
|
+
test('the atomic delete refuses when a commit lands on the branch between the predicate and cleanup', async () => {
|
|
534
|
+
const { proveCleanEmptyManagedWorktree, autoDropCleanManagedWorktreeLocked } = await import('../worktree.js');
|
|
535
|
+
const nodeId = 'wt-race-branch-commit';
|
|
536
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
537
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
538
|
+
const proof = proveCleanEmptyManagedWorktree(wt);
|
|
539
|
+
assert.ok(proof !== null, 'a fresh clean, zero-commit worktree must prove droppable');
|
|
540
|
+
// Simulate a concurrent process committing new work on the managed branch
|
|
541
|
+
// in the window between the predicate and cleanup.
|
|
542
|
+
writeFileSync(join(wt.path, 'concurrent-work.txt'), 'a real commit landed mid-cleanup\n');
|
|
543
|
+
run(['add', '.'], wt.path);
|
|
544
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'concurrent work'], wt.path);
|
|
545
|
+
const concurrentSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
546
|
+
assert.notEqual(concurrentSha, proof?.branchSha, 'the branch must have actually moved past the proven SHA for this test to be meaningful');
|
|
547
|
+
const result = autoDropCleanManagedWorktreeLocked(nodeId, wt, proof);
|
|
548
|
+
assert.equal(result, null, 'the atomic delete must refuse once the branch has moved past the proven SHA');
|
|
549
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'state must stay open — nothing may be marked safely dropped');
|
|
550
|
+
assert.ok(existsSync(wt.path), 'the path must still resolve (tombstoned if the checkout itself was removed) — never left dangling');
|
|
551
|
+
// The actual safety property: the branch ref, and the concurrent commit it
|
|
552
|
+
// now names, are fully preserved — regardless of whether the checkout
|
|
553
|
+
// itself survived (git requires removing it before the ref delete can even
|
|
554
|
+
// be attempted; see the ordering note on autoDropCleanManagedWorktreeLocked).
|
|
555
|
+
const refCheck = gitSync(['rev-parse', '--verify', `refs/heads/${wt.branch}`], wt.repo_root);
|
|
556
|
+
assert.equal(refCheck.status, 0, 'the branch ref must still exist');
|
|
557
|
+
assert.equal(refCheck.stdout.trim(), concurrentSha, 'the branch, and the concurrent commit it names, must still be reachable — nothing was lost');
|
|
558
|
+
});
|
|
559
|
+
// An external rewrite of the base branch (e.g. a force-reset) invalidates the
|
|
560
|
+
// containment proof in the same window. The re-verification immediately
|
|
561
|
+
// before the delete must catch this even though the branch itself never
|
|
562
|
+
// moved.
|
|
563
|
+
test('the re-verified base containment refuses when the base is rewritten between the predicate and cleanup', async () => {
|
|
564
|
+
const { proveCleanEmptyManagedWorktree, autoDropCleanManagedWorktreeLocked } = await import('../worktree.js');
|
|
565
|
+
const repo = mkdtempSync(join(tmpdir(), 'crtr-worktree-race-base-'));
|
|
566
|
+
run(['init', '-b', 'main'], repo);
|
|
567
|
+
run(['config', 'user.email', 'test@example.com'], repo);
|
|
568
|
+
run(['config', 'user.name', 'Test'], repo);
|
|
569
|
+
writeFileSync(join(repo, 'README.md'), 'hello\n');
|
|
570
|
+
run(['add', '.'], repo);
|
|
571
|
+
run(['commit', '-m', 'init'], repo);
|
|
572
|
+
const nodeId = 'wt-race-base-rewrite';
|
|
573
|
+
const wt = createManagedWorktree(repo, nodeId);
|
|
574
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
575
|
+
const proof = proveCleanEmptyManagedWorktree(wt);
|
|
576
|
+
assert.ok(proof !== null, 'a fresh clean, zero-commit worktree must prove droppable');
|
|
577
|
+
// Simulate an external force-reset of the base branch in the same window —
|
|
578
|
+
// an unrelated rewrite (not a fast-forward), so the proven branch tip is no
|
|
579
|
+
// longer an ancestor of the new base tip.
|
|
580
|
+
writeFileSync(join(repo, 'rewritten.txt'), 'unrelated history\n');
|
|
581
|
+
run(['add', '.'], repo);
|
|
582
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '--amend', '-m', 'rewritten base tip'], repo);
|
|
583
|
+
const rewrittenBaseSha = gitSync(['rev-parse', 'main'], repo).stdout.trim();
|
|
584
|
+
assert.notEqual(rewrittenBaseSha, proof?.baseSha, 'the base must have actually moved for this test to be meaningful');
|
|
585
|
+
const stillAncestor = gitSync(['merge-base', '--is-ancestor', proof.branchSha, rewrittenBaseSha], repo);
|
|
586
|
+
assert.notEqual(stillAncestor.status, 0, 'the rewrite must actually break containment for this test to be meaningful');
|
|
587
|
+
const result = autoDropCleanManagedWorktreeLocked(nodeId, wt, proof);
|
|
588
|
+
assert.equal(result, null, 'a base rewrite that breaks containment must refuse the drop');
|
|
589
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'state must stay open — nothing may be marked safely dropped');
|
|
590
|
+
assert.ok(existsSync(wt.path), 'the checkout must remain intact');
|
|
591
|
+
assert.equal(gitSync(['show-ref', '--verify', '--quiet', `refs/heads/${wt.branch}`], repo).status, 0, 'the branch ref must still exist — nothing was lost');
|
|
592
|
+
rmSync(repo, { recursive: true, force: true });
|
|
593
|
+
});
|
|
594
|
+
// ---------------------------------------------------------------------------
|
|
595
|
+
// The base-ref TOCTOU: a branch-only compare-and-delete refuses when the
|
|
596
|
+
// BRANCH moves, but a base force-reset between the containment proof and the
|
|
597
|
+
// delete could still leave the delete's own condition (the branch equals the
|
|
598
|
+
// proven SHA) satisfied while the branch is no longer contained in anything.
|
|
599
|
+
// `bestEffortDeleteBranchWithBaseProof` closes this by binding the base's
|
|
600
|
+
// live value into the SAME atomic transaction as the branch delete. These
|
|
601
|
+
// tests reproduce the race against real Git by wrapping the `git worktree
|
|
602
|
+
// remove` call each cleanup path makes strictly between its live ancestry
|
|
603
|
+
// re-check and its ref-deletion transaction — the same technique used above
|
|
604
|
+
// for the branch-only race, and the same one the independent re-review used
|
|
605
|
+
// to reproduce this exact Critical against `6de1c8d`.
|
|
606
|
+
// ---------------------------------------------------------------------------
|
|
607
|
+
test('auto-drop atomic delete refuses when the base is force-reset between the live ancestry check and the ref transaction', async () => {
|
|
608
|
+
const { proveCleanEmptyManagedWorktree, autoDropCleanManagedWorktreeLocked } = await import('../worktree.js');
|
|
609
|
+
const repo = mkdtempSync(join(tmpdir(), 'crtr-worktree-auto-drop-base-window-'));
|
|
610
|
+
run(['init', '-b', 'main'], repo);
|
|
611
|
+
run(['config', 'user.email', 'test@example.com'], repo);
|
|
612
|
+
run(['config', 'user.name', 'Test'], repo);
|
|
613
|
+
writeFileSync(join(repo, 'README.md'), 'hello\n');
|
|
614
|
+
run(['add', '.'], repo);
|
|
615
|
+
run(['commit', '-m', 'init'], repo);
|
|
616
|
+
const preMergeMainSha = gitSync(['rev-parse', 'main'], repo).stdout.trim();
|
|
617
|
+
const nodeId = 'wt-auto-drop-base-window';
|
|
618
|
+
const wt = createManagedWorktree(repo, nodeId);
|
|
619
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
620
|
+
writeFileSync(join(wt.path, 'feature.txt'), 'landed elsewhere\n');
|
|
621
|
+
run(['add', '.'], wt.path);
|
|
622
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'feature'], wt.path);
|
|
623
|
+
const branchSha = gitSync(['rev-parse', 'HEAD'], wt.path).stdout.trim();
|
|
624
|
+
// A manager fast-forwards main past this branch's own tip, exactly like
|
|
625
|
+
// the #327 positive case, so the branch proves clean-and-contained.
|
|
626
|
+
run(['merge', '--ff-only', branchSha], repo);
|
|
627
|
+
assert.equal(gitSync(['rev-parse', 'main'], repo).stdout.trim(), branchSha);
|
|
628
|
+
const proof = proveCleanEmptyManagedWorktree(wt);
|
|
629
|
+
assert.ok(proof !== null, 'the branch, now contained in the moved base, must prove droppable');
|
|
630
|
+
// Wrap `git worktree remove` — the call `autoDropCleanManagedWorktreeLocked`
|
|
631
|
+
// makes strictly AFTER its own live ancestry re-check and strictly BEFORE
|
|
632
|
+
// its ref-deletion transaction — to force-reset main back to its pre-merge
|
|
633
|
+
// tip right before the real removal runs. A sequential re-check placed
|
|
634
|
+
// anywhere before this point cannot see this rewrite; only binding the
|
|
635
|
+
// base's live value into the delete transaction itself can.
|
|
636
|
+
const wrapperDir = mkdtempSync(join(tmpdir(), 'crtr-git-wrapper-'));
|
|
637
|
+
const wrapperPath = join(wrapperDir, 'git');
|
|
638
|
+
const originalPath = process.env['PATH'] ?? '';
|
|
639
|
+
writeFileSync(wrapperPath, `#!/bin/sh
|
|
640
|
+
if [ "$1" = "worktree" ] && [ "$2" = "remove" ] && [ "$3" = "${wt.path}" ]; then
|
|
641
|
+
PATH="$CRTR_TEST_REAL_PATH" git -C "${repo}" update-ref refs/heads/main "${preMergeMainSha}"
|
|
642
|
+
fi
|
|
643
|
+
PATH="$CRTR_TEST_REAL_PATH" exec git "$@"
|
|
644
|
+
`);
|
|
645
|
+
chmodSync(wrapperPath, 0o755);
|
|
646
|
+
process.env['CRTR_TEST_REAL_PATH'] = originalPath;
|
|
647
|
+
process.env['PATH'] = `${wrapperDir}:${originalPath}`;
|
|
648
|
+
let result;
|
|
649
|
+
try {
|
|
650
|
+
result = autoDropCleanManagedWorktreeLocked(nodeId, wt, proof);
|
|
651
|
+
}
|
|
652
|
+
finally {
|
|
653
|
+
process.env['PATH'] = originalPath;
|
|
654
|
+
delete process.env['CRTR_TEST_REAL_PATH'];
|
|
655
|
+
rmSync(wrapperDir, { recursive: true, force: true });
|
|
656
|
+
}
|
|
657
|
+
assert.equal(result, null, 'a base rewritten strictly after the live ancestry check must still refuse the atomic delete');
|
|
658
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'state must stay open — nothing may be marked safely dropped');
|
|
659
|
+
const refCheck = gitSync(['rev-parse', '--verify', `refs/heads/${wt.branch}`], repo);
|
|
660
|
+
assert.equal(refCheck.status, 0, 'the source branch must be preserved');
|
|
661
|
+
assert.equal(refCheck.stdout.trim(), branchSha, 'the branch must still name the proven commit — the source commit remains reachable from this head');
|
|
662
|
+
rmSync(repo, { recursive: true, force: true });
|
|
663
|
+
});
|
|
664
|
+
test('close-landed atomic delete refuses when the base is force-reset between landing and the cleanup delete', () => {
|
|
665
|
+
const repo = mkdtempSync(join(tmpdir(), 'crtr-worktree-close-base-window-'));
|
|
666
|
+
run(['init', '-b', 'main'], repo);
|
|
667
|
+
run(['config', 'user.email', 'test@example.com'], repo);
|
|
668
|
+
run(['config', 'user.name', 'Test'], repo);
|
|
669
|
+
writeFileSync(join(repo, 'README.md'), 'hello\n');
|
|
670
|
+
run(['add', '.'], repo);
|
|
671
|
+
run(['commit', '-m', 'init'], repo);
|
|
672
|
+
const preLandMainSha = gitSync(['rev-parse', 'main'], repo).stdout.trim();
|
|
673
|
+
const nodeId = 'wt-close-base-window';
|
|
674
|
+
const wt = createManagedWorktree(repo, nodeId);
|
|
675
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
676
|
+
writeFileSync(join(wt.path, 'feature.txt'), 'work\n');
|
|
677
|
+
run(['add', '.'], wt.path);
|
|
678
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'feature'], wt.path);
|
|
679
|
+
// Wrap `git worktree remove` — the call `bestEffortRemoveWorktreeCheckout`
|
|
680
|
+
// makes right after landing (fast-forwarding main to the new tip) but
|
|
681
|
+
// strictly before the atomic base+branch delete transaction — to reset main
|
|
682
|
+
// away from the just-landed tip in exactly that window.
|
|
683
|
+
const wrapperDir = mkdtempSync(join(tmpdir(), 'crtr-git-wrapper-'));
|
|
684
|
+
const wrapperPath = join(wrapperDir, 'git');
|
|
685
|
+
const originalPath = process.env['PATH'] ?? '';
|
|
686
|
+
writeFileSync(wrapperPath, `#!/bin/sh
|
|
687
|
+
if [ "$1" = "worktree" ] && [ "$2" = "remove" ] && [ "$3" = "${wt.path}" ]; then
|
|
688
|
+
PATH="$CRTR_TEST_REAL_PATH" git -C "${repo}" update-ref refs/heads/main "${preLandMainSha}"
|
|
689
|
+
fi
|
|
690
|
+
PATH="$CRTR_TEST_REAL_PATH" exec git "$@"
|
|
691
|
+
`);
|
|
692
|
+
chmodSync(wrapperPath, 0o755);
|
|
693
|
+
process.env['CRTR_TEST_REAL_PATH'] = originalPath;
|
|
694
|
+
process.env['PATH'] = `${wrapperDir}:${originalPath}`;
|
|
695
|
+
let result;
|
|
696
|
+
try {
|
|
697
|
+
result = closeManagedWorktree(nodeId);
|
|
698
|
+
}
|
|
699
|
+
finally {
|
|
700
|
+
process.env['PATH'] = originalPath;
|
|
701
|
+
delete process.env['CRTR_TEST_REAL_PATH'];
|
|
702
|
+
rmSync(wrapperDir, { recursive: true, force: true });
|
|
703
|
+
}
|
|
704
|
+
assert.equal(result.branch_deleted, false, 'a base reset in the window between landing and cleanup must refuse the branch delete');
|
|
705
|
+
assert.ok(result.branch_delete_error, 'the refusal must be surfaced as a non-fatal cleanup error');
|
|
706
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'closed', 'the land already succeeded — a cleanup refusal must not un-close it');
|
|
707
|
+
const refCheck = gitSync(['rev-parse', '--verify', `refs/heads/${wt.branch}`], repo);
|
|
708
|
+
assert.equal(refCheck.status, 0, 'the source branch must be preserved when cleanup refuses');
|
|
709
|
+
assert.equal(refCheck.stdout.trim(), result.landed_sha, 'the preserved branch must still name the landed commit — no orphaned landed commit');
|
|
710
|
+
rmSync(repo, { recursive: true, force: true });
|
|
711
|
+
});
|
|
712
|
+
// ---------------------------------------------------------------------------
|
|
713
|
+
// Checkout-removal refusal: `bestEffortRemoveWorktreeCheckout` can report
|
|
714
|
+
// `worktreeRemoved: false` (real Git refused `worktree remove` because a
|
|
715
|
+
// file reappeared after the clean predicate ran). That refusal must itself
|
|
716
|
+
// refuse the whole cleanup — never reach the low-level ref-deletion
|
|
717
|
+
// transaction, which bypasses Git's own checked-out-branch protection.
|
|
718
|
+
// ---------------------------------------------------------------------------
|
|
719
|
+
test('auto-drop refuses and preserves the branch and checkout when checkout removal is refused after the clean predicate', async () => {
|
|
720
|
+
const { proveCleanEmptyManagedWorktree, autoDropCleanManagedWorktreeLocked } = await import('../worktree.js');
|
|
721
|
+
const nodeId = 'wt-auto-drop-removal-refused';
|
|
722
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
723
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
724
|
+
const proof = proveCleanEmptyManagedWorktree(wt);
|
|
725
|
+
assert.ok(proof !== null, 'a fresh clean, zero-commit worktree must prove droppable');
|
|
726
|
+
// A file appears after the clean predicate ran — real `git worktree
|
|
727
|
+
// remove` (no --force) correctly refuses to remove a dirty checkout.
|
|
728
|
+
writeFileSync(join(wt.path, 'late-arrival.txt'), 'appeared after the clean predicate\n');
|
|
729
|
+
const result = autoDropCleanManagedWorktreeLocked(nodeId, wt, proof);
|
|
730
|
+
assert.equal(result, null, 'a checkout-removal refusal must refuse the whole drop, not just skip the branch delete');
|
|
731
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'open', 'refused cleanup must never mutate managed-worktree state');
|
|
732
|
+
assert.equal(gitSync(['show-ref', '--verify', '--quiet', `refs/heads/${wt.branch}`], sourceDir).status, 0, 'the branch must never reach the ref-deletion transaction');
|
|
733
|
+
const list = gitSync(['worktree', 'list', '--porcelain'], sourceDir);
|
|
734
|
+
assert.ok(list.stdout.includes(wt.path), 'the checkout must remain registered and recoverable');
|
|
735
|
+
assert.ok(existsSync(join(wt.path, 'late-arrival.txt')), 'the live checkout, including its uncommitted file, must remain intact');
|
|
736
|
+
});
|
|
737
|
+
test('post-land cleanup timeout preserves the land and releases the repository lock', async () => {
|
|
738
|
+
const nodeId = 'wt-close-cleanup-timeout';
|
|
739
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
740
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
741
|
+
writeFileSync(join(wt.path, 'cleanup-timeout-work.txt'), 'work\n');
|
|
742
|
+
run(['add', '.'], wt.path);
|
|
743
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'cleanup timeout work'], wt.path);
|
|
744
|
+
const baseBefore = gitSync(['rev-parse', 'main'], sourceDir).stdout.trim();
|
|
745
|
+
setWorktreeCleanupRunnerForTest((args, cwd, options) => {
|
|
746
|
+
if (args[0] === 'worktree' && args[1] === 'remove' && args[2] === wt.path) {
|
|
747
|
+
assert.equal(options.timeoutMs, 5_000, 'only post-land cleanup gets the finite deadline');
|
|
748
|
+
return { status: 1, stdout: '', stderr: '', timedOut: true };
|
|
749
|
+
}
|
|
750
|
+
if (args[0] === 'worktree' && args[1] === 'list') {
|
|
751
|
+
assert.equal(options.timeoutMs, 5_000, 'residual inspection gets the same finite deadline');
|
|
752
|
+
const inspection = gitSync(args, cwd, undefined, options);
|
|
753
|
+
return {
|
|
754
|
+
...inspection,
|
|
755
|
+
// Branch identity is not checkout-validity: a switch/detach racing the
|
|
756
|
+
// timed-out remove still leaves a live registration that needs --force.
|
|
757
|
+
stdout: inspection.stdout.replace(`branch refs/heads/${wt.branch}`, 'branch refs/heads/externally-switched'),
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
return gitSync(args, cwd, undefined, options);
|
|
761
|
+
});
|
|
762
|
+
try {
|
|
763
|
+
const started = Date.now();
|
|
764
|
+
const result = closeManagedWorktree(nodeId);
|
|
765
|
+
const elapsed = Date.now() - started;
|
|
766
|
+
const cleanupDeadlineMs = 5_000;
|
|
767
|
+
const schedulingMarginMs = 500;
|
|
768
|
+
assert.ok(elapsed < cleanupDeadlineMs - schedulingMarginMs, `cleanup timeout must return promptly, took ${elapsed}ms`);
|
|
769
|
+
assert.notEqual(result.landed_sha, baseBefore, 'the land must contain a new commit');
|
|
770
|
+
assert.equal(gitSync(['rev-parse', 'main'], sourceDir).stdout.trim(), result.landed_sha, 'the base must contain the landed commit');
|
|
771
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'closed', 'timeout must preserve the closed state');
|
|
772
|
+
assert.equal(result.worktree_removed, false);
|
|
773
|
+
assert.equal(result.branch_deleted, false);
|
|
774
|
+
assert.match(result.worktree_remove_error ?? '', /timed out/);
|
|
775
|
+
assert.match(result.worktree_remove_error ?? '', /git -C .* worktree remove --force/);
|
|
776
|
+
assert.doesNotMatch(result.worktree_remove_error ?? '', /worktree prune/, 'a valid registered checkout needs force-removal even if its branch changed');
|
|
777
|
+
assert.equal(gitSync(['show-ref', '--verify', '--quiet', `refs/heads/${wt.branch}`], sourceDir).status, 0, 'the source branch must remain reachable');
|
|
778
|
+
// The node that timed out must still be able to complete its own finalization
|
|
779
|
+
// from the recreated cwd; a different-node lock check alone is insufficient.
|
|
780
|
+
await push(nodeId, { kind: 'final', body: 'timed-out cleanup node finalized' });
|
|
781
|
+
assert.equal(getNode(nodeId)?.status, 'done', 'the timed-out node must finalize itself successfully');
|
|
782
|
+
assert.ok(getNode(nodeId)?.final_report, 'the timed-out node must record its canonical final');
|
|
783
|
+
// A second close must acquire the same repository lock and complete, proving
|
|
784
|
+
// the timed-out cleanup did not strand the lock around the finished land.
|
|
785
|
+
const followupId = 'wt-close-after-cleanup-timeout';
|
|
786
|
+
const followup = createManagedWorktree(sourceDir, followupId);
|
|
787
|
+
createNode(node(followupId, { cwd: followup.path, managed_worktree: followup }));
|
|
788
|
+
writeFileSync(join(followup.path, 'followup-work.txt'), 'followup\n');
|
|
789
|
+
run(['add', '.'], followup.path);
|
|
790
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'followup work'], followup.path);
|
|
791
|
+
const followupResult = closeManagedWorktree(followupId);
|
|
792
|
+
assert.equal(followupResult.worktree_removed, true, 'subsequent finalization must complete');
|
|
793
|
+
assert.equal(getNode(followupId)?.managed_worktree?.state, 'closed');
|
|
794
|
+
}
|
|
795
|
+
finally {
|
|
796
|
+
setWorktreeCleanupRunnerForTest();
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
test('post-land cleanup timeout gives prune guidance for a tombstone residual', () => {
|
|
800
|
+
const nodeId = 'wt-close-cleanup-timeout-tombstone';
|
|
801
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
802
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
803
|
+
writeFileSync(join(wt.path, 'cleanup-tombstone-work.txt'), 'work\n');
|
|
804
|
+
run(['add', '.'], wt.path);
|
|
805
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'cleanup tombstone work'], wt.path);
|
|
806
|
+
setWorktreeCleanupRunnerForTest((args, cwd, options) => {
|
|
807
|
+
if (args[0] === 'worktree' && args[1] === 'remove' && args[2] === wt.path) {
|
|
808
|
+
assert.equal(options.timeoutMs, 5_000, 'the timed-out remove gets the finite deadline');
|
|
809
|
+
rmSync(wt.path, { recursive: true, force: true });
|
|
810
|
+
mkdirSync(wt.path, { recursive: true });
|
|
811
|
+
return { status: 1, stdout: '', stderr: '', timedOut: true };
|
|
812
|
+
}
|
|
813
|
+
if (args[0] === 'worktree' && args[1] === 'list') {
|
|
814
|
+
assert.equal(options.timeoutMs, 5_000, 'residual inspection gets the same finite deadline');
|
|
815
|
+
const branchSha = gitSync(['rev-parse', `refs/heads/${wt.branch}`], sourceDir).stdout.trim();
|
|
816
|
+
return {
|
|
817
|
+
status: 0,
|
|
818
|
+
stdout: `worktree ${wt.path}\nHEAD ${branchSha}\nbranch refs/heads/${wt.branch}\nprunable gitdir file points to non-existent location\n`,
|
|
819
|
+
stderr: '',
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
return gitSync(args, cwd, undefined, options);
|
|
823
|
+
});
|
|
824
|
+
try {
|
|
825
|
+
const result = closeManagedWorktree(nodeId);
|
|
826
|
+
const guidance = result.worktree_remove_error ?? '';
|
|
827
|
+
assert.equal(result.worktree_removed, false);
|
|
828
|
+
assert.equal(result.branch_deleted, false);
|
|
829
|
+
assert.match(guidance, /git -C .* worktree prune/);
|
|
830
|
+
assert.match(guidance, /rm -rf/);
|
|
831
|
+
assert.doesNotMatch(guidance, /worktree remove --force/);
|
|
832
|
+
assert.ok(existsSync(wt.path), 'the tombstone residual must remain available for guided cleanup');
|
|
833
|
+
}
|
|
834
|
+
finally {
|
|
835
|
+
setWorktreeCleanupRunnerForTest();
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
test('close-landed never low-level-deletes the source branch when checkout removal is refused', () => {
|
|
839
|
+
const nodeId = 'wt-close-removal-refused';
|
|
840
|
+
const wt = createManagedWorktree(sourceDir, nodeId);
|
|
841
|
+
createNode(node(nodeId, { cwd: wt.path, managed_worktree: wt }));
|
|
842
|
+
writeFileSync(join(wt.path, 'removal-refused-work.txt'), 'work\n');
|
|
843
|
+
run(['add', '.'], wt.path);
|
|
844
|
+
run(['-c', 'user.email=test@example.com', '-c', 'user.name=Test', 'commit', '-m', 'feature'], wt.path);
|
|
845
|
+
// Wrap `git worktree remove` to drop an untracked file into the checkout
|
|
846
|
+
// immediately before delegating to the real removal, so the real
|
|
847
|
+
// `git worktree remove` (no --force) refuses — exactly as it would if a
|
|
848
|
+
// process wrote into the checkout after close's own dirty check ran.
|
|
849
|
+
const wrapperDir = mkdtempSync(join(tmpdir(), 'crtr-git-wrapper-'));
|
|
850
|
+
const wrapperPath = join(wrapperDir, 'git');
|
|
851
|
+
const originalPath = process.env['PATH'] ?? '';
|
|
852
|
+
writeFileSync(wrapperPath, `#!/bin/sh
|
|
853
|
+
if [ "$1" = "worktree" ] && [ "$2" = "remove" ] && [ "$3" = "${wt.path}" ]; then
|
|
854
|
+
echo "late arrival" > "${wt.path}/late-arrival.txt"
|
|
855
|
+
fi
|
|
856
|
+
PATH="$CRTR_TEST_REAL_PATH" exec git "$@"
|
|
857
|
+
`);
|
|
858
|
+
chmodSync(wrapperPath, 0o755);
|
|
859
|
+
process.env['CRTR_TEST_REAL_PATH'] = originalPath;
|
|
860
|
+
process.env['PATH'] = `${wrapperDir}:${originalPath}`;
|
|
861
|
+
let result;
|
|
862
|
+
try {
|
|
863
|
+
result = closeManagedWorktree(nodeId);
|
|
864
|
+
}
|
|
865
|
+
finally {
|
|
866
|
+
process.env['PATH'] = originalPath;
|
|
867
|
+
delete process.env['CRTR_TEST_REAL_PATH'];
|
|
868
|
+
rmSync(wrapperDir, { recursive: true, force: true });
|
|
869
|
+
}
|
|
870
|
+
assert.equal(result.worktree_removed, false, 'the real checkout removal must genuinely refuse');
|
|
871
|
+
assert.equal(result.branch_deleted, false, 'a checkout-removal refusal must never be treated as safe to low-level-delete the branch');
|
|
872
|
+
assert.equal(getNode(nodeId)?.managed_worktree?.state, 'closed', 'the land already succeeded — a cleanup refusal must not un-close it');
|
|
873
|
+
const refCheck = gitSync(['rev-parse', '--verify', `refs/heads/${wt.branch}`], sourceDir);
|
|
874
|
+
assert.equal(refCheck.status, 0, 'the source branch must be preserved when its checkout could not be removed');
|
|
875
|
+
assert.equal(refCheck.stdout.trim(), result.landed_sha, 'the preserved branch must still name the landed commit');
|
|
876
|
+
});
|