@tangle-network/agent-app 0.63.29 → 0.63.31

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 (147) hide show
  1. package/dist/{DesignCanvas-3DGZQOD7.js → DesignCanvas-VKZ7Y3JU.js} +2 -3
  2. package/dist/{DesignCanvasEditor-OG4QY5WJ.js → DesignCanvasEditor-3V53YLLZ.js} +2 -3
  3. package/dist/agent-profiles/d1.js +4 -3
  4. package/dist/agent-profiles/d1.js.map +1 -1
  5. package/dist/agent-profiles/index.js +4 -3
  6. package/dist/alerting/github.d.ts +33 -0
  7. package/dist/alerting/index.d.ts +1 -0
  8. package/dist/alerting/index.js +47 -0
  9. package/dist/alerting/index.js.map +1 -1
  10. package/dist/app-auth/index.js +1 -2
  11. package/dist/app-auth/index.js.map +1 -1
  12. package/dist/assistant/index.js +4 -4
  13. package/dist/billing/index.d.ts +15 -0
  14. package/dist/billing/index.js +5 -3
  15. package/dist/chat-routes/default-backend.d.ts +19 -2
  16. package/dist/chat-routes/hybrid-producer.d.ts +7 -2
  17. package/dist/chat-routes/index.js +16 -15
  18. package/dist/chat-routes/index.js.map +1 -1
  19. package/dist/chat-routes/route-storage.d.ts +1 -1
  20. package/dist/chat-routes/router-producer.d.ts +2 -1
  21. package/dist/chat-routes/turn-route-contracts.d.ts +1 -1
  22. package/dist/chat-store/index.js +34 -4
  23. package/dist/chat-store/index.js.map +1 -1
  24. package/dist/chat-store/schema.d.ts +286 -0
  25. package/dist/{chunk-6JEDSKFH.js → chunk-2SDX3OC4.js} +32 -24
  26. package/dist/{chunk-6JEDSKFH.js.map → chunk-2SDX3OC4.js.map} +1 -1
  27. package/dist/{chunk-DCJCZ7EP.js → chunk-4CEIZZTH.js} +44 -26
  28. package/dist/chunk-4CEIZZTH.js.map +1 -0
  29. package/dist/{chunk-WL7PZK7Q.js → chunk-4PIN6QYQ.js} +43 -1
  30. package/dist/chunk-4PIN6QYQ.js.map +1 -0
  31. package/dist/{chunk-6UMIOEDR.js → chunk-AZRPDSRQ.js} +3 -3
  32. package/dist/{chunk-6LMM3OVX.js → chunk-BMCC2BUP.js} +3 -3
  33. package/dist/{chunk-36HSG7HU.js → chunk-CRZXEKCX.js} +2 -2
  34. package/dist/chunk-F4XBNR5L.js +16 -0
  35. package/dist/chunk-F4XBNR5L.js.map +1 -0
  36. package/dist/chunk-GY4IPYG4.js +40 -0
  37. package/dist/chunk-GY4IPYG4.js.map +1 -0
  38. package/dist/{chunk-QUT3T2IN.js → chunk-L3QR274L.js} +11 -3
  39. package/dist/chunk-L3QR274L.js.map +1 -0
  40. package/dist/{chunk-6OG4244Y.js → chunk-MTKD2FN5.js} +2 -251
  41. package/dist/chunk-MTKD2FN5.js.map +1 -0
  42. package/dist/{chunk-56JUV4DK.js → chunk-NDXQFEZQ.js} +3332 -3014
  43. package/dist/chunk-NDXQFEZQ.js.map +1 -0
  44. package/dist/chunk-NSWLZTJX.js +645 -0
  45. package/dist/chunk-NSWLZTJX.js.map +1 -0
  46. package/dist/chunk-PU6AWIRE.js +252 -0
  47. package/dist/chunk-PU6AWIRE.js.map +1 -0
  48. package/dist/{chunk-JKECSYDB.js → chunk-PV3GSLUY.js} +3 -3
  49. package/dist/{chunk-7Y7U7U7X.js → chunk-Q7RSHLEV.js} +5 -3
  50. package/dist/{chunk-7Y7U7U7X.js.map → chunk-Q7RSHLEV.js.map} +1 -1
  51. package/dist/{chunk-HRBF4B5L.js → chunk-TUJ4277Q.js} +1 -14
  52. package/dist/chunk-TUJ4277Q.js.map +1 -0
  53. package/dist/{chunk-57XPEL7X.js → chunk-V42C72V5.js} +25 -2
  54. package/dist/chunk-V42C72V5.js.map +1 -0
  55. package/dist/{chunk-FCYHDENJ.js → chunk-VOIVDEAV.js} +2 -2
  56. package/dist/{chunk-ACB7KOQ6.js → chunk-WSQSKYXP.js} +4 -4
  57. package/dist/{chunk-F6J5J4H6.js → chunk-WYQTPFPI.js} +26 -2
  58. package/dist/chunk-WYQTPFPI.js.map +1 -0
  59. package/dist/{chunk-PFTOGTHH.js → chunk-Z3IJ7XEW.js} +3 -3
  60. package/dist/{chunk-ZD2AUFIT.js → chunk-ZGGEYYEQ.js} +3 -3
  61. package/dist/{chunk-O5AUJQIA.js → chunk-ZNWJJRHP.js} +2 -2
  62. package/dist/design-canvas/index.js +1 -2
  63. package/dist/design-canvas/index.js.map +1 -1
  64. package/dist/design-canvas-react/engine.js +1 -2
  65. package/dist/design-canvas-react/index.js +2 -3
  66. package/dist/design-canvas-react/index.js.map +1 -1
  67. package/dist/design-canvas-react/lazy.js +1 -1
  68. package/dist/media/generate-request.d.ts +27 -1
  69. package/dist/media/index.js +36 -426
  70. package/dist/media/index.js.map +1 -1
  71. package/dist/media/router-generation.d.ts +7 -0
  72. package/dist/model-resolution/index.js +1 -1
  73. package/dist/operator/gateway-keys.d.ts +44 -0
  74. package/dist/operator/index.d.ts +1 -0
  75. package/dist/operator/index.js +55 -1
  76. package/dist/operator/index.js.map +1 -1
  77. package/dist/plans/decision.d.ts +31 -0
  78. package/dist/plans/drizzle.js +1 -1
  79. package/dist/plans/index.js +5 -1
  80. package/dist/platform/billing.d.ts +3 -2
  81. package/dist/platform/deployment.d.ts +21 -0
  82. package/dist/platform/index.d.ts +1 -0
  83. package/dist/platform/index.js +30 -10
  84. package/dist/platform/index.js.map +1 -1
  85. package/dist/preset-cloudflare/index.js +9 -8
  86. package/dist/preset-cloudflare/index.js.map +1 -1
  87. package/dist/public-consultation/index.d.ts +1 -1
  88. package/dist/public-consultation/index.js +14 -13
  89. package/dist/public-consultation/index.js.map +1 -1
  90. package/dist/sandbox/computer-files.d.ts +67 -0
  91. package/dist/sandbox/computer-receipts.d.ts +46 -0
  92. package/dist/sandbox/computer-step.d.ts +78 -0
  93. package/dist/sandbox/index.d.ts +5 -0
  94. package/dist/sandbox/index.js +34 -5
  95. package/dist/sandbox/router-model-policy.d.ts +31 -0
  96. package/dist/sandbox/router-models.d.ts +26 -0
  97. package/dist/sandbox/sandbox-run-tool.d.ts +5 -4
  98. package/dist/sequences/index.js +1 -2
  99. package/dist/sequences/index.js.map +1 -1
  100. package/dist/spend/drizzle.d.ts +195 -0
  101. package/dist/spend/drizzle.js +22 -0
  102. package/dist/spend/drizzle.js.map +1 -1
  103. package/dist/stream/index.js +2 -2
  104. package/dist/studio/generated-media/flows.d.ts +240 -0
  105. package/dist/studio/generated-media/index.d.ts +3 -1
  106. package/dist/studio/generated-media/index.js +357 -138
  107. package/dist/studio/generated-media/index.js.map +1 -1
  108. package/dist/studio/index.js +18 -16
  109. package/dist/studio-react/index.js +28 -26
  110. package/dist/studio-react/index.js.map +1 -1
  111. package/dist/teams/index.d.ts +1 -0
  112. package/dist/teams/index.js +16 -0
  113. package/dist/teams/index.js.map +1 -1
  114. package/dist/teams/invitations-api.js +1 -1
  115. package/dist/teams/members-api.d.ts +5 -3
  116. package/dist/teams/members-api.js +1 -1
  117. package/dist/teams/thread-access.d.ts +22 -0
  118. package/dist/tools/index.js +5 -4
  119. package/dist/web/index.js +4 -6
  120. package/dist/web-react/index.js +4 -4
  121. package/dist/work-product/index.js +3 -2
  122. package/dist/work-product/index.js.map +1 -1
  123. package/dist/workspace-export/d1.d.ts +1 -1
  124. package/dist/workspace-export/index.js +9 -2
  125. package/dist/workspace-export/index.js.map +1 -1
  126. package/package.json +1 -1
  127. package/dist/chunk-56JUV4DK.js.map +0 -1
  128. package/dist/chunk-57XPEL7X.js.map +0 -1
  129. package/dist/chunk-6OG4244Y.js.map +0 -1
  130. package/dist/chunk-6Z7TZVKZ.js +0 -26
  131. package/dist/chunk-6Z7TZVKZ.js.map +0 -1
  132. package/dist/chunk-DCJCZ7EP.js.map +0 -1
  133. package/dist/chunk-F6J5J4H6.js.map +0 -1
  134. package/dist/chunk-HRBF4B5L.js.map +0 -1
  135. package/dist/chunk-QUT3T2IN.js.map +0 -1
  136. package/dist/chunk-WL7PZK7Q.js.map +0 -1
  137. /package/dist/{DesignCanvas-3DGZQOD7.js.map → DesignCanvas-VKZ7Y3JU.js.map} +0 -0
  138. /package/dist/{DesignCanvasEditor-OG4QY5WJ.js.map → DesignCanvasEditor-3V53YLLZ.js.map} +0 -0
  139. /package/dist/{chunk-6UMIOEDR.js.map → chunk-AZRPDSRQ.js.map} +0 -0
  140. /package/dist/{chunk-6LMM3OVX.js.map → chunk-BMCC2BUP.js.map} +0 -0
  141. /package/dist/{chunk-36HSG7HU.js.map → chunk-CRZXEKCX.js.map} +0 -0
  142. /package/dist/{chunk-JKECSYDB.js.map → chunk-PV3GSLUY.js.map} +0 -0
  143. /package/dist/{chunk-FCYHDENJ.js.map → chunk-VOIVDEAV.js.map} +0 -0
  144. /package/dist/{chunk-ACB7KOQ6.js.map → chunk-WSQSKYXP.js.map} +0 -0
  145. /package/dist/{chunk-PFTOGTHH.js.map → chunk-Z3IJ7XEW.js.map} +0 -0
  146. /package/dist/{chunk-ZD2AUFIT.js.map → chunk-ZGGEYYEQ.js.map} +0 -0
  147. /package/dist/{chunk-O5AUJQIA.js.map → chunk-ZNWJJRHP.js.map} +0 -0
@@ -4,6 +4,11 @@ import { type StreamSandboxPromptOptions } from '../sandbox/prompt-options';
4
4
  import type { ChatTurnStoreBindings } from './route-storage';
5
5
  import { type ModelPolicy } from '../policy-filters/index';
6
6
  import type { ChatTurnProduceArgs, ChatTurnHybridConfiguration } from './turn-route-contracts';
7
+ import type { RouterTurnTool } from '../runtime/router-turn';
8
+ import type { RouterTurnKey } from './router-producer';
9
+ import type { ComputerVault } from '../sandbox/computer-files';
10
+ import type { ComputerStepReceipts } from '../sandbox/computer-receipts';
11
+ import type { Outcome } from '../sandbox/outcome';
7
12
  /** Worker bindings are explicit; no ambient deployment credentials replace product policy. */
8
13
  export interface ChatTurnEnvironment {
9
14
  DB?: ChatTurnStoreBindings['db'];
@@ -18,7 +23,7 @@ export interface ChatTurnEnvironment {
18
23
  SANDBOX_GATEWAY_URL?: string;
19
24
  }
20
25
  /** Domain data for the default lane, instead of constructing producers or admission hooks. */
21
- export interface ChatTurnDefaultBackend {
26
+ export interface ChatTurnDefaultBackend<TContext = unknown, TResource = unknown> {
22
27
  model?: string;
23
28
  systemPrompt?: string;
24
29
  harness?: Harness;
@@ -28,9 +33,21 @@ export interface ChatTurnDefaultBackend {
28
33
  shell?: SandboxRuntimeConfig;
29
34
  /** Explicitly keep every turn on the sandbox lane. */
30
35
  router?: false;
36
+ /** Who pays for the Router model call: the turn's key, or a per-turn lease (`createDelegatedTurnKeys`) the
37
+ * producer revokes when the turn settles. Default `TANGLE_API_KEY`. Started before the turn lock, like the call. */
38
+ funding?(args: ChatTurnProduceArgs<TContext, TResource>): RouterTurnKey | Promise<RouterTurnKey>;
39
+ /** The product's in-process tools for the Router model; `sandbox_run` is added after them. */
40
+ tools?(args: ChatTurnProduceArgs<TContext, TResource>): RouterTurnTool[] | Promise<RouterTurnTool[]>;
41
+ /** What the computer step does beyond running the task: copy its files into the product's Vault, keep durable
42
+ * receipts, and run a model the box key allows (`readSandboxRouterModels` with the payer's key). */
43
+ computer?: {
44
+ files?(args: ChatTurnProduceArgs<TContext, TResource>): ComputerVault | undefined;
45
+ receipts?: ComputerStepReceipts;
46
+ allowedModels?(args: ChatTurnProduceArgs<TContext, TResource>, signal: AbortSignal): Promise<Outcome<readonly string[] | null>>;
47
+ };
31
48
  }
32
49
  export declare function defaultChatShell(projectId: string, env: ChatTurnEnvironment, config: ChatTurnDefaultBackend): SandboxRuntimeConfig;
33
- export declare function createDefaultChatBackend<TContext, TResource>(projectId: string, env: ChatTurnEnvironment, config: ChatTurnDefaultBackend, bindings?: ChatTurnStoreBindings, modelPolicy?: ModelPolicy): {
50
+ export declare function createDefaultChatBackend<TContext, TResource>(projectId: string, env: ChatTurnEnvironment, config: ChatTurnDefaultBackend<TContext, TResource>, bindings?: ChatTurnStoreBindings, modelPolicy?: ModelPolicy): {
34
51
  when: (args: ChatTurnProduceArgs<TContext, TResource>) => boolean;
35
52
  router(args: ChatTurnProduceArgs<TContext, TResource>): Promise<ChatTurnHybridConfiguration>;
36
53
  sandbox: (args: ChatTurnProduceArgs<TContext, TResource>) => Promise<{
@@ -39,6 +39,7 @@ import type { SandboxInstance } from '@tangle-network/sandbox';
39
39
  import type { RouterTurnTool } from '../runtime/router-turn';
40
40
  import { type EscalationHint, type EscalationInput } from '../sandbox/escalation-speculator';
41
41
  import { type SandboxRunToolOptions } from '../sandbox/sandbox-run-tool';
42
+ import { type ComputerStepOptions } from '../sandbox/computer-step';
42
43
  import type { PersistedChatMessageForTurn } from '../stream/index';
43
44
  import { type RouterTurnProducerOptions } from './router-producer';
44
45
  import type { ChatTurnRouteProducer } from './turn-routes';
@@ -51,8 +52,12 @@ export interface HybridTurnBox {
51
52
  acquire(signal: AbortSignal): Promise<SandboxInstance>;
52
53
  /** A start admission already began ({@link startHybridBox}); the producer takes it as the turn's start. */
53
54
  started?: Promise<SandboxInstance>;
54
- /** Runs the task on the box and returns its answer: `sandboxPromptRunner(shell, …)` or the product's runner. */
55
- runTask: SandboxRunToolOptions['runTask'];
55
+ /** Runs the task on the box and returns its answer. Omit it and pass `computer` for agent-app's computer step. */
56
+ runTask?: SandboxRunToolOptions['runTask'];
57
+ /** agent-app's computer step ({@link createComputerStep}): the first of the turn's models the box key allows, one
58
+ * session value, stable step ids, durable receipts and the copy of the step's files into the product's Vault.
59
+ * `parentExecutionId` defaults to the turn's execution id on the chat route, else the trace id. */
60
+ computer?: ComputerStepOptions;
56
61
  /** Wall-clock cap for one `sandbox_run` call, box start included. Default 4 minutes. */
57
62
  timeoutMs?: number;
58
63
  warm?: SandboxRunToolOptions['warm'];
@@ -40,7 +40,7 @@ import {
40
40
  observeNativeCompletion,
41
41
  readCompletedSandboxTurn,
42
42
  recoverSandboxAssistantMessage
43
- } from "../chunk-PFTOGTHH.js";
43
+ } from "../chunk-Z3IJ7XEW.js";
44
44
  import {
45
45
  runProtectedRouterTurn
46
46
  } from "../chunk-G3LZITCA.js";
@@ -79,7 +79,7 @@ import {
79
79
  turnCarriesFiles,
80
80
  turnPromptText,
81
81
  withProducerStream
82
- } from "../chunk-DCJCZ7EP.js";
82
+ } from "../chunk-4CEIZZTH.js";
83
83
  import "../chunk-CWO2LHXH.js";
84
84
  import {
85
85
  sniffMimeFromName
@@ -87,30 +87,31 @@ import {
87
87
  import "../chunk-4DBHC63F.js";
88
88
  import "../chunk-RN4WPTBH.js";
89
89
  import "../chunk-MM6RLOXF.js";
90
- import "../chunk-56JUV4DK.js";
90
+ import "../chunk-NDXQFEZQ.js";
91
91
  import "../chunk-F4TUZYMX.js";
92
92
  import {
93
93
  redactErrorMessage
94
94
  } from "../chunk-MH74DY2I.js";
95
+ import "../chunk-GY4IPYG4.js";
95
96
  import {
96
97
  assistantRowIdForTurn,
97
98
  createAssistantDraftWriter,
98
99
  isDraftContentEvent,
99
100
  rowIdOf,
100
101
  storeSupportsDraftPersistence
101
- } from "../chunk-6LMM3OVX.js";
102
+ } from "../chunk-BMCC2BUP.js";
102
103
  import "../chunk-2PCNHHN2.js";
103
104
  import "../chunk-YG66IHDU.js";
104
105
  import {
105
106
  attachmentInputToPart,
106
107
  attachmentKindForMime,
107
108
  toChatMessageParts
108
- } from "../chunk-36HSG7HU.js";
109
+ } from "../chunk-CRZXEKCX.js";
109
110
  import "../chunk-ZVEEWGDK.js";
110
111
  import {
111
112
  getPartKey,
112
113
  mergePersistedPart
113
- } from "../chunk-O5AUJQIA.js";
114
+ } from "../chunk-ZNWJJRHP.js";
114
115
  import "../chunk-SRZTL3Z5.js";
115
116
  import "../chunk-H4JL74GP.js";
116
117
  import "../chunk-ALIWB2P3.js";
@@ -156,17 +157,17 @@ import {
156
157
  turnResponseEventFor,
157
158
  validateSandboxMentionPath
158
159
  } from "../chunk-QGJOT6R6.js";
159
- import "../chunk-QUT3T2IN.js";
160
+ import "../chunk-L3QR274L.js";
160
161
  import "../chunk-XELWWXJJ.js";
161
162
  import "../chunk-DSMGS4IV.js";
162
- import "../chunk-ACB7KOQ6.js";
163
+ import "../chunk-WSQSKYXP.js";
163
164
  import "../chunk-6A7MYOUI.js";
164
165
  import "../chunk-O7UX55EU.js";
165
- import "../chunk-7Y7U7U7X.js";
166
+ import "../chunk-Q7RSHLEV.js";
166
167
  import "../chunk-S5SRJJQG.js";
167
- import "../chunk-FCYHDENJ.js";
168
+ import "../chunk-VOIVDEAV.js";
168
169
  import "../chunk-UGWQLQDS.js";
169
- import "../chunk-HRBF4B5L.js";
170
+ import "../chunk-TUJ4277Q.js";
170
171
  import "../chunk-YRWUJKW5.js";
171
172
  import "../chunk-D6UJEOZQ.js";
172
173
  import "../chunk-W6G2HF6M.js";
@@ -177,13 +178,13 @@ import {
177
178
  } from "../chunk-CTREXL3O.js";
178
179
  import "../chunk-ELX5YITO.js";
179
180
  import "../chunk-HY57QRRW.js";
180
- import "../chunk-TXD5HXLE.js";
181
+ import "../chunk-F4XBNR5L.js";
181
182
  import {
182
183
  persistedPartToPlan,
183
184
  planFollowUpTurnId
184
- } from "../chunk-WL7PZK7Q.js";
185
- import "../chunk-6Z7TZVKZ.js";
186
- import "../chunk-57XPEL7X.js";
185
+ } from "../chunk-4PIN6QYQ.js";
186
+ import "../chunk-V42C72V5.js";
187
+ import "../chunk-TXD5HXLE.js";
187
188
 
188
189
  // src/chat-routes/protected-runtime-producer.ts
189
190
  import { profileMaterializationAxes } from "@tangle-network/agent-interface";