@deepseek-harness-tui/dsh-tui 0.9.1 → 0.9.3
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 +14 -4
- package/bin/dsh-tui.js +26 -4
- 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/commands.d.ts.map +1 -1
- package/lib/types/commands.js +7 -8
- package/lib/types/components/BalanceReportRow.d.ts +24 -0
- package/lib/types/components/BalanceReportRow.d.ts.map +1 -0
- package/lib/types/components/BalanceReportRow.js +87 -0
- package/lib/types/components/HistorySearchDialog.js +1 -1
- package/lib/types/components/MessageList.d.ts +3 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +11 -7
- package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
- package/lib/types/components/PluginSceneBoundary.js +1 -1
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +16 -0
- package/lib/types/components/Whale.d.ts +15 -4
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +9 -8
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts +7 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +34 -4
- package/lib/types/deepseekBalance.d.ts +53 -0
- package/lib/types/deepseekBalance.d.ts.map +1 -0
- package/lib/types/deepseekBalance.js +86 -0
- package/lib/types/deepseekPricing.d.ts +82 -0
- package/lib/types/deepseekPricing.d.ts.map +1 -0
- package/lib/types/deepseekPricing.js +133 -0
- package/lib/types/dsh-adapter/channel.d.ts +46 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +84 -10
- package/lib/types/dsh-adapter/index.d.ts +5 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +1 -0
- package/lib/types/dsh-adapter/packaged-skills.d.ts +9 -0
- package/lib/types/dsh-adapter/packaged-skills.d.ts.map +1 -1
- package/lib/types/dsh-adapter/packaged-skills.js +19 -4
- package/lib/types/dsh-adapter/plugin.d.ts +6 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +122 -18
- package/lib/types/dsh-adapter/settings-sections.d.ts +1 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +35 -2
- package/lib/types/history.d.ts +4 -3
- package/lib/types/history.d.ts.map +1 -1
- package/lib/types/history.js +66 -18
- package/lib/types/i18n.d.ts +122 -55
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +39 -18
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +67 -17
- package/lib/types/ink/root.d.ts +16 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +2 -0
- package/lib/types/ink/terminal-querier.d.ts +8 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +13 -0
- package/lib/types/ink/terminal.d.ts +42 -0
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +52 -2
- package/lib/types/plugin-spec/registry.d.ts +1 -1
- package/lib/types/plugin-spec/registry.js +1 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +72 -37
- package/lib/types/screens/SessionBrowser.d.ts.map +1 -1
- package/lib/types/screens/SessionBrowser.js +28 -13
- package/lib/types/screens/SessionTree.d.ts.map +1 -1
- package/lib/types/screens/SessionTree.js +33 -9
- package/lib/types/screens/Settings.d.ts +7 -5
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +206 -99
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +32 -1
- package/lib/types/sessionHistory.d.ts +11 -0
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +29 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +14 -4
- package/lib/types/tips.js +2 -2
- package/lib/types/tuiDisplayPrefs.d.ts +3 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +1 -0
- package/lib/types/update.d.ts +66 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +346 -3
- package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +21 -21
- package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +44 -44
- 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 +95 -5
- package/skills/pr-comments/SKILL.md +1 -1
- 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/README.md
CHANGED
|
@@ -49,10 +49,11 @@
|
|
|
49
49
|
</tr>
|
|
50
50
|
</table>
|
|
51
51
|
</div>
|
|
52
|
+
|
|
52
53
|
## 核心能力
|
|
53
54
|
|
|
54
55
|
- **终端交互**:低资源占用,长会话稳定可靠;多种主题切换,样式美观,实时显示工作状态、TPS、缓存命中率等
|
|
55
|
-
推理等级、输入/输出 token 与 Git
|
|
56
|
+
推理等级、输入/输出 token 与 Git/会话信息;终端卡多行命令可经 `/settings` 折叠为首行 + 计数提示(Ctrl+O 或点击卡片展开)。
|
|
56
57
|
- **功能全面**:`/resume`、`/new`、`/compact`、`/export`、`/btw`,模型热切换,原生subagent,会话fork,自动更新;可在vs code中[以vscode插件形式启动](docs/vscode.md),已上架 VS Code Marketplace。
|
|
57
58
|
- **扩展丰富**:原生浏览器交互,compter use等大量附属功能性扩展
|
|
58
59
|
|
|
@@ -105,6 +106,16 @@ sh install.sh
|
|
|
105
106
|
# 之后 dsh-tui 与 dsh --profile dsh-tui 等价
|
|
106
107
|
```
|
|
107
108
|
|
|
109
|
+
> **新用户提示**:若 `dsh plugin` 安装时报 `ERR_PNPM_IGNORED_BUILDS`(pnpm ≥11 默认阻止带安装脚本的依赖,如 `@google/genai`、`protobufjs`——这些脚本运行时不需要,忽略即可),在 profile 的 `pnpm-workspace.yaml` 里加入:
|
|
110
|
+
>
|
|
111
|
+
> ```yaml
|
|
112
|
+
> allowBuilds:
|
|
113
|
+
> '@google/genai': false
|
|
114
|
+
> protobufjs: false
|
|
115
|
+
> ```
|
|
116
|
+
>
|
|
117
|
+
> `/update` 与 `dsh-tui update` 会自动写入这份配置,无需手工处理。
|
|
118
|
+
|
|
108
119
|
更面向零基础的安装流程、profile 叠加机制、源码构建与常见问题见[安装与快速开始](docs/getting-started.md)。
|
|
109
120
|
|
|
110
121
|
|
|
@@ -113,8 +124,7 @@ sh install.sh
|
|
|
113
124
|
|
|
114
125
|
想为 dsh-TUI 做插件/扩展?欢迎加入生态!
|
|
115
126
|
|
|
116
|
-
-
|
|
117
|
-
- **插件开发指南**:[`docs/plugins.md`](docs/plugins.md)(接缝、契约、规范与验证清单)
|
|
127
|
+
- **接口与兼容性协定 / 插件开发指南**:[终端交互生态插件准入与开发指南](https://github.com/T-Auto/dsh-ecosystem-spec/blob/main/docs/plugin-admission-and-development.md)(准入规范、接缝、契约、验证清单)
|
|
118
128
|
- **生态组织**:[dsh-tui-ecosystem](https://github.com/dsh-tui-ecosystem)(社区插件与模板的家)
|
|
119
129
|
- **模板仓库**:[plugin-template](https://github.com/dsh-tui-ecosystem/plugin-template)(从模板起步,5 分钟出一个插件)
|
|
120
130
|
- **参考实现**:`dsh-working-activity`(实时工作状态行:TUI 槽位 + `activity/status` 会话事件双出口)
|
|
@@ -132,7 +142,7 @@ sh install.sh
|
|
|
132
142
|
| [架构与限制](docs/architecture.md) | 运行链路、渲染与持久化设计、安全边界、已知限制 |
|
|
133
143
|
| [VS Code 使用指南](docs/vscode.md) | 在 VS Code 集成终端运行 dsh-tui;companion 扩展 `dsh-tui-vscode` 提供与 Claude Code 官方扩展几乎一致的体验(已上架 Marketplace) |
|
|
134
144
|
| [贡献与开发约定](docs/contributing.md) | 贡献流程、仓库地图、构建产物、验证矩阵与修改规则 |
|
|
135
|
-
| [
|
|
145
|
+
| [插件准入与开发指南](https://github.com/T-Auto/dsh-ecosystem-spec/blob/main/docs/plugin-admission-and-development.md) | 接口与兼容性协定 / 插件准入规范 / 插件接缝 / 契约 / 验证清单(已并入 dsh-ecosystem-spec) |
|
|
136
146
|
|
|
137
147
|
完整的中英文索引见 [`docs/README.md`](docs/README.md)。
|
|
138
148
|
|
package/bin/dsh-tui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* dsh-tui — 双态启动器(delegating launcher,0.9.
|
|
3
|
+
* dsh-tui — 双态启动器(delegating launcher,0.9.3)。
|
|
4
4
|
*
|
|
5
5
|
* 同一个文件按“自己住在哪”决定扮演的角色:
|
|
6
6
|
*
|
|
@@ -28,13 +28,29 @@
|
|
|
28
28
|
* `DSH_TUI_LANG` 显式指定时从其值,否则默认中文(同 src/i18n.ts 的缺省)。
|
|
29
29
|
*/
|
|
30
30
|
import { spawn, spawnSync } from 'node:child_process'
|
|
31
|
-
import { existsSync, readFileSync, realpathSync } from 'node:fs'
|
|
31
|
+
import { existsSync, readFileSync, realpathSync, rmSync } from 'node:fs'
|
|
32
32
|
import { homedir } from 'node:os'
|
|
33
33
|
import { dirname, isAbsolute, join, resolve } from 'node:path'
|
|
34
34
|
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
35
35
|
|
|
36
|
+
if (process.platform === 'win32' && process.env.DSH_TUI_STANDALONE_BINARY) {
|
|
37
|
+
try {
|
|
38
|
+
const oldBinary = `${process.env.DSH_TUI_STANDALONE_BINARY}.old`
|
|
39
|
+
if (existsSync(oldBinary)) rmSync(oldBinary, { force: true })
|
|
40
|
+
} catch {
|
|
41
|
+
// Best effort cleanup.
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
36
45
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
37
46
|
const ownDir = dirname(here)
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Read and parse a JSON file safely.
|
|
50
|
+
*
|
|
51
|
+
* @param {string} p - File path to parse.
|
|
52
|
+
* @returns {any} Parsed JSON content or undefined.
|
|
53
|
+
*/
|
|
38
54
|
const readJson = p => {
|
|
39
55
|
try {
|
|
40
56
|
return JSON.parse(readFileSync(p, 'utf8'))
|
|
@@ -50,6 +66,12 @@ const PROFILE = 'dsh-tui'
|
|
|
50
66
|
// --- 内联小工具(见文件头:零 lib 依赖是迁移契约的一部分)---------------------
|
|
51
67
|
// 与 lib/types/utils/shellQuote.js 同语义的最小实现:cmd.exe 以空格拼接参数
|
|
52
68
|
// 且不做转义,含空格/引号的参数必须整体加引号(内层引号与反斜杠转义)。
|
|
69
|
+
/**
|
|
70
|
+
* Quote an array of arguments for cmd.exe.
|
|
71
|
+
*
|
|
72
|
+
* @param {string[]} args - Argument tokens.
|
|
73
|
+
* @returns {string[]} Quoted argument tokens.
|
|
74
|
+
*/
|
|
53
75
|
const shellQuote = args =>
|
|
54
76
|
args.map(arg => {
|
|
55
77
|
const s = String(arg)
|
|
@@ -190,7 +212,7 @@ const MSG = {
|
|
|
190
212
|
},
|
|
191
213
|
helpText: {
|
|
192
214
|
en:
|
|
193
|
-
`Usage: dsh-tui [command] [options] [path|url]\n\n` +
|
|
215
|
+
`Usage: dsh-tui|dst [command] [options] [path|url]\n\n` +
|
|
194
216
|
`Commands:\n` +
|
|
195
217
|
` update Update the ${PROFILE} profile to the latest release\n` +
|
|
196
218
|
` doctor Pre-flight environment checks (dsh/pnpm/profile/key)\n` +
|
|
@@ -202,7 +224,7 @@ const MSG = {
|
|
|
202
224
|
` <path|url> Open with the given workspace target\n\n` +
|
|
203
225
|
`Any other argument is forwarded to \`dsh --profile ${PROFILE}\`.`,
|
|
204
226
|
zh:
|
|
205
|
-
`用法:dsh-tui [命令] [选项] [路径|URL]\n\n` +
|
|
227
|
+
`用法:dsh-tui|dst [命令] [选项] [路径|URL]\n\n` +
|
|
206
228
|
`命令:\n` +
|
|
207
229
|
` update 将 ${PROFILE} profile 升级到最新版本\n` +
|
|
208
230
|
` doctor 启动前环境诊断(dsh/pnpm/profile/密钥)\n` +
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { ApiReference, ProtocolCatalog, ProtocolDefinition } from '@dsh-std/core'
|
|
2
|
-
export { registerTuiContributionExtensions } from './tui-contributions.js'
|
|
3
|
-
export * from './tui-channel.js'
|
|
4
|
-
|
|
5
|
-
export const DECISION_EVENTS: Readonly<ApiReference & {
|
|
6
|
-
apiVersion: 'tui.dsh/v1alpha1'
|
|
7
|
-
kind: 'DecisionEvents'
|
|
8
|
-
}>
|
|
9
|
-
|
|
10
|
-
export const decisionEventsDefinition: ProtocolDefinition
|
|
11
|
-
export const profileDefinitions: readonly ProtocolDefinition[]
|
|
12
|
-
|
|
13
|
-
export function registerProfileProtocols(catalog: ProtocolCatalog): () => void
|
|
1
|
+
import type { ApiReference, ProtocolCatalog, ProtocolDefinition } from '@dsh-std/core'
|
|
2
|
+
export { registerTuiContributionExtensions } from './tui-contributions.js'
|
|
3
|
+
export * from './tui-channel.js'
|
|
4
|
+
|
|
5
|
+
export const DECISION_EVENTS: Readonly<ApiReference & {
|
|
6
|
+
apiVersion: 'tui.dsh/v1alpha1'
|
|
7
|
+
kind: 'DecisionEvents'
|
|
8
|
+
}>
|
|
9
|
+
|
|
10
|
+
export const decisionEventsDefinition: ProtocolDefinition
|
|
11
|
+
export const profileDefinitions: readonly ProtocolDefinition[]
|
|
12
|
+
|
|
13
|
+
export function registerProfileProtocols(catalog: ProtocolCatalog): () => void
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
/** dsh-TUI private protocol definitions evaluated by @dsh-std/core. */
|
|
2
|
-
|
|
3
|
-
export { registerTuiContributionExtensions } from './tui-contributions.js'
|
|
4
|
-
export * from './tui-channel.js'
|
|
5
|
-
import { tuiChannelDefinition } from './tui-channel.js'
|
|
6
|
-
|
|
7
|
-
export const DECISION_EVENTS = Object.freeze({
|
|
8
|
-
apiVersion: 'tui.dsh/v1alpha1',
|
|
9
|
-
kind: 'DecisionEvents',
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
function featureSupport(value, label) {
|
|
13
|
-
if (value === undefined) return Object.freeze({ features: Object.freeze([]) })
|
|
14
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
15
|
-
throw new TypeError(`${label} support spec must be an object`)
|
|
16
|
-
}
|
|
17
|
-
const unknown = Object.keys(value).filter(key => key !== 'features' && !key.startsWith('x-'))
|
|
18
|
-
if (unknown.length > 0) throw new TypeError(`${label} support spec contains unknown field ${JSON.stringify(unknown[0])}`)
|
|
19
|
-
if (value.features !== undefined && (!Array.isArray(value.features)
|
|
20
|
-
|| value.features.some(feature => typeof feature !== 'string' || feature.trim() === ''))) {
|
|
21
|
-
throw new TypeError(`${label} support spec.features must be an array of non-empty strings`)
|
|
22
|
-
}
|
|
23
|
-
return Object.freeze({ features: Object.freeze([...(value.features ?? [])].sort()) })
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function providerDefinition(reference, label) {
|
|
27
|
-
return Object.freeze({
|
|
28
|
-
...reference,
|
|
29
|
-
validateRequirement(value) {
|
|
30
|
-
if (value !== undefined) throw new TypeError(`${label} requirement does not accept spec in manifest v0.15`)
|
|
31
|
-
return undefined
|
|
32
|
-
},
|
|
33
|
-
validateSupport(value) { return featureSupport(value, label) },
|
|
34
|
-
negotiate(input) {
|
|
35
|
-
const providers = [...new Set(input.supports.map(row => row.participant))].sort()
|
|
36
|
-
const issues = input.requirements.flatMap(row => providers.length === 0
|
|
37
|
-
? [{
|
|
38
|
-
code: row.requirement.optional === true ? 'optional-support-missing' : 'required-support-missing',
|
|
39
|
-
severity: row.requirement.optional === true ? 'warning' : 'error',
|
|
40
|
-
participant: row.participant,
|
|
41
|
-
message: `${label} has no provider in this negotiation scope`,
|
|
42
|
-
}]
|
|
43
|
-
: [])
|
|
44
|
-
return { agreement: Object.freeze({ providers: Object.freeze(providers) }), issues: Object.freeze(issues) }
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export const decisionEventsDefinition = providerDefinition(DECISION_EVENTS, 'DecisionEvents')
|
|
50
|
-
|
|
51
|
-
export const profileDefinitions = Object.freeze([
|
|
52
|
-
decisionEventsDefinition,
|
|
53
|
-
tuiChannelDefinition,
|
|
54
|
-
])
|
|
55
|
-
|
|
56
|
-
export function registerProfileProtocols(catalog) {
|
|
57
|
-
const disposers = profileDefinitions.map(definition => catalog.register(definition))
|
|
58
|
-
return () => { for (const dispose of disposers.reverse()) dispose() }
|
|
59
|
-
}
|
|
1
|
+
/** dsh-TUI private protocol definitions evaluated by @dsh-std/core. */
|
|
2
|
+
|
|
3
|
+
export { registerTuiContributionExtensions } from './tui-contributions.js'
|
|
4
|
+
export * from './tui-channel.js'
|
|
5
|
+
import { tuiChannelDefinition } from './tui-channel.js'
|
|
6
|
+
|
|
7
|
+
export const DECISION_EVENTS = Object.freeze({
|
|
8
|
+
apiVersion: 'tui.dsh/v1alpha1',
|
|
9
|
+
kind: 'DecisionEvents',
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
function featureSupport(value, label) {
|
|
13
|
+
if (value === undefined) return Object.freeze({ features: Object.freeze([]) })
|
|
14
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
15
|
+
throw new TypeError(`${label} support spec must be an object`)
|
|
16
|
+
}
|
|
17
|
+
const unknown = Object.keys(value).filter(key => key !== 'features' && !key.startsWith('x-'))
|
|
18
|
+
if (unknown.length > 0) throw new TypeError(`${label} support spec contains unknown field ${JSON.stringify(unknown[0])}`)
|
|
19
|
+
if (value.features !== undefined && (!Array.isArray(value.features)
|
|
20
|
+
|| value.features.some(feature => typeof feature !== 'string' || feature.trim() === ''))) {
|
|
21
|
+
throw new TypeError(`${label} support spec.features must be an array of non-empty strings`)
|
|
22
|
+
}
|
|
23
|
+
return Object.freeze({ features: Object.freeze([...(value.features ?? [])].sort()) })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function providerDefinition(reference, label) {
|
|
27
|
+
return Object.freeze({
|
|
28
|
+
...reference,
|
|
29
|
+
validateRequirement(value) {
|
|
30
|
+
if (value !== undefined) throw new TypeError(`${label} requirement does not accept spec in manifest v0.15`)
|
|
31
|
+
return undefined
|
|
32
|
+
},
|
|
33
|
+
validateSupport(value) { return featureSupport(value, label) },
|
|
34
|
+
negotiate(input) {
|
|
35
|
+
const providers = [...new Set(input.supports.map(row => row.participant))].sort()
|
|
36
|
+
const issues = input.requirements.flatMap(row => providers.length === 0
|
|
37
|
+
? [{
|
|
38
|
+
code: row.requirement.optional === true ? 'optional-support-missing' : 'required-support-missing',
|
|
39
|
+
severity: row.requirement.optional === true ? 'warning' : 'error',
|
|
40
|
+
participant: row.participant,
|
|
41
|
+
message: `${label} has no provider in this negotiation scope`,
|
|
42
|
+
}]
|
|
43
|
+
: [])
|
|
44
|
+
return { agreement: Object.freeze({ providers: Object.freeze(providers) }), issues: Object.freeze(issues) }
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const decisionEventsDefinition = providerDefinition(DECISION_EVENTS, 'DecisionEvents')
|
|
50
|
+
|
|
51
|
+
export const profileDefinitions = Object.freeze([
|
|
52
|
+
decisionEventsDefinition,
|
|
53
|
+
tuiChannelDefinition,
|
|
54
|
+
])
|
|
55
|
+
|
|
56
|
+
export function registerProfileProtocols(catalog) {
|
|
57
|
+
const disposers = profileDefinitions.map(definition => catalog.register(definition))
|
|
58
|
+
return () => { for (const dispose of disposers.reverse()) dispose() }
|
|
59
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export const TUI_CHANNEL_HTTP_API_VERSION: 'tui.dsh/v1alpha1'
|
|
2
|
-
export const TUI_CHANNEL_HTTP_KIND: 'ChannelEndpoint'
|
|
3
|
-
export const TUI_CHANNEL_HTTP_HEALTH_PATH: '/dsh-tui/v1/health'
|
|
4
|
-
export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH: '/dsh-tui/v1/endpoint'
|
|
5
|
-
export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH: '/dsh-tui/v1/connection'
|
|
6
|
-
|
|
7
|
-
export interface TuiChannelEndpointDescriptor {
|
|
8
|
-
readonly apiVersion: typeof TUI_CHANNEL_HTTP_API_VERSION
|
|
9
|
-
readonly kind: typeof TUI_CHANNEL_HTTP_KIND
|
|
10
|
-
readonly origin: string
|
|
11
|
-
readonly connection: typeof TUI_CHANNEL_HTTP_WEBSOCKET_PATH
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function createTuiChannelEndpointDescriptor(origin: string): TuiChannelEndpointDescriptor
|
|
15
|
-
export function validateTuiChannelEndpointDescriptor(value: unknown): TuiChannelEndpointDescriptor
|
|
1
|
+
export const TUI_CHANNEL_HTTP_API_VERSION: 'tui.dsh/v1alpha1'
|
|
2
|
+
export const TUI_CHANNEL_HTTP_KIND: 'ChannelEndpoint'
|
|
3
|
+
export const TUI_CHANNEL_HTTP_HEALTH_PATH: '/dsh-tui/v1/health'
|
|
4
|
+
export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH: '/dsh-tui/v1/endpoint'
|
|
5
|
+
export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH: '/dsh-tui/v1/connection'
|
|
6
|
+
|
|
7
|
+
export interface TuiChannelEndpointDescriptor {
|
|
8
|
+
readonly apiVersion: typeof TUI_CHANNEL_HTTP_API_VERSION
|
|
9
|
+
readonly kind: typeof TUI_CHANNEL_HTTP_KIND
|
|
10
|
+
readonly origin: string
|
|
11
|
+
readonly connection: typeof TUI_CHANNEL_HTTP_WEBSOCKET_PATH
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function createTuiChannelEndpointDescriptor(origin: string): TuiChannelEndpointDescriptor
|
|
15
|
+
export function validateTuiChannelEndpointDescriptor(value: unknown): TuiChannelEndpointDescriptor
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
|
|
2
|
-
export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
|
|
3
|
-
export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
|
|
4
|
-
export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
|
|
5
|
-
export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
|
|
6
|
-
|
|
7
|
-
export function createTuiChannelEndpointDescriptor(origin) {
|
|
8
|
-
const normalized = new URL(origin)
|
|
9
|
-
if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
|
|
10
|
-
throw new TypeError('TUI Channel endpoint origin must use http or https')
|
|
11
|
-
}
|
|
12
|
-
normalized.pathname = '/'
|
|
13
|
-
normalized.search = ''
|
|
14
|
-
normalized.hash = ''
|
|
15
|
-
return Object.freeze({
|
|
16
|
-
apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
|
|
17
|
-
kind: TUI_CHANNEL_HTTP_KIND,
|
|
18
|
-
origin: normalized.toString().replace(/\/$/u, ''),
|
|
19
|
-
connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function validateTuiChannelEndpointDescriptor(value) {
|
|
24
|
-
if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
|
|
25
|
-
if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
|
|
26
|
-
throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
|
|
27
|
-
}
|
|
28
|
-
if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
|
|
29
|
-
createTuiChannelEndpointDescriptor(value.origin)
|
|
30
|
-
if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
|
|
31
|
-
return value
|
|
32
|
-
}
|
|
1
|
+
export const TUI_CHANNEL_HTTP_API_VERSION = 'tui.dsh/v1alpha1'
|
|
2
|
+
export const TUI_CHANNEL_HTTP_KIND = 'ChannelEndpoint'
|
|
3
|
+
export const TUI_CHANNEL_HTTP_HEALTH_PATH = '/dsh-tui/v1/health'
|
|
4
|
+
export const TUI_CHANNEL_HTTP_DESCRIPTOR_PATH = '/dsh-tui/v1/endpoint'
|
|
5
|
+
export const TUI_CHANNEL_HTTP_WEBSOCKET_PATH = '/dsh-tui/v1/connection'
|
|
6
|
+
|
|
7
|
+
export function createTuiChannelEndpointDescriptor(origin) {
|
|
8
|
+
const normalized = new URL(origin)
|
|
9
|
+
if (normalized.protocol !== 'http:' && normalized.protocol !== 'https:') {
|
|
10
|
+
throw new TypeError('TUI Channel endpoint origin must use http or https')
|
|
11
|
+
}
|
|
12
|
+
normalized.pathname = '/'
|
|
13
|
+
normalized.search = ''
|
|
14
|
+
normalized.hash = ''
|
|
15
|
+
return Object.freeze({
|
|
16
|
+
apiVersion: TUI_CHANNEL_HTTP_API_VERSION,
|
|
17
|
+
kind: TUI_CHANNEL_HTTP_KIND,
|
|
18
|
+
origin: normalized.toString().replace(/\/$/u, ''),
|
|
19
|
+
connection: TUI_CHANNEL_HTTP_WEBSOCKET_PATH,
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function validateTuiChannelEndpointDescriptor(value) {
|
|
24
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new TypeError('TUI Channel endpoint descriptor must be an object')
|
|
25
|
+
if (value.apiVersion !== TUI_CHANNEL_HTTP_API_VERSION || value.kind !== TUI_CHANNEL_HTTP_KIND) {
|
|
26
|
+
throw new TypeError('TUI Channel endpoint descriptor version or kind is unsupported')
|
|
27
|
+
}
|
|
28
|
+
if (typeof value.origin !== 'string') throw new TypeError('TUI Channel endpoint origin must be a string')
|
|
29
|
+
createTuiChannelEndpointDescriptor(value.origin)
|
|
30
|
+
if (value.connection !== TUI_CHANNEL_HTTP_WEBSOCKET_PATH) throw new TypeError('TUI Channel endpoint connection path is unsupported')
|
|
31
|
+
return value
|
|
32
|
+
}
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
|
|
2
|
-
|
|
3
|
-
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
|
|
4
|
-
|
|
5
|
-
export const TUI_CHANNEL: Readonly<ApiReference & {
|
|
6
|
-
apiVersion: 'tui.dsh/v1alpha1'
|
|
7
|
-
kind: 'Channel'
|
|
8
|
-
}>
|
|
9
|
-
export const TUI_CHANNEL_WIRE_REVISION: 6
|
|
10
|
-
export const TUI_CHANNEL_FEATURES: readonly string[]
|
|
11
|
-
|
|
12
|
-
export interface TuiChannelRequirementSpec {
|
|
13
|
-
readonly wireRevision: number
|
|
14
|
-
readonly features: readonly string[]
|
|
15
|
-
}
|
|
16
|
-
export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
|
|
17
|
-
|
|
18
|
-
export interface TuiChannelSnapshot {
|
|
19
|
-
readonly wireRevision: number
|
|
20
|
-
readonly channelId: string
|
|
21
|
-
readonly version: number
|
|
22
|
-
readonly state: Readonly<Record<string, JsonValue>>
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TuiChannelWorkspaceFlowChoice {
|
|
26
|
-
readonly id: string
|
|
27
|
-
readonly label: string
|
|
28
|
-
readonly description?: string
|
|
29
|
-
readonly badge?: string
|
|
30
|
-
readonly action: string
|
|
31
|
-
readonly input?: {
|
|
32
|
-
readonly action: string
|
|
33
|
-
readonly initialValue?: string
|
|
34
|
-
readonly placeholder?: string
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export type TuiChannelWorkspaceFlowResult =
|
|
39
|
-
| { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
|
|
40
|
-
| { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
|
|
41
|
-
|
|
42
|
-
export type TuiChannelInput =
|
|
43
|
-
| { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
|
|
44
|
-
| { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
|
|
45
|
-
| { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
|
|
46
|
-
| { readonly operation: 'close'; readonly value: { readonly channelId: string } }
|
|
47
|
-
|
|
48
|
-
export interface TuiChannelInvokeOutput {
|
|
49
|
-
readonly value: JsonValue
|
|
50
|
-
readonly valueDefined?: boolean
|
|
51
|
-
readonly snapshot?: TuiChannelSnapshot
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const tuiChannelDefinition: ProtocolDefinition
|
|
55
|
-
export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
|
|
56
|
-
export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
|
|
57
|
-
export function validateTuiChannelInput(operation: string, value: unknown): object
|
|
58
|
-
export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
|
|
59
|
-
export function validateTuiChannelOutput(operation: string, value: unknown): object
|
|
1
|
+
import type { ApiReference, ProtocolDefinition } from '@dsh-std/core'
|
|
2
|
+
|
|
3
|
+
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | { readonly [key: string]: JsonValue }
|
|
4
|
+
|
|
5
|
+
export const TUI_CHANNEL: Readonly<ApiReference & {
|
|
6
|
+
apiVersion: 'tui.dsh/v1alpha1'
|
|
7
|
+
kind: 'Channel'
|
|
8
|
+
}>
|
|
9
|
+
export const TUI_CHANNEL_WIRE_REVISION: 6
|
|
10
|
+
export const TUI_CHANNEL_FEATURES: readonly string[]
|
|
11
|
+
|
|
12
|
+
export interface TuiChannelRequirementSpec {
|
|
13
|
+
readonly wireRevision: number
|
|
14
|
+
readonly features: readonly string[]
|
|
15
|
+
}
|
|
16
|
+
export interface TuiChannelSupportSpec extends TuiChannelRequirementSpec {}
|
|
17
|
+
|
|
18
|
+
export interface TuiChannelSnapshot {
|
|
19
|
+
readonly wireRevision: number
|
|
20
|
+
readonly channelId: string
|
|
21
|
+
readonly version: number
|
|
22
|
+
readonly state: Readonly<Record<string, JsonValue>>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TuiChannelWorkspaceFlowChoice {
|
|
26
|
+
readonly id: string
|
|
27
|
+
readonly label: string
|
|
28
|
+
readonly description?: string
|
|
29
|
+
readonly badge?: string
|
|
30
|
+
readonly action: string
|
|
31
|
+
readonly input?: {
|
|
32
|
+
readonly action: string
|
|
33
|
+
readonly initialValue?: string
|
|
34
|
+
readonly placeholder?: string
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type TuiChannelWorkspaceFlowResult =
|
|
39
|
+
| { readonly kind: 'target'; readonly target: import('./tui-contributions.js').WorkspaceTarget }
|
|
40
|
+
| { readonly kind: 'choices'; readonly title: string; readonly choices: readonly TuiChannelWorkspaceFlowChoice[] }
|
|
41
|
+
|
|
42
|
+
export type TuiChannelInput =
|
|
43
|
+
| { readonly operation: 'open'; readonly value: { readonly workspace?: string; readonly sessionId?: string; readonly options?: JsonValue } }
|
|
44
|
+
| { readonly operation: 'subscribe'; readonly value: { readonly channelId: string; readonly afterVersion: number } }
|
|
45
|
+
| { readonly operation: 'invoke'; readonly value: { readonly channelId: string; readonly method: string; readonly arguments: readonly JsonValue[] } }
|
|
46
|
+
| { readonly operation: 'close'; readonly value: { readonly channelId: string } }
|
|
47
|
+
|
|
48
|
+
export interface TuiChannelInvokeOutput {
|
|
49
|
+
readonly value: JsonValue
|
|
50
|
+
readonly valueDefined?: boolean
|
|
51
|
+
readonly snapshot?: TuiChannelSnapshot
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const tuiChannelDefinition: ProtocolDefinition
|
|
55
|
+
export function validateTuiChannelRequirement(value: unknown): TuiChannelRequirementSpec
|
|
56
|
+
export function validateTuiChannelSupport(value: unknown): TuiChannelSupportSpec
|
|
57
|
+
export function validateTuiChannelInput(operation: string, value: unknown): object
|
|
58
|
+
export function validateTuiChannelSnapshot(value: unknown): TuiChannelSnapshot
|
|
59
|
+
export function validateTuiChannelOutput(operation: string, value: unknown): object
|