@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
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Regression: TitledEditor's top border dropped the git-info chip only when the
|
|
2
|
-
// title chip left fewer than 4 free columns — when BOTH chips fit individually
|
|
3
|
-
// but their sum exceeded the terminal width, the fill clamped to 0 and the line
|
|
4
|
-
// came out chipW+infoW wide. pi-tui hard-crashes on any over-wide line:
|
|
5
|
-
// "Error: Rendered line 3192 exceeds terminal width (75 > 70)"
|
|
6
|
-
// (title chip " ⬢ general (base) continue-crouter-development 0 " = 50 cols,
|
|
7
|
-
// info "crouter · ⎇ main · ●⇡5⇣1" = 25 cols, terminal 70). The fix truncates
|
|
8
|
-
// the info chip to the space the title leaves instead of all-or-nothing.
|
|
9
|
-
// See composeTopBorder in src/clients/attach/titled-editor.ts.
|
|
10
|
-
import { test } from 'node:test';
|
|
11
|
-
import assert from 'node:assert/strict';
|
|
12
|
-
import { visibleWidth } from '@earendil-works/pi-tui';
|
|
13
|
-
import { composeTopBorder, thinkingBorderColor, thinkingTitleStyle } from '../titled-editor.js';
|
|
14
|
-
const titleStyle = (s) => `\x1b[7m ${s} \x1b[27m`;
|
|
15
|
-
const borderColor = (s) => `\x1b[38;2;128;128;128m${s}\x1b[39m`;
|
|
16
|
-
const compose = (width, title, info) => composeTopBorder(width, title, info, titleStyle, borderColor);
|
|
17
|
-
test('crash scenario: chip + info that each fit but overflow together stays at width', () => {
|
|
18
|
-
const title = '⬢ general (base) continue-crouter-development 0'; // chip = 50 cols
|
|
19
|
-
const info = `\x1b[38;2;128;128;128mcrouter · \x1b[39m\x1b[38;2;129;162;190m⎇ main\x1b[39m\x1b[38;2;128;128;128m · \x1b[39m\x1b[33m●\x1b[39m⇡5⇣1`; // 25 cols
|
|
20
|
-
const line = compose(70, title, info);
|
|
21
|
-
assert.equal(visibleWidth(line), 70, 'line must be exactly terminal width, not 75');
|
|
22
|
-
});
|
|
23
|
-
test('top border never exceeds width across title/info length combinations', () => {
|
|
24
|
-
const longInfo = `\x1b[33m${'status-info-'.repeat(8)}\x1b[39m`;
|
|
25
|
-
for (const width of [20, 40, 70, 120]) {
|
|
26
|
-
for (const title of ['', 'a', 'session', 'x'.repeat(200)]) {
|
|
27
|
-
for (const info of ['', 'crouter · main', longInfo]) {
|
|
28
|
-
const line = compose(width, title, info);
|
|
29
|
-
assert.ok(visibleWidth(line) <= width, `overflow at width=${width} titleLen=${title.length} infoW=${visibleWidth(info)}: got ${visibleWidth(line)}`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
test('info chip survives intact when there is room for it', () => {
|
|
35
|
-
const info = 'crouter · main';
|
|
36
|
-
const line = compose(80, 'sess', info);
|
|
37
|
-
assert.ok(line.includes(info), 'fitting info must not be truncated or dropped');
|
|
38
|
-
assert.equal(visibleWidth(line), 80);
|
|
39
|
-
});
|
|
40
|
-
test('thinking levels use an evenly spaced blue→orange scale', () => {
|
|
41
|
-
const cases = [
|
|
42
|
-
['minimal', '38;2;68;120;228', '48;2;68;120;228'],
|
|
43
|
-
['low', '38;2;108;128;188', '48;2;108;128;188'],
|
|
44
|
-
['medium', '38;2;148;136;148', '48;2;148;136;148'],
|
|
45
|
-
['high', '38;2;188;144;108', '48;2;188;144;108'],
|
|
46
|
-
['xhigh', '38;2;228;152;68', '48;2;228;152;68'],
|
|
47
|
-
];
|
|
48
|
-
const borderRgb = new Set();
|
|
49
|
-
const titleRgb = new Set();
|
|
50
|
-
for (const [level, border, title] of cases) {
|
|
51
|
-
const borderColor = thinkingBorderColor(level, (s) => s);
|
|
52
|
-
const titleStyle = thinkingTitleStyle(level, (s) => s);
|
|
53
|
-
assert.match(composeTopBorder(24, 'sess', '', (s) => s, borderColor), new RegExp(`\\x1b\\[${border}m`), `${level} border should use ${border}`);
|
|
54
|
-
assert.match(titleStyle('sess'), new RegExp(`\\x1b\\[${title}m`), `${level} title should use ${title}`);
|
|
55
|
-
borderRgb.add(border);
|
|
56
|
-
titleRgb.add(title);
|
|
57
|
-
}
|
|
58
|
-
assert.equal(borderRgb.size, cases.length, 'every thinking level needs its own border step');
|
|
59
|
-
assert.equal(titleRgb.size, cases.length, 'every thinking level needs its own title step');
|
|
60
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// Bug-regression: guards the hard cut that merged the substrate's `when`/`why`
|
|
2
|
-
// frontmatter pair into the single `when-and-why-to-read` read-routing field.
|
|
3
|
-
// The CTO ruling (taste/why-field-means-why-to-read) requires the migration be
|
|
4
|
-
// a hard cut: an old-shape doc must FAIL at `crtr memory lint`, never be read at
|
|
5
|
-
// runtime. `lintSubstrateSchema` is that enforcement seam — these lock it.
|
|
6
|
-
//
|
|
7
|
-
// Run: node --import tsx/esm --test src/commands/memory/__tests__/lint-schema.test.ts
|
|
8
|
-
import { test } from 'node:test';
|
|
9
|
-
import assert from 'node:assert/strict';
|
|
10
|
-
import { lintSubstrateSchema } from '../lint.js';
|
|
11
|
-
const ROUTING = 'When you are X, this reference should be read because Y';
|
|
12
|
-
const RUNGS = { 'system-prompt-visibility': 'name', 'file-read-visibility': 'none' };
|
|
13
|
-
test('lint rejects a doc still carrying the retired `when` key', () => {
|
|
14
|
-
const err = lintSubstrateSchema({ kind: 'knowledge', when: 'when X' });
|
|
15
|
-
assert.ok(err !== null, 'old-shape `when` must produce a finding');
|
|
16
|
-
assert.match(err, /when-and-why-to-read/, 'the message points at the new field');
|
|
17
|
-
});
|
|
18
|
-
test('lint rejects a doc still carrying the retired `why` key', () => {
|
|
19
|
-
const err = lintSubstrateSchema({ kind: 'knowledge', why: 'because Y' });
|
|
20
|
-
assert.ok(err !== null, 'old-shape `why` must produce a finding');
|
|
21
|
-
assert.match(err, /when-and-why-to-read/, 'the message points at the new field');
|
|
22
|
-
});
|
|
23
|
-
test('lint rejects a substrate doc missing the merged routing field', () => {
|
|
24
|
-
const err = lintSubstrateSchema({ kind: 'knowledge' });
|
|
25
|
-
assert.ok(err !== null, 'a substrate doc must carry when-and-why-to-read');
|
|
26
|
-
assert.match(err, /when-and-why-to-read/);
|
|
27
|
-
});
|
|
28
|
-
test('lint accepts the merged new-shape frontmatter', () => {
|
|
29
|
-
assert.equal(lintSubstrateSchema({ kind: 'knowledge', 'when-and-why-to-read': ROUTING, ...RUNGS }), null);
|
|
30
|
-
});
|
|
31
|
-
// Visibility is a required, case-by-case authoring call — there is no kind
|
|
32
|
-
// default. lint must reject a doc that omits either rung (the runtime parser
|
|
33
|
-
// silently floors a missing rung to `none`, which is exactly the tolerance this
|
|
34
|
-
// gate exists to catch at authoring time).
|
|
35
|
-
test('lint rejects a substrate doc missing system-prompt-visibility', () => {
|
|
36
|
-
const err = lintSubstrateSchema({
|
|
37
|
-
kind: 'knowledge',
|
|
38
|
-
'when-and-why-to-read': ROUTING,
|
|
39
|
-
'file-read-visibility': 'none',
|
|
40
|
-
});
|
|
41
|
-
assert.ok(err !== null, 'a missing rung must produce a finding');
|
|
42
|
-
assert.match(err, /missing system-prompt-visibility/);
|
|
43
|
-
});
|
|
44
|
-
test('lint rejects a substrate doc missing file-read-visibility', () => {
|
|
45
|
-
const err = lintSubstrateSchema({
|
|
46
|
-
kind: 'knowledge',
|
|
47
|
-
'when-and-why-to-read': ROUTING,
|
|
48
|
-
'system-prompt-visibility': 'name',
|
|
49
|
-
});
|
|
50
|
-
assert.ok(err !== null, 'a missing rung must produce a finding');
|
|
51
|
-
assert.match(err, /missing file-read-visibility/);
|
|
52
|
-
});
|
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
// Framework tests for the argv parser and help renderer (inputModel: 'argv').
|
|
2
|
-
// Run with: node --import tsx/esm --test src/core/__tests__/argv-parser.test.ts
|
|
3
|
-
// These tests exercise parseArgv and renderLeafArgv directly — no process.argv
|
|
4
|
-
// mutation, no subprocess spawning.
|
|
5
|
-
import { test, describe } from 'node:test';
|
|
6
|
-
import assert from 'node:assert/strict';
|
|
7
|
-
import { parseArgv } from '../command.js';
|
|
8
|
-
import { renderLeafArgv } from '../help.js';
|
|
9
|
-
import { defineLeaf } from '../command.js';
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
// parseArgv — flags
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
describe('parseArgv: flags', () => {
|
|
14
|
-
const params = [
|
|
15
|
-
{ kind: 'flag', name: 'plan-id', type: 'string', required: true, constraint: 'Plan id.' },
|
|
16
|
-
{ kind: 'flag', name: 'limit', type: 'int', required: false, constraint: 'Max results.', default: 20 },
|
|
17
|
-
{ kind: 'flag', name: 'follow', type: 'bool', required: false, constraint: 'Stream.' },
|
|
18
|
-
{ kind: 'flag', name: 'status', type: 'enum', choices: ['draft', 'done'], required: false, constraint: 'Filter.' },
|
|
19
|
-
];
|
|
20
|
-
test('parses --flag value form', async () => {
|
|
21
|
-
const result = await parseArgv(params, ['--plan-id', 'abc123']);
|
|
22
|
-
assert.equal(result['planId'], 'abc123');
|
|
23
|
-
});
|
|
24
|
-
test('parses --flag=value form', async () => {
|
|
25
|
-
const result = await parseArgv(params, ['--plan-id=abc123']);
|
|
26
|
-
assert.equal(result['planId'], 'abc123');
|
|
27
|
-
});
|
|
28
|
-
test('parses int flag', async () => {
|
|
29
|
-
const result = await parseArgv(params, ['--plan-id', 'x', '--limit', '42']);
|
|
30
|
-
assert.equal(result['limit'], 42);
|
|
31
|
-
});
|
|
32
|
-
test('rejects non-integer for int flag', async () => {
|
|
33
|
-
await assert.rejects(() => parseArgv(params, ['--plan-id', 'x', '--limit', 'notanint']), (err) => { assert.match(err.message, /must be an integer/); return true; });
|
|
34
|
-
});
|
|
35
|
-
test('bool flag: presence = true', async () => {
|
|
36
|
-
const result = await parseArgv(params, ['--plan-id', 'x', '--follow']);
|
|
37
|
-
assert.equal(result['follow'], true);
|
|
38
|
-
});
|
|
39
|
-
test('bool flag: absence = default false', async () => {
|
|
40
|
-
const result = await parseArgv(params, ['--plan-id', 'x']);
|
|
41
|
-
assert.equal(result['follow'], false);
|
|
42
|
-
});
|
|
43
|
-
test('bool flag rejects --flag=value', async () => {
|
|
44
|
-
await assert.rejects(() => parseArgv(params, ['--plan-id', 'x', '--follow=true']), (err) => { assert.match(err.message, /takes no value/); return true; });
|
|
45
|
-
});
|
|
46
|
-
test('enum flag: valid value passes', async () => {
|
|
47
|
-
const result = await parseArgv(params, ['--plan-id', 'x', '--status', 'draft']);
|
|
48
|
-
assert.equal(result['status'], 'draft');
|
|
49
|
-
});
|
|
50
|
-
test('enum flag: invalid value throws invalid_type', async () => {
|
|
51
|
-
await assert.rejects(() => parseArgv(params, ['--plan-id', 'x', '--status', 'unknown']), (err) => { assert.match(err.message, /must be one of/); return true; });
|
|
52
|
-
});
|
|
53
|
-
test('int flag default applied when absent', async () => {
|
|
54
|
-
const result = await parseArgv(params, ['--plan-id', 'x']);
|
|
55
|
-
assert.equal(result['limit'], 20);
|
|
56
|
-
});
|
|
57
|
-
test('unknown flag throws unknown_flag', async () => {
|
|
58
|
-
await assert.rejects(() => parseArgv(params, ['--plan-id', 'x', '--bogus', 'y']), (err) => { assert.match(err.message, /unknown flag/); return true; });
|
|
59
|
-
});
|
|
60
|
-
test('missing required flag throws missing_parameter', async () => {
|
|
61
|
-
await assert.rejects(() => parseArgv(params, []), (err) => { assert.match(err.message, /required parameter is missing/); return true; });
|
|
62
|
-
});
|
|
63
|
-
test('kebab-case flag name becomes camelCase key', async () => {
|
|
64
|
-
const result = await parseArgv(params, ['--plan-id', 'abc']);
|
|
65
|
-
assert.ok('planId' in result);
|
|
66
|
-
assert.ok(!('plan-id' in result));
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
|
-
// parseArgv — positional
|
|
71
|
-
// ---------------------------------------------------------------------------
|
|
72
|
-
describe('parseArgv: positional', () => {
|
|
73
|
-
const params = [
|
|
74
|
-
{ kind: 'positional', name: 'job-id', required: true, constraint: 'Job id.' },
|
|
75
|
-
{ kind: 'flag', name: 'follow', type: 'bool', required: false, constraint: '' },
|
|
76
|
-
];
|
|
77
|
-
test('parses single positional before flags', async () => {
|
|
78
|
-
const result = await parseArgv(params, ['job-abc', '--follow']);
|
|
79
|
-
assert.equal(result['jobId'], 'job-abc');
|
|
80
|
-
assert.equal(result['follow'], true);
|
|
81
|
-
});
|
|
82
|
-
test('parses single positional after flags', async () => {
|
|
83
|
-
const result = await parseArgv(params, ['--follow', 'job-abc']);
|
|
84
|
-
assert.equal(result['jobId'], 'job-abc');
|
|
85
|
-
});
|
|
86
|
-
test('parses positional after bare --', async () => {
|
|
87
|
-
const result = await parseArgv(params, ['--', 'job-abc']);
|
|
88
|
-
assert.equal(result['jobId'], 'job-abc');
|
|
89
|
-
});
|
|
90
|
-
test('two positionals throws bad_invocation', async () => {
|
|
91
|
-
await assert.rejects(() => parseArgv(params, ['job-abc', 'extra']), (err) => { assert.match(err.message, /unexpected extra positional/); return true; });
|
|
92
|
-
});
|
|
93
|
-
test('missing required positional throws missing_parameter', async () => {
|
|
94
|
-
await assert.rejects(() => parseArgv(params, []), (err) => { assert.match(err.message, /required parameter is missing/); return true; });
|
|
95
|
-
});
|
|
96
|
-
test('positional when none declared throws bad_invocation', async () => {
|
|
97
|
-
const noPos = [
|
|
98
|
-
{ kind: 'flag', name: 'name', type: 'string', required: false, constraint: '' },
|
|
99
|
-
];
|
|
100
|
-
await assert.rejects(() => parseArgv(noPos, ['somevalue']), (err) => { assert.match(err.message, /takes no positional/); return true; });
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
// ---------------------------------------------------------------------------
|
|
104
|
-
// parseArgv — stdin satisfied by a positional argument
|
|
105
|
-
// ---------------------------------------------------------------------------
|
|
106
|
-
describe('parseArgv: stdin-as-positional', () => {
|
|
107
|
-
const params = [
|
|
108
|
-
{ kind: 'stdin', name: 'prompt', required: true, constraint: 'Task.' },
|
|
109
|
-
{ kind: 'flag', name: 'agent', type: 'string', required: false, default: 'general', constraint: '' },
|
|
110
|
-
];
|
|
111
|
-
test('a positional token satisfies a stdin param', async () => {
|
|
112
|
-
const result = await parseArgv(params, ['--agent', 'general', 'Say hi']);
|
|
113
|
-
assert.equal(result['prompt'], 'Say hi');
|
|
114
|
-
assert.equal(result['agent'], 'general');
|
|
115
|
-
});
|
|
116
|
-
test('positional-as-stdin works with the positional before flags', async () => {
|
|
117
|
-
const result = await parseArgv(params, ['Say hi', '--agent', 'general']);
|
|
118
|
-
assert.equal(result['prompt'], 'Say hi');
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
// ---------------------------------------------------------------------------
|
|
122
|
-
// parseArgv — context-file
|
|
123
|
-
// ---------------------------------------------------------------------------
|
|
124
|
-
describe('parseArgv: context-file', () => {
|
|
125
|
-
test('unknown --context-file when not declared throws unknown_flag', async () => {
|
|
126
|
-
const params = [];
|
|
127
|
-
await assert.rejects(() => parseArgv(params, ['--context-file', '/some/path']), (err) => { assert.match(err.message, /unknown flag: --context-file/); return true; });
|
|
128
|
-
});
|
|
129
|
-
test('--context-file missing PATH throws missing_parameter', async () => {
|
|
130
|
-
const params = [
|
|
131
|
-
{ kind: 'context-file', name: 'context', required: false, constraint: '' },
|
|
132
|
-
];
|
|
133
|
-
await assert.rejects(() => parseArgv(params, ['--context-file']), (err) => { assert.match(err.message, /requires a PATH/); return true; });
|
|
134
|
-
});
|
|
135
|
-
test('--context-file with nonexistent file throws invalid_type', async () => {
|
|
136
|
-
const params = [
|
|
137
|
-
{ kind: 'context-file', name: 'context', required: false, constraint: '' },
|
|
138
|
-
];
|
|
139
|
-
await assert.rejects(() => parseArgv(params, ['--context-file', '/no/such/file/xyz.json']), (err) => { assert.match(err.message, /cannot read file/); return true; });
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
// ---------------------------------------------------------------------------
|
|
143
|
-
// renderLeafArgv — help format
|
|
144
|
-
// ---------------------------------------------------------------------------
|
|
145
|
-
describe('renderLeafArgv: help format', () => {
|
|
146
|
-
const help = {
|
|
147
|
-
name: 'task claim',
|
|
148
|
-
summary: 'claim a draft task and spawn a worker',
|
|
149
|
-
params: [
|
|
150
|
-
{ kind: 'positional', name: 'task-id', required: true, constraint: 'Task in draft state.' },
|
|
151
|
-
{ kind: 'flag', name: 'worker', type: 'string', required: false, constraint: 'Worker template.' },
|
|
152
|
-
{ kind: 'flag', name: 'follow', type: 'bool', required: false, constraint: 'Stream output.' },
|
|
153
|
-
{ kind: 'context-file', name: 'context', required: false, constraint: 'Extra facts for the worker.', shape: '{key: string}' },
|
|
154
|
-
],
|
|
155
|
-
output: [
|
|
156
|
-
{ name: 'job_id', type: 'string', required: true, constraint: 'Use with crtr job logs.' },
|
|
157
|
-
],
|
|
158
|
-
outputKind: 'object',
|
|
159
|
-
effects: ['Marks task claimed.'],
|
|
160
|
-
};
|
|
161
|
-
test('starts with name: summary', () => {
|
|
162
|
-
const out = renderLeafArgv(help);
|
|
163
|
-
assert.ok(out.startsWith('task claim: claim a draft task and spawn a worker.'));
|
|
164
|
-
});
|
|
165
|
-
test('contains Input section', () => {
|
|
166
|
-
const out = renderLeafArgv(help);
|
|
167
|
-
assert.ok(out.includes('Input'));
|
|
168
|
-
});
|
|
169
|
-
test('positional shown as TASK_ID', () => {
|
|
170
|
-
const out = renderLeafArgv(help);
|
|
171
|
-
assert.ok(out.includes('TASK-ID'));
|
|
172
|
-
});
|
|
173
|
-
test('bool flag shown without VALUE placeholder', () => {
|
|
174
|
-
const out = renderLeafArgv(help);
|
|
175
|
-
assert.ok(out.includes('--follow'));
|
|
176
|
-
assert.ok(!out.includes('--follow FOLLOW'));
|
|
177
|
-
});
|
|
178
|
-
test('string flag shown with VALUE placeholder', () => {
|
|
179
|
-
const out = renderLeafArgv(help);
|
|
180
|
-
assert.ok(out.includes('--worker WORKER'));
|
|
181
|
-
});
|
|
182
|
-
test('context-file shown as --context-file PATH', () => {
|
|
183
|
-
const out = renderLeafArgv(help);
|
|
184
|
-
assert.ok(out.includes('--context-file PATH'));
|
|
185
|
-
});
|
|
186
|
-
test('contains Output section', () => {
|
|
187
|
-
const out = renderLeafArgv(help);
|
|
188
|
-
assert.ok(out.includes('Output (fields carried in the rendered result)'));
|
|
189
|
-
});
|
|
190
|
-
test('contains Effects section', () => {
|
|
191
|
-
const out = renderLeafArgv(help);
|
|
192
|
-
assert.ok(out.includes('Effects'));
|
|
193
|
-
assert.ok(out.includes('Marks task claimed.'));
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
// ---------------------------------------------------------------------------
|
|
197
|
-
// defineLeaf
|
|
198
|
-
// ---------------------------------------------------------------------------
|
|
199
|
-
describe('defineLeaf', () => {
|
|
200
|
-
test('builds a leaf with the declared params', () => {
|
|
201
|
-
const leaf = defineLeaf({
|
|
202
|
-
name: 'test',
|
|
203
|
-
help: {
|
|
204
|
-
name: 'test',
|
|
205
|
-
summary: 'test leaf',
|
|
206
|
-
params: [],
|
|
207
|
-
output: [],
|
|
208
|
-
outputKind: 'object',
|
|
209
|
-
effects: [],
|
|
210
|
-
},
|
|
211
|
-
run: async () => { },
|
|
212
|
-
});
|
|
213
|
-
assert.equal(leaf.kind, 'leaf');
|
|
214
|
-
assert.equal(leaf.name, 'test');
|
|
215
|
-
assert.deepEqual(leaf.help.params, []);
|
|
216
|
-
});
|
|
217
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { test, before, beforeEach, after } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { existsSync, mkdtempSync, mkdirSync, rmSync } from 'node:fs';
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { join } from 'node:path';
|
|
6
|
-
import { interactionsRoot, migrateLegacyWorkspaceDirs, workspaceRoot } from '../artifact.js';
|
|
7
|
-
let home;
|
|
8
|
-
let origHome;
|
|
9
|
-
before(() => {
|
|
10
|
-
home = mkdtempSync(join(tmpdir(), 'crtr-workspaces-'));
|
|
11
|
-
origHome = process.env['HOME'];
|
|
12
|
-
process.env['HOME'] = home;
|
|
13
|
-
});
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
rmSync(home, { recursive: true, force: true });
|
|
16
|
-
mkdirSync(join(home, '.crouter'), { recursive: true });
|
|
17
|
-
});
|
|
18
|
-
after(() => {
|
|
19
|
-
rmSync(home, { recursive: true, force: true });
|
|
20
|
-
if (origHome === undefined)
|
|
21
|
-
delete process.env['HOME'];
|
|
22
|
-
else
|
|
23
|
-
process.env['HOME'] = origHome;
|
|
24
|
-
});
|
|
25
|
-
test('workspace roots live under ~/.crouter/workspaces/<mangled-cwd>', () => {
|
|
26
|
-
const cwd = '/Users/silasrhyneer/Code/cli/crouter';
|
|
27
|
-
const root = join(home, '.crouter', 'workspaces', '-Users-silasrhyneer-Code-cli-crouter');
|
|
28
|
-
assert.equal(workspaceRoot(cwd), root);
|
|
29
|
-
assert.equal(interactionsRoot(cwd), join(root, 'interactions'));
|
|
30
|
-
});
|
|
31
|
-
test('migrateLegacyWorkspaceDirs moves only legacy mangled cwd dirs', () => {
|
|
32
|
-
const legacy = join(home, '.crouter', '-Users-silasrhyneer-Code-cli-crouter');
|
|
33
|
-
const workspace = join(home, '.crouter', 'workspaces', '-Users-silasrhyneer-Code-cli-crouter');
|
|
34
|
-
const memory = join(home, '.crouter', 'memory');
|
|
35
|
-
const canvas = join(home, '.crouter', 'canvas');
|
|
36
|
-
mkdirSync(legacy, { recursive: true });
|
|
37
|
-
mkdirSync(memory, { recursive: true });
|
|
38
|
-
mkdirSync(canvas, { recursive: true });
|
|
39
|
-
migrateLegacyWorkspaceDirs();
|
|
40
|
-
assert.ok(!existsSync(legacy));
|
|
41
|
-
assert.ok(existsSync(workspace));
|
|
42
|
-
assert.ok(existsSync(memory));
|
|
43
|
-
assert.ok(existsSync(canvas));
|
|
44
|
-
});
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
// Bug-regression test for the crtr TUI Draw style encoding.
|
|
2
|
-
//
|
|
3
|
-
// Observed bug (canvas + linkedin views, 2026-06-07): view code set Style.fg to a
|
|
4
|
-
// color NAME ('green'/'cyan'/'red') instead of an SGR parameter ('32'/'36'/'31').
|
|
5
|
-
// With color ON, styleSpan emitted `\x1b[greenm` — an invalid CSI the terminal
|
|
6
|
-
// eats as a control op, printing the tail ('reenm') as literal garbage. The
|
|
7
|
-
// monitor's status glyphs/flags rendered as garbage on any color terminal (the
|
|
8
|
-
// non-TTY/NO_COLOR path was unaffected because fg is gated behind `color`).
|
|
9
|
-
//
|
|
10
|
-
// Root-cause fix: styleSpan now only emits fg/bg when the value is a valid SGR
|
|
11
|
-
// parameter string (digits + semicolons); a bad value degrades to no-color
|
|
12
|
-
// instead of emitting a broken escape. These tests lock that guarantee.
|
|
13
|
-
//
|
|
14
|
-
// Run: node --import tsx/esm --test src/core/__tests__/draw-style.test.ts
|
|
15
|
-
import { test, describe } from 'node:test';
|
|
16
|
-
import assert from 'node:assert/strict';
|
|
17
|
-
import { styleSpan, isSgrParams, createDraw } from '../tui/draw.js';
|
|
18
|
-
import { drawChrome } from '../tui/host.js';
|
|
19
|
-
const ESC = '\x1b[';
|
|
20
|
-
const ON = { color: true, color256: true };
|
|
21
|
-
const OFF = { color: false, color256: false };
|
|
22
|
-
const SIZE = { cols: 80, rows: 24 };
|
|
23
|
-
/** Strip the harmless framing CSIs the serializer emits (cursor home / clear),
|
|
24
|
-
* so any REMAINING `\x1b[` not followed by an SGR param digit/semicolon is a
|
|
25
|
-
* broken SGR escape — the exact bug class (`\x1b[greenm`). */
|
|
26
|
-
function hasInvalidCsi(frame) {
|
|
27
|
-
const stripped = frame.replace(/\x1b\[[HJK]/g, '').replace(/[\r\n]/g, '');
|
|
28
|
-
return /\x1b\[[^0-9;]/.test(stripped);
|
|
29
|
-
}
|
|
30
|
-
/** Any 8-bit color SGR (fg 30-37/90-97, or 256-color bg) present in the frame. */
|
|
31
|
-
function hasColorSgr(frame) {
|
|
32
|
-
return /\x1b\[(3[0-9]|9[0-7])m/.test(frame) || /\x1b\[48;5;/.test(frame);
|
|
33
|
-
}
|
|
34
|
-
function baseChrome(over = {}) {
|
|
35
|
-
return { status: null, banner: null, busy: false, loaded: true, lastRefresh: Date.now(), tick: 0, subtitle: null, mode: null, ...over };
|
|
36
|
-
}
|
|
37
|
-
const MANIFEST = {
|
|
38
|
-
title: 'Test View', subtitle: '3 unread',
|
|
39
|
-
keymap: [
|
|
40
|
-
{ keys: 'j/k', label: 'move' }, { keys: 'enter', label: 'open' },
|
|
41
|
-
{ keys: 'r', label: 'reply' }, { keys: 'g', label: 'refresh' }, { keys: 'q', label: 'quit' },
|
|
42
|
-
],
|
|
43
|
-
};
|
|
44
|
-
describe('styleSpan: SGR encoding (bug-regression)', () => {
|
|
45
|
-
test('a valid numeric fg emits a well-formed CSI', () => {
|
|
46
|
-
const out = styleSpan('●', { fg: '32', bold: true }, true, '');
|
|
47
|
-
assert.ok(out.includes(`${ESC}32m`), 'should contain \\x1b[32m');
|
|
48
|
-
assert.ok(out.includes(`${ESC}1m`), 'bold still emitted');
|
|
49
|
-
});
|
|
50
|
-
test('a color NAME fg degrades to no-color — never emits a broken escape', () => {
|
|
51
|
-
const out = styleSpan('●', { fg: 'green' }, true, '');
|
|
52
|
-
// The bug: \x1b[greenm. Assert no CSI is followed by a non-digit/semicolon.
|
|
53
|
-
assert.ok(!/\x1b\[[^0-9;]/.test(out), 'no invalid CSI introducer');
|
|
54
|
-
assert.ok(!out.includes('green'), 'the bad token never leaks into output');
|
|
55
|
-
});
|
|
56
|
-
test('a color NAME bg degrades to no-color', () => {
|
|
57
|
-
const out = styleSpan('x', { bg: 'red' }, true, '');
|
|
58
|
-
assert.ok(!/\x1b\[[^0-9;]/.test(out), 'no invalid CSI introducer');
|
|
59
|
-
assert.ok(!out.includes('red'), 'the bad token never leaks into output');
|
|
60
|
-
});
|
|
61
|
-
test('a valid 256-color bg index emits 48;5;N', () => {
|
|
62
|
-
const out = styleSpan('x', { bg: '236' }, true, '');
|
|
63
|
-
assert.ok(out.includes(`${ESC}48;5;236m`), 'should contain \\x1b[48;5;236m');
|
|
64
|
-
});
|
|
65
|
-
test('compound SGR params (e.g. "1;36") are valid', () => {
|
|
66
|
-
assert.equal(isSgrParams('1;36'), true);
|
|
67
|
-
assert.equal(isSgrParams('236'), true);
|
|
68
|
-
assert.equal(isSgrParams('green'), false);
|
|
69
|
-
assert.equal(isSgrParams(''), false);
|
|
70
|
-
});
|
|
71
|
-
test('structural styles (bold/dim/reverse) are unaffected by color gating', () => {
|
|
72
|
-
const out = styleSpan('x', { fg: 'green', dim: true }, true, '');
|
|
73
|
-
assert.ok(out.includes(`${ESC}2m`), 'dim still emitted even when fg is rejected');
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
// ── New Draw primitives — same bug class (no invalid CSI; bad value degrades) ──
|
|
77
|
-
describe('spansRight: SGR encoding (bug-regression)', () => {
|
|
78
|
-
test('valid numeric fg → well-formed CSI, no broken escape', () => {
|
|
79
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
80
|
-
draw.spansRight(0, 80, [{ text: 'ready', style: { fg: '32', bold: true } }]);
|
|
81
|
-
const f = frame();
|
|
82
|
-
assert.ok(f.includes(`${ESC}32m`), 'emits \\x1b[32m');
|
|
83
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
84
|
-
});
|
|
85
|
-
test('a color NAME fg degrades — no broken escape, name not leaked', () => {
|
|
86
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
87
|
-
draw.spansRight(0, 80, [{ text: 'x', style: { fg: 'green' } }]);
|
|
88
|
-
const f = frame();
|
|
89
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI introducer');
|
|
90
|
-
assert.ok(!f.includes('green'), 'the bad token never leaks');
|
|
91
|
-
});
|
|
92
|
-
test('over-maxWidth groups left-clip with a leading … (no overflow, no garbage)', () => {
|
|
93
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
94
|
-
draw.spansRight(0, 80, [{ text: 'abcdefghij', style: { dim: true } }], 4);
|
|
95
|
-
const f = frame();
|
|
96
|
-
assert.ok(f.includes('…'), 'leading ellipsis present');
|
|
97
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
describe('vline: SGR encoding + mono fallback (bug-regression)', () => {
|
|
101
|
-
test('renders a dim rule with no invalid CSI (color on)', () => {
|
|
102
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
103
|
-
draw.vline(40, 0, 10);
|
|
104
|
-
const f = frame();
|
|
105
|
-
assert.ok(f.includes('│'), 'default │ glyph present');
|
|
106
|
-
assert.ok(f.includes(`${ESC}2m`), 'dim emitted');
|
|
107
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
108
|
-
});
|
|
109
|
-
test('ASCII fallback ch and mono caps both stay well-formed', () => {
|
|
110
|
-
const { draw, frame } = createDraw(SIZE, OFF);
|
|
111
|
-
draw.vline(40, 0, 10, '|');
|
|
112
|
-
const f = frame();
|
|
113
|
-
assert.ok(f.includes('|'), 'ASCII fallback | present');
|
|
114
|
-
assert.ok(!hasColorSgr(f), 'no color SGR when caps.color is off');
|
|
115
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
describe('ListItemRow.right: SGR encoding (bug-regression)', () => {
|
|
119
|
-
test('right group + cursor-row base merge → no invalid CSI', () => {
|
|
120
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
121
|
-
/** @type {ListItemRow[]} */
|
|
122
|
-
const items = [
|
|
123
|
-
{ spans: [{ text: 'Ada Lovelace', style: { bold: true } }], right: [{ text: '2h', style: { fg: '90' } }] },
|
|
124
|
-
{ spans: [{ text: 'Grace Hopper' }], right: [{ text: '4h', style: { fg: '90' } }] },
|
|
125
|
-
];
|
|
126
|
-
const res = draw.list({ row: 2, col: 0, width: 80, height: 5 }, items, 0, 0);
|
|
127
|
-
const f = frame();
|
|
128
|
-
assert.equal(res.scroll, 0);
|
|
129
|
-
assert.ok(f.includes('2h') && f.includes('4h'), 'right-flushed timestamps drawn');
|
|
130
|
-
assert.ok(f.includes(`${ESC}48;5;236m`), 'cursor-row 236-bg highlight present');
|
|
131
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
132
|
-
});
|
|
133
|
-
test('a color NAME fg in the right group degrades, not leaks', () => {
|
|
134
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
135
|
-
const items = [{ spans: [{ text: 'x' }], right: [{ text: 'y', style: { fg: 'cyan' } }] }];
|
|
136
|
-
draw.list({ row: 0, col: 0, width: 80, height: 2 }, items, 0, 0);
|
|
137
|
-
const f = frame();
|
|
138
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
139
|
-
assert.ok(!f.includes('cyan'), 'the bad token never leaks');
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
// ── Chrome — every new element survives the bug class + has a mono fallback ──
|
|
143
|
-
describe('drawChrome: SGR encoding + mono fallback (bug-regression)', () => {
|
|
144
|
-
const states = [
|
|
145
|
-
['working', baseChrome({ busy: true, status: 'Loading…' })],
|
|
146
|
-
['blocked', baseChrome({ banner: { msg: 'Send rejected', level: 'error' } })],
|
|
147
|
-
['attention', baseChrome({ banner: { msg: 'Log in, then press r', level: 'action' } })],
|
|
148
|
-
['ready', baseChrome({ status: '5 conversations' })],
|
|
149
|
-
['idle', baseChrome({ loaded: false, lastRefresh: 0 })],
|
|
150
|
-
['info-banner', baseChrome({ banner: { msg: 'Throttling — waiting', level: 'info' } })],
|
|
151
|
-
];
|
|
152
|
-
for (const [name, chrome] of states) {
|
|
153
|
-
test(`state "${name}" never emits a broken escape (color on)`, () => {
|
|
154
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
155
|
-
drawChrome(draw, SIZE, MANIFEST, chrome);
|
|
156
|
-
assert.ok(!hasInvalidCsi(frame()), 'no invalid CSI');
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
test('mono fallback: no color SGR when caps.color is off, glyphs/words still render', () => {
|
|
160
|
-
const { draw, frame } = createDraw(SIZE, OFF);
|
|
161
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ busy: true, status: 'Loading…' }));
|
|
162
|
-
const f = frame();
|
|
163
|
-
assert.ok(!hasColorSgr(f), 'no color SGR emitted in mono');
|
|
164
|
-
assert.ok(f.includes('▎'), 'state rail glyph always drawn');
|
|
165
|
-
assert.ok(f.includes('working'), 'state WORD carries meaning in mono');
|
|
166
|
-
assert.ok(f.includes(`${ESC}1m`), 'structural bold still emitted');
|
|
167
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
168
|
-
});
|
|
169
|
-
test('every banner level renders its glyph with no broken escape', () => {
|
|
170
|
-
for (const [level, glyph] of [['info', 'ℹ'], ['action', '▸'], ['error', '✗']]) {
|
|
171
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
172
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ banner: { msg: 'm', level } }));
|
|
173
|
-
const f = frame();
|
|
174
|
-
assert.ok(f.includes(glyph), `${level} banner glyph ${glyph} present`);
|
|
175
|
-
assert.ok(!hasInvalidCsi(f), `${level} banner: no invalid CSI`);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
test('keymap overflow degrades to keys-only on a narrow screen, still well-formed', () => {
|
|
179
|
-
const narrow = { cols: 28, rows: 24 };
|
|
180
|
-
const { draw, frame } = createDraw(narrow, ON);
|
|
181
|
-
drawChrome(draw, narrow, MANIFEST, baseChrome({ status: 'a very long status line here' }));
|
|
182
|
-
const f = frame();
|
|
183
|
-
assert.ok(f.includes('q'), 'q quit hint survives overflow');
|
|
184
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI under overflow');
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
// ── Dynamic subtitle (host.setSubtitle) — same bug class + mono fallback ──
|
|
188
|
-
describe('drawChrome subtitle: SGR encoding + mono fallback (bug-regression)', () => {
|
|
189
|
-
test('a dynamic subtitle overrides manifest.subtitle, dim, no broken escape', () => {
|
|
190
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
191
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ subtitle: '7 unread' }));
|
|
192
|
-
const f = frame();
|
|
193
|
-
assert.ok(f.includes('7 unread'), 'dynamic subtitle rendered');
|
|
194
|
-
assert.ok(!f.includes('3 unread'), 'dynamic value overrides the static manifest subtitle');
|
|
195
|
-
assert.ok(f.includes(`${ESC}2m`), 'subtitle is dim (structural)');
|
|
196
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
197
|
-
});
|
|
198
|
-
test('null subtitle falls back to the manifest default', () => {
|
|
199
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
200
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ subtitle: null }));
|
|
201
|
-
const f = frame();
|
|
202
|
-
assert.ok(f.includes('3 unread'), 'manifest.subtitle shown when dynamic is null');
|
|
203
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
204
|
-
});
|
|
205
|
-
test('mono fallback: subtitle text renders dim with no color SGR', () => {
|
|
206
|
-
const { draw, frame } = createDraw(SIZE, OFF);
|
|
207
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ subtitle: '7 unread' }));
|
|
208
|
-
const f = frame();
|
|
209
|
-
assert.ok(f.includes('7 unread'), 'subtitle text still renders in mono');
|
|
210
|
-
assert.ok(!hasColorSgr(f), 'no color SGR emitted for the subtitle in mono');
|
|
211
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
212
|
-
});
|
|
213
|
-
});
|
|
214
|
-
// ── Mode chip (host.setMode) — same bug class, mono fallback, precedence ──
|
|
215
|
-
describe('drawChrome mode chip: SGR encoding + mono fallback (bug-regression)', () => {
|
|
216
|
-
test('compose mode → ✎ compose in yellow (33), no broken escape', () => {
|
|
217
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
218
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ mode: 'compose' }));
|
|
219
|
-
const f = frame();
|
|
220
|
-
assert.ok(f.includes('✎') && f.includes('compose'), 'mode glyph + word present');
|
|
221
|
-
assert.ok(f.includes(`${ESC}33m`), 'compose-accent yellow 33 emitted');
|
|
222
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
223
|
-
});
|
|
224
|
-
test('react mode → ☺ react reuses the compose-accent yellow (33)', () => {
|
|
225
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
226
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ mode: 'react' }));
|
|
227
|
-
const f = frame();
|
|
228
|
-
assert.ok(f.includes('☺') && f.includes('react'), 'react glyph + word present');
|
|
229
|
-
assert.ok(f.includes(`${ESC}33m`), 'react reuses yellow 33');
|
|
230
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
231
|
-
});
|
|
232
|
-
test('mono fallback: mode chip is glyph + bold word, no color SGR', () => {
|
|
233
|
-
const { draw, frame } = createDraw(SIZE, OFF);
|
|
234
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ mode: 'compose' }));
|
|
235
|
-
const f = frame();
|
|
236
|
-
assert.ok(f.includes('✎'), 'glyph carries the mode in mono');
|
|
237
|
-
assert.ok(f.includes('compose'), 'mode word carries meaning in mono');
|
|
238
|
-
assert.ok(f.includes(`${ESC}1m`), 'bold still emitted (mono carrier)');
|
|
239
|
-
assert.ok(!hasColorSgr(f), 'no color SGR emitted in mono');
|
|
240
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
241
|
-
});
|
|
242
|
-
test('precedence: an explicit mode WINS the chip over the derived busy/working state', () => {
|
|
243
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
244
|
-
// busy would derive `working`; the explicit mode must override it.
|
|
245
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ busy: true, mode: 'compose' }));
|
|
246
|
-
const f = frame();
|
|
247
|
-
assert.ok(f.includes('compose'), 'mode word shown');
|
|
248
|
-
assert.ok(!f.includes('working'), 'derived working chip suppressed by the mode override');
|
|
249
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
250
|
-
});
|
|
251
|
-
test('null mode returns to the derived chip (ready when loaded)', () => {
|
|
252
|
-
const { draw, frame } = createDraw(SIZE, ON);
|
|
253
|
-
drawChrome(draw, SIZE, MANIFEST, baseChrome({ mode: null }));
|
|
254
|
-
const f = frame();
|
|
255
|
-
assert.ok(f.includes('ready'), 'derived ready chip shown when no mode set');
|
|
256
|
-
assert.ok(!hasInvalidCsi(f), 'no invalid CSI');
|
|
257
|
-
});
|
|
258
|
-
});
|