@linxin666/dsh-client-ui-task-board-ssh 0.0.0-stage → 0.4.21
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/LICENSE +202 -0
- package/README.i18n.yaml +6 -0
- package/README.md +96 -2
- package/README.zh.md +97 -0
- package/cordis.patch.yml +15 -0
- package/icon.svg +5 -0
- package/lib/client.js +4435 -0
- package/lib/index.js +7082 -0
- package/lib/types/client/PluginSettingsCard.d.ts +255 -0
- package/lib/types/client/RangeBubble.d.ts +46 -0
- package/lib/types/client/SegmentGroup.d.ts +28 -0
- package/lib/types/client/index.d.ts +100 -0
- package/lib/types/client/locales.d.ts +125 -0
- package/lib/types/client/seat-props.d.ts +53 -0
- package/lib/types/client/settings-entry-form.d.ts +49 -0
- package/lib/types/client/settings-form.d.ts +237 -0
- package/lib/types/client/ssh/card-decoration.d.ts +23 -0
- package/lib/types/client/ssh/compose-section.d.ts +7 -0
- package/lib/types/client/ssh/detail-section.d.ts +7 -0
- package/lib/types/client/ssh/extension.d.ts +54 -0
- package/lib/types/client/ssh/log-buffer.d.ts +128 -0
- package/lib/types/client/ssh/log-view.d.ts +37 -0
- package/lib/types/client/ssh/model.d.ts +130 -0
- package/lib/types/client/ssh/settings-section.d.ts +134 -0
- package/lib/types/client/ssh/summary.d.ts +160 -0
- package/lib/types/client/ssh/target-form.d.ts +60 -0
- package/lib/types/core/action.d.ts +89 -0
- package/lib/types/core/adapters/claude.d.ts +15 -0
- package/lib/types/core/adapters/codex.d.ts +15 -0
- package/lib/types/core/adapters/custom.d.ts +29 -0
- package/lib/types/core/adapters/dsh.d.ts +21 -0
- package/lib/types/core/adapters/index.d.ts +25 -0
- package/lib/types/core/adapters/types.d.ts +76 -0
- package/lib/types/core/contract.d.ts +453 -0
- package/lib/types/core/launcher-script.d.ts +13 -0
- package/lib/types/core/launcher.d.ts +153 -0
- package/lib/types/core/ledger.d.ts +123 -0
- package/lib/types/core/shell.d.ts +61 -0
- package/lib/types/core/target.d.ts +149 -0
- package/lib/types/core/task-record.d.ts +74 -0
- package/lib/types/core/workspace.d.ts +74 -0
- package/lib/types/host/board.d.ts +75 -0
- package/lib/types/host/engine.d.ts +563 -0
- package/lib/types/host/extension.d.ts +61 -0
- package/lib/types/host/inspect.d.ts +99 -0
- package/lib/types/host/logs.d.ts +135 -0
- package/lib/types/host/payload.d.ts +75 -0
- package/lib/types/host/prompt.d.ts +44 -0
- package/lib/types/host/queue.d.ts +53 -0
- package/lib/types/host/remote.d.ts +137 -0
- package/lib/types/host/settings.d.ts +149 -0
- package/lib/types/host/timers.d.ts +20 -0
- package/lib/types/host/tools.d.ts +17 -0
- package/lib/types/host/workspace/errors.d.ts +29 -0
- package/lib/types/host/workspace/git.d.ts +108 -0
- package/lib/types/host/workspace/in-place.d.ts +36 -0
- package/lib/types/host/workspace/index.d.ts +28 -0
- package/lib/types/host/workspace/layout.d.ts +62 -0
- package/lib/types/host/workspace/local-git.d.ts +72 -0
- package/lib/types/host/workspace/remote-git.d.ts +111 -0
- package/lib/types/host/workspace/remote.d.ts +85 -0
- package/lib/types/host/workspace/types.d.ts +28 -0
- package/lib/types/host/workspace-seam.d.ts +100 -0
- package/lib/types/index.d.ts +97 -0
- package/lib/types/mount-once.d.ts +55 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +89 -3
- package/src/client/PluginSettingsCard.tsx +838 -0
- package/src/client/RangeBubble.tsx +164 -0
- package/src/client/SegmentGroup.tsx +93 -0
- package/src/client/css-modules.d.ts +5 -0
- package/src/client/index.ts +195 -0
- package/src/client/locales.ts +257 -0
- package/src/client/seat-props.ts +58 -0
- package/src/client/settings-card.module.css +821 -0
- package/src/client/settings-entry-form.ts +141 -0
- package/src/client/settings-form.ts +529 -0
- package/src/client/ssh/card-decoration.tsx +55 -0
- package/src/client/ssh/compose-section.tsx +147 -0
- package/src/client/ssh/detail-section.tsx +345 -0
- package/src/client/ssh/extension.ts +271 -0
- package/src/client/ssh/log-buffer.ts +224 -0
- package/src/client/ssh/log-view.tsx +149 -0
- package/src/client/ssh/model.ts +299 -0
- package/src/client/ssh/settings-section.tsx +401 -0
- package/src/client/ssh/summary.ts +388 -0
- package/src/client/ssh/target-form.tsx +380 -0
- package/src/client/ssh.module.css +617 -0
- package/src/core/action.ts +270 -0
- package/src/core/adapters/claude.ts +64 -0
- package/src/core/adapters/codex.ts +83 -0
- package/src/core/adapters/custom.ts +88 -0
- package/src/core/adapters/dsh.ts +87 -0
- package/src/core/adapters/index.ts +74 -0
- package/src/core/adapters/types.ts +95 -0
- package/src/core/contract.ts +515 -0
- package/src/core/launcher-script.ts +313 -0
- package/src/core/launcher.ts +283 -0
- package/src/core/ledger.ts +377 -0
- package/src/core/shell.ts +77 -0
- package/src/core/target.ts +420 -0
- package/src/core/task-record.ts +73 -0
- package/src/core/workspace.ts +78 -0
- package/src/host/board.ts +107 -0
- package/src/host/engine.ts +2026 -0
- package/src/host/extension.ts +310 -0
- package/src/host/inspect.ts +264 -0
- package/src/host/logs.ts +297 -0
- package/src/host/payload.ts +134 -0
- package/src/host/prompt.ts +89 -0
- package/src/host/queue.ts +73 -0
- package/src/host/remote.ts +356 -0
- package/src/host/settings.ts +294 -0
- package/src/host/timers.ts +33 -0
- package/src/host/tools.ts +449 -0
- package/src/host/workspace/errors.ts +43 -0
- package/src/host/workspace/git.ts +305 -0
- package/src/host/workspace/in-place.ts +58 -0
- package/src/host/workspace/index.ts +37 -0
- package/src/host/workspace/layout.ts +122 -0
- package/src/host/workspace/local-git.ts +164 -0
- package/src/host/workspace/remote-git.ts +244 -0
- package/src/host/workspace/remote.ts +181 -0
- package/src/host/workspace/types.ts +34 -0
- package/src/host/workspace-seam.ts +132 -0
- package/src/index.ts +243 -0
- package/src/mount-once.ts +142 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy for the SSH provider's browser half: a zh dictionary with the English
|
|
3
|
+
* counterpart beside it. The zh side is the key-set source of truth;
|
|
4
|
+
* `packages/dsh-i18n` mirrors the keys into the centralized ru dictionary and
|
|
5
|
+
* `pnpm i18n:check` enforces the parity.
|
|
6
|
+
*
|
|
7
|
+
* Prefixes: `settings.*` is the section inside the board's own settings card
|
|
8
|
+
* (its shared chrome plus this provider's switches), `detail.*` is the
|
|
9
|
+
* task-detail seat and the field set it shares with the create dialog,
|
|
10
|
+
* `compose.*` is the create dialog's own row, `run.*` is the run-phase
|
|
11
|
+
* vocabulary the detail seat and the card badge share, and `card.*` is the
|
|
12
|
+
* badge itself.
|
|
13
|
+
*
|
|
14
|
+
* @module dsh-task-board-ssh/client/locales
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Extension copy, key source of truth. */
|
|
18
|
+
export const zh = {
|
|
19
|
+
'settings.title': 'SSH 远程执行',
|
|
20
|
+
'settings.description': '把这张看板的卡片送到经 dsh-ssh 触达的主机上执行。',
|
|
21
|
+
'settings.enabled': '启用远程执行',
|
|
22
|
+
'settings.enabledConsequence': '关闭后不再向主机派发运行;已产生的运行记录与远端日志保留。',
|
|
23
|
+
'settings.enabledHint': '关闭后本扩展不再登记详情区与卡片徽标,也不再向主机派发运行;本区块保留,随时可以重新开启。已经产生的运行记录与远端日志不受影响。',
|
|
24
|
+
'settings.defaultMode': '默认模式',
|
|
25
|
+
'settings.defaultAgent': '默认 Agent',
|
|
26
|
+
'settings.defaultHost': '默认主机',
|
|
27
|
+
'settings.defaultHostPlaceholder': 'dsh-ssh 主机别名',
|
|
28
|
+
'settings.perHostCap': '每主机并发上限',
|
|
29
|
+
'settings.perHostCapHint': '同一台主机上同时运行的卡片数,超出的请求按提交顺序排队。',
|
|
30
|
+
'settings.agentCommandHint.dsh': '留空即用 dsh headless 命令行;模板必须引用 {prompt_file}。',
|
|
31
|
+
'settings.agentCommandHint.claude': '留空即用 claude -p 命令行;模板必须引用 {prompt_file}。',
|
|
32
|
+
'settings.agentCommandHint.codex': '留空即用 codex exec 命令行;模板必须引用 {prompt_file}。',
|
|
33
|
+
'settings.disabledNotice': '关闭中:以下默认值与命令覆写暂不生效,打开上面的开关即可继续配置。',
|
|
34
|
+
'settings.on': '开',
|
|
35
|
+
'settings.offLabel': '关',
|
|
36
|
+
'settings.inherit': '继承默认',
|
|
37
|
+
'settings.overridden': '已覆盖',
|
|
38
|
+
'settings.reset': '重置',
|
|
39
|
+
'settings.invalidValue': '该取值不被接受',
|
|
40
|
+
'settings.collapse': '收起设置',
|
|
41
|
+
'settings.expand': '展开设置',
|
|
42
|
+
'settings.notExposed': '当前 DSH 版本未向设置页暴露本插件的配置命名空间,表单不可用。可编辑 ~/.dsh/settings.yaml 直接配置,或将本命名空间加入 Host 设置白名单后重启。',
|
|
43
|
+
'settings.readOnly': '当前部署的设置只读。',
|
|
44
|
+
'settings.saveFailed': '部署未接受这些值,已保留供你修改。',
|
|
45
|
+
|
|
46
|
+
'detail.target': '执行目标',
|
|
47
|
+
'detail.hostHalfMissing': '需要先在插件管理里启用 SSH 插件',
|
|
48
|
+
'detail.setTarget': '设置执行目标',
|
|
49
|
+
'detail.editTarget': '编辑目标',
|
|
50
|
+
'detail.cancelEdit': '收起目标',
|
|
51
|
+
'detail.mode': '模式',
|
|
52
|
+
'detail.mode.direct': '直接执行',
|
|
53
|
+
'detail.mode.proxy': '本地代理',
|
|
54
|
+
'detail.modeHintDirect': '在主机上直接起一个 headless agent,本机离线也不影响它。',
|
|
55
|
+
'detail.modeHintProxy': '本机开一个会话,用 ssh 工具驱动主机;本机离线即中断。',
|
|
56
|
+
'detail.host': '主机',
|
|
57
|
+
'detail.hostNone': '没有可用主机',
|
|
58
|
+
'detail.hostMissing': '在 dsh-ssh 设置里添加主机后,这里才能选择。',
|
|
59
|
+
'detail.hostUnknown': '已不在 dsh-ssh 的主机列表中:{alias}',
|
|
60
|
+
'detail.agent': 'Agent',
|
|
61
|
+
'detail.agent.dsh': 'dsh',
|
|
62
|
+
'detail.agent.claude': 'Claude Code',
|
|
63
|
+
'detail.agent.codex': 'Codex',
|
|
64
|
+
'detail.agent.custom': '自定义',
|
|
65
|
+
'detail.agentCommand': '启动命令',
|
|
66
|
+
'detail.agentResumeCommand': '续跑命令',
|
|
67
|
+
'detail.workspace': '工作区',
|
|
68
|
+
'detail.workspace.in-place': '远端目录',
|
|
69
|
+
'detail.workspace.git': 'Git 分支',
|
|
70
|
+
'detail.workspace.path': '远端路径',
|
|
71
|
+
'detail.workspace.source': '仓库来源',
|
|
72
|
+
'detail.workspace.source.url': '远端仓库',
|
|
73
|
+
'detail.workspace.source.workspace': '本机仓库',
|
|
74
|
+
'detail.workspace.url': '仓库地址',
|
|
75
|
+
'detail.workspace.base': '起始分支',
|
|
76
|
+
'detail.workspace.workspaceId': '本机工作区',
|
|
77
|
+
'detail.workspace.workspaceIdPlaceholder': '工作区标识',
|
|
78
|
+
'detail.save': '保存目标',
|
|
79
|
+
'detail.saving': '保存中',
|
|
80
|
+
'detail.targetSummary': '{host} · {agent} · {workspace}',
|
|
81
|
+
'detail.rejected': '看板没有接受这次操作。',
|
|
82
|
+
'detail.error.host': '选择一台主机。',
|
|
83
|
+
'detail.error.path': '填写主机上的绝对路径,需以 / 开头。',
|
|
84
|
+
'detail.error.agentCommand': '启动命令必须引用 {prompt_file}。',
|
|
85
|
+
'detail.error.url': '填写主机能访问的仓库地址,不能含空格。',
|
|
86
|
+
'detail.error.workspaceId': '填写本机工作区的标识。',
|
|
87
|
+
'detail.error.generic': '该取值不被接受:{error}',
|
|
88
|
+
|
|
89
|
+
'detail.log': '运行日志',
|
|
90
|
+
'detail.logEmpty': '还没有输出',
|
|
91
|
+
'detail.logTruncated': '更早的输出已滚出窗口',
|
|
92
|
+
'detail.logLatest': '跳到最新',
|
|
93
|
+
'detail.followUp': '追问',
|
|
94
|
+
'detail.followUpPlaceholder': '写下要它继续做的事',
|
|
95
|
+
'detail.followUpSend': '发送',
|
|
96
|
+
'detail.followUpQueued': '本轮结束后发送',
|
|
97
|
+
'detail.cancel': '取消执行',
|
|
98
|
+
'detail.cancelling': '取消中',
|
|
99
|
+
'detail.actionFailed': '操作没有完成:{error}',
|
|
100
|
+
'detail.untrackedFiles': '{count} 个未跟踪文件未同步',
|
|
101
|
+
'detail.branch': '分支 {branch}',
|
|
102
|
+
|
|
103
|
+
'run.idle': '待运行',
|
|
104
|
+
'run.queued': '排队',
|
|
105
|
+
'run.running': '运行中',
|
|
106
|
+
'run.succeeded': '已完成',
|
|
107
|
+
'run.failed': '失败',
|
|
108
|
+
'run.cancelled': '已取消',
|
|
109
|
+
'run.lost': '失联',
|
|
110
|
+
|
|
111
|
+
'card.badgeTitle': '{host} · {state}',
|
|
112
|
+
|
|
113
|
+
'compose.remote': '在远程主机上执行',
|
|
114
|
+
} as const
|
|
115
|
+
|
|
116
|
+
/** The English counterpart; the same key set, verified by the locale audit. */
|
|
117
|
+
export const en: Record<TaskBoardSshKey, string> = {
|
|
118
|
+
'settings.title': 'SSH remote execution',
|
|
119
|
+
'settings.description': 'Runs a card of this board on a host reached through dsh-ssh.',
|
|
120
|
+
'settings.enabled': 'Enable remote execution',
|
|
121
|
+
'settings.enabledConsequence': 'No run is dispatched to a host while it is off; recorded runs and their remote logs stay.',
|
|
122
|
+
'settings.enabledHint': 'When off, this extension registers no task-detail section and no card badge, and dispatches no run to a host. This section stays so the switch can be turned back on; recorded runs and remote logs are untouched.',
|
|
123
|
+
'settings.defaultMode': 'Default mode',
|
|
124
|
+
'settings.defaultAgent': 'Default agent',
|
|
125
|
+
'settings.defaultHost': 'Default host',
|
|
126
|
+
'settings.defaultHostPlaceholder': 'dsh-ssh host alias',
|
|
127
|
+
'settings.perHostCap': 'Per-host concurrency',
|
|
128
|
+
'settings.perHostCapHint': 'Cards running at once on one host; anything beyond that waits in submission order.',
|
|
129
|
+
'settings.agentCommandHint.dsh': 'Leave empty for the built-in dsh headless command line; the template must reference {prompt_file}.',
|
|
130
|
+
'settings.agentCommandHint.claude': 'Leave empty for the built-in claude -p command line; the template must reference {prompt_file}.',
|
|
131
|
+
'settings.agentCommandHint.codex': 'Leave empty for the built-in codex exec command line; the template must reference {prompt_file}.',
|
|
132
|
+
'settings.disabledNotice': 'Turned off: the defaults and command overrides below are inactive until the switch above is on.',
|
|
133
|
+
'settings.on': 'On',
|
|
134
|
+
'settings.offLabel': 'Off',
|
|
135
|
+
'settings.inherit': 'Inherit default',
|
|
136
|
+
'settings.overridden': 'Overridden',
|
|
137
|
+
'settings.reset': 'Reset',
|
|
138
|
+
'settings.invalidValue': 'This value is not accepted',
|
|
139
|
+
'settings.collapse': 'Collapse settings',
|
|
140
|
+
'settings.expand': 'Expand settings',
|
|
141
|
+
'settings.notExposed': 'This DSH version does not expose the plugin settings namespace to the settings page, so the form is unavailable. Edit ~/.dsh/settings.yaml directly, or add the namespace to the Host settings allowlist and restart.',
|
|
142
|
+
'settings.readOnly': 'This deployment serves its settings read-only.',
|
|
143
|
+
'settings.saveFailed': 'The deployment did not accept these values; they are kept for you to edit.',
|
|
144
|
+
|
|
145
|
+
'detail.target': 'Execution target',
|
|
146
|
+
'detail.hostHalfMissing': 'Enable the SSH plugin in the plugin manager first',
|
|
147
|
+
'detail.setTarget': 'Set an execution target',
|
|
148
|
+
'detail.editTarget': 'Edit target',
|
|
149
|
+
'detail.cancelEdit': 'Collapse target',
|
|
150
|
+
'detail.mode': 'Mode',
|
|
151
|
+
'detail.mode.direct': 'Direct',
|
|
152
|
+
'detail.mode.proxy': 'Local proxy',
|
|
153
|
+
'detail.modeHintDirect': 'Starts a headless agent on the host; it keeps running while this machine is offline.',
|
|
154
|
+
'detail.modeHintProxy': 'Starts a local session that drives the host through the ssh tools; going offline ends it.',
|
|
155
|
+
'detail.host': 'Host',
|
|
156
|
+
'detail.hostNone': 'No host available',
|
|
157
|
+
'detail.hostMissing': 'Add a host in the dsh-ssh settings before choosing one here.',
|
|
158
|
+
'detail.hostUnknown': 'No longer in the dsh-ssh host list: {alias}',
|
|
159
|
+
'detail.agent': 'Agent',
|
|
160
|
+
'detail.agent.dsh': 'dsh',
|
|
161
|
+
'detail.agent.claude': 'Claude Code',
|
|
162
|
+
'detail.agent.codex': 'Codex',
|
|
163
|
+
'detail.agent.custom': 'Custom',
|
|
164
|
+
'detail.agentCommand': 'Start command',
|
|
165
|
+
'detail.agentResumeCommand': 'Resume command',
|
|
166
|
+
'detail.workspace': 'Workspace',
|
|
167
|
+
'detail.workspace.in-place': 'Remote directory',
|
|
168
|
+
'detail.workspace.git': 'Git branch',
|
|
169
|
+
'detail.workspace.path': 'Remote path',
|
|
170
|
+
'detail.workspace.source': 'Repository source',
|
|
171
|
+
'detail.workspace.source.url': 'Remote repository',
|
|
172
|
+
'detail.workspace.source.workspace': 'This workspace',
|
|
173
|
+
'detail.workspace.url': 'Repository URL',
|
|
174
|
+
'detail.workspace.base': 'Starting branch',
|
|
175
|
+
'detail.workspace.workspaceId': 'Workspace',
|
|
176
|
+
'detail.workspace.workspaceIdPlaceholder': 'Workspace id',
|
|
177
|
+
'detail.save': 'Save target',
|
|
178
|
+
'detail.saving': 'Saving',
|
|
179
|
+
'detail.targetSummary': '{host} · {agent} · {workspace}',
|
|
180
|
+
'detail.rejected': 'The board did not accept that action.',
|
|
181
|
+
'detail.error.host': 'Choose a host.',
|
|
182
|
+
'detail.error.path': 'Enter an absolute path on the host, starting with /.',
|
|
183
|
+
'detail.error.agentCommand': 'The start command must reference {prompt_file}.',
|
|
184
|
+
'detail.error.url': 'Enter a repository URL the host can reach, without spaces.',
|
|
185
|
+
'detail.error.workspaceId': 'Enter the id of a local workspace.',
|
|
186
|
+
'detail.error.generic': 'This value is not accepted: {error}',
|
|
187
|
+
|
|
188
|
+
'detail.log': 'Run log',
|
|
189
|
+
'detail.logEmpty': 'No output yet',
|
|
190
|
+
'detail.logTruncated': 'Earlier output left the window',
|
|
191
|
+
'detail.logLatest': 'Jump to latest',
|
|
192
|
+
'detail.followUp': 'Follow-up',
|
|
193
|
+
'detail.followUpPlaceholder': 'What it should do next',
|
|
194
|
+
'detail.followUpSend': 'Send',
|
|
195
|
+
'detail.followUpQueued': 'Sent after this turn ends',
|
|
196
|
+
'detail.cancel': 'Cancel run',
|
|
197
|
+
'detail.cancelling': 'Cancelling',
|
|
198
|
+
'detail.actionFailed': 'The action did not complete: {error}',
|
|
199
|
+
'detail.untrackedFiles': '{count} untracked files were not sent',
|
|
200
|
+
'detail.branch': 'Branch {branch}',
|
|
201
|
+
|
|
202
|
+
'run.idle': 'Ready',
|
|
203
|
+
'run.queued': 'Queued',
|
|
204
|
+
'run.running': 'Running',
|
|
205
|
+
'run.succeeded': 'Done',
|
|
206
|
+
'run.failed': 'Failed',
|
|
207
|
+
'run.cancelled': 'Cancelled',
|
|
208
|
+
'run.lost': 'Lost contact',
|
|
209
|
+
|
|
210
|
+
'card.badgeTitle': '{host} · {state}',
|
|
211
|
+
|
|
212
|
+
'compose.remote': 'Run on a remote host',
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** One key of this extension's catalog. */
|
|
216
|
+
export type TaskBoardSshKey = keyof typeof zh
|
|
217
|
+
|
|
218
|
+
/** The dictionary this module falls back to when no runtime seat is wired. */
|
|
219
|
+
function dictionary(): Record<TaskBoardSshKey, string> {
|
|
220
|
+
// Chinese keeps the Chinese table; every other UI language falls back to English.
|
|
221
|
+
const lang = (typeof document !== 'undefined' && document.documentElement.lang !== '' ? document.documentElement.lang : 'zh').toLowerCase()
|
|
222
|
+
return lang.startsWith('zh') ? zh : en
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* SDK translate seat wired by the browser apply() once ctx.locale is bound.
|
|
227
|
+
* When present it reads the ACTIVE locale at call time, so the provider's seats
|
|
228
|
+
* follow a runtime language switch; the document-language pick above stays only
|
|
229
|
+
* as the unwired fallback.
|
|
230
|
+
*/
|
|
231
|
+
let runtimeT: ((key: TaskBoardSshKey, params?: Record<string, string>) => string) | undefined
|
|
232
|
+
|
|
233
|
+
/** Wire the SDK translate seat; pass undefined to restore the document-language pick. */
|
|
234
|
+
export function setRuntimeTranslate(t: ((key: TaskBoardSshKey, params?: Record<string, string>) => string) | undefined): void {
|
|
235
|
+
runtimeT = t
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Translate one key of this extension's catalog.
|
|
240
|
+
*
|
|
241
|
+
* The provider's child seats receive only the contract's owner props, so they
|
|
242
|
+
* cannot be handed a locale binding the way a plugin card is; this module-level
|
|
243
|
+
* lookup is what lets them render copy.
|
|
244
|
+
* @param key - the catalog key.
|
|
245
|
+
* @param params - optional {name} template values.
|
|
246
|
+
* @returns the localized text.
|
|
247
|
+
*/
|
|
248
|
+
export function t(key: TaskBoardSshKey, params?: Record<string, string>): string {
|
|
249
|
+
if (runtimeT !== undefined) return runtimeT(key, params)
|
|
250
|
+
let text: string = dictionary()[key]
|
|
251
|
+
if (params !== undefined) {
|
|
252
|
+
for (const [name, value] of Object.entries(params)) {
|
|
253
|
+
text = text.replaceAll(`{${name}}`, value)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return text
|
|
257
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same-shape restatement of the four child seats the task board declares.
|
|
3
|
+
*
|
|
4
|
+
* The board owns these owner-prop shapes (`packages/dsh-task-board/src/core/extension.ts`);
|
|
5
|
+
* this package may not import them as values, and `src/core/` restates that
|
|
6
|
+
* protocol one-for-one, so the restatement lives beside the seats that consume
|
|
7
|
+
* it. Only the props are restated: every board type they mention already has one
|
|
8
|
+
* home in `src/core/`.
|
|
9
|
+
*
|
|
10
|
+
* @module dsh-task-board-ssh/client/seat-props
|
|
11
|
+
*/
|
|
12
|
+
import type { TaskBoardExtensionDispatch, TaskBoardExtensionPayload } from '../core/contract.ts'
|
|
13
|
+
import type { TaskRecord } from '../core/task-record.ts'
|
|
14
|
+
|
|
15
|
+
/** Owner props of the task-detail seat. */
|
|
16
|
+
export interface SshDetailSectionProps {
|
|
17
|
+
/** The card whose detail panel is open. */
|
|
18
|
+
task: TaskRecord
|
|
19
|
+
/** The board's same-origin action channel; the section's only way out. */
|
|
20
|
+
dispatch: TaskBoardExtensionDispatch
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Owner props of the settings seat inside the board's own settings card. */
|
|
24
|
+
export interface SshSettingsSectionProps {
|
|
25
|
+
/** The board's same-origin action channel. */
|
|
26
|
+
dispatch: TaskBoardExtensionDispatch
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Owner props of the card-decoration seat. */
|
|
30
|
+
export interface SshCardDecorationProps {
|
|
31
|
+
/** The card being decorated. */
|
|
32
|
+
task: TaskRecord
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Optional metadata reported alongside a new-card draft. */
|
|
36
|
+
export interface SshComposeDraftOptions {
|
|
37
|
+
/** One-line summary displayed when the Run Mode section is collapsed. */
|
|
38
|
+
summary?: string
|
|
39
|
+
/** Non-empty validation blocker message; prevents the dialog from submitting or running locally. */
|
|
40
|
+
error?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Owner props of the new-card seat inside the board's create dialog.
|
|
45
|
+
*/
|
|
46
|
+
export interface SshComposeSectionProps {
|
|
47
|
+
/**
|
|
48
|
+
* Report what this new card pins under `ssh`: one ledger payload carrying the
|
|
49
|
+
* target and no run account, or undefined to leave the card untargeted so its
|
|
50
|
+
* detail seat sets a target after the fact. A later call replaces the earlier
|
|
51
|
+
* draft, and the board reads the last one when the dialog submits.
|
|
52
|
+
*/
|
|
53
|
+
contribute(extensionId: string, payload: TaskBoardExtensionPayload | undefined, options?: SshComposeDraftOptions): void
|
|
54
|
+
/** Initial integrations of the source card when duplicating a card. */
|
|
55
|
+
initialIntegrations?: Readonly<Record<string, unknown>>
|
|
56
|
+
/** Incremented on each submit attempt so untouched field errors can be revealed. */
|
|
57
|
+
submitAttempt?: number
|
|
58
|
+
}
|