@deepseek-harness-tui/dsh-tui 0.8.5 → 0.8.7
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 +13 -3
- package/bin/dsh-tui.js +269 -218
- package/cordis.patch.yml +48 -22
- package/dsh-ecosystem-spec/protocols/profile-definitions.d.ts +13 -13
- package/dsh-ecosystem-spec/protocols/profile-definitions.js +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel-http.d.ts +15 -15
- package/dsh-ecosystem-spec/protocols/tui-channel-http.js +32 -32
- package/dsh-ecosystem-spec/protocols/tui-channel.d.ts +59 -59
- package/dsh-ecosystem-spec/protocols/tui-channel.js +166 -166
- package/dsh-ecosystem-spec/protocols/tui-contributions.d.ts +42 -42
- package/dsh-ecosystem-spec/protocols/tui-contributions.js +143 -143
- package/dsh-ecosystem-spec/registry/README.md +14 -14
- package/dsh-ecosystem-spec/registry/host-descriptor.tui.example.json +56 -56
- package/dsh-ecosystem-spec/registry/permissions-0.1.json +13 -13
- package/dsh-ecosystem-spec/registry/registry-0.15.json +149 -149
- package/lib/types/cc/figures.d.ts +7 -0
- package/lib/types/cc/figures.d.ts.map +1 -1
- package/lib/types/cc/figures.js +24 -0
- package/lib/types/cc/markdown.d.ts.map +1 -1
- package/lib/types/cc/markdown.js +47 -14
- package/lib/types/cc/syntaxRuns.d.ts +16 -0
- package/lib/types/cc/syntaxRuns.d.ts.map +1 -0
- package/lib/types/cc/syntaxRuns.js +79 -0
- package/lib/types/cc/syntaxTheme.d.ts +12 -0
- package/lib/types/cc/syntaxTheme.d.ts.map +1 -0
- package/lib/types/cc/syntaxTheme.js +76 -0
- package/lib/types/commands.d.ts +14 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +20 -1
- package/lib/types/components/Chat/SubagentMessage.d.ts +19 -0
- package/lib/types/components/Chat/SubagentMessage.d.ts.map +1 -0
- package/lib/types/components/Chat/SubagentMessage.js +75 -0
- package/lib/types/components/EffortChargeGlyph.d.ts +26 -0
- package/lib/types/components/EffortChargeGlyph.d.ts.map +1 -0
- package/lib/types/components/EffortChargeGlyph.js +70 -0
- package/lib/types/components/EffortInputBorder.d.ts +36 -0
- package/lib/types/components/EffortInputBorder.d.ts.map +1 -0
- package/lib/types/components/EffortInputBorder.js +73 -0
- package/lib/types/components/EffortTierBadge.d.ts +26 -0
- package/lib/types/components/EffortTierBadge.d.ts.map +1 -0
- package/lib/types/components/EffortTierBadge.js +97 -0
- package/lib/types/components/HelpMenu.d.ts +8 -1
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +15 -4
- package/lib/types/components/LoadedContextPanel.js +1 -1
- package/lib/types/components/LogoV2.d.ts +3 -1
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +2 -2
- package/lib/types/components/MessageList.d.ts +6 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +22 -13
- package/lib/types/components/ModelPicker.js +2 -2
- package/lib/types/components/PromptInput.d.ts +1 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +83 -18
- package/lib/types/components/SkillsPicker.js +2 -2
- package/lib/types/components/SplitDiffView.d.ts +2 -17
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +9 -162
- package/lib/types/components/StreamingMarkdown.js +1 -1
- package/lib/types/components/SubagentCard.d.ts +9 -0
- package/lib/types/components/SubagentCard.d.ts.map +1 -0
- package/lib/types/components/SubagentCard.js +26 -0
- package/lib/types/components/SubagentDashboard.d.ts +13 -0
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -0
- package/lib/types/components/SubagentDashboard.js +50 -0
- package/lib/types/components/SubagentDetailScene.d.ts +16 -0
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -0
- package/lib/types/components/SubagentDetailScene.js +141 -0
- package/lib/types/components/SyntaxText.d.ts +15 -0
- package/lib/types/components/SyntaxText.d.ts.map +1 -0
- package/lib/types/components/SyntaxText.js +34 -0
- package/lib/types/components/ThinkingToggle.d.ts +3 -10
- package/lib/types/components/ThinkingToggle.d.ts.map +1 -1
- package/lib/types/components/ThinkingToggle.js +4 -9
- package/lib/types/components/design-system/ListItem.d.ts.map +1 -1
- package/lib/types/components/design-system/ListItem.js +1 -1
- package/lib/types/components/design-system/ThemedBox.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemedBox.js +4 -1
- package/lib/types/components/design-system/ThemedText.js +2 -2
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts +12 -6
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +37 -10
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +2 -0
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +71 -18
- package/lib/types/components/messages/UserPromptMessage.d.ts +4 -6
- package/lib/types/components/messages/UserPromptMessage.d.ts.map +1 -1
- package/lib/types/components/messages/UserPromptMessage.js +19 -10
- package/lib/types/dsh-adapter/channel.d.ts +58 -2
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +337 -7
- package/lib/types/dsh-adapter/contract.d.ts +27 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +56 -10
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +9 -3
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +38 -0
- package/lib/types/dsh-adapter/shortcuts.js +3 -3
- package/lib/types/dsh-adapter/subagents.d.ts +87 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -0
- package/lib/types/dsh-adapter/subagents.js +204 -0
- package/lib/types/herdr.d.ts +28 -0
- package/lib/types/herdr.d.ts.map +1 -0
- package/lib/types/herdr.js +133 -0
- package/lib/types/i18n.d.ts +215 -31
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +65 -14
- package/lib/types/ink/ink.d.ts +4 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +46 -15
- package/lib/types/minimalMode.d.ts +13 -0
- package/lib/types/minimalMode.d.ts.map +1 -0
- package/lib/types/minimalMode.js +17 -0
- package/lib/types/screens/Chat.d.ts +1 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +95 -45
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +6 -2
- package/lib/types/screens/TrajectoryScene.d.ts.map +1 -1
- package/lib/types/screens/TrajectoryScene.js +4 -2
- package/lib/types/theme.d.ts +20 -0
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +77 -23
- package/lib/types/tips.js +3 -3
- package/lib/types/trajectory/effortIgnition.d.ts +66 -0
- package/lib/types/trajectory/effortIgnition.d.ts.map +1 -0
- package/lib/types/trajectory/effortIgnition.js +142 -0
- package/lib/types/update.d.ts +18 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +73 -2
- package/lib/types/utils/execFileNoThrow.d.ts +3 -20
- package/lib/types/utils/execFileNoThrow.d.ts.map +1 -1
- package/lib/types/utils/execFileNoThrow.js +53 -32
- package/lib/types/utils/externalEditor.d.ts +12 -11
- package/lib/types/utils/externalEditor.d.ts.map +1 -1
- package/lib/types/utils/externalEditor.js +11 -11
- package/node_modules/@dsh-std/command/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/command/LICENSE +21 -21
- package/node_modules/@dsh-std/command/README.md +26 -26
- package/node_modules/@dsh-std/command/README.zh.md +28 -28
- package/node_modules/@dsh-std/command/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/command/package.json +22 -22
- package/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/node_modules/@dsh-std/connection/README.md +42 -42
- package/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/node_modules/@dsh-std/connection/package.json +20 -20
- package/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/core/LICENSE +21 -21
- package/node_modules/@dsh-std/core/README.md +13 -13
- package/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/core/package.json +21 -21
- package/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/node_modules/@dsh-std/manifest/README.md +5 -5
- package/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/manifest/package.json +20 -20
- package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/node_modules/@dsh-std/messages/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/messages/LICENSE +21 -21
- package/node_modules/@dsh-std/messages/README.md +5 -5
- package/node_modules/@dsh-std/messages/README.zh.md +7 -7
- package/node_modules/@dsh-std/messages/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/messages/package.json +20 -20
- package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -54
- package/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/node_modules/@dsh-std/presentation/README.md +27 -27
- package/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/presentation/package.json +25 -25
- package/node_modules/@dsh-std/storage/CHANGELOG.md +8 -8
- package/node_modules/@dsh-std/storage/LICENSE +21 -21
- package/node_modules/@dsh-std/storage/README.md +5 -5
- package/node_modules/@dsh-std/storage/README.zh.md +7 -7
- package/node_modules/@dsh-std/storage/lib/index.js.map +1 -1
- package/node_modules/@dsh-std/storage/package.json +20 -20
- package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -56
- package/package.json +64 -58
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -5
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -20
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -144
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/CHANGELOG.md +9 -9
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -21
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +27 -27
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +29 -29
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/callback.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +25 -25
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -42
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -20
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/CHANGELOG.md +8 -8
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -21
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -13
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -1
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -21
package/lib/types/commands.d.ts
CHANGED
|
@@ -53,6 +53,20 @@ export type CommandChildren = (canonicalPath: readonly string[]) => readonly Com
|
|
|
53
53
|
* commands merge in at runtime; locals win on name collisions.
|
|
54
54
|
*/
|
|
55
55
|
export declare const LOCAL_COMMANDS: LocalCommand[];
|
|
56
|
+
/**
|
|
57
|
+
* Hidden slash commands: intentionally not exposed in the `/` suggestion
|
|
58
|
+
* menu or Help, but still recognized as local commands when typed. They are
|
|
59
|
+
* kept out of `LOCAL_COMMANDS` so `filterCommands`/`completeCommands` never
|
|
60
|
+
* surface them; dispatch recognizes them via {@link HIDDEN_COMMAND_NAMES}.
|
|
61
|
+
*/
|
|
62
|
+
export declare const HIDDEN_COMMANDS: readonly LocalCommand[];
|
|
63
|
+
/** Names of hidden commands, for fast dispatch/lookup. */
|
|
64
|
+
export declare const HIDDEN_COMMAND_NAMES: ReadonlySet<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Whether the input names a hidden command (same slash-optional trimming
|
|
67
|
+
* rules as {@link isLocalCommandName}).
|
|
68
|
+
*/
|
|
69
|
+
export declare function isHiddenCommandName(input: string): boolean;
|
|
56
70
|
/**
|
|
57
71
|
* Resolve a command's description in the active UI language. The en text in
|
|
58
72
|
* `LOCAL_COMMANDS` (and the registry's own text for external commands) is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAElF,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,KAAK,SAAS,qBAAqB,EAAE,CAAA;AAEpG;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EA2DxC,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIhG;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAS,YAAY,EAAmB,GAC7C,OAAO,CAKT;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAS,YAAY,EAAmB,GAC7C,YAAY,EAAE,CAKhB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,SAAS,YAAY,EAAmB,EAC/C,QAAQ,GAAE,eAA0B,GACnC,iBAAiB,EAAE,CAoCrB"}
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAElF,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,+DAA+D;IAC/D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,qEAAqE;IACrE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,+EAA+E;AAC/E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3B,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,KAAK,SAAS,qBAAqB,EAAE,CAAA;AAEpG;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,YAAY,EA2DxC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,YAAY,EAElD,CAAA;AAED,0DAA0D;AAC1D,eAAO,MAAM,oBAAoB,EAAE,WAAW,CAAC,MAAM,CAEpD,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIhG;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAIhD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAS,YAAY,EAAmB,GAC7C,OAAO,CAKT;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,SAAS,YAAY,EAAmB,GAC7C,YAAY,EAAE,CAKhB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,KAAK,GAAE,SAAS,YAAY,EAAmB,EAC/C,QAAQ,GAAE,eAA0B,GACnC,iBAAiB,EAAE,CAoCrB"}
|
package/lib/types/commands.js
CHANGED
|
@@ -71,6 +71,25 @@ export const LOCAL_COMMANDS = [
|
|
|
71
71
|
{ name: 'quit', description: 'Exit dsh-tui', tag: 'alias of /exit' },
|
|
72
72
|
{ name: 'q', description: 'Exit dsh-tui', tag: 'alias of /exit' },
|
|
73
73
|
];
|
|
74
|
+
/**
|
|
75
|
+
* Hidden slash commands: intentionally not exposed in the `/` suggestion
|
|
76
|
+
* menu or Help, but still recognized as local commands when typed. They are
|
|
77
|
+
* kept out of `LOCAL_COMMANDS` so `filterCommands`/`completeCommands` never
|
|
78
|
+
* surface them; dispatch recognizes them via {@link HIDDEN_COMMAND_NAMES}.
|
|
79
|
+
*/
|
|
80
|
+
export const HIDDEN_COMMANDS = [
|
|
81
|
+
{ name: 'deepseek', description: 'Hidden DeepSeek easter egg' },
|
|
82
|
+
];
|
|
83
|
+
/** Names of hidden commands, for fast dispatch/lookup. */
|
|
84
|
+
export const HIDDEN_COMMAND_NAMES = new Set(HIDDEN_COMMANDS.map(command => command.name));
|
|
85
|
+
/**
|
|
86
|
+
* Whether the input names a hidden command (same slash-optional trimming
|
|
87
|
+
* rules as {@link isLocalCommandName}).
|
|
88
|
+
*/
|
|
89
|
+
export function isHiddenCommandName(input) {
|
|
90
|
+
const name = input.replace(/^\//, '').trim();
|
|
91
|
+
return HIDDEN_COMMAND_NAMES.has(name);
|
|
92
|
+
}
|
|
74
93
|
/**
|
|
75
94
|
* Resolve a command's description in the active UI language. The en text in
|
|
76
95
|
* `LOCAL_COMMANDS` (and the registry's own text for external commands) is
|
|
@@ -111,7 +130,7 @@ export function isLocalCommandName(input, list = LOCAL_COMMANDS) {
|
|
|
111
130
|
// Trailing whitespace is legal (Tab completion leaves a space after the
|
|
112
131
|
// name so the user can type arguments).
|
|
113
132
|
const name = input.replace(/^\//, '').trim();
|
|
114
|
-
return list.some(command => command.name === name);
|
|
133
|
+
return HIDDEN_COMMAND_NAMES.has(name) || list.some(command => command.name === name);
|
|
115
134
|
}
|
|
116
135
|
/**
|
|
117
136
|
* Filter commands by a `/…` input prefix (matches the CC overlay behavior).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SubagentRow } from '../../dsh-adapter/channel.js';
|
|
3
|
+
/**
|
|
4
|
+
* Borderless, fixed-height activity card embedded directly in the transcript
|
|
5
|
+
* (Kimi Code visual language). Running: header + one-line current tool + a
|
|
6
|
+
* constant 3-row waterfall (each row hard-clipped to one terminal line so
|
|
7
|
+
* the card height never changes). Settled: folds to the header line alone
|
|
8
|
+
* (failure keeps one error line). The running glyph reuses the user's
|
|
9
|
+
* working-activity preset (`/activity`), so the indicator follows the same
|
|
10
|
+
* setting as the main spinner.
|
|
11
|
+
*/
|
|
12
|
+
export declare function SubagentMessage({ subagent, addMargin, activityFrames, onClick }: {
|
|
13
|
+
subagent: SubagentRow;
|
|
14
|
+
addMargin: boolean;
|
|
15
|
+
activityFrames?: string;
|
|
16
|
+
isExpanded: boolean;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
}): React.ReactNode;
|
|
19
|
+
//# sourceMappingURL=SubagentMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/SubagentMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AA+C/D;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE;IAChF,QAAQ,EAAE,WAAW,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,GAAG,KAAK,CAAC,SAAS,CAqElB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Text, useAnimationFrame, useTerminalSize } from '../../ui.js';
|
|
4
|
+
import { t } from '../../i18n.js';
|
|
5
|
+
import { resolvePreset } from '../activityFrames.js';
|
|
6
|
+
import { toolNameColor } from '../messages/AssistantToolUseMessage.js';
|
|
7
|
+
import { stringWidth } from '../../ink/stringWidth.js';
|
|
8
|
+
import { isMinimalMode } from '../../minimalMode.js';
|
|
9
|
+
/** The waterfall window is a Kimi Code style constant-height region. */
|
|
10
|
+
const WATERFALL_ROWS = 3;
|
|
11
|
+
/** Card left padding + the `│ ` gutter prefix. */
|
|
12
|
+
const WATERFALL_GUTTER = 4;
|
|
13
|
+
function duration(ms = 0) {
|
|
14
|
+
const seconds = Math.floor(ms / 1000);
|
|
15
|
+
return seconds < 60 ? `${seconds}s` : `${Math.floor(seconds / 60)}m${seconds % 60}s`;
|
|
16
|
+
}
|
|
17
|
+
function tokens(row) {
|
|
18
|
+
const total = row.tokens?.total ?? ((row.tokens?.input ?? 0) + (row.tokens?.output ?? 0) || 0);
|
|
19
|
+
return total > 0 ? `${total} tok` : '- tok';
|
|
20
|
+
}
|
|
21
|
+
function status(row) {
|
|
22
|
+
const minimal = isMinimalMode();
|
|
23
|
+
if (row.status === 'completed')
|
|
24
|
+
return { glyph: minimal ? '✓' : '🟢', label: t('subagent-status-completed'), color: minimal ? undefined : 'success' };
|
|
25
|
+
if (row.status === 'failed')
|
|
26
|
+
return { glyph: minimal ? '×' : '🔴', label: t('subagent-status-failed'), color: minimal ? undefined : 'error' };
|
|
27
|
+
if (row.status === 'cancelled')
|
|
28
|
+
return { glyph: minimal ? '×' : '🔴', label: t('subagent-status-cancelled'), color: minimal ? undefined : 'error' };
|
|
29
|
+
return { glyph: minimal ? '·' : '🟡', label: t('subagent-status-running'), color: minimal ? undefined : 'warning' };
|
|
30
|
+
}
|
|
31
|
+
/** Hard single-line clip by display width — a wrapped waterfall row would
|
|
32
|
+
* break the constant-height window. */
|
|
33
|
+
function clipLine(text, maxWidth) {
|
|
34
|
+
if (maxWidth <= 1)
|
|
35
|
+
return '';
|
|
36
|
+
let width = 0;
|
|
37
|
+
let index = 0;
|
|
38
|
+
while (index < text.length) {
|
|
39
|
+
// Advance by the next full code point so wide glyphs (CJK, emoji) are
|
|
40
|
+
// never split in half.
|
|
41
|
+
const next = text.codePointAt(index);
|
|
42
|
+
const char = String.fromCodePoint(next);
|
|
43
|
+
const charWidth = stringWidth(char);
|
|
44
|
+
if (width + charWidth > maxWidth - 1)
|
|
45
|
+
break;
|
|
46
|
+
width += charWidth;
|
|
47
|
+
index += char.length;
|
|
48
|
+
}
|
|
49
|
+
return index < text.length ? `${text.slice(0, index)}…` : text;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Borderless, fixed-height activity card embedded directly in the transcript
|
|
53
|
+
* (Kimi Code visual language). Running: header + one-line current tool + a
|
|
54
|
+
* constant 3-row waterfall (each row hard-clipped to one terminal line so
|
|
55
|
+
* the card height never changes). Settled: folds to the header line alone
|
|
56
|
+
* (failure keeps one error line). The running glyph reuses the user's
|
|
57
|
+
* working-activity preset (`/activity`), so the indicator follows the same
|
|
58
|
+
* setting as the main spinner.
|
|
59
|
+
*/
|
|
60
|
+
export function SubagentMessage({ subagent, addMargin, activityFrames, onClick }) {
|
|
61
|
+
const [, time] = useAnimationFrame(120);
|
|
62
|
+
const { columns } = useTerminalSize();
|
|
63
|
+
const info = status(subagent);
|
|
64
|
+
const settled = subagent.status === 'completed' || subagent.status === 'failed' || subagent.status === 'cancelled';
|
|
65
|
+
const elapsed = subagent.completedAt ? subagent.durationMs : Date.now() - subagent.startedAt;
|
|
66
|
+
const lastRunning = [...subagent.toolCalls].reverse().find(tool => tool.status === 'running');
|
|
67
|
+
const previousDone = lastRunning
|
|
68
|
+
? subagent.toolCalls[subagent.toolCalls.indexOf(lastRunning) - 1]
|
|
69
|
+
: subagent.toolCalls[subagent.toolCalls.length - 1];
|
|
70
|
+
const preset = React.useMemo(() => resolvePreset(activityFrames), [activityFrames]);
|
|
71
|
+
const activity = settled ? [] : subagent.outputLines.slice(-WATERFALL_ROWS);
|
|
72
|
+
const runningGlyph = preset.frames[Math.floor(time / preset.intervalMs) % preset.frames.length] ?? '·';
|
|
73
|
+
const rowWidth = Math.max(20, (columns ?? 80) - WATERFALL_GUTTER);
|
|
74
|
+
return _jsxs(Box, { flexDirection: "column", marginTop: addMargin ? 1 : 0, paddingLeft: 2, onClick: onClick, children: [_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: info.color, children: settled ? info.glyph : ` ${runningGlyph}` }), _jsx(Text, { bold: true, children: `${t('subagent-card-prefix')}${subagent.description}` }), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { children: subagent.model ?? subagent.provider ?? 'default' }), subagent.effort && _jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { dimColor: true, children: subagent.effort })] }), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { dimColor: true, children: duration(elapsed) }), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { dimColor: true, children: tokens(subagent) }), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsxs(Text, { dimColor: true, children: [subagent.toolCalls.length, " tools"] }), _jsx(Text, { dimColor: true, children: "\u00B7" }), _jsx(Text, { color: info.color, children: info.label })] }), !settled && (lastRunning ?? previousDone) !== undefined && (_jsx(Text, { wrap: "truncate", children: lastRunning !== undefined ? (_jsxs(_Fragment, { children: [previousDone !== undefined && (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: ' · ' }), _jsx(Text, { color: "success", children: "\u2713" }), _jsx(Text, { color: toolNameColor(previousDone.name), children: previousDone.name }), _jsx(Text, { dimColor: true, children: ' · ' })] })), lastRunning.argsPreview === undefined && (_jsx(Text, { color: toolNameColor(lastRunning.name), children: lastRunning.name })), lastRunning.argsPreview !== undefined && (_jsxs(_Fragment, { children: [_jsx(Text, { color: toolNameColor(lastRunning.name), children: lastRunning.name }), _jsx(Text, { dimColor: true, children: ` (${clipLine(lastRunning.argsPreview.replace(/\s+/g, ' ').trim(), Math.max(10, rowWidth - lastRunning.name.length - 6))})` })] }))] })) : (previousDone !== undefined && (_jsxs(_Fragment, { children: [_jsx(Text, { dimColor: true, children: ' · ' }), _jsx(Text, { color: "success", children: "\u2713" }), _jsx(Text, { color: toolNameColor(previousDone.name), children: previousDone.name }), previousDone.argsPreview !== undefined && (_jsx(Text, { dimColor: true, children: ` (${clipLine(previousDone.argsPreview.replace(/\s+/g, ' ').trim(), Math.max(10, rowWidth - previousDone.name.length - 6))})` }))] }))) })), !settled && Array.from({ length: WATERFALL_ROWS }, (_, index) => (_jsx(Text, { dimColor: true, wrap: "truncate", children: ` │ ${clipLine(activity[index] ?? '', rowWidth)}` }, `${subagent.agentId}-wf-${index}-${time}`))), settled && subagent.status === 'failed' && subagent.error && (_jsx(Text, { color: "error", wrap: "truncate", children: ` └ ${clipLine(subagent.error, rowWidth)}` }))] });
|
|
75
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EffortChargeGlyph — 输入提示前缀 `❯ ` 的最高档强调与充能。
|
|
3
|
+
*
|
|
4
|
+
* 思考强度处于当前路线最高档期间,前缀换为点火强调色(加粗,与点焰波
|
|
5
|
+
* 共用 hues[0]——同一瞬间前缀与波是同一种橙);切到最高档的瞬间做一次
|
|
6
|
+
* 150ms「充能」渐变(accentRamp 的暗端 → 全值)。冷启动已在最高档时
|
|
7
|
+
* 不充能(充能只属于切换瞬间),离开最高档恢复原样的 dim 行为。
|
|
8
|
+
*
|
|
9
|
+
* 触发判定在渲染期做(React 官方的「props 变化即调整 state」模式,
|
|
10
|
+
* 与 EffortInputBorder 同一模式)——放 effect 会晚一帧,effort 变化
|
|
11
|
+
* 的首帧以全亮闪现、下一帧才跌回暗端重来。充能只动颜色,glyph 恒为
|
|
12
|
+
* `❯ `,SGR-only 规则天然成立。
|
|
13
|
+
*
|
|
14
|
+
* 时钟复用 Ink core 共享时钟,且只在充能未满的那 150ms 内订阅;稳态
|
|
15
|
+
* 零定时器、零重渲染,前缀色取记忆化常量。
|
|
16
|
+
*/
|
|
17
|
+
import React from 'react';
|
|
18
|
+
export declare function EffortChargeGlyph({ effort, levels, working, }: {
|
|
19
|
+
/** 当前思考强度档 id;`undefined` 表示路线未声明。 */
|
|
20
|
+
effort: string | undefined;
|
|
21
|
+
/** 当前路线的档位表(低→高,末位为最高档)。 */
|
|
22
|
+
levels: readonly string[] | undefined;
|
|
23
|
+
/** 模型工作中时前缀照旧压暗(既有语义)。 */
|
|
24
|
+
working: boolean;
|
|
25
|
+
}): React.ReactNode;
|
|
26
|
+
//# sourceMappingURL=EffortChargeGlyph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffortChargeGlyph.d.ts","sourceRoot":"","sources":["../../../src/components/EffortChargeGlyph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAsD,MAAM,OAAO,CAAA;AAW1E,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE;IACD,sCAAsC;IACtC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,4BAA4B;IAC5B,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACrC,0BAA0B;IAC1B,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,KAAK,CAAC,SAAS,CAuDlB"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* EffortChargeGlyph — 输入提示前缀 `❯ ` 的最高档强调与充能。
|
|
4
|
+
*
|
|
5
|
+
* 思考强度处于当前路线最高档期间,前缀换为点火强调色(加粗,与点焰波
|
|
6
|
+
* 共用 hues[0]——同一瞬间前缀与波是同一种橙);切到最高档的瞬间做一次
|
|
7
|
+
* 150ms「充能」渐变(accentRamp 的暗端 → 全值)。冷启动已在最高档时
|
|
8
|
+
* 不充能(充能只属于切换瞬间),离开最高档恢复原样的 dim 行为。
|
|
9
|
+
*
|
|
10
|
+
* 触发判定在渲染期做(React 官方的「props 变化即调整 state」模式,
|
|
11
|
+
* 与 EffortInputBorder 同一模式)——放 effect 会晚一帧,effort 变化
|
|
12
|
+
* 的首帧以全亮闪现、下一帧才跌回暗端重来。充能只动颜色,glyph 恒为
|
|
13
|
+
* `❯ `,SGR-only 规则天然成立。
|
|
14
|
+
*
|
|
15
|
+
* 时钟复用 Ink core 共享时钟,且只在充能未满的那 150ms 内订阅;稳态
|
|
16
|
+
* 零定时器、零重渲染,前缀色取记忆化常量。
|
|
17
|
+
*/
|
|
18
|
+
import { useContext, useEffect, useReducer, useState } from 'react';
|
|
19
|
+
import { Text, useTheme } from '../ui.js';
|
|
20
|
+
import { ClockContext } from '../ink/components/ClockContext.js';
|
|
21
|
+
import { accentRamp } from '../trajectory/effortIgnition.js';
|
|
22
|
+
import { rgbString } from '../trajectory/motion.js';
|
|
23
|
+
import { interpolateColor } from './Spinner/spinnerUtils.js';
|
|
24
|
+
import { isLightThemeActive } from '../theme.js';
|
|
25
|
+
/** 充能时长(ms)。 */
|
|
26
|
+
const CHARGE_MS = 150;
|
|
27
|
+
export function EffortChargeGlyph({ effort, levels, working, }) {
|
|
28
|
+
const clock = useContext(ClockContext);
|
|
29
|
+
const [themeName] = useTheme();
|
|
30
|
+
const [chargeStartedAt, setChargeStartedAt] = useState(null);
|
|
31
|
+
const [prevEffort, setPrevEffort] = useState(effort);
|
|
32
|
+
const [, forceRender] = useReducer((tick) => tick + 1, 0);
|
|
33
|
+
const topActive = effort !== undefined && levels !== undefined && levels.length > 1 && effort === levels[levels.length - 1];
|
|
34
|
+
// Render-phase trigger (same pattern as EffortInputBorder): switching from
|
|
35
|
+
// an existing tier onto the top tier starts the charge NOW, not one effect
|
|
36
|
+
// later — the first frame of the new effort must not flash fully lit.
|
|
37
|
+
// Cold mounts enter the steady state directly; without a shared clock
|
|
38
|
+
// (headless embeds) there is no charge either — no frames would ever arrive.
|
|
39
|
+
if (effort !== prevEffort) {
|
|
40
|
+
setPrevEffort(effort);
|
|
41
|
+
if (topActive && clock !== null) {
|
|
42
|
+
setChargeStartedAt(clock.now());
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// Only the 150ms charge window subscribes to the shared clock; steady
|
|
46
|
+
// state has zero timers and zero re-renders.
|
|
47
|
+
const chargeElapsed = chargeStartedAt === null
|
|
48
|
+
? Infinity
|
|
49
|
+
: // Clamp at zero: the shared clock can hand back a stale tickTime for
|
|
50
|
+
// one frame after waking from pause.
|
|
51
|
+
Math.max(0, (clock?.now() ?? Date.now()) - chargeStartedAt);
|
|
52
|
+
const charging = chargeElapsed < CHARGE_MS;
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (!charging || clock === null)
|
|
55
|
+
return;
|
|
56
|
+
return clock.subscribe(() => forceRender(), /* keepAlive */ true);
|
|
57
|
+
}, [charging, clock]);
|
|
58
|
+
if (!topActive)
|
|
59
|
+
return _jsx(Text, { dimColor: working, children: "\u276F " });
|
|
60
|
+
const ramp = accentRamp(isLightThemeActive(themeName));
|
|
61
|
+
if (!charging) {
|
|
62
|
+
// Steady state re-derives on every render (two allocations + one blend
|
|
63
|
+
// per keystroke — negligible) instead of caching: a cached colour would
|
|
64
|
+
// go stale across a light/dark theme flip while the tier stays active.
|
|
65
|
+
const color = rgbString(ramp.full);
|
|
66
|
+
return (_jsxs(Text, { bold: true, color: color, dimColor: working, children: ["\u276F", ' '] }));
|
|
67
|
+
}
|
|
68
|
+
const charge = Math.min(1, chargeElapsed / CHARGE_MS);
|
|
69
|
+
return (_jsxs(Text, { bold: true, color: rgbString(interpolateColor(ramp.dim, ramp.full, charge)), dimColor: working, children: ["\u276F", ' '] }));
|
|
70
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EffortInputBorder — 输入框层上的三幕点焰叠加(对齐 Codex 的完整
|
|
3
|
+
* 语义:光扫过、档位字样浮现、整体渐隐)。
|
|
4
|
+
*
|
|
5
|
+
* 输入框只有顶/底两条横边框(round、无左右)——本组件自绘这两行,
|
|
6
|
+
* **同步**承载动画;档位字样由输入行尾的 EffortTierBadge 短暂显示
|
|
7
|
+
* (见 PromptInput),动画全程行数恒定。切到最高思考强度档时:
|
|
8
|
+
*
|
|
9
|
+
* 1. 扫光 [0, 1s)——一段高亮彩色光带沿顶/底边框同步自左向右扫过
|
|
10
|
+
* (wave 波形逐列变色),期间输入框完全正常可用;
|
|
11
|
+
* 2. 档位字样 [600ms, ~1.1s)——光带行至中段时,输入行居中浮现
|
|
12
|
+
* 档名大写(由暗渐亮加粗、间距聚拢,见 EffortTierBadge);
|
|
13
|
+
* 3. 渐隐 [1.5s, 2s)——字样连同光色一起向主题色淡出,末帧归零:
|
|
14
|
+
* 静止时顶/底边框就是原主题色,内容区无任何附加物。
|
|
15
|
+
*
|
|
16
|
+
* glyph 变化仅限字样行的出现/让位(一次性);其余帧间变化全部是既
|
|
17
|
+
* 有 `─` 的前景色。触发判定在渲染期做(props-变化-调整模式);从
|
|
18
|
+
* 「已有档位」切到档位表末位最高档才触发,冷启动恢复偏好/单档表/
|
|
19
|
+
* 无档位表/无共享时钟均不触发。时钟复用 Ink core 共享时钟,仅动画
|
|
20
|
+
* 窗口订阅(keepAlive),播完回到零开销静止边框。
|
|
21
|
+
*/
|
|
22
|
+
import React from 'react';
|
|
23
|
+
import type { Color } from '../ink/styles.js';
|
|
24
|
+
import type { Theme } from '../theme.js';
|
|
25
|
+
export declare function EffortInputBorder({ effort, levels, columns, onLight, idleColor, children, }: {
|
|
26
|
+
/** 当前思考强度档 id;`undefined` 表示路线未声明。 */
|
|
27
|
+
effort: string | undefined;
|
|
28
|
+
/** 当前路线的档位表(低→高,末位为最高档);未知时传 `undefined`。 */
|
|
29
|
+
levels: readonly string[] | undefined;
|
|
30
|
+
columns: number;
|
|
31
|
+
onLight: boolean;
|
|
32
|
+
/** 静止边框色(主题 token 名,如 'promptBorder' / 'planMode')。 */
|
|
33
|
+
idleColor: keyof Theme | Color;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}): React.ReactNode;
|
|
36
|
+
//# sourceMappingURL=EffortInputBorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffortInputBorder.d.ts","sourceRoot":"","sources":["../../../src/components/EffortInputBorder.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAA8D,MAAM,OAAO,CAAA;AAGlF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAgCxC,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,QAAQ,GACT,EAAE;IACD,sCAAsC;IACtC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,6CAA6C;IAC7C,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACrC,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,uDAAuD;IACvD,SAAS,EAAE,MAAM,KAAK,GAAG,KAAK,CAAA;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,GAAG,KAAK,CAAC,SAAS,CA0DlB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* EffortInputBorder — 输入框层上的三幕点焰叠加(对齐 Codex 的完整
|
|
4
|
+
* 语义:光扫过、档位字样浮现、整体渐隐)。
|
|
5
|
+
*
|
|
6
|
+
* 输入框只有顶/底两条横边框(round、无左右)——本组件自绘这两行,
|
|
7
|
+
* **同步**承载动画;档位字样由输入行尾的 EffortTierBadge 短暂显示
|
|
8
|
+
* (见 PromptInput),动画全程行数恒定。切到最高思考强度档时:
|
|
9
|
+
*
|
|
10
|
+
* 1. 扫光 [0, 1s)——一段高亮彩色光带沿顶/底边框同步自左向右扫过
|
|
11
|
+
* (wave 波形逐列变色),期间输入框完全正常可用;
|
|
12
|
+
* 2. 档位字样 [600ms, ~1.1s)——光带行至中段时,输入行居中浮现
|
|
13
|
+
* 档名大写(由暗渐亮加粗、间距聚拢,见 EffortTierBadge);
|
|
14
|
+
* 3. 渐隐 [1.5s, 2s)——字样连同光色一起向主题色淡出,末帧归零:
|
|
15
|
+
* 静止时顶/底边框就是原主题色,内容区无任何附加物。
|
|
16
|
+
*
|
|
17
|
+
* glyph 变化仅限字样行的出现/让位(一次性);其余帧间变化全部是既
|
|
18
|
+
* 有 `─` 的前景色。触发判定在渲染期做(props-变化-调整模式);从
|
|
19
|
+
* 「已有档位」切到档位表末位最高档才触发,冷启动恢复偏好/单档表/
|
|
20
|
+
* 无档位表/无共享时钟均不触发。时钟复用 Ink core 共享时钟,仅动画
|
|
21
|
+
* 窗口订阅(keepAlive),播完回到零开销静止边框。
|
|
22
|
+
*/
|
|
23
|
+
import { useContext, useEffect, useReducer, useState } from 'react';
|
|
24
|
+
import { Box, Text } from '../ui.js';
|
|
25
|
+
import { ClockContext } from '../ink/components/ClockContext.js';
|
|
26
|
+
import { IGNITION_TIMELINE, ignitionLineColors } from '../trajectory/effortIgnition.js';
|
|
27
|
+
/** 边框行(顶/底共用同一色段序列——同步变色)。 */
|
|
28
|
+
function BorderRow({ left, right, runs, idleColor, }) {
|
|
29
|
+
return (_jsx(Box, { width: "100%", height: 1, flexShrink: 0, overflow: "hidden", children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { color: idleColor, children: left }), runs.map((run, i) => (_jsx(Text, { color: run.color, children: run.glyph }, i))), _jsx(Text, { color: idleColor, children: right })] }) }));
|
|
30
|
+
}
|
|
31
|
+
export function EffortInputBorder({ effort, levels, columns, onLight, idleColor, children, }) {
|
|
32
|
+
const clock = useContext(ClockContext);
|
|
33
|
+
const [overlay, setOverlay] = useState(null);
|
|
34
|
+
const [prevEffort, setPrevEffort] = useState(effort);
|
|
35
|
+
const [, forceRender] = useReducer((tick) => tick + 1, 0);
|
|
36
|
+
// 渲染期触发:effort 变化的首帧就以新状态渲染(effect 会晚一帧)。
|
|
37
|
+
if (effort !== prevEffort) {
|
|
38
|
+
setPrevEffort(effort);
|
|
39
|
+
if (clock !== null &&
|
|
40
|
+
effort !== undefined &&
|
|
41
|
+
levels !== undefined &&
|
|
42
|
+
levels.length > 1 &&
|
|
43
|
+
effort === levels[levels.length - 1]) {
|
|
44
|
+
setOverlay({ label: effort.toUpperCase(), startedAtMs: clock.now() });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// 仅动画窗口订阅共享时钟;静止边框零定时器零重渲染。
|
|
48
|
+
const elapsedMs = overlay === null ? Infinity : Math.max(0, (clock?.now() ?? Date.now()) - overlay.startedAtMs);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (overlay === null || clock === null)
|
|
51
|
+
return;
|
|
52
|
+
return clock.subscribe(() => forceRender(), /* keepAlive */ true);
|
|
53
|
+
}, [overlay, clock]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (overlay !== null && elapsedMs >= IGNITION_TIMELINE.fadeEndMs)
|
|
56
|
+
setOverlay(null);
|
|
57
|
+
}, [overlay, elapsedMs]);
|
|
58
|
+
const midWidth = Math.max(0, columns - 2);
|
|
59
|
+
const sweepColors = overlay !== null && elapsedMs < IGNITION_TIMELINE.sweepMs && midWidth > 0
|
|
60
|
+
? ignitionLineColors({ elapsedMs, width: midWidth, onLight })
|
|
61
|
+
: [];
|
|
62
|
+
// 顶/底共用的色段序列(同步):扫光列取波形色,其余列回主题色。
|
|
63
|
+
const runs = [];
|
|
64
|
+
for (let index = 0; index < midWidth; index++) {
|
|
65
|
+
const color = sweepColors[index] ?? idleColor;
|
|
66
|
+
const last = runs[runs.length - 1];
|
|
67
|
+
if (last !== undefined && last.color === color)
|
|
68
|
+
last.glyph += '─';
|
|
69
|
+
else
|
|
70
|
+
runs.push({ glyph: '─', color });
|
|
71
|
+
}
|
|
72
|
+
return (_jsxs(Box, { flexDirection: "column", alignItems: "flex-start", justifyContent: "flex-start", width: "100%", flexShrink: 0, children: [_jsx(BorderRow, { left: "\u256D", right: "\u256E", runs: runs, idleColor: idleColor }), _jsx(Box, { flexShrink: 0, children: children }), _jsx(BorderRow, { left: "\u2570", right: "\u256F", runs: runs, idleColor: idleColor })] }));
|
|
73
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EffortTierBadge — 输入行尾的档位字样徽标:三幕点焰的第二幕载体
|
|
3
|
+
* (与 EffortInputBorder 的双框扫光同一时间轴、同一触发),切到最高
|
|
4
|
+
* 思考强度档时光带行至中段,输入行居中浮现档名(当前档名大写,字母间距从
|
|
5
|
+
* 10 个空格减速聚拢到 1 个——连续位置逐字母取整保证帧帧有移动,
|
|
6
|
+
* 明亮蓝加粗,由暗渐亮),随后随图层整体渐隐让位——行数恒定,静
|
|
7
|
+
* 止时完全不渲染;输入行有文字时不显示(绝不遮挡内容)。
|
|
8
|
+
*
|
|
9
|
+
* 触发判定在渲染期做(props-变化-调整模式,与边框/充能组件同模
|
|
10
|
+
* 式);冷启动恢复偏好/单档表/无档位表/无共享时钟均不触发。时钟
|
|
11
|
+
* 复用 Ink core 共享时钟,仅动画窗口订阅(keepAlive),播完归零。
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
export declare function EffortTierBadge({ effort, levels, onLight, columns, leadingColumns, }: {
|
|
15
|
+
/** 当前思考强度档 id;`undefined` 表示路线未声明。 */
|
|
16
|
+
effort: string | undefined;
|
|
17
|
+
/** 当前路线的档位表(低→高,末位为最高档);未知时传 `undefined`。 */
|
|
18
|
+
levels: readonly string[] | undefined;
|
|
19
|
+
onLight: boolean;
|
|
20
|
+
/** 终端列数——居中锚点按终端几何中心计算(纯文本流,不引入嵌套 Box)。 */
|
|
21
|
+
columns: number;
|
|
22
|
+
/** badge 文本流之前该行已被占据的列数(❯ 与块光标等)——居中换算成
|
|
23
|
+
* badge 流内列时要扣掉,否则整体偏右一个前缀宽。 */
|
|
24
|
+
leadingColumns: number;
|
|
25
|
+
}): React.ReactNode;
|
|
26
|
+
//# sourceMappingURL=EffortTierBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EffortTierBadge.d.ts","sourceRoot":"","sources":["../../../src/components/EffortTierBadge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAsD,MAAM,OAAO,CAAA;AAc1E,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,EACP,cAAc,GACf,EAAE;IACD,sCAAsC;IACtC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,6CAA6C;IAC7C,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IACrC,OAAO,EAAE,OAAO,CAAA;IAChB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf;qCACiC;IACjC,cAAc,EAAE,MAAM,CAAA;CACvB,GAAG,KAAK,CAAC,SAAS,CAkFlB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* EffortTierBadge — 输入行尾的档位字样徽标:三幕点焰的第二幕载体
|
|
4
|
+
* (与 EffortInputBorder 的双框扫光同一时间轴、同一触发),切到最高
|
|
5
|
+
* 思考强度档时光带行至中段,输入行居中浮现档名(当前档名大写,字母间距从
|
|
6
|
+
* 10 个空格减速聚拢到 1 个——连续位置逐字母取整保证帧帧有移动,
|
|
7
|
+
* 明亮蓝加粗,由暗渐亮),随后随图层整体渐隐让位——行数恒定,静
|
|
8
|
+
* 止时完全不渲染;输入行有文字时不显示(绝不遮挡内容)。
|
|
9
|
+
*
|
|
10
|
+
* 触发判定在渲染期做(props-变化-调整模式,与边框/充能组件同模
|
|
11
|
+
* 式);冷启动恢复偏好/单档表/无档位表/无共享时钟均不触发。时钟
|
|
12
|
+
* 复用 Ink core 共享时钟,仅动画窗口订阅(keepAlive),播完归零。
|
|
13
|
+
*/
|
|
14
|
+
import { useContext, useEffect, useReducer, useState } from 'react';
|
|
15
|
+
import { Text } from '../ui.js';
|
|
16
|
+
import { ClockContext } from '../ink/components/ClockContext.js';
|
|
17
|
+
import { rgbString } from '../trajectory/motion.js';
|
|
18
|
+
import { IGNITION_TIMELINE, ignitionHues } from '../trajectory/effortIgnition.js';
|
|
19
|
+
/** 字母间距聚拢:从 10 个空格减速收敛到 1 个(ease-out,快收慢停)。 */
|
|
20
|
+
const GAP_START = 10;
|
|
21
|
+
const GAP_END = 1;
|
|
22
|
+
const CONVERGE_MS = 500;
|
|
23
|
+
export function EffortTierBadge({ effort, levels, onLight, columns, leadingColumns, }) {
|
|
24
|
+
const clock = useContext(ClockContext);
|
|
25
|
+
const [overlay, setOverlay] = useState(null);
|
|
26
|
+
const [prevEffort, setPrevEffort] = useState(effort);
|
|
27
|
+
const [, forceRender] = useReducer((tick) => tick + 1, 0);
|
|
28
|
+
// 渲染期触发(与边框/充能同模式):effort 变化的首帧就以新状态渲染。
|
|
29
|
+
if (effort !== prevEffort) {
|
|
30
|
+
setPrevEffort(effort);
|
|
31
|
+
if (clock !== null &&
|
|
32
|
+
effort !== undefined &&
|
|
33
|
+
levels !== undefined &&
|
|
34
|
+
levels.length > 1 &&
|
|
35
|
+
effort === levels[levels.length - 1]) {
|
|
36
|
+
setOverlay({ label: effort.toUpperCase(), startedAtMs: clock.now() });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const elapsedMs = overlay === null ? Infinity : Math.max(0, (clock?.now() ?? Date.now()) - overlay.startedAtMs);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (overlay === null || clock === null)
|
|
42
|
+
return;
|
|
43
|
+
return clock.subscribe(() => forceRender(), /* keepAlive */ true);
|
|
44
|
+
}, [overlay, clock]);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (overlay !== null && elapsedMs >= IGNITION_TIMELINE.fadeEndMs)
|
|
47
|
+
setOverlay(null);
|
|
48
|
+
}, [overlay, elapsedMs]);
|
|
49
|
+
if (overlay === null || elapsedMs < IGNITION_TIMELINE.labelStartMs)
|
|
50
|
+
return null;
|
|
51
|
+
const brighten = Math.min(1, (elapsedMs - IGNITION_TIMELINE.labelStartMs) / IGNITION_TIMELINE.labelBrightenMs);
|
|
52
|
+
const fade = elapsedMs < IGNITION_TIMELINE.fadeStartMs
|
|
53
|
+
? 1
|
|
54
|
+
: Math.max(0, 1 - (elapsedMs - IGNITION_TIMELINE.fadeStartMs) / (IGNITION_TIMELINE.fadeEndMs - IGNITION_TIMELINE.fadeStartMs));
|
|
55
|
+
const alpha = brighten * fade;
|
|
56
|
+
if (alpha <= 0)
|
|
57
|
+
return null;
|
|
58
|
+
const band = onLight ? { r: 240, g: 240, b: 242 } : { r: 27, g: 30, b: 40 };
|
|
59
|
+
// 明亮蓝:accent 混白 35% 提亮(用户拍板的高亮观感)。
|
|
60
|
+
const hue = ignitionHues(onLight)[0];
|
|
61
|
+
const whiten = (x) => Math.round(x + (255 - x) * 0.35);
|
|
62
|
+
const bright = { r: whiten(hue.r), g: whiten(hue.g), b: whiten(hue.b) };
|
|
63
|
+
const mix = (x, y) => Math.round(x + (y - x) * alpha);
|
|
64
|
+
const color = rgbString({ r: mix(band.r, bright.r), g: mix(band.g, bright.g), b: mix(band.b, bright.b) });
|
|
65
|
+
// 字母间距聚拢(Codex 的 converge 语义):间距是连续浮点,字母位置
|
|
66
|
+
// 以**行中心为锚**对称收缩——pos_i = center + (i-(n-1)/2)·(1+gap),
|
|
67
|
+
// 左右字母各向中心移动一半(奇数档名的居中字母原位不动),两侧速
|
|
68
|
+
// 度天然均衡;每字母独立按连续位置取整落列,不同字母在不同帧跨
|
|
69
|
+
// 格,每帧至少一个在动(把间距整体取整会让 ease-out 慢末段上百毫
|
|
70
|
+
// 秒才跨一格,看起来就是卡顿)。曲线混入 15% 线性做末段保底速度。
|
|
71
|
+
const progress = Math.min(1, Math.max(0, (elapsedMs - IGNITION_TIMELINE.labelStartMs) / CONVERGE_MS));
|
|
72
|
+
// 跳变间隔均匀化:离散格子上「减速」若靠曲线导数趋零实现,末段会
|
|
73
|
+
// 出现几十帧不动一格的长停顿再突跳(卡感来源)。改为 90% 线性 +
|
|
74
|
+
// 10% easeOutQuad 的轻缓收尾——跳变间隔全程近似恒定(约 55ms/格),
|
|
75
|
+
// 仅末端轻微放慢,终端上的观感是均匀顺滑的聚拢。
|
|
76
|
+
const eased = 1 - progress;
|
|
77
|
+
const easedWithFloor = 0.9 * eased + 0.1 * (1 - progress * progress);
|
|
78
|
+
const gapF = GAP_END + (GAP_START - GAP_END) * easedWithFloor;
|
|
79
|
+
const letterCount = overlay.label.length;
|
|
80
|
+
// 锚点是**终端几何中心**(不是 ❯/光标之后可用区的中心——那会整体
|
|
81
|
+
// 偏右约 1.5 格;可用区起点在左,其"中点"不含左部占位)。左右字母
|
|
82
|
+
// 严格镜像——Math.round 对 .5 恒向上,正负方向舍入不对称会让跨格
|
|
83
|
+
// 时刻错开;左字母的落列由右字母的舍入结果镜像得出(2C − col),
|
|
84
|
+
// M/X 每次同帧反向同跳,全程对称于终端中心。
|
|
85
|
+
const C = Math.round((columns - 1) / 2) - leadingColumns;
|
|
86
|
+
let spaced = '';
|
|
87
|
+
let column = 0;
|
|
88
|
+
for (let i = 0; i < letterCount; i++) {
|
|
89
|
+
const off = (i - (letterCount - 1) / 2) * (1 + gapF);
|
|
90
|
+
const at = off >= 0
|
|
91
|
+
? Math.round(C + off)
|
|
92
|
+
: 2 * C - Math.round(C - off);
|
|
93
|
+
spaced += ' '.repeat(Math.max(0, at - column)) + overlay.label[i];
|
|
94
|
+
column = at + 1;
|
|
95
|
+
}
|
|
96
|
+
return (_jsx(Text, { bold: true, color: color, wrap: "truncate-end", children: spaced }));
|
|
97
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type ScrollBoxHandle } from '../ui.js';
|
|
2
3
|
import type { LocalCommand } from '../commands.js';
|
|
3
4
|
/**
|
|
4
5
|
* The `?` help menu, mirroring Claude Code's `PromptInputHelpMenu.tsx`
|
|
@@ -10,7 +11,13 @@ import type { LocalCommand } from '../commands.js';
|
|
|
10
11
|
* menu is for chrome commands. Modifier labels follow the platform
|
|
11
12
|
* convention: ⌘ on macOS, ctrl elsewhere.
|
|
12
13
|
*/
|
|
13
|
-
export declare function HelpMenu({ commands, }: {
|
|
14
|
+
export declare function HelpMenu({ commands, viewportHeight, viewportWidth, scrollRef, }: {
|
|
14
15
|
commands: readonly LocalCommand[];
|
|
16
|
+
/** Fixed viewport supplied by the prompt overlay; unset for standalone renders. */
|
|
17
|
+
viewportHeight?: number;
|
|
18
|
+
/** Terminal width used to collapse the three-column layout when necessary. */
|
|
19
|
+
viewportWidth?: number;
|
|
20
|
+
/** PromptInput owns keyboard routing and drives this scroll viewport. */
|
|
21
|
+
scrollRef?: React.Ref<ScrollBoxHandle>;
|
|
15
22
|
}): React.ReactNode;
|
|
16
23
|
//# sourceMappingURL=HelpMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpMenu.d.ts","sourceRoot":"","sources":["../../../src/components/HelpMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"HelpMenu.d.ts","sourceRoot":"","sources":["../../../src/components/HelpMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAKlD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,cAAc,EACd,aAAa,EACb,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,SAAS,YAAY,EAAE,CAAA;IACjC,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8EAA8E;IAC9E,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,yEAAyE;IACzE,SAAS,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;CACvC,GAAG,KAAK,CAAC,SAAS,CAyHlB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import Box from '../
|
|
3
|
-
import Text from '../ink/components/Text.js';
|
|
2
|
+
import { Box, ScrollBox, Text } from '../ui.js';
|
|
4
3
|
import { localizedDescription } from '../commands.js';
|
|
5
4
|
import { t } from '../i18n.js';
|
|
6
5
|
import { modLabel } from '../utils/modifiers.js';
|
|
@@ -14,7 +13,19 @@ import { modLabel } from '../utils/modifiers.js';
|
|
|
14
13
|
* menu is for chrome commands. Modifier labels follow the platform
|
|
15
14
|
* convention: ⌘ on macOS, ctrl elsewhere.
|
|
16
15
|
*/
|
|
17
|
-
export function HelpMenu({ commands, }) {
|
|
16
|
+
export function HelpMenu({ commands, viewportHeight, viewportWidth, scrollRef, }) {
|
|
18
17
|
const chrome = commands.filter(command => !command.skill);
|
|
19
|
-
|
|
18
|
+
const primaryShortcuts = (_jsxs(Box, { flexDirection: "column", width: 26, flexShrink: 0, children: [_jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-for-commands') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-this-help') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-verbose-output', { mod: modLabel }) }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-open-trajectory', { mod: modLabel }) }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-search-history', { mod: modLabel }) }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-interrupt') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-exit') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-redraw', { mod: modLabel }) }) })] }));
|
|
19
|
+
const secondaryShortcuts = (_jsxs(Box, { flexDirection: "column", width: 24, flexShrink: 0, children: [_jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-clear-input') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-history-nav') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-move-cursor') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-word-jumps', { mod: modLabel }) }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-complete-command') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-cycle-mode') }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: t('help-open-editor') }) })] }));
|
|
20
|
+
const commandRows = chrome.map(command => (_jsx(Box, { flexShrink: 0, children: _jsxs(Text, { dimColor: true, wrap: "truncate-end", children: ["/", command.name, " \u2014 ", localizedDescription(command)] }) }, command.name)));
|
|
21
|
+
const compactCommandRows = chrome.map(command => (_jsx(Box, { flexShrink: 0, children: _jsxs(Text, { dimColor: true, wrap: "truncate-end", children: ["/", command.name, " \u2014 ", localizedDescription(command)] }) }, command.name)));
|
|
22
|
+
const commandList = (_jsxs(Box, { flexDirection: "column", flexShrink: 0, children: [_jsx(Text, { dimColor: true, children: t('help-commands-title') }), commandRows] }));
|
|
23
|
+
const content = (_jsxs(Box, { paddingX: 2, flexDirection: "row", gap: 4, children: [primaryShortcuts, secondaryShortcuts, _jsx(Box, { flexDirection: "column", flexShrink: 1, children: commandList })] }));
|
|
24
|
+
// Standalone renders (notably the i18n verifier) keep the historical
|
|
25
|
+
// intrinsic-height layout. The real prompt overlay supplies an explicit
|
|
26
|
+
// height so a growing command registry cannot escape the terminal.
|
|
27
|
+
if (viewportHeight === undefined)
|
|
28
|
+
return content;
|
|
29
|
+
const compact = viewportWidth !== undefined && viewportWidth < 72;
|
|
30
|
+
return (_jsxs(Box, { height: viewportHeight, flexDirection: "column", children: [compact ? (_jsxs(ScrollBox, { ref: scrollRef, flexDirection: "column", flexGrow: 1, flexShrink: 1, paddingX: 2, children: [primaryShortcuts, secondaryShortcuts, _jsx(Text, { dimColor: true, children: t('help-commands-title') }), compactCommandRows] })) : (_jsxs(Box, { paddingX: 2, flexDirection: "row", gap: 4, flexGrow: 1, children: [primaryShortcuts, secondaryShortcuts, _jsx(ScrollBox, { ref: scrollRef, flexDirection: "column", flexGrow: 1, flexShrink: 1, children: commandList })] })), _jsx(Box, { paddingX: 2, flexShrink: 0, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: t('help-scroll-hint') }) })] }));
|
|
20
31
|
}
|
|
@@ -26,5 +26,5 @@ export function LoadedContextPanel({ context, open, onToggle, }) {
|
|
|
26
26
|
const summary = summarizeLoadedContext(context);
|
|
27
27
|
if (summary === '')
|
|
28
28
|
return null;
|
|
29
|
-
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [_jsx(Box, { paddingX: 1, backgroundColor: open ? '
|
|
29
|
+
return (_jsxs(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: [_jsx(Box, { paddingX: 1, backgroundColor: open ? 'userMessageBackgroundHover' : undefined, children: _jsxs(Text, { bold: open, wrap: "truncate", children: [open ? '▼' : '▶', " ", _jsxs(Text, { dimColor: true, children: ["\uFF08Ctrl+P", open ? t('context-panel-collapse') : t('context-panel-expand'), "\uFF09"] }), " ", t('context-loaded'), " \u00B7 ", summary] }) }), open && (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingTop: 1, children: [context.sections.length > 0 && (_jsx(Group, { title: t('context-panel-sections', { n: context.sections.length }), children: context.sections.map(section => (_jsx(Entry, { entry: section }, section.name))) })), context.files.length > 0 && (_jsx(Group, { title: t('context-panel-files', { n: context.files.length }), children: context.files.map(file => (_jsx(Text, { dimColor: true, children: file.displayPath }, file.displayPath))) })), context.contexts.length > 0 && (_jsx(Group, { title: t('context-panel-runtime', { n: context.contexts.length }), children: context.contexts.map(entry => (_jsx(Entry, { entry: entry }, entry.name))) })), context.skills.length > 0 && (_jsx(Group, { title: t('context-panel-skills', { n: context.skills.length }), children: context.skills.map(skill => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: skill.name }), _jsx(Text, { dimColor: true, wrap: "wrap", children: skill.description })] }, skill.name))) })), context.tools.length > 0 && (_jsx(Group, { title: t('context-panel-tools', { n: context.tools.length }), children: context.tools.map(tool => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { bold: true, dimColor: true, children: tool.name }), _jsx(Text, { dimColor: true, wrap: "wrap", children: truncateContextText(tool.description, 160) })] }, tool.name))) })), _jsx(Text, { dimColor: true, children: "\u00B7 /context" })] }))] }));
|
|
30
30
|
}
|
|
@@ -14,7 +14,7 @@ import { type Tip } from '../tips.js';
|
|
|
14
14
|
* the whale the welcome tagline, centered under the art, in ice
|
|
15
15
|
* blue. Narrow terminals drop the whale and keep the text column.
|
|
16
16
|
*/
|
|
17
|
-
export declare function LogoV2({ model, effort, cwd, skipIntro, tip, }: {
|
|
17
|
+
export declare function LogoV2({ model, effort, cwd, skipIntro, tip, whale, }: {
|
|
18
18
|
model: string;
|
|
19
19
|
effort?: string | undefined;
|
|
20
20
|
cwd: string;
|
|
@@ -22,5 +22,7 @@ export declare function LogoV2({ model, effort, cwd, skipIntro, tip, }: {
|
|
|
22
22
|
skipIntro?: boolean;
|
|
23
23
|
/** Test seam: pin the startup tip line (probes need a deterministic tip). */
|
|
24
24
|
tip?: Tip;
|
|
25
|
+
/** Show the pixel whale art (settings `dsh-tui.whale`); off → text-only header. */
|
|
26
|
+
whale?: boolean;
|
|
25
27
|
}): React.ReactNode;
|
|
26
28
|
//# sourceMappingURL=LogoV2.d.ts.map
|