@tangle-network/sandbox 0.60.78-develop.20261017134105.a6b32a2 → 0.60.78-develop.20261021201434.3bcd5ef

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 (66) hide show
  1. package/README.md +61 -0
  2. package/dist/agent/index.d.ts +4 -4
  3. package/dist/agent/index.js +5 -5
  4. package/dist/agent/preview.d.ts +1 -1
  5. package/dist/agent/preview.js +2 -2
  6. package/dist/{agent-run-outcome-CTEpjCEZ.d.ts → agent-run-outcome-brwJbH5S.d.ts} +1 -1
  7. package/dist/auth/index.d.ts +2 -2
  8. package/dist/auth/index.js +5 -5
  9. package/dist/{backend-types-D6bYbvMB.js → backend-types-CLvdSX8V.js} +41 -1
  10. package/dist/{browser-interactive-control-controller-rpTbyvAS.d.ts → browser-interactive-control-controller-CvObO_Kf.d.ts} +1 -1
  11. package/dist/{browser-interactive-control-controller-BJf0P_J4.js → browser-interactive-control-controller-DHx53yre.js} +16 -1
  12. package/dist/{chunked-upload-DtIvkKNo.js → chunked-upload-DN2twsUu.js} +2 -59
  13. package/dist/{chunked-upload-file-DnsHEjg0.js → chunked-upload-file-Dpv1YsoA.js} +2 -1
  14. package/dist/{cli-auth-bundle-cSJjPeFF.js → cli-auth-bundle-CFeHsq-5.js} +23 -11
  15. package/dist/{client-R1tw-4Px.js → client-CgtR203z.js} +3349 -3341
  16. package/dist/client-Dr8qasCR.d.ts +6076 -0
  17. package/dist/collaboration/index.d.ts +1 -1
  18. package/dist/collaboration/index.js +1 -1
  19. package/dist/{collaboration-DaJU5O0E.js → collaboration-g_HzXa6f.js} +5 -5
  20. package/dist/core.d.ts +7 -7
  21. package/dist/core.js +7 -6
  22. package/dist/direct-http2-Dar5erTH.js +99 -0
  23. package/dist/{errors-DSJBKmGZ.js → errors-BfbOP_rx.js} +171 -22
  24. package/dist/{index-DO7GVpk_.d.ts → index-C8VSFtWl.d.ts} +1 -1
  25. package/dist/{index-DZ27pdB8.d.ts → index-CVjTnRWP.d.ts} +1 -1
  26. package/dist/{sandbox-CoIGxzm_.d.ts → index-D5dVNm76.d.ts} +2117 -1519
  27. package/dist/index.d.ts +12 -4704
  28. package/dist/index.js +40 -15
  29. package/dist/intelligence/index.js +1 -1
  30. package/dist/interactive-control.d.ts +1 -1
  31. package/dist/interactive-control.js +1 -1
  32. package/dist/{interactive-controller-CJ24g8Va.js → interactive-controller-OAsASPd_.js} +662 -620
  33. package/dist/interactive-controller-nMhGqXxq.d.ts +41 -0
  34. package/dist/keep-alive-fetch-BBzJDWyt.js +247 -0
  35. package/dist/{lines-DodQslsf.d.ts → lines-C5CPSg8n.d.ts} +21 -17
  36. package/dist/lines-C5ER4aN_.js +298 -0
  37. package/dist/lines.d.ts +1 -1
  38. package/dist/lines.js +1 -295
  39. package/dist/{local-cli-auth-CBV7Vjk5.js → local-cli-auth-D-CQ0-ub.js} +1 -1
  40. package/dist/{mcp-local-DjryqUiY.js → mcp-local-BjLG7VHY.js} +1 -1
  41. package/dist/{preview-wpGGk0bu.d.ts → preview-COO7TSBk.d.ts} +3 -3
  42. package/dist/public-templates-BDrchm0J.d.ts +80 -0
  43. package/dist/public-templates.d.ts +2 -0
  44. package/dist/public-templates.js +173 -0
  45. package/dist/{raw-evidence-archive-Br5a3xZ_.js → raw-evidence-archive-CDYDqHNv.js} +161 -69
  46. package/dist/runtime.d.ts +49 -41
  47. package/dist/runtime.js +8 -8
  48. package/dist/{sandbox-C7Tk62qn.js → sandbox-BrZxAq11.js} +9048 -8939
  49. package/dist/{secp256k1-Dx2XABHz.js → secp256k1-CmLpsmWl.js} +1 -1
  50. package/dist/session-gateway/index.d.ts +23 -67
  51. package/dist/session-gateway/index.js +578 -451
  52. package/dist/tangle/index.d.ts +1 -1
  53. package/dist/tangle/index.js +1 -1
  54. package/dist/{tangle-Ba4Kz5zT.js → tangle-GiPBak5X.js} +176 -169
  55. package/dist/terminal-stream-types-ClZCArRg.d.ts +662 -0
  56. package/dist/{types-B_QF-iHm.d.ts → types-CtH0GRql.d.ts} +6161 -5812
  57. package/package.json +11 -6
  58. package/dist/client-Lhxo82x1.d.ts +0 -1261
  59. package/dist/errors-mPL-qvgF.d.ts +0 -347
  60. package/dist/index-DRto9Ijb.d.ts +0 -579
  61. package/dist/managed-process-B7WfqKmi.d.ts +0 -15
  62. package/dist/terminal-stream-jdYomM1m.d.ts +0 -389
  63. /package/dist/{cli-auth-bundle-ODe06Ts7.d.ts → cli-auth-bundle-Dyw3hCGx.d.ts} +0 -0
  64. /package/dist/{line-application-Cq6dJLBD.js → line-application-DY9ZTdgF.js} +0 -0
  65. /package/dist/{preview-operations-DqSo-IBm.js → preview-operations-Ca02vPDJ.js} +0 -0
  66. /package/dist/{utils-B7_9Hl_z.js → utils-BGvM02yJ.js} +0 -0
@@ -1,579 +0,0 @@
1
- import { n as SandboxInstance } from "./sandbox-CoIGxzm_.js";
2
- import { B as CreateSandboxOptions, Sn as HttpClient } from "./types-B_QF-iHm.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 readonly chain;
358
- private readonly sandboxes;
359
- private readonly operatorApiUrl?;
360
- private readonly operatorApiToken?;
361
- private operatorSession;
362
- constructor(config: TangleSandboxClientConfig);
363
- /**
364
- * Create a sandbox via on-chain job submission.
365
- *
366
- * Secrets never ride the chain: `options.tangleSecrets` is delivered to the
367
- * operator's 2-phase provisioning endpoint over an EIP-191-authenticated
368
- * session after the job completes (requires `operatorApiUrl`). Everything
369
- * in `options.env` IS published on-chain in the job calldata — secret-shaped
370
- * keys there trigger a warning pointing at `tangleSecrets`.
371
- */
372
- create(options?: CreateSandboxOptions): Promise<SandboxInstance>;
373
- /**
374
- * Get a sandbox by id. Rehydrates from the operator API when configured so
375
- * app servers can resolve sandboxes created by earlier requests.
376
- */
377
- get(id: string): Promise<SandboxInstance | null>;
378
- /**
379
- * Route interception for SandboxInstance lifecycle calls.
380
- *
381
- * SandboxInstance calls this.client.fetch() for:
382
- * - GET /v1/sandboxes/:id → return from local tracking
383
- * - POST /v1/sandboxes/:id/stop → unsupported until blueprint exposes stop
384
- * - POST /v1/sandboxes/:id/resume → unsupported until blueprint exposes resume
385
- * - DELETE /v1/sandboxes/:id → on-chain JOB_SANDBOX_DELETE
386
- */
387
- fetch(path: string, options?: RequestInit): Promise<Response>;
388
- private fetchRuntime;
389
- /**
390
- * Get available capacity from the blueprint contract.
391
- * Requires blueprintContractAddress in config.
392
- */
393
- getAvailableCapacity(): Promise<number>;
394
- /**
395
- * Get service stats from the blueprint contract.
396
- * Requires blueprintContractAddress in config.
397
- */
398
- getServiceStats(): Promise<{
399
- totalSandboxes: number;
400
- totalCapacity: number;
401
- }>;
402
- /**
403
- * Mint or reuse the EIP-191 session for the operator API.
404
- *
405
- * The session is signed by the SAME key that submits jobs (`chain.signMessage`),
406
- * so the operator binds it to every sandbox this client created.
407
- */
408
- private getOperatorSession;
409
- /**
410
- * Deliver secrets to a sandbox via the operator's 2-phase provisioning
411
- * endpoint (`POST /api/sandboxes/:id/secrets`).
412
- *
413
- * Unlike `env`, these values never appear on-chain: they ride TLS to the
414
- * operator, which validates the session's recovered address against the
415
- * sandbox's on-chain creator before injecting.
416
- */
417
- injectSecrets(sandboxId: string, secrets: Record<string, string>): Promise<void>;
418
- /** Read a sandbox's provisioned secret keys and credential availability. */
419
- getSecrets(sandboxId: string): Promise<{
420
- sandboxId: string;
421
- envJson: Record<string, unknown>;
422
- credentialsAvailable: boolean;
423
- }>;
424
- /**
425
- * Run an operator-API request with a session, retrying once with a fresh
426
- * session on 401 (expired PASETO). Any other failure names the sandbox so
427
- * the caller can retry without losing the ID.
428
- */
429
- private withOperatorSession;
430
- private fetchOperatorApi;
431
- }
432
- //#endregion
433
- //#region src/tangle/operator-auth.d.ts
434
- /**
435
- * Operator API session auth — the client half of the operator's EIP-191
436
- * challenge-response flow (`sandbox-runtime/src/session_auth`).
437
- *
438
- * Flow (matches the operator exactly):
439
- * 1. `POST /api/auth/challenge` → `{ nonce, message, expires_at }`
440
- * 2. Sign `message` with the job submitter's key (EIP-191 personal_sign,
441
- * 65-byte `r ‖ s ‖ v`)
442
- * 3. `POST /api/auth/session` `{ nonce, signature }` →
443
- * `{ token, address, expires_at }` (PASETO bearer, 1h)
444
- * 4. `Authorization: Bearer <token>`
445
- *
446
- * The operator recovers the signer address from the signature and binds every
447
- * sandbox operation to it: `require_sandbox_owner` rejects any session whose
448
- * address is not the sandbox's on-chain creator. So a session minted from the
449
- * same key that submitted the create job can read/inject that sandbox's
450
- * secrets — and nothing else.
451
- */
452
- /** Challenge payload served by `POST /api/auth/challenge`. */
453
- interface OperatorChallenge {
454
- nonce: string;
455
- message: string;
456
- expires_at: number;
457
- }
458
- /** Session payload served by `POST /api/auth/session`. */
459
- interface OperatorSessionToken {
460
- token: string;
461
- address: string;
462
- expires_at: number;
463
- }
464
- /** Signs an arbitrary message with EIP-191 personal_sign semantics. */
465
- type SignMessage = (message: string) => Promise<`0x${string}`>;
466
- declare class OperatorSessionError extends Error {
467
- readonly status?: number | undefined;
468
- constructor(message: string, status?: number | undefined);
469
- }
470
- /**
471
- * A bearer session with the blueprint operator API, minted by proving control
472
- * of the job submitter's key. Establish lazily and reuse until near expiry;
473
- * the caller retries with a fresh session on 401.
474
- */
475
- declare class OperatorSession {
476
- private readonly token;
477
- private readonly address;
478
- private readonly expiresAtMs;
479
- private constructor();
480
- get signerAddress(): string;
481
- /** True when the token is within the refresh margin of expiry. */
482
- needsRefresh(nowMs?: number): boolean;
483
- authorizationHeader(): string;
484
- /**
485
- * Run the challenge-response flow against an operator API base URL.
486
- *
487
- * `signMessage` must implement EIP-191 personal_sign with the SAME key that
488
- * submitted the sandbox create job — the operator binds ownership to the
489
- * recovered address, so any other key yields a session that owns nothing.
490
- */
491
- static establish(baseUrl: string, signMessage: SignMessage, fetchImpl?: typeof fetch): Promise<OperatorSession>;
492
- }
493
- //#endregion
494
- //#region src/tangle/rfq.d.ts
495
- /**
496
- * RFQ quote primitives for tnt-core's `JobsRFQ` marketplace flow.
497
- *
498
- * These helpers fetch, hash, and validate operator quotes. Callers remain
499
- * responsible for preparing and submitting on-chain transactions.
500
- *
501
- * The EIP-712 hashing here is pinned byte-for-byte against the Rust SDK
502
- * (blueprint `tangle-extra::job_quote`, digest fixture in
503
- * `tangle-rfq.test.ts`) and against `SignatureLib` in tnt-core. Never change
504
- * the typed-data shape without regenerating all three.
505
- */
506
- type Address = `0x${string}`;
507
- type Hash = `0x${string}`;
508
- /** EIP-712 domain — identical to tnt-core `Base.sol`: name "TangleQuote", version "1". */
509
- interface QuoteDomain {
510
- chainId: number;
511
- verifyingContract: Address;
512
- }
513
- /** Mirrors `JobQuoteDetails` in tnt-core `SignatureLib` (field-for-field). */
514
- interface JobQuoteDetails {
515
- requester: Address;
516
- serviceId: bigint;
517
- jobIndex: number;
518
- /** Price in the chain native unit's smallest denomination; wire values use
519
- * decimal strings to survive JSON transport without precision loss. */
520
- price: bigint;
521
- timestamp: bigint;
522
- expiry: bigint;
523
- /** tnt-core `ConfidentialityPolicy`: 0 Any, 1 TEE required, 2 Standard required, 3 TEE preferred. */
524
- confidentiality: 0 | 1 | 2 | 3;
525
- inputsHash: Hash;
526
- }
527
- /** A signed quote as served by the operator's `/api/quote`. */
528
- interface SignedQuote {
529
- details: JobQuoteDetails;
530
- /** 65-byte `r ‖ s ‖ v` hex — exactly what `submitJobFromQuote` expects. */
531
- signature: `0x${string}`;
532
- operator: Address;
533
- /** Operator-reported live capacity at quote time (informational). */
534
- capacity?: {
535
- active: number;
536
- max: number;
537
- };
538
- }
539
- declare class QuoteError extends Error {
540
- readonly code: "QUOTE_REJECTED" | "QUOTE_SIGNATURE_INVALID" | "QUOTE_EXPIRED" | "QUOTE_MISMATCH";
541
- constructor(message: string, code: "QUOTE_REJECTED" | "QUOTE_SIGNATURE_INVALID" | "QUOTE_EXPIRED" | "QUOTE_MISMATCH");
542
- }
543
- /**
544
- * The EIP-712 digest of a quote — matches
545
- * `job_quote_digest_eip712` (Rust SDK) and `computeJobQuoteDigest` (tnt-core).
546
- */
547
- declare function jobQuoteDigest(details: JobQuoteDetails, domain: QuoteDomain): Hash;
548
- /** Parse the operator's `/api/quote` JSON without fabricating missing values. */
549
- declare function parseQuoteResponse(raw: Record<string, unknown>): SignedQuote;
550
- /** keccak256 of the exact ABI-encoded job inputs — what quotes bind to. */
551
- declare function inputsHashOf(encodedInputs: `0x${string}`): Hash;
552
- /**
553
- * Validate a quote before paying for it: fresh (not expired), addressed to
554
- * the buyer, for the exact inputs about to be submitted, on the expected
555
- * service/job, and signed by the operator it names.
556
- *
557
- * Signature verification uses viem's offline EOA recovery and compares the
558
- * signer against the same digest the chain checks.
559
- */
560
- declare function validateQuote(args: {
561
- quote: SignedQuote;
562
- domain: QuoteDomain; /** The buyer's address — must equal `details.requester`. */
563
- buyer: Address;
564
- serviceId: bigint;
565
- jobIndex: number;
566
- inputsHash: Hash;
567
- now?: number;
568
- }): Promise<void>;
569
- /** Query one operator for a quote over HTTP. */
570
- declare function fetchQuote(operatorApiUrl: string, params: {
571
- requester: Address;
572
- jobIndex: number; /** 0x-hex ABI-encoded job inputs, or a precomputed keccak256 hash. */
573
- inputs?: `0x${string}`;
574
- inputsHash?: Hash;
575
- confidentiality?: JobQuoteDetails["confidentiality"];
576
- fetchImpl?: typeof fetch;
577
- }): Promise<SignedQuote>;
578
- //#endregion
579
- 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 { Fn as ManagedProcessJobs, In as ManagedProcessOptions, Ln as ManagedProcessRecord, Rn as ManagedProcessResumeOptions, zn as ManagedProcessSpec } from "./types-B_QF-iHm.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 };