host-execution-mcp 1.0.0

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 (126) hide show
  1. package/CHANGELOG.md +330 -0
  2. package/LICENSE +21 -0
  3. package/README.md +92 -0
  4. package/SECURITY.md +72 -0
  5. package/dist/access/docker-runtime.d.ts +38 -0
  6. package/dist/access/docker-runtime.js +61 -0
  7. package/dist/access/docker-runtime.js.map +1 -0
  8. package/dist/access/index.d.ts +110 -0
  9. package/dist/access/index.js +174 -0
  10. package/dist/access/index.js.map +1 -0
  11. package/dist/access/paradi-auth.d.ts +33 -0
  12. package/dist/access/paradi-auth.js +89 -0
  13. package/dist/access/paradi-auth.js.map +1 -0
  14. package/dist/access/paradi-transport.d.ts +10 -0
  15. package/dist/access/paradi-transport.js +39 -0
  16. package/dist/access/paradi-transport.js.map +1 -0
  17. package/dist/access/paradi-username.d.ts +5 -0
  18. package/dist/access/paradi-username.js +14 -0
  19. package/dist/access/paradi-username.js.map +1 -0
  20. package/dist/access/probe.d.ts +14 -0
  21. package/dist/access/probe.js +63 -0
  22. package/dist/access/probe.js.map +1 -0
  23. package/dist/access/session-pool.d.ts +25 -0
  24. package/dist/access/session-pool.js +46 -0
  25. package/dist/access/session-pool.js.map +1 -0
  26. package/dist/access/ssh-transport.d.ts +16 -0
  27. package/dist/access/ssh-transport.js +74 -0
  28. package/dist/access/ssh-transport.js.map +1 -0
  29. package/dist/access/types.d.ts +43 -0
  30. package/dist/access/types.js +21 -0
  31. package/dist/access/types.js.map +1 -0
  32. package/dist/config.d.ts +52 -0
  33. package/dist/config.js +179 -0
  34. package/dist/config.js.map +1 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +19 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/instructions.d.ts +4 -0
  39. package/dist/instructions.js +93 -0
  40. package/dist/instructions.js.map +1 -0
  41. package/dist/kubectl/runner.d.ts +32 -0
  42. package/dist/kubectl/runner.js +79 -0
  43. package/dist/kubectl/runner.js.map +1 -0
  44. package/dist/server.d.ts +3 -0
  45. package/dist/server.js +24 -0
  46. package/dist/server.js.map +1 -0
  47. package/dist/ssh/access-client.d.ts +62 -0
  48. package/dist/ssh/access-client.js +470 -0
  49. package/dist/ssh/access-client.js.map +1 -0
  50. package/dist/ssh/access-errors.d.ts +53 -0
  51. package/dist/ssh/access-errors.js +180 -0
  52. package/dist/ssh/access-errors.js.map +1 -0
  53. package/dist/ssh/access-sftp.d.ts +14 -0
  54. package/dist/ssh/access-sftp.js +456 -0
  55. package/dist/ssh/access-sftp.js.map +1 -0
  56. package/dist/ssh/bastion-client.d.ts +60 -0
  57. package/dist/ssh/bastion-client.js +423 -0
  58. package/dist/ssh/bastion-client.js.map +1 -0
  59. package/dist/ssh/bastion-errors.d.ts +62 -0
  60. package/dist/ssh/bastion-errors.js +190 -0
  61. package/dist/ssh/bastion-errors.js.map +1 -0
  62. package/dist/ssh/hop1-sftp.d.ts +14 -0
  63. package/dist/ssh/hop1-sftp.js +437 -0
  64. package/dist/ssh/hop1-sftp.js.map +1 -0
  65. package/dist/tools/copy-job-schemas.d.ts +709 -0
  66. package/dist/tools/copy-job-schemas.js +48 -0
  67. package/dist/tools/copy-job-schemas.js.map +1 -0
  68. package/dist/tools/register.d.ts +14 -0
  69. package/dist/tools/register.js +619 -0
  70. package/dist/tools/register.js.map +1 -0
  71. package/dist/tools/remote-schemas.d.ts +879 -0
  72. package/dist/tools/remote-schemas.js +214 -0
  73. package/dist/tools/remote-schemas.js.map +1 -0
  74. package/dist/utils/copy-executor.d.ts +41 -0
  75. package/dist/utils/copy-executor.js +231 -0
  76. package/dist/utils/copy-executor.js.map +1 -0
  77. package/dist/utils/copy-job-manager.d.ts +34 -0
  78. package/dist/utils/copy-job-manager.js +400 -0
  79. package/dist/utils/copy-job-manager.js.map +1 -0
  80. package/dist/utils/copy-job-store.d.ts +18 -0
  81. package/dist/utils/copy-job-store.js +104 -0
  82. package/dist/utils/copy-job-store.js.map +1 -0
  83. package/dist/utils/copy-job-types.d.ts +133 -0
  84. package/dist/utils/copy-job-types.js +37 -0
  85. package/dist/utils/copy-job-types.js.map +1 -0
  86. package/dist/utils/copy-transfer.d.ts +59 -0
  87. package/dist/utils/copy-transfer.js +86 -0
  88. package/dist/utils/copy-transfer.js.map +1 -0
  89. package/dist/utils/remote-copy.d.ts +14 -0
  90. package/dist/utils/remote-copy.js +115 -0
  91. package/dist/utils/remote-copy.js.map +1 -0
  92. package/dist/utils/remote-executor.d.ts +15 -0
  93. package/dist/utils/remote-executor.js +34 -0
  94. package/dist/utils/remote-executor.js.map +1 -0
  95. package/dist/utils/remote-target.d.ts +22 -0
  96. package/dist/utils/remote-target.js +75 -0
  97. package/dist/utils/remote-target.js.map +1 -0
  98. package/dist/utils/result.d.ts +87 -0
  99. package/dist/utils/result.js +81 -0
  100. package/dist/utils/result.js.map +1 -0
  101. package/dist/utils/shell-quote.d.ts +22 -0
  102. package/dist/utils/shell-quote.js +55 -0
  103. package/dist/utils/shell-quote.js.map +1 -0
  104. package/dist/utils/timeout.d.ts +1 -0
  105. package/dist/utils/timeout.js +18 -0
  106. package/dist/utils/timeout.js.map +1 -0
  107. package/dist/utils/truncate.d.ts +5 -0
  108. package/dist/utils/truncate.js +12 -0
  109. package/dist/utils/truncate.js.map +1 -0
  110. package/dist/version.d.ts +1 -0
  111. package/dist/version.js +7 -0
  112. package/dist/version.js.map +1 -0
  113. package/docs/AGENT_GUIDE.md +161 -0
  114. package/docs/CONFIGURATION.md +130 -0
  115. package/docs/COPY_SPECIALIZED_TEST_CHECKLIST.md +9 -0
  116. package/docs/HOP1_E2E_CHECKLIST.md +128 -0
  117. package/docs/HOP1_E2E_RESULTS.json +647 -0
  118. package/docs/PARADI_ACCESS_PLAN.md +272 -0
  119. package/docs/REMOTE_COPY_JOB_API.md +92 -0
  120. package/docs/TODO.md +66 -0
  121. package/docs/USER_GUIDE.zh-CN.md +93 -0
  122. package/docs/clients/claude-desktop.json.example +12 -0
  123. package/docs/clients/cursor-npx.json.example +12 -0
  124. package/docs/clients/cursor.json.example +12 -0
  125. package/docs/clients/vscode.json.example +12 -0
  126. package/package.json +65 -0
@@ -0,0 +1,879 @@
1
+ import { z } from "zod";
2
+ import type { AccessRuntime } from "../access/index.js";
3
+ import type { FileEndpoint } from "../utils/remote-copy.js";
4
+ export declare const landingTarget: z.ZodLiteral<"landing">;
5
+ export declare const podFields: {
6
+ namespace: z.ZodString;
7
+ pod: z.ZodString;
8
+ container: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare const contextFields: {
11
+ contextKey: z.ZodString;
12
+ };
13
+ export type RemoteSchemaOpts = {
14
+ allowContext?: boolean;
15
+ };
16
+ /** Shared landing | pod [| context] discriminated union builder. */
17
+ export declare function remotePathUnion<T extends z.ZodRawShape>(fields: T, opts?: RemoteSchemaOpts): z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
18
+ target: z.ZodLiteral<"landing">;
19
+ } & T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
20
+ target: z.ZodLiteral<"landing">;
21
+ } & T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
22
+ target: z.ZodLiteral<"landing">;
23
+ } & T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>, z.ZodObject<{
24
+ namespace: z.ZodString;
25
+ pod: z.ZodString;
26
+ container: z.ZodOptional<z.ZodString>;
27
+ target: z.ZodLiteral<"pod">;
28
+ } & T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
29
+ namespace: z.ZodString;
30
+ pod: z.ZodString;
31
+ container: z.ZodOptional<z.ZodString>;
32
+ target: z.ZodLiteral<"pod">;
33
+ } & T>, any> extends infer T_3 ? { [k_2 in keyof T_3]: T_3[k_2]; } : never, z.baseObjectInputType<{
34
+ namespace: z.ZodString;
35
+ pod: z.ZodString;
36
+ container: z.ZodOptional<z.ZodString>;
37
+ target: z.ZodLiteral<"pod">;
38
+ } & T> extends infer T_4 ? { [k_3 in keyof T_4]: T_4[k_3]; } : never>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
39
+ target: z.ZodLiteral<"landing">;
40
+ } & T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
41
+ target: z.ZodLiteral<"landing">;
42
+ } & T>, any> extends infer T_5 ? { [k in keyof T_5]: T_5[k]; } : never, z.baseObjectInputType<{
43
+ target: z.ZodLiteral<"landing">;
44
+ } & T> extends infer T_6 ? { [k_1 in keyof T_6]: T_6[k_1]; } : never>, z.ZodObject<{
45
+ namespace: z.ZodString;
46
+ pod: z.ZodString;
47
+ container: z.ZodOptional<z.ZodString>;
48
+ target: z.ZodLiteral<"pod">;
49
+ } & T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
50
+ namespace: z.ZodString;
51
+ pod: z.ZodString;
52
+ container: z.ZodOptional<z.ZodString>;
53
+ target: z.ZodLiteral<"pod">;
54
+ } & T>, any> extends infer T_7 ? { [k_2 in keyof T_7]: T_7[k_2]; } : never, z.baseObjectInputType<{
55
+ namespace: z.ZodString;
56
+ pod: z.ZodString;
57
+ container: z.ZodOptional<z.ZodString>;
58
+ target: z.ZodLiteral<"pod">;
59
+ } & T> extends infer T_8 ? { [k_3 in keyof T_8]: T_8[k_3]; } : never>, z.ZodObject<{
60
+ contextKey: z.ZodString;
61
+ target: z.ZodLiteral<"context">;
62
+ } & T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
63
+ contextKey: z.ZodString;
64
+ target: z.ZodLiteral<"context">;
65
+ } & T>, any> extends infer T_9 ? { [k_4 in keyof T_9]: T_9[k_4]; } : never, z.baseObjectInputType<{
66
+ contextKey: z.ZodString;
67
+ target: z.ZodLiteral<"context">;
68
+ } & T> extends infer T_10 ? { [k_5 in keyof T_10]: T_10[k_5]; } : never>]>;
69
+ export declare function buildRemoteReadFileSchema(opts?: RemoteSchemaOpts): z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
70
+ target: z.ZodLiteral<"landing">;
71
+ } & {
72
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
73
+ lines: z.ZodOptional<z.ZodNumber>;
74
+ maxLines: z.ZodOptional<z.ZodNumber>;
75
+ offset: z.ZodOptional<z.ZodNumber>;
76
+ grep: z.ZodOptional<z.ZodString>;
77
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
78
+ path: z.ZodString;
79
+ }, "strict", z.ZodTypeAny, {
80
+ target: "landing";
81
+ path: string;
82
+ timeoutMs?: number | undefined;
83
+ mode?: "head" | "tail" | undefined;
84
+ lines?: number | undefined;
85
+ maxLines?: number | undefined;
86
+ offset?: number | undefined;
87
+ grep?: string | undefined;
88
+ }, {
89
+ target: "landing";
90
+ path: string;
91
+ timeoutMs?: number | undefined;
92
+ mode?: "head" | "tail" | undefined;
93
+ lines?: number | undefined;
94
+ maxLines?: number | undefined;
95
+ offset?: number | undefined;
96
+ grep?: string | undefined;
97
+ }>, z.ZodObject<{
98
+ namespace: z.ZodString;
99
+ pod: z.ZodString;
100
+ container: z.ZodOptional<z.ZodString>;
101
+ target: z.ZodLiteral<"pod">;
102
+ } & {
103
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
104
+ lines: z.ZodOptional<z.ZodNumber>;
105
+ maxLines: z.ZodOptional<z.ZodNumber>;
106
+ offset: z.ZodOptional<z.ZodNumber>;
107
+ grep: z.ZodOptional<z.ZodString>;
108
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
109
+ path: z.ZodString;
110
+ }, "strict", z.ZodTypeAny, {
111
+ pod: string;
112
+ target: "pod";
113
+ path: string;
114
+ namespace: string;
115
+ timeoutMs?: number | undefined;
116
+ container?: string | undefined;
117
+ mode?: "head" | "tail" | undefined;
118
+ lines?: number | undefined;
119
+ maxLines?: number | undefined;
120
+ offset?: number | undefined;
121
+ grep?: string | undefined;
122
+ }, {
123
+ pod: string;
124
+ target: "pod";
125
+ path: string;
126
+ namespace: string;
127
+ timeoutMs?: number | undefined;
128
+ container?: string | undefined;
129
+ mode?: "head" | "tail" | undefined;
130
+ lines?: number | undefined;
131
+ maxLines?: number | undefined;
132
+ offset?: number | undefined;
133
+ grep?: string | undefined;
134
+ }>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
135
+ target: z.ZodLiteral<"landing">;
136
+ } & {
137
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
138
+ lines: z.ZodOptional<z.ZodNumber>;
139
+ maxLines: z.ZodOptional<z.ZodNumber>;
140
+ offset: z.ZodOptional<z.ZodNumber>;
141
+ grep: z.ZodOptional<z.ZodString>;
142
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
143
+ path: z.ZodString;
144
+ }, "strict", z.ZodTypeAny, {
145
+ target: "landing";
146
+ path: string;
147
+ timeoutMs?: number | undefined;
148
+ mode?: "head" | "tail" | undefined;
149
+ lines?: number | undefined;
150
+ maxLines?: number | undefined;
151
+ offset?: number | undefined;
152
+ grep?: string | undefined;
153
+ }, {
154
+ target: "landing";
155
+ path: string;
156
+ timeoutMs?: number | undefined;
157
+ mode?: "head" | "tail" | undefined;
158
+ lines?: number | undefined;
159
+ maxLines?: number | undefined;
160
+ offset?: number | undefined;
161
+ grep?: string | undefined;
162
+ }>, z.ZodObject<{
163
+ namespace: z.ZodString;
164
+ pod: z.ZodString;
165
+ container: z.ZodOptional<z.ZodString>;
166
+ target: z.ZodLiteral<"pod">;
167
+ } & {
168
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
169
+ lines: z.ZodOptional<z.ZodNumber>;
170
+ maxLines: z.ZodOptional<z.ZodNumber>;
171
+ offset: z.ZodOptional<z.ZodNumber>;
172
+ grep: z.ZodOptional<z.ZodString>;
173
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
174
+ path: z.ZodString;
175
+ }, "strict", z.ZodTypeAny, {
176
+ pod: string;
177
+ target: "pod";
178
+ path: string;
179
+ namespace: string;
180
+ timeoutMs?: number | undefined;
181
+ container?: string | undefined;
182
+ mode?: "head" | "tail" | undefined;
183
+ lines?: number | undefined;
184
+ maxLines?: number | undefined;
185
+ offset?: number | undefined;
186
+ grep?: string | undefined;
187
+ }, {
188
+ pod: string;
189
+ target: "pod";
190
+ path: string;
191
+ namespace: string;
192
+ timeoutMs?: number | undefined;
193
+ container?: string | undefined;
194
+ mode?: "head" | "tail" | undefined;
195
+ lines?: number | undefined;
196
+ maxLines?: number | undefined;
197
+ offset?: number | undefined;
198
+ grep?: string | undefined;
199
+ }>, z.ZodObject<{
200
+ contextKey: z.ZodString;
201
+ target: z.ZodLiteral<"context">;
202
+ } & {
203
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
204
+ lines: z.ZodOptional<z.ZodNumber>;
205
+ maxLines: z.ZodOptional<z.ZodNumber>;
206
+ offset: z.ZodOptional<z.ZodNumber>;
207
+ grep: z.ZodOptional<z.ZodString>;
208
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
209
+ path: z.ZodString;
210
+ }, "strict", z.ZodTypeAny, {
211
+ contextKey: string;
212
+ target: "context";
213
+ path: string;
214
+ timeoutMs?: number | undefined;
215
+ mode?: "head" | "tail" | undefined;
216
+ lines?: number | undefined;
217
+ maxLines?: number | undefined;
218
+ offset?: number | undefined;
219
+ grep?: string | undefined;
220
+ }, {
221
+ contextKey: string;
222
+ target: "context";
223
+ path: string;
224
+ timeoutMs?: number | undefined;
225
+ mode?: "head" | "tail" | undefined;
226
+ lines?: number | undefined;
227
+ maxLines?: number | undefined;
228
+ offset?: number | undefined;
229
+ grep?: string | undefined;
230
+ }>]>;
231
+ export declare function buildRemotePsSchema(opts?: RemoteSchemaOpts): z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
232
+ target: z.ZodLiteral<"landing">;
233
+ } & {
234
+ pattern: z.ZodOptional<z.ZodString>;
235
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
236
+ }, "strict", z.ZodTypeAny, {
237
+ target: "landing";
238
+ timeoutMs?: number | undefined;
239
+ pattern?: string | undefined;
240
+ }, {
241
+ target: "landing";
242
+ timeoutMs?: number | undefined;
243
+ pattern?: string | undefined;
244
+ }>, z.ZodObject<{
245
+ namespace: z.ZodString;
246
+ pod: z.ZodString;
247
+ container: z.ZodOptional<z.ZodString>;
248
+ target: z.ZodLiteral<"pod">;
249
+ } & {
250
+ pattern: z.ZodOptional<z.ZodString>;
251
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
252
+ }, "strict", z.ZodTypeAny, {
253
+ pod: string;
254
+ target: "pod";
255
+ namespace: string;
256
+ timeoutMs?: number | undefined;
257
+ container?: string | undefined;
258
+ pattern?: string | undefined;
259
+ }, {
260
+ pod: string;
261
+ target: "pod";
262
+ namespace: string;
263
+ timeoutMs?: number | undefined;
264
+ container?: string | undefined;
265
+ pattern?: string | undefined;
266
+ }>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
267
+ target: z.ZodLiteral<"landing">;
268
+ } & {
269
+ pattern: z.ZodOptional<z.ZodString>;
270
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
271
+ }, "strict", z.ZodTypeAny, {
272
+ target: "landing";
273
+ timeoutMs?: number | undefined;
274
+ pattern?: string | undefined;
275
+ }, {
276
+ target: "landing";
277
+ timeoutMs?: number | undefined;
278
+ pattern?: string | undefined;
279
+ }>, z.ZodObject<{
280
+ namespace: z.ZodString;
281
+ pod: z.ZodString;
282
+ container: z.ZodOptional<z.ZodString>;
283
+ target: z.ZodLiteral<"pod">;
284
+ } & {
285
+ pattern: z.ZodOptional<z.ZodString>;
286
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
287
+ }, "strict", z.ZodTypeAny, {
288
+ pod: string;
289
+ target: "pod";
290
+ namespace: string;
291
+ timeoutMs?: number | undefined;
292
+ container?: string | undefined;
293
+ pattern?: string | undefined;
294
+ }, {
295
+ pod: string;
296
+ target: "pod";
297
+ namespace: string;
298
+ timeoutMs?: number | undefined;
299
+ container?: string | undefined;
300
+ pattern?: string | undefined;
301
+ }>, z.ZodObject<{
302
+ contextKey: z.ZodString;
303
+ target: z.ZodLiteral<"context">;
304
+ } & {
305
+ pattern: z.ZodOptional<z.ZodString>;
306
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
307
+ }, "strict", z.ZodTypeAny, {
308
+ contextKey: string;
309
+ target: "context";
310
+ timeoutMs?: number | undefined;
311
+ pattern?: string | undefined;
312
+ }, {
313
+ contextKey: string;
314
+ target: "context";
315
+ timeoutMs?: number | undefined;
316
+ pattern?: string | undefined;
317
+ }>]>;
318
+ /** Default schemas (ACCESS_KIND=ssh — context allowed). */
319
+ export declare const remoteReadFileSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
320
+ target: z.ZodLiteral<"landing">;
321
+ } & {
322
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
323
+ lines: z.ZodOptional<z.ZodNumber>;
324
+ maxLines: z.ZodOptional<z.ZodNumber>;
325
+ offset: z.ZodOptional<z.ZodNumber>;
326
+ grep: z.ZodOptional<z.ZodString>;
327
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
328
+ path: z.ZodString;
329
+ }, "strict", z.ZodTypeAny, {
330
+ target: "landing";
331
+ path: string;
332
+ timeoutMs?: number | undefined;
333
+ mode?: "head" | "tail" | undefined;
334
+ lines?: number | undefined;
335
+ maxLines?: number | undefined;
336
+ offset?: number | undefined;
337
+ grep?: string | undefined;
338
+ }, {
339
+ target: "landing";
340
+ path: string;
341
+ timeoutMs?: number | undefined;
342
+ mode?: "head" | "tail" | undefined;
343
+ lines?: number | undefined;
344
+ maxLines?: number | undefined;
345
+ offset?: number | undefined;
346
+ grep?: string | undefined;
347
+ }>, z.ZodObject<{
348
+ namespace: z.ZodString;
349
+ pod: z.ZodString;
350
+ container: z.ZodOptional<z.ZodString>;
351
+ target: z.ZodLiteral<"pod">;
352
+ } & {
353
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
354
+ lines: z.ZodOptional<z.ZodNumber>;
355
+ maxLines: z.ZodOptional<z.ZodNumber>;
356
+ offset: z.ZodOptional<z.ZodNumber>;
357
+ grep: z.ZodOptional<z.ZodString>;
358
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
359
+ path: z.ZodString;
360
+ }, "strict", z.ZodTypeAny, {
361
+ pod: string;
362
+ target: "pod";
363
+ path: string;
364
+ namespace: string;
365
+ timeoutMs?: number | undefined;
366
+ container?: string | undefined;
367
+ mode?: "head" | "tail" | undefined;
368
+ lines?: number | undefined;
369
+ maxLines?: number | undefined;
370
+ offset?: number | undefined;
371
+ grep?: string | undefined;
372
+ }, {
373
+ pod: string;
374
+ target: "pod";
375
+ path: string;
376
+ namespace: string;
377
+ timeoutMs?: number | undefined;
378
+ container?: string | undefined;
379
+ mode?: "head" | "tail" | undefined;
380
+ lines?: number | undefined;
381
+ maxLines?: number | undefined;
382
+ offset?: number | undefined;
383
+ grep?: string | undefined;
384
+ }>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
385
+ target: z.ZodLiteral<"landing">;
386
+ } & {
387
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
388
+ lines: z.ZodOptional<z.ZodNumber>;
389
+ maxLines: z.ZodOptional<z.ZodNumber>;
390
+ offset: z.ZodOptional<z.ZodNumber>;
391
+ grep: z.ZodOptional<z.ZodString>;
392
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
393
+ path: z.ZodString;
394
+ }, "strict", z.ZodTypeAny, {
395
+ target: "landing";
396
+ path: string;
397
+ timeoutMs?: number | undefined;
398
+ mode?: "head" | "tail" | undefined;
399
+ lines?: number | undefined;
400
+ maxLines?: number | undefined;
401
+ offset?: number | undefined;
402
+ grep?: string | undefined;
403
+ }, {
404
+ target: "landing";
405
+ path: string;
406
+ timeoutMs?: number | undefined;
407
+ mode?: "head" | "tail" | undefined;
408
+ lines?: number | undefined;
409
+ maxLines?: number | undefined;
410
+ offset?: number | undefined;
411
+ grep?: string | undefined;
412
+ }>, z.ZodObject<{
413
+ namespace: z.ZodString;
414
+ pod: z.ZodString;
415
+ container: z.ZodOptional<z.ZodString>;
416
+ target: z.ZodLiteral<"pod">;
417
+ } & {
418
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
419
+ lines: z.ZodOptional<z.ZodNumber>;
420
+ maxLines: z.ZodOptional<z.ZodNumber>;
421
+ offset: z.ZodOptional<z.ZodNumber>;
422
+ grep: z.ZodOptional<z.ZodString>;
423
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
424
+ path: z.ZodString;
425
+ }, "strict", z.ZodTypeAny, {
426
+ pod: string;
427
+ target: "pod";
428
+ path: string;
429
+ namespace: string;
430
+ timeoutMs?: number | undefined;
431
+ container?: string | undefined;
432
+ mode?: "head" | "tail" | undefined;
433
+ lines?: number | undefined;
434
+ maxLines?: number | undefined;
435
+ offset?: number | undefined;
436
+ grep?: string | undefined;
437
+ }, {
438
+ pod: string;
439
+ target: "pod";
440
+ path: string;
441
+ namespace: string;
442
+ timeoutMs?: number | undefined;
443
+ container?: string | undefined;
444
+ mode?: "head" | "tail" | undefined;
445
+ lines?: number | undefined;
446
+ maxLines?: number | undefined;
447
+ offset?: number | undefined;
448
+ grep?: string | undefined;
449
+ }>, z.ZodObject<{
450
+ contextKey: z.ZodString;
451
+ target: z.ZodLiteral<"context">;
452
+ } & {
453
+ mode: z.ZodOptional<z.ZodEnum<["head", "tail"]>>;
454
+ lines: z.ZodOptional<z.ZodNumber>;
455
+ maxLines: z.ZodOptional<z.ZodNumber>;
456
+ offset: z.ZodOptional<z.ZodNumber>;
457
+ grep: z.ZodOptional<z.ZodString>;
458
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
459
+ path: z.ZodString;
460
+ }, "strict", z.ZodTypeAny, {
461
+ contextKey: string;
462
+ target: "context";
463
+ path: string;
464
+ timeoutMs?: number | undefined;
465
+ mode?: "head" | "tail" | undefined;
466
+ lines?: number | undefined;
467
+ maxLines?: number | undefined;
468
+ offset?: number | undefined;
469
+ grep?: string | undefined;
470
+ }, {
471
+ contextKey: string;
472
+ target: "context";
473
+ path: string;
474
+ timeoutMs?: number | undefined;
475
+ mode?: "head" | "tail" | undefined;
476
+ lines?: number | undefined;
477
+ maxLines?: number | undefined;
478
+ offset?: number | undefined;
479
+ grep?: string | undefined;
480
+ }>]>;
481
+ export declare const remotePsSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
482
+ target: z.ZodLiteral<"landing">;
483
+ } & {
484
+ pattern: z.ZodOptional<z.ZodString>;
485
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
486
+ }, "strict", z.ZodTypeAny, {
487
+ target: "landing";
488
+ timeoutMs?: number | undefined;
489
+ pattern?: string | undefined;
490
+ }, {
491
+ target: "landing";
492
+ timeoutMs?: number | undefined;
493
+ pattern?: string | undefined;
494
+ }>, z.ZodObject<{
495
+ namespace: z.ZodString;
496
+ pod: z.ZodString;
497
+ container: z.ZodOptional<z.ZodString>;
498
+ target: z.ZodLiteral<"pod">;
499
+ } & {
500
+ pattern: z.ZodOptional<z.ZodString>;
501
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
502
+ }, "strict", z.ZodTypeAny, {
503
+ pod: string;
504
+ target: "pod";
505
+ namespace: string;
506
+ timeoutMs?: number | undefined;
507
+ container?: string | undefined;
508
+ pattern?: string | undefined;
509
+ }, {
510
+ pod: string;
511
+ target: "pod";
512
+ namespace: string;
513
+ timeoutMs?: number | undefined;
514
+ container?: string | undefined;
515
+ pattern?: string | undefined;
516
+ }>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
517
+ target: z.ZodLiteral<"landing">;
518
+ } & {
519
+ pattern: z.ZodOptional<z.ZodString>;
520
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
521
+ }, "strict", z.ZodTypeAny, {
522
+ target: "landing";
523
+ timeoutMs?: number | undefined;
524
+ pattern?: string | undefined;
525
+ }, {
526
+ target: "landing";
527
+ timeoutMs?: number | undefined;
528
+ pattern?: string | undefined;
529
+ }>, z.ZodObject<{
530
+ namespace: z.ZodString;
531
+ pod: z.ZodString;
532
+ container: z.ZodOptional<z.ZodString>;
533
+ target: z.ZodLiteral<"pod">;
534
+ } & {
535
+ pattern: z.ZodOptional<z.ZodString>;
536
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
537
+ }, "strict", z.ZodTypeAny, {
538
+ pod: string;
539
+ target: "pod";
540
+ namespace: string;
541
+ timeoutMs?: number | undefined;
542
+ container?: string | undefined;
543
+ pattern?: string | undefined;
544
+ }, {
545
+ pod: string;
546
+ target: "pod";
547
+ namespace: string;
548
+ timeoutMs?: number | undefined;
549
+ container?: string | undefined;
550
+ pattern?: string | undefined;
551
+ }>, z.ZodObject<{
552
+ contextKey: z.ZodString;
553
+ target: z.ZodLiteral<"context">;
554
+ } & {
555
+ pattern: z.ZodOptional<z.ZodString>;
556
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
557
+ }, "strict", z.ZodTypeAny, {
558
+ contextKey: string;
559
+ target: "context";
560
+ timeoutMs?: number | undefined;
561
+ pattern?: string | undefined;
562
+ }, {
563
+ contextKey: string;
564
+ target: "context";
565
+ timeoutMs?: number | undefined;
566
+ pattern?: string | undefined;
567
+ }>]>;
568
+ export type RemoteReadFileInput = z.infer<typeof remoteReadFileSchema>;
569
+ export type RemotePsInput = z.infer<typeof remotePsSchema>;
570
+ export type RemotePathInput = RemoteReadFileInput | RemotePsInput;
571
+ /** Map discriminated-union input to internal RemoteTarget. */
572
+ export declare function remoteInputToTarget(args: RemotePathInput): {
573
+ target: "landing";
574
+ namespace?: undefined;
575
+ pod?: undefined;
576
+ container?: undefined;
577
+ contextKey?: undefined;
578
+ } | {
579
+ target: "pod";
580
+ namespace: string;
581
+ pod: string;
582
+ container: string | undefined;
583
+ contextKey?: undefined;
584
+ } | {
585
+ target: "context";
586
+ contextKey: string;
587
+ namespace?: undefined;
588
+ pod?: undefined;
589
+ container?: undefined;
590
+ };
591
+ export type RemoteTarget = ReturnType<typeof remoteInputToTarget>;
592
+ export declare function buildRemoteFileEndpointSchema(opts?: RemoteSchemaOpts): z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
593
+ path: z.ZodString;
594
+ target: z.ZodLiteral<"local">;
595
+ }, "strict", z.ZodTypeAny, {
596
+ target: "local";
597
+ path: string;
598
+ }, {
599
+ target: "local";
600
+ path: string;
601
+ }>, z.ZodObject<{
602
+ path: z.ZodString;
603
+ target: z.ZodLiteral<"landing">;
604
+ }, "strict", z.ZodTypeAny, {
605
+ target: "landing";
606
+ path: string;
607
+ }, {
608
+ target: "landing";
609
+ path: string;
610
+ }>, z.ZodObject<{
611
+ path: z.ZodString;
612
+ namespace: z.ZodString;
613
+ pod: z.ZodString;
614
+ container: z.ZodOptional<z.ZodString>;
615
+ target: z.ZodLiteral<"pod">;
616
+ }, "strict", z.ZodTypeAny, {
617
+ pod: string;
618
+ target: "pod";
619
+ path: string;
620
+ namespace: string;
621
+ container?: string | undefined;
622
+ }, {
623
+ pod: string;
624
+ target: "pod";
625
+ path: string;
626
+ namespace: string;
627
+ container?: string | undefined;
628
+ }>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
629
+ path: z.ZodString;
630
+ target: z.ZodLiteral<"local">;
631
+ }, "strict", z.ZodTypeAny, {
632
+ target: "local";
633
+ path: string;
634
+ }, {
635
+ target: "local";
636
+ path: string;
637
+ }>, z.ZodObject<{
638
+ path: z.ZodString;
639
+ target: z.ZodLiteral<"landing">;
640
+ }, "strict", z.ZodTypeAny, {
641
+ target: "landing";
642
+ path: string;
643
+ }, {
644
+ target: "landing";
645
+ path: string;
646
+ }>, z.ZodObject<{
647
+ path: z.ZodString;
648
+ namespace: z.ZodString;
649
+ pod: z.ZodString;
650
+ container: z.ZodOptional<z.ZodString>;
651
+ target: z.ZodLiteral<"pod">;
652
+ }, "strict", z.ZodTypeAny, {
653
+ pod: string;
654
+ target: "pod";
655
+ path: string;
656
+ namespace: string;
657
+ container?: string | undefined;
658
+ }, {
659
+ pod: string;
660
+ target: "pod";
661
+ path: string;
662
+ namespace: string;
663
+ container?: string | undefined;
664
+ }>, z.ZodObject<{
665
+ path: z.ZodString;
666
+ contextKey: z.ZodString;
667
+ target: z.ZodLiteral<"context">;
668
+ }, "strict", z.ZodTypeAny, {
669
+ contextKey: string;
670
+ target: "context";
671
+ path: string;
672
+ }, {
673
+ contextKey: string;
674
+ target: "context";
675
+ path: string;
676
+ }>]>;
677
+ export declare const remoteFileEndpointSchema: z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
678
+ path: z.ZodString;
679
+ target: z.ZodLiteral<"local">;
680
+ }, "strict", z.ZodTypeAny, {
681
+ target: "local";
682
+ path: string;
683
+ }, {
684
+ target: "local";
685
+ path: string;
686
+ }>, z.ZodObject<{
687
+ path: z.ZodString;
688
+ target: z.ZodLiteral<"landing">;
689
+ }, "strict", z.ZodTypeAny, {
690
+ target: "landing";
691
+ path: string;
692
+ }, {
693
+ target: "landing";
694
+ path: string;
695
+ }>, z.ZodObject<{
696
+ path: z.ZodString;
697
+ namespace: z.ZodString;
698
+ pod: z.ZodString;
699
+ container: z.ZodOptional<z.ZodString>;
700
+ target: z.ZodLiteral<"pod">;
701
+ }, "strict", z.ZodTypeAny, {
702
+ pod: string;
703
+ target: "pod";
704
+ path: string;
705
+ namespace: string;
706
+ container?: string | undefined;
707
+ }, {
708
+ pod: string;
709
+ target: "pod";
710
+ path: string;
711
+ namespace: string;
712
+ container?: string | undefined;
713
+ }>]> | z.ZodDiscriminatedUnion<"target", [z.ZodObject<{
714
+ path: z.ZodString;
715
+ target: z.ZodLiteral<"local">;
716
+ }, "strict", z.ZodTypeAny, {
717
+ target: "local";
718
+ path: string;
719
+ }, {
720
+ target: "local";
721
+ path: string;
722
+ }>, z.ZodObject<{
723
+ path: z.ZodString;
724
+ target: z.ZodLiteral<"landing">;
725
+ }, "strict", z.ZodTypeAny, {
726
+ target: "landing";
727
+ path: string;
728
+ }, {
729
+ target: "landing";
730
+ path: string;
731
+ }>, z.ZodObject<{
732
+ path: z.ZodString;
733
+ namespace: z.ZodString;
734
+ pod: z.ZodString;
735
+ container: z.ZodOptional<z.ZodString>;
736
+ target: z.ZodLiteral<"pod">;
737
+ }, "strict", z.ZodTypeAny, {
738
+ pod: string;
739
+ target: "pod";
740
+ path: string;
741
+ namespace: string;
742
+ container?: string | undefined;
743
+ }, {
744
+ pod: string;
745
+ target: "pod";
746
+ path: string;
747
+ namespace: string;
748
+ container?: string | undefined;
749
+ }>, z.ZodObject<{
750
+ path: z.ZodString;
751
+ contextKey: z.ZodString;
752
+ target: z.ZodLiteral<"context">;
753
+ }, "strict", z.ZodTypeAny, {
754
+ contextKey: string;
755
+ target: "context";
756
+ path: string;
757
+ }, {
758
+ contextKey: string;
759
+ target: "context";
760
+ path: string;
761
+ }>]>;
762
+ export type RemoteFileEndpoint = z.infer<typeof remoteFileEndpointSchema>;
763
+ export declare function buildRemoteCopyFileSchema(opts?: RemoteSchemaOpts): z.ZodEffects<z.ZodObject<{
764
+ source: z.ZodType<any, z.ZodTypeDef, any>;
765
+ dest: z.ZodType<any, z.ZodTypeDef, any>;
766
+ recursive: z.ZodOptional<z.ZodBoolean>;
767
+ /** @deprecated Prefer totalTimeoutMs; mapped to totalTimeoutMs when set. */
768
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
769
+ skipIfComplete: z.ZodOptional<z.ZodBoolean>;
770
+ progressIntervalMs: z.ZodOptional<z.ZodNumber>;
771
+ totalTimeoutMs: z.ZodOptional<z.ZodNumber>;
772
+ connectionTimeoutMs: z.ZodOptional<z.ZodNumber>;
773
+ verify: z.ZodOptional<z.ZodEnum<["none", "size", "size+sha256"]>>;
774
+ }, "strict", z.ZodTypeAny, {
775
+ timeoutMs?: number | undefined;
776
+ source?: any;
777
+ dest?: any;
778
+ recursive?: boolean | undefined;
779
+ skipIfComplete?: boolean | undefined;
780
+ verify?: "none" | "size" | "size+sha256" | undefined;
781
+ progressIntervalMs?: number | undefined;
782
+ totalTimeoutMs?: number | undefined;
783
+ connectionTimeoutMs?: number | undefined;
784
+ }, {
785
+ timeoutMs?: number | undefined;
786
+ source?: any;
787
+ dest?: any;
788
+ recursive?: boolean | undefined;
789
+ skipIfComplete?: boolean | undefined;
790
+ verify?: "none" | "size" | "size+sha256" | undefined;
791
+ progressIntervalMs?: number | undefined;
792
+ totalTimeoutMs?: number | undefined;
793
+ connectionTimeoutMs?: number | undefined;
794
+ }>, {
795
+ timeoutMs?: number | undefined;
796
+ source?: any;
797
+ dest?: any;
798
+ recursive?: boolean | undefined;
799
+ skipIfComplete?: boolean | undefined;
800
+ verify?: "none" | "size" | "size+sha256" | undefined;
801
+ progressIntervalMs?: number | undefined;
802
+ totalTimeoutMs?: number | undefined;
803
+ connectionTimeoutMs?: number | undefined;
804
+ }, {
805
+ timeoutMs?: number | undefined;
806
+ source?: any;
807
+ dest?: any;
808
+ recursive?: boolean | undefined;
809
+ skipIfComplete?: boolean | undefined;
810
+ verify?: "none" | "size" | "size+sha256" | undefined;
811
+ progressIntervalMs?: number | undefined;
812
+ totalTimeoutMs?: number | undefined;
813
+ connectionTimeoutMs?: number | undefined;
814
+ }>;
815
+ export declare const remoteCopyFileSchema: z.ZodEffects<z.ZodObject<{
816
+ source: z.ZodType<any, z.ZodTypeDef, any>;
817
+ dest: z.ZodType<any, z.ZodTypeDef, any>;
818
+ recursive: z.ZodOptional<z.ZodBoolean>;
819
+ /** @deprecated Prefer totalTimeoutMs; mapped to totalTimeoutMs when set. */
820
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
821
+ skipIfComplete: z.ZodOptional<z.ZodBoolean>;
822
+ progressIntervalMs: z.ZodOptional<z.ZodNumber>;
823
+ totalTimeoutMs: z.ZodOptional<z.ZodNumber>;
824
+ connectionTimeoutMs: z.ZodOptional<z.ZodNumber>;
825
+ verify: z.ZodOptional<z.ZodEnum<["none", "size", "size+sha256"]>>;
826
+ }, "strict", z.ZodTypeAny, {
827
+ timeoutMs?: number | undefined;
828
+ source?: any;
829
+ dest?: any;
830
+ recursive?: boolean | undefined;
831
+ skipIfComplete?: boolean | undefined;
832
+ verify?: "none" | "size" | "size+sha256" | undefined;
833
+ progressIntervalMs?: number | undefined;
834
+ totalTimeoutMs?: number | undefined;
835
+ connectionTimeoutMs?: number | undefined;
836
+ }, {
837
+ timeoutMs?: number | undefined;
838
+ source?: any;
839
+ dest?: any;
840
+ recursive?: boolean | undefined;
841
+ skipIfComplete?: boolean | undefined;
842
+ verify?: "none" | "size" | "size+sha256" | undefined;
843
+ progressIntervalMs?: number | undefined;
844
+ totalTimeoutMs?: number | undefined;
845
+ connectionTimeoutMs?: number | undefined;
846
+ }>, {
847
+ timeoutMs?: number | undefined;
848
+ source?: any;
849
+ dest?: any;
850
+ recursive?: boolean | undefined;
851
+ skipIfComplete?: boolean | undefined;
852
+ verify?: "none" | "size" | "size+sha256" | undefined;
853
+ progressIntervalMs?: number | undefined;
854
+ totalTimeoutMs?: number | undefined;
855
+ connectionTimeoutMs?: number | undefined;
856
+ }, {
857
+ timeoutMs?: number | undefined;
858
+ source?: any;
859
+ dest?: any;
860
+ recursive?: boolean | undefined;
861
+ skipIfComplete?: boolean | undefined;
862
+ verify?: "none" | "size" | "size+sha256" | undefined;
863
+ progressIntervalMs?: number | undefined;
864
+ totalTimeoutMs?: number | undefined;
865
+ connectionTimeoutMs?: number | undefined;
866
+ }>;
867
+ export type RemoteCopyFileInput = z.infer<typeof remoteCopyFileSchema>;
868
+ export declare function fileEndpointToInternal(endpoint: RemoteFileEndpoint): FileEndpoint;
869
+ /** Materialize context endpoints to landing|host for the copy engine. */
870
+ export declare function materializeCopyEndpoint(access: AccessRuntime, endpoint: FileEndpoint): FileEndpoint;
871
+ export type ReadFileMode = "head" | "tail";
872
+ export interface ResolvedReadOptions {
873
+ mode: ReadFileMode;
874
+ lines: number;
875
+ offset?: number;
876
+ grep?: string;
877
+ }
878
+ /** Normalize remote_read_file args. */
879
+ export declare function resolveReadOptions(args: RemoteReadFileInput): ResolvedReadOptions;