@crouton-kit/crouter 0.3.33 → 0.3.34
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 +2 -2
- package/dist/build-root.js +3 -6
- package/dist/builtin-memory/crouter-development/marketplaces.md +6 -6
- package/dist/builtin-memory/crouter-development/plugins.md +13 -13
- package/dist/builtin-memory/internal/examples/imessage-assistant.md +3 -3
- package/dist/builtin-memory/internal/nodes-and-canvas.md +4 -4
- package/dist/builtin-personas/developer/PERSONA.md +1 -1
- package/dist/builtin-personas/orchestration-kernel.md +1 -1
- package/dist/builtin-personas/waiting.md +1 -1
- package/dist/builtin-pi-packages/pi-crtr-extensions/README.md +71 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/crtr-help-gate.test.ts +41 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/provider-rotation.test.ts +663 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/__tests__/statusline.test.ts +52 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/claude-plugin-commands.ts +418 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crouter-help.ts +87 -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 +174 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/crtr-help-gate.ts +408 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/frontmatter-rules/index.ts +442 -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/nested-context.ts +327 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/provider-rotation.ts +574 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/statusline.ts +260 -0
- package/dist/builtin-pi-packages/pi-crtr-extensions/extensions/strip-skills-docs.ts +40 -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 +479 -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-mode-switch/README.md +64 -0
- package/dist/builtin-pi-packages/pi-mode-switch/bin/mode +40 -0
- package/dist/builtin-pi-packages/pi-mode-switch/extensions/index.ts +422 -0
- package/dist/builtin-pi-packages/pi-mode-switch/package.json +13 -0
- package/dist/clients/attach/__tests__/crtr-output-coverage.test.js +55 -0
- package/dist/clients/attach/__tests__/crtr-output-render.test.js +2340 -0
- package/dist/clients/attach/attach-cmd.js +826 -754
- package/dist/clients/attach/auth-pickers.js +2 -2
- package/dist/clients/attach/canvas-panels.js +1 -1
- package/dist/clients/attach/chat-view.d.ts +3 -2
- package/dist/clients/attach/chat-view.js +30 -10
- package/dist/clients/attach/clipboard-image.js +1 -1
- package/dist/clients/attach/clipboard-text.js +1 -1
- package/dist/clients/attach/config-load.js +1 -1
- package/dist/clients/attach/crtr-output-render.d.ts +48 -0
- package/dist/clients/attach/crtr-output-render.js +646 -0
- package/dist/clients/attach/extension-dialogs.js +1 -1
- package/dist/clients/attach/graph-overlay.js +3 -3
- package/dist/clients/attach/input-controller.js +1 -1
- package/dist/clients/attach/pickers.js +1 -1
- package/dist/clients/attach/slash-commands.js +5 -6
- package/dist/clients/attach/titled-editor.d.ts +4 -0
- package/dist/clients/attach/titled-editor.js +13 -1
- package/dist/clients/attach/view-socket.js +1 -1
- package/dist/clients/web/__tests__/source-cache.test.js +5 -5
- package/dist/clients/web/server.js +29 -5
- package/dist/clients/web/source-cache.js +3 -3
- package/dist/clients/web/web-cmd.js +7 -7
- package/dist/commands/canvas-issue.js +1 -1
- package/dist/commands/canvas-prune.js +24 -2
- package/dist/commands/canvas-snapshot.js +3 -0
- package/dist/commands/canvas-tmux-spread.js +3 -3
- package/dist/commands/human.js +1 -1
- package/dist/commands/memory/lint.js +15 -8
- package/dist/commands/memory/origin.d.ts +1 -0
- package/dist/commands/memory/origin.js +88 -0
- package/dist/commands/memory/shared.d.ts +8 -0
- package/dist/commands/memory/shared.js +22 -1
- package/dist/commands/memory/write.js +17 -12
- package/dist/commands/memory.js +4 -3
- package/dist/commands/node-context.js +4 -4
- package/dist/commands/node-snapshot.js +4 -1
- package/dist/commands/node.d.ts +2 -2
- package/dist/commands/node.js +814 -606
- package/dist/commands/pkg/market-inspect.d.ts +2 -1
- package/dist/commands/pkg/market-inspect.js +14 -32
- package/dist/commands/pkg/market-manage.d.ts +3 -1
- package/dist/commands/pkg/market-manage.js +58 -154
- package/dist/commands/pkg/market.js +7 -7
- package/dist/commands/pkg/plugin-inspect.d.ts +2 -1
- package/dist/commands/pkg/plugin-inspect.js +8 -24
- package/dist/commands/pkg/plugin-manage.d.ts +5 -1
- package/dist/commands/pkg/plugin-manage.js +245 -171
- package/dist/commands/pkg/plugin.js +6 -6
- package/dist/commands/pkg.js +5 -5
- package/dist/commands/revive.js +5 -3
- package/dist/commands/search/answer.js +1 -1
- package/dist/commands/search/contents.js +1 -1
- package/dist/commands/search/web.js +2 -2
- package/dist/commands/search.js +1 -1
- package/dist/commands/surface.d.ts +2 -0
- package/dist/commands/surface.js +43 -0
- package/dist/commands/sys/promptstudio.js +1 -1
- package/dist/commands/sys/settings.js +2 -2
- package/dist/commands/sys/setup-core.d.ts +88 -0
- package/dist/commands/sys/setup-core.js +352 -0
- package/dist/commands/sys/setup.d.ts +2 -0
- package/dist/commands/sys/setup.js +516 -0
- package/dist/commands/sys/sysprompt.js +3 -0
- package/dist/commands/sys.js +3 -2
- package/dist/commands/view-cycle.js +5 -5
- package/dist/commands/view-list.js +3 -3
- package/dist/commands/view-new.js +5 -5
- package/dist/commands/view-pick.js +6 -6
- package/dist/commands/view-run.js +14 -14
- package/dist/commands/view.js +3 -3
- package/dist/commands/workspace.js +10 -10
- package/dist/core/__tests__/boot.test.js +140 -0
- package/dist/core/__tests__/broker-sdk-wiring.test.js +6 -27
- package/dist/core/__tests__/daemon-boot.test.js +22 -0
- package/dist/core/__tests__/fixtures/fake-engine.js +1 -1
- package/dist/core/__tests__/full/broker-attach-limits.test.js +1 -1
- package/dist/core/__tests__/full/broker-attach-stream.test.js +1 -1
- package/dist/core/__tests__/full/broker-crash-teardown.test.js +10 -5
- package/dist/core/__tests__/full/broker-model-changed-broadcast.test.js +1 -1
- package/dist/core/__tests__/full/broker-navigate-tree-rewelcome.test.js +1 -1
- package/dist/core/__tests__/full/broker-pane-resolution.test.js +1 -1
- package/dist/core/__tests__/full/cascade-close.test.js +31 -18
- package/dist/core/__tests__/full/detach-focus.test.js +2 -2
- package/dist/core/__tests__/hearth-bootstrap.test.js +136 -0
- package/dist/core/__tests__/helpers/harness.js +1 -1
- package/dist/core/__tests__/live-mutation-verbs.test.js +10 -10
- package/dist/core/__tests__/live-mutation.test.js +8 -8
- package/dist/core/__tests__/migration.test.js +124 -0
- package/dist/core/__tests__/on-read-dedup-resume.test.js +40 -0
- package/dist/core/__tests__/preview-registry-sync.test.js +36 -0
- package/dist/core/__tests__/prune-to-limit.test.js +91 -0
- package/dist/core/__tests__/revive.test.js +64 -21
- package/dist/core/__tests__/trigger-migration.test.js +48 -0
- package/dist/core/__tests__/wake-bearings.test.js +23 -21
- package/dist/core/__tests__/wake-origin.test.js +36 -33
- package/dist/core/canvas/boot.d.ts +48 -0
- package/dist/core/canvas/boot.js +157 -0
- package/dist/core/canvas/canvas.d.ts +27 -1
- package/dist/core/canvas/canvas.js +86 -5
- package/dist/core/canvas/db.js +86 -1
- package/dist/core/canvas/index.d.ts +1 -1
- package/dist/core/canvas/index.js +1 -1
- package/dist/core/canvas/nav-model.js +1 -1
- package/dist/core/canvas/pid.d.ts +6 -0
- package/dist/core/canvas/pid.js +13 -0
- package/dist/core/canvas/triggers.d.ts +108 -0
- package/dist/core/canvas/triggers.js +320 -0
- package/dist/core/canvas/types.d.ts +128 -46
- package/dist/core/command.js +13 -4
- package/dist/core/hearth/__tests__/model-auth-guest.test.js +151 -0
- package/dist/core/hearth/config.d.ts +1 -0
- package/dist/core/hearth/config.js +36 -0
- package/dist/core/hearth/guest-env.d.ts +7 -0
- package/dist/core/hearth/guest-env.js +17 -1
- package/dist/core/hearth/model-auth-guest.d.ts +8 -0
- package/dist/core/hearth/model-auth-guest.js +435 -0
- package/dist/core/hearth/provider.d.ts +13 -6
- package/dist/core/hearth/providers/blaxel-bootstrap.d.ts +2 -0
- package/dist/core/hearth/providers/blaxel-bootstrap.js +127 -19
- package/dist/core/hearth/providers/blaxel-home.d.ts +8 -4
- package/dist/core/hearth/providers/blaxel-home.js +85 -75
- package/dist/core/hearth/providers/blaxel.d.ts +5 -0
- package/dist/core/hearth/providers/blaxel.js +86 -12
- package/dist/core/hearth/providers/types.d.ts +6 -1
- package/dist/core/hearth/registry.js +2 -1
- package/dist/core/hearth/types.d.ts +35 -0
- package/dist/core/help.d.ts +16 -0
- package/dist/core/help.js +2 -0
- package/dist/core/memory-resolver.d.ts +8 -8
- package/dist/core/memory-resolver.js +58 -26
- package/dist/core/preview-registry.d.ts +25 -0
- package/dist/core/preview-registry.js +2047 -0
- package/dist/core/resolver.d.ts +1 -0
- package/dist/core/resolver.js +23 -16
- package/dist/core/runtime/bearings.d.ts +11 -10
- package/dist/core/runtime/bearings.js +8 -8
- package/dist/core/runtime/broker-protocol.d.ts +2 -2
- package/dist/core/runtime/broker-protocol.js +2 -2
- package/dist/core/runtime/close.js +2 -2
- package/dist/core/runtime/kickoff.js +1 -1
- package/dist/core/runtime/launch.d.ts +9 -3
- package/dist/core/runtime/launch.js +17 -9
- package/dist/core/runtime/lifecycle.js +7 -7
- package/dist/core/runtime/model-swap.js +1 -1
- package/dist/core/runtime/placement.d.ts +5 -5
- package/dist/core/runtime/placement.js +10 -10
- package/dist/core/runtime/recycle.js +7 -7
- package/dist/core/runtime/reset.d.ts +1 -1
- package/dist/core/runtime/reset.js +3 -3
- package/dist/core/runtime/revive-all.d.ts +5 -2
- package/dist/core/runtime/revive-all.js +5 -2
- package/dist/core/runtime/revive.d.ts +15 -8
- package/dist/core/runtime/revive.js +52 -16
- package/dist/core/runtime/spawn.d.ts +1 -1
- package/dist/core/runtime/spawn.js +7 -7
- package/dist/core/runtime/stop-guard.js +5 -5
- package/dist/core/runtime/surface-bg.js +1 -1
- package/dist/core/runtime/tmux.d.ts +1 -1
- package/dist/core/runtime/tmux.js +4 -4
- package/dist/core/scope.d.ts +9 -0
- package/dist/core/scope.js +37 -15
- package/dist/core/substrate/on-read.js +23 -21
- package/dist/core/substrate/render.js +3 -3
- package/dist/core/view/loader.js +2 -2
- package/dist/core/wake.d.ts +2 -2
- package/dist/core/wake.js +7 -7
- package/dist/daemon/__tests__/predicate-eval.test.js +109 -0
- package/dist/daemon/crtrd.js +222 -103
- package/dist/daemon/predicate-eval.d.ts +52 -0
- package/dist/daemon/predicate-eval.js +248 -0
- package/dist/hearth/control-plane/__tests__/node-message.test.js +60 -0
- package/dist/hearth/control-plane/__tests__/rate-limit-recurrence.test.js +49 -0
- package/dist/hearth/control-plane/__tests__/relay-security.test.js +314 -0
- package/dist/hearth/control-plane/__tests__/scheduler-scan-loop.test.js +133 -0
- package/dist/hearth/control-plane/__tests__/trigger-delivery.test.js +170 -0
- package/dist/hearth/control-plane/__tests__/webhook-ingress.test.js +167 -0
- package/dist/hearth/control-plane/config.d.ts +21 -0
- package/dist/hearth/control-plane/config.js +77 -0
- package/dist/hearth/control-plane/db.d.ts +30 -0
- package/dist/hearth/control-plane/db.js +534 -0
- package/dist/hearth/control-plane/ingress/rate-limit.d.ts +24 -0
- package/dist/hearth/control-plane/ingress/rate-limit.js +100 -0
- package/dist/hearth/control-plane/ingress/route-store.d.ts +31 -0
- package/dist/hearth/control-plane/ingress/route-store.js +61 -0
- package/dist/hearth/control-plane/ingress/webhook-delivery-store.d.ts +41 -0
- package/dist/hearth/control-plane/ingress/webhook-delivery-store.js +69 -0
- package/dist/hearth/control-plane/ingress/webhook-route.d.ts +55 -0
- package/dist/hearth/control-plane/ingress/webhook-route.js +285 -0
- package/dist/hearth/control-plane/main.js +88 -0
- package/dist/hearth/control-plane/node-message.d.ts +31 -0
- package/dist/hearth/control-plane/node-message.js +98 -0
- package/dist/hearth/control-plane/register.d.ts +15 -0
- package/dist/hearth/control-plane/register.js +34 -0
- package/dist/hearth/control-plane/registry.d.ts +17 -0
- package/dist/hearth/control-plane/registry.js +161 -0
- package/dist/hearth/control-plane/relay.d.ts +40 -0
- package/dist/hearth/control-plane/relay.js +642 -0
- package/dist/hearth/control-plane/scheduler/fire-store.d.ts +36 -0
- package/dist/hearth/control-plane/scheduler/fire-store.js +73 -0
- package/dist/hearth/control-plane/scheduler/recurrence.d.ts +7 -0
- package/dist/hearth/control-plane/scheduler/recurrence.js +58 -0
- package/dist/hearth/control-plane/scheduler/scan-loop.d.ts +38 -0
- package/dist/hearth/control-plane/scheduler/scan-loop.js +138 -0
- package/dist/hearth/control-plane/scheduler/schedule-store.d.ts +32 -0
- package/dist/hearth/control-plane/scheduler/schedule-store.js +66 -0
- package/dist/hearth/control-plane/secrets.d.ts +17 -0
- package/dist/hearth/control-plane/secrets.js +113 -0
- package/dist/hearth/control-plane/server.d.ts +27 -0
- package/dist/hearth/control-plane/server.js +346 -0
- package/dist/hearth/control-plane/session.d.ts +68 -0
- package/dist/hearth/control-plane/session.js +273 -0
- package/dist/hearth/control-plane/triggers/acl.d.ts +14 -0
- package/dist/hearth/control-plane/triggers/acl.js +52 -0
- package/dist/hearth/control-plane/triggers/audit-store.d.ts +38 -0
- package/dist/hearth/control-plane/triggers/audit-store.js +79 -0
- package/dist/hearth/control-plane/triggers/deliver.d.ts +43 -0
- package/dist/hearth/control-plane/triggers/deliver.js +76 -0
- package/dist/hearth/control-plane/triggers/envelope.d.ts +29 -0
- package/dist/hearth/control-plane/triggers/envelope.js +38 -0
- package/dist/hearth/control-plane/types.d.ts +66 -0
- package/dist/hearth/control-plane/wake.d.ts +80 -0
- package/dist/hearth/control-plane/wake.js +312 -0
- package/dist/hearth/wake-proxy/__tests__/guest-source.test.js +2 -2
- package/dist/hearth/wake-proxy/home.d.ts +2 -8
- package/dist/hearth/wake-proxy/home.js +48 -12
- package/dist/pi-extensions/canvas-doc-substrate.js +28 -2
- package/dist/pi-extensions/canvas-nav.js +1 -1
- package/dist/prompts/view.js +7 -8
- package/dist/types.js +4 -4
- package/dist/web-client/assets/{index-D36PNBj4.js → index-BRKxe-hy.js} +2 -2
- package/dist/web-client/index.html +1 -1
- package/package.json +12 -8
- package/scripts/postinstall.mjs +8 -0
- package/dist/clients/attach/__tests__/action-parity.test.js +0 -48
- package/dist/clients/attach/__tests__/autocomplete-and-bash-mode.test.js +0 -96
- package/dist/clients/attach/__tests__/bash-bang-routing.test.js +0 -58
- package/dist/clients/attach/__tests__/bundle-pi-tui-dedup.test.js +0 -56
- package/dist/clients/attach/__tests__/clipboard-image.test.js +0 -76
- package/dist/clients/attach/__tests__/editor-newline.test.js +0 -82
- package/dist/clients/attach/__tests__/git-info.test.js +0 -31
- package/dist/clients/attach/__tests__/onrequest-wired.test.js +0 -20
- package/dist/clients/attach/__tests__/reconnect-giveup.test.js +0 -30
- package/dist/clients/attach/__tests__/slash-quit-copy.test.js +0 -42
- package/dist/clients/attach/__tests__/titled-editor.test.js +0 -60
- package/dist/commands/memory/__tests__/lint-schema.test.js +0 -52
- package/dist/core/__tests__/argv-parser.test.js +0 -217
- package/dist/core/__tests__/artifact-paths.test.js +0 -44
- package/dist/core/__tests__/draw-style.test.js +0 -258
- package/dist/core/__tests__/editor-label.test.js +0 -26
- package/dist/core/__tests__/fault-marker.test.js +0 -112
- package/dist/core/__tests__/fault-retry-rewind.test.d.ts +0 -1
- package/dist/core/__tests__/fault-retry-rewind.test.js +0 -123
- package/dist/core/__tests__/frame-decoder-perf.test.d.ts +0 -1
- package/dist/core/__tests__/frame-decoder-perf.test.js +0 -224
- package/dist/core/__tests__/keystone.test.d.ts +0 -1
- package/dist/core/__tests__/keystone.test.js +0 -185
- package/dist/core/__tests__/listing-completeness.test.d.ts +0 -1
- package/dist/core/__tests__/listing-completeness.test.js +0 -31
- package/dist/core/__tests__/memory-resolver.test.d.ts +0 -1
- package/dist/core/__tests__/memory-resolver.test.js +0 -119
- package/dist/core/__tests__/memory.test.d.ts +0 -1
- package/dist/core/__tests__/memory.test.js +0 -60
- package/dist/core/__tests__/model-ladders.test.d.ts +0 -1
- package/dist/core/__tests__/model-ladders.test.js +0 -160
- package/dist/core/__tests__/node-env.test.d.ts +0 -1
- package/dist/core/__tests__/node-env.test.js +0 -26
- package/dist/core/__tests__/pane-column.test.d.ts +0 -1
- package/dist/core/__tests__/pane-column.test.js +0 -153
- package/dist/core/__tests__/persona-compose.test.d.ts +0 -1
- package/dist/core/__tests__/persona-compose.test.js +0 -53
- package/dist/core/__tests__/persona-subkind.test.d.ts +0 -1
- package/dist/core/__tests__/persona-subkind.test.js +0 -65
- package/dist/core/__tests__/persona.test.d.ts +0 -1
- package/dist/core/__tests__/persona.test.js +0 -107
- package/dist/core/__tests__/unknown-path.test.d.ts +0 -1
- package/dist/core/__tests__/unknown-path.test.js +0 -58
- package/dist/core/canvas/wakeups.d.ts +0 -76
- package/dist/core/canvas/wakeups.js +0 -185
- package/dist/hearth/wake-proxy/__tests__/source-bridge-gate.test.d.ts +0 -1
- package/dist/hearth/wake-proxy/__tests__/source-bridge-gate.test.js +0 -455
- /package/dist/clients/attach/__tests__/{action-parity.test.d.ts → crtr-output-coverage.test.d.ts} +0 -0
- /package/dist/clients/attach/__tests__/{autocomplete-and-bash-mode.test.d.ts → crtr-output-render.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/bash-bang-routing.test.d.ts → core/__tests__/boot.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/bundle-pi-tui-dedup.test.d.ts → core/__tests__/hearth-bootstrap.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/clipboard-image.test.d.ts → core/__tests__/preview-registry-sync.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/editor-newline.test.d.ts → core/__tests__/prune-to-limit.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/git-info.test.d.ts → core/__tests__/trigger-migration.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/onrequest-wired.test.d.ts → core/hearth/__tests__/model-auth-guest.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/reconnect-giveup.test.d.ts → daemon/__tests__/predicate-eval.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/slash-quit-copy.test.d.ts → hearth/control-plane/__tests__/node-message.test.d.ts} +0 -0
- /package/dist/{clients/attach/__tests__/titled-editor.test.d.ts → hearth/control-plane/__tests__/rate-limit-recurrence.test.d.ts} +0 -0
- /package/dist/{commands/memory/__tests__/lint-schema.test.d.ts → hearth/control-plane/__tests__/relay-security.test.d.ts} +0 -0
- /package/dist/{core/__tests__/argv-parser.test.d.ts → hearth/control-plane/__tests__/scheduler-scan-loop.test.d.ts} +0 -0
- /package/dist/{core/__tests__/artifact-paths.test.d.ts → hearth/control-plane/__tests__/trigger-delivery.test.d.ts} +0 -0
- /package/dist/{core/__tests__/draw-style.test.d.ts → hearth/control-plane/__tests__/webhook-ingress.test.d.ts} +0 -0
- /package/dist/{core/__tests__/editor-label.test.d.ts → hearth/control-plane/main.d.ts} +0 -0
- /package/dist/{core/__tests__/fault-marker.test.d.ts → hearth/control-plane/types.js} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
6
|
<meta name="color-scheme" content="dark light" />
|
|
7
7
|
<title>crouter</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BRKxe-hy.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-BZUxTkv5.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crouton-kit/crouter",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.34",
|
|
4
4
|
"description": "crtr — agent runtime with memory, plugins, and marketplaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -25,13 +25,17 @@
|
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"dist",
|
|
28
|
-
"bin"
|
|
28
|
+
"bin",
|
|
29
|
+
"scripts/postinstall.mjs"
|
|
29
30
|
],
|
|
30
31
|
"scripts": {
|
|
31
|
-
"
|
|
32
|
+
"prebuild": "rm -rf node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-tui node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-ai node_modules/@earendil-works/pi-coding-agent/node_modules/@earendil-works/pi-agent-core",
|
|
33
|
+
"build": "rm -rf dist && tsc && cp -R src/builtin-personas dist/builtin-personas && cp -R src/builtin-views dist/builtin-views && cp -R src/builtin-memory dist/builtin-memory && cp -R src/builtin-pi-packages dist/builtin-pi-packages && npm run build:attach && vite build --config src/clients/web/web-client/vite.config.ts",
|
|
32
34
|
"lint:web-px": "node scripts/lint-web-px.mjs",
|
|
33
35
|
"build:attach": "esbuild src/clients/attach/attach-cmd.ts --bundle --minify --format=esm --platform=node --target=node22 --alias:@earendil-works/pi-tui=$PWD/node_modules/@earendil-works/pi-tui --outfile=dist/clients/attach/attach-cmd.js --log-level=warning --banner:js=\"import{createRequire as __cr}from'node:module';const require=__cr(import.meta.url);\"",
|
|
36
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
34
37
|
"hearth:wake-proxy": "node dist/hearth/wake-proxy/main.js",
|
|
38
|
+
"hearth:control-plane": "node dist/hearth/control-plane/main.js",
|
|
35
39
|
"dev": "tsx src/cli.ts",
|
|
36
40
|
"link": "npm link",
|
|
37
41
|
"prepublishOnly": "npm run build",
|
|
@@ -45,11 +49,11 @@
|
|
|
45
49
|
"license": "MIT",
|
|
46
50
|
"dependencies": {
|
|
47
51
|
"@blaxel/core": "^0.2.94",
|
|
48
|
-
"@crouton-kit/humanloop": "
|
|
49
|
-
"@earendil-works/pi-agent-core": "0.
|
|
50
|
-
"@earendil-works/pi-ai": "0.
|
|
51
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
52
|
-
"@earendil-works/pi-tui": "0.
|
|
52
|
+
"@crouton-kit/humanloop": "latest",
|
|
53
|
+
"@earendil-works/pi-agent-core": "0.80.2",
|
|
54
|
+
"@earendil-works/pi-ai": "0.80.2",
|
|
55
|
+
"@earendil-works/pi-coding-agent": "0.80.2",
|
|
56
|
+
"@earendil-works/pi-tui": "0.80.2",
|
|
53
57
|
"@fontsource-variable/fraunces": "^5.2.9",
|
|
54
58
|
"@fontsource-variable/instrument-sans": "^5.2.8",
|
|
55
59
|
"@fontsource-variable/martian-mono": "^5.2.7",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
try {
|
|
3
|
+
if (process.env.CI) process.exit(0);
|
|
4
|
+
console.log('crouter installed. Run `crtr sys setup` to install companion pi plugins (mode-switch, crtr-extensions, Claude OAuth), tmux/nvim, and your Exa key.');
|
|
5
|
+
} catch {
|
|
6
|
+
// never fail install
|
|
7
|
+
}
|
|
8
|
+
process.exit(0);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Regression: the `crtr attach` viewer's InputController wired only a subset of
|
|
2
|
-
// pi's editor `app.*` actions, so several keys that work in pi were dead in the
|
|
3
|
-
// attach surface — most visibly Ctrl+O (toggle tool output) and Ctrl+T (toggle
|
|
4
|
-
// thinking blocks), but also Ctrl+G (external editor), Shift+Tab (cycle thinking
|
|
5
|
-
// level), Shift+Ctrl+P (cycle model backward), and Alt+Up (dequeue). The broker
|
|
6
|
-
// already supported every one of these frames; only the client-side onAction
|
|
7
|
-
// wiring was missing. The fix wires them in input-controller's wire() and adds
|
|
8
|
-
// the ChatView render toggles for the two display-only ones. This assembly lives
|
|
9
|
-
// inside TUI-constructing code with no unit seam, so we guard the wiring at the
|
|
10
|
-
// source level (mirrors onrequest-wired.test.ts).
|
|
11
|
-
// See src/clients/attach/{input-controller,chat-view,attach-cmd}.ts.
|
|
12
|
-
import { test } from 'node:test';
|
|
13
|
-
import assert from 'node:assert/strict';
|
|
14
|
-
import { readFileSync } from 'node:fs';
|
|
15
|
-
import { fileURLToPath } from 'node:url';
|
|
16
|
-
import { dirname, join } from 'node:path';
|
|
17
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
18
|
-
const read = (file) => readFileSync(join(here, '..', file), 'utf8').replace(/\s+/g, ' ');
|
|
19
|
-
const inputController = read('input-controller.ts');
|
|
20
|
-
const chatView = read('chat-view.ts');
|
|
21
|
-
const attachCmd = read('attach-cmd.ts');
|
|
22
|
-
test('input-controller wires every previously-dead app.* editor action', () => {
|
|
23
|
-
for (const action of [
|
|
24
|
-
'app.tools.expand', // Ctrl+O — toggle tool output
|
|
25
|
-
'app.thinking.toggle', // Ctrl+T — toggle thinking blocks
|
|
26
|
-
'app.thinking.cycle', // Shift+Tab — cycle thinking level
|
|
27
|
-
'app.model.cycleBackward', // Shift+Ctrl+P — cycle model backward
|
|
28
|
-
'app.message.dequeue', // Alt+Up — restore queued messages
|
|
29
|
-
'app.editor.external', // Ctrl+G — external editor
|
|
30
|
-
]) {
|
|
31
|
-
assert.match(inputController, new RegExp(`onAction\\(\\s*'${action.replace(/\./g, '\\.')}'`), `input-controller must register onAction('${action}')`);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
test('cycle_model carries an explicit direction in both directions', () => {
|
|
35
|
-
assert.match(inputController, /type:\s*'cycle_model',\s*direction:\s*'forward'/);
|
|
36
|
-
assert.match(inputController, /type:\s*'cycle_model',\s*direction:\s*'backward'/);
|
|
37
|
-
});
|
|
38
|
-
test('ChatView exposes the Ctrl+O / Ctrl+T render toggles', () => {
|
|
39
|
-
assert.match(chatView, /toggleToolsExpanded\(\)/, 'ChatView needs toggleToolsExpanded()');
|
|
40
|
-
assert.match(chatView, /toggleThinking\(\)/, 'ChatView needs toggleThinking()');
|
|
41
|
-
// The toggles must actually fan out to the rendered children, not just flip a flag.
|
|
42
|
-
assert.match(chatView, /child\.setExpanded\(this\.toolOutputExpanded\)/);
|
|
43
|
-
assert.match(chatView, /child\.setHideThinkingBlock\(this\.hideThinking\)/);
|
|
44
|
-
});
|
|
45
|
-
test('attach-cmd connects the ChatView toggles to the input controller', () => {
|
|
46
|
-
assert.match(attachCmd, /onToggleToolsExpand:\s*\(\)\s*=>[\s\S]*chatView\.toggleToolsExpanded\(\)/);
|
|
47
|
-
assert.match(attachCmd, /onToggleThinking:\s*\(\)\s*=>[\s\S]*chatView\.toggleThinking\(\)/);
|
|
48
|
-
});
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { test } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { chmodSync, mkdtempSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
|
-
import { CombinedAutocompleteProvider } from '@earendil-works/pi-tui';
|
|
7
|
-
import { buildAttachAutocompleteProvider, deriveBashMode, resolveEditorFrameStyles } from '../attach-cmd.js';
|
|
8
|
-
function writeFakeFd(binDir) {
|
|
9
|
-
const fdBin = join(binDir, 'fd');
|
|
10
|
-
writeFileSync(fdBin, `#!/usr/bin/env node
|
|
11
|
-
const fs = require('node:fs');
|
|
12
|
-
const path = require('node:path');
|
|
13
|
-
if (process.argv.includes('--version')) {
|
|
14
|
-
process.stdout.write('fd 0.0.0\\n');
|
|
15
|
-
process.exit(0);
|
|
16
|
-
}
|
|
17
|
-
const args = process.argv.slice(2);
|
|
18
|
-
const baseDirIndex = args.indexOf('--base-directory');
|
|
19
|
-
const baseDir = baseDirIndex >= 0 ? args[baseDirIndex + 1] : process.cwd();
|
|
20
|
-
const maxResultsIndex = args.indexOf('--max-results');
|
|
21
|
-
const maxResults = maxResultsIndex >= 0 ? Number(args[maxResultsIndex + 1]) : Infinity;
|
|
22
|
-
const fullPath = args.includes('--full-path');
|
|
23
|
-
let query = '';
|
|
24
|
-
for (let i = 0; i < args.length; i += 1) {
|
|
25
|
-
const arg = args[i];
|
|
26
|
-
if (arg === '--base-directory' || arg === '--max-results' || arg === '--type' || arg === '--exclude') {
|
|
27
|
-
i += 1;
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (arg === '--follow' || arg === '--hidden' || arg === '--full-path') continue;
|
|
31
|
-
if (!arg.startsWith('--')) query = arg;
|
|
32
|
-
}
|
|
33
|
-
const results = [];
|
|
34
|
-
function walk(dir, rel = '') {
|
|
35
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
36
|
-
for (const entry of entries) {
|
|
37
|
-
if (entry.name === '.git') continue;
|
|
38
|
-
const nextRel = rel ? rel + '/' + entry.name : entry.name;
|
|
39
|
-
const full = path.join(dir, entry.name);
|
|
40
|
-
if (!query || nextRel.includes(query) || entry.name.includes(query)) {
|
|
41
|
-
results.push((fullPath ? nextRel : nextRel) + (entry.isDirectory() ? '/' : ''));
|
|
42
|
-
if (results.length >= maxResults) return true;
|
|
43
|
-
}
|
|
44
|
-
if (entry.isDirectory() && walk(full, nextRel)) return true;
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
walk(baseDir);
|
|
49
|
-
process.stdout.write(results.join('\\n'));
|
|
50
|
-
`, 'utf8');
|
|
51
|
-
chmodSync(fdBin, 0o755);
|
|
52
|
-
return fdBin;
|
|
53
|
-
}
|
|
54
|
-
test('#6 attach threads the resolved fd path into @-mention file completion', async () => {
|
|
55
|
-
const base = mkdtempSync(join(tmpdir(), 'crtr-at-'));
|
|
56
|
-
const binDir = mkdtempSync(join(tmpdir(), 'crtr-fd-'));
|
|
57
|
-
mkdirSync(join(base, 'nested'));
|
|
58
|
-
writeFileSync(join(base, 'alpha.txt'), 'a');
|
|
59
|
-
writeFileSync(join(base, 'nested', 'beta.md'), 'b');
|
|
60
|
-
const fdPath = writeFakeFd(binDir);
|
|
61
|
-
let seen;
|
|
62
|
-
const provider = buildAttachAutocompleteProvider(base, fdPath, [], (items, cwd, passedFdPath) => {
|
|
63
|
-
seen = { cwd, fdPath: passedFdPath, items };
|
|
64
|
-
return new CombinedAutocompleteProvider(items, cwd, passedFdPath);
|
|
65
|
-
});
|
|
66
|
-
assert.equal(seen?.cwd, base);
|
|
67
|
-
assert.equal(seen?.fdPath, fdPath);
|
|
68
|
-
assert.ok((seen?.items.length ?? 0) > 0);
|
|
69
|
-
const result = await provider.getSuggestions(['@'], 0, 1, {
|
|
70
|
-
force: false,
|
|
71
|
-
signal: new AbortController().signal,
|
|
72
|
-
});
|
|
73
|
-
assert.ok(result, 'expected @ suggestions from the file picker');
|
|
74
|
-
assert.equal(result?.prefix, '@');
|
|
75
|
-
assert.ok(result?.items.some((item) => item.label === 'alpha.txt' || item.label === 'nested/'));
|
|
76
|
-
});
|
|
77
|
-
test('attach-cmd derives bash mode from the leading cue and switches frame colors', () => {
|
|
78
|
-
assert.equal(deriveBashMode('plain text'), 0);
|
|
79
|
-
assert.equal(deriveBashMode(' ! echo hi'), 1);
|
|
80
|
-
assert.equal(deriveBashMode('\t!! echo hi'), 2);
|
|
81
|
-
const pal = {
|
|
82
|
-
bashMode: (s) => `green:${s}`,
|
|
83
|
-
bashModeAlt: (s) => `bright:${s}`,
|
|
84
|
-
border: (s) => `border:${s}`,
|
|
85
|
-
};
|
|
86
|
-
const off = resolveEditorFrameStyles(0, undefined, pal);
|
|
87
|
-
assert.equal(off.titleStyle('x'), '\x1b[7m x \x1b[27m');
|
|
88
|
-
assert.notEqual(off.borderColor, pal.bashMode);
|
|
89
|
-
assert.notEqual(off.borderColor, pal.bashModeAlt);
|
|
90
|
-
const single = resolveEditorFrameStyles(1, undefined, pal);
|
|
91
|
-
assert.equal(single.borderColor, pal.bashMode);
|
|
92
|
-
assert.equal(single.titleStyle('x'), '\x1b[42m\x1b[97m\x1b[1m x \x1b[0m');
|
|
93
|
-
const double = resolveEditorFrameStyles(2, undefined, pal);
|
|
94
|
-
assert.equal(double.borderColor, pal.bashModeAlt);
|
|
95
|
-
assert.equal(double.titleStyle('x'), '\x1b[102m\x1b[30m\x1b[1m x \x1b[0m');
|
|
96
|
-
});
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// Regression: typing `!cmd` in the attach viewer was sent to the engine as a
|
|
2
|
-
// normal PROMPT (the LLM saw the literal `!cmd` and took a turn) instead of
|
|
3
|
-
// running bash and injecting the output into context with no agent turn — pi's
|
|
4
|
-
// native `!`/`!!` semantics. The fix routes a leading `!` in InputController to a
|
|
5
|
-
// `bash` drive frame (and `!!` to one with excludeFromContext). These tests lock
|
|
6
|
-
// the routing decision (the user-visible crux) so it can't silently revert.
|
|
7
|
-
import { test } from 'node:test';
|
|
8
|
-
import assert from 'node:assert/strict';
|
|
9
|
-
import { mkdtempSync } from 'node:fs';
|
|
10
|
-
import { tmpdir } from 'node:os';
|
|
11
|
-
import { join } from 'node:path';
|
|
12
|
-
import { TUI, ProcessTerminal } from '@earendil-works/pi-tui';
|
|
13
|
-
import { TitledEditor } from '../titled-editor.js';
|
|
14
|
-
import { InputController } from '../input-controller.js';
|
|
15
|
-
import { createKeybindingsManager } from '../config-load.js';
|
|
16
|
-
const ENTER = '\r';
|
|
17
|
-
function build() {
|
|
18
|
-
const agentDir = mkdtempSync(join(tmpdir(), 'crtr-bang-'));
|
|
19
|
-
const km = createKeybindingsManager(agentDir);
|
|
20
|
-
const tui = new TUI(new ProcessTerminal());
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
const editor = new TitledEditor(tui, { borderColor: (s) => s, selectList: {} }, km, {
|
|
23
|
-
paddingX: 1,
|
|
24
|
-
});
|
|
25
|
-
const frames = [];
|
|
26
|
-
const hooks = {
|
|
27
|
-
onCommand: (f) => frames.push(f),
|
|
28
|
-
onDialogResponse: () => { },
|
|
29
|
-
};
|
|
30
|
-
// eslint-disable-next-line no-new -- wiring the editor.onSubmit handler is the point
|
|
31
|
-
new InputController(tui, editor, km, hooks);
|
|
32
|
-
return { editor, frames };
|
|
33
|
-
}
|
|
34
|
-
test('`!cmd` routes to a bash frame, not a prompt', () => {
|
|
35
|
-
const { editor, frames } = build();
|
|
36
|
-
editor.setText('!ls -la');
|
|
37
|
-
editor.handleInput(ENTER);
|
|
38
|
-
assert.deepEqual(frames, [{ type: 'bash', command: 'ls -la', excludeFromContext: false }]);
|
|
39
|
-
assert.equal(editor.getText(), '', 'editor clears after a bash submit');
|
|
40
|
-
});
|
|
41
|
-
test('`!!cmd` routes to a bash frame with excludeFromContext', () => {
|
|
42
|
-
const { editor, frames } = build();
|
|
43
|
-
editor.setText('!!echo secret');
|
|
44
|
-
editor.handleInput(ENTER);
|
|
45
|
-
assert.deepEqual(frames, [{ type: 'bash', command: 'echo secret', excludeFromContext: true }]);
|
|
46
|
-
});
|
|
47
|
-
test('a bare `!` with no command is ignored (no frame, text kept)', () => {
|
|
48
|
-
const { editor, frames } = build();
|
|
49
|
-
editor.setText('! ');
|
|
50
|
-
editor.handleInput(ENTER);
|
|
51
|
-
assert.equal(frames.length, 0, 'a bare `!` must not emit a bash frame');
|
|
52
|
-
});
|
|
53
|
-
test('ordinary text still routes to a prompt frame (no regression)', () => {
|
|
54
|
-
const { editor, frames } = build();
|
|
55
|
-
editor.setText('hello world');
|
|
56
|
-
editor.handleInput(ENTER);
|
|
57
|
-
assert.deepEqual(frames, [{ type: 'prompt', text: 'hello world' }]);
|
|
58
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Regression: after the attach viewer was re-bundled (commit d72c0de), Alt+Enter
|
|
2
|
-
// silently stopped inserting a newline. Root cause was NOT in the editor logic —
|
|
3
|
-
// editor-newline.test.ts still passed because it runs UNBUNDLED (tsx), where
|
|
4
|
-
// config-load and pi-coding-agent's CustomEditor each load their own pi-tui from
|
|
5
|
-
// disk and `mirrorKeybindingsToEditor` reaches the editor's disk copy.
|
|
6
|
-
//
|
|
7
|
-
// In the BUNDLE, esbuild inlined TWO distinct pi-tui module instances — the
|
|
8
|
-
// top-level `node_modules/@earendil-works/pi-tui` (imported by config-load) and
|
|
9
|
-
// pi-coding-agent's nested `.../pi-coding-agent/node_modules/@earendil-works/pi-tui`
|
|
10
|
-
// (imported by CustomEditor). `setKeybindings` ran against the first global; the
|
|
11
|
-
// editor read `getKeybindings` from the second. The Alt+Enter newLine binding was
|
|
12
|
-
// invisible to the editor and the key fell through — swallowed. The runtime disk
|
|
13
|
-
// mirror can't help: it targets a third (on-disk) instance, not either bundled one.
|
|
14
|
-
//
|
|
15
|
-
// Fix: the build:attach script aliases @earendil-works/pi-tui to one absolute
|
|
16
|
-
// path so esbuild collapses both imports to a SINGLE bundled instance, and
|
|
17
|
-
// setKeybindings reaches the editor directly. This test bundles attach-cmd.ts
|
|
18
|
-
// the way the build script does and asserts exactly one pi-tui copy is inlined.
|
|
19
|
-
import { test } from 'node:test';
|
|
20
|
-
import assert from 'node:assert/strict';
|
|
21
|
-
import { readFileSync } from 'node:fs';
|
|
22
|
-
import { fileURLToPath } from 'node:url';
|
|
23
|
-
import { dirname, join } from 'node:path';
|
|
24
|
-
import { build } from 'esbuild';
|
|
25
|
-
const here = dirname(fileURLToPath(import.meta.url));
|
|
26
|
-
const repoRoot = join(here, '..', '..', '..', '..'); // src/clients/attach/__tests__ → package root
|
|
27
|
-
const entry = join(repoRoot, 'src/clients/attach/attach-cmd.ts');
|
|
28
|
-
const piTui = join(repoRoot, 'node_modules/@earendil-works/pi-tui');
|
|
29
|
-
/** Count distinct pi-tui package directories esbuild inlines into the bundle.
|
|
30
|
-
* Unminified output keeps each module's source path as a `// <path>` comment. */
|
|
31
|
-
function piTuiCopies(code) {
|
|
32
|
-
const copies = new Set();
|
|
33
|
-
for (const m of code.matchAll(/node_modules\/(?:\.pnpm\/)?@earendil-works\/(?:pi-coding-agent\/node_modules\/@earendil-works\/)?pi-tui/g)) {
|
|
34
|
-
copies.add(m[0]);
|
|
35
|
-
}
|
|
36
|
-
return copies;
|
|
37
|
-
}
|
|
38
|
-
test('build:attach aliases pi-tui to one path (sanity: package.json carries the alias)', () => {
|
|
39
|
-
const pkg = JSON.parse(readFileSync(join(repoRoot, 'package.json'), 'utf8'));
|
|
40
|
-
assert.match(pkg.scripts['build:attach'], /--alias:@earendil-works\/pi-tui=/, 'build:attach must alias pi-tui so the bundle inlines a single instance');
|
|
41
|
-
});
|
|
42
|
-
test('attach bundle inlines exactly ONE pi-tui instance (editor + config-load share the keybindings global)', async () => {
|
|
43
|
-
const result = await build({
|
|
44
|
-
entryPoints: [entry],
|
|
45
|
-
bundle: true,
|
|
46
|
-
write: false,
|
|
47
|
-
format: 'esm',
|
|
48
|
-
platform: 'node',
|
|
49
|
-
target: 'node22',
|
|
50
|
-
alias: { '@earendil-works/pi-tui': piTui },
|
|
51
|
-
logLevel: 'silent',
|
|
52
|
-
});
|
|
53
|
-
const code = result.outputFiles[0].text;
|
|
54
|
-
const copies = piTuiCopies(code);
|
|
55
|
-
assert.equal(copies.size, 1, `bundle must inline exactly one pi-tui (two = the Alt+Enter regression). Found: ${[...copies].join(', ')}`);
|
|
56
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
// Bug-regression: `crtr attach` Ctrl+V reported "no image in the clipboard" even
|
|
2
|
-
// when the clipboard genuinely held an image. Root cause — the macOS reader only
|
|
3
|
-
// tried `pngpaste -`, which is NOT a built-in (`brew install pngpaste`); on a
|
|
4
|
-
// stock Mac its absence returned null, indistinguishable from an empty clipboard.
|
|
5
|
-
//
|
|
6
|
-
// These lock in the platform dispatch (clipboard-image.ts): a MISSING pngpaste
|
|
7
|
-
// must FALL THROUGH to the native osascript read (not collapse to "no image"),
|
|
8
|
-
// and the reader must DISTINGUISH "no clipboard tool" from "clipboard has no
|
|
9
|
-
// image" so the user-facing notice is accurate. The decision logic is pure +
|
|
10
|
-
// injectable precisely so it can be unit-tested without a real clipboard.
|
|
11
|
-
import { test } from 'node:test';
|
|
12
|
-
import assert from 'node:assert/strict';
|
|
13
|
-
import { selectMacOutcome, selectLinuxOutcome, } from '../clipboard-image.js';
|
|
14
|
-
const bytes = (s) => Buffer.from(s);
|
|
15
|
-
test('macOS: missing pngpaste falls through to the native osascript read (the bug)', () => {
|
|
16
|
-
let nativeCalled = false;
|
|
17
|
-
const runTool = (cmd) => {
|
|
18
|
-
assert.equal(cmd, 'pngpaste');
|
|
19
|
-
return { missing: true }; // pngpaste not installed (stock Mac)
|
|
20
|
-
};
|
|
21
|
-
const readNative = () => {
|
|
22
|
-
nativeCalled = true;
|
|
23
|
-
return { image: { bytes: bytes('PNGDATA'), mimeType: 'image/png' } };
|
|
24
|
-
};
|
|
25
|
-
const out = selectMacOutcome(runTool, readNative);
|
|
26
|
-
assert.equal(nativeCalled, true, 'native osascript path must run when pngpaste is absent');
|
|
27
|
-
assert.equal(out.image?.mimeType, 'image/png');
|
|
28
|
-
assert.equal(out.image?.bytes.toString(), 'PNGDATA');
|
|
29
|
-
});
|
|
30
|
-
test('macOS: pngpaste present takes the fast path and skips osascript', () => {
|
|
31
|
-
let nativeCalled = false;
|
|
32
|
-
const runTool = () => ({ bytes: bytes('FASTPNG') });
|
|
33
|
-
const readNative = () => {
|
|
34
|
-
nativeCalled = true;
|
|
35
|
-
return {};
|
|
36
|
-
};
|
|
37
|
-
const out = selectMacOutcome(runTool, readNative);
|
|
38
|
-
assert.equal(nativeCalled, false, 'fast path must not invoke osascript');
|
|
39
|
-
assert.equal(out.image?.bytes.toString(), 'FASTPNG');
|
|
40
|
-
});
|
|
41
|
-
test('macOS: pngpaste present but clipboard empty still defers to osascript', () => {
|
|
42
|
-
// pngpaste exits non-zero on an empty clipboard → {} (ran, no image). The
|
|
43
|
-
// native path is authoritative for the empty-vs-failure distinction.
|
|
44
|
-
let nativeCalled = false;
|
|
45
|
-
const runTool = () => ({}); // ran, no bytes
|
|
46
|
-
const readNative = () => {
|
|
47
|
-
nativeCalled = true;
|
|
48
|
-
return {}; // osascript: NO_IMAGE
|
|
49
|
-
};
|
|
50
|
-
const out = selectMacOutcome(runTool, readNative);
|
|
51
|
-
assert.equal(nativeCalled, true);
|
|
52
|
-
assert.equal(out.image, undefined);
|
|
53
|
-
assert.equal(out.note, undefined, 'empty clipboard → no note (caller shows the generic notice)');
|
|
54
|
-
});
|
|
55
|
-
test('Linux: no clipboard tool installed surfaces a precise note, not "no image"', () => {
|
|
56
|
-
const runTool = () => ({ missing: true }); // neither xclip nor wl-paste
|
|
57
|
-
const out = selectLinuxOutcome(runTool, /* wayland */ false);
|
|
58
|
-
assert.equal(out.image, undefined);
|
|
59
|
-
assert.match(out.note ?? '', /install xclip/);
|
|
60
|
-
});
|
|
61
|
-
test('Linux/Wayland: no tool installed names wl-clipboard', () => {
|
|
62
|
-
const out = selectLinuxOutcome(() => ({ missing: true }), /* wayland */ true);
|
|
63
|
-
assert.match(out.note ?? '', /wl-clipboard/);
|
|
64
|
-
});
|
|
65
|
-
test('Linux: tool present but clipboard has no image → empty (no note)', () => {
|
|
66
|
-
const runTool = () => ({}); // xclip ran, no image of that type
|
|
67
|
-
const out = selectLinuxOutcome(runTool, /* wayland */ false);
|
|
68
|
-
assert.equal(out.image, undefined);
|
|
69
|
-
assert.equal(out.note, undefined, 'a tool that ran but found no image is genuinely empty');
|
|
70
|
-
});
|
|
71
|
-
test('Linux: xclip returns PNG bytes', () => {
|
|
72
|
-
const runTool = (_cmd, args) => args.includes('image/png') ? { bytes: bytes('XPNG') } : {};
|
|
73
|
-
const out = selectLinuxOutcome(runTool, /* wayland */ false);
|
|
74
|
-
assert.equal(out.image?.mimeType, 'image/png');
|
|
75
|
-
assert.equal(out.image?.bytes.toString(), 'XPNG');
|
|
76
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// Regression (#11): in the attach viewer, Alt+Enter did NOTHING on an INSTALLED
|
|
2
|
-
// (non-deduped) crtr — not a newline, not a submit. Root cause: pi-coding-agent's
|
|
3
|
-
// CustomEditor resolves `@earendil-works/pi-tui` from its OWN node_modules, a
|
|
4
|
-
// SEPARATE module instance from the one `config-load` imports. The base Editor
|
|
5
|
-
// reads `getKeybindings()` from THAT instance — stuck at the default
|
|
6
|
-
// `tui.input.newLine = shift+enter` unless the `mirrorKeybindingsToEditor` shim
|
|
7
|
-
// (best-effort, `import.meta.resolve`-based) succeeds in registering crtr's
|
|
8
|
-
// manager on it. On install layouts where that mirror silently fails, the
|
|
9
|
-
// `alt+enter → newLine` override never reached the editor and Alt+Enter
|
|
10
|
-
// (`\x1b[13;3u`) matched neither newLine nor submit and fell through.
|
|
11
|
-
//
|
|
12
|
-
// The fix makes the chord self-contained: `TitledEditor.handleInput` matches
|
|
13
|
-
// newLine against crtr's OWN KeybindingsManager (the one CustomEditor already
|
|
14
|
-
// uses for `app.*`) and inserts the newline directly, so it no longer depends on
|
|
15
|
-
// the cross-instance mirror. The third test below builds the editor WITHOUT the
|
|
16
|
-
// mirror and is the real guard for the installed-layout failure.
|
|
17
|
-
import { test } from 'node:test';
|
|
18
|
-
import assert from 'node:assert/strict';
|
|
19
|
-
import { mkdtempSync } from 'node:fs';
|
|
20
|
-
import { tmpdir } from 'node:os';
|
|
21
|
-
import { join } from 'node:path';
|
|
22
|
-
import { TUI, ProcessTerminal } from '@earendil-works/pi-tui';
|
|
23
|
-
import { TitledEditor } from '../titled-editor.js';
|
|
24
|
-
import { createKeybindingsManager, mirrorKeybindingsToEditor } from '../config-load.js';
|
|
25
|
-
// Kitty CSI-u: `\x1b[<codepoint>;<1+mods>u`. enter=13, alt=2 → mods byte 3.
|
|
26
|
-
const ALT_ENTER = '\x1b[13;3u';
|
|
27
|
-
const ENTER = '\r';
|
|
28
|
-
async function buildEditor() {
|
|
29
|
-
// Empty agent dir → no user keybindings.json, so the binding under test is the
|
|
30
|
-
// attach DEFAULT (`ATTACH_KEYBINDING_OVERRIDES` adds alt+enter to newLine).
|
|
31
|
-
const agentDir = mkdtempSync(join(tmpdir(), 'crtr-kb-'));
|
|
32
|
-
const km = createKeybindingsManager(agentDir);
|
|
33
|
-
await mirrorKeybindingsToEditor(km); // mirror still runs for general tui.* parity
|
|
34
|
-
const tui = new TUI(new ProcessTerminal());
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
|
-
return new TitledEditor(tui, { borderColor: (s) => s, selectList: {} }, km, {
|
|
37
|
-
paddingX: 1,
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
test('attach editor inserts a newline on Alt+Enter (cross-instance binding reaches the editor)', async () => {
|
|
41
|
-
const editor = await buildEditor();
|
|
42
|
-
let submitted = null;
|
|
43
|
-
editor.onSubmit = (t) => {
|
|
44
|
-
submitted = t;
|
|
45
|
-
};
|
|
46
|
-
editor.setText('hello');
|
|
47
|
-
editor.handleInput(ALT_ENTER);
|
|
48
|
-
assert.equal(editor.getText(), 'hello\n', 'Alt+Enter must insert a newline, not be swallowed');
|
|
49
|
-
assert.equal(submitted, null, 'Alt+Enter must not submit');
|
|
50
|
-
});
|
|
51
|
-
test('attach editor still submits on plain Enter', async () => {
|
|
52
|
-
const editor = await buildEditor();
|
|
53
|
-
let submitted = null;
|
|
54
|
-
editor.onSubmit = (t) => {
|
|
55
|
-
submitted = t;
|
|
56
|
-
};
|
|
57
|
-
editor.setText('hello');
|
|
58
|
-
editor.handleInput(ENTER);
|
|
59
|
-
assert.equal(submitted, 'hello', 'plain Enter must submit');
|
|
60
|
-
assert.equal(editor.getText(), '', 'editor clears after submit');
|
|
61
|
-
});
|
|
62
|
-
test('attach editor inserts a newline on Alt+Enter even WITHOUT the cross-instance mirror (#11)', async () => {
|
|
63
|
-
// Reproduces the installed-layout failure: the editor's pi-tui instance never
|
|
64
|
-
// received crtr's alt+enter override (mirror not run). TitledEditor.handleInput
|
|
65
|
-
// must still newline by matching crtr's own km directly.
|
|
66
|
-
const agentDir = mkdtempSync(join(tmpdir(), 'crtr-kb-'));
|
|
67
|
-
const km = createKeybindingsManager(agentDir);
|
|
68
|
-
// NOTE: deliberately NOT calling mirrorKeybindingsToEditor.
|
|
69
|
-
const tui = new TUI(new ProcessTerminal());
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
71
|
-
const editor = new TitledEditor(tui, { borderColor: (s) => s, selectList: {} }, km, {
|
|
72
|
-
paddingX: 1,
|
|
73
|
-
});
|
|
74
|
-
let submitted = null;
|
|
75
|
-
editor.onSubmit = (t) => {
|
|
76
|
-
submitted = t;
|
|
77
|
-
};
|
|
78
|
-
editor.setText('hello');
|
|
79
|
-
editor.handleInput(ALT_ENTER);
|
|
80
|
-
assert.equal(editor.getText(), 'hello\n', 'Alt+Enter must newline without relying on the mirror');
|
|
81
|
-
assert.equal(submitted, null, 'Alt+Enter must not submit');
|
|
82
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// Unit coverage for the pure git-status parser that feeds the attach editor's
|
|
2
|
-
// border (cwd · branch · status symbols). The shell-out is non-blocking and
|
|
3
|
-
// untestable in a unit, but the porcelain-v1 --branch parse is pure and the
|
|
4
|
-
// part that can silently mis-read state, so it is locked in here.
|
|
5
|
-
// See src/clients/attach/git-info.ts.
|
|
6
|
-
import { test } from 'node:test';
|
|
7
|
-
import assert from 'node:assert/strict';
|
|
8
|
-
import { parseGitStatus } from '../git-info.js';
|
|
9
|
-
test('clean tree on a tracked branch', () => {
|
|
10
|
-
const info = parseGitStatus('repo', '## main...origin/main\n');
|
|
11
|
-
assert.deepEqual(info, { dir: 'repo', branch: 'main', dirty: false, ahead: 0, behind: 0 });
|
|
12
|
-
});
|
|
13
|
-
test('dirty tree with ahead/behind counts', () => {
|
|
14
|
-
const info = parseGitStatus('repo', '## feature...origin/feature [ahead 2, behind 3]\n M src/a.ts\n?? new.ts\n');
|
|
15
|
-
assert.equal(info.branch, 'feature');
|
|
16
|
-
assert.equal(info.dirty, true);
|
|
17
|
-
assert.equal(info.ahead, 2);
|
|
18
|
-
assert.equal(info.behind, 3);
|
|
19
|
-
});
|
|
20
|
-
test('untracked-only branch (no upstream) is still dirty, no counts', () => {
|
|
21
|
-
const info = parseGitStatus('repo', '## main\n?? scratch.md\n');
|
|
22
|
-
assert.equal(info.branch, 'main');
|
|
23
|
-
assert.equal(info.dirty, true);
|
|
24
|
-
assert.equal(info.ahead, 0);
|
|
25
|
-
assert.equal(info.behind, 0);
|
|
26
|
-
});
|
|
27
|
-
test('detached HEAD reports no branch', () => {
|
|
28
|
-
const info = parseGitStatus('repo', '## HEAD (no branch)\n');
|
|
29
|
-
assert.equal(info.branch, undefined);
|
|
30
|
-
assert.equal(info.dirty, false);
|
|
31
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Regression: the `crtr attach` viewer built its InputController WITHOUT the
|
|
2
|
-
// `onRequest` hook, so the correlated read-op channel was never wired even
|
|
3
|
-
// though ViewSocketClient.request() was fully implemented. Every native picker
|
|
4
|
-
// (/model, /resume, /fork, /tree, /settings, /scoped-models) therefore degraded
|
|
5
|
-
// to the "isn't available in this viewer" notice — /model couldn't open the
|
|
6
|
-
// model picker. The fix wires `onRequest: (frame) => socket.request(frame)` in
|
|
7
|
-
// attach-cmd. This assembly lives inside a big TUI-constructing function with no
|
|
8
|
-
// seam to unit-test, so this guards the exact wiring at the source level.
|
|
9
|
-
// See src/clients/attach/{attach-cmd,input-controller,slash-commands}.ts.
|
|
10
|
-
import { test } from 'node:test';
|
|
11
|
-
import assert from 'node:assert/strict';
|
|
12
|
-
import { readFileSync } from 'node:fs';
|
|
13
|
-
import { fileURLToPath } from 'node:url';
|
|
14
|
-
import { dirname, join } from 'node:path';
|
|
15
|
-
const src = readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', 'attach-cmd.ts'), 'utf8');
|
|
16
|
-
test('attach-cmd wires onRequest to socket.request so native pickers work', () => {
|
|
17
|
-
// The InputController must receive the read-op channel; without it
|
|
18
|
-
// openPicker() short-circuits to the "isn't available in this viewer" notice.
|
|
19
|
-
assert.match(src.replace(/\s+/g, ' '), /onRequest:\s*\(frame\)\s*=>\s*socket\.request\(frame\)/, 'attach-cmd must pass onRequest: (frame) => socket.request(frame) to InputController');
|
|
20
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Regression: the `crtr attach` viewer used to ALWAYS teardown ("broker gone")
|
|
2
|
-
// on a socket close, so a resident broker node's yield→revive cycle dropped the
|
|
3
|
-
// viewer to a shell. The fix holds the pane and re-dials the SAME view.sock
|
|
4
|
-
// while the node is still alive, giving up only when it is genuinely gone. This
|
|
5
|
-
// locks the give-up/keep-reconnecting decision (the bug-prone core) without a
|
|
6
|
-
// socket or tmux. See src/clients/attach/{view-socket,attach-cmd}.ts.
|
|
7
|
-
import { test } from 'node:test';
|
|
8
|
-
import assert from 'node:assert/strict';
|
|
9
|
-
import { reconnectShouldGiveUp } from '../view-socket.js';
|
|
10
|
-
const rowWith = (status) => ({
|
|
11
|
-
node_id: 'n',
|
|
12
|
-
status,
|
|
13
|
-
host_kind: 'broker',
|
|
14
|
-
intent: null,
|
|
15
|
-
pi_pid: null,
|
|
16
|
-
});
|
|
17
|
-
test('keeps reconnecting while the node is still alive (active = mid yield/revive)', () => {
|
|
18
|
-
// A yield leaves status='active' (intent='refresh') — must NOT give up.
|
|
19
|
-
assert.equal(reconnectShouldGiveUp(rowWith('active')), false);
|
|
20
|
-
// idle-release revives on the next inbox wake — keep trying (bounded by the
|
|
21
|
-
// supervisor's own ~30s deadline), do not give up.
|
|
22
|
-
assert.equal(reconnectShouldGiveUp(rowWith('idle')), false);
|
|
23
|
-
});
|
|
24
|
-
test('gives up the instant the node is genuinely gone', () => {
|
|
25
|
-
assert.equal(reconnectShouldGiveUp(rowWith('done')), true);
|
|
26
|
-
assert.equal(reconnectShouldGiveUp(rowWith('dead')), true);
|
|
27
|
-
assert.equal(reconnectShouldGiveUp(rowWith('canceled')), true);
|
|
28
|
-
// A reaped row (null) → give up.
|
|
29
|
-
assert.equal(reconnectShouldGiveUp(null), true);
|
|
30
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// Regression: `/quit` in the attach viewer only sent a `bye` frame + a notice.
|
|
2
|
-
// The broker answers `bye` with socket.end(), which the viewer's close handler
|
|
3
|
-
// treats as a dropped connection and RECONNECTS — so `/quit` never detached (it
|
|
4
|
-
// silently reconnected). The fix routes `/quit` through an `onQuit` hook wired to
|
|
5
|
-
// teardown('detach'). Likewise `/copy` was a dead "not available" stub; it now
|
|
6
|
-
// runs through an `onCopy` hook. This guards the dispatch contract for both.
|
|
7
|
-
// See src/clients/attach/{slash-commands,input-controller,attach-cmd}.ts.
|
|
8
|
-
import { test } from 'node:test';
|
|
9
|
-
import assert from 'node:assert/strict';
|
|
10
|
-
import { dispatchSlashCommand } from '../slash-commands.js';
|
|
11
|
-
function ctx(overrides = {}) {
|
|
12
|
-
const sent = [];
|
|
13
|
-
const notices = [];
|
|
14
|
-
return {
|
|
15
|
-
send: (f) => sent.push(f),
|
|
16
|
-
notify: (m) => notices.push(m),
|
|
17
|
-
sent,
|
|
18
|
-
notices,
|
|
19
|
-
...overrides,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
test('/quit detaches via onQuit and does NOT send a bare bye (reconnect-loop bug)', () => {
|
|
23
|
-
let quit = 0;
|
|
24
|
-
const c = ctx({ onQuit: () => quit++ });
|
|
25
|
-
const handled = dispatchSlashCommand('/quit', c);
|
|
26
|
-
assert.equal(handled, true);
|
|
27
|
-
assert.equal(quit, 1, '/quit must invoke onQuit (teardown), not just send bye');
|
|
28
|
-
assert.equal(c.sent.length, 0, '/quit must not send a bare bye frame when onQuit is wired');
|
|
29
|
-
});
|
|
30
|
-
test('/quit falls back to a bye frame when onQuit is unwired', () => {
|
|
31
|
-
const c = ctx();
|
|
32
|
-
dispatchSlashCommand('/quit', c);
|
|
33
|
-
assert.deepEqual(c.sent, [{ type: 'bye' }]);
|
|
34
|
-
});
|
|
35
|
-
test('/copy runs through onCopy instead of the dead "not available" stub', () => {
|
|
36
|
-
let copy = 0;
|
|
37
|
-
const c = ctx({ onCopy: () => copy++ });
|
|
38
|
-
const handled = dispatchSlashCommand('/copy', c);
|
|
39
|
-
assert.equal(handled, true);
|
|
40
|
-
assert.equal(copy, 1, '/copy must invoke onCopy');
|
|
41
|
-
assert.equal(c.notices.length, 0, '/copy must not fall through to a notice when onCopy is wired');
|
|
42
|
-
});
|