@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
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The only way a workspace strategy talks to a host.
3
+ *
4
+ * Every command is built by `remote-git.ts` (or a helper in `core/shell.ts`) and
5
+ * handed to `dshSsh` verbatim: no strategy opens a connection of its own, so a
6
+ * run shares the host inventory, the credentials and the connection pool the
7
+ * user already operates. A transport failure is raised as the same error type
8
+ * as a command failure, because a workspace that could not be looked at must
9
+ * never be reported as missing.
10
+ *
11
+ * @module dsh-task-board-ssh/host/workspace/remote
12
+ */
13
+ import type { DshSshExecResult } from '../../core/contract.ts';
14
+ import type { SshWorkspaceRun } from '../../core/workspace.ts';
15
+ /** Default command timeout for remote git/workspace commands (5 min for large clones/pushes). */
16
+ export declare const WORKSPACE_COMMAND_TIMEOUT_MS = 300000;
17
+ /** Redact embedded credentials (`user:pass@`) from a clone URL before surfacing it in errors. */
18
+ export declare function redactGitUrl(url: string): string;
19
+ /**
20
+ * Run one command on the run's host.
21
+ * @param run - the run being served.
22
+ * @param command - command line built from quoted words.
23
+ * @param timeoutMs - optional timeout ceiling; defaults to {@link WORKSPACE_COMMAND_TIMEOUT_MS}.
24
+ * @returns what the command did.
25
+ * @throws SshWorkspaceError when the host could not be reached at all.
26
+ */
27
+ export declare function execRemote(run: SshWorkspaceRun, command: string, timeoutMs?: number): Promise<DshSshExecResult>;
28
+ /**
29
+ * Run one command and require it to succeed.
30
+ * @param run - the run being served.
31
+ * @param command - command line built from quoted words.
32
+ * @param what - what the command does, for the diagnostic.
33
+ * @returns the finished command.
34
+ * @throws SshWorkspaceError when it failed or the host was unreachable.
35
+ */
36
+ export declare function execRemoteChecked(run: SshWorkspaceRun, command: string, what: string): Promise<DshSshExecResult>;
37
+ /**
38
+ * Run one probe and report whether it held.
39
+ *
40
+ * A probe's non-zero exit is an answer, not a failure: it is how "this
41
+ * directory does not exist" and "this branch is gone" are read without an
42
+ * exception per negative case.
43
+ * @param run - the run being served.
44
+ * @param command - command line that exits zero when the questioned fact holds.
45
+ * @returns whether it held.
46
+ * @throws SshWorkspaceError when the host could not be reached.
47
+ */
48
+ export declare function probeRemote(run: SshWorkspaceRun, command: string): Promise<boolean>;
49
+ /**
50
+ * Upload one local file to an absolute remote path.
51
+ * @param run - the run being served.
52
+ * @param localPath - file on this machine.
53
+ * @param remotePath - absolute destination path on the host.
54
+ * @throws SshWorkspaceError when the transfer failed.
55
+ */
56
+ export declare function uploadToHost(run: SshWorkspaceRun, localPath: string, remotePath: string): Promise<void>;
57
+ /**
58
+ * Download one remote file to a local path.
59
+ * @param run - the run being served.
60
+ * @param remotePath - file on the host.
61
+ * @param localPath - destination path on this machine.
62
+ * @throws SshWorkspaceError when the transfer failed.
63
+ */
64
+ export declare function downloadFromHost(run: SshWorkspaceRun, remotePath: string, localPath: string): Promise<void>;
65
+ /**
66
+ * Remove one remote file, tolerating every failure.
67
+ *
68
+ * Bundles are the only temporary files this package puts on a host, and a
69
+ * leftover one changes no outcome: it is removed on the way past a successful
70
+ * transfer, and a broken connection during that removal must not turn a
71
+ * finished run into a failed one.
72
+ * @param run - the run being served.
73
+ * @param path - absolute remote file path.
74
+ */
75
+ export declare function removeRemoteFile(run: SshWorkspaceRun, path: string): Promise<void>;
76
+ /**
77
+ * Build the command that removes one remote file, absence included.
78
+ *
79
+ * The only command this package composes outside `core/shell.ts`: that module
80
+ * owns directory removal (`rm -rf`) and nothing else, so a constant verb plus
81
+ * one quoted path is written here rather than there.
82
+ * @param path - absolute remote file path.
83
+ * @returns one shell command.
84
+ */
85
+ export declare function removeFileCommand(path: string): string;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * What this package adds to the frozen workspace-strategy interface.
3
+ *
4
+ * `src/core/workspace.ts` is the seam both halves were written against and it
5
+ * stays frozen: a strategy returns the directory the agent runs in, and the
6
+ * collection either carries a branch or does not. The one fact the card has to
7
+ * explain is how many local files the run did not receive, so the strategies
8
+ * here return a preparation that may carry that note, and the factory hands
9
+ * back a strategy narrowed to it. The narrowing is assignable to the frozen
10
+ * interface, so an engine written against `SshWorkspaceStrategy` accepts it
11
+ * unchanged.
12
+ *
13
+ * @module dsh-task-board-ssh/host/workspace/types
14
+ */
15
+ import type { SshWorkspacePreparation, SshWorkspaceRun, SshWorkspaceStrategy } from '../../core/workspace.ts';
16
+ /** What preparing a run produced, with the note this package adds to it. */
17
+ export interface SshWorkspacePreparationNote extends SshWorkspacePreparation {
18
+ /**
19
+ * Untracked files the run did not receive, because a bundle carries commits
20
+ * and not the untracked working tree. Absent for a strategy that never looks
21
+ * at a local repository, so `0` always means "counted, none".
22
+ */
23
+ untrackedFiles?: number;
24
+ }
25
+ /** The strategy this package's factory builds: the frozen interface, sourced. */
26
+ export interface SshWorkspaceStrategyWithNote extends SshWorkspaceStrategy {
27
+ prepare(run: SshWorkspaceRun): Promise<SshWorkspacePreparationNote>;
28
+ }
@@ -0,0 +1,100 @@
1
+ /**
2
+ * The seam the placement strategies are assembled behind.
3
+ *
4
+ * The strategies themselves live in `src/host/workspace/` and are owned there;
5
+ * the engine only ever sees the frozen interface from `src/core/workspace.ts`
6
+ * through this resolver. That keeps two things true at once: the engine never
7
+ * imports a strategy implementation, and a deployment that serves none still
8
+ * mounts — a git run then fails on the card with a diagnosable reason instead of
9
+ * silently working in the wrong place.
10
+ *
11
+ * Two facts a run needs from the deployment live here as well, because both are
12
+ * about the workspace rather than about the run protocol: the local directory a
13
+ * `workspace` repository source points at, and the note a strategy attaches when
14
+ * it could not send every local file.
15
+ *
16
+ * @module dsh-task-board-ssh/host/workspace-seam
17
+ */
18
+ import type { DshSshService, ServiceLookupSeat } from '../core/contract.ts';
19
+ import type { SshWorkspaceTarget } from '../core/target.ts';
20
+ import type { SshWorkspacePreparation, SshWorkspaceStrategy } from '../core/workspace.ts';
21
+ /**
22
+ * Resolve the placement strategy for one pinned workspace target.
23
+ *
24
+ * The whole target is passed rather than its kind, because which strategy serves
25
+ * a git run depends on where its repository comes from: a URL the host reaches
26
+ * and the local workspace sent as a bundle are two mechanisms behind one kind.
27
+ * Called once per run, at the moment the run is prepared, so it may answer
28
+ * differently as a deployment's strategies change.
29
+ */
30
+ export type SshWorkspaceStrategyResolver = (target: SshWorkspaceTarget) => SshWorkspaceStrategy | undefined;
31
+ /** What a strategy assembly receives. */
32
+ export interface SshWorkspaceAssemblyInput {
33
+ /** The shared `dshSsh` face: every remote operation a strategy makes goes through it. */
34
+ ssh: DshSshService;
35
+ }
36
+ /**
37
+ * The shape of `createWorkspaceStrategies`-style assembly in
38
+ * `src/host/workspace/index.ts`.
39
+ *
40
+ * The host entry assembles its resolver through that module's single entry and
41
+ * this declaration is the interface the two halves meet on.
42
+ */
43
+ export type CreateSshWorkspaceStrategies = (input: SshWorkspaceAssemblyInput) => SshWorkspaceStrategyResolver;
44
+ /** The resolver of a deployment that serves no placement strategy. */
45
+ export declare const NO_WORKSPACE_STRATEGIES: SshWorkspaceStrategyResolver;
46
+ /** Cordis service name of the deployment's workspace registry. */
47
+ export declare const WORKSPACE_REGISTRY_SERVICE = "workspaceRegistry";
48
+ /**
49
+ * The slice of the deployment's workspace registry this package reads.
50
+ *
51
+ * The board resolves the same service for the same reason — a card that pins a
52
+ * workspace id has to become a directory before anything can run in it — and
53
+ * every member used here is one the runtime already publishes.
54
+ */
55
+ export interface WorkspaceRegistrySeat {
56
+ /** Every workspace this deployment knows, in store order. */
57
+ list(): ReadonlyArray<{
58
+ id: string;
59
+ path: string;
60
+ }>;
61
+ }
62
+ /**
63
+ * Resolve the workspace registry, when this deployment serves one.
64
+ * @param ctx - a seat that can read services by name.
65
+ * @returns the registry, or undefined when the deployment serves none.
66
+ */
67
+ export declare function resolveWorkspaceRegistry(ctx: ServiceLookupSeat): WorkspaceRegistrySeat | undefined;
68
+ /**
69
+ * Resolve one workspace id to the local repository a git run bundles.
70
+ *
71
+ * A missing registry, a missing workspace and a path this deployment cannot read
72
+ * all answer undefined: the run then fails with the strategy's own "was not
73
+ * resolved" refusal, which says more than a rejected id would.
74
+ * @param registry - the deployment's registry, when it serves one.
75
+ * @param workspaceId - workspace the card's target names.
76
+ * @returns the absolute local directory, or undefined when it does not resolve.
77
+ */
78
+ export declare function readWorkspaceDirectory(registry: WorkspaceRegistrySeat | undefined, workspaceId: string): string | undefined;
79
+ /**
80
+ * Read the untracked-file note a preparation may carry.
81
+ *
82
+ * The frozen `SshWorkspacePreparation` promises one member, the directory; the
83
+ * strategies in `src/host/workspace/` add this one, because a bundle carries
84
+ * commits and not the untracked working tree, and a card has to be able to say
85
+ * how much of it stayed behind. Read structurally: a strategy of this
86
+ * deployment's own that reports nothing is a strategy that sent everything.
87
+ * @param prepared - what a strategy returned.
88
+ * @returns the count, or undefined when the strategy did not measure one.
89
+ */
90
+ export declare function readUntrackedFiles(prepared: SshWorkspacePreparation): number | undefined;
91
+ /**
92
+ * One sentence saying how many local files the run did not receive.
93
+ *
94
+ * It travels in the outcome the card records, which is the only free-text channel
95
+ * an external run has: the ledger keeps the account of a run, not a second
96
+ * schema field for a workspace detail.
97
+ * @param files - untracked files that stayed on this machine.
98
+ * @returns the sentence, or an empty string when there is nothing to say.
99
+ */
100
+ export declare function untrackedNote(files: number | undefined): string;
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Host half of the task-board SSH provider extension.
3
+ *
4
+ * The row registers one provider with the task board: a card that pins a
5
+ * `dsh-ssh` host runs on that host instead of in a local session. Both services
6
+ * it needs are taken through one cordis dependency scope, so a deployment that
7
+ * serves neither — or mounts them later — keeps starting normally and gains the
8
+ * provider the moment both are there, with nothing registered before then.
9
+ *
10
+ * What this file owns and nothing else does: the Config schema (every field
11
+ * `volatile()`, so a settings edit binds the next run without a restart), the
12
+ * scope wiring, and the single configuration write path. The engine, its remote
13
+ * operations, its tools and its action routing live in `src/host/`.
14
+ *
15
+ * @module dsh-task-board-ssh
16
+ */
17
+ import type { Context, Volatile } from '@deepseek-ai/cordis';
18
+ import z from '@deepseek-ai/schemastery';
19
+ import { type SshAgentKind, type SshExecutionMode } from './core/target.ts';
20
+ import { SSH_EXTENSION_ID } from './host/extension.ts';
21
+ export { SSH_EXTENSION_ID };
22
+ /**
23
+ * npm identity of this package. The host single-instance guard keys on it, so an
24
+ * aggregate install and a standalone install do not double-register.
25
+ */
26
+ export declare const PACKAGE_NAME = "@linxin666/dsh-client-ui-task-board-ssh";
27
+ /** One configured agent command override. */
28
+ export interface SshAgentCommandInput {
29
+ /** Agent CLI the override applies to. */
30
+ kind: SshAgentKind;
31
+ /** Start template; must reference `{prompt_file}`. */
32
+ command: string;
33
+ /** Resume template; without one a follow-up runs fresh. */
34
+ resumeCommand?: string;
35
+ }
36
+ /** Plugin config, validated by the same-named schemastery schema. */
37
+ export interface Config {
38
+ /** Master switch of the extension. */
39
+ enabled?: Volatile<boolean>;
40
+ /** Host alias a card opens with. */
41
+ defaultHost?: Volatile<string>;
42
+ /** Agent CLI a card opens with. */
43
+ defaultAgent?: Volatile<SshAgentKind>;
44
+ /** Execution mode a card opens with. */
45
+ defaultMode?: Volatile<SshExecutionMode>;
46
+ /** How many runs one host executes at once. */
47
+ perHostCap?: Volatile<number>;
48
+ /** Per-agent command templates that replace the built-in command line. */
49
+ agentCommands?: Volatile<SshAgentCommandInput[]>;
50
+ }
51
+ /** Profile-patch shape of {@link Config}. */
52
+ export interface ConfigInput {
53
+ enabled?: boolean;
54
+ defaultHost?: string;
55
+ defaultAgent?: SshAgentKind;
56
+ defaultMode?: SshExecutionMode;
57
+ perHostCap?: number;
58
+ agentCommands?: SshAgentCommandInput[];
59
+ }
60
+ declare module '@deepseek-ai/cordis' {
61
+ interface Events {
62
+ /**
63
+ * Volatile config values were committed into the running fiber without a
64
+ * remount; dispatched to the owning fiber only.
65
+ * @param paths - the changed config paths, as key arrays.
66
+ * @mode emit
67
+ */
68
+ 'loader/volatile-update'(paths: readonly (readonly string[])[]): void;
69
+ }
70
+ }
71
+ /**
72
+ * Every configuration field is volatile: a write is committed into the running
73
+ * fiber, and every consumer here reads it at use time, so the next admission,
74
+ * the next run and the next tool call all see the new value without a remount.
75
+ */
76
+ export declare const Config: z<ConfigInput, Config>;
77
+ /**
78
+ * Activate the extension's host half.
79
+ *
80
+ * Registration lives behind one cordis dependency scope over both services the
81
+ * provider needs, because the Host loads plugin rows in an order this package
82
+ * does not own: either service may genuinely not exist yet when this row
83
+ * activates, and the scope mounts when both appear and unloads when either is
84
+ * withdrawn. Nothing is registered while it is down.
85
+ *
86
+ * The switch in that scope is this row's own volatile field, so it is re-derived
87
+ * here rather than by the board: the Loader commits a settings write into the
88
+ * running fiber and announces `loader/volatile-update` on this fiber, and this
89
+ * row tears its provider down (engine stopped, tools and launch handler
90
+ * withdrawn, published summary gone) or builds it again from that announcement.
91
+ * No card data is touched on the way out, exactly as the board's own switch
92
+ * semantics promise.
93
+ * @param ctx - the plugin context.
94
+ * @param config - resolved plugin config.
95
+ */
96
+ declare function applyImpl(ctx: Context, config?: Config): void;
97
+ export declare const apply: typeof applyImpl;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Host single-instance guard shared by the plugin family. The family bundle
3
+ * (dsh-web-all / dsh-skins) namespaces every child row id (web-ui-*), so
4
+ * the loader accepts a standalone install of the same package side by side;
5
+ * without this guard the second instance would still re-register the same
6
+ * webserver routes, tools, settings namespaces, and system-prompt sections
7
+ * and fail the boot. mountOnce makes a mount of an already-mounted package a
8
+ * no-op for as long as the first instance lives (the browser half is already
9
+ * deduped by package name in the client module host).
10
+ *
11
+ * A no-op is only safe while the holder is ALIVE. The holder can be disposed
12
+ * long after the refused mount ran its course: the Host reloads a profile by
13
+ * creating the new loader entries before the old ones are torn down (a
14
+ * plugin-manager enable/disable/install write, a settings-driven row reload,
15
+ * HMR), so the new aggregate shell entry mounts its family plugin while the
16
+ * previous entry still owns the name. Dropping that refused mount lost the
17
+ * plugin for good - the previous entry then disposed its own mount, releasing
18
+ * the name with nobody left to take it, and the family row stayed listed as
19
+ * active while its host routes 404ed (the task-board panel showed
20
+ * "board.hostError.notMounted", no degraded record appeared, and only a Host
21
+ * restart recovered it).
22
+ *
23
+ * The refused mount is therefore QUEUED, not dropped, and replayed the moment
24
+ * the holder releases the name - if the waiting fiber is still alive then. The
25
+ * single-instance guarantee is unchanged: exactly one mount is live per
26
+ * package name, and the replay re-enters the guard so a later mount still
27
+ * dedupes against it.
28
+ *
29
+ * The registry rides a global symbol so two module instances of the same
30
+ * package (npm copy vs repository link) still share one verdict. That symbol
31
+ * is a CROSS-REPOSITORY contract, not this file's private state: the four
32
+ * satellite packages (dsh-skins / dsh-pet / dsh-presets /
33
+ * dsh-community-plugins) are separate repositories carrying their own copy of
34
+ * this guard, rebuilt on their own schedule, so the value under `MOUNTED`
35
+ * must keep the shape every published copy reads (a `Set` of package names
36
+ * with `has`/`add`/`delete`). The wait queues this guard added therefore live
37
+ * under their own additive key, and the registry reads back a `Set` even when
38
+ * some other build left a different value there. Changing `MOUNTED`'s shape
39
+ * in place broke that contract once: a satellite's legacy copy created a
40
+ * `Set`, the family's new copy read it as a `Map`, and every family row
41
+ * mounted after it failed with "claims.get is not a function".
42
+ *
43
+ * cordis `ctx.effect` runs its callback immediately and treats the callback's
44
+ * return value as the fiber disposer, so the unmarker is returned, not run.
45
+ */
46
+ /**
47
+ * Wrap a cordis plugin apply so the package runs at most once per process.
48
+ * The first mount registers normally and releases the name when its fiber
49
+ * disposes; a mount refused while that name is held waits for the release and
50
+ * then runs, unless its own fiber disposes first.
51
+ * @param packageName - npm package identity shared by every install source.
52
+ * @param fn - the original plugin apply.
53
+ * @returns an apply of the same shape.
54
+ */
55
+ export declare function mountOnce<T extends (...args: any[]) => unknown>(packageName: string, fn: T): T;
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Task Board SSH Provider",
4
+ "description": "Runs a pinned card as a headless agent session on a remote host reached through dsh-ssh."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "任务看板 SSH 提供方",
4
+ "description": "把钉住的卡片送到远端主机执行"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,92 @@
1
1
  {
2
2
  "name": "@linxin666/dsh-client-ui-task-board-ssh",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Task board provider that runs a pinned card as a headless agent session on a remote host reached through dsh-ssh, with a POSIX launcher that survives the local host going away.",
4
+ "version": "0.4.21",
5
+ "icon": "icon.svg",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=24.9.0"
9
+ },
10
+ "main": "lib/index.js",
11
+ "types": "lib/types/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./lib/types/index.d.ts",
15
+ "default": "./lib/index.js"
16
+ },
17
+ "./client": {
18
+ "types": "./lib/types/client/index.d.ts",
19
+ "default": "./lib/client.js"
20
+ },
21
+ "./src/*": "./src/*",
22
+ "./locale/en.json": "./locale/en.json",
23
+ "./locale/zh.json": "./locale/zh.json",
24
+ "./package.json": "./package.json"
25
+ },
26
+ "dsh": {
27
+ "engines": {
28
+ "dsh": ">=0.2.2-rc.3"
29
+ },
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ },
33
+ "client": {
34
+ "inject": [
35
+ "@deepseek-ai/dsh-client-locale",
36
+ "@deepseek-ai/dsh-client-ui-renderer",
37
+ "@deepseek-ai/dsh-client-ui-settings",
38
+ "@deepseek-ai/dsh-client-ui-slots"
39
+ ],
40
+ "platform": "web"
41
+ }
42
+ },
43
+ "peerDependencies": {
44
+ "@deepseek-ai/dsh": ">=0.2.2-rc.3",
45
+ "react": "^18.2.0"
46
+ },
47
+ "dependencies": {
48
+ "@deepseek-ai/schemastery": "^3.19.0"
49
+ },
50
+ "devDependencies": {
51
+ "@deepseek-ai/cordis": "^4.1.0",
52
+ "@deepseek-ai/dsh-api-gateway": "^0.2.2-rc.3",
53
+ "@deepseek-ai/dsh-client-locale": "^0.2.2-rc.3",
54
+ "@deepseek-ai/dsh-client-store": "^0.2.2-rc.3",
55
+ "@deepseek-ai/dsh-client-ui-renderer": "^0.2.2-rc.3",
56
+ "@deepseek-ai/dsh-client-ui-settings": "^0.2.2-rc.3",
57
+ "@deepseek-ai/dsh-client-ui-slots": "^0.2.2-rc.3",
58
+ "@deepseek-ai/dsh-llm": "^0.2.2-rc.3",
59
+ "@deepseek-ai/dsh-tools": "^0.2.2-rc.3",
60
+ "@testing-library/react": "^16.1.0",
61
+ "@types/node": "^22.20.0",
62
+ "@types/react": "~18.3.1",
63
+ "@types/react-dom": "^18.3.5",
64
+ "jsdom": "^26.0.0",
65
+ "react": "^18.3.1",
66
+ "react-dom": "^18.3.1",
67
+ "tsdown": "0.22.2",
68
+ "typescript": "~5.7.2",
69
+ "vitest": "^4.1.11"
70
+ },
71
+ "files": [
72
+ "lib/**/*.js",
73
+ "lib/**/*.d.ts",
74
+ "src",
75
+ "cordis.patch.yml",
76
+ "icon.svg",
77
+ "locale"
78
+ ],
79
+ "license": "Apache-2.0",
80
+ "repository": {
81
+ "type": "git",
82
+ "url": "https://github.com/zhu1090093659/dsh-web.git"
83
+ },
84
+ "scripts": {
85
+ "build": "tsc -b tsconfig.build.json && tsdown",
86
+ "bundle": "tsdown",
87
+ "watch": "tsdown --watch",
88
+ "typecheck": "tsgo --noEmit",
89
+ "test": "vitest run",
90
+ "test:watch": "vitest"
91
+ }
6
92
  }