@tangle-network/sandbox 0.63.20 → 0.63.22

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 (65) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +5 -5
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +2 -2
  5. package/dist/{agent-run-outcome-DlYhZnhD.d.ts → agent-run-outcome-C-VR-L0I.d.ts} +1 -1
  6. package/dist/auth/index.d.ts +2 -2
  7. package/dist/auth/index.js +1 -1
  8. package/dist/{backend-types-D6bYbvMB.js → backend-types-zuUBEJO1.js} +35 -1
  9. package/dist/{browser-interactive-control-controller-B6sySQFu.d.ts → browser-interactive-control-controller-CvObO_Kf.d.ts} +1 -1
  10. package/dist/{browser-interactive-control-controller-BJf0P_J4.js → browser-interactive-control-controller-DHx53yre.js} +16 -1
  11. package/dist/{chunked-upload-KJyRCAiC.js → chunked-upload-DN2twsUu.js} +1 -1
  12. package/dist/{chunked-upload-file-DfiGzqaR.js → chunked-upload-file-Dpv1YsoA.js} +2 -2
  13. package/dist/{cli-auth-bundle-CMgB8Ec3.js → cli-auth-bundle-R0Y7rngn.js} +8 -8
  14. package/dist/{client-Dl22CVOz.js → client-CGcWP4FX.js} +3271 -3271
  15. package/dist/client-CqpKC6n3.d.ts +6066 -0
  16. package/dist/collaboration/index.d.ts +1 -1
  17. package/dist/collaboration/index.js +1 -1
  18. package/dist/{collaboration-XHg5BEUI.js → collaboration-g_HzXa6f.js} +1 -1
  19. package/dist/core.d.ts +6 -7
  20. package/dist/core.js +5 -5
  21. package/dist/{direct-http2-Dq7tq6jV.js → direct-http2-CoGVOqVR.js} +1 -1
  22. package/dist/{errors-AB5BD3FM.js → errors-BfbOP_rx.js} +19 -1
  23. package/dist/{sandbox-DDdPhk2j.d.ts → index-D4OBUP5M.d.ts} +2105 -1461
  24. package/dist/index.d.ts +12 -4747
  25. package/dist/index.js +15 -11
  26. package/dist/intelligence/index.js +1 -1
  27. package/dist/interactive-control.d.ts +1 -1
  28. package/dist/interactive-control.js +1 -1
  29. package/dist/{interactive-controller-BSWoA0YE.d.ts → interactive-controller-BBwB_5QQ.d.ts} +3 -2
  30. package/dist/{interactive-controller-zE6hwv3C.js → interactive-controller-D4N4zqmu.js} +578 -610
  31. package/dist/{lines-hsXVdk60.d.ts → lines-5m11CEj-.d.ts} +21 -17
  32. package/dist/lines-C5ER4aN_.js +298 -0
  33. package/dist/lines.d.ts +1 -1
  34. package/dist/lines.js +1 -295
  35. package/dist/{local-cli-auth-C4QcPdZt.js → local-cli-auth-DVUBOY4y.js} +1 -1
  36. package/dist/{mcp-local-BYHcA72Z.js → mcp-local-BjLG7VHY.js} +1 -1
  37. package/dist/{preview-D8UAF7F9.d.ts → preview-CcJBQSjB.d.ts} +3 -3
  38. package/dist/{public-templates-BP3sTaSb.d.ts → public-templates-nv4AFFVc.d.ts} +2 -2
  39. package/dist/public-templates.d.ts +1 -1
  40. package/dist/public-templates.js +1 -1
  41. package/dist/runtime.d.ts +47 -40
  42. package/dist/runtime.js +4 -4
  43. package/dist/{sandbox-BJkpVtLN.js → sandbox-BDgvO9Z3.js} +9256 -9215
  44. package/dist/{secp256k1-DoWlH6ff.js → secp256k1-CmLpsmWl.js} +1 -1
  45. package/dist/session-gateway/index.d.ts +16 -17
  46. package/dist/session-gateway/index.js +20 -23
  47. package/dist/tangle/index.d.ts +1 -1
  48. package/dist/tangle/index.js +1 -1
  49. package/dist/{tangle-BBpguPfj.js → tangle-D-VfQGTu.js} +144 -138
  50. package/dist/terminal-stream-types-ClZCArRg.d.ts +662 -0
  51. package/dist/{types-BxZX2EVj.d.ts → types-BjyQe_CI.d.ts} +393 -315
  52. package/package.json +6 -6
  53. package/dist/client-DraGbXEP.d.ts +0 -1249
  54. package/dist/error-classes-BWS1a9HO.d.ts +0 -321
  55. package/dist/index-xS3mRl69.d.ts +0 -578
  56. package/dist/managed-process-B-pXdMLC.d.ts +0 -15
  57. package/dist/terminal-stream-DgD7GlFi.d.ts +0 -388
  58. /package/dist/{cli-auth-bundle-BKsrsbxy.d.ts → cli-auth-bundle-Dyw3hCGx.d.ts} +0 -0
  59. /package/dist/{index-DfA_usrZ.d.ts → index-C8VSFtWl.d.ts} +0 -0
  60. /package/dist/{index-CWUW8pqr.d.ts → index-CVjTnRWP.d.ts} +0 -0
  61. /package/dist/{keep-alive-fetch-CXvfSczd.js → keep-alive-fetch-CuwGi7gz.js} +0 -0
  62. /package/dist/{line-application-UtPFP0o4.js → line-application-DY9ZTdgF.js} +0 -0
  63. /package/dist/{preview-operations-Bvo5YcIq.js → preview-operations-Ca02vPDJ.js} +0 -0
  64. /package/dist/{raw-evidence-archive-Bxk6fUjS.js → raw-evidence-archive-CDYDqHNv.js} +0 -0
  65. /package/dist/{utils-B6gap92T.js → utils-BGvM02yJ.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { a as anumber, c as concatBytes$1, f as randomBytes, h as toBytes, i as ahash, l as createHasher$1, n as abytes$1, o as aoutput, p as rotr, r as aexists, s as clean, t as Hash, u as createView, x as split } from "./utils-B6gap92T.js";
1
+ import { a as anumber, c as concatBytes$1, f as randomBytes, h as toBytes, i as ahash, l as createHasher$1, n as abytes$1, o as aoutput, p as rotr, r as aexists, s as clean, t as Hash, u as createView, x as split } from "./utils-BGvM02yJ.js";
2
2
  //#region ../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
3
3
  /**
4
4
  * Internal Merkle-Damgard hash utils.
@@ -66,7 +66,7 @@ interface RuntimeUnavailableData {
66
66
  /**
67
67
  * Message types sent by the server.
68
68
  */
69
- type ServerMessage = (ServerMessageBase & {
69
+ type GatewayServerMessage = (ServerMessageBase & {
70
70
  type: "connection.established";
71
71
  data: {
72
72
  sessionId: string;
@@ -258,7 +258,7 @@ interface TokenRefreshResult {
258
258
  /**
259
259
  * Event handlers for session gateway events.
260
260
  */
261
- interface SessionGatewayEventHandlers {
261
+ interface GatewayEventHandlers {
262
262
  onConnect?: (sessionId: string) => void;
263
263
  onDisconnect?: (code: number, reason: string) => void;
264
264
  onReconnect?: () => void;
@@ -359,7 +359,7 @@ type TransportMode = "websocket";
359
359
  /**
360
360
  * Configuration for SessionGatewayClient.
361
361
  */
362
- interface SessionGatewayClientConfig {
362
+ interface GatewayClientConfig {
363
363
  /** WebSocket URL for the session gateway */
364
364
  url: string;
365
365
  /**
@@ -408,7 +408,7 @@ interface SessionGatewayClientConfig {
408
408
  /** Number of latency samples to track for averaging (default: 10) */
409
409
  latencyHistorySize?: number;
410
410
  /** Event handlers */
411
- handlers?: SessionGatewayEventHandlers;
411
+ handlers?: GatewayEventHandlers;
412
412
  }
413
413
  /**
414
414
  * Statistics for the session gateway connection.
@@ -431,7 +431,7 @@ interface SessionGatewayStats {
431
431
  */
432
432
  declare function calculateConnectionQuality(metrics: ConnectionMetrics, isConnected: boolean): ConnectionQuality;
433
433
  //#endregion
434
- //#region ../../../packages/sdk/dist/client-C_E_mxfN.d.ts
434
+ //#region ../../../packages/sdk/dist/client-BiqC9Qo9.d.ts
435
435
  //#region src/session-gateway/core-types.d.ts
436
436
  interface SubscriptionDenial {
437
437
  channel: string;
@@ -441,7 +441,7 @@ interface SubscriptionAcknowledgement {
441
441
  channels: string[];
442
442
  denied?: SubscriptionDenial[];
443
443
  }
444
- type ServerMessage$2 = Exclude<ServerMessage, {
444
+ type ServerMessage$1 = Exclude<GatewayServerMessage, {
445
445
  type: "connection.established" | "subscribed";
446
446
  }> | (ServerMessageBase & {
447
447
  type: "connection.established";
@@ -483,19 +483,20 @@ interface RawWireMessage {
483
483
  interface NormalizedServerMessage extends RawWireMessage {
484
484
  type: string;
485
485
  }
486
- interface SessionGatewayEventHandlers$2 extends SessionGatewayEventHandlers {
486
+ interface SessionGatewayEventHandlers$1 extends GatewayEventHandlers {
487
487
  /** Called after internal processing for every non-duplicate normalized frame. */
488
488
  onMessage?: (message: NormalizedServerMessage) => void;
489
489
  }
490
- interface SessionGatewayClientConfig$2 extends Omit<SessionGatewayClientConfig, "handlers"> {
490
+ interface SessionGatewayClientConfig$1 extends Omit<GatewayClientConfig, "handlers"> {
491
491
  /** Browser session ID embedded in the session-scoped read token. */
492
492
  sessionId: string;
493
493
  /** Additional subscriptions; server-authorized channels are used by default. */
494
494
  channels?: string[];
495
495
  /** Maximum wait for `connection.established` (default: 10000 ms). */
496
496
  connectionEstablishmentTimeoutMs?: number;
497
- handlers?: SessionGatewayEventHandlers$2;
498
- } //#endregion
497
+ handlers?: SessionGatewayEventHandlers$1;
498
+ }
499
+ declare const INITIAL_METRICS: ConnectionMetrics; //#endregion
499
500
  //#region src/session-gateway/core.d.ts
500
501
  declare class SessionGatewayClientCore {
501
502
  #private;
@@ -531,7 +532,7 @@ declare class SessionGatewayClientCore {
531
532
  private currentSessionId;
532
533
  private isReplaying;
533
534
  private replayProgress;
534
- constructor(config: SessionGatewayClientConfig$2, initialMetrics?: ConnectionMetrics);
535
+ constructor(config: SessionGatewayClientConfig$1, initialMetrics?: ConnectionMetrics);
535
536
  /**
536
537
  * Connect to the session gateway.
537
538
  */
@@ -615,18 +616,16 @@ declare class SessionGatewayClientCore {
615
616
  private loadReplayState;
616
617
  private saveReplayState;
617
618
  } //#endregion
618
- //#region src/session-gateway/types.d.ts
619
- //#endregion
620
- //#region src/session-gateway/types.d.ts
621
- declare const INITIAL_METRICS: ConnectionMetrics;
619
+ //#region src/session-gateway/client.d.ts
620
+ /** SDK client with its original immediate, synchronous replay commands. */
622
621
  //#endregion
623
622
  //#region src/session-gateway/client.d.ts
624
623
  /** Sandbox replay waits for the server's authenticated connection receipt. */
625
624
  declare class SessionGatewayClient extends SessionGatewayClientCore {
626
- constructor(config: SessionGatewayClientConfig$2);
625
+ constructor(config: SessionGatewayClientConfig$1);
627
626
  /** @deprecated Timestamps are not a stable cursor. Use replaySinceSeq(). */
628
627
  replay(since: number): Promise<void>;
629
628
  replaySinceSeq(sinceSeq: number): Promise<void>;
630
629
  }
631
630
  //#endregion
632
- export { type ClientMessage, type ConnectionMetrics, type ConnectionQuality, type ConnectionState, INITIAL_METRICS, type NormalizedServerMessage, type PortEventData, type ReplayOptions, type ReplayState, type ReplayStateStorage, type RuntimeUnavailableData, type RuntimeUnavailableReason, type ServerMessage$2 as ServerMessage, SessionGatewayClient, type SessionGatewayClientConfig$2 as SessionGatewayClientConfig, type SessionGatewayEventHandlers$2 as SessionGatewayEventHandlers, type SessionGatewayStats, type SubscriptionAcknowledgement, type SubscriptionDenial, type TokenRefreshResult, type TransportMode, calculateConnectionQuality };
631
+ export { type ClientMessage, type ConnectionMetrics, type ConnectionQuality, type ConnectionState, INITIAL_METRICS, type NormalizedServerMessage, type PortEventData, type ReplayOptions, type ReplayState, type ReplayStateStorage, type RuntimeUnavailableData, type RuntimeUnavailableReason, type ServerMessage$1 as ServerMessage, SessionGatewayClient, type SessionGatewayClientConfig$1 as SessionGatewayClientConfig, type SessionGatewayEventHandlers$1 as SessionGatewayEventHandlers, type SessionGatewayStats, type SubscriptionAcknowledgement, type SubscriptionDenial, type TokenRefreshResult, type TransportMode, calculateConnectionQuality };
@@ -33,7 +33,7 @@ function calculateConnectionQuality(metrics, isConnected) {
33
33
  return "good";
34
34
  }
35
35
  //#endregion
36
- //#region ../../../packages/sdk/dist/client-CGwxRfro.js
36
+ //#region ../../../packages/sdk/dist/types-B0EH3UTU.js
37
37
  function invokeClientCallback(name, callback, onError) {
38
38
  try {
39
39
  callback();
@@ -85,8 +85,8 @@ var ConnectionWaiters = class {
85
85
  }
86
86
  };
87
87
  /** Browser-safe session gateway contracts for both SDK clients. */
88
- const INITIAL_METRICS$1 = createConnectionMetrics();
89
- const DEFAULT_CONFIG = {
88
+ const INITIAL_METRICS = createConnectionMetrics();
89
+ const DEFAULT_SESSION_GATEWAY_CLIENT_CONFIG = {
90
90
  transport: "websocket",
91
91
  channels: [],
92
92
  autoReconnect: true,
@@ -273,30 +273,31 @@ var SessionGatewayClientCore = class {
273
273
  total: 0,
274
274
  received: 0
275
275
  };
276
- constructor(config, initialMetrics = INITIAL_METRICS$1) {
276
+ constructor(config, initialMetrics = INITIAL_METRICS) {
277
277
  this.initialMetrics = initialMetrics;
278
278
  this.connectionMetrics = { ...initialMetrics };
279
279
  if (!config.token.trim()) throw new Error("Session gateway token must not be empty");
280
280
  const replayStorage = resolveReplayStorage(config.replayStorage);
281
+ const defaults = DEFAULT_SESSION_GATEWAY_CLIENT_CONFIG;
281
282
  this.#config = {
282
283
  url: config.url,
283
284
  sessionId: config.sessionId,
284
285
  token: config.token,
285
- transport: config.transport ?? DEFAULT_CONFIG.transport,
286
- channels: config.channels ?? DEFAULT_CONFIG.channels,
287
- autoReconnect: config.autoReconnect ?? DEFAULT_CONFIG.autoReconnect,
288
- maxReconnectAttempts: config.maxReconnectAttempts ?? DEFAULT_CONFIG.maxReconnectAttempts,
289
- initialReconnectDelayMs: config.initialReconnectDelayMs ?? DEFAULT_CONFIG.initialReconnectDelayMs,
290
- maxReconnectDelayMs: config.maxReconnectDelayMs ?? DEFAULT_CONFIG.maxReconnectDelayMs,
291
- pingIntervalMs: config.pingIntervalMs ?? DEFAULT_CONFIG.pingIntervalMs,
292
- pongTimeoutMs: config.pongTimeoutMs ?? DEFAULT_CONFIG.pongTimeoutMs,
293
- maxMissedPongs: config.maxMissedPongs ?? DEFAULT_CONFIG.maxMissedPongs,
294
- enableDeduplication: config.enableDeduplication ?? DEFAULT_CONFIG.enableDeduplication,
295
- maxDeduplicationSize: config.maxDeduplicationSize ?? DEFAULT_CONFIG.maxDeduplicationSize,
296
- enableReplayPersistence: config.enableReplayPersistence ?? DEFAULT_CONFIG.enableReplayPersistence,
297
- replayStorageKeyPrefix: config.replayStorageKeyPrefix ?? DEFAULT_CONFIG.replayStorageKeyPrefix,
298
- latencyHistorySize: config.latencyHistorySize ?? DEFAULT_CONFIG.latencyHistorySize,
299
- connectionEstablishmentTimeoutMs: config.connectionEstablishmentTimeoutMs ?? DEFAULT_CONFIG.connectionEstablishmentTimeoutMs
286
+ transport: config.transport ?? defaults.transport,
287
+ channels: config.channels ?? defaults.channels,
288
+ autoReconnect: config.autoReconnect ?? defaults.autoReconnect,
289
+ maxReconnectAttempts: config.maxReconnectAttempts ?? defaults.maxReconnectAttempts,
290
+ initialReconnectDelayMs: config.initialReconnectDelayMs ?? defaults.initialReconnectDelayMs,
291
+ maxReconnectDelayMs: config.maxReconnectDelayMs ?? defaults.maxReconnectDelayMs,
292
+ pingIntervalMs: config.pingIntervalMs ?? defaults.pingIntervalMs,
293
+ pongTimeoutMs: config.pongTimeoutMs ?? defaults.pongTimeoutMs,
294
+ maxMissedPongs: config.maxMissedPongs ?? defaults.maxMissedPongs,
295
+ enableDeduplication: config.enableDeduplication ?? defaults.enableDeduplication,
296
+ maxDeduplicationSize: config.maxDeduplicationSize ?? defaults.maxDeduplicationSize,
297
+ enableReplayPersistence: config.enableReplayPersistence ?? defaults.enableReplayPersistence,
298
+ replayStorageKeyPrefix: config.replayStorageKeyPrefix ?? defaults.replayStorageKeyPrefix,
299
+ latencyHistorySize: config.latencyHistorySize ?? defaults.latencyHistorySize,
300
+ connectionEstablishmentTimeoutMs: config.connectionEstablishmentTimeoutMs ?? defaults.connectionEstablishmentTimeoutMs
300
301
  };
301
302
  this.handlers = config.handlers ?? {};
302
303
  this.connectionWaiters = new ConnectionWaiters(this.#config.connectionEstablishmentTimeoutMs);
@@ -853,10 +854,6 @@ var SessionGatewayClientCore = class {
853
854
  });
854
855
  }
855
856
  };
856
- createConnectionMetrics();
857
- //#endregion
858
- //#region src/session-gateway/types.ts
859
- const INITIAL_METRICS = createConnectionMetrics();
860
857
  //#endregion
861
858
  //#region src/session-gateway/client.ts
862
859
  /** Sandbox replay waits for the server's authenticated connection receipt. */
@@ -1,2 +1,2 @@
1
- import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as ITangleJobsAbi, T as SandboxCreateResponseParamTypes, _ as JOB_SANDBOX_DELETE, a as fetchQuote, b as TangleSandboxClientConfig, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as JOB_SANDBOX_CREATE, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TANGLE_CHAIN_ID, w as SandboxCreateParamTypes, x as AgentSandboxBlueprintAbi, y as TANGLE_JOBS_CONTRACT } from "../index-xS3mRl69.js";
1
+ import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-D4OBUP5M.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JobQuoteDetails, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, QuoteDomain, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, SignedQuote, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,2 +1,2 @@
1
- import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as JOB_SANDBOX_DELETE, f as TANGLE_CHAIN_ID, g as JsonResponseParamTypes, h as ITangleJobsAbi, i as jobQuoteDigest, l as OperatorSessionError, m as AgentSandboxBlueprintAbi, n as fetchQuote, o as validateQuote, p as TANGLE_JOBS_CONTRACT, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as JOB_SANDBOX_CREATE, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-BBpguPfj.js";
1
+ import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-D-VfQGTu.js";
2
2
  export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
@@ -1,138 +1,16 @@
1
- import { r as readResponseJson } from "./errors-AB5BD3FM.js";
2
- import { n as createSandboxInstanceFromResponse } from "./sandbox-BJkpVtLN.js";
3
- import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-B6gap92T.js";
4
- //#region src/tangle/abi.ts
1
+ import { i as readResponseJson } from "./errors-BfbOP_rx.js";
2
+ import { n as createSandboxInstanceFromResponse } from "./sandbox-BDgvO9Z3.js";
3
+ import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-BGvM02yJ.js";
4
+ //#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
5
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.
6
+ * Tangle blueprint wire contract shared by the orchestrator's Tangle driver and
7
+ * the published sandbox SDK's Tangle client: job indices and the ABI
8
+ * definitions for encoding/decoding the AgentSandbox blueprint's job inputs
9
+ * and outputs, plus its contract views/events.
11
10
  */
12
- const ITangleJobsAbi = [
13
- {
14
- type: "function",
15
- name: "submitJob",
16
- inputs: [
17
- {
18
- name: "serviceId",
19
- type: "uint64"
20
- },
21
- {
22
- name: "jobIndex",
23
- type: "uint8"
24
- },
25
- {
26
- name: "inputs",
27
- type: "bytes"
28
- }
29
- ],
30
- outputs: [{
31
- name: "callId",
32
- type: "uint64"
33
- }],
34
- stateMutability: "payable"
35
- },
36
- {
37
- type: "function",
38
- name: "getJobCall",
39
- inputs: [{
40
- name: "serviceId",
41
- type: "uint64"
42
- }, {
43
- name: "callId",
44
- type: "uint64"
45
- }],
46
- outputs: [{
47
- name: "",
48
- type: "tuple",
49
- components: [
50
- {
51
- name: "jobIndex",
52
- type: "uint8"
53
- },
54
- {
55
- name: "caller",
56
- type: "address"
57
- },
58
- {
59
- name: "createdAt",
60
- type: "uint64"
61
- },
62
- {
63
- name: "resultCount",
64
- type: "uint32"
65
- },
66
- {
67
- name: "payment",
68
- type: "uint256"
69
- },
70
- {
71
- name: "completed",
72
- type: "bool"
73
- }
74
- ]
75
- }],
76
- stateMutability: "view"
77
- },
78
- {
79
- type: "event",
80
- name: "JobSubmitted",
81
- inputs: [
82
- {
83
- name: "serviceId",
84
- type: "uint64",
85
- indexed: true
86
- },
87
- {
88
- name: "callId",
89
- type: "uint64",
90
- indexed: true
91
- },
92
- {
93
- name: "jobIndex",
94
- type: "uint8",
95
- indexed: false
96
- },
97
- {
98
- name: "caller",
99
- type: "address",
100
- indexed: false
101
- },
102
- {
103
- name: "inputs",
104
- type: "bytes",
105
- indexed: false
106
- }
107
- ]
108
- },
109
- {
110
- type: "event",
111
- name: "JobResultSubmitted",
112
- inputs: [
113
- {
114
- name: "serviceId",
115
- type: "uint64",
116
- indexed: true
117
- },
118
- {
119
- name: "callId",
120
- type: "uint64",
121
- indexed: true
122
- },
123
- {
124
- name: "operator",
125
- type: "address",
126
- indexed: true
127
- },
128
- {
129
- name: "result",
130
- type: "bytes",
131
- indexed: false
132
- }
133
- ]
134
- }
135
- ];
11
+ /** Job indices matching the blueprint's job IDs. */
12
+ const JOB_SANDBOX_CREATE = 0;
13
+ const JOB_SANDBOX_DELETE = 1;
136
14
  const SandboxCreateParamTypes = [{
137
15
  name: "request",
138
16
  type: "tuple",
@@ -374,6 +252,137 @@ const AgentSandboxBlueprintAbi = [
374
252
  }
375
253
  ];
376
254
  //#endregion
255
+ //#region src/tangle/abi.ts
256
+ /**
257
+ * Tangle Contract ABI Definitions
258
+ *
259
+ * Viem-compatible ABI for the ITangleJobs precompile.
260
+ */
261
+ const ITangleJobsAbi = [
262
+ {
263
+ type: "function",
264
+ name: "submitJob",
265
+ inputs: [
266
+ {
267
+ name: "serviceId",
268
+ type: "uint64"
269
+ },
270
+ {
271
+ name: "jobIndex",
272
+ type: "uint8"
273
+ },
274
+ {
275
+ name: "inputs",
276
+ type: "bytes"
277
+ }
278
+ ],
279
+ outputs: [{
280
+ name: "callId",
281
+ type: "uint64"
282
+ }],
283
+ stateMutability: "payable"
284
+ },
285
+ {
286
+ type: "function",
287
+ name: "getJobCall",
288
+ inputs: [{
289
+ name: "serviceId",
290
+ type: "uint64"
291
+ }, {
292
+ name: "callId",
293
+ type: "uint64"
294
+ }],
295
+ outputs: [{
296
+ name: "",
297
+ type: "tuple",
298
+ components: [
299
+ {
300
+ name: "jobIndex",
301
+ type: "uint8"
302
+ },
303
+ {
304
+ name: "caller",
305
+ type: "address"
306
+ },
307
+ {
308
+ name: "createdAt",
309
+ type: "uint64"
310
+ },
311
+ {
312
+ name: "resultCount",
313
+ type: "uint32"
314
+ },
315
+ {
316
+ name: "payment",
317
+ type: "uint256"
318
+ },
319
+ {
320
+ name: "completed",
321
+ type: "bool"
322
+ }
323
+ ]
324
+ }],
325
+ stateMutability: "view"
326
+ },
327
+ {
328
+ type: "event",
329
+ name: "JobSubmitted",
330
+ inputs: [
331
+ {
332
+ name: "serviceId",
333
+ type: "uint64",
334
+ indexed: true
335
+ },
336
+ {
337
+ name: "callId",
338
+ type: "uint64",
339
+ indexed: true
340
+ },
341
+ {
342
+ name: "jobIndex",
343
+ type: "uint8",
344
+ indexed: false
345
+ },
346
+ {
347
+ name: "caller",
348
+ type: "address",
349
+ indexed: false
350
+ },
351
+ {
352
+ name: "inputs",
353
+ type: "bytes",
354
+ indexed: false
355
+ }
356
+ ]
357
+ },
358
+ {
359
+ type: "event",
360
+ name: "JobResultSubmitted",
361
+ inputs: [
362
+ {
363
+ name: "serviceId",
364
+ type: "uint64",
365
+ indexed: true
366
+ },
367
+ {
368
+ name: "callId",
369
+ type: "uint64",
370
+ indexed: true
371
+ },
372
+ {
373
+ name: "operator",
374
+ type: "address",
375
+ indexed: true
376
+ },
377
+ {
378
+ name: "result",
379
+ type: "bytes",
380
+ indexed: false
381
+ }
382
+ ]
383
+ }
384
+ ];
385
+ //#endregion
377
386
  //#region src/tangle/types.ts
378
387
  /**
379
388
  * Tangle Sandbox Client types and constants.
@@ -382,9 +391,6 @@ const AgentSandboxBlueprintAbi = [
382
391
  const TANGLE_CHAIN_ID = 5845;
383
392
  /** ITangleJobs precompile contract address. */
384
393
  const TANGLE_JOBS_CONTRACT = "0x0000000000000000000000000000000000000808";
385
- /** Job indices matching the blueprint's job IDs. */
386
- const JOB_SANDBOX_CREATE = 0;
387
- const JOB_SANDBOX_DELETE = 1;
388
394
  //#endregion
389
395
  //#region src/tangle/chain-client.ts
390
396
  function confidentialFromOptions(options) {
@@ -2370,7 +2376,7 @@ function isAddressEqual(a, b) {
2370
2376
  //#region ../../../node_modules/.pnpm/viem@2.55.4_bufferutil@4.1.0_typescript@6.0.3_utf-8-validate@5.0.10_zod@4.6.5/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
2371
2377
  async function recoverPublicKey({ hash, signature }) {
2372
2378
  const hashHex = isHex(hash) ? hash : toHex(hash);
2373
- const { secp256k1 } = await import("./secp256k1-DoWlH6ff.js");
2379
+ const { secp256k1 } = await import("./secp256k1-CmLpsmWl.js");
2374
2380
  return `0x${(() => {
2375
2381
  if (typeof signature === "object" && "r" in signature && "s" in signature) {
2376
2382
  const { r, s, v, yParity } = signature;
@@ -2846,4 +2852,4 @@ async function fetchQuote(operatorApiUrl, params) {
2846
2852
  return parseQuoteResponse(raw);
2847
2853
  }
2848
2854
  //#endregion
2849
- export { SandboxCreateParamTypes as _, parseQuoteResponse as a, OperatorSession as c, JOB_SANDBOX_DELETE as d, TANGLE_CHAIN_ID as f, JsonResponseParamTypes as g, ITangleJobsAbi as h, jobQuoteDigest as i, OperatorSessionError as l, AgentSandboxBlueprintAbi as m, fetchQuote as n, validateQuote as o, TANGLE_JOBS_CONTRACT as p, inputsHashOf as r, TangleSandboxClient as s, QuoteError as t, JOB_SANDBOX_CREATE as u, SandboxCreateResponseParamTypes as v, SandboxIdParamTypes as y };
2855
+ export { SandboxCreateParamTypes as _, parseQuoteResponse as a, OperatorSession as c, TANGLE_JOBS_CONTRACT as d, ITangleJobsAbi as f, JsonResponseParamTypes as g, JOB_SANDBOX_DELETE as h, jobQuoteDigest as i, OperatorSessionError as l, JOB_SANDBOX_CREATE as m, fetchQuote as n, validateQuote as o, AgentSandboxBlueprintAbi as p, inputsHashOf as r, TangleSandboxClient as s, QuoteError as t, TANGLE_CHAIN_ID as u, SandboxCreateResponseParamTypes as v, SandboxIdParamTypes as y };