@tangle-network/sandbox 0.63.20 → 0.63.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +5 -5
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +2 -2
- package/dist/{agent-run-outcome-DlYhZnhD.d.ts → agent-run-outcome-C-VR-L0I.d.ts} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{backend-types-D6bYbvMB.js → backend-types-zuUBEJO1.js} +35 -1
- package/dist/{browser-interactive-control-controller-B6sySQFu.d.ts → browser-interactive-control-controller-CvObO_Kf.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-BJf0P_J4.js → browser-interactive-control-controller-DHx53yre.js} +16 -1
- package/dist/{chunked-upload-KJyRCAiC.js → chunked-upload-DN2twsUu.js} +1 -1
- package/dist/{chunked-upload-file-DfiGzqaR.js → chunked-upload-file-Dpv1YsoA.js} +2 -2
- package/dist/{cli-auth-bundle-CMgB8Ec3.js → cli-auth-bundle-AvhkWJHX.js} +1 -1
- package/dist/{client-Dl22CVOz.js → client-5yqzAcFJ.js} +3271 -3271
- package/dist/client-CqpKC6n3.d.ts +6066 -0
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-XHg5BEUI.js → collaboration-g_HzXa6f.js} +1 -1
- package/dist/core.d.ts +6 -7
- package/dist/core.js +5 -5
- package/dist/{direct-http2-Dq7tq6jV.js → direct-http2-CoGVOqVR.js} +1 -1
- package/dist/{errors-AB5BD3FM.js → errors-BfbOP_rx.js} +19 -1
- package/dist/{sandbox-DDdPhk2j.d.ts → index-D4OBUP5M.d.ts} +2105 -1461
- package/dist/index.d.ts +12 -4747
- package/dist/index.js +15 -11
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-BSWoA0YE.d.ts → interactive-controller-BBwB_5QQ.d.ts} +3 -2
- package/dist/{interactive-controller-zE6hwv3C.js → interactive-controller-D4N4zqmu.js} +578 -610
- package/dist/{lines-hsXVdk60.d.ts → lines-5m11CEj-.d.ts} +21 -17
- package/dist/lines-C5ER4aN_.js +298 -0
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -295
- package/dist/{local-cli-auth-C4QcPdZt.js → local-cli-auth-CSnvjLAP.js} +1 -1
- package/dist/{mcp-local-BYHcA72Z.js → mcp-local-BjLG7VHY.js} +1 -1
- package/dist/{preview-D8UAF7F9.d.ts → preview-CcJBQSjB.d.ts} +3 -3
- package/dist/{public-templates-BP3sTaSb.d.ts → public-templates-nv4AFFVc.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/runtime.d.ts +47 -40
- package/dist/runtime.js +4 -4
- package/dist/{sandbox-BJkpVtLN.js → sandbox-BGIam_wK.js} +9256 -9215
- package/dist/{secp256k1-DoWlH6ff.js → secp256k1-CmLpsmWl.js} +1 -1
- package/dist/session-gateway/index.d.ts +16 -17
- package/dist/session-gateway/index.js +20 -23
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-BBpguPfj.js → tangle--i0MX6UC.js} +144 -138
- package/dist/terminal-stream-types-ClZCArRg.d.ts +662 -0
- package/dist/{types-BxZX2EVj.d.ts → types-BjyQe_CI.d.ts} +393 -315
- package/package.json +7 -7
- package/dist/client-DraGbXEP.d.ts +0 -1249
- package/dist/error-classes-BWS1a9HO.d.ts +0 -321
- package/dist/index-xS3mRl69.d.ts +0 -578
- package/dist/managed-process-B-pXdMLC.d.ts +0 -15
- package/dist/terminal-stream-DgD7GlFi.d.ts +0 -388
- /package/dist/{cli-auth-bundle-BKsrsbxy.d.ts → cli-auth-bundle-Dyw3hCGx.d.ts} +0 -0
- /package/dist/{index-DfA_usrZ.d.ts → index-C8VSFtWl.d.ts} +0 -0
- /package/dist/{index-CWUW8pqr.d.ts → index-CVjTnRWP.d.ts} +0 -0
- /package/dist/{keep-alive-fetch-CXvfSczd.js → keep-alive-fetch-CuwGi7gz.js} +0 -0
- /package/dist/{line-application-UtPFP0o4.js → line-application-DY9ZTdgF.js} +0 -0
- /package/dist/{preview-operations-Bvo5YcIq.js → preview-operations-Ca02vPDJ.js} +0 -0
- /package/dist/{raw-evidence-archive-Bxk6fUjS.js → raw-evidence-archive-CDYDqHNv.js} +0 -0
- /package/dist/{utils-B6gap92T.js → utils-BGvM02yJ.js} +0 -0
package/dist/index-xS3mRl69.d.ts
DELETED
|
@@ -1,578 +0,0 @@
|
|
|
1
|
-
import { n as SandboxInstance } from "./sandbox-DDdPhk2j.js";
|
|
2
|
-
import { ea as HttpClient, yr as CreateSandboxOptions } from "./types-BxZX2EVj.js";
|
|
3
|
-
|
|
4
|
-
//#region src/tangle/abi.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Tangle Contract ABI Definitions
|
|
7
|
-
*
|
|
8
|
-
* Viem-compatible ABI for the ITangleJobs precompile, the AgentSandbox
|
|
9
|
-
* blueprint contract views/events, and ABI parameter definitions for
|
|
10
|
-
* encoding/decoding blueprint job inputs and outputs.
|
|
11
|
-
*/
|
|
12
|
-
declare const ITangleJobsAbi: readonly [{
|
|
13
|
-
readonly type: "function";
|
|
14
|
-
readonly name: "submitJob";
|
|
15
|
-
readonly inputs: readonly [{
|
|
16
|
-
readonly name: "serviceId";
|
|
17
|
-
readonly type: "uint64";
|
|
18
|
-
}, {
|
|
19
|
-
readonly name: "jobIndex";
|
|
20
|
-
readonly type: "uint8";
|
|
21
|
-
}, {
|
|
22
|
-
readonly name: "inputs";
|
|
23
|
-
readonly type: "bytes";
|
|
24
|
-
}];
|
|
25
|
-
readonly outputs: readonly [{
|
|
26
|
-
readonly name: "callId";
|
|
27
|
-
readonly type: "uint64";
|
|
28
|
-
}];
|
|
29
|
-
readonly stateMutability: "payable";
|
|
30
|
-
}, {
|
|
31
|
-
readonly type: "function";
|
|
32
|
-
readonly name: "getJobCall";
|
|
33
|
-
readonly inputs: readonly [{
|
|
34
|
-
readonly name: "serviceId";
|
|
35
|
-
readonly type: "uint64";
|
|
36
|
-
}, {
|
|
37
|
-
readonly name: "callId";
|
|
38
|
-
readonly type: "uint64";
|
|
39
|
-
}];
|
|
40
|
-
readonly outputs: readonly [{
|
|
41
|
-
readonly name: "";
|
|
42
|
-
readonly type: "tuple";
|
|
43
|
-
readonly components: readonly [{
|
|
44
|
-
readonly name: "jobIndex";
|
|
45
|
-
readonly type: "uint8";
|
|
46
|
-
}, {
|
|
47
|
-
readonly name: "caller";
|
|
48
|
-
readonly type: "address";
|
|
49
|
-
}, {
|
|
50
|
-
readonly name: "createdAt";
|
|
51
|
-
readonly type: "uint64";
|
|
52
|
-
}, {
|
|
53
|
-
readonly name: "resultCount";
|
|
54
|
-
readonly type: "uint32";
|
|
55
|
-
}, {
|
|
56
|
-
readonly name: "payment";
|
|
57
|
-
readonly type: "uint256";
|
|
58
|
-
}, {
|
|
59
|
-
readonly name: "completed";
|
|
60
|
-
readonly type: "bool";
|
|
61
|
-
}];
|
|
62
|
-
}];
|
|
63
|
-
readonly stateMutability: "view";
|
|
64
|
-
}, {
|
|
65
|
-
readonly type: "event";
|
|
66
|
-
readonly name: "JobSubmitted";
|
|
67
|
-
readonly inputs: readonly [{
|
|
68
|
-
readonly name: "serviceId";
|
|
69
|
-
readonly type: "uint64";
|
|
70
|
-
readonly indexed: true;
|
|
71
|
-
}, {
|
|
72
|
-
readonly name: "callId";
|
|
73
|
-
readonly type: "uint64";
|
|
74
|
-
readonly indexed: true;
|
|
75
|
-
}, {
|
|
76
|
-
readonly name: "jobIndex";
|
|
77
|
-
readonly type: "uint8";
|
|
78
|
-
readonly indexed: false;
|
|
79
|
-
}, {
|
|
80
|
-
readonly name: "caller";
|
|
81
|
-
readonly type: "address";
|
|
82
|
-
readonly indexed: false;
|
|
83
|
-
}, {
|
|
84
|
-
readonly name: "inputs";
|
|
85
|
-
readonly type: "bytes";
|
|
86
|
-
readonly indexed: false;
|
|
87
|
-
}];
|
|
88
|
-
}, {
|
|
89
|
-
readonly type: "event";
|
|
90
|
-
readonly name: "JobResultSubmitted";
|
|
91
|
-
readonly inputs: readonly [{
|
|
92
|
-
readonly name: "serviceId";
|
|
93
|
-
readonly type: "uint64";
|
|
94
|
-
readonly indexed: true;
|
|
95
|
-
}, {
|
|
96
|
-
readonly name: "callId";
|
|
97
|
-
readonly type: "uint64";
|
|
98
|
-
readonly indexed: true;
|
|
99
|
-
}, {
|
|
100
|
-
readonly name: "operator";
|
|
101
|
-
readonly type: "address";
|
|
102
|
-
readonly indexed: true;
|
|
103
|
-
}, {
|
|
104
|
-
readonly name: "result";
|
|
105
|
-
readonly type: "bytes";
|
|
106
|
-
readonly indexed: false;
|
|
107
|
-
}];
|
|
108
|
-
}];
|
|
109
|
-
declare const SandboxCreateParamTypes: readonly [{
|
|
110
|
-
readonly name: "request";
|
|
111
|
-
readonly type: "tuple";
|
|
112
|
-
readonly components: readonly [{
|
|
113
|
-
readonly name: "name";
|
|
114
|
-
readonly type: "string";
|
|
115
|
-
}, {
|
|
116
|
-
readonly name: "image";
|
|
117
|
-
readonly type: "string";
|
|
118
|
-
}, {
|
|
119
|
-
readonly name: "stack";
|
|
120
|
-
readonly type: "string";
|
|
121
|
-
}, {
|
|
122
|
-
readonly name: "agent_identifier";
|
|
123
|
-
readonly type: "string";
|
|
124
|
-
}, {
|
|
125
|
-
readonly name: "env_json";
|
|
126
|
-
readonly type: "string";
|
|
127
|
-
}, {
|
|
128
|
-
readonly name: "metadata_json";
|
|
129
|
-
readonly type: "string";
|
|
130
|
-
}, {
|
|
131
|
-
readonly name: "ssh_enabled";
|
|
132
|
-
readonly type: "bool";
|
|
133
|
-
}, {
|
|
134
|
-
readonly name: "ssh_public_key";
|
|
135
|
-
readonly type: "string";
|
|
136
|
-
}, {
|
|
137
|
-
readonly name: "web_terminal_enabled";
|
|
138
|
-
readonly type: "bool";
|
|
139
|
-
}, {
|
|
140
|
-
readonly name: "max_lifetime_seconds";
|
|
141
|
-
readonly type: "uint64";
|
|
142
|
-
}, {
|
|
143
|
-
readonly name: "idle_timeout_seconds";
|
|
144
|
-
readonly type: "uint64";
|
|
145
|
-
}, {
|
|
146
|
-
readonly name: "cpu_cores";
|
|
147
|
-
readonly type: "uint64";
|
|
148
|
-
}, {
|
|
149
|
-
readonly name: "memory_mb";
|
|
150
|
-
readonly type: "uint64";
|
|
151
|
-
}, {
|
|
152
|
-
readonly name: "disk_gb";
|
|
153
|
-
readonly type: "uint64";
|
|
154
|
-
}, {
|
|
155
|
-
readonly name: "tee_required";
|
|
156
|
-
readonly type: "bool";
|
|
157
|
-
}, {
|
|
158
|
-
readonly name: "tee_type";
|
|
159
|
-
readonly type: "uint8";
|
|
160
|
-
}, {
|
|
161
|
-
readonly name: "attestation_nonce";
|
|
162
|
-
readonly type: "string";
|
|
163
|
-
}, {
|
|
164
|
-
readonly name: "capabilities_json";
|
|
165
|
-
readonly type: "string";
|
|
166
|
-
}];
|
|
167
|
-
}];
|
|
168
|
-
declare const SandboxIdParamTypes: readonly [{
|
|
169
|
-
readonly name: "request";
|
|
170
|
-
readonly type: "tuple";
|
|
171
|
-
readonly components: readonly [{
|
|
172
|
-
readonly name: "sandbox_id";
|
|
173
|
-
readonly type: "string";
|
|
174
|
-
}];
|
|
175
|
-
}];
|
|
176
|
-
declare const SandboxCreateResponseParamTypes: readonly [{
|
|
177
|
-
readonly name: "response";
|
|
178
|
-
readonly type: "tuple";
|
|
179
|
-
readonly components: readonly [{
|
|
180
|
-
readonly name: "sandboxId";
|
|
181
|
-
readonly type: "string";
|
|
182
|
-
}, {
|
|
183
|
-
readonly name: "json";
|
|
184
|
-
readonly type: "string";
|
|
185
|
-
}];
|
|
186
|
-
}];
|
|
187
|
-
declare const JsonResponseParamTypes: readonly [{
|
|
188
|
-
readonly name: "response";
|
|
189
|
-
readonly type: "tuple";
|
|
190
|
-
readonly components: readonly [{
|
|
191
|
-
readonly name: "json";
|
|
192
|
-
readonly type: "string";
|
|
193
|
-
}];
|
|
194
|
-
}];
|
|
195
|
-
declare const AgentSandboxBlueprintAbi: readonly [{
|
|
196
|
-
readonly type: "function";
|
|
197
|
-
readonly name: "getAvailableCapacity";
|
|
198
|
-
readonly inputs: readonly [];
|
|
199
|
-
readonly outputs: readonly [{
|
|
200
|
-
readonly name: "available";
|
|
201
|
-
readonly type: "uint32";
|
|
202
|
-
}];
|
|
203
|
-
readonly stateMutability: "view";
|
|
204
|
-
}, {
|
|
205
|
-
readonly type: "function";
|
|
206
|
-
readonly name: "getServiceStats";
|
|
207
|
-
readonly inputs: readonly [];
|
|
208
|
-
readonly outputs: readonly [{
|
|
209
|
-
readonly name: "totalSandboxes";
|
|
210
|
-
readonly type: "uint32";
|
|
211
|
-
}, {
|
|
212
|
-
readonly name: "totalCapacity";
|
|
213
|
-
readonly type: "uint32";
|
|
214
|
-
}];
|
|
215
|
-
readonly stateMutability: "view";
|
|
216
|
-
}, {
|
|
217
|
-
readonly type: "function";
|
|
218
|
-
readonly name: "getOperatorLoad";
|
|
219
|
-
readonly inputs: readonly [{
|
|
220
|
-
readonly name: "operator";
|
|
221
|
-
readonly type: "address";
|
|
222
|
-
}];
|
|
223
|
-
readonly outputs: readonly [{
|
|
224
|
-
readonly name: "active";
|
|
225
|
-
readonly type: "uint32";
|
|
226
|
-
}, {
|
|
227
|
-
readonly name: "max";
|
|
228
|
-
readonly type: "uint32";
|
|
229
|
-
}];
|
|
230
|
-
readonly stateMutability: "view";
|
|
231
|
-
}, {
|
|
232
|
-
readonly type: "function";
|
|
233
|
-
readonly name: "getSandboxOperator";
|
|
234
|
-
readonly inputs: readonly [{
|
|
235
|
-
readonly name: "sandboxId";
|
|
236
|
-
readonly type: "string";
|
|
237
|
-
}];
|
|
238
|
-
readonly outputs: readonly [{
|
|
239
|
-
readonly name: "";
|
|
240
|
-
readonly type: "address";
|
|
241
|
-
}];
|
|
242
|
-
readonly stateMutability: "view";
|
|
243
|
-
}, {
|
|
244
|
-
readonly type: "function";
|
|
245
|
-
readonly name: "isSandboxActive";
|
|
246
|
-
readonly inputs: readonly [{
|
|
247
|
-
readonly name: "sandboxId";
|
|
248
|
-
readonly type: "string";
|
|
249
|
-
}];
|
|
250
|
-
readonly outputs: readonly [{
|
|
251
|
-
readonly name: "";
|
|
252
|
-
readonly type: "bool";
|
|
253
|
-
}];
|
|
254
|
-
readonly stateMutability: "view";
|
|
255
|
-
}, {
|
|
256
|
-
readonly type: "event";
|
|
257
|
-
readonly name: "OperatorAssigned";
|
|
258
|
-
readonly inputs: readonly [{
|
|
259
|
-
readonly name: "serviceId";
|
|
260
|
-
readonly type: "uint64";
|
|
261
|
-
readonly indexed: true;
|
|
262
|
-
}, {
|
|
263
|
-
readonly name: "callId";
|
|
264
|
-
readonly type: "uint64";
|
|
265
|
-
readonly indexed: true;
|
|
266
|
-
}, {
|
|
267
|
-
readonly name: "operator";
|
|
268
|
-
readonly type: "address";
|
|
269
|
-
readonly indexed: true;
|
|
270
|
-
}];
|
|
271
|
-
}, {
|
|
272
|
-
readonly type: "event";
|
|
273
|
-
readonly name: "OperatorRouted";
|
|
274
|
-
readonly inputs: readonly [{
|
|
275
|
-
readonly name: "serviceId";
|
|
276
|
-
readonly type: "uint64";
|
|
277
|
-
readonly indexed: true;
|
|
278
|
-
}, {
|
|
279
|
-
readonly name: "callId";
|
|
280
|
-
readonly type: "uint64";
|
|
281
|
-
readonly indexed: true;
|
|
282
|
-
}, {
|
|
283
|
-
readonly name: "operator";
|
|
284
|
-
readonly type: "address";
|
|
285
|
-
readonly indexed: true;
|
|
286
|
-
}];
|
|
287
|
-
}, {
|
|
288
|
-
readonly type: "event";
|
|
289
|
-
readonly name: "SandboxCreated";
|
|
290
|
-
readonly inputs: readonly [{
|
|
291
|
-
readonly name: "sandboxHash";
|
|
292
|
-
readonly type: "bytes32";
|
|
293
|
-
readonly indexed: true;
|
|
294
|
-
}, {
|
|
295
|
-
readonly name: "operator";
|
|
296
|
-
readonly type: "address";
|
|
297
|
-
readonly indexed: true;
|
|
298
|
-
}];
|
|
299
|
-
}, {
|
|
300
|
-
readonly type: "event";
|
|
301
|
-
readonly name: "SandboxDeleted";
|
|
302
|
-
readonly inputs: readonly [{
|
|
303
|
-
readonly name: "sandboxHash";
|
|
304
|
-
readonly type: "bytes32";
|
|
305
|
-
readonly indexed: true;
|
|
306
|
-
}, {
|
|
307
|
-
readonly name: "operator";
|
|
308
|
-
readonly type: "address";
|
|
309
|
-
readonly indexed: true;
|
|
310
|
-
}];
|
|
311
|
-
}];
|
|
312
|
-
//#endregion
|
|
313
|
-
//#region src/tangle/types.d.ts
|
|
314
|
-
/**
|
|
315
|
-
* Tangle Sandbox Client types and constants.
|
|
316
|
-
*/
|
|
317
|
-
/** Tangle mainnet chain ID. */
|
|
318
|
-
declare const TANGLE_CHAIN_ID = 5845;
|
|
319
|
-
/** ITangleJobs precompile contract address. */
|
|
320
|
-
declare const TANGLE_JOBS_CONTRACT: "0x0000000000000000000000000000000000000808";
|
|
321
|
-
/** Job indices matching the blueprint's job IDs. */
|
|
322
|
-
declare const JOB_SANDBOX_CREATE = 0;
|
|
323
|
-
declare const JOB_SANDBOX_DELETE = 1;
|
|
324
|
-
interface TangleSandboxClientConfig {
|
|
325
|
-
/** Tangle service instance ID for the sandbox blueprint. */
|
|
326
|
-
serviceId: bigint;
|
|
327
|
-
/** viem WalletClient for browser environments. Mutually exclusive with privateKey. */
|
|
328
|
-
wallet?: unknown;
|
|
329
|
-
/** Hex-encoded private key for Node.js environments. Mutually exclusive with wallet. */
|
|
330
|
-
privateKey?: `0x${string}`;
|
|
331
|
-
/**
|
|
332
|
-
* HTTP JSON-RPC endpoint for the Tangle chain. Required for both the
|
|
333
|
-
* privateKey and wallet paths: the SDK ships no default endpoint because the
|
|
334
|
-
* legacy public host was retired.
|
|
335
|
-
*/
|
|
336
|
-
rpcUrl: string;
|
|
337
|
-
/** Blueprint contract address for view calls (getAvailableCapacity, etc). */
|
|
338
|
-
blueprintContractAddress?: `0x${string}`;
|
|
339
|
-
/** ITangleJobs precompile address. Defaults to 0x...0808. */
|
|
340
|
-
contractAddress?: `0x${string}`;
|
|
341
|
-
/** Max time to wait for a job to complete. No hard limit — agent jobs can run hours. Default: 14400000 (4h). */
|
|
342
|
-
jobTimeoutMs?: number;
|
|
343
|
-
/** Interval between job completion polls. Default: 5000 (5s). */
|
|
344
|
-
pollIntervalMs?: number;
|
|
345
|
-
/**
|
|
346
|
-
* Operator API base URL for routes that must be handled by the Blueprint
|
|
347
|
-
* operator rather than the sidecar directly, such as nonce-bound TEE
|
|
348
|
-
* attestation.
|
|
349
|
-
*/
|
|
350
|
-
operatorApiUrl?: string;
|
|
351
|
-
/** Bearer token for the operator API session. */
|
|
352
|
-
operatorApiToken?: string;
|
|
353
|
-
}
|
|
354
|
-
//#endregion
|
|
355
|
-
//#region src/tangle/client.d.ts
|
|
356
|
-
declare class TangleSandboxClient implements HttpClient {
|
|
357
|
-
#private;
|
|
358
|
-
private readonly chain;
|
|
359
|
-
private readonly operatorApiUrl?;
|
|
360
|
-
private operatorSession;
|
|
361
|
-
constructor(config: TangleSandboxClientConfig);
|
|
362
|
-
/**
|
|
363
|
-
* Create a sandbox via on-chain job submission.
|
|
364
|
-
*
|
|
365
|
-
* Secrets never ride the chain: `options.tangleSecrets` is delivered to the
|
|
366
|
-
* operator's 2-phase provisioning endpoint over an EIP-191-authenticated
|
|
367
|
-
* session after the job completes (requires `operatorApiUrl`). Everything
|
|
368
|
-
* in `options.env` IS published on-chain in the job calldata — secret-shaped
|
|
369
|
-
* keys there trigger a warning pointing at `tangleSecrets`.
|
|
370
|
-
*/
|
|
371
|
-
create(options?: CreateSandboxOptions): Promise<SandboxInstance>;
|
|
372
|
-
/**
|
|
373
|
-
* Get a sandbox by id. Rehydrates from the operator API when configured so
|
|
374
|
-
* app servers can resolve sandboxes created by earlier requests.
|
|
375
|
-
*/
|
|
376
|
-
get(id: string): Promise<SandboxInstance | null>;
|
|
377
|
-
/**
|
|
378
|
-
* Route interception for SandboxInstance lifecycle calls.
|
|
379
|
-
*
|
|
380
|
-
* SandboxInstance calls this.client.fetch() for:
|
|
381
|
-
* - GET /v1/sandboxes/:id → return from local tracking
|
|
382
|
-
* - POST /v1/sandboxes/:id/stop → unsupported until blueprint exposes stop
|
|
383
|
-
* - POST /v1/sandboxes/:id/resume → unsupported until blueprint exposes resume
|
|
384
|
-
* - DELETE /v1/sandboxes/:id → on-chain JOB_SANDBOX_DELETE
|
|
385
|
-
*/
|
|
386
|
-
fetch(path: string, options?: RequestInit): Promise<Response>;
|
|
387
|
-
private fetchRuntime;
|
|
388
|
-
/**
|
|
389
|
-
* Get available capacity from the blueprint contract.
|
|
390
|
-
* Requires blueprintContractAddress in config.
|
|
391
|
-
*/
|
|
392
|
-
getAvailableCapacity(): Promise<number>;
|
|
393
|
-
/**
|
|
394
|
-
* Get service stats from the blueprint contract.
|
|
395
|
-
* Requires blueprintContractAddress in config.
|
|
396
|
-
*/
|
|
397
|
-
getServiceStats(): Promise<{
|
|
398
|
-
totalSandboxes: number;
|
|
399
|
-
totalCapacity: number;
|
|
400
|
-
}>;
|
|
401
|
-
/**
|
|
402
|
-
* Mint or reuse the EIP-191 session for the operator API.
|
|
403
|
-
*
|
|
404
|
-
* The session is signed by the SAME key that submits jobs (`chain.signMessage`),
|
|
405
|
-
* so the operator binds it to every sandbox this client created.
|
|
406
|
-
*/
|
|
407
|
-
private getOperatorSession;
|
|
408
|
-
/**
|
|
409
|
-
* Deliver secrets to a sandbox via the operator's 2-phase provisioning
|
|
410
|
-
* endpoint (`POST /api/sandboxes/:id/secrets`).
|
|
411
|
-
*
|
|
412
|
-
* Unlike `env`, these values never appear on-chain: they ride TLS to the
|
|
413
|
-
* operator, which validates the session's recovered address against the
|
|
414
|
-
* sandbox's on-chain creator before injecting.
|
|
415
|
-
*/
|
|
416
|
-
injectSecrets(sandboxId: string, secrets: Record<string, string>): Promise<void>;
|
|
417
|
-
/** Read a sandbox's provisioned secret keys and credential availability. */
|
|
418
|
-
getSecrets(sandboxId: string): Promise<{
|
|
419
|
-
sandboxId: string;
|
|
420
|
-
envJson: Record<string, unknown>;
|
|
421
|
-
credentialsAvailable: boolean;
|
|
422
|
-
}>;
|
|
423
|
-
/**
|
|
424
|
-
* Run an operator-API request with a session, retrying once with a fresh
|
|
425
|
-
* session on 401 (expired PASETO). Any other failure names the sandbox so
|
|
426
|
-
* the caller can retry without losing the ID.
|
|
427
|
-
*/
|
|
428
|
-
private withOperatorSession;
|
|
429
|
-
private fetchOperatorApi;
|
|
430
|
-
}
|
|
431
|
-
//#endregion
|
|
432
|
-
//#region src/tangle/operator-auth.d.ts
|
|
433
|
-
/**
|
|
434
|
-
* Operator API session auth — the client half of the operator's EIP-191
|
|
435
|
-
* challenge-response flow (`sandbox-runtime/src/session_auth`).
|
|
436
|
-
*
|
|
437
|
-
* Flow (matches the operator exactly):
|
|
438
|
-
* 1. `POST /api/auth/challenge` → `{ nonce, message, expires_at }`
|
|
439
|
-
* 2. Sign `message` with the job submitter's key (EIP-191 personal_sign,
|
|
440
|
-
* 65-byte `r ‖ s ‖ v`)
|
|
441
|
-
* 3. `POST /api/auth/session` `{ nonce, signature }` →
|
|
442
|
-
* `{ token, address, expires_at }` (PASETO bearer, 1h)
|
|
443
|
-
* 4. `Authorization: Bearer <token>`
|
|
444
|
-
*
|
|
445
|
-
* The operator recovers the signer address from the signature and binds every
|
|
446
|
-
* sandbox operation to it: `require_sandbox_owner` rejects any session whose
|
|
447
|
-
* address is not the sandbox's on-chain creator. So a session minted from the
|
|
448
|
-
* same key that submitted the create job can read/inject that sandbox's
|
|
449
|
-
* secrets — and nothing else.
|
|
450
|
-
*/
|
|
451
|
-
/** Challenge payload served by `POST /api/auth/challenge`. */
|
|
452
|
-
interface OperatorChallenge {
|
|
453
|
-
nonce: string;
|
|
454
|
-
message: string;
|
|
455
|
-
expires_at: number;
|
|
456
|
-
}
|
|
457
|
-
/** Session payload served by `POST /api/auth/session`. */
|
|
458
|
-
interface OperatorSessionToken {
|
|
459
|
-
token: string;
|
|
460
|
-
address: string;
|
|
461
|
-
expires_at: number;
|
|
462
|
-
}
|
|
463
|
-
/** Signs an arbitrary message with EIP-191 personal_sign semantics. */
|
|
464
|
-
type SignMessage = (message: string) => Promise<`0x${string}`>;
|
|
465
|
-
declare class OperatorSessionError extends Error {
|
|
466
|
-
readonly status?: number | undefined;
|
|
467
|
-
constructor(message: string, status?: number | undefined);
|
|
468
|
-
}
|
|
469
|
-
/**
|
|
470
|
-
* A bearer session with the blueprint operator API, minted by proving control
|
|
471
|
-
* of the job submitter's key. Establish lazily and reuse until near expiry;
|
|
472
|
-
* the caller retries with a fresh session on 401.
|
|
473
|
-
*/
|
|
474
|
-
declare class OperatorSession {
|
|
475
|
-
#private;
|
|
476
|
-
private readonly address;
|
|
477
|
-
private readonly expiresAtMs;
|
|
478
|
-
private constructor();
|
|
479
|
-
get signerAddress(): string;
|
|
480
|
-
/** True when the token is within the refresh margin of expiry. */
|
|
481
|
-
needsRefresh(nowMs?: number): boolean;
|
|
482
|
-
authorizationHeader(): string;
|
|
483
|
-
/**
|
|
484
|
-
* Run the challenge-response flow against an operator API base URL.
|
|
485
|
-
*
|
|
486
|
-
* `signMessage` must implement EIP-191 personal_sign with the SAME key that
|
|
487
|
-
* submitted the sandbox create job — the operator binds ownership to the
|
|
488
|
-
* recovered address, so any other key yields a session that owns nothing.
|
|
489
|
-
*/
|
|
490
|
-
static establish(baseUrl: string, signMessage: SignMessage, fetchImpl?: typeof fetch): Promise<OperatorSession>;
|
|
491
|
-
}
|
|
492
|
-
//#endregion
|
|
493
|
-
//#region src/tangle/rfq.d.ts
|
|
494
|
-
/**
|
|
495
|
-
* RFQ quote primitives for tnt-core's `JobsRFQ` marketplace flow.
|
|
496
|
-
*
|
|
497
|
-
* These helpers fetch, hash, and validate operator quotes. Callers remain
|
|
498
|
-
* responsible for preparing and submitting on-chain transactions.
|
|
499
|
-
*
|
|
500
|
-
* The EIP-712 hashing here is pinned byte-for-byte against the Rust SDK
|
|
501
|
-
* (blueprint `tangle-extra::job_quote`, digest fixture in
|
|
502
|
-
* `tangle-rfq.test.ts`) and against `SignatureLib` in tnt-core. Never change
|
|
503
|
-
* the typed-data shape without regenerating all three.
|
|
504
|
-
*/
|
|
505
|
-
type Address = `0x${string}`;
|
|
506
|
-
type Hash = `0x${string}`;
|
|
507
|
-
/** EIP-712 domain — identical to tnt-core `Base.sol`: name "TangleQuote", version "1". */
|
|
508
|
-
interface QuoteDomain {
|
|
509
|
-
chainId: number;
|
|
510
|
-
verifyingContract: Address;
|
|
511
|
-
}
|
|
512
|
-
/** Mirrors `JobQuoteDetails` in tnt-core `SignatureLib` (field-for-field). */
|
|
513
|
-
interface JobQuoteDetails {
|
|
514
|
-
requester: Address;
|
|
515
|
-
serviceId: bigint;
|
|
516
|
-
jobIndex: number;
|
|
517
|
-
/** Price in the chain native unit's smallest denomination; wire values use
|
|
518
|
-
* decimal strings to survive JSON transport without precision loss. */
|
|
519
|
-
price: bigint;
|
|
520
|
-
timestamp: bigint;
|
|
521
|
-
expiry: bigint;
|
|
522
|
-
/** tnt-core `ConfidentialityPolicy`: 0 Any, 1 TEE required, 2 Standard required, 3 TEE preferred. */
|
|
523
|
-
confidentiality: 0 | 1 | 2 | 3;
|
|
524
|
-
inputsHash: Hash;
|
|
525
|
-
}
|
|
526
|
-
/** A signed quote as served by the operator's `/api/quote`. */
|
|
527
|
-
interface SignedQuote {
|
|
528
|
-
details: JobQuoteDetails;
|
|
529
|
-
/** 65-byte `r ‖ s ‖ v` hex — exactly what `submitJobFromQuote` expects. */
|
|
530
|
-
signature: `0x${string}`;
|
|
531
|
-
operator: Address;
|
|
532
|
-
/** Operator-reported live capacity at quote time (informational). */
|
|
533
|
-
capacity?: {
|
|
534
|
-
active: number;
|
|
535
|
-
max: number;
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
declare class QuoteError extends Error {
|
|
539
|
-
readonly code: "QUOTE_REJECTED" | "QUOTE_SIGNATURE_INVALID" | "QUOTE_EXPIRED" | "QUOTE_MISMATCH";
|
|
540
|
-
constructor(message: string, code: "QUOTE_REJECTED" | "QUOTE_SIGNATURE_INVALID" | "QUOTE_EXPIRED" | "QUOTE_MISMATCH");
|
|
541
|
-
}
|
|
542
|
-
/**
|
|
543
|
-
* The EIP-712 digest of a quote — matches
|
|
544
|
-
* `job_quote_digest_eip712` (Rust SDK) and `computeJobQuoteDigest` (tnt-core).
|
|
545
|
-
*/
|
|
546
|
-
declare function jobQuoteDigest(details: JobQuoteDetails, domain: QuoteDomain): Hash;
|
|
547
|
-
/** Parse the operator's `/api/quote` JSON without fabricating missing values. */
|
|
548
|
-
declare function parseQuoteResponse(raw: Record<string, unknown>): SignedQuote;
|
|
549
|
-
/** keccak256 of the exact ABI-encoded job inputs — what quotes bind to. */
|
|
550
|
-
declare function inputsHashOf(encodedInputs: `0x${string}`): Hash;
|
|
551
|
-
/**
|
|
552
|
-
* Validate a quote before paying for it: fresh (not expired), addressed to
|
|
553
|
-
* the buyer, for the exact inputs about to be submitted, on the expected
|
|
554
|
-
* service/job, and signed by the operator it names.
|
|
555
|
-
*
|
|
556
|
-
* Signature verification uses viem's offline EOA recovery and compares the
|
|
557
|
-
* signer against the same digest the chain checks.
|
|
558
|
-
*/
|
|
559
|
-
declare function validateQuote(args: {
|
|
560
|
-
quote: SignedQuote;
|
|
561
|
-
domain: QuoteDomain; /** The buyer's address — must equal `details.requester`. */
|
|
562
|
-
buyer: Address;
|
|
563
|
-
serviceId: bigint;
|
|
564
|
-
jobIndex: number;
|
|
565
|
-
inputsHash: Hash;
|
|
566
|
-
now?: number;
|
|
567
|
-
}): Promise<void>;
|
|
568
|
-
/** Query one operator for a quote over HTTP. */
|
|
569
|
-
declare function fetchQuote(operatorApiUrl: string, params: {
|
|
570
|
-
requester: Address;
|
|
571
|
-
jobIndex: number; /** 0x-hex ABI-encoded job inputs, or a precomputed keccak256 hash. */
|
|
572
|
-
inputs?: `0x${string}`;
|
|
573
|
-
inputsHash?: Hash;
|
|
574
|
-
confidentiality?: JobQuoteDetails["confidentiality"];
|
|
575
|
-
fetchImpl?: typeof fetch;
|
|
576
|
-
}): Promise<SignedQuote>;
|
|
577
|
-
//#endregion
|
|
578
|
-
export { JsonResponseParamTypes as C, SandboxIdParamTypes as E, ITangleJobsAbi as S, SandboxCreateResponseParamTypes as T, JOB_SANDBOX_DELETE as _, fetchQuote as a, TangleSandboxClientConfig as b, parseQuoteResponse as c, OperatorSession as d, OperatorSessionError as f, JOB_SANDBOX_CREATE as g, TangleSandboxClient as h, SignedQuote as i, validateQuote as l, SignMessage as m, QuoteDomain as n, inputsHashOf as o, OperatorSessionToken as p, QuoteError as r, jobQuoteDigest as s, JobQuoteDetails as t, OperatorChallenge as u, TANGLE_CHAIN_ID as v, SandboxCreateParamTypes as w, AgentSandboxBlueprintAbi as x, TANGLE_JOBS_CONTRACT as y };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Ji as ManagedProcessJobs, Qi as ManagedProcessSpec, Xi as ManagedProcessRecord, Yi as ManagedProcessOptions, Zi as ManagedProcessResumeOptions } from "./types-BxZX2EVj.js";
|
|
2
|
-
|
|
3
|
-
//#region src/managed-process.d.ts
|
|
4
|
-
declare class ManagedProcessClient implements ManagedProcessJobs {
|
|
5
|
-
private readonly request;
|
|
6
|
-
private readonly environmentId;
|
|
7
|
-
constructor(request: (path: string, init: RequestInit) => Promise<Response>, environmentId: string);
|
|
8
|
-
private call;
|
|
9
|
-
submit(spec: ManagedProcessSpec, options?: ManagedProcessOptions): Promise<ManagedProcessRecord>;
|
|
10
|
-
get(id: string, options?: ManagedProcessOptions): Promise<ManagedProcessRecord | null>;
|
|
11
|
-
resume(id: string, options: ManagedProcessResumeOptions): Promise<ManagedProcessRecord | null>;
|
|
12
|
-
cancel(id: string, options?: ManagedProcessOptions): Promise<ManagedProcessRecord | null>;
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { ManagedProcessClient as t };
|