@tangle-network/agent-app 0.63.28 → 0.63.30

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 (60) hide show
  1. package/dist/{TimelineEditor-VB2UJ34D.js → TimelineEditor-MUY35ULL.js} +3 -3
  2. package/dist/app-auth/index.js +3 -3
  3. package/dist/assistant/index.js +9 -9
  4. package/dist/chat-react/index.js +3 -3
  5. package/dist/chat-routes/default-backend.d.ts +19 -2
  6. package/dist/chat-routes/hybrid-producer.d.ts +7 -2
  7. package/dist/chat-routes/index.js +4 -4
  8. package/dist/chat-routes/route-storage.d.ts +1 -1
  9. package/dist/chat-routes/router-producer.d.ts +2 -1
  10. package/dist/chat-routes/turn-route-contracts.d.ts +1 -1
  11. package/dist/chunk-53ZX7XZY.js +371 -0
  12. package/dist/chunk-53ZX7XZY.js.map +1 -0
  13. package/dist/{chunk-56JUV4DK.js → chunk-5AUZR655.js} +3335 -3020
  14. package/dist/chunk-5AUZR655.js.map +1 -0
  15. package/dist/{chunk-IVBREL7A.js → chunk-5HBIN366.js} +10 -10
  16. package/dist/{chunk-A7JD27SN.js → chunk-6UMIOEDR.js} +13 -13
  17. package/dist/{chunk-QUT3T2IN.js → chunk-L3QR274L.js} +11 -3
  18. package/dist/chunk-L3QR274L.js.map +1 -0
  19. package/dist/chunk-N425HGJW.js +261 -0
  20. package/dist/chunk-N425HGJW.js.map +1 -0
  21. package/dist/{chunk-DCJCZ7EP.js → chunk-QLZ6A73E.js} +37 -19
  22. package/dist/chunk-QLZ6A73E.js.map +1 -0
  23. package/dist/{chunk-ZZTPTCMY.js → chunk-XJXAULNI.js} +7 -7
  24. package/dist/conformance/cli.d.ts +2 -0
  25. package/dist/conformance/cli.js +67 -0
  26. package/dist/conformance/cli.js.map +1 -0
  27. package/dist/conformance/index.d.ts +3 -0
  28. package/dist/conformance/index.js +9 -0
  29. package/dist/conformance/index.js.map +1 -0
  30. package/dist/conformance/revision.d.ts +13 -0
  31. package/dist/conformance/run.d.ts +48 -0
  32. package/dist/conformance/session.d.ts +24 -0
  33. package/dist/conformance/turns.d.ts +37 -0
  34. package/dist/design-canvas/index.js +6 -6
  35. package/dist/design-canvas-react/index.js +4 -4
  36. package/dist/model-resolution/index.js +1 -1
  37. package/dist/operator/index.js +24 -252
  38. package/dist/operator/index.js.map +1 -1
  39. package/dist/platform/index.js +8 -8
  40. package/dist/public-consultation/index.d.ts +2 -2
  41. package/dist/public-consultation/index.js +4 -4
  42. package/dist/sandbox/computer-files.d.ts +67 -0
  43. package/dist/sandbox/computer-receipts.d.ts +46 -0
  44. package/dist/sandbox/computer-step.d.ts +78 -0
  45. package/dist/sandbox/index.d.ts +4 -0
  46. package/dist/sandbox/index.js +23 -1
  47. package/dist/sandbox/router-models.d.ts +26 -0
  48. package/dist/sandbox/sandbox-run-tool.d.ts +5 -4
  49. package/dist/sequences-react/index.js +3 -3
  50. package/dist/settings-react/index.js +1 -1
  51. package/dist/web-react/index.js +28 -28
  52. package/dist/workspace-react/index.js +5 -5
  53. package/package.json +8 -2
  54. package/dist/chunk-56JUV4DK.js.map +0 -1
  55. package/dist/chunk-DCJCZ7EP.js.map +0 -1
  56. package/dist/chunk-QUT3T2IN.js.map +0 -1
  57. /package/dist/{TimelineEditor-VB2UJ34D.js.map → TimelineEditor-MUY35ULL.js.map} +0 -0
  58. /package/dist/{chunk-IVBREL7A.js.map → chunk-5HBIN366.js.map} +0 -0
  59. /package/dist/{chunk-A7JD27SN.js.map → chunk-6UMIOEDR.js.map} +0 -0
  60. /package/dist/{chunk-ZZTPTCMY.js.map → chunk-XJXAULNI.js.map} +0 -0
@@ -11,6 +11,7 @@ import {
11
11
  } from "./chunk-MM6RLOXF.js";
12
12
  import {
13
13
  SandboxRunError,
14
+ createComputerStep,
14
15
  createD1PrewarmClaimStore,
15
16
  createEscalationSpeculator,
16
17
  createSandboxRunTool,
@@ -23,11 +24,10 @@ import {
23
24
  resolveTurnStorage,
24
25
  runForegroundSandboxSingleFlight,
25
26
  sandboxPromptExecutionOptions,
26
- sandboxPromptRunner,
27
27
  sandboxRunFailureDetail,
28
28
  streamSandboxPrompt,
29
29
  turnStorageBindings
30
- } from "./chunk-56JUV4DK.js";
30
+ } from "./chunk-5AUZR655.js";
31
31
  import {
32
32
  redactErrorMessage
33
33
  } from "./chunk-MH74DY2I.js";
@@ -104,7 +104,7 @@ import {
104
104
  readHttpStatusHint,
105
105
  readUpstreamUnavailableCode,
106
106
  runWithModelFailover
107
- } from "./chunk-QUT3T2IN.js";
107
+ } from "./chunk-L3QR274L.js";
108
108
  import {
109
109
  assertPolicy,
110
110
  checkModelPolicy
@@ -435,6 +435,9 @@ function createHybridTurnProducer(options) {
435
435
  }
436
436
  })();
437
437
  try {
438
+ const step = box.computer ? createComputerStep({ ...box.computer, parentExecutionId: box.computer.parentExecutionId ?? router.traceId }) : void 0;
439
+ const runBoxTask = box.runTask ?? step?.runTask;
440
+ if (!runBoxTask) throw new Error("A hybrid box needs runTask or computer");
438
441
  const warnings = /* @__PURE__ */ new Map();
439
442
  const details = /* @__PURE__ */ new Map();
440
443
  const withWarnings = (parts) => parts.flatMap((part) => {
@@ -449,7 +452,7 @@ function createHybridTurnProducer(options) {
449
452
  if (unconfirmed || activeTasks > 0) throw new SandboxRunError("sandbox_unconfirmed", "An earlier computer step may still be running; no further task was dispatched.");
450
453
  activeTasks++;
451
454
  try {
452
- return await box.runTask(...args);
455
+ return await runBoxTask(...args);
453
456
  } catch (error) {
454
457
  if (!(error instanceof SandboxRunError) || error.code === "sandbox_unconfirmed") unconfirmed = true;
455
458
  throw error;
@@ -476,7 +479,7 @@ function createHybridTurnProducer(options) {
476
479
  ...onSpeculate ? { onSpeculate } : {}
477
480
  });
478
481
  speculator.onInput({ text: speculateOn ?? router.userMessage, ...attachments ? { attachments } : {} });
479
- const extra = guidance === false ? "" : guidance ?? HYBRID_TURN_GUIDANCE;
482
+ const extra = guidance === false ? "" : [guidance ?? HYBRID_TURN_GUIDANCE, step?.guidance].filter(Boolean).join("\n\n");
480
483
  const producer = createRouterTurnProducer({
481
484
  ...router,
482
485
  systemPrompt: Promise.resolve(router.systemPrompt).then((prompt) => !extra ? prompt : typeof prompt === "string" ? `${prompt}
@@ -2299,7 +2302,9 @@ function routerRouteProducer(value, args) {
2299
2302
  // They can only add a requirement; they never replace route admission.
2300
2303
  admitted: Promise.all([args.admitted, value.admitted])
2301
2304
  };
2302
- return "box" in value ? createHybridTurnProducer({ ...options, box: value.box }) : createRouterTurnProducer(options);
2305
+ if (!("box" in value)) return createRouterTurnProducer(options);
2306
+ const computer = value.box.computer && { parentExecutionId: args.executionId, ...value.box.computer };
2307
+ return createHybridTurnProducer({ ...options, box: { ...value.box, ...computer ? { computer } : {} } });
2303
2308
  }
2304
2309
  function sandboxRouteProducer(value, args) {
2305
2310
  if (isProducer(value)) return value;
@@ -3368,28 +3373,36 @@ function createDefaultChatBackend(projectId, env, config, bindings, modelPolicy)
3368
3373
  if (!model?.trim()) throw new Error("Default chat requires MODEL_NAME or produce.model");
3369
3374
  return model;
3370
3375
  };
3371
- const promptOptions = (args) => ({
3376
+ const runOptions = (args) => ({
3372
3377
  model: modelFor(args),
3373
3378
  harness,
3374
- sessionId: args.identity.sessionId,
3375
- executionId: args.executionId,
3376
- turnId: args.executionId,
3377
- trace: args.trace,
3378
- signal: args.admissionSignal,
3379
3379
  detach: true,
3380
3380
  systemPrompt: config.systemPrompt,
3381
3381
  interactions: config.interactions,
3382
3382
  ...sandboxPromptExecutionOptions(args.executionLimits, args.body.effort ?? config.effort)
3383
3383
  });
3384
+ const promptOptions = (args) => ({
3385
+ ...runOptions(args),
3386
+ sessionId: args.identity.sessionId,
3387
+ executionId: args.executionId,
3388
+ turnId: args.executionId,
3389
+ trace: args.trace,
3390
+ signal: args.admissionSignal
3391
+ });
3384
3392
  return {
3385
- when: (args) => config.router !== false && Boolean(env.TANGLE_API_KEY?.trim()) && !turnCarriesFiles(args.prompt) && !args.executionLimits?.maxReasoningTokens,
3393
+ when: (args) => config.router !== false && (Boolean(config.funding) || Boolean(env.TANGLE_API_KEY?.trim())) && !turnCarriesFiles(args.prompt) && !args.executionLimits?.maxReasoningTokens,
3386
3394
  async router(args) {
3387
3395
  const model = modelFor(args);
3388
3396
  if (modelPolicy) await assertPolicy({ kind: "model", id: model, ...modelPolicy });
3389
3397
  const base = env.TANGLE_ROUTER_URL?.trim().replace(/\/+$/, "");
3398
+ const funding = config.funding;
3399
+ const tools = config.tools ? await config.tools(args) : void 0;
3400
+ const files = config.computer?.files?.(args);
3401
+ const allowedModels = config.computer?.allowedModels;
3390
3402
  return {
3391
- apiKey: env.TANGLE_API_KEY.trim(),
3403
+ apiKey: funding ? Promise.resolve().then(() => funding(args)) : env.TANGLE_API_KEY.trim(),
3392
3404
  model,
3405
+ ...tools?.length ? { tools } : {},
3393
3406
  reasoningEffort: args.executionLimits?.maxReasoningTokens === 0 ? "none" : args.body.effort ?? config.effort,
3394
3407
  ...args.executionLimits?.maxOutputTokens !== void 0 ? {
3395
3408
  maxTokens: args.executionLimits.maxOutputTokens,
@@ -3397,10 +3410,15 @@ function createDefaultChatBackend(projectId, env, config, bindings, modelPolicy)
3397
3410
  } : {},
3398
3411
  ...base ? { baseUrl: base.endsWith("/v1") ? base : `${base}/v1` } : {},
3399
3412
  systemPrompt: { profile: shell.profile({ systemPrompt: config.systemPrompt, harness }) },
3400
- box: { acquire: () => acquire(args), runTask: sandboxPromptRunner(shell, {
3401
- ...promptOptions(args),
3402
- sessionId: `sandbox-run-${args.identity.sessionId}`
3403
- }) }
3413
+ box: { acquire: () => acquire(args), computer: {
3414
+ shell,
3415
+ prompt: runOptions(args),
3416
+ parentExecutionId: args.executionId,
3417
+ session: { id: `sandbox-run-${args.identity.sessionId}` },
3418
+ ...allowedModels ? { models: { preferred: [model], allowed: (signal) => allowedModels(args, signal) } } : {},
3419
+ ...files ? { files } : {},
3420
+ ...config.computer?.receipts ? { receipts: config.computer.receipts } : {}
3421
+ } }
3404
3422
  };
3405
3423
  },
3406
3424
  sandbox: async (args) => {
@@ -3925,4 +3943,4 @@ export {
3925
3943
  createChatTurnRoutes,
3926
3944
  streamChatRouteAsSandboxEvents
3927
3945
  };
3928
- //# sourceMappingURL=chunk-DCJCZ7EP.js.map
3946
+ //# sourceMappingURL=chunk-QLZ6A73E.js.map