@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
|
@@ -1,149 +1,149 @@
|
|
|
1
|
-
{
|
|
2
|
-
"profileVersion": "tui-admission/0.15",
|
|
3
|
-
"std": {
|
|
4
|
-
"repository": "https://github.com/Yan-Zero/dsh-std",
|
|
5
|
-
"submodule": "vendor/dsh-std",
|
|
6
|
-
"manifestVersion": "0.15"
|
|
7
|
-
},
|
|
8
|
-
"imports": [
|
|
9
|
-
{
|
|
10
|
-
"name": "commands",
|
|
11
|
-
"coordinates": {
|
|
12
|
-
"apiVersion": "commands.dsh/v1alpha1",
|
|
13
|
-
"kind": "Command"
|
|
14
|
-
},
|
|
15
|
-
"package": "@dsh-std/command",
|
|
16
|
-
"kind": "capability",
|
|
17
|
-
"permissions": [
|
|
18
|
-
"commands.invoke"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"name": "storage.local",
|
|
23
|
-
"coordinates": {
|
|
24
|
-
"apiVersion": "storage.dsh/v1alpha1",
|
|
25
|
-
"kind": "LocalStorage"
|
|
26
|
-
},
|
|
27
|
-
"package": "@dsh-std/storage",
|
|
28
|
-
"kind": "capability",
|
|
29
|
-
"permissions": [
|
|
30
|
-
"storage.local.read",
|
|
31
|
-
"storage.local.write"
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "messages.observe",
|
|
36
|
-
"coordinates": {
|
|
37
|
-
"apiVersion": "messages.dsh/v1alpha1",
|
|
38
|
-
"kind": "MessageObserver"
|
|
39
|
-
},
|
|
40
|
-
"package": "@dsh-std/messages",
|
|
41
|
-
"kind": "event",
|
|
42
|
-
"permissions": [
|
|
43
|
-
"messages.observe.read"
|
|
44
|
-
],
|
|
45
|
-
"eventEnvelope": "@dsh-std/messages/schema/message-observer-envelope-0.15.json"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"name": "presentation.open-external",
|
|
49
|
-
"coordinates": {
|
|
50
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
51
|
-
"kind": "OpenExternal"
|
|
52
|
-
},
|
|
53
|
-
"package": "@dsh-std/presentation",
|
|
54
|
-
"kind": "capability",
|
|
55
|
-
"permissions": []
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"name": "presentation.user-interaction",
|
|
59
|
-
"coordinates": {
|
|
60
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
61
|
-
"kind": "UserInteraction"
|
|
62
|
-
},
|
|
63
|
-
"package": "@dsh-std/presentation",
|
|
64
|
-
"kind": "capability",
|
|
65
|
-
"permissions": []
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "presentation.external-redirect",
|
|
69
|
-
"coordinates": {
|
|
70
|
-
"apiVersion": "presentation.dsh/v1alpha1",
|
|
71
|
-
"kind": "ExternalRedirect"
|
|
72
|
-
},
|
|
73
|
-
"package": "@dsh-std/presentation",
|
|
74
|
-
"kind": "capability",
|
|
75
|
-
"permissions": []
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"definitions": [
|
|
79
|
-
{
|
|
80
|
-
"name": "tui.decision-events",
|
|
81
|
-
"authority": "dsh-tui",
|
|
82
|
-
"coordinates": {
|
|
83
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
84
|
-
"kind": "DecisionEvents"
|
|
85
|
-
},
|
|
86
|
-
"kind": "capability",
|
|
87
|
-
"profile": "registry/contracts/decision-events-v1alpha1.json",
|
|
88
|
-
"profileHash": "sha256:56440dde1b00c210b22761a0cba139ce0a20207330567777cebe1e48b494ceb0",
|
|
89
|
-
"permissions": [
|
|
90
|
-
"session.input.intercept",
|
|
91
|
-
"session.rewind.intercept",
|
|
92
|
-
"session.switch.intercept",
|
|
93
|
-
"session.compact.intercept"
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"name": "tui.channel",
|
|
98
|
-
"authority": "dsh-tui",
|
|
99
|
-
"coordinates": {
|
|
100
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
101
|
-
"kind": "Channel"
|
|
102
|
-
},
|
|
103
|
-
"kind": "capability",
|
|
104
|
-
"profile": "registry/contracts/tui-channel-v1alpha1.json",
|
|
105
|
-
"profileHash": "sha256:2d0668656d999a8cacd363cd3c76207f9392118be8a83e6dd5f81b54ae063fe6",
|
|
106
|
-
"permissions": []
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
"extensions": [
|
|
110
|
-
{
|
|
111
|
-
"name": "workspace.provider",
|
|
112
|
-
"authority": "dsh-std",
|
|
113
|
-
"coordinates": {
|
|
114
|
-
"apiVersion": "workspace.dsh/v1alpha1",
|
|
115
|
-
"kind": "WorkspaceProvider"
|
|
116
|
-
},
|
|
117
|
-
"kind": "extension",
|
|
118
|
-
"package": "@dsh-std/workspace",
|
|
119
|
-
"permissions": []
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "tui.settings-section",
|
|
123
|
-
"authority": "dsh-tui",
|
|
124
|
-
"coordinates": {
|
|
125
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
126
|
-
"kind": "SettingsSection"
|
|
127
|
-
},
|
|
128
|
-
"kind": "extension",
|
|
129
|
-
"profile": "registry/contracts/settings-section-v1alpha1.json",
|
|
130
|
-
"profileHash": "sha256:685b0f17fe489f458e9b799811f61c42b858330584e95ecb97e7216b5be100ac",
|
|
131
|
-
"permissions": []
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "tui.scene",
|
|
135
|
-
"authority": "dsh-tui",
|
|
136
|
-
"coordinates": {
|
|
137
|
-
"apiVersion": "tui.dsh/v1alpha1",
|
|
138
|
-
"kind": "Scene"
|
|
139
|
-
},
|
|
140
|
-
"kind": "extension",
|
|
141
|
-
"profile": "registry/contracts/scene-v1alpha1.json",
|
|
142
|
-
"profileHash": "sha256:69ce3ae26d60dea2ed170376db8a1fb5860c94bd192c62681423c1d848ec2b26",
|
|
143
|
-
"permissions": []
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"facetApiVersions": [
|
|
147
|
-
"v1alpha1"
|
|
148
|
-
]
|
|
149
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"profileVersion": "tui-admission/0.15",
|
|
3
|
+
"std": {
|
|
4
|
+
"repository": "https://github.com/Yan-Zero/dsh-std",
|
|
5
|
+
"submodule": "vendor/dsh-std",
|
|
6
|
+
"manifestVersion": "0.15"
|
|
7
|
+
},
|
|
8
|
+
"imports": [
|
|
9
|
+
{
|
|
10
|
+
"name": "commands",
|
|
11
|
+
"coordinates": {
|
|
12
|
+
"apiVersion": "commands.dsh/v1alpha1",
|
|
13
|
+
"kind": "Command"
|
|
14
|
+
},
|
|
15
|
+
"package": "@dsh-std/command",
|
|
16
|
+
"kind": "capability",
|
|
17
|
+
"permissions": [
|
|
18
|
+
"commands.invoke"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "storage.local",
|
|
23
|
+
"coordinates": {
|
|
24
|
+
"apiVersion": "storage.dsh/v1alpha1",
|
|
25
|
+
"kind": "LocalStorage"
|
|
26
|
+
},
|
|
27
|
+
"package": "@dsh-std/storage",
|
|
28
|
+
"kind": "capability",
|
|
29
|
+
"permissions": [
|
|
30
|
+
"storage.local.read",
|
|
31
|
+
"storage.local.write"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "messages.observe",
|
|
36
|
+
"coordinates": {
|
|
37
|
+
"apiVersion": "messages.dsh/v1alpha1",
|
|
38
|
+
"kind": "MessageObserver"
|
|
39
|
+
},
|
|
40
|
+
"package": "@dsh-std/messages",
|
|
41
|
+
"kind": "event",
|
|
42
|
+
"permissions": [
|
|
43
|
+
"messages.observe.read"
|
|
44
|
+
],
|
|
45
|
+
"eventEnvelope": "@dsh-std/messages/schema/message-observer-envelope-0.15.json"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "presentation.open-external",
|
|
49
|
+
"coordinates": {
|
|
50
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
51
|
+
"kind": "OpenExternal"
|
|
52
|
+
},
|
|
53
|
+
"package": "@dsh-std/presentation",
|
|
54
|
+
"kind": "capability",
|
|
55
|
+
"permissions": []
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "presentation.user-interaction",
|
|
59
|
+
"coordinates": {
|
|
60
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
61
|
+
"kind": "UserInteraction"
|
|
62
|
+
},
|
|
63
|
+
"package": "@dsh-std/presentation",
|
|
64
|
+
"kind": "capability",
|
|
65
|
+
"permissions": []
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"name": "presentation.external-redirect",
|
|
69
|
+
"coordinates": {
|
|
70
|
+
"apiVersion": "presentation.dsh/v1alpha1",
|
|
71
|
+
"kind": "ExternalRedirect"
|
|
72
|
+
},
|
|
73
|
+
"package": "@dsh-std/presentation",
|
|
74
|
+
"kind": "capability",
|
|
75
|
+
"permissions": []
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"definitions": [
|
|
79
|
+
{
|
|
80
|
+
"name": "tui.decision-events",
|
|
81
|
+
"authority": "dsh-tui",
|
|
82
|
+
"coordinates": {
|
|
83
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
84
|
+
"kind": "DecisionEvents"
|
|
85
|
+
},
|
|
86
|
+
"kind": "capability",
|
|
87
|
+
"profile": "registry/contracts/decision-events-v1alpha1.json",
|
|
88
|
+
"profileHash": "sha256:56440dde1b00c210b22761a0cba139ce0a20207330567777cebe1e48b494ceb0",
|
|
89
|
+
"permissions": [
|
|
90
|
+
"session.input.intercept",
|
|
91
|
+
"session.rewind.intercept",
|
|
92
|
+
"session.switch.intercept",
|
|
93
|
+
"session.compact.intercept"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "tui.channel",
|
|
98
|
+
"authority": "dsh-tui",
|
|
99
|
+
"coordinates": {
|
|
100
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
101
|
+
"kind": "Channel"
|
|
102
|
+
},
|
|
103
|
+
"kind": "capability",
|
|
104
|
+
"profile": "registry/contracts/tui-channel-v1alpha1.json",
|
|
105
|
+
"profileHash": "sha256:2d0668656d999a8cacd363cd3c76207f9392118be8a83e6dd5f81b54ae063fe6",
|
|
106
|
+
"permissions": []
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"extensions": [
|
|
110
|
+
{
|
|
111
|
+
"name": "workspace.provider",
|
|
112
|
+
"authority": "dsh-std",
|
|
113
|
+
"coordinates": {
|
|
114
|
+
"apiVersion": "workspace.dsh/v1alpha1",
|
|
115
|
+
"kind": "WorkspaceProvider"
|
|
116
|
+
},
|
|
117
|
+
"kind": "extension",
|
|
118
|
+
"package": "@dsh-std/workspace",
|
|
119
|
+
"permissions": []
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "tui.settings-section",
|
|
123
|
+
"authority": "dsh-tui",
|
|
124
|
+
"coordinates": {
|
|
125
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
126
|
+
"kind": "SettingsSection"
|
|
127
|
+
},
|
|
128
|
+
"kind": "extension",
|
|
129
|
+
"profile": "registry/contracts/settings-section-v1alpha1.json",
|
|
130
|
+
"profileHash": "sha256:685b0f17fe489f458e9b799811f61c42b858330584e95ecb97e7216b5be100ac",
|
|
131
|
+
"permissions": []
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "tui.scene",
|
|
135
|
+
"authority": "dsh-tui",
|
|
136
|
+
"coordinates": {
|
|
137
|
+
"apiVersion": "tui.dsh/v1alpha1",
|
|
138
|
+
"kind": "Scene"
|
|
139
|
+
},
|
|
140
|
+
"kind": "extension",
|
|
141
|
+
"profile": "registry/contracts/scene-v1alpha1.json",
|
|
142
|
+
"profileHash": "sha256:69ce3ae26d60dea2ed170376db8a1fb5860c94bd192c62681423c1d848ec2b26",
|
|
143
|
+
"permissions": []
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
"facetApiVersions": [
|
|
147
|
+
"v1alpha1"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
@@ -67,4 +67,11 @@ export declare const BRIDGE_SPINNER_FRAMES: string[];
|
|
|
67
67
|
export declare const BRIDGE_READY_INDICATOR = "\u00B7\u2714\uFE0E\u00B7";
|
|
68
68
|
/** Bridge failed indicator (`×`). */
|
|
69
69
|
export declare const BRIDGE_FAILED_INDICATOR = "\u00D7";
|
|
70
|
+
export declare const THINKING_SPINNER_FRAMES: string[];
|
|
71
|
+
export declare const THINKING_SPINNER_INTERVAL_MS = 80;
|
|
72
|
+
/** Thinking settled marker: anchor (`⚓`) — the static end-state glyph after
|
|
73
|
+
* the reasoning block stops streaming. U+2693 is Emoji_Presentation in
|
|
74
|
+
* ink/stringWidth, so it measures 2 columns; the braille spinner frames
|
|
75
|
+
* above are padded to the same width to keep the label stationary. */
|
|
76
|
+
export declare const THINKING_SETTLED_MARKER = "\u2693";
|
|
70
77
|
//# sourceMappingURL=figures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../../src/cc/figures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uEAAuE;AACvE,eAAO,MAAM,YAAY,QAA4C,CAAA;AAGrE,kDAAkD;AAClD,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,+BAA+B;AAC/B,eAAO,MAAM,IAAI,WAAW,CAAA;AAC5B,gDAAgD;AAChD,eAAO,MAAM,eAAe,WAAW,CAAA;AACvC,qEAAqE;AACrE,eAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,gCAAgC;AAChC,eAAO,MAAM,gBAAgB,WAAW,CAAA;AACxC,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,iDAAiD;AACjD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,sBAAsB;AACtB,eAAO,MAAM,QAAQ,WAAW,CAAA;AAChC,wBAAwB;AACxB,eAAO,MAAM,UAAU,WAAW,CAAA;AAClC,2CAA2C;AAC3C,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,qDAAqD;AACrD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,qCAAqC;AACrC,eAAO,MAAM,UAAU,WAAW,CAAA;AAClC,+CAA+C;AAC/C,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,WAAW,WAAW,CAAA;AACnC,sCAAsC;AACtC,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,0BAA0B;AAC1B,eAAO,MAAM,SAAS,WAAW,CAAA;AACjC,2BAA2B;AAC3B,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,uDAAuD;AACvD,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,mDAAmD;AACnD,eAAO,MAAM,YAAY,WAAW,CAAA;AACpC,qDAAqD;AACrD,eAAO,MAAM,cAAc,WAAW,CAAA;AACtC,iDAAiD;AACjD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,wCAAwC;AACxC,eAAO,MAAM,SAAS,WAAW,CAAA;AACjC,oDAAoD;AACpD,eAAO,MAAM,cAAc,WAAW,CAAA;AACtC,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,WAAW,CAAA;AAGxC,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,UAKjC,CAAA;AACD,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,6BAA6B,CAAA;AAChE,qCAAqC;AACrC,eAAO,MAAM,uBAAuB,WAAW,CAAA"}
|
|
1
|
+
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../../src/cc/figures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uEAAuE;AACvE,eAAO,MAAM,YAAY,QAA4C,CAAA;AAGrE,kDAAkD;AAClD,eAAO,MAAM,OAAO,WAAW,CAAA;AAC/B,+BAA+B;AAC/B,eAAO,MAAM,IAAI,WAAW,CAAA;AAC5B,gDAAgD;AAChD,eAAO,MAAM,eAAe,WAAW,CAAA;AACvC,qEAAqE;AACrE,eAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,gCAAgC;AAChC,eAAO,MAAM,gBAAgB,WAAW,CAAA;AACxC,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,iDAAiD;AACjD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,sBAAsB;AACtB,eAAO,MAAM,QAAQ,WAAW,CAAA;AAChC,wBAAwB;AACxB,eAAO,MAAM,UAAU,WAAW,CAAA;AAClC,2CAA2C;AAC3C,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,qDAAqD;AACrD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,qCAAqC;AACrC,eAAO,MAAM,UAAU,WAAW,CAAA;AAClC,+CAA+C;AAC/C,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,WAAW,WAAW,CAAA;AACnC,sCAAsC;AACtC,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,0BAA0B;AAC1B,eAAO,MAAM,SAAS,WAAW,CAAA;AACjC,2BAA2B;AAC3B,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,uDAAuD;AACvD,eAAO,MAAM,aAAa,WAAW,CAAA;AACrC,wCAAwC;AACxC,eAAO,MAAM,UAAU,WAAW,CAAA;AAGlC,mDAAmD;AACnD,eAAO,MAAM,YAAY,WAAW,CAAA;AACpC,qDAAqD;AACrD,eAAO,MAAM,cAAc,WAAW,CAAA;AACtC,iDAAiD;AACjD,eAAO,MAAM,cAAc,WAAW,CAAA;AAGtC,wCAAwC;AACxC,eAAO,MAAM,SAAS,WAAW,CAAA;AACjC,oDAAoD;AACpD,eAAO,MAAM,cAAc,WAAW,CAAA;AACtC,mCAAmC;AACnC,eAAO,MAAM,gBAAgB,WAAW,CAAA;AAGxC,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,UAKjC,CAAA;AACD,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,6BAA6B,CAAA;AAChE,qCAAqC;AACrC,eAAO,MAAM,uBAAuB,WAAW,CAAA;AAQ/C,eAAO,MAAM,uBAAuB,UAWnC,CAAA;AACD,eAAO,MAAM,4BAA4B,KAAK,CAAA;AAC9C;;;uEAGuE;AACvE,eAAO,MAAM,uBAAuB,WAAW,CAAA"}
|
package/lib/types/cc/figures.js
CHANGED
|
@@ -80,3 +80,27 @@ export const BRIDGE_SPINNER_FRAMES = [
|
|
|
80
80
|
export const BRIDGE_READY_INDICATOR = '\u00b7\u2714\ufe0e\u00b7';
|
|
81
81
|
/** Bridge failed indicator (`×`). */
|
|
82
82
|
export const BRIDGE_FAILED_INDICATOR = '\u00d7';
|
|
83
|
+
// Thinking spinner (Kimi Code style braille cycle, shown while reasoning
|
|
84
|
+
// streams; the static anchor takes over once the step settles). Each frame
|
|
85
|
+
// is padded to 2 columns (space BEFORE the braille glyph) so it matches the
|
|
86
|
+
// settled ⚓ anchor exactly — the spinner sits one column right, hugging the
|
|
87
|
+
// label like the anchor does, and a 1-col frame would shift the whole label
|
|
88
|
+
// right by one column the moment the step settles.
|
|
89
|
+
export const THINKING_SPINNER_FRAMES = [
|
|
90
|
+
' \u280b', // ⠋
|
|
91
|
+
' \u2819', // ⠙
|
|
92
|
+
' \u2839', // ⠹
|
|
93
|
+
' \u2838', // ⠸
|
|
94
|
+
' \u283c', // ⠼
|
|
95
|
+
' \u2834', // ⠴
|
|
96
|
+
' \u2826', // ⠦
|
|
97
|
+
' \u2827', // ⠧
|
|
98
|
+
' \u2807', // ⠇
|
|
99
|
+
' \u280f', // ⠏
|
|
100
|
+
];
|
|
101
|
+
export const THINKING_SPINNER_INTERVAL_MS = 80;
|
|
102
|
+
/** Thinking settled marker: anchor (`⚓`) — the static end-state glyph after
|
|
103
|
+
* the reasoning block stops streaming. U+2693 is Emoji_Presentation in
|
|
104
|
+
* ink/stringWidth, so it measures 2 columns; the braille spinner frames
|
|
105
|
+
* above are padded to the same width to keep the label stationary. */
|
|
106
|
+
export const THINKING_SETTLED_MARKER = '\u2693'; // ⚓
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/cc/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAA4B,KAAK,KAAK,EAAe,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../../src/cc/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAA4B,KAAK,KAAK,EAAe,MAAM,QAAQ,CAAA;AAO1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AA4BrD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAWtC;AAuCD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,KAAK,EACZ,SAAS,SAAI,EACb,iBAAiB,GAAE,MAAM,GAAG,IAAW,EACvC,MAAM,GAAE,KAAK,GAAG,IAAW,EAC3B,SAAS,GAAE,YAAY,GAAG,IAAW,GACpC,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,YAAY,GAAG,IAAW,GACpC,MAAM,CAgBR;AA2SD;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GACpD,MAAM,CAUR"}
|
package/lib/types/cc/markdown.js
CHANGED
|
@@ -18,6 +18,7 @@ import { stringWidth } from '../ink/stringWidth.js';
|
|
|
18
18
|
import { supportsHyperlinks } from '../ink/supports-hyperlinks.js';
|
|
19
19
|
import { colorize } from '../ink/colorize.js';
|
|
20
20
|
import { getActiveTheme } from '../theme.js';
|
|
21
|
+
import { buildSyntaxTheme } from './syntaxTheme.js';
|
|
21
22
|
import { logForDebugging } from '../utils/debug.js';
|
|
22
23
|
import { createHyperlink } from './hyperlink.js';
|
|
23
24
|
// '\n' is used unconditionally — os.EOL is '\r\n' on Windows, and the stray
|
|
@@ -112,7 +113,10 @@ export function applyMarkdown(content, highlight = null) {
|
|
|
112
113
|
.lexer(stripPromptXMLTags(content))
|
|
113
114
|
.map(token => dispatch(token, rootState))
|
|
114
115
|
.join('')
|
|
115
|
-
|
|
116
|
+
// trimEnd only: the input is already trimmed, so leading whitespace in
|
|
117
|
+
// the output is renderer-intended (e.g. the code block's 2-space indent
|
|
118
|
+
// on its first line). A full trim() would eat that first-line indent.
|
|
119
|
+
.trimEnd();
|
|
116
120
|
}
|
|
117
121
|
/**
|
|
118
122
|
* Type guard that narrows to the concrete marked token of `kind`.
|
|
@@ -176,19 +180,39 @@ function renderBlockquote(token, state) {
|
|
|
176
180
|
.join(EOL);
|
|
177
181
|
}
|
|
178
182
|
function renderCodeBlock(token, state) {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
// Kimi Code style: a muted ```lang opening line (language tag + boundary
|
|
184
|
+
// for unhighlighted blocks) + 2-space indent; no closing fence (syntax
|
|
185
|
+
// colors or the indent already mark the end, it only cost vertical space).
|
|
186
|
+
const theme = getActiveTheme();
|
|
187
|
+
const openFence = colorize('```' + (token.lang ?? ''), theme.subtle, 'foreground');
|
|
188
|
+
const indent = ' ';
|
|
189
|
+
const renderBody = () => {
|
|
190
|
+
if (!state.highlight) {
|
|
191
|
+
return token.text;
|
|
186
192
|
}
|
|
187
|
-
|
|
188
|
-
|
|
193
|
+
let language = 'plaintext';
|
|
194
|
+
if (token.lang) {
|
|
195
|
+
if (state.highlight.supportsLanguage(token.lang)) {
|
|
196
|
+
language = token.lang;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
logForDebugging(`Language not supported while highlighting code, falling back to plaintext: ${token.lang}`);
|
|
200
|
+
}
|
|
189
201
|
}
|
|
202
|
+
return state.highlight.highlight(token.text, { language, theme: buildSyntaxTheme(theme) });
|
|
203
|
+
};
|
|
204
|
+
// Strip ALL trailing newlines: trailing blank lines would otherwise leak a
|
|
205
|
+
// stray blank line at the end of the block.
|
|
206
|
+
const body = renderBody().replace(/\n+$/, '');
|
|
207
|
+
if (body === '') {
|
|
208
|
+
return `${openFence}${EOL}`;
|
|
190
209
|
}
|
|
191
|
-
return
|
|
210
|
+
return (openFence +
|
|
211
|
+
EOL +
|
|
212
|
+
body
|
|
213
|
+
.split(EOL)
|
|
214
|
+
.map(line => (line === '' ? line : indent + line))
|
|
215
|
+
.join(EOL) + EOL);
|
|
192
216
|
}
|
|
193
217
|
function renderEmphasis(token, state) {
|
|
194
218
|
const inner = token.tokens.map(child => dispatch(child, inlineChildren(state))).join('');
|
|
@@ -200,8 +224,14 @@ function renderStrong(token, state) {
|
|
|
200
224
|
}
|
|
201
225
|
function renderHeading(token, state) {
|
|
202
226
|
const text = token.tokens.map(child => dispatch(child, fresh(state))).join('');
|
|
203
|
-
// H1 gets the
|
|
204
|
-
|
|
227
|
+
// Blue-primary progression: H1 gets the mist brand blue + underline, H2 the
|
|
228
|
+
// lighter border blue, deeper levels stay bold near-text (kimi-style).
|
|
229
|
+
const theme = getActiveTheme();
|
|
230
|
+
const styled = token.depth === 1
|
|
231
|
+
? chalk.bold.underline(colorize(text, theme.claude, 'foreground'))
|
|
232
|
+
: token.depth === 2
|
|
233
|
+
? chalk.bold(colorize(text, theme.permission, 'foreground'))
|
|
234
|
+
: chalk.bold(text);
|
|
205
235
|
return styled + EOL + EOL;
|
|
206
236
|
}
|
|
207
237
|
function renderLink(token, state) {
|
|
@@ -251,7 +281,10 @@ function renderText(token, state) {
|
|
|
251
281
|
const body = token.tokens
|
|
252
282
|
? token.tokens.map(child => dispatch(child, withParent(state, token))).join('')
|
|
253
283
|
: linkifyIssueReferences(token.text);
|
|
254
|
-
|
|
284
|
+
// Blue bullet marker: list structure gets a tint without loading the
|
|
285
|
+
// whole item (kimi-style `•` in the accent color).
|
|
286
|
+
const tinted = colorize(bullet, getActiveTheme().permission, 'foreground');
|
|
287
|
+
return `${tinted} ${body}${EOL}`;
|
|
255
288
|
}
|
|
256
289
|
return linkifyIssueReferences(token.text);
|
|
257
290
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CliHighlight } from './cliHighlight.js';
|
|
2
|
+
import type { Theme } from '../theme.js';
|
|
3
|
+
export type SyntaxRun = {
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly color?: string;
|
|
6
|
+
};
|
|
7
|
+
export type SyntaxLines = readonly (readonly SyntaxRun[])[];
|
|
8
|
+
type SyntaxTheme = Theme | Record<string, (text: string) => string>;
|
|
9
|
+
/** Parse ANSI once, preserving active syntax colors over embedded newlines. */
|
|
10
|
+
export declare function parseAnsiRuns(text: string): SyntaxRun[];
|
|
11
|
+
export declare function splitRunsToLines(runs: readonly SyntaxRun[]): SyntaxLines;
|
|
12
|
+
/** Highlight complete text, then split it; unsupported or failed languages are plain. */
|
|
13
|
+
export declare function highlightLines(text: string, language: string | undefined, highlighter: CliHighlight | null, theme: SyntaxTheme | undefined, themeSig: string): SyntaxLines | undefined;
|
|
14
|
+
export declare function syntaxThemeSignature(theme: Theme): string;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=syntaxRuns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntaxRuns.d.ts","sourceRoot":"","sources":["../../../src/cc/syntaxRuns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,MAAM,SAAS,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAC1E,MAAM,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,SAAS,EAAE,CAAC,EAAE,CAAA;AAC3D,KAAK,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;AASnE,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,CAmBvD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,WAAW,CAUxE;AAKD,yFAAyF;AACzF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,WAAW,EAAE,YAAY,GAAG,IAAI,EAChC,KAAK,EAAE,WAAW,GAAG,SAAS,EAC9B,QAAQ,EAAE,MAAM,GACf,WAAW,GAAG,SAAS,CAoBzB;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAGzD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { SYNTAX_CLASS_TO_TOKEN, buildSyntaxTheme } from './syntaxTheme.js';
|
|
2
|
+
const ANSI16 = {
|
|
3
|
+
30: 'rgb(0,0,0)', 31: 'rgb(128,0,0)', 32: 'rgb(0,128,0)', 33: 'rgb(128,128,0)',
|
|
4
|
+
34: 'rgb(0,0,128)', 35: 'rgb(128,0,128)', 36: 'rgb(0,128,128)', 37: 'rgb(192,192,192)',
|
|
5
|
+
90: 'rgb(128,128,128)', 91: 'rgb(255,0,0)', 92: 'rgb(0,255,0)', 93: 'rgb(255,255,0)',
|
|
6
|
+
94: 'rgb(0,0,255)', 95: 'rgb(255,0,255)', 96: 'rgb(0,255,255)', 97: 'rgb(255,255,255)',
|
|
7
|
+
};
|
|
8
|
+
/** Parse ANSI once, preserving active syntax colors over embedded newlines. */
|
|
9
|
+
export function parseAnsiRuns(text) {
|
|
10
|
+
const runs = [];
|
|
11
|
+
let color;
|
|
12
|
+
let rest = text;
|
|
13
|
+
// eslint-disable-next-line no-control-regex -- parsing SGR is intentional
|
|
14
|
+
const sgr = /\x1b\[([0-9;]+)m/;
|
|
15
|
+
while (rest.length > 0) {
|
|
16
|
+
const match = sgr.exec(rest);
|
|
17
|
+
const chunk = match === null ? rest : rest.slice(0, match.index);
|
|
18
|
+
if (chunk !== '')
|
|
19
|
+
runs.push(color === undefined ? { text: chunk } : { text: chunk, color });
|
|
20
|
+
if (match === null)
|
|
21
|
+
break;
|
|
22
|
+
const codes = match[1].split(';').map(Number);
|
|
23
|
+
if (codes.includes(0) || codes.includes(39))
|
|
24
|
+
color = undefined;
|
|
25
|
+
else if (codes[0] === 38 && codes[1] === 2 && codes.length >= 5)
|
|
26
|
+
color = `rgb(${codes[2]},${codes[3]},${codes[4]})`;
|
|
27
|
+
else if (codes[0] === 38 && codes[1] === 5 && codes.length >= 3)
|
|
28
|
+
color = `ansi256(${codes[2]})`;
|
|
29
|
+
else if (codes.length === 1 && ANSI16[codes[0]] !== undefined)
|
|
30
|
+
color = ANSI16[codes[0]];
|
|
31
|
+
rest = rest.slice(match.index + match[0].length);
|
|
32
|
+
}
|
|
33
|
+
return runs;
|
|
34
|
+
}
|
|
35
|
+
export function splitRunsToLines(runs) {
|
|
36
|
+
const lines = [[]];
|
|
37
|
+
for (const run of runs) {
|
|
38
|
+
const parts = run.text.split('\n');
|
|
39
|
+
for (let i = 0; i < parts.length; i++) {
|
|
40
|
+
if (i > 0)
|
|
41
|
+
lines.push([]);
|
|
42
|
+
if (parts[i] !== '')
|
|
43
|
+
lines[lines.length - 1].push(run.color === undefined ? { text: parts[i] } : { text: parts[i], color: run.color });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return lines;
|
|
47
|
+
}
|
|
48
|
+
const syntaxCache = new Map();
|
|
49
|
+
const SYNTAX_CACHE_MAX = 64;
|
|
50
|
+
/** Highlight complete text, then split it; unsupported or failed languages are plain. */
|
|
51
|
+
export function highlightLines(text, language, highlighter, theme, themeSig) {
|
|
52
|
+
if (highlighter === null || theme === undefined || language === undefined || text === '' || !highlighter.supportsLanguage(language))
|
|
53
|
+
return undefined;
|
|
54
|
+
const key = `${themeSig}\u0000${language}\u0000${text}`;
|
|
55
|
+
const cached = syntaxCache.get(key);
|
|
56
|
+
if (cached !== undefined)
|
|
57
|
+
return cached;
|
|
58
|
+
try {
|
|
59
|
+
const themeOption = 'syntaxKeyword' in theme
|
|
60
|
+
? buildSyntaxTheme(theme)
|
|
61
|
+
: theme;
|
|
62
|
+
const highlighted = highlighter.highlight(text, { language, theme: themeOption });
|
|
63
|
+
const lines = splitRunsToLines(parseAnsiRuns(highlighted));
|
|
64
|
+
if (syntaxCache.size >= SYNTAX_CACHE_MAX) {
|
|
65
|
+
const first = syntaxCache.keys().next().value;
|
|
66
|
+
if (first !== undefined)
|
|
67
|
+
syntaxCache.delete(first);
|
|
68
|
+
}
|
|
69
|
+
syntaxCache.set(key, lines);
|
|
70
|
+
return lines;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export function syntaxThemeSignature(theme) {
|
|
77
|
+
const palette = theme;
|
|
78
|
+
return Object.values(SYNTAX_CLASS_TO_TOKEN).map(key => palette[key] ?? '').join('|');
|
|
79
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Theme } from '../theme.js';
|
|
2
|
+
/** highlight.js token classes -> theme syntax tokens. `default` catches
|
|
3
|
+
* every unmapped class so cli-highlight's own yellow never leaks through
|
|
4
|
+
* (issue #250, P2-6). */
|
|
5
|
+
export declare const SYNTAX_CLASS_TO_TOKEN: Record<string, string>;
|
|
6
|
+
/** chalk style for one raw theme value. Accepts every form the theme
|
|
7
|
+
* loader documents: #rgb, #rrggbb, #rrggbbaa (alpha stripped), rgb() with
|
|
8
|
+
* or without spaces, ansi256(n), ansi:name (issue #250, P2-5). */
|
|
9
|
+
export declare function chalkFromToken(token: string): (text: string) => string;
|
|
10
|
+
/** Build the cli-highlight `theme` option from an active theme palette. */
|
|
11
|
+
export declare function buildSyntaxTheme(theme: Theme): Record<string, (text: string) => string>;
|
|
12
|
+
//# sourceMappingURL=syntaxTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"syntaxTheme.d.ts","sourceRoot":"","sources":["../../../src/cc/syntaxTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAQxC;;0BAE0B;AAC1B,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA4BxD,CAAA;AAED;;mEAEmE;AACnE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAmBtE;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,KAAK,GACX,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAQ1C"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
// --- syntax highlighting theme bridge ----------------------------------------
|
|
3
|
+
// Shared by SplitDiffView (diff panes) and the markdown renderer (fenced
|
|
4
|
+
// code blocks). Both feed cli-highlight's `theme` option so code colors come
|
|
5
|
+
// from the active dsh-tui theme instead of cli-highlight's own sparse
|
|
6
|
+
// default palette.
|
|
7
|
+
/** highlight.js token classes -> theme syntax tokens. `default` catches
|
|
8
|
+
* every unmapped class so cli-highlight's own yellow never leaks through
|
|
9
|
+
* (issue #250, P2-6). */
|
|
10
|
+
export const SYNTAX_CLASS_TO_TOKEN = {
|
|
11
|
+
keyword: 'syntaxKeyword',
|
|
12
|
+
built_in: 'syntaxKeyword',
|
|
13
|
+
literal: 'syntaxKeyword',
|
|
14
|
+
string: 'syntaxString',
|
|
15
|
+
subst: 'syntaxString',
|
|
16
|
+
quote: 'syntaxString',
|
|
17
|
+
comment: 'syntaxComment',
|
|
18
|
+
number: 'syntaxNumber',
|
|
19
|
+
title: 'syntaxFunction',
|
|
20
|
+
'title.function_': 'syntaxFunction',
|
|
21
|
+
function: 'syntaxFunction',
|
|
22
|
+
'title.class_': 'syntaxType',
|
|
23
|
+
type: 'syntaxType',
|
|
24
|
+
class: 'syntaxType',
|
|
25
|
+
tag: 'syntaxType',
|
|
26
|
+
name: 'syntaxType',
|
|
27
|
+
attr: 'syntaxVariable',
|
|
28
|
+
attribute: 'syntaxVariable',
|
|
29
|
+
variable: 'syntaxVariable',
|
|
30
|
+
'template-variable': 'syntaxVariable',
|
|
31
|
+
params: 'syntaxVariable',
|
|
32
|
+
operator: 'syntaxOperator',
|
|
33
|
+
punctuation: 'syntaxPunctuation',
|
|
34
|
+
meta: 'syntaxPunctuation',
|
|
35
|
+
symbol: 'syntaxConstant',
|
|
36
|
+
regexp: 'syntaxConstant',
|
|
37
|
+
default: 'syntaxVariable',
|
|
38
|
+
};
|
|
39
|
+
/** chalk style for one raw theme value. Accepts every form the theme
|
|
40
|
+
* loader documents: #rgb, #rrggbb, #rrggbbaa (alpha stripped), rgb() with
|
|
41
|
+
* or without spaces, ansi256(n), ansi:name (issue #250, P2-5). */
|
|
42
|
+
export function chalkFromToken(token) {
|
|
43
|
+
let match = /^#([0-9a-fA-F]{3})$/.exec(token);
|
|
44
|
+
if (match !== null) {
|
|
45
|
+
const [r, g, b] = match[1].split('').map(c => parseInt(c + c, 16));
|
|
46
|
+
return chalk.rgb(r, g, b);
|
|
47
|
+
}
|
|
48
|
+
match = /^#([0-9a-fA-F]{6})(?:[0-9a-fA-F]{2})?$/.exec(token);
|
|
49
|
+
if (match !== null)
|
|
50
|
+
return chalk.hex(`#${match[1]}`);
|
|
51
|
+
match = /^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/.exec(token);
|
|
52
|
+
if (match !== null)
|
|
53
|
+
return chalk.rgb(Number(match[1]), Number(match[2]), Number(match[3]));
|
|
54
|
+
match = /^ansi256\((\d+)\)$/.exec(token);
|
|
55
|
+
if (match !== null)
|
|
56
|
+
return chalk.ansi256(Number(match[1]));
|
|
57
|
+
match = /^ansi:(\w+)$/.exec(token);
|
|
58
|
+
if (match !== null) {
|
|
59
|
+
const name = match[1] === 'blackBright' ? 'gray' : match[1];
|
|
60
|
+
const style = chalk[name];
|
|
61
|
+
if (style !== undefined)
|
|
62
|
+
return style;
|
|
63
|
+
}
|
|
64
|
+
return (text) => text;
|
|
65
|
+
}
|
|
66
|
+
/** Build the cli-highlight `theme` option from an active theme palette. */
|
|
67
|
+
export function buildSyntaxTheme(theme) {
|
|
68
|
+
const palette = theme;
|
|
69
|
+
const out = {};
|
|
70
|
+
for (const [tokenClass, tokenKey] of Object.entries(SYNTAX_CLASS_TO_TOKEN)) {
|
|
71
|
+
const value = palette[tokenKey];
|
|
72
|
+
if (value !== undefined)
|
|
73
|
+
out[tokenClass] = chalkFromToken(value);
|
|
74
|
+
}
|
|
75
|
+
return out;
|
|
76
|
+
}
|