@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.
Files changed (128) hide show
  1. package/LICENSE +202 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +96 -2
  4. package/README.zh.md +97 -0
  5. package/cordis.patch.yml +15 -0
  6. package/icon.svg +5 -0
  7. package/lib/client.js +4435 -0
  8. package/lib/index.js +7082 -0
  9. package/lib/types/client/PluginSettingsCard.d.ts +255 -0
  10. package/lib/types/client/RangeBubble.d.ts +46 -0
  11. package/lib/types/client/SegmentGroup.d.ts +28 -0
  12. package/lib/types/client/index.d.ts +100 -0
  13. package/lib/types/client/locales.d.ts +125 -0
  14. package/lib/types/client/seat-props.d.ts +53 -0
  15. package/lib/types/client/settings-entry-form.d.ts +49 -0
  16. package/lib/types/client/settings-form.d.ts +237 -0
  17. package/lib/types/client/ssh/card-decoration.d.ts +23 -0
  18. package/lib/types/client/ssh/compose-section.d.ts +7 -0
  19. package/lib/types/client/ssh/detail-section.d.ts +7 -0
  20. package/lib/types/client/ssh/extension.d.ts +54 -0
  21. package/lib/types/client/ssh/log-buffer.d.ts +128 -0
  22. package/lib/types/client/ssh/log-view.d.ts +37 -0
  23. package/lib/types/client/ssh/model.d.ts +130 -0
  24. package/lib/types/client/ssh/settings-section.d.ts +134 -0
  25. package/lib/types/client/ssh/summary.d.ts +160 -0
  26. package/lib/types/client/ssh/target-form.d.ts +60 -0
  27. package/lib/types/core/action.d.ts +89 -0
  28. package/lib/types/core/adapters/claude.d.ts +15 -0
  29. package/lib/types/core/adapters/codex.d.ts +15 -0
  30. package/lib/types/core/adapters/custom.d.ts +29 -0
  31. package/lib/types/core/adapters/dsh.d.ts +21 -0
  32. package/lib/types/core/adapters/index.d.ts +25 -0
  33. package/lib/types/core/adapters/types.d.ts +76 -0
  34. package/lib/types/core/contract.d.ts +453 -0
  35. package/lib/types/core/launcher-script.d.ts +13 -0
  36. package/lib/types/core/launcher.d.ts +153 -0
  37. package/lib/types/core/ledger.d.ts +123 -0
  38. package/lib/types/core/shell.d.ts +61 -0
  39. package/lib/types/core/target.d.ts +149 -0
  40. package/lib/types/core/task-record.d.ts +74 -0
  41. package/lib/types/core/workspace.d.ts +74 -0
  42. package/lib/types/host/board.d.ts +75 -0
  43. package/lib/types/host/engine.d.ts +563 -0
  44. package/lib/types/host/extension.d.ts +61 -0
  45. package/lib/types/host/inspect.d.ts +99 -0
  46. package/lib/types/host/logs.d.ts +135 -0
  47. package/lib/types/host/payload.d.ts +75 -0
  48. package/lib/types/host/prompt.d.ts +44 -0
  49. package/lib/types/host/queue.d.ts +53 -0
  50. package/lib/types/host/remote.d.ts +137 -0
  51. package/lib/types/host/settings.d.ts +149 -0
  52. package/lib/types/host/timers.d.ts +20 -0
  53. package/lib/types/host/tools.d.ts +17 -0
  54. package/lib/types/host/workspace/errors.d.ts +29 -0
  55. package/lib/types/host/workspace/git.d.ts +108 -0
  56. package/lib/types/host/workspace/in-place.d.ts +36 -0
  57. package/lib/types/host/workspace/index.d.ts +28 -0
  58. package/lib/types/host/workspace/layout.d.ts +62 -0
  59. package/lib/types/host/workspace/local-git.d.ts +72 -0
  60. package/lib/types/host/workspace/remote-git.d.ts +111 -0
  61. package/lib/types/host/workspace/remote.d.ts +85 -0
  62. package/lib/types/host/workspace/types.d.ts +28 -0
  63. package/lib/types/host/workspace-seam.d.ts +100 -0
  64. package/lib/types/index.d.ts +97 -0
  65. package/lib/types/mount-once.d.ts +55 -0
  66. package/locale/en.json +6 -0
  67. package/locale/zh.json +6 -0
  68. package/package.json +89 -3
  69. package/src/client/PluginSettingsCard.tsx +838 -0
  70. package/src/client/RangeBubble.tsx +164 -0
  71. package/src/client/SegmentGroup.tsx +93 -0
  72. package/src/client/css-modules.d.ts +5 -0
  73. package/src/client/index.ts +195 -0
  74. package/src/client/locales.ts +257 -0
  75. package/src/client/seat-props.ts +58 -0
  76. package/src/client/settings-card.module.css +821 -0
  77. package/src/client/settings-entry-form.ts +141 -0
  78. package/src/client/settings-form.ts +529 -0
  79. package/src/client/ssh/card-decoration.tsx +55 -0
  80. package/src/client/ssh/compose-section.tsx +147 -0
  81. package/src/client/ssh/detail-section.tsx +345 -0
  82. package/src/client/ssh/extension.ts +271 -0
  83. package/src/client/ssh/log-buffer.ts +224 -0
  84. package/src/client/ssh/log-view.tsx +149 -0
  85. package/src/client/ssh/model.ts +299 -0
  86. package/src/client/ssh/settings-section.tsx +401 -0
  87. package/src/client/ssh/summary.ts +388 -0
  88. package/src/client/ssh/target-form.tsx +380 -0
  89. package/src/client/ssh.module.css +617 -0
  90. package/src/core/action.ts +270 -0
  91. package/src/core/adapters/claude.ts +64 -0
  92. package/src/core/adapters/codex.ts +83 -0
  93. package/src/core/adapters/custom.ts +88 -0
  94. package/src/core/adapters/dsh.ts +87 -0
  95. package/src/core/adapters/index.ts +74 -0
  96. package/src/core/adapters/types.ts +95 -0
  97. package/src/core/contract.ts +515 -0
  98. package/src/core/launcher-script.ts +313 -0
  99. package/src/core/launcher.ts +283 -0
  100. package/src/core/ledger.ts +377 -0
  101. package/src/core/shell.ts +77 -0
  102. package/src/core/target.ts +420 -0
  103. package/src/core/task-record.ts +73 -0
  104. package/src/core/workspace.ts +78 -0
  105. package/src/host/board.ts +107 -0
  106. package/src/host/engine.ts +2026 -0
  107. package/src/host/extension.ts +310 -0
  108. package/src/host/inspect.ts +264 -0
  109. package/src/host/logs.ts +297 -0
  110. package/src/host/payload.ts +134 -0
  111. package/src/host/prompt.ts +89 -0
  112. package/src/host/queue.ts +73 -0
  113. package/src/host/remote.ts +356 -0
  114. package/src/host/settings.ts +294 -0
  115. package/src/host/timers.ts +33 -0
  116. package/src/host/tools.ts +449 -0
  117. package/src/host/workspace/errors.ts +43 -0
  118. package/src/host/workspace/git.ts +305 -0
  119. package/src/host/workspace/in-place.ts +58 -0
  120. package/src/host/workspace/index.ts +37 -0
  121. package/src/host/workspace/layout.ts +122 -0
  122. package/src/host/workspace/local-git.ts +164 -0
  123. package/src/host/workspace/remote-git.ts +244 -0
  124. package/src/host/workspace/remote.ts +181 -0
  125. package/src/host/workspace/types.ts +34 -0
  126. package/src/host/workspace-seam.ts +132 -0
  127. package/src/index.ts +243 -0
  128. package/src/mount-once.ts +142 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # node scripts/verify-docs.mjs --write <dir>
5
+ README.md: b2180415091d66a7b6a62e3c99fb7fe07cb5b2ba
6
+ README.zh.md: 46dfb7b7e1a9363c27006950506f6229b7527414
package/README.md CHANGED
@@ -1,3 +1,97 @@
1
- # Temporary Holding Version
1
+ # @linxin666/dsh-client-ui-task-board-ssh
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ English | [中文](README.zh.md)
4
+
5
+ A task-board provider extension that runs a pinned card as a headless agent session on a remote host reached through dsh-ssh, so the work happens on the machine that holds the code and keeps running while this host is away.
6
+
7
+ ## What it does
8
+
9
+ - Registers the `ssh` provider extension with the task board and takes over the cards pinned to a remote target at the board's single launch gate, so the native run button, a schedule and `task_board_run` all take the same path.
10
+ - Starts dsh, Claude Code, Codex or a custom command on the host through one POSIX `sh` launcher, detached with `setsid nohup` (falling back to `nohup` on hosts without `setsid`, such as macOS), so a run outlives the SSH connection and the local host.
11
+ - Keeps the run account in the card's own payload and the output in a remote file read back by bounded byte-offset pages, so a log replays from its start at any time.
12
+ - Adds model-visible tools (`task_board_ssh` as the one surface, plus the older `task_board_ssh_target`, `task_board_ssh_status`, `task_board_ssh_follow_up` kept as a compatibility layer) and one task-detail seat holding the target form, the run state, the log viewer, the follow-up box and cancel.
13
+ - Offers the same target choice in the create dialog's Run Mode section, so a card can be created already pinned to a host. The choice starts as no target at all: such a card is created untargeted and its detail seat sets the target afterwards, exactly as before.
14
+ - Cancelling a run from the task-detail seat stops the remote process and puts the card back in the to-do column, with no verdict written.
15
+
16
+ ## Execution modes
17
+
18
+ - `direct` (default) starts a headless agent on the host over dsh-ssh. The board creates no local session and no local execution record, only the card in the running column, which the provider closes through the board's external-outcome action.
19
+ - `proxy` runs the card as an ordinary local session whose prompt opens with the pinned remote target, and that session drives the host through the `ssh_*` tools of dsh-ssh.
20
+
21
+ Proxy mode cannot survive this host going offline: the session, its tool calls and its token spend all live here, so stopping this host stops the work. Direct mode is the one that keeps going, and on the next start the provider reconciles every run that finished while this host was down.
22
+
23
+ ## Workspaces
24
+
25
+ - `in-place` runs in an absolute directory that already exists on the host and collects nothing.
26
+ - `git` from a repository URL keeps a bare cache per source under `~/.dsh/task-board-ssh/repos/` on the host, adds one worktree per run under `workspaces/<runId>`, commits on the branch `dsh-task/<runId>` and pushes that branch back to the URL.
27
+ - `git` from the local workspace sends `HEAD` plus the tracked uncommitted changes as a git bundle, adds the same per-run worktree on the host, and fetches `dsh-task/<runId>` into the local repository without touching its working tree, index or `HEAD`.
28
+
29
+ Untracked files are not synced: a bundle carries commits, so untracked and ignored files stay on this machine. A local-workspace run counts the untracked non-ignored files it did not receive and reports that count in the run summary the card renders.
30
+
31
+ ## Install
32
+
33
+ The host half takes the board and dsh-ssh through one cordis dependency scope: while either service is missing it registers nothing, and it unloads the moment either is withdrawn. In the aggregate bundle the `dsh-ssh` row (`web-ui-ssh`) ships disabled by default, so turn it on in the plugin manager first; until then a card's detail seat only says "Enable the SSH plugin in the plugin manager first", and the create dialog shows no SSH rows at all.
34
+
35
+ ### From npm
36
+
37
+ ```sh
38
+ dsh plugin --profile web add @linxin666/dsh-client-ui-task-board-ssh@latest
39
+ ```
40
+
41
+ ### From the repository
42
+
43
+ ```sh
44
+ git clone https://github.com/zhu1090093659/dsh-web.git
45
+ cd dsh-web
46
+ pnpm install
47
+ pnpm -r build
48
+ dsh plugin --profile web add link:$(pwd)/packages/dsh-task-board-ssh
49
+ ```
50
+
51
+ ## Config
52
+
53
+ ### Per card
54
+
55
+ A card's target is chosen in the create dialog's Run Mode section, or on its detail seat afterwards. Both surfaces edit these same four fields, and a card created without a target keeps none: nothing is pinned until one of them says where it runs.
56
+
57
+ - `mode`: `direct` or `proxy`, as described under execution modes.
58
+ - `host`: the dsh-ssh host alias the run addresses.
59
+ - `agent`: `dsh`, `claude`, `codex` or `custom`; a custom agent needs a start command template carrying `{prompt_file}` and optionally a resume template.
60
+ - `workspace`: `in-place` with a remote path, or `git` with a repository URL and an optional base branch, or `git` with the id of a local workspace.
61
+
62
+ ### Agent surface
63
+
64
+ `task_board_ssh` takes `action: create | bind | read | run | status | log | followup`. One call, `{action:"create", title, prompt, host, workspacePath, run:true, wait:true}`, creates the card with its target, checks it, starts the run and blocks until it settles.
65
+
66
+ - Target choice: `mode` `direct` starts a headless agent on the host and keeps no local session (self-contained jobs); `proxy` runs a local session that drives the host (work that needs local context). `workspaceKind` `in-place` works inside the existing remote directory `workspacePath`; `git` makes a per-run worktree on branch `dsh-task/<runId>` from `repositoryUrl` or the local `workspaceId`. `agent` is `dsh` (default), `claude`, `codex` or `custom` (needs `agentCommand`).
67
+ - Preflight on `create` and `bind` (skip with `preflight:false`), before anything is saved: `host-unreachable` (alias unknown to dsh-ssh or the host did not answer), `agent-missing` (not a supported agent name, or its program is not on the host PATH), `path-missing` (an in-place directory is never created), `permission-required` (the directory is not writable by the ssh user). A refused `create` leaves no card. `run-active` refuses a second run while one is in flight. `invalid-target` lists the other malformed fields.
68
+ - Run handle: `task_board_run` and `action:"run"` answer `executionId`, `runId`, `logPath`, `target`, `estimatedDurationMs` (median of earlier successful runs, else 180000) and a note naming the call that blocks. The settled board execution takes that `executionId`.
69
+ - `status` has one shape for a running and a settled run: `phase` (never missing), `exitCode`, `result`, `summary`, `error` (`code`, `message`, `retryHint`, failures only), `durationMs`, `remoteSessionId`, `lastActivityAt`, and while running `lastActivity` (the agent's last tool call). `wait:true` with `timeoutMs` (default 120000, at most 600000) blocks until the run settles; a timeout answers `timedOut:true` and the run keeps going.
70
+ - `log` filters on the host: `system` events other than `init`, `rate_limit_event` and stream deltas are dropped and lines are cut at 2000 bytes. Reads are `tail` N lines (default 40) or `since` a cursor (`nextSince`), at most 64 KB per reply (`maxBytes` up to 128 KB); `stats` (`rawBytes`, `filteredLines`, `filteredBytes`) comes with every reply and `statsOnly:true` returns it alone; `raw:true` skips the filter.
71
+ - A succeeded run's conclusion is the execution `summary`; `error` carries failures, with `errorCode` and `retryHint`. `task_board_get` and `task_board_list` show a `remote` summary (host, agent, mode, `canFollowUp`) for these cards, and never report `permissionPending` for a direct card, which the local permission gate does not govern.
72
+
73
+ ### Extension settings
74
+
75
+ - `enabled`: the master switch; off withdraws the detail seat, the card badge, the create dialog's row, the four tools and the launch interceptor, and stops polling every run it follows.
76
+ - `defaultMode`, `defaultAgent` and `defaultHost`: what a card opens with before anyone pins a target.
77
+ - `perHostCap`: how many runs one host executes at once, from 1 to 16, default 2; the rest wait in submission order.
78
+ - `agentCommands`: per-agent command templates that replace the built-in command line.
79
+
80
+ ## Security model
81
+
82
+ - Every remote run is unattended. dsh runs with `--permission-mode danger-full-access`, Claude Code with `--dangerously-skip-permissions` and Codex with `--sandbox danger-full-access`, so a card is an instruction to an agent that never asks this host for approval: a card whose prompt is hostile can do anything the remote account can.
83
+ - Every value the provider sends to a host passes through one POSIX shell quoting function; no remote command line is assembled from raw text.
84
+ - dsh-ssh hands this package no credential, key path or proxy command, and the card payload holds no log bytes.
85
+ - A remote log returns into the card unredacted, the same trust model as `ssh_exec`.
86
+
87
+ ## Known limitations
88
+
89
+ - Codex is unverified. Its flags and event names come from OpenAI's non-interactive-mode documentation, and the adapter is fixture-tested against that documented stream only; the first run on a host that has Codex must confirm or correct it.
90
+ - The launcher needs a POSIX `sh` on the host (using `setsid` when present and falling back to `nohup` otherwise, e.g. on macOS); a host without POSIX `sh` cannot run a direct card.
91
+ - A card moved out of the running column while its run is active is read as a cancel request, so a mistaken drag stops the remote run.
92
+ - A git workspace needs a repository on one side or the other: a local directory that is not a git repository cannot be sent to a host.
93
+ - The run directory under `~/.dsh/task-board-ssh/runs/<runId>/` on the host is the only copy of that run's output; nothing about it is copied into the card.
94
+
95
+ ## License
96
+
97
+ Apache-2.0.
package/README.zh.md ADDED
@@ -0,0 +1,97 @@
1
+ # @linxin666/dsh-client-ui-task-board-ssh
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 任务看板的外部提供方扩展:把钉住目标卡片作为无头 agent 会话,跑在经 dsh-ssh 触达的远端主机上,让卡片的工作发生在持有代码的机器上,并且在本机离开时继续运行。
6
+
7
+ ## 是什么
8
+
9
+ - 向任务看板登记 `ssh` 提供方扩展,并在看板唯一的启动闸口接管钉住了远端目标的卡片,因此原生运行按钮、定时调度与 `task_board_run` 走同一条路径。
10
+ - 通过一个 POSIX `sh` 启动器在主机上运行 dsh、Claude Code、Codex 或自定义命令,优先用 `setsid nohup` 脱离(主机无 `setsid` 如 macOS 时回退到 `nohup`),使一次运行活过 SSH 连接与本机。
11
+ - 运行的账目留在卡片自己的载荷里,输出留在远端文件里按有界字节偏移分页读回,因此日志随时可以从头回放。
12
+ - 新增模型可见工具(统一入口 `task_board_ssh`,以及作为兼容层保留的 `task_board_ssh_target`、`task_board_ssh_status`、`task_board_ssh_follow_up`)与一个任务详情席位,席位上放目标表单、运行状态、日志视图、追问框与取消。
13
+ - 新建弹窗的「运行方式」区块里也提供同一套目标选择,卡片可以在建出来之前就钉住主机。默认是不指定:这样的卡片建出来时不带目标,建好后仍由详情席位设置,与以前完全一样。
14
+ - 从任务详情席位取消一次运行会停掉远端进程并把卡片放回待办列,不写任何结论。
15
+
16
+ ## 执行模式
17
+
18
+ - `direct`(默认)经 dsh-ssh 在主机上直接起一个无头 agent。看板不建本地会话、不写本地执行记录,只把卡片放进运行中列,随后由本提供方经看板的外部结果动作结案。
19
+ - `proxy` 把卡片作为普通本地会话运行,其 Prompt 以钉住的远端目标开头,由该会话用 dsh-ssh 的 `ssh_*` 工具驱动主机。
20
+
21
+ proxy 模式撑不过本机离线:会话、它的工具调用与它的令牌开销都在本机,停掉本机就停掉工作。会继续跑的是 direct 模式,本机下次启动时,本提供方会把本机离线期间结束的运行逐一对账。
22
+
23
+ ## 工作区
24
+
25
+ - `in-place` 在主机上一个已经存在的绝对路径里运行,不回传任何东西。
26
+ - `git` 用仓库地址时,在主机 `~/.dsh/task-board-ssh/repos/` 下按来源各留一份裸缓存,在 `workspaces/<runId>` 下为每次运行加一个工作树,在 `dsh-task/<runId>` 分支上提交,并把该分支推回这个地址。
27
+ - `git` 用本机仓库时,把 `HEAD` 与已跟踪的未提交改动打成 git bundle 送出,在主机上加同样的按次工作树,最后把 `dsh-task/<runId>` 取回本机仓库,且不动它的工作树、索引与 `HEAD`。
28
+
29
+ 未跟踪文件不同步:bundle 只带提交,未跟踪与被忽略的文件留在本机。本机仓库来源的运行会数出自己没有收到多少个未跟踪文件,并把该数字写进卡片渲染的运行摘要。
30
+
31
+ ## 安装
32
+
33
+ 宿主半区用同一个 cordis 依赖作用域同时取看板与 dsh-ssh:任一服务缺席时不注册任何东西,任一服务撤走时整块卸载。聚合包里 `dsh-ssh` 那一行(`web-ui-ssh`)出厂默认关闭,需要先在插件管理里启用;在此之前,卡片详情只显示「需要先在插件管理里启用 SSH 插件」,新建弹窗里不出现任何 SSH 行。
34
+
35
+ ### 从 npm 安装
36
+
37
+ ```sh
38
+ dsh plugin --profile web add @linxin666/dsh-client-ui-task-board-ssh@latest
39
+ ```
40
+
41
+ ### 从仓库安装
42
+
43
+ ```sh
44
+ git clone https://github.com/zhu1090093659/dsh-web.git
45
+ cd dsh-web
46
+ pnpm install
47
+ pnpm -r build
48
+ dsh plugin --profile web add link:$(pwd)/packages/dsh-task-board-ssh
49
+ ```
50
+
51
+ ## 配置
52
+
53
+ ### 按卡片
54
+
55
+ 卡片的目标在新建弹窗的「运行方式」里选,也可以建好之后在详情席位里设置。两处编辑的是同四个字段;建卡时没有指定目标的卡片也就没有目标,直到其中一处说出了它在哪运行。
56
+
57
+ - `mode`:`direct` 或 `proxy`,差别见执行模式一节。
58
+ - `host`:这次运行要用的 dsh-ssh 主机别名。
59
+ - `agent`:`dsh`、`claude`、`codex` 或 `custom`;自定义 agent 需要一条带 `{prompt_file}` 的启动命令模板,可选一条续跑模板。
60
+ - `workspace`:`in-place` 配一个远端路径,或 `git` 配仓库地址与可选起始分支,或 `git` 配一个本机工作区标识。
61
+
62
+ ### Agent 入口
63
+
64
+ `task_board_ssh` 的 `action` 取 `create | bind | read | run | status | log | followup`。一次调用 `{action:"create", title, prompt, host, workspacePath, run:true, wait:true}` 即可带目标建卡、预检、启动并阻塞到结束。
65
+
66
+ - 目标怎么选:`mode` 为 `direct` 时在主机上起无头 agent、不留本地会话(自包含任务);`proxy` 由本地会话驱动主机(需要本地上下文的工作)。`workspaceKind` 为 `in-place` 时直接在已存在的远端目录 `workspacePath` 里干活;`git` 按次建工作树、分支 `dsh-task/<runId>`,来源是 `repositoryUrl` 或本机 `workspaceId`。`agent` 取 `dsh`(默认)、`claude`、`codex` 或 `custom`(需 `agentCommand`)。
67
+ - `create` 与 `bind` 在保存任何东西之前先预检(`preflight:false` 可跳过):`host-unreachable`(别名 dsh-ssh 不认识或主机无应答)、`agent-missing`(不是受支持的 agent 名,或其程序不在主机 PATH 上)、`path-missing`(in-place 目录从不自动创建)、`permission-required`(ssh 用户对目录无写权限)。被拒绝的 `create` 不留卡片。`run-active` 在已有运行进行中时拒绝再次运行。其余字段不合法时返回 `invalid-target` 并逐项列出。
68
+ - 运行句柄:`task_board_run` 与 `action:"run"` 返回 `executionId`、`runId`、`logPath`、`target`、`estimatedDurationMs`(同卡以往成功运行的中位数,否则 180000)和一条指明阻塞调用的提示;结束后的看板执行记录沿用这个 `executionId`。
69
+ - `status` 对运行中与已结束的运行返回同一种结构:`phase`(永不缺失)、`exitCode`、`result`、`summary`、`error`(`code`、`message`、`retryHint`,仅失败时有值)、`durationMs`、`remoteSessionId`、`lastActivityAt`,运行中另有 `lastActivity`(agent 最后一次工具调用)。`wait:true` 配合 `timeoutMs`(默认 120000,上限 600000)阻塞到运行结束;超时返回 `timedOut:true`,运行不受影响。
70
+ - `log` 在主机侧过滤:丢弃 `init` 以外的 `system` 事件、`rate_limit_event` 与流式增量,单行截断到 2000 字节。读取方式是 `tail` 末尾 N 行(默认 40)或 `since` 游标(`nextSince`),单次至多 64 KB(`maxBytes` 最大 128 KB);每次回复都带 `stats`(`rawBytes`、`filteredLines`、`filteredBytes`),`statsOnly:true` 只回统计;`raw:true` 跳过过滤。
71
+ - 成功运行的结论写入执行记录的 `summary`;`error` 只承载失败,并附 `errorCode` 与 `retryHint`。`task_board_get` 与 `task_board_list` 对这类卡片给出 `remote` 摘要(主机、agent、模式、`canFollowUp`),且对 direct 卡不再报告 `permissionPending`(本地权限闸不管它)。
72
+
73
+ ### 扩展设置
74
+
75
+ - `enabled`:总开关;关闭即撤下详情席位、卡片徽标、新建弹窗里的那一行、四个工具与启动拦截器,并停掉对所有在跟运行的轮询。
76
+ - `defaultMode`、`defaultAgent` 与 `defaultHost`:卡片在还没钉目标时打开的默认值。
77
+ - `perHostCap`:一台主机同时跑几张卡,1 到 16,默认 2;超出的按提交顺序排队。
78
+ - `agentCommands`:按 agent 覆写的命令模板,替换内置命令行。
79
+
80
+ ## 安全模型
81
+
82
+ - 每次远端运行都是无人值守的。dsh 用 `--permission-mode danger-full-access`,Claude Code 用 `--dangerously-skip-permissions`,Codex 用 `--sandbox danger-full-access`:一张卡就是对 agent 的指令,而这个 agent 从不向本机请示,因此 Prompt 里带敌意的卡片能对该远端账号做任何事。
83
+ - 本包发往主机的每个值都过同一个 POSIX shell 转义函数;远端命令行不由裸文本拼接。
84
+ - dsh-ssh 不向本包交出凭据、私钥路径或 proxy 命令文本,卡片载荷也不含日志字节。
85
+ - 远端日志原样回到卡片,与 `ssh_exec` 同一套信任模型。
86
+
87
+ ## 已知限制
88
+
89
+ - Codex 未核实。它的开关与事件名来自 OpenAI 的非交互模式文档,适配器只对那份文档描述的流做夹具测试;第一次在装有 Codex 的主机上运行时必须确认或修正。
90
+ - 启动器需要主机上有 POSIX `sh`(有 `setsid` 时优先使用,缺失时如 macOS 回退到 `nohup`);没有 POSIX `sh` 的主机跑不了 direct 模式卡片。
91
+ - 运行中的卡片被移出运行中列即视为取消请求,因此误拖一次会停掉远端运行。
92
+ - git 工作区需要某一侧有仓库:本机上一个不是 git 仓库的目录无法送到主机。
93
+ - 主机上 `~/.dsh/task-board-ssh/runs/<runId>/` 的运行目录是该次运行输出的唯一副本,卡片里不保留任何一份。
94
+
95
+ ## 许可证
96
+
97
+ Apache-2.0。
@@ -0,0 +1,15 @@
1
+ # dsh-task-board-ssh bundle patch: inserts the SSH provider extension row into
2
+ # the web profile roster. Applied as a profile bundle layer (the
3
+ # `dsh.bundle.patch` manifest field) over dsh-base; activate with
4
+ # `dsh plugin --profile web add link:<repo>/packages/dsh-task-board-ssh`.
5
+ #
6
+ # The row is a bare plugin by package name: the node half (exports ".") runs in
7
+ # the host process, and the `dsh.client` declaration in package.json makes the
8
+ # browser half (exports "./client", served at /plugins/<id>/client.js) load in
9
+ # the web GUI. In the aggregate bundle this row is namespaced
10
+ # web-ui-task-board-ssh and must stay behind web-ui-task-board: the extension
11
+ # registers into the task board's provider surface, so the board has to be
12
+ # there first.
13
+ - insert:
14
+ - id: ui-task-board-ssh
15
+ name: '@linxin666/dsh-client-ui-task-board-ssh'
package/icon.svg ADDED
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
2
+ <rect x="2.5" y="4" width="19" height="16" rx="2.5" />
3
+ <path d="M6 9l3 3-3 3" />
4
+ <path d="M12 15h6" />
5
+ </svg>