better-dsh 0.3.0 → 0.3.1

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 (73) hide show
  1. package/README.md +49 -178
  2. package/cordis.patch.yml +4 -35
  3. package/docs/adr/0015-independent-bundles-agent-remote.md +40 -0
  4. package/docs/remote-tools.md +56 -0
  5. package/docs/specs/omp-python-repl-port/runtime-guide.md +33 -0
  6. package/docs/specs/omp-python-repl-port/spec.md +61 -0
  7. package/docs/specs/remote-tool-enhancement/spec.md +203 -0
  8. package/dsh-docs/baseline.md +13 -0
  9. package/dsh-docs/subsystems/invariants.md +3 -0
  10. package/dsh-docs/subsystems/invariants.zh.md +3 -0
  11. package/eval-description.md +7 -3
  12. package/lib/{LaunchOptions-kGXcZOe0.js → LaunchOptions-5eg7E0ye.js} +1 -1
  13. package/lib/LaunchOptions-DxQQ0s-A.js +4 -0
  14. package/lib/{bidi-BalpKaJc.js → bidi-CwabFH07.js} +1 -1
  15. package/lib/client/index.js +30 -6
  16. package/lib/failover/index.js +1 -1
  17. package/lib/fs-aware/sandbox-plugin.js +3 -3
  18. package/lib/{index-browser-CysrjMyM.js → index-browser-B-9jm12n.js} +4 -4
  19. package/lib/index.d.ts +17 -41
  20. package/lib/index.js +473 -1678
  21. package/lib/kernel-env-BOF0fNHn.js +91 -0
  22. package/lib/kernel-env.d.ts +4 -58
  23. package/lib/kernel-env.js +2 -2
  24. package/lib/{lsp-server-registry-BXvUTBY7.js → lsp-server-registry-BcdkHROD.js} +1 -1
  25. package/lib/{lsp-server-registry-CH9WNFFt.js → lsp-server-registry-D4VLs1Sm.js} +1 -1
  26. package/lib/{main-CupOhMp5.js → main-BeCgUd20.js} +8 -6
  27. package/lib/{main-BQeFrBM1.js → main-Dv_UQqG2.js} +1 -1
  28. package/lib/mobile/plugin.d.ts +1 -1
  29. package/lib/omp-python/DILL-LICENSE +35 -0
  30. package/lib/omp-python/OMP-LICENSE +23 -0
  31. package/lib/omp-python/better_snapshot.py +391 -0
  32. package/lib/omp-python/better_support.py +425 -0
  33. package/lib/omp-python/dill-provenance.json +55 -0
  34. package/lib/omp-python/provenance.json +13 -0
  35. package/lib/omp-python/runner.py +2499 -0
  36. package/lib/omp-python/vendor/dill/__diff.py +234 -0
  37. package/lib/omp-python/vendor/dill/__info__.py +291 -0
  38. package/lib/omp-python/vendor/dill/__init__.py +119 -0
  39. package/lib/omp-python/vendor/dill/_dill.py +2265 -0
  40. package/lib/omp-python/vendor/dill/_objects.py +545 -0
  41. package/lib/omp-python/vendor/dill/_shims.py +193 -0
  42. package/lib/omp-python/vendor/dill/detect.py +287 -0
  43. package/lib/omp-python/vendor/dill/logger.py +285 -0
  44. package/lib/omp-python/vendor/dill/objtypes.py +24 -0
  45. package/lib/omp-python/vendor/dill/pointers.py +122 -0
  46. package/lib/omp-python/vendor/dill/session.py +612 -0
  47. package/lib/omp-python/vendor/dill/settings.py +25 -0
  48. package/lib/omp-python/vendor/dill/source.py +1025 -0
  49. package/lib/omp-python/vendor/dill/temp.py +252 -0
  50. package/lib/{puppeteer-core-CSk2PtSm.js → puppeteer-core-Dnd7eqel.js} +9 -9
  51. package/lib/remote/plugin.d.ts +459 -5
  52. package/lib/remote/plugin.js +2389 -210
  53. package/lib/url-schemes/index.d.ts +11 -11
  54. package/lib/url-schemes/index.js +12 -12
  55. package/lib/web-password.d.ts +8 -8
  56. package/lib/web-password.js +5 -1
  57. package/lib/{web-trust-Dej_RI2B.d.ts → web-trust-CwZrTBcl.d.ts} +11 -11
  58. package/lib/web-trust.d.ts +1 -2
  59. package/lib/welcome-notice.d.ts +5 -7
  60. package/lib/welcome-notice.js +9 -48
  61. package/lib/{wrap-T4I0nfPM.js → wrap-0VA0uFx8.js} +1 -1
  62. package/package.json +6 -23
  63. package/scripts/kernel-provision.mjs +4 -34
  64. package/lib/LaunchOptions-B874eBu2.js +0 -4
  65. package/lib/bundle-delivery.d.ts +0 -20
  66. package/lib/bundle-delivery.js +0 -209
  67. package/lib/hmr.d.ts +0 -32
  68. package/lib/hmr.js +0 -49
  69. package/lib/kernel-bridge.py +0 -172
  70. package/lib/kernel-env-D8UOWeji.js +0 -195
  71. package/lib/webserver.d.ts +0 -10
  72. package/lib/webserver.js +0 -19
  73. package/scripts/register-bundle.mjs +0 -80
@@ -1,8 +1,461 @@
1
- import { t as Schema } from "../index-DTDXUe6m.js";
2
1
  import { Context } from "@deepseek-ai/cordis";
2
+ import { ToolRunContext } from "@deepseek-ai/dsh-tools";
3
+ import { Readable, Writable } from "node:stream";
4
+ import { NativeConfigSchema } from "@deepseek-ai/dsh-app-boot";
5
+ import { StandardSchemaV1 } from "../../third_party/schemastery/node_modules/@standard-schema/spec/dist/index.js";
6
+ import { JobId, JobRegistry } from "@deepseek-ai/dsh-jobs";
3
7
 
8
+ //#region src/remote/ssh-targets.d.ts
9
+ interface SshConnection {
10
+ readonly host: string;
11
+ readonly user?: string;
12
+ readonly port?: number;
13
+ readonly key?: string;
14
+ readonly proxyJump?: string;
15
+ }
16
+ /** One instance per Agent-owned driver; destroyed with its Agent/plugin owners. */
17
+ declare class SshTargets {
18
+ private readonly targets;
19
+ register(label: string, connection: SshConnection): SshConnection;
20
+ get(label: string): SshConnection | undefined;
21
+ entries(): ReadonlyArray<readonly [string, SshConnection]>;
22
+ clear(): void;
23
+ }
24
+ /** Shared by execution, probes and file/relay consumers. extraArgs is trusted
25
+ * internal SSH argv (e.g. forwarding), never a model-provided shell string. */
26
+ declare function sshArgv(connection: SshConnection, options?: {
27
+ tty?: boolean;
28
+ extraArgs?: readonly string[];
29
+ command?: string;
30
+ }): string[];
31
+ //#endregion
32
+ //#region src/remote/copy.d.ts
33
+ interface CopyRequest {
34
+ src: string;
35
+ dst: string;
36
+ verify?: boolean;
37
+ mkdir?: boolean;
38
+ }
39
+ interface TransferReceipt {
40
+ action: 'copy';
41
+ src: string;
42
+ dst: string;
43
+ verified: boolean;
44
+ sourceDigest?: string;
45
+ destinationDigest?: string;
46
+ bytes: number;
47
+ entries: number;
48
+ scratch?: string;
49
+ scope: 'transferred entries';
50
+ error?: string;
51
+ }
52
+ //#endregion
53
+ //#region src/remote/target.d.ts
54
+ /** 解析后的传输计划:三种 CLI 传输之一。 */
55
+ type TargetPlan = {
56
+ kind: 'ssh';
57
+ host: string;
58
+ connection?: SshConnection;
59
+ } | {
60
+ kind: 'docker';
61
+ container: string;
62
+ } | {
63
+ kind: 'incus';
64
+ container: string;
65
+ };
66
+ //#endregion
67
+ //#region src/remote/native-copy.d.ts
68
+ interface NativeCopyReceipt {
69
+ action: 'copy';
70
+ src: string;
71
+ dst: string;
72
+ /** Native route actually used, stated as a fact (two-command routes never masquerade as one CLI). */
73
+ route: string;
74
+ /** Native argv actually executed per command, one token per element, no shell joining. */
75
+ argv: string[][];
76
+ exits: (number | null)[];
77
+ stdout: string[];
78
+ stderr: string[];
79
+ outputTruncated: boolean;
80
+ /** Native CLI success only — no independent digest was computed for this path. */
81
+ verified: false;
82
+ /** Tool-owned staging/config release: released on normal/observed exit, unknown when a channel was lost. */
83
+ cleanup: 'released' | 'unknown' | 'none-required';
84
+ }
85
+ interface RunResult {
86
+ exit: number | null;
87
+ stdout: string;
88
+ stderr: string;
89
+ outputTruncated: boolean;
90
+ }
91
+ //#endregion
92
+ //#region src/remote/ssh-rsync-native-relay.d.ts
93
+ interface RelayRsyncOptions {
94
+ /** Test seam: wraps every spawned SSH/daemon argv (fixture isolation). */
95
+ wrapArgv?: (argv: string[]) => string[];
96
+ /** Test seam: fixed daemon port instead of ephemeral allocation. */
97
+ ports?: {
98
+ daemon: number;
99
+ };
100
+ /** Test seam: skip route A (simulate denied forwarding). */
101
+ forceStdioRoute?: boolean;
102
+ }
103
+ //#endregion
104
+ //#region src/remote/rsync.d.ts
105
+ interface RsyncRequest {
106
+ src: string;
107
+ dst: string;
108
+ argv?: string[];
109
+ }
110
+ interface RsyncEndpoint {
111
+ path: string;
112
+ connection?: SshConnection;
113
+ }
114
+ interface RsyncReceipt extends RunResult {
115
+ action: 'rsync';
116
+ src: string;
117
+ dst: string;
118
+ argv: string[];
119
+ command: string;
120
+ /** Populated only when the CLI actually printed --stats output. */
121
+ itemizedChanges?: string[];
122
+ literalBytes?: number;
123
+ matchedBytes?: number;
124
+ sentBytes?: number;
125
+ receivedBytes?: number;
126
+ transferredBytes?: number;
127
+ /** Two-SSH route actually used, when applicable. */
128
+ route?: 'local-ssh' | 'ssh-ssh-forward' | 'ssh-ssh-stdio';
129
+ }
130
+ /**
131
+ * Native rsync with ordered caller options. Local↔SSH runs rsync directly with
132
+ * the endpoint's SSH identity wired as RSYNC_RSH; explicit -e/--rsh in argv
133
+ * overrides that wiring per rsync's own rules (the receipt shows the argv).
134
+ * SSH↔SSH delegates to the native relay routes (forwarding first, stdio second).
135
+ * No option is injected: no archive, no timeout, no dry-run, no remote owner.
136
+ */
137
+ declare function runRsync(request: RsyncRequest, source: RsyncEndpoint, destination: RsyncEndpoint, signal: AbortSignal, options?: RelayRsyncOptions): Promise<RsyncReceipt>;
138
+ //#endregion
139
+ //#region src/remote/process.d.ts
140
+ declare const PROCESS_CLEANUP_BOUND_MS: number;
141
+ interface ProcessOptions {
142
+ stdin?: string;
143
+ timeoutSec?: number;
144
+ cwd?: string;
145
+ /** Hub retains raw bytes; native transports retain decoded UTF16 units. */
146
+ unit?: 'bytes' | 'utf16';
147
+ onOutput?: () => void;
148
+ /** Overlay on process.env (tool-built values only, e.g. RSYNC_RSH). */
149
+ env?: NodeJS.ProcessEnv;
150
+ }
151
+ /** Real detached process. Completion includes group cleanup, even after its leader closes. */
152
+ declare function startBinaryProcess(argv: string[], options?: Pick<ProcessOptions, 'cwd' | 'timeoutSec' | 'env'>): {
153
+ stdout: Readable;
154
+ stderr: Readable;
155
+ stdin: Writable;
156
+ cancel(): void;
157
+ done: RemoteProcess['done'];
158
+ diagnostic(): string | undefined;
159
+ };
160
+ /** Text adapter over the same owned process-group lifecycle as binary pipelines. */
161
+ declare function startOneShot(argv: string[], options?: ProcessOptions): RemoteProcess;
162
+ //#endregion
163
+ //#region src/remote/oneshot.d.ts
164
+ interface OneShotOptions {
165
+ stdin?: string;
166
+ timeoutSec?: number;
167
+ }
168
+ interface OneShotResult {
169
+ exit: number | null;
170
+ timedOut: boolean;
171
+ stdout: string;
172
+ stderr: string;
173
+ durationMs: number;
174
+ outputStats?: StreamOutputStats;
175
+ }
176
+ //#endregion
177
+ //#region src/remote/status.d.ts
178
+ interface ProbeOptions {
179
+ connectTimeoutSec?: number;
180
+ hardTimeoutSec?: number;
181
+ runner?: (argv: string[], opts?: OneShotOptions) => Promise<OneShotResult>;
182
+ }
183
+ //#endregion
184
+ //#region src/remote/roster.d.ts
185
+ interface RosterOptions {
186
+ byosshLabels?: readonly string[];
187
+ /** 测试缝:替代 runOneShot 的容器扫描执行器。 */
188
+ runner?: (argv: string[], opts?: OneShotOptions) => Promise<OneShotResult>;
189
+ /** 测试缝:替代 ~/.ssh/config 读取。 */
190
+ readSshConfig?: () => Promise<string>;
191
+ hardTimeoutSec?: number;
192
+ }
193
+ //#endregion
194
+ //#region src/remote/driver.d.ts
195
+ type RemoteCallParams = RemoteInput;
196
+ interface RemoteCallResult {
197
+ mode: 'oneshot' | 'pty';
198
+ target: string;
199
+ exit: number | null;
200
+ cwd: string | null;
201
+ timedOut: boolean;
202
+ reconnected: boolean;
203
+ stdout: string;
204
+ stderr?: string;
205
+ durationMs: number;
206
+ truncated?: number;
207
+ outputStats?: StreamOutputStats;
208
+ outputStatsUnavailable?: boolean;
209
+ /** `byop:<label>` 调用面:本会话的 label(模型自选、即复用入口)。transport target 会话不带。 */
210
+ session?: string;
211
+ /** 引导/教学行(同 label 重复给 spawn 时的「可省略 spawn」提示等);无则省略。 */
212
+ notice?: string;
213
+ }
214
+ interface RemoteAuditRecord {
215
+ target: string;
216
+ cmd: string;
217
+ cwd?: string;
218
+ exit?: number | null;
219
+ durationMs?: number;
220
+ error?: string;
221
+ }
222
+ interface RemoteDriverOptions {
223
+ /** Fixture transport seam; normal consumers use the canonical native SSH builder. */
224
+ /** Fixture transport seam for native copy CLIs (scp/docker/incus argv isolation). */
225
+ nativeArgvFor?: (argv: string[]) => string[];
226
+ getHub?: () => HubRemoteTransport | undefined;
227
+ execTimeoutSec?: number;
228
+ idleTtlSec?: number;
229
+ maxOutputChars?: number;
230
+ onAudit?: (r: RemoteAuditRecord) => void;
231
+ oneshotArgvFor?: (plan: TargetPlan, cmd: string, options: {
232
+ cleanupTag?: string;
233
+ }) => string[];
234
+ ptyArgvFor?: (plan: TargetPlan) => string[];
235
+ spawnArgvFor?: (spawnCommand: string) => string[];
236
+ probeRunner?: ProbeOptions['runner'];
237
+ /** 测试缝:roster 扫描执行器(bare-name 解析复用)。 */
238
+ rosterRunner?: RosterOptions['runner'];
239
+ /** 测试缝:ssh config 读取(bare-name 解析复用)。 */
240
+ sshConfigReader?: () => Promise<string>;
241
+ }
242
+ /** 双轨调度器(spec §七 Phase 2):参数校验 → 路由 → oneshot 子进程 / pty 会话池。 */
243
+ declare class RemoteDriver {
244
+ private readonly opts;
245
+ private readonly sshTargets;
246
+ private readonly pool;
247
+ private readonly hubOwner;
248
+ private readonly hubProviders;
249
+ private readonly processes;
250
+ private readonly starting;
251
+ private readonly fileAbort;
252
+ private disposed;
253
+ private disposal;
254
+ constructor(opts?: RemoteDriverOptions);
255
+ call(params: RemoteCallParams, callCtx?: {
256
+ sessionKey?: string;
257
+ }): Promise<RemoteCallResult>;
258
+ /** Native-first copy routing (spec: remote-native-shortcut): CLI peers run
259
+ * their native CLI verbatim; only Hub↔local↔local stays on the staged tree
260
+ * lane with verify/mkdir. Mixed pairs (Hub↔CLI peer) are refused: Hub has no
261
+ * native CLI and the tree lane has no CLI options. */
262
+ copy(request: CopyRequest & {
263
+ argv?: unknown;
264
+ pullArgv?: unknown;
265
+ pushArgv?: unknown;
266
+ }, signal: AbortSignal, callCtx?: {
267
+ sessionKey?: string;
268
+ }): Promise<TransferReceipt | NativeCopyReceipt>;
269
+ rsync(request: RsyncRequest, signal: AbortSignal, callCtx?: {
270
+ sessionKey?: string;
271
+ }): Promise<RsyncReceipt>;
272
+ /** Only called from JobSpec.run: admission precedes local file reads and discovery. */
273
+ start(input: RemoteInput, signal: AbortSignal): Promise<RemoteProcess>;
274
+ private startPrepared;
275
+ private nativeProcess;
276
+ private own;
277
+ /** Ruling 16/17:on-demand 探测 + 会话层,两行如实陈述。 */
278
+ /**
279
+ * Ruling P20 + PTY 候选表末位:裸名按名匹配——ssh config 字面 host → docker → incus(本地廉价扫描,
280
+ * 撞名 ssh 优先),三段全不中再看池内活 PTY label,最后才是默认 ssh(交原生错误)。
281
+ * 位置即优先级:现有三段一位不挪。选择器前缀的 target 不经此路径。
282
+ */
283
+ private resolveBareName;
284
+ /** Ruling P19:roster = 注意力入口——本地廉价扫描(ssh config/docker ps/incus list + 池内活会话),零拨号。
285
+ * 活的 pty 会话按调用方 agent session 过滤(2026-10-03 裁决):ssh/docker/incus 是**公共静态配置**,
286
+ * 而活会话是**操作环境**——复用别的 agent 留下的 shell 等于继承未知状态,且两个 agent 各开一条线
287
+ * 的代价可忽略。BYO-PTY 天然是活的,于是自然落进这个 scope,无需另立规则。 */
288
+ roster(callCtx?: {
289
+ sessionKey?: string;
290
+ }): Promise<string>;
291
+ status(target: string, callCtx?: {
292
+ sessionKey?: string;
293
+ }): Promise<string>;
294
+ /** PTY 状态行:纯池内读取,零拨号(label 从来不是可拨目标)。 */
295
+ private ptyStatus;
296
+ /** Ruling 13:审计 best-effort——钩子抛错不得影响命令路径(成功被毒化成失败+双重审计)。 */
297
+ private audit;
298
+ /** Registration never dials; response reveals labels only, not credentials. */
299
+ registerSsh(target: string, connection: SshConnection): string;
300
+ private byosshPlan;
301
+ /** Single target resolver for later copy/rsync; BYO identities cannot be
302
+ * independently re-resolved through the origin's alias table. */
303
+ resolveConnectionTarget(target: string, callCtx?: {
304
+ sessionKey?: string;
305
+ }): Promise<TargetPlan>;
306
+ private route;
307
+ private execute;
308
+ /** BYO-PTY 通道:label 即池键(agent 前缀之外),spawn 只在 label 尚不存在时被接受。
309
+ * 三分支 —— 建(无会话)/ 复用(无 spawn,或有 spawn 且与创建来源相同)/ **冲突(有 spawn 且来源不同:不执行任何命令)**。 */
310
+ private ptyCall;
311
+ hasHub(): boolean;
312
+ private requireHub;
313
+ private assertOpen;
314
+ dispose(): Promise<void>;
315
+ }
316
+ //#endregion
317
+ //#region src/remote/hub-contract.d.ts
318
+ interface RemoteInput {
319
+ target?: string;
320
+ spawn?: string;
321
+ ssh?: SshConnection;
322
+ cmd?: string;
323
+ script?: string;
324
+ stdin?: string;
325
+ mode?: 'oneshot' | 'pty';
326
+ timeout?: number;
327
+ }
328
+ interface PreparedRemoteInput {
329
+ target: string;
330
+ spawn?: string;
331
+ ssh?: SshConnection;
332
+ cmd: string;
333
+ stdin?: string;
334
+ mode?: 'oneshot' | 'pty';
335
+ timeout?: number;
336
+ }
337
+ /** Counters exclude diagnostic banners. dropped is ring eviction; total-returned is all omitted output. */
338
+ type OutputStats = {
339
+ unit: 'utf16' | 'bytes';
340
+ total: number;
341
+ retained: number;
342
+ dropped: number;
343
+ returned: number;
344
+ retentionLimit: number;
345
+ };
346
+ type StreamOutputStats = {
347
+ stdout: OutputStats;
348
+ stderr?: OutputStats;
349
+ };
350
+ interface RemoteProcess {
351
+ cancel(reason?: string): void;
352
+ done: Promise<{
353
+ exit: number | null;
354
+ timedOut: boolean;
355
+ durationMs: number;
356
+ cancelled?: boolean;
357
+ }>;
358
+ /** diagnostic is executor-generated text, not process output; excluded from byte cursor and counters. */
359
+ read(channel: 'stdout' | 'stderr', fromByte: number): {
360
+ text: string;
361
+ nextOffset: number;
362
+ lossy: boolean;
363
+ stats?: OutputStats;
364
+ diagnostic?: string;
365
+ };
366
+ }
367
+ interface BinaryFileEndpoint {
368
+ exportTree(path: string, signal: AbortSignal): Promise<NodeJS.ReadableStream>;
369
+ importTree(path: string, source: NodeJS.ReadableStream, options: {
370
+ mkdir: boolean;
371
+ signal: AbortSignal;
372
+ }): Promise<void>;
373
+ digest(path: string, signal: AbortSignal, selection?: readonly string[]): Promise<{
374
+ sha256: string;
375
+ bytes: number;
376
+ entries: number;
377
+ }>;
378
+ }
379
+ interface HubTarget {
380
+ id: string;
381
+ label: string;
382
+ execEnabled: boolean;
383
+ }
384
+ interface HubRemoteTransport {
385
+ protocol: 1;
386
+ listTargets(): readonly HubTarget[];
387
+ start(machine: string, input: PreparedRemoteInput, owner: string): Promise<RemoteProcess>;
388
+ pty(machine: string, cmd: string, owner: string, options: {
389
+ stdin?: string;
390
+ timeout?: number;
391
+ }): Promise<RemoteCallResult>;
392
+ fileEndpoint(machine: string): BinaryFileEndpoint;
393
+ releaseOwner(owner: string): Promise<void>;
394
+ }
395
+ //#endregion
396
+ //#region src/remote/output-ring.d.ts
397
+ /** Byte-addressed decoded output: mid-codepoint cursors skip forward and explicitly report loss. */
398
+ declare function readUtf8Tail(bytes: Buffer, totalBytes: number, fromByte: number): {
399
+ text: string;
400
+ nextOffset: number;
401
+ lossy: boolean;
402
+ };
403
+ /** Native/PTY retention is UTF16 units; cursor offsets remain real UTF8 bytes. Input is decoded text. */
404
+ declare class Utf16TailRing {
405
+ readonly capacity: number;
406
+ text: string;
407
+ total: number;
408
+ private totalBytes;
409
+ constructor(capacity?: number);
410
+ push(text: string): void;
411
+ stats(returned?: number): OutputStats;
412
+ read(fromByte: number): ReturnType<typeof readUtf8Tail>;
413
+ }
414
+ /** Raw byte retention for Hub oneshot. Tail/read starts skip partial UTF8 prefixes, never invent replacement characters. */
415
+ declare class ByteTailRing {
416
+ readonly capacity: number;
417
+ total: number;
418
+ private chunks;
419
+ private retained;
420
+ constructor(capacity?: number);
421
+ push(chunk: Buffer): void;
422
+ tail(maxBytes?: number): Buffer;
423
+ stats(returned?: number): OutputStats;
424
+ read(fromByte: number): ReturnType<typeof readUtf8Tail>;
425
+ }
426
+ //#endregion
427
+ //#region src/remote/jobs.d.ts
428
+ declare module '@deepseek-ai/dsh-jobs' {
429
+ interface JobKindMap {
430
+ remote: 'remote';
431
+ }
432
+ }
433
+ /** No preparation or discovery before the official registry's admission. */
434
+ declare function startRemoteJob(registry: JobRegistry, input: RemoteInput, exec: ToolRunContext, driver: RemoteDriver): JobId;
435
+ //#endregion
436
+ //#region src/remote/archive.d.ts
437
+ declare const FILE_FRAME_BYTES: number;
438
+ declare const FILE_MAX_ENTRIES = 10000;
439
+ declare const FILE_MAX_METADATA: number;
440
+ declare function checkAbsolute(p: string): void;
441
+ declare function checkSelection(selection: readonly string[]): void;
442
+ /** Internal worker ownership hooks, not a second endpoint contract. */
443
+ interface LocalFileResources {
444
+ receiveRoot?: string;
445
+ temporary?(path: string, active: boolean): Promise<void>;
446
+ }
447
+ declare function localFileEndpoint(resources?: LocalFileResources): BinaryFileEndpoint;
448
+ //#endregion
449
+ //#region src/remote/file-worker.d.ts
450
+ declare function runFileWorker(request: {
451
+ action: 'export' | 'import' | 'digest';
452
+ path: string;
453
+ mkdir: boolean;
454
+ root: string;
455
+ selected: boolean;
456
+ }): Promise<void>;
457
+ //#endregion
4
458
  //#region src/remote/plugin.d.ts
5
-
6
459
  declare const name = "dashr-remote";
7
460
  declare const inject: string[];
8
461
  /** 运行参数旋钮(Ruling P18):无别名表面——容器一律显式 'docker:' / 'incus:' 前缀。 */
@@ -11,14 +464,15 @@ interface RemoteRowConfig {
11
464
  idleTtlSec: number;
12
465
  maxOutputChars: number;
13
466
  }
14
- declare const Config: Schema<RemoteRowConfig>;
467
+ type RemoteConfigValidator = ((value?: unknown) => RemoteRowConfig) & StandardSchemaV1<unknown, RemoteRowConfig> & NativeConfigSchema;
468
+ declare const Config: RemoteConfigValidator;
15
469
  /** MUST stay an arrow(RM0 plugin.ts 同注:function 声明会被 cordis 当构造器 new 掉,返回的 disposer 丢失)。 */
16
470
  declare const apply: (ctx: Context, config: RemoteRowConfig) => (() => void);
17
471
  declare const _default: {
18
472
  name: string;
19
473
  inject: string[];
20
- Config: Schema<RemoteRowConfig>;
474
+ Config: RemoteConfigValidator;
21
475
  apply: (ctx: Context, config: RemoteRowConfig) => (() => void);
22
476
  };
23
477
  //#endregion
24
- export { Config, RemoteRowConfig, apply, _default as default, inject, name };
478
+ export { type BinaryFileEndpoint, ByteTailRing, Config, FILE_FRAME_BYTES, FILE_MAX_ENTRIES, FILE_MAX_METADATA, type HubRemoteTransport, type HubTarget, type OutputStats, PROCESS_CLEANUP_BOUND_MS, type PreparedRemoteInput, RemoteConfigValidator, type RemoteInput, type RemoteProcess, RemoteRowConfig, type RsyncEndpoint, type RsyncReceipt, type RsyncRequest, type SshConnection, SshTargets, type StreamOutputStats, Utf16TailRing, apply, checkAbsolute, checkSelection, _default as default, inject, localFileEndpoint, name, readUtf8Tail, runFileWorker, runRsync, sshArgv, startBinaryProcess, startOneShot, startRemoteJob };