@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,1210 @@
|
|
|
1
|
+
// fake-engine.ts — a deterministic in-process stand-in for the pi SDK engine,
|
|
2
|
+
// the SDK analog of fixtures/fake-pi-host.ts.
|
|
3
|
+
//
|
|
4
|
+
// This is NOT an LLM and NOT a mock of the canvas extensions. It occupies the
|
|
5
|
+
// pi SDK's place INSIDE the REAL broker (src/core/runtime/broker.ts): the broker
|
|
6
|
+
// loads it through the `CRTR_BROKER_ENGINE` seam (broker-sdk.ts `loadBrokerEngine`),
|
|
7
|
+
// then drives it exactly as it drives the real `@earendil-works/pi-coding-agent`
|
|
8
|
+
// engine — SessionManager.open/create, createAgentSession, session.bindExtensions,
|
|
9
|
+
// session.subscribe, session.prompt. We load the REAL `-e` canvas extensions (the
|
|
10
|
+
// modules the runtime put in the node's broker-launch.json) and fire REAL
|
|
11
|
+
// lifecycle events under harness control, so the real hooks (canvas-stophook,
|
|
12
|
+
// canvas-inbox-watcher) and the real broker drive real canvas state — across the
|
|
13
|
+
// detached broker process boundary, with NOTHING in the broker mocked.
|
|
14
|
+
//
|
|
15
|
+
// It is run UNDER tsx in the broker process (the harness puts `--import tsx/esm`
|
|
16
|
+
// in the broker's NODE_OPTIONS), so the `.ts` extension paths and this `.ts`
|
|
17
|
+
// module both resolve. By the time the broker calls our SessionManager/
|
|
18
|
+
// createAgentSession, piInvocationToSdkConfig has merged inv.env into
|
|
19
|
+
// process.env, so CRTR_NODE_ID / CRTR_HOME are set — that is how we find the
|
|
20
|
+
// node dir.
|
|
21
|
+
//
|
|
22
|
+
// Proof / control surface — IDENTICAL filenames to fake-pi-host.ts, so the
|
|
23
|
+
// EXISTING harness observers (awaitBoot, awaitWake, eventCount, bootCount,
|
|
24
|
+
// injected) work for broker nodes UNCHANGED:
|
|
25
|
+
// <nodeDir>/fake-pi.boot.json — argv + env + loaded exts (latest boot)
|
|
26
|
+
// <nodeDir>/fake-pi.boots.jsonl — append-only, one line per boot (broker pid)
|
|
27
|
+
// <nodeDir>/fake-pi.events.jsonl — append-only, one line per fired event
|
|
28
|
+
// <nodeDir>/fake-pi.injected.jsonl — every sendUserMessage (inbox-watcher wake)
|
|
29
|
+
// <nodeDir>/fake-pi.error — any boot/import failure
|
|
30
|
+
// <nodeDir>/fake-pi.cmd — harness writes ONE JSON command (turn|stop|auto_retry|dialog)
|
|
31
|
+
// <nodeDir>/fake-pi.dialog.jsonl — one line per resolved unattended dialog (§5.4)
|
|
32
|
+
import { writeFileSync, readFileSync, existsSync, mkdirSync, appendFileSync, unlinkSync, } from 'node:fs';
|
|
33
|
+
import { join, dirname } from 'node:path';
|
|
34
|
+
import { randomUUID } from 'node:crypto';
|
|
35
|
+
import { DefaultResourceLoader, getAgentDir } from '@earendil-works/pi-coding-agent';
|
|
36
|
+
import { MANAGED_PROVIDER_COOLING_DIAGNOSTIC } from '../../runtime/managed-provider-cooling.js';
|
|
37
|
+
/** Test seams for prompt-scoped failures before session_start. The one-shot
|
|
38
|
+
* variant records its first failure per node so the next cycling retry can
|
|
39
|
+
* reach boot confirmation. */
|
|
40
|
+
export const FAIL_BEFORE_SESSION_START = '__FAIL_BEFORE_SESSION_START__';
|
|
41
|
+
export const FAIL_BEFORE_SESSION_START_ONCE = '__FAIL_BEFORE_SESSION_START_ONCE__';
|
|
42
|
+
/** Text marker that makes `session.prompt()` REJECT outright (no agent_start,
|
|
43
|
+
* no turn) — the shape a broker whose model resolved but whose provider has
|
|
44
|
+
* no installed credential produces ("No API key found for <provider>"). */
|
|
45
|
+
export const REJECT_PROMPT_CALL = '__REJECT_PROMPT_CALL__';
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// node dir / proof helpers
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
function nodeDirFromEnv() {
|
|
50
|
+
const home = (process.env['CRTR_HOME'] ?? '').trim();
|
|
51
|
+
const nodeId = (process.env['CRTR_NODE_ID'] ?? '').trim();
|
|
52
|
+
if (home === '' || nodeId === '') {
|
|
53
|
+
throw new Error('[fake-engine] CRTR_HOME / CRTR_NODE_ID missing in env');
|
|
54
|
+
}
|
|
55
|
+
const dir = join(home, 'nodes', nodeId);
|
|
56
|
+
mkdirSync(dir, { recursive: true });
|
|
57
|
+
return dir;
|
|
58
|
+
}
|
|
59
|
+
function recordError(dir, msg) {
|
|
60
|
+
try {
|
|
61
|
+
appendFileSync(join(dir, 'fake-pi.error'), msg + '\n');
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
/* best effort */
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
process.stderr.write('[fake-engine] ' + msg + '\n');
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
/* ignore */
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
// SessionManager — the broker calls .open(path) (resume) or .create(cwd) (fresh)
|
|
75
|
+
// and hands the result to createAgentSession. sessionId/sessionFile round-trip
|
|
76
|
+
// through it, so a resume (`--session <pi_session_file>`) re-opens the SAME
|
|
77
|
+
// .jsonl the fresh start created — the load-bearing identity for revive.
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
export class SessionManager {
|
|
80
|
+
sessionId;
|
|
81
|
+
sessionFile;
|
|
82
|
+
resumed;
|
|
83
|
+
constructor(sessionId, sessionFile, resumed) {
|
|
84
|
+
this.sessionId = sessionId;
|
|
85
|
+
this.sessionFile = sessionFile;
|
|
86
|
+
this.resumed = resumed;
|
|
87
|
+
}
|
|
88
|
+
/** Fresh start: a brand-new session whose .jsonl lives under the node dir
|
|
89
|
+
* (created empty if missing, like fake-pi-host). */
|
|
90
|
+
static create(_cwd) {
|
|
91
|
+
const dir = nodeDirFromEnv();
|
|
92
|
+
const sessionFile = join(dir, 'fake-session.jsonl');
|
|
93
|
+
if (!existsSync(sessionFile))
|
|
94
|
+
writeFileSync(sessionFile, '');
|
|
95
|
+
return new SessionManager(`fake-sess-${randomUUID()}`, sessionFile, false);
|
|
96
|
+
}
|
|
97
|
+
/** Spawn-time fork: create the fork's distinct fake session. The focused
|
|
98
|
+
* broker tests do not replay source history, but they must reach the same
|
|
99
|
+
* post-fork model/session construction path as the real engine. */
|
|
100
|
+
static forkFrom(_source, cwd) {
|
|
101
|
+
return SessionManager.create(cwd);
|
|
102
|
+
}
|
|
103
|
+
/** Resume: round-trip the .jsonl PATH the revive passed via `--session`. */
|
|
104
|
+
static open(path) {
|
|
105
|
+
return new SessionManager(`fake-sess-resume-${randomUUID()}`, path, true);
|
|
106
|
+
}
|
|
107
|
+
getSessionId() {
|
|
108
|
+
return this.sessionId;
|
|
109
|
+
}
|
|
110
|
+
getSessionFile() {
|
|
111
|
+
return this.sessionFile;
|
|
112
|
+
}
|
|
113
|
+
/** The directory containing the session file — the real SessionManager's
|
|
114
|
+
* getSessionDir(). The broker prewarms the session-list cache with it at boot
|
|
115
|
+
* (broker.ts runBroker), so the fixture must expose it or every broker boot
|
|
116
|
+
* crashes before it binds view.sock. */
|
|
117
|
+
getSessionDir() {
|
|
118
|
+
return dirname(this.sessionFile);
|
|
119
|
+
}
|
|
120
|
+
leafId = null;
|
|
121
|
+
/** Cycling support (crtr-cycle marker) — mirrors the real SDK's getLeafId/
|
|
122
|
+
* resetLeaf/appendCustomEntry just enough that `buildBrokerSession`'s cycling
|
|
123
|
+
* branch (broker.ts) doesn't throw. The fake has no real cross-boot tree at
|
|
124
|
+
* this point (FakeSession builds a fresh SessionTree every boot regardless),
|
|
125
|
+
* so these are recording stubs, not a faithful branch model —
|
|
126
|
+
* cycleAwareMessages already degrades to single-cycle passthrough for a
|
|
127
|
+
* session manager without getEntries/getBranch (never implemented on the
|
|
128
|
+
* fake), so multi-cycle REPLAY is out of scope for the fixture; only "does
|
|
129
|
+
* not crash" is in scope. */
|
|
130
|
+
getLeafId() {
|
|
131
|
+
return this.leafId;
|
|
132
|
+
}
|
|
133
|
+
resetLeaf() {
|
|
134
|
+
this.leafId = null;
|
|
135
|
+
}
|
|
136
|
+
appendCustomEntry(_customType, _data) {
|
|
137
|
+
this.leafId = `fake-cycle-${randomUUID().slice(0, 8)}`;
|
|
138
|
+
return this.leafId;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
// AgentSessionEvent stream synthesis (T8 / G1, G3, G4, G8). The fake emits a
|
|
143
|
+
// REALISTIC streaming assistant turn through session.subscribe — the SAME channel
|
|
144
|
+
// the real pi engine feeds the broker's fan-out — so the frames a `crtr surface attach`
|
|
145
|
+
// client receives are byte-for-byte real AgentSessionEvents. The EMITTED event
|
|
146
|
+
// shapes are typed against the real `AgentSessionEvent` union from pi (whose full
|
|
147
|
+
// 17 variants are message_start/update/end, tool_execution_start/update/end,
|
|
148
|
+
// agent_start/end, turn_start/end, queue_update, compaction_start/end, auto_retry_
|
|
149
|
+
// start/end, session_info_changed, thinking_level_changed) — emit() takes that
|
|
150
|
+
// union, so a drift in the shape of any variant emitTurn() constructs (the
|
|
151
|
+
// streaming subset: the message_*, tool_execution_*, agent/turn start+end events)
|
|
152
|
+
// fails the build, not a test.
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
/** A minimal but fully-typed AssistantMessage. `pad` bytes of filler text let a
|
|
155
|
+
* test size a single frame to multiple MiB (G8 backpressure flood). */
|
|
156
|
+
function assistantMessage(text, pad = 0) {
|
|
157
|
+
return {
|
|
158
|
+
role: 'assistant',
|
|
159
|
+
content: [{ type: 'text', text: pad > 0 ? `${text} ${'x'.repeat(pad)}` : text }],
|
|
160
|
+
api: 'anthropic-messages',
|
|
161
|
+
provider: 'anthropic',
|
|
162
|
+
model: 'fake-sonnet',
|
|
163
|
+
usage: {
|
|
164
|
+
input: 10,
|
|
165
|
+
output: 5,
|
|
166
|
+
cacheRead: 0,
|
|
167
|
+
cacheWrite: 0,
|
|
168
|
+
totalTokens: 15,
|
|
169
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
|
170
|
+
},
|
|
171
|
+
stopReason: 'stop',
|
|
172
|
+
timestamp: Date.now(),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/** A streaming text-delta event (the `assistantMessageEvent` carried by a
|
|
176
|
+
* message_update). Kept small (the big payload rides in message_update.message). */
|
|
177
|
+
function textDelta(partial, delta) {
|
|
178
|
+
return { type: 'text_delta', contentIndex: 0, delta, partial };
|
|
179
|
+
}
|
|
180
|
+
class SessionTree {
|
|
181
|
+
entries = new Map();
|
|
182
|
+
children = new Map();
|
|
183
|
+
leafId = null;
|
|
184
|
+
append(message) {
|
|
185
|
+
const entry = {
|
|
186
|
+
type: 'message',
|
|
187
|
+
id: randomUUID().slice(0, 8),
|
|
188
|
+
parentId: this.leafId,
|
|
189
|
+
timestamp: new Date().toISOString(),
|
|
190
|
+
message,
|
|
191
|
+
};
|
|
192
|
+
this.entries.set(entry.id, entry);
|
|
193
|
+
const siblings = this.children.get(entry.parentId) ?? [];
|
|
194
|
+
siblings.push(entry.id);
|
|
195
|
+
this.children.set(entry.parentId, siblings);
|
|
196
|
+
this.leafId = entry.id;
|
|
197
|
+
return entry;
|
|
198
|
+
}
|
|
199
|
+
/** Synthetic in-place rewind for the broker navigate_tree regression lock:
|
|
200
|
+
* drop the last turn (assistant leaf + its user parent) by re-anchoring the
|
|
201
|
+
* leaf past it. The abandoned tail is left in the map (not deleted), mirroring
|
|
202
|
+
* a real branch switch — only the ACTIVE branch shortens. */
|
|
203
|
+
rewindOneTurn() {
|
|
204
|
+
const leaf = this.leafId === null ? undefined : this.entries.get(this.leafId);
|
|
205
|
+
if (leaf === undefined)
|
|
206
|
+
return;
|
|
207
|
+
const user = leaf.parentId === null ? undefined : this.entries.get(leaf.parentId);
|
|
208
|
+
this.leafId = user !== undefined ? user.parentId : leaf.parentId;
|
|
209
|
+
}
|
|
210
|
+
getLeafId() {
|
|
211
|
+
return this.leafId;
|
|
212
|
+
}
|
|
213
|
+
getEntry(id) {
|
|
214
|
+
return this.entries.get(id);
|
|
215
|
+
}
|
|
216
|
+
getTree() {
|
|
217
|
+
return (this.children.get(null) ?? []).map((id) => this.node(id)).filter((node) => node !== null);
|
|
218
|
+
}
|
|
219
|
+
getUserMessagesForForking() {
|
|
220
|
+
return [...this.entries.values()]
|
|
221
|
+
.filter((entry) => entry.message.role === 'user')
|
|
222
|
+
.map((entry) => ({ entryId: entry.id, text: this.textOf(entry.message), timestamp: entry.timestamp }));
|
|
223
|
+
}
|
|
224
|
+
buildSessionContext() {
|
|
225
|
+
return { messages: this.branchMessages(), thinkingLevel: 'off', model: null };
|
|
226
|
+
}
|
|
227
|
+
branchMessages() {
|
|
228
|
+
const ids = [];
|
|
229
|
+
let cur = this.leafId;
|
|
230
|
+
while (cur !== null) {
|
|
231
|
+
const entry = this.entries.get(cur);
|
|
232
|
+
if (entry === undefined)
|
|
233
|
+
break;
|
|
234
|
+
ids.push(cur);
|
|
235
|
+
cur = entry.parentId;
|
|
236
|
+
}
|
|
237
|
+
ids.reverse();
|
|
238
|
+
return ids.map((id) => this.entries.get(id)?.message).filter((m) => m !== undefined);
|
|
239
|
+
}
|
|
240
|
+
node(id) {
|
|
241
|
+
const entry = this.entries.get(id);
|
|
242
|
+
if (entry === undefined)
|
|
243
|
+
return null;
|
|
244
|
+
return {
|
|
245
|
+
entry,
|
|
246
|
+
children: (this.children.get(id) ?? []).map((child) => this.node(child)).filter((node) => node !== null),
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
textOf(message) {
|
|
250
|
+
const content = Array.isArray(message.content) ? message.content : [];
|
|
251
|
+
for (const part of content) {
|
|
252
|
+
if (typeof part?.text === 'string' && part.text !== '')
|
|
253
|
+
return part.text;
|
|
254
|
+
}
|
|
255
|
+
return '';
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
class FakeSession {
|
|
259
|
+
sm;
|
|
260
|
+
loader;
|
|
261
|
+
dir;
|
|
262
|
+
tree = new SessionTree();
|
|
263
|
+
promptFailuresRemaining;
|
|
264
|
+
extensions = [];
|
|
265
|
+
injected = [];
|
|
266
|
+
uiContext;
|
|
267
|
+
shutdownHandler;
|
|
268
|
+
streaming = false;
|
|
269
|
+
disposed = false;
|
|
270
|
+
eventSeq = 0;
|
|
271
|
+
timer;
|
|
272
|
+
/** Full-tier graceful-teardown seam: a real active turn that only settles
|
|
273
|
+
* after abort(), so the broker's bounded abort wait is observable. */
|
|
274
|
+
heldTurn;
|
|
275
|
+
// The broker's fan-out subscribers (broker.ts `session.subscribe(...)`) and the
|
|
276
|
+
// accumulating message history the catch-up snapshot serializes (G3).
|
|
277
|
+
listeners = new Set();
|
|
278
|
+
/** Idle watcher sends received while bindExtensions is still running. They
|
|
279
|
+
* start naturally as soon as broker.ts subscribes, without a retry loop that
|
|
280
|
+
* could keep a failed broker process alive forever. */
|
|
281
|
+
pendingIdlePrompts = [];
|
|
282
|
+
messageLog = [];
|
|
283
|
+
turnEndLeafId = null;
|
|
284
|
+
/** Testability seam: `hasPendingMessages()` reported to `agent_settled`
|
|
285
|
+
* handlers. Real pi's `AgentSession.hasPendingMessages()` reflects its
|
|
286
|
+
* steer+followUp queue; this fake has no such queue, so a test that needs to
|
|
287
|
+
* reproduce a settle observed WITH pending sends (the real incident this
|
|
288
|
+
* fixture otherwise cannot exercise) sets CRTR_FAKE_ENGINE_PENDING_AT_SETTLE=1
|
|
289
|
+
* before spawning the broker. Unset → false, matching the fixture's actual
|
|
290
|
+
* (queueless) state. */
|
|
291
|
+
pendingAtSettle = process.env['CRTR_FAKE_ENGINE_PENDING_AT_SETTLE'] === '1';
|
|
292
|
+
// The construction-time services.modelRuntime (broker-sdk services path). For
|
|
293
|
+
// a model-less (tier-3) boot this is broker.ts's SELF-HEALING masking PROXY
|
|
294
|
+
// (modelLessRegistry): getAvailable()/getModel() answer empty/undefined while
|
|
295
|
+
// masked, then broker.ts reveal()s the SAME proxy the instant construction
|
|
296
|
+
// returns. Exposing it as `session.modelRuntime` (real-SDK parity — broker.ts
|
|
297
|
+
// registryOf(session) builds its facade over it) lets the broker's
|
|
298
|
+
// list_models handler observe the 0a self-heal — a post-/login list_models
|
|
299
|
+
// reports the now-available model iff reveal() actually ran.
|
|
300
|
+
modelRt;
|
|
301
|
+
constructor(sm, loader, model, modelRuntime) {
|
|
302
|
+
this.sm = sm;
|
|
303
|
+
this.loader = loader;
|
|
304
|
+
this.modelRt = modelRuntime;
|
|
305
|
+
this.dir = nodeDirFromEnv();
|
|
306
|
+
// Mirror the real pi SDK: a model-less construction (`model === undefined`)
|
|
307
|
+
// does NOT leave `session.model` undefined — Agent.createMutableAgentState()
|
|
308
|
+
// falls back to a hardcoded unknown-stub. Representing that here is what
|
|
309
|
+
// makes the full/ tests exercise the broker's real sessionHasNoModel()/
|
|
310
|
+
// isUnknownModel() guard path (broker.ts) rather than the `=== undefined`
|
|
311
|
+
// shortcut that never happens against the real engine.
|
|
312
|
+
this.currentModel = model ?? UNKNOWN_MODEL_STUB;
|
|
313
|
+
this.recordModel();
|
|
314
|
+
const configured = Number(process.env['CRTR_FAKE_ENGINE_PROMPT_FAILS'] ?? '0');
|
|
315
|
+
this.promptFailuresRemaining = Number.isFinite(configured) && configured > 0 ? Math.floor(configured) : 0;
|
|
316
|
+
this.syncTreeSnapshot();
|
|
317
|
+
}
|
|
318
|
+
// --- broker-read getters. buildSnapshot (on a client hello) reads messages/
|
|
319
|
+
// stats/model: T8 clients attach and assert on welcome.snapshot, so messages
|
|
320
|
+
// returns the accrued history; stats/model stay cheap stubs. ---------------
|
|
321
|
+
get messages() {
|
|
322
|
+
return this.tree.buildSessionContext().messages;
|
|
323
|
+
}
|
|
324
|
+
// The broker's catch-up snapshot reconstructs history from the persisted
|
|
325
|
+
// session tree (sessionManager.buildSessionContext) — the single source of
|
|
326
|
+
// truth, since `session.messages` can be sliced by pi's retry/overflow/
|
|
327
|
+
// compaction recovery. Mirror that surface so the fake's snapshot still serves
|
|
328
|
+
// the accrued history (G2/G3). The fake's persisted analog is the active branch.
|
|
329
|
+
get sessionManager() {
|
|
330
|
+
return {
|
|
331
|
+
buildSessionContext: () => this.tree.buildSessionContext(),
|
|
332
|
+
getLeafId: () => this.tree.getLeafId(),
|
|
333
|
+
getEntry: (id) => this.tree.getEntry(id),
|
|
334
|
+
getTree: () => this.tree.getTree(),
|
|
335
|
+
getUserMessagesForForking: () => this.tree.getUserMessagesForForking(),
|
|
336
|
+
getSessionId: () => this.sm.getSessionId(),
|
|
337
|
+
getSessionFile: () => this.sm.getSessionFile(),
|
|
338
|
+
getSessionDir: () => this.sm.getSessionDir(),
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
get sessionId() {
|
|
342
|
+
return this.sm.getSessionId();
|
|
343
|
+
}
|
|
344
|
+
get sessionFile() {
|
|
345
|
+
return this.sm.getSessionFile();
|
|
346
|
+
}
|
|
347
|
+
get model() {
|
|
348
|
+
return this.currentModel;
|
|
349
|
+
}
|
|
350
|
+
// set_model regression surface: the broker resolves the spec via the services
|
|
351
|
+
// registry stub below, calls setModel, then broadcasts `model_changed` off
|
|
352
|
+
// this getter — store whatever it hands us.
|
|
353
|
+
currentModel;
|
|
354
|
+
currentThinkingLevel;
|
|
355
|
+
get thinkingLevel() {
|
|
356
|
+
return this.currentThinkingLevel;
|
|
357
|
+
}
|
|
358
|
+
setThinkingLevel(level) {
|
|
359
|
+
this.currentThinkingLevel = level;
|
|
360
|
+
}
|
|
361
|
+
recordModel() {
|
|
362
|
+
// Treat the unknown-stub as "no model" on the recorded surface (parity with
|
|
363
|
+
// broker.ts formatModelSpec) so a zero-auth boot's model reads `null`, not
|
|
364
|
+
// a bogus `unknown/unknown`.
|
|
365
|
+
const m = this.currentModel;
|
|
366
|
+
const record = m === undefined || isUnknownModelStub(m) ? null : m;
|
|
367
|
+
writeFileSync(join(this.dir, 'fake-pi.model.json'), JSON.stringify(record));
|
|
368
|
+
}
|
|
369
|
+
setModel(model) {
|
|
370
|
+
this.currentModel = model;
|
|
371
|
+
this.recordModel();
|
|
372
|
+
return Promise.resolve();
|
|
373
|
+
}
|
|
374
|
+
// --- list_models / cycle_model read surface (real-SDK parity) ----------------
|
|
375
|
+
/** The broker's read-op picker data (buildListModelsData → registryOf(session))
|
|
376
|
+
* reads this. For a model-less boot it is the self-healing mask proxy — see
|
|
377
|
+
* modelRt. */
|
|
378
|
+
get modelRuntime() {
|
|
379
|
+
// Inert empty runtime if a construction ever omitted it — no production
|
|
380
|
+
// path does (createAgentSessionFromServices always threads it), so this only
|
|
381
|
+
// guards list_models against throwing inside the broker's data builder.
|
|
382
|
+
return this.modelRt ?? {
|
|
383
|
+
getModel: () => undefined,
|
|
384
|
+
getAvailableSnapshot: () => [],
|
|
385
|
+
getAvailable: async () => [],
|
|
386
|
+
getModels: () => [],
|
|
387
|
+
hasConfiguredAuth: () => false,
|
|
388
|
+
getError: () => undefined,
|
|
389
|
+
refresh: async () => { },
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
/** The `--models` scoped cycle set — none in these fixtures. */
|
|
393
|
+
get scopedModels() {
|
|
394
|
+
return [];
|
|
395
|
+
}
|
|
396
|
+
/** The slice of SettingsManager the list_models data builder touches. */
|
|
397
|
+
get settingsManager() {
|
|
398
|
+
return { getEnabledModels: () => null };
|
|
399
|
+
}
|
|
400
|
+
get isStreaming() {
|
|
401
|
+
return this.streaming;
|
|
402
|
+
}
|
|
403
|
+
getSessionStats() {
|
|
404
|
+
return { messages: 0, tokens: 0 };
|
|
405
|
+
}
|
|
406
|
+
syncTreeSnapshot() {
|
|
407
|
+
try {
|
|
408
|
+
writeFileSync(join(this.dir, 'fake-pi.tree.json'), JSON.stringify({
|
|
409
|
+
leafId: this.tree.getLeafId(),
|
|
410
|
+
activeBranch: this.tree.buildSessionContext().messages,
|
|
411
|
+
tree: this.tree.getTree(),
|
|
412
|
+
userMessagesForForking: this.tree.getUserMessagesForForking(),
|
|
413
|
+
}, null, 2));
|
|
414
|
+
}
|
|
415
|
+
catch {
|
|
416
|
+
/* best effort */
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// --- naming is cosmetic (broker calls it in a try/catch) ---------------------
|
|
420
|
+
setSessionName(_name) {
|
|
421
|
+
/* no-op recording stub */
|
|
422
|
+
}
|
|
423
|
+
// --- controller-drive stubs (no controller connects in these tests) ----------
|
|
424
|
+
prompt(text, _options) {
|
|
425
|
+
// Rejection seam: the engine refuses the call itself (pi's no-provider-
|
|
426
|
+
// credential shape) — the promise rejects and NO lifecycle event fires.
|
|
427
|
+
if (text.includes(REJECT_PROMPT_CALL)) {
|
|
428
|
+
return Promise.reject(new Error('No API key found for anthropic'));
|
|
429
|
+
}
|
|
430
|
+
// The broker calls this for the controller-less retry path. Emit the turn
|
|
431
|
+
// on the broker's subscribe channel and also run the real extension hooks so
|
|
432
|
+
// the canvas stophook records the fault marker and the broker can schedule
|
|
433
|
+
// the next retry.
|
|
434
|
+
const fail = this.promptFailuresRemaining > 0;
|
|
435
|
+
if (fail)
|
|
436
|
+
this.promptFailuresRemaining--;
|
|
437
|
+
return this.emitTurn(text, { fail, runHooks: true });
|
|
438
|
+
}
|
|
439
|
+
steer(_text) {
|
|
440
|
+
return Promise.resolve();
|
|
441
|
+
}
|
|
442
|
+
followUp(_text) {
|
|
443
|
+
return Promise.resolve();
|
|
444
|
+
}
|
|
445
|
+
/** In-memory recording only — no proof file, matching the offline in-process
|
|
446
|
+
* contract broker-sdk-wiring.test.ts's REAL-SDK tests already use. Purely
|
|
447
|
+
* defensive: broker.ts's driveEngine now calls `session.sendCustomMessage`
|
|
448
|
+
* on ANY frame whose inline memory-reference guidance resolves, so a fake-
|
|
449
|
+
* engine-backed lifecycle test whose fixture prompt text happens to contain
|
|
450
|
+
* a resolvable `/name` token must not crash on a missing method. */
|
|
451
|
+
customMessages = [];
|
|
452
|
+
sendCustomMessage(message, options) {
|
|
453
|
+
this.customMessages.push({
|
|
454
|
+
customType: message.customType,
|
|
455
|
+
content: message.content,
|
|
456
|
+
display: message.display,
|
|
457
|
+
deliverAs: options?.deliverAs,
|
|
458
|
+
});
|
|
459
|
+
return Promise.resolve();
|
|
460
|
+
}
|
|
461
|
+
abort() {
|
|
462
|
+
const held = this.heldTurn;
|
|
463
|
+
if (held === undefined)
|
|
464
|
+
return Promise.resolve();
|
|
465
|
+
held.release();
|
|
466
|
+
return held.settled;
|
|
467
|
+
}
|
|
468
|
+
/** In-place tree rewind (broker `navigate_tree`). Mirrors the real SDK's
|
|
469
|
+
* contract: the session file is unchanged, the live history is truncated,
|
|
470
|
+
* and the navigated-to user message's text comes back as `editorText`. The
|
|
471
|
+
* fake's "rewind" re-anchors the active branch without deleting the abandoned
|
|
472
|
+
* tail so the welcome snapshot can prove the one-nudge property. */
|
|
473
|
+
async navigateTree(targetId, _options) {
|
|
474
|
+
// The broker regression this locks is pure frame plumbing (navigate_tree →
|
|
475
|
+
// reWelcomeAll + ack.detail), not real tree traversal, so the viewer sends a
|
|
476
|
+
// SYNTHETIC targetId. Rewind the active branch by one full turn (the last
|
|
477
|
+
// user+assistant pair) so the re-welcome serves an observably shorter
|
|
478
|
+
// transcript, and echo the target as editorText (pi parity: the navigator
|
|
479
|
+
// restores the navigated-to user message's text to the editor).
|
|
480
|
+
const hold = join(this.dir, 'fake-pi.navigate-hold');
|
|
481
|
+
if (existsSync(hold)) {
|
|
482
|
+
writeFileSync(join(this.dir, 'fake-pi.navigate-started'), '');
|
|
483
|
+
await new Promise((resolve) => {
|
|
484
|
+
const wait = () => {
|
|
485
|
+
if (existsSync(join(this.dir, 'fake-pi.navigate-release')))
|
|
486
|
+
resolve();
|
|
487
|
+
else
|
|
488
|
+
setTimeout(wait, 10);
|
|
489
|
+
};
|
|
490
|
+
wait();
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
this.tree.rewindOneTurn();
|
|
494
|
+
this.syncTreeSnapshot();
|
|
495
|
+
return { cancelled: false, editorText: `rewound-to:${targetId}` };
|
|
496
|
+
}
|
|
497
|
+
// --- the single engine event stream the broker fans out (broker.ts subscribes
|
|
498
|
+
// here and broadcasts each event VERBATIM to every attached viewer) --------
|
|
499
|
+
subscribe(listener) {
|
|
500
|
+
const l = listener;
|
|
501
|
+
this.listeners.add(l);
|
|
502
|
+
// The loader starts extension timers before broker.ts reaches subscribe().
|
|
503
|
+
// An idle watcher send in that narrow bind window is held here until the
|
|
504
|
+
// broker can observe its lifecycle; no polling/retry loop survives a failed
|
|
505
|
+
// bind with no subscriber.
|
|
506
|
+
const pending = this.pendingIdlePrompts.splice(0);
|
|
507
|
+
for (const content of pending)
|
|
508
|
+
this.startIdlePrompt(content);
|
|
509
|
+
return () => {
|
|
510
|
+
this.listeners.delete(l);
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
startIdlePrompt(content) {
|
|
514
|
+
setImmediate(() => {
|
|
515
|
+
if (this.disposed)
|
|
516
|
+
return;
|
|
517
|
+
void this.prompt(content).catch((e) => recordError(this.dir, `inbox prompt: ${String(e)}`));
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
/** Fan one typed AgentSessionEvent out to every broker subscriber. A throwing
|
|
521
|
+
* listener is recorded, never propagated (mirrors the broker's m7 try/catch). */
|
|
522
|
+
emit(event) {
|
|
523
|
+
for (const l of this.listeners) {
|
|
524
|
+
try {
|
|
525
|
+
l(event);
|
|
526
|
+
}
|
|
527
|
+
catch (e) {
|
|
528
|
+
recordError(this.dir, `subscribe listener threw: ${String(e)}`);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
/** Emit a realistic streaming assistant turn on the subscribe channel:
|
|
533
|
+
* agent_start → turn_start → message_start → message_update×N →
|
|
534
|
+
* tool_execution_start/update/end → message_end → turn_end → agent_end. Drives
|
|
535
|
+
* G1 (controller prompt relay), G3 (produce-while-detached, accrues messageLog),
|
|
536
|
+
* and G8 (a fast event stream — `updates`/`padBytes` size the flood that sheds a
|
|
537
|
+
* stalled viewer at the broker HWM). A per-update setImmediate yield lets a
|
|
538
|
+
* fast viewer drain between frames so only the stalled one trips the HWM. */
|
|
539
|
+
async emitTurn(text, opts = {}) {
|
|
540
|
+
if (this.disposed)
|
|
541
|
+
return;
|
|
542
|
+
const updates = opts.updates ?? 3;
|
|
543
|
+
const pad = opts.padBytes ?? 0;
|
|
544
|
+
const withTool = opts.tool ?? true;
|
|
545
|
+
const fail = opts.fail === true;
|
|
546
|
+
const small = assistantMessage(text);
|
|
547
|
+
// A normal turn yields with setImmediate (fast). A sized flood (G8, pad>0) is
|
|
548
|
+
// PACED with a small real delay so a fast (reading) viewer always drains each
|
|
549
|
+
// frame and stays under the HWM, while a stalled (non-reading) viewer's backlog
|
|
550
|
+
// still climbs monotonically past the 32 MiB byte cap and is shed. Without the
|
|
551
|
+
// pace the burst outruns the reader's event loop and sheds the fast viewer too.
|
|
552
|
+
const yieldTick = () => pad > 0 ? new Promise((r) => setTimeout(r, 3)) : new Promise((r) => setImmediate(r));
|
|
553
|
+
this.streaming = true;
|
|
554
|
+
if (opts.runHooks === true) {
|
|
555
|
+
await this.fire('agent_start', {}, this.buildCtx());
|
|
556
|
+
}
|
|
557
|
+
this.emit({ type: 'agent_start' });
|
|
558
|
+
this.emit({ type: 'turn_start' });
|
|
559
|
+
this.emit({ type: 'message_start', message: small });
|
|
560
|
+
if (process.env['PI_FAKE_ENGINE_HOLD_TURN'] === '1') {
|
|
561
|
+
let release;
|
|
562
|
+
let resolveSettled;
|
|
563
|
+
const settled = new Promise((resolve) => { resolveSettled = resolve; });
|
|
564
|
+
const releaseGate = new Promise((resolve) => { release = resolve; });
|
|
565
|
+
this.heldTurn = { release, settled, resolveSettled };
|
|
566
|
+
await releaseGate;
|
|
567
|
+
}
|
|
568
|
+
// F2 (message_update coalescing): the broker now coalesces message_update
|
|
569
|
+
// relays (latest-wins, ~75 ms window), so a padded flood riding message_update
|
|
570
|
+
// can no longer climb a stalled viewer's backlog — the coalescer would shed
|
|
571
|
+
// the flood before the HWM does. A sized flood (pad>0, G8) therefore rides
|
|
572
|
+
// tool_execution_update frames, which the broker relays VERBATIM (only
|
|
573
|
+
// message_update is coalesced — tool output streams remain the realistic
|
|
574
|
+
// unbounded-backlog vector M1 guards against). The flood gets its own
|
|
575
|
+
// tool_execution_start so the frame sequence stays well-formed.
|
|
576
|
+
const floodToolCallId = pad > 0 ? `flood-${++this.eventSeq}` : undefined;
|
|
577
|
+
if (floodToolCallId !== undefined) {
|
|
578
|
+
this.emit({
|
|
579
|
+
type: 'tool_execution_start',
|
|
580
|
+
toolCallId: floodToolCallId,
|
|
581
|
+
toolName: 'read',
|
|
582
|
+
args: { path: 'flood.txt' },
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
for (let i = 0; i < updates; i++) {
|
|
586
|
+
if (this.disposed)
|
|
587
|
+
return;
|
|
588
|
+
this.emit({
|
|
589
|
+
type: 'message_update',
|
|
590
|
+
message: assistantMessage(`${text} [${i + 1}/${updates}]`),
|
|
591
|
+
assistantMessageEvent: textDelta(small, `chunk ${i + 1}`),
|
|
592
|
+
});
|
|
593
|
+
if (floodToolCallId !== undefined) {
|
|
594
|
+
// The big payload (G8) rides the partialResult; ~padBytes per frame.
|
|
595
|
+
this.emit({
|
|
596
|
+
type: 'tool_execution_update',
|
|
597
|
+
toolCallId: floodToolCallId,
|
|
598
|
+
toolName: 'read',
|
|
599
|
+
args: { path: 'flood.txt' },
|
|
600
|
+
partialResult: { chunk: 'x'.repeat(pad) },
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
await yieldTick();
|
|
604
|
+
}
|
|
605
|
+
if (floodToolCallId !== undefined) {
|
|
606
|
+
this.emit({
|
|
607
|
+
type: 'tool_execution_end',
|
|
608
|
+
toolCallId: floodToolCallId,
|
|
609
|
+
toolName: 'read',
|
|
610
|
+
result: { ok: true },
|
|
611
|
+
isError: false,
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
if (withTool) {
|
|
615
|
+
const toolCallId = `call-${++this.eventSeq}`;
|
|
616
|
+
this.emit({ type: 'tool_execution_start', toolCallId, toolName: 'read', args: { path: 'README.md' } });
|
|
617
|
+
this.emit({
|
|
618
|
+
type: 'tool_execution_update',
|
|
619
|
+
toolCallId,
|
|
620
|
+
toolName: 'read',
|
|
621
|
+
args: { path: 'README.md' },
|
|
622
|
+
partialResult: { bytes: 42 },
|
|
623
|
+
});
|
|
624
|
+
this.emit({ type: 'tool_execution_end', toolCallId, toolName: 'read', result: { ok: true }, isError: false });
|
|
625
|
+
}
|
|
626
|
+
if (this.disposed)
|
|
627
|
+
return;
|
|
628
|
+
const userMsg = {
|
|
629
|
+
role: 'user',
|
|
630
|
+
content: [{ type: 'text', text }],
|
|
631
|
+
timestamp: Date.now(),
|
|
632
|
+
};
|
|
633
|
+
this.tree.append(userMsg);
|
|
634
|
+
this.syncTreeSnapshot();
|
|
635
|
+
const finalMsg = fail
|
|
636
|
+
? { ...assistantMessage(text), stopReason: 'error', errorMessage: 'Connection error.' }
|
|
637
|
+
: assistantMessage(text);
|
|
638
|
+
this.emit({ type: 'message_end', message: finalMsg });
|
|
639
|
+
this.emit({ type: 'turn_end', message: finalMsg, toolResults: [] });
|
|
640
|
+
this.messageLog.push(finalMsg);
|
|
641
|
+
const anchorBeforeFinal = this.tree.getLeafId();
|
|
642
|
+
this.turnEndLeafId = anchorBeforeFinal;
|
|
643
|
+
this.tree.append(finalMsg);
|
|
644
|
+
this.syncTreeSnapshot();
|
|
645
|
+
if (opts.runHooks === true) {
|
|
646
|
+
const hookCtx = this.buildCtx();
|
|
647
|
+
await this.fire('turn_end', { message: finalMsg, toolResults: [] }, hookCtx);
|
|
648
|
+
const hookMessages = fail
|
|
649
|
+
? [...this.tree.buildSessionContext().messages, finalMsg]
|
|
650
|
+
: this.tree.buildSessionContext().messages.slice();
|
|
651
|
+
await this.fire('agent_end', { messages: hookMessages, willRetry: false }, hookCtx);
|
|
652
|
+
// Pi settles extensions before it notifies session subscribers. This order
|
|
653
|
+
// is load-bearing for the broker's cooperative shutdown: the watcher
|
|
654
|
+
// commits its inbox cursor at settle, then the broker may exit.
|
|
655
|
+
await this.fire('agent_settled', { type: 'agent_settled' }, hookCtx);
|
|
656
|
+
}
|
|
657
|
+
this.turnEndLeafId = null;
|
|
658
|
+
// Pi exposes agent_end while the run is still active; agent_settled is the
|
|
659
|
+
// first subscriber event after isStreaming clears. Keep that production
|
|
660
|
+
// ordering so broker retry tests cannot green-light an impossible arm point.
|
|
661
|
+
const agentEndMessages = fail
|
|
662
|
+
? [...this.tree.buildSessionContext().messages, finalMsg]
|
|
663
|
+
: this.tree.buildSessionContext().messages.slice();
|
|
664
|
+
this.emit({ type: 'agent_end', messages: agentEndMessages, willRetry: false });
|
|
665
|
+
this.streaming = false;
|
|
666
|
+
this.emit({ type: 'agent_settled' });
|
|
667
|
+
const held = this.heldTurn;
|
|
668
|
+
this.heldTurn = undefined;
|
|
669
|
+
held?.resolveSettled();
|
|
670
|
+
}
|
|
671
|
+
dispose() {
|
|
672
|
+
this.disposed = true;
|
|
673
|
+
if (this.timer !== undefined)
|
|
674
|
+
clearInterval(this.timer);
|
|
675
|
+
}
|
|
676
|
+
// --- bindExtensions: drive the loader's ALREADY-loaded extensions. The REAL
|
|
677
|
+
// DefaultResourceLoader.reload() (broker.ts, BEFORE createAgentSession) has
|
|
678
|
+
// already imported the `-e` canvas extensions via jiti and called each
|
|
679
|
+
// default(pi) against the SDK's `notInitialized` runtime — registering their
|
|
680
|
+
// handlers but leaving every action method (pi.sendUserMessage, …) a stub
|
|
681
|
+
// that THROWS during load. We must NOT re-import them: a native import() is a
|
|
682
|
+
// jiti-independent SECOND module instance, so the inbox-watcher's module-
|
|
683
|
+
// level timer would run TWICE — and the reload() copy (bound to the throwing
|
|
684
|
+
// runtime) wins the race for the shared on-disk inbox cursor, consuming the
|
|
685
|
+
// entry and never delivering. Instead we replicate the minimal slice of
|
|
686
|
+
// agent-session's bindCore: swap the shared runtime's action methods IN PLACE
|
|
687
|
+
// so the real handlers' pi.sendUserMessage delivers into our proof files,
|
|
688
|
+
// then emit session_start into their handler maps so the REAL canvas-stophook
|
|
689
|
+
// records pi_session_id/file + recordPid(process.pid=broker pid). The broker's
|
|
690
|
+
// shutdownHandler is wired into ctx.shutdown so the stophook's done/idle-
|
|
691
|
+
// release/refresh branches exit the broker. -------------------------------
|
|
692
|
+
async bindExtensions(opts) {
|
|
693
|
+
this.uiContext = opts.uiContext;
|
|
694
|
+
this.shutdownHandler = opts.shutdownHandler;
|
|
695
|
+
const { argv, extPaths, label, prompt } = readLaunch(this.dir);
|
|
696
|
+
// SessionManager.open backs both strict resume and in-place cycling. The
|
|
697
|
+
// latter roots a fresh context, so report and fault-inject it as non-resuming.
|
|
698
|
+
const resuming = this.sm.resumed && !argv.includes('--crtr-new-cycle');
|
|
699
|
+
// M-1 regression seam: simulate a broker that throws BEFORE session_start
|
|
700
|
+
// (no pid, no session ever recorded). Only a fresh start carries the kickoff
|
|
701
|
+
// prompt; the throw propagates out of bindExtensions → runBroker rejects →
|
|
702
|
+
// broker-cli's fatal catch logs to job/broker.log + exit(1).
|
|
703
|
+
if (!resuming && (prompt ?? '').includes(FAIL_BEFORE_SESSION_START)) {
|
|
704
|
+
throw new Error('[fake-engine] simulated pre-session_start boot failure');
|
|
705
|
+
}
|
|
706
|
+
if (!resuming && (prompt ?? '').includes(FAIL_BEFORE_SESSION_START_ONCE)) {
|
|
707
|
+
const marker = join(this.dir, 'yield-retry.once-failed');
|
|
708
|
+
if (!existsSync(marker)) {
|
|
709
|
+
writeFileSync(marker, '1');
|
|
710
|
+
throw new Error('[fake-engine] simulated one-shot pre-session_start boot failure');
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
// bindCore (minimal): adopt the loader's extensions + their shared runtime, and
|
|
714
|
+
// replace the throwing notInitialized action methods with working ones. The
|
|
715
|
+
// handlers themselves stay the REAL ones the SDK registered during reload().
|
|
716
|
+
const loaded = [];
|
|
717
|
+
const failedExt = [];
|
|
718
|
+
try {
|
|
719
|
+
const result = this.loader?.getExtensions();
|
|
720
|
+
this.extensions = result?.extensions ?? [];
|
|
721
|
+
for (const e of this.extensions)
|
|
722
|
+
loaded.push(e.path);
|
|
723
|
+
for (const err of result?.errors ?? []) {
|
|
724
|
+
failedExt.push(String(err?.error ?? err));
|
|
725
|
+
}
|
|
726
|
+
const rt = result?.runtime;
|
|
727
|
+
if (rt !== undefined) {
|
|
728
|
+
rt.assertActive = () => { };
|
|
729
|
+
rt.sendUserMessage = (content, options) => {
|
|
730
|
+
this.recordInjected({ content, deliverAs: options?.deliverAs });
|
|
731
|
+
// Pi's unqualified idle send starts a prompt. Drive that actual fake
|
|
732
|
+
// session lifecycle so a watcher wake reaches agent_end/settled and the
|
|
733
|
+
// broker subscriber naturally, rather than asking a test to dispatch a
|
|
734
|
+
// separate synthetic turn. Steered/follow-up sends remain queued proof
|
|
735
|
+
// records: they belong to an already-running turn in this focused fake.
|
|
736
|
+
if (options?.deliverAs === undefined) {
|
|
737
|
+
// The loader's watcher timer can tick while bindExtensions is still
|
|
738
|
+
// awaiting session_start, before broker.ts installs subscribe(). Hold
|
|
739
|
+
// that send until subscription rather than completing an unobserved
|
|
740
|
+
// turn or spinning an event-loop retry if bind fails.
|
|
741
|
+
if (this.listeners.size === 0)
|
|
742
|
+
this.pendingIdlePrompts.push(content);
|
|
743
|
+
else
|
|
744
|
+
this.startIdlePrompt(content);
|
|
745
|
+
}
|
|
746
|
+
};
|
|
747
|
+
rt.sendMessage = (message, options) => this.recordInjected({ content: JSON.stringify(message), deliverAs: options?.deliverAs });
|
|
748
|
+
rt.setSessionName = () => { };
|
|
749
|
+
}
|
|
750
|
+
else {
|
|
751
|
+
recordError(this.dir, 'bindExtensions: resourceLoader.getExtensions() returned no runtime');
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
catch (e) {
|
|
755
|
+
recordError(this.dir, `bindExtensions getExtensions/bindCore failed: ${String(e)}`);
|
|
756
|
+
}
|
|
757
|
+
const ctx = this.buildCtx();
|
|
758
|
+
// session_start: the real boot-confirm hook captures session id/file + the
|
|
759
|
+
// broker's pid (recordPid(process.pid)) and clears any pending refresh.
|
|
760
|
+
await this.fire('session_start', { reason: resuming ? 'resume' : 'startup' }, ctx);
|
|
761
|
+
// The boot proof the harness asserts on (same shape as fake-pi-host's boot).
|
|
762
|
+
const env = process.env;
|
|
763
|
+
const boot = {
|
|
764
|
+
pid: process.pid, // the broker pid (recorded as pi_pid by the stophook)
|
|
765
|
+
nodeId: (env['CRTR_NODE_ID'] ?? '').trim(),
|
|
766
|
+
home: (env['CRTR_HOME'] ?? '').trim(),
|
|
767
|
+
rawArgv: argv,
|
|
768
|
+
extPaths,
|
|
769
|
+
loaded,
|
|
770
|
+
failedExt,
|
|
771
|
+
sessionId: this.sm.getSessionId(),
|
|
772
|
+
sessionFile: this.sm.getSessionFile(),
|
|
773
|
+
resuming,
|
|
774
|
+
label: label ?? null,
|
|
775
|
+
prompt: prompt ?? null,
|
|
776
|
+
env: {
|
|
777
|
+
CRTR_NODE_ID: env['CRTR_NODE_ID'] ?? null,
|
|
778
|
+
CRTR_KIND: env['CRTR_KIND'] ?? null,
|
|
779
|
+
CRTR_MODE: env['CRTR_MODE'] ?? null,
|
|
780
|
+
CRTR_LIFECYCLE: env['CRTR_LIFECYCLE'] ?? null,
|
|
781
|
+
CRTR_NODE_CWD: env['CRTR_NODE_CWD'] ?? null,
|
|
782
|
+
CRTR_HOME: env['CRTR_HOME'] ?? null,
|
|
783
|
+
CRTR_PARENT_NODE_ID: env['CRTR_PARENT_NODE_ID'] ?? null,
|
|
784
|
+
CRTR_ROOT_SESSION: env['CRTR_ROOT_SESSION'] ?? null,
|
|
785
|
+
CRTR_SUBTREE: env['CRTR_SUBTREE'] ?? null,
|
|
786
|
+
CRTR_FRONT_DOOR: env['CRTR_FRONT_DOOR'] ?? null,
|
|
787
|
+
},
|
|
788
|
+
injectedDuringBoot: this.injected.slice(),
|
|
789
|
+
};
|
|
790
|
+
writeFileSync(join(this.dir, 'fake-pi.boot.json'), JSON.stringify(boot, null, 2));
|
|
791
|
+
try {
|
|
792
|
+
appendFileSync(join(this.dir, 'fake-pi.boots.jsonl'), JSON.stringify(boot) + '\n');
|
|
793
|
+
}
|
|
794
|
+
catch {
|
|
795
|
+
/* best effort */
|
|
796
|
+
}
|
|
797
|
+
// Control loop: poll for one harness command at a time (turn | stop | dialog).
|
|
798
|
+
this.timer = setInterval(() => {
|
|
799
|
+
void this.step().catch((e) => recordError(this.dir, `step: ${String(e)}`));
|
|
800
|
+
}, 100);
|
|
801
|
+
if (typeof this.timer.unref === 'function')
|
|
802
|
+
this.timer.unref();
|
|
803
|
+
}
|
|
804
|
+
// --- record an injected user message (the inbox-watcher wake proof). Called by
|
|
805
|
+
// the runtime's swapped-in sendUserMessage/sendMessage. ---------------------
|
|
806
|
+
recordInjected(rec) {
|
|
807
|
+
this.injected.push(rec);
|
|
808
|
+
try {
|
|
809
|
+
appendFileSync(join(this.dir, 'fake-pi.injected.jsonl'), JSON.stringify({ ...rec, ts: Date.now() }) + '\n');
|
|
810
|
+
}
|
|
811
|
+
catch {
|
|
812
|
+
/* best effort */
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
// --- the ctx passed to fired handlers (union across both focus extensions) ---
|
|
816
|
+
buildCtx() {
|
|
817
|
+
return {
|
|
818
|
+
sessionManager: {
|
|
819
|
+
getSessionId: () => this.sm.getSessionId(),
|
|
820
|
+
getSessionFile: () => this.sm.getSessionFile(),
|
|
821
|
+
getLeafId: () => this.turnEndLeafId ?? this.tree.getLeafId(),
|
|
822
|
+
},
|
|
823
|
+
getContextUsage: () => ({ tokens: 1000 }),
|
|
824
|
+
// Wired to the broker's shutdownHandler: the stophook calls ctx.shutdown()
|
|
825
|
+
// in exactly its done / idle-release / refresh branches → disposeAndExit.
|
|
826
|
+
shutdown: () => {
|
|
827
|
+
this.shutdownHandler?.();
|
|
828
|
+
},
|
|
829
|
+
isIdle: () => !this.streaming,
|
|
830
|
+
abort: () => { },
|
|
831
|
+
hasPendingMessages: () => this.pendingAtSettle,
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
// Append a durable record of every fired event BEFORE its handlers run — the
|
|
835
|
+
// harness's robust "the broker received my command and is dispatching it"
|
|
836
|
+
// signal, surviving a handler that exits the process (agent_end → ctx.shutdown
|
|
837
|
+
// → broker disposeAndExit → process.exit).
|
|
838
|
+
recordEvent(event, ev) {
|
|
839
|
+
try {
|
|
840
|
+
const reason = ev?.reason;
|
|
841
|
+
appendFileSync(join(this.dir, 'fake-pi.events.jsonl'), JSON.stringify({ seq: ++this.eventSeq, event, reason: reason ?? null, ts: Date.now() }) + '\n');
|
|
842
|
+
}
|
|
843
|
+
catch {
|
|
844
|
+
/* best effort */
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
async fire(event, ev, ctx) {
|
|
848
|
+
this.recordEvent(event, ev);
|
|
849
|
+
// Dispatch into the loader's REAL extension handler maps (the same handlers
|
|
850
|
+
// the SDK's reload() registered as each extension called pi.on(event, …)).
|
|
851
|
+
for (const ext of this.extensions) {
|
|
852
|
+
for (const h of ext.handlers.get(event) ?? []) {
|
|
853
|
+
try {
|
|
854
|
+
await h(ev, ctx);
|
|
855
|
+
}
|
|
856
|
+
catch (e) {
|
|
857
|
+
recordError(this.dir, `handler ${event} threw: ${String(e)}`);
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
// --- the command channel: one JSON command at a time, atomically renamed in --
|
|
863
|
+
async step() {
|
|
864
|
+
if (this.disposed)
|
|
865
|
+
return;
|
|
866
|
+
const cmdFile = join(this.dir, 'fake-pi.cmd');
|
|
867
|
+
if (!existsSync(cmdFile))
|
|
868
|
+
return;
|
|
869
|
+
let cmd = null;
|
|
870
|
+
try {
|
|
871
|
+
cmd = JSON.parse(readFileSync(cmdFile, 'utf8'));
|
|
872
|
+
}
|
|
873
|
+
catch {
|
|
874
|
+
cmd = null;
|
|
875
|
+
}
|
|
876
|
+
try {
|
|
877
|
+
unlinkSync(cmdFile);
|
|
878
|
+
}
|
|
879
|
+
catch {
|
|
880
|
+
/* ignore */
|
|
881
|
+
}
|
|
882
|
+
if (cmd)
|
|
883
|
+
await this.dispatch(cmd);
|
|
884
|
+
}
|
|
885
|
+
async dispatch(cmd) {
|
|
886
|
+
const ctx = this.buildCtx();
|
|
887
|
+
switch (cmd.cmd) {
|
|
888
|
+
case 'stream':
|
|
889
|
+
// Drive a subscribe-channel streaming turn WITHOUT a controller (G3:
|
|
890
|
+
// produce-while-detached) or with sized frames (G8: a fast event stream
|
|
891
|
+
// that sheds a stalled viewer at the HWM). Pure fan-out — no stophook, no
|
|
892
|
+
// exit — so the broker stays alive.
|
|
893
|
+
await this.emitTurn(cmd.text ?? 'streamed turn', {
|
|
894
|
+
updates: cmd.updates,
|
|
895
|
+
padBytes: cmd.padBytes,
|
|
896
|
+
tool: cmd.tool,
|
|
897
|
+
});
|
|
898
|
+
break;
|
|
899
|
+
case 'turn':
|
|
900
|
+
this.streaming = true;
|
|
901
|
+
await this.fire('agent_start', {}, ctx);
|
|
902
|
+
this.emit({ type: 'agent_start' });
|
|
903
|
+
this.streaming = false;
|
|
904
|
+
await this.fire('turn_end', { message: { role: 'assistant', usage: { input: 10, output: 5 }, model: 'fake' } }, ctx);
|
|
905
|
+
await this.fire('agent_end', { messages: [{ role: 'assistant', stopReason: 'stop', content: [{ type: 'text', text: cmd.text ?? '' }] }] }, ctx);
|
|
906
|
+
await this.fire('agent_settled', { type: 'agent_settled' }, ctx);
|
|
907
|
+
this.emit({ type: 'agent_settled' });
|
|
908
|
+
break;
|
|
909
|
+
case 'stop': {
|
|
910
|
+
// Match pi's lifecycle: the stophook sees agent_end while the run is
|
|
911
|
+
// active, then the subscriber receives agent_settled after it clears.
|
|
912
|
+
this.streaming = true;
|
|
913
|
+
const stopMessages = [
|
|
914
|
+
{
|
|
915
|
+
role: 'assistant',
|
|
916
|
+
stopReason: cmd.reason ?? 'stop',
|
|
917
|
+
// A real engine attaches errorMessage on a stopReason:'error'
|
|
918
|
+
// turn; the stophook classifies it for the active-fault marker.
|
|
919
|
+
// Forward it so a test can drive a CONNECTION stall faithfully.
|
|
920
|
+
...(cmd.errorMessage === undefined ? {} : { errorMessage: cmd.errorMessage }),
|
|
921
|
+
// A managed-provider cooling terminal carries the earliest pool
|
|
922
|
+
// deadline as a typed diagnostic that survives verbatim into
|
|
923
|
+
// agent_end.messages; the stophook reads it (extractCoolingDeadline)
|
|
924
|
+
// to stamp retry.nextAt. Attached only when a test drives `deadline`.
|
|
925
|
+
...(cmd.deadline === undefined
|
|
926
|
+
? {}
|
|
927
|
+
: {
|
|
928
|
+
diagnostics: [
|
|
929
|
+
{
|
|
930
|
+
type: MANAGED_PROVIDER_COOLING_DIAGNOSTIC,
|
|
931
|
+
timestamp: Date.now(),
|
|
932
|
+
details: { rateLimitedUntil: cmd.deadline },
|
|
933
|
+
},
|
|
934
|
+
],
|
|
935
|
+
}),
|
|
936
|
+
content: [{ type: 'text', text: cmd.text ?? '' }],
|
|
937
|
+
},
|
|
938
|
+
];
|
|
939
|
+
await this.fire('agent_end', { messages: stopMessages }, ctx);
|
|
940
|
+
// Every attempt reaches the broker subscriber while streaming; only the
|
|
941
|
+
// following settled event may publish its fault or arm a retry timer.
|
|
942
|
+
this.emit({ type: 'agent_end', messages: stopMessages, willRetry: false });
|
|
943
|
+
this.streaming = false;
|
|
944
|
+
await this.fire('agent_settled', { type: 'agent_settled' }, ctx);
|
|
945
|
+
this.emit({ type: 'agent_settled' });
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
case 'overflow': {
|
|
949
|
+
const raw = {
|
|
950
|
+
role: 'assistant',
|
|
951
|
+
stopReason: 'error',
|
|
952
|
+
errorMessage: 'Your input exceeds the context window of this model.',
|
|
953
|
+
content: [],
|
|
954
|
+
};
|
|
955
|
+
const rawMessages = [raw];
|
|
956
|
+
const emitAttemptEnd = async () => {
|
|
957
|
+
await this.fire('agent_end', { messages: rawMessages, willRetry: false }, ctx);
|
|
958
|
+
this.emit({ type: 'agent_end', messages: rawMessages, willRetry: false });
|
|
959
|
+
};
|
|
960
|
+
const emitRecoveredContinuation = async () => {
|
|
961
|
+
await this.fire('agent_start', {}, ctx);
|
|
962
|
+
this.emit({ type: 'agent_start' });
|
|
963
|
+
const recovered = assistantMessage('recovered after compaction');
|
|
964
|
+
await this.fire('turn_end', { message: recovered, toolResults: [] }, ctx);
|
|
965
|
+
this.emit({ type: 'turn_end', message: recovered, toolResults: [] });
|
|
966
|
+
await this.fire('agent_end', { messages: [recovered], willRetry: false }, ctx);
|
|
967
|
+
this.emit({ type: 'agent_end', messages: [recovered], willRetry: false });
|
|
968
|
+
};
|
|
969
|
+
const emitDefinitiveOverflowFailure = () => {
|
|
970
|
+
this.emit({
|
|
971
|
+
type: 'compaction_end',
|
|
972
|
+
reason: 'overflow',
|
|
973
|
+
result: undefined,
|
|
974
|
+
aborted: false,
|
|
975
|
+
willRetry: false,
|
|
976
|
+
errorMessage: 'Context overflow recovery failed after one compact-and-retry attempt. Try reducing context or switching to a larger-context model.',
|
|
977
|
+
});
|
|
978
|
+
};
|
|
979
|
+
this.streaming = true;
|
|
980
|
+
await this.fire('agent_start', {}, ctx);
|
|
981
|
+
this.emit({ type: 'agent_start' });
|
|
982
|
+
await emitAttemptEnd();
|
|
983
|
+
if (cmd.outcome === 'recover') {
|
|
984
|
+
this.emit({
|
|
985
|
+
type: 'compaction_end',
|
|
986
|
+
reason: 'overflow',
|
|
987
|
+
result: { summary: 'compacted', firstKeptEntryId: 'entry-1', tokensBefore: 200_000 },
|
|
988
|
+
aborted: false,
|
|
989
|
+
willRetry: true,
|
|
990
|
+
});
|
|
991
|
+
await emitRecoveredContinuation();
|
|
992
|
+
}
|
|
993
|
+
else if (cmd.outcome === 'fail') {
|
|
994
|
+
this.emit({
|
|
995
|
+
type: 'compaction_end',
|
|
996
|
+
reason: 'overflow',
|
|
997
|
+
result: { summary: 'compacted', firstKeptEntryId: 'entry-1', tokensBefore: 200_000 },
|
|
998
|
+
aborted: false,
|
|
999
|
+
willRetry: true,
|
|
1000
|
+
});
|
|
1001
|
+
await this.fire('agent_start', {}, ctx);
|
|
1002
|
+
this.emit({ type: 'agent_start' });
|
|
1003
|
+
await emitAttemptEnd();
|
|
1004
|
+
emitDefinitiveOverflowFailure();
|
|
1005
|
+
}
|
|
1006
|
+
else if (cmd.outcome === 'failure-continued') {
|
|
1007
|
+
emitDefinitiveOverflowFailure();
|
|
1008
|
+
await emitRecoveredContinuation();
|
|
1009
|
+
}
|
|
1010
|
+
this.streaming = false;
|
|
1011
|
+
await this.fire('agent_settled', { type: 'agent_settled' }, ctx);
|
|
1012
|
+
this.emit({ type: 'agent_settled' });
|
|
1013
|
+
writeFileSync(join(this.dir, 'fake-pi.overflow.json'), JSON.stringify({ outcome: cmd.outcome ?? 'uncompacted' }));
|
|
1014
|
+
break;
|
|
1015
|
+
}
|
|
1016
|
+
case 'auto_retry':
|
|
1017
|
+
// Drive the exact broker subscription event that pi emits before its
|
|
1018
|
+
// retry timer, so provider fallback policy runs in the live broker.
|
|
1019
|
+
this.emit({ type: 'auto_retry_start', errorMessage: cmd.errorMessage ?? 'rate limit exceeded' });
|
|
1020
|
+
// The broker begins its fallback async; the next check phase follows
|
|
1021
|
+
// its resolved registry/setModel microtasks and is a deterministic
|
|
1022
|
+
// receipt for a rejected target (which intentionally never changes model).
|
|
1023
|
+
await new Promise((resolve) => setImmediate(resolve));
|
|
1024
|
+
writeFileSync(join(this.dir, 'fake-pi.auto-retry.json'), JSON.stringify({ at: Date.now() }));
|
|
1025
|
+
break;
|
|
1026
|
+
case 'display':
|
|
1027
|
+
// Paint through the broker's REAL uiContext exactly as an extension does.
|
|
1028
|
+
// These are LEVELS with no pi getter, so the broker is their only holder
|
|
1029
|
+
// and must carry them in the catch-up snapshot for a LATE joiner.
|
|
1030
|
+
this.uiContext?.setStatus?.(cmd.text ?? 'k', cmd.reason ?? 'v');
|
|
1031
|
+
this.uiContext?.setWidget?.(cmd.text ?? 'k', [cmd.reason ?? 'v'], {
|
|
1032
|
+
placement: 'aboveEditor',
|
|
1033
|
+
});
|
|
1034
|
+
this.uiContext?.setTitle?.(cmd.reason ?? 'v');
|
|
1035
|
+
break;
|
|
1036
|
+
case 'dialog':
|
|
1037
|
+
// Raise a blocking confirm() through the broker's REAL uiContext. The path
|
|
1038
|
+
// taken depends on who is attached when it raises:
|
|
1039
|
+
// • ZERO viewers (C2 / G6a): makeBrokerUiContext resolves the default
|
|
1040
|
+
// (false) IMMEDIATELY — noOp fallback, no timer, no wait, no deadlock.
|
|
1041
|
+
// • a controller attached (G5): forwarded as an extension_ui_request the
|
|
1042
|
+
// controller answers via extension_ui_response — the engine proceeds.
|
|
1043
|
+
// • a controller attached but silent (G6b): resolves on the broker-side
|
|
1044
|
+
// timeout. Pass a SHORT explicit per-dialog `timeout` so that path is
|
|
1045
|
+
// fast and deterministic (never the broker's 120s default).
|
|
1046
|
+
await this.runDialog(cmd.timeout ?? 0);
|
|
1047
|
+
break;
|
|
1048
|
+
default:
|
|
1049
|
+
recordError(this.dir, `unknown cmd: ${String(cmd.cmd)}`);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
async runDialog(timeout) {
|
|
1053
|
+
const start = Date.now();
|
|
1054
|
+
try {
|
|
1055
|
+
const resolved = await Promise.resolve(this.uiContext?.confirm?.('headless-dialog', 'forward-progress check', { timeout }));
|
|
1056
|
+
appendFileSync(join(this.dir, 'fake-pi.dialog.jsonl'), JSON.stringify({ resolved: resolved ?? null, ms: Date.now() - start, ts: Date.now() }) + '\n');
|
|
1057
|
+
}
|
|
1058
|
+
catch (e) {
|
|
1059
|
+
recordError(this.dir, `dialog: ${String(e)}`);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
/** The real pi SDK's model-less sentinel (Agent.DEFAULT_MODEL). The fake mirrors
|
|
1064
|
+
* it so `session.model` is NEVER literally `undefined` after a model-less boot,
|
|
1065
|
+
* matching prod — see the FakeSession constructor. */
|
|
1066
|
+
const UNKNOWN_MODEL_STUB = { provider: 'unknown', id: 'unknown', api: 'unknown' };
|
|
1067
|
+
function isUnknownModelStub(m) {
|
|
1068
|
+
return m !== undefined && m.provider === 'unknown' && m.id === 'unknown' && m.api === 'unknown';
|
|
1069
|
+
}
|
|
1070
|
+
const FAKE_AVAILABLE_MODEL = { provider: 'fake', id: 'fake-model' };
|
|
1071
|
+
// Every model cell the default ladders (types.ts defaultModelLaddersConfig) can
|
|
1072
|
+
// resolve to must appear here: `getModels()` IS the ordered fallback set the
|
|
1073
|
+
// broker's launch resolver enumerates, so a ladder cell missing from this roster
|
|
1074
|
+
// resolves as a bare stub through `getModel()` yet can never be chosen as a
|
|
1075
|
+
// fallback — which silently inverts fallback direction. Keep in step with the
|
|
1076
|
+
// ladders.
|
|
1077
|
+
const FAKE_REGISTERED_MODELS = [
|
|
1078
|
+
{ provider: 'anthropic', id: 'claude-fable-5' },
|
|
1079
|
+
{ provider: 'anthropic', id: 'claude-opus-5' },
|
|
1080
|
+
{ provider: 'anthropic', id: 'claude-opus-4-8' },
|
|
1081
|
+
{ provider: 'anthropic', id: 'claude-sonnet-5' },
|
|
1082
|
+
{ provider: 'anthropic', id: 'claude-haiku-4-5' },
|
|
1083
|
+
{ provider: 'openai-codex', id: 'gpt-5.6-sol' },
|
|
1084
|
+
{ provider: 'openai-codex', id: 'gpt-5.6-terra' },
|
|
1085
|
+
{ provider: 'openai-codex', id: 'gpt-5.6-luna' },
|
|
1086
|
+
FAKE_AVAILABLE_MODEL,
|
|
1087
|
+
];
|
|
1088
|
+
export async function createAgentSessionServices(options) {
|
|
1089
|
+
const loader = new DefaultResourceLoader({
|
|
1090
|
+
cwd: options.cwd,
|
|
1091
|
+
agentDir: options.agentDir ?? getAgentDir(),
|
|
1092
|
+
additionalExtensionPaths: options.resourceLoaderOptions?.additionalExtensionPaths,
|
|
1093
|
+
appendSystemPrompt: options.resourceLoaderOptions?.appendSystemPrompt,
|
|
1094
|
+
});
|
|
1095
|
+
await loader.reload();
|
|
1096
|
+
// Zero-auth test seam. While <CRTR_HOME>/fake-pi.no-auth exists, the registry
|
|
1097
|
+
// reports a GENUINE zero-auth boot (nothing registered, nothing authenticated)
|
|
1098
|
+
// so resolveLaunchModel (broker.ts) falls all the way to a tier-3 model-less
|
|
1099
|
+
// boot — the stock always-authenticated FAKE_AVAILABLE_MODEL below can't
|
|
1100
|
+
// express that. Two properties matter, both satisfied by a HOME-level sentinel
|
|
1101
|
+
// FILE checked LIVE (not a one-shot env read — custom env vars don't survive
|
|
1102
|
+
// cleanBaseEnv into the initial `node new --headless` boot):
|
|
1103
|
+
// • RACE-FREE ARMING: the test writes it BEFORE spawning (no per-node-dir
|
|
1104
|
+
// dependency on an id that only exists post-spawn, and the broker races to
|
|
1105
|
+
// read the registry the instant it boots).
|
|
1106
|
+
// • LIVE FLIP: a reload_auth frame's modelRegistry.refresh() re-reads these
|
|
1107
|
+
// getters, so DELETING the sentinel mid-test flips auth ON and the broker's
|
|
1108
|
+
// reload_auth re-drive observes it with zero extra plumbing — the exact
|
|
1109
|
+
// login/re-drive transition.
|
|
1110
|
+
// Absent (the common case) → unchanged always-authenticated behavior.
|
|
1111
|
+
const home = (process.env['CRTR_HOME'] ?? '').trim();
|
|
1112
|
+
const noAuthSentinel = join(home, 'fake-pi.no-auth');
|
|
1113
|
+
const zeroAuth = () => home !== '' && existsSync(noAuthSentinel);
|
|
1114
|
+
return {
|
|
1115
|
+
resourceLoader: loader,
|
|
1116
|
+
modelRuntime: {
|
|
1117
|
+
// A minimal model stub for any spec — the set_model regression test drives
|
|
1118
|
+
// the broker's findModelSpec → session.setModel path through it. Nothing is
|
|
1119
|
+
// findable during a zero-auth window.
|
|
1120
|
+
getModel: (provider, id) => (zeroAuth() ? undefined : { provider, id }),
|
|
1121
|
+
// Always-authenticated single fake model — the M-9 no-boot-model branch
|
|
1122
|
+
// (broker.ts) picks `available[0]` and must never see an empty list here —
|
|
1123
|
+
// EXCEPT during a zero-auth window, when nothing is available/registered.
|
|
1124
|
+
getAvailableSnapshot: () => (zeroAuth() ? [] : [FAKE_AVAILABLE_MODEL]),
|
|
1125
|
+
getAvailable: async () => (zeroAuth() ? [] : [FAKE_AVAILABLE_MODEL]),
|
|
1126
|
+
getModels: () => (zeroAuth() ? [] : FAKE_REGISTERED_MODELS),
|
|
1127
|
+
hasConfiguredAuth: () => !zeroAuth(),
|
|
1128
|
+
getError: () => undefined,
|
|
1129
|
+
refresh: async () => { },
|
|
1130
|
+
},
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
export async function createAgentSessionFromServices(options) {
|
|
1134
|
+
const session = new FakeSession(options.sessionManager, options.services.resourceLoader, options.model, options.services.modelRuntime);
|
|
1135
|
+
// Parity with the real SDK: a construction-time thinking level IS the
|
|
1136
|
+
// session's thinking level from the first turn on. The broker formats
|
|
1137
|
+
// `model:thinking` off this getter, and that suffix is what distinguishes two
|
|
1138
|
+
// ladder cells sharing one model id (openai ultra/strong are both
|
|
1139
|
+
// gpt-5.6-sol) — dropping it here silently misroutes turn-time rotation.
|
|
1140
|
+
if (options.thinkingLevel !== undefined)
|
|
1141
|
+
session.setThinkingLevel(options.thinkingLevel);
|
|
1142
|
+
return { session };
|
|
1143
|
+
}
|
|
1144
|
+
class FakeAgentSessionRuntime {
|
|
1145
|
+
createRuntime;
|
|
1146
|
+
cwd;
|
|
1147
|
+
agentDir;
|
|
1148
|
+
session;
|
|
1149
|
+
services;
|
|
1150
|
+
rebindSession;
|
|
1151
|
+
constructor(createRuntime, cwd, agentDir, session, services) {
|
|
1152
|
+
this.createRuntime = createRuntime;
|
|
1153
|
+
this.cwd = cwd;
|
|
1154
|
+
this.agentDir = agentDir;
|
|
1155
|
+
this.session = session;
|
|
1156
|
+
this.services = services;
|
|
1157
|
+
}
|
|
1158
|
+
setRebindSession(rebindSession) {
|
|
1159
|
+
this.rebindSession = rebindSession;
|
|
1160
|
+
}
|
|
1161
|
+
async newSession() {
|
|
1162
|
+
const next = await this.createRuntime({ cwd: this.cwd, agentDir: this.agentDir, sessionManager: SessionManager.create(this.cwd) });
|
|
1163
|
+
this.session = next.session;
|
|
1164
|
+
this.services = next.services;
|
|
1165
|
+
await this.rebindSession?.(next.session);
|
|
1166
|
+
return { cancelled: false };
|
|
1167
|
+
}
|
|
1168
|
+
async dispose() {
|
|
1169
|
+
this.session.dispose();
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
export async function createAgentSessionRuntime(createRuntime, options) {
|
|
1173
|
+
const initial = await createRuntime(options);
|
|
1174
|
+
return new FakeAgentSessionRuntime(createRuntime, options.cwd, options.agentDir, initial.session, initial.services);
|
|
1175
|
+
}
|
|
1176
|
+
// ---------------------------------------------------------------------------
|
|
1177
|
+
// VERSION — set to the SDK's published version so assertEngineVersion (which
|
|
1178
|
+
// only logs, never throws) emits no spurious mismatch warning.
|
|
1179
|
+
// ---------------------------------------------------------------------------
|
|
1180
|
+
export const VERSION = '0.78.1';
|
|
1181
|
+
// ---------------------------------------------------------------------------
|
|
1182
|
+
// Parse the broker-launch.json recipe the host serialized (the PiInvocation
|
|
1183
|
+
// buildPiArgv produced) for the proof shape — the same `-e`/`-n`/positional
|
|
1184
|
+
// vocabulary fake-pi-host parses off its argv.
|
|
1185
|
+
// ---------------------------------------------------------------------------
|
|
1186
|
+
function readLaunch(dir) {
|
|
1187
|
+
let argv = [];
|
|
1188
|
+
try {
|
|
1189
|
+
const inv = JSON.parse(readFileSync(join(dir, 'broker-launch.json'), 'utf8'));
|
|
1190
|
+
argv = Array.isArray(inv.argv) ? inv.argv : [];
|
|
1191
|
+
}
|
|
1192
|
+
catch {
|
|
1193
|
+
/* no launch file — leave argv empty */
|
|
1194
|
+
}
|
|
1195
|
+
const extPaths = [];
|
|
1196
|
+
let label;
|
|
1197
|
+
let prompt;
|
|
1198
|
+
for (let i = 0; i < argv.length; i++) {
|
|
1199
|
+
const a = argv[i];
|
|
1200
|
+
if (a === '-e')
|
|
1201
|
+
extPaths.push(argv[++i]);
|
|
1202
|
+
else if (a === '-n')
|
|
1203
|
+
label = argv[++i];
|
|
1204
|
+
else if (a === '--session' || a === '--model' || a === '--tools' || a === '--append-system-prompt' || a === '--fork')
|
|
1205
|
+
i++;
|
|
1206
|
+
else if (!a.startsWith('-'))
|
|
1207
|
+
prompt = a; // positional kickoff (fresh start only)
|
|
1208
|
+
}
|
|
1209
|
+
return { argv, extPaths, label, prompt };
|
|
1210
|
+
}
|