@tangle-network/agent-app 0.54.0 → 0.54.1

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 (52) hide show
  1. package/dist/app-auth/index.js +2 -2
  2. package/dist/assistant/index.js +7 -7
  3. package/dist/chat-react/index.js +3 -3
  4. package/dist/chat-routes/index.js +22 -11
  5. package/dist/chat-routes/index.js.map +1 -1
  6. package/dist/chat-routes/sandbox-producer.d.ts +7 -0
  7. package/dist/chat-routes/wire.d.ts +1 -1
  8. package/dist/chat-store/index.js +4 -4
  9. package/dist/{chunk-UII6SBT4.js → chunk-4XBRPVL3.js} +4 -4
  10. package/dist/{chunk-TSZIYQAZ.js → chunk-6VRVRWYN.js} +2 -2
  11. package/dist/{chunk-CP36C5LZ.js → chunk-D6UJEOZQ.js} +1 -1
  12. package/dist/chunk-D6UJEOZQ.js.map +1 -0
  13. package/dist/{chunk-W3RSC6XB.js → chunk-DVOJNI6T.js} +3 -3
  14. package/dist/{chunk-M3K2HVQD.js → chunk-FCON65I2.js} +1 -1
  15. package/dist/{chunk-M3K2HVQD.js.map → chunk-FCON65I2.js.map} +1 -1
  16. package/dist/{chunk-UJHENCPR.js → chunk-GYDFGEJ2.js} +1 -1
  17. package/dist/chunk-GYDFGEJ2.js.map +1 -0
  18. package/dist/{chunk-YB6BZKXY.js → chunk-IJDPERPL.js} +31 -5
  19. package/dist/chunk-IJDPERPL.js.map +1 -0
  20. package/dist/{chunk-2S7QRQUS.js → chunk-NJA6X7JI.js} +2 -2
  21. package/dist/{chunk-JZ64GXYP.js → chunk-OMHGFN5I.js} +2 -2
  22. package/dist/{chunk-4KFM7VTH.js → chunk-OXDA7G4E.js} +9 -8
  23. package/dist/chunk-OXDA7G4E.js.map +1 -0
  24. package/dist/{chunk-ZMMIQOFI.js → chunk-UII4YDYS.js} +2 -2
  25. package/dist/{chunk-L57CYCXN.js → chunk-WN3UK23P.js} +2 -2
  26. package/dist/interactions/contract.d.ts +4 -3
  27. package/dist/interactions/index.js +2 -2
  28. package/dist/platform/index.js +2 -2
  29. package/dist/public-consultation/index.js +6 -6
  30. package/dist/runtime/index.js +1 -1
  31. package/dist/runtime/model.d.ts +1 -1
  32. package/dist/sandbox/index.d.ts +0 -4
  33. package/dist/sandbox/index.js +2 -2
  34. package/dist/sandbox/model.d.ts +9 -12
  35. package/dist/stream/index.js +2 -2
  36. package/dist/web-react/chat-stream.d.ts +1 -1
  37. package/dist/web-react/index.d.ts +10 -0
  38. package/dist/web-react/index.js +7 -7
  39. package/dist/workspace-react/index.js +51 -5
  40. package/dist/workspace-react/index.js.map +1 -1
  41. package/package.json +3 -3
  42. package/dist/chunk-4KFM7VTH.js.map +0 -1
  43. package/dist/chunk-CP36C5LZ.js.map +0 -1
  44. package/dist/chunk-UJHENCPR.js.map +0 -1
  45. package/dist/chunk-YB6BZKXY.js.map +0 -1
  46. /package/dist/{chunk-UII6SBT4.js.map → chunk-4XBRPVL3.js.map} +0 -0
  47. /package/dist/{chunk-TSZIYQAZ.js.map → chunk-6VRVRWYN.js.map} +0 -0
  48. /package/dist/{chunk-W3RSC6XB.js.map → chunk-DVOJNI6T.js.map} +0 -0
  49. /package/dist/{chunk-2S7QRQUS.js.map → chunk-NJA6X7JI.js.map} +0 -0
  50. /package/dist/{chunk-JZ64GXYP.js.map → chunk-OMHGFN5I.js.map} +0 -0
  51. /package/dist/{chunk-ZMMIQOFI.js.map → chunk-UII4YDYS.js.map} +0 -0
  52. /package/dist/{chunk-L57CYCXN.js.map → chunk-WN3UK23P.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  canTransitionInteractionStatus,
3
3
  persistedPartToInteraction
4
- } from "./chunk-M3K2HVQD.js";
4
+ } from "./chunk-FCON65I2.js";
5
5
  import {
6
6
  canTransitionPlanStatus,
7
7
  persistedPartToPlan,
@@ -406,4 +406,4 @@ export {
406
406
  terminalizeDanglingAssistantToolUpdates,
407
407
  encodeEvent
408
408
  };
409
- //# sourceMappingURL=chunk-ZMMIQOFI.js.map
409
+ //# sourceMappingURL=chunk-UII4YDYS.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isTangleBillingEnforcementDisabled
3
- } from "./chunk-CP36C5LZ.js";
3
+ } from "./chunk-D6UJEOZQ.js";
4
4
  import {
5
5
  clearCookieHeader,
6
6
  readCookieValue,
@@ -494,4 +494,4 @@ export {
494
494
  createAdminGuard,
495
495
  assertBillableBalance
496
496
  };
497
- //# sourceMappingURL=chunk-L57CYCXN.js.map
497
+ //# sourceMappingURL=chunk-WN3UK23P.js.map
@@ -120,8 +120,9 @@ export declare function composerAnswerData(field: ChatInteractionField, text: st
120
120
  export declare function interactionPartKey(id: string): string;
121
121
  /** Generate a unique key string for a notice using the given identifier */
122
122
  export declare function noticePartKey(id: string): string;
123
- /** Define specific string literals representing different kinds of notices */
124
- export type NoticeKind = 'warning' | 'auto-declined';
123
+ /** Kinds of transcript notice. `error` marks a turn that failed: products render it in the danger tone
124
+ * instead of as answer prose (see `createSandboxChatProducer`'s `errorNotice`). */
125
+ export type NoticeKind = 'warning' | 'auto-declined' | 'error';
125
126
  /**
126
127
  * Persisted-part shapes the codecs below produce — the SAME rows
127
128
  * `/chat-store`'s `ChatInteractionPart`/`ChatNoticePart` store, typed at the
@@ -151,7 +152,7 @@ export type NoticePersistedPart = {
151
152
  text: string;
152
153
  };
153
154
  /** Builds the persisted/streamed `notice` part — a one-line transcript notice
154
- * explaining an out-of-band event (warning, auto-declined interaction). */
155
+ * explaining an out-of-band event (warning, auto-declined interaction, turn error). */
155
156
  export declare function noticePart(noticeKind: NoticeKind, id: string, text: string): NoticePersistedPart;
156
157
  /** Reads a wire request into the client's pending `ChatInteraction`. */
157
158
  export declare function interactionFromWireRequest(request: InteractionRequestWire): ChatInteraction;
@@ -7,7 +7,7 @@ import {
7
7
  mapInteractionRespondFailure,
8
8
  respondToSessionInteraction,
9
9
  validateInteractionAnswerBody
10
- } from "../chunk-TSZIYQAZ.js";
10
+ } from "../chunk-6VRVRWYN.js";
11
11
  import "../chunk-3NCPXNBZ.js";
12
12
  import "../chunk-TXD5HXLE.js";
13
13
  import {
@@ -34,7 +34,7 @@ import {
34
34
  persistedPartToInteraction,
35
35
  questionInteractionContentSignature,
36
36
  stampInteractionAnswers
37
- } from "../chunk-M3K2HVQD.js";
37
+ } from "../chunk-FCON65I2.js";
38
38
  export {
39
39
  INTERACTION_CANCEL_EVENT,
40
40
  INTERACTION_EVENT,
@@ -13,10 +13,10 @@ import {
13
13
  resolveTangleSsoAccount,
14
14
  signSessionCookieValue,
15
15
  verifySignedSsoState
16
- } from "../chunk-L57CYCXN.js";
16
+ } from "../chunk-WN3UK23P.js";
17
17
  import {
18
18
  resolveTangleExecutionEnvironment
19
- } from "../chunk-CP36C5LZ.js";
19
+ } from "../chunk-D6UJEOZQ.js";
20
20
  import "../chunk-YNSPVKMS.js";
21
21
  import {
22
22
  parseJsonObjectBody
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  createChatTurnRoutes,
3
3
  streamChatRouteAsSandboxEvents
4
- } from "../chunk-UII6SBT4.js";
5
- import "../chunk-TSZIYQAZ.js";
4
+ } from "../chunk-4XBRPVL3.js";
5
+ import "../chunk-6VRVRWYN.js";
6
6
  import "../chunk-YNSPVKMS.js";
7
7
  import "../chunk-3NCPXNBZ.js";
8
- import "../chunk-W3RSC6XB.js";
8
+ import "../chunk-DVOJNI6T.js";
9
9
  import "../chunk-ZVEEWGDK.js";
10
- import "../chunk-UJHENCPR.js";
10
+ import "../chunk-GYDFGEJ2.js";
11
11
  import "../chunk-TXD5HXLE.js";
12
12
  import "../chunk-53K4S3K6.js";
13
- import "../chunk-ZMMIQOFI.js";
14
- import "../chunk-M3K2HVQD.js";
13
+ import "../chunk-UII4YDYS.js";
14
+ import "../chunk-FCON65I2.js";
15
15
  import "../chunk-YJMCRXQQ.js";
16
16
  import "../chunk-HXTJXODG.js";
17
17
 
@@ -16,7 +16,7 @@ import {
16
16
  resolveUserTangleExecutionKeyForUser,
17
17
  tangleExecutionKeyHttpError,
18
18
  trimOrNull
19
- } from "../chunk-CP36C5LZ.js";
19
+ } from "../chunk-D6UJEOZQ.js";
20
20
  import {
21
21
  MAX_RECOMMENDED_MODELS,
22
22
  __resetCatalogCache,
@@ -4,7 +4,7 @@
4
4
  * Every Tangle agent product resolves the SAME thing from env: the Tangle Router
5
5
  * (OpenAI-compatible, metered at the platform markup against a single
6
6
  * `TANGLE_API_KEY`) by default, with a direct-Anthropic BYOK escape hatch. The
7
- * shape feeds the sandbox backend's role-named model fields (see
7
+ * shape feeds the sandbox backend's nested `model` object (see
8
8
  * `backendModelFields`). Lifted here so no product
9
9
  * hand-rolls the env parsing + the router default.
10
10
  */
@@ -706,10 +706,6 @@ export type SandboxPromptConfig = Pick<SandboxRuntimeConfig, 'provider' | 'defer
706
706
  * Reuse the returned backend for preflight and dispatch so they inspect identical configuration.
707
707
  */
708
708
  export declare function resolveSandboxPromptBackend(shell: SandboxPromptConfig, options: StreamSandboxPromptOptions, operation?: string): Promise<{
709
- modelId?: string | undefined;
710
- provider?: string | undefined;
711
- apiKey?: string;
712
- baseUrl?: string;
713
709
  model?: {
714
710
  model: string;
715
711
  provider: string;
@@ -100,7 +100,7 @@ import {
100
100
  workspaceSandboxRecoveryMessage,
101
101
  workspaceSandboxRecoveryRecommendedActions,
102
102
  writeProfileFilesToBox
103
- } from "../chunk-4KFM7VTH.js";
103
+ } from "../chunk-OXDA7G4E.js";
104
104
  import "../chunk-MCYJON3F.js";
105
105
  import "../chunk-LWSJK546.js";
106
106
  import "../chunk-2TARCQA2.js";
@@ -110,7 +110,7 @@ import "../chunk-UGWQLQDS.js";
110
110
  import "../chunk-S5SRJJQG.js";
111
111
  import "../chunk-KLQWU6K5.js";
112
112
  import "../chunk-CHYGAU4E.js";
113
- import "../chunk-CP36C5LZ.js";
113
+ import "../chunk-D6UJEOZQ.js";
114
114
  export {
115
115
  DEFAULT_FOREGROUND_PROVISION_CLAIM_TTL_SECONDS,
116
116
  DEFAULT_FOREGROUND_PROVISION_POLL_INTERVAL_MS,
@@ -10,21 +10,18 @@ export interface ProviderResolutionConfig {
10
10
  }
11
11
  /** Represent a fully configured model with optional API key and base URL for sandbox platform integration */
12
12
  /**
13
- * Spread a {@link ResolvedModel} onto a sandbox backend config as role-named
14
- * fields. The model id's home on a standalone backend is `modelId`; routing
15
- * rides `provider`/`apiKey`/`baseUrl` flat — the SDK folds them onto the wire.
13
+ * Spread a {@link ResolvedModel} onto a sandbox backend config as the nested
14
+ * `model` object — the one spelling every admitted SDK accepts.
16
15
  *
17
- * The deprecated nested `model` object rides along while agent-app's peer
18
- * range still admits pre-fold SDK versions (< the 0.60.14 develop train):
19
- * old SDKs forward only the nested object and drop the unknown flat fields,
20
- * fold-aware SDKs see two AGREEING spellings and fold them. Delete the
21
- * nested half when the peer floor moves past the fold.
16
+ * Do not add the role-named flat fields (`modelId`, `provider`, `apiKey`,
17
+ * `baseUrl`) beside it until the sandbox peer floor reaches the release that
18
+ * folds them (0.60.16). A pre-fold SDK forwards the whole backend unchanged,
19
+ * and the platform's strict backend schema refuses the extra keys:
20
+ * agent-app 0.53.10–0.54.0 emitted both, and every sandbox chat turn on a
21
+ * product resolving sandbox < 0.60.16 failed with "unrecognized_keys
22
+ * provider, apiKey, baseUrl, modelId at path backend" (Creative, 2026-10-06).
22
23
  */
23
24
  export declare function backendModelFields(model: ResolvedModel): {
24
- modelId: string;
25
- provider: string;
26
- apiKey?: string;
27
- baseUrl?: string;
28
25
  model: {
29
26
  model: string;
30
27
  provider: string;
@@ -28,8 +28,8 @@ import {
28
28
  terminalizeDanglingAssistantToolUpdates,
29
29
  terminalizeDanglingToolPart,
30
30
  terminalizeDanglingToolParts
31
- } from "../chunk-ZMMIQOFI.js";
32
- import "../chunk-M3K2HVQD.js";
31
+ } from "../chunk-UII4YDYS.js";
32
+ import "../chunk-FCON65I2.js";
33
33
  import "../chunk-YJMCRXQQ.js";
34
34
  import {
35
35
  DEFAULT_RUNNING_TURN_LEASE_MS,
@@ -47,7 +47,7 @@ export interface ChatStreamCallbacks {
47
47
  }) => void;
48
48
  onNotice?: (notice: {
49
49
  id: string;
50
- noticeKind: 'warning' | 'auto-declined';
50
+ noticeKind: 'warning' | 'auto-declined' | 'error';
51
51
  text: string;
52
52
  }) => void;
53
53
  onMetadata?: (data: Record<string, unknown>) => void;
@@ -137,7 +137,17 @@ export type ChatMessageSegment = {
137
137
  } | {
138
138
  kind: 'tool';
139
139
  call: ChatToolCallInfo;
140
+ }
141
+ /** An out-of-band transcript notice — a failed turn's error, a warning —
142
+ * rendered in its status tone so it never reads as answer prose. Map a
143
+ * persisted `notice` part (`noticeKind: 'error' | 'warning'`) to this. */
144
+ | {
145
+ kind: 'notice';
146
+ tone: ChatNoticeTone;
147
+ content: string;
140
148
  };
149
+ /** Status tone of a {@link ChatMessageSegment} notice. */
150
+ export type ChatNoticeTone = 'error' | 'warning';
141
151
  /** Describe the structure and properties of a chat message with roles, content, and optional metadata */
142
152
  export interface ChatUiMessage extends ChatMessageMetrics {
143
153
  id: string;
@@ -134,7 +134,7 @@ import {
134
134
  withoutRecordGridCreated,
135
135
  withoutRecordGridRemoved,
136
136
  withoutRecordGridUpdate
137
- } from "../chunk-YB6BZKXY.js";
137
+ } from "../chunk-IJDPERPL.js";
138
138
  import {
139
139
  SessionHistoryPanel,
140
140
  formatSessionTimestamp,
@@ -182,7 +182,7 @@ import {
182
182
  renamePastedImages,
183
183
  useComposerAttachments,
184
184
  useDictation
185
- } from "../chunk-JZ64GXYP.js";
185
+ } from "../chunk-OMHGFN5I.js";
186
186
  import "../chunk-L7MB2LLM.js";
187
187
  import {
188
188
  WorkspaceInitial,
@@ -214,7 +214,7 @@ import "../chunk-Q3ZHNN5X.js";
214
214
  import "../chunk-FQYAJYPW.js";
215
215
  import {
216
216
  ATTACHMENT_ACCEPT
217
- } from "../chunk-2S7QRQUS.js";
217
+ } from "../chunk-NJA6X7JI.js";
218
218
  import "../chunk-MCYJON3F.js";
219
219
  import "../chunk-7YA4QNTU.js";
220
220
  import {
@@ -224,7 +224,7 @@ import {
224
224
  isChatAttachmentPart,
225
225
  mentionInputToPart,
226
226
  mentionPartsFromMessageParts
227
- } from "../chunk-W3RSC6XB.js";
227
+ } from "../chunk-DVOJNI6T.js";
228
228
  import "../chunk-ZVEEWGDK.js";
229
229
  import {
230
230
  DISPATCH_MAX_MEDIA_PARTS,
@@ -237,11 +237,11 @@ import {
237
237
  fileMentionsToParts,
238
238
  mediaTypeForMentionPath,
239
239
  mentionKindForPath
240
- } from "../chunk-UJHENCPR.js";
240
+ } from "../chunk-GYDFGEJ2.js";
241
241
  import "../chunk-TXD5HXLE.js";
242
242
  import {
243
243
  attachmentPartKey
244
- } from "../chunk-ZMMIQOFI.js";
244
+ } from "../chunk-UII4YDYS.js";
245
245
  import {
246
246
  INTERACTION_CANCEL_EVENT,
247
247
  INTERACTION_EVENT,
@@ -266,7 +266,7 @@ import {
266
266
  persistedPartToInteraction,
267
267
  questionInteractionContentSignature,
268
268
  stampInteractionAnswers
269
- } from "../chunk-M3K2HVQD.js";
269
+ } from "../chunk-FCON65I2.js";
270
270
  import "../chunk-YJMCRXQQ.js";
271
271
  export {
272
272
  ATTACHMENT_ACCEPT,
@@ -185,7 +185,7 @@ function WorkspaceMenu({
185
185
  }
186
186
 
187
187
  // src/workspace-react/companion.tsx
188
- import { forwardRef, useCallback as useCallback2, useEffect, useImperativeHandle, useRef, useState as useState2 } from "react";
188
+ import { forwardRef, useCallback as useCallback2, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState as useState2 } from "react";
189
189
  import { Tabs, TabsContent, TabsList, TabsTrigger } from "@tangle-network/sandbox-ui/primitives";
190
190
  import { WorkspaceLayout } from "@tangle-network/sandbox-ui/workspace";
191
191
  import { FlaskConical, FolderOpen, GitCompare, Monitor, Terminal } from "lucide-react";
@@ -324,10 +324,7 @@ var AgentWorkspaceCompanion = forwardRef(function AgentWorkspaceCompanion2({
324
324
  persistenceKey,
325
325
  minRightWidth: 280,
326
326
  rightContentClassName: "flex flex-col overflow-hidden",
327
- rightHeader: tabs.length > 0 ? /* @__PURE__ */ jsx2(TabsList, { "aria-label": label, className: "h-9 max-w-full justify-start overflow-x-auto bg-transparent p-0", children: tabs.map((tab) => /* @__PURE__ */ jsxs2(TabsTrigger, { value: tab.id, className: "gap-1.5 px-2.5 text-sm", children: [
328
- tab.icon,
329
- /* @__PURE__ */ jsx2("span", { children: tab.label })
330
- ] }, tab.id)) }) : void 0,
327
+ rightHeader: tabs.length > 0 ? /* @__PURE__ */ jsx2(CompanionTabList, { tabs, active, label }) : void 0,
331
328
  right: tabs.length > 0 ? tabs.map((tab) => {
332
329
  const isActive = tab.id === active;
333
330
  const retained = tab.keepMounted && visited.has(tab.id);
@@ -347,6 +344,55 @@ var AgentWorkspaceCompanion = forwardRef(function AgentWorkspaceCompanion2({
347
344
  }
348
345
  ) }, persistenceKey);
349
346
  });
347
+ function CompanionTabList({ tabs, active, label }) {
348
+ const frameRef = useRef(null);
349
+ const fullWidth = useRef(0);
350
+ const [compact, setCompact] = useState2(false);
351
+ const signature = tabs.map((tab) => `${tab.id}\0${tab.label}\0${tab.icon ? 1 : 0}`).join("");
352
+ useLayoutEffect(() => {
353
+ fullWidth.current = 0;
354
+ setCompact(false);
355
+ }, [signature]);
356
+ useLayoutEffect(() => {
357
+ const frame = frameRef.current;
358
+ const list = frame?.firstElementChild;
359
+ if (!frame || !(list instanceof HTMLElement)) return;
360
+ const fit = () => {
361
+ const available = frame.clientWidth;
362
+ if (!compact) {
363
+ fullWidth.current = list.scrollWidth;
364
+ if (list.scrollWidth > available + 1) setCompact(true);
365
+ } else if (fullWidth.current > 0 && available >= fullWidth.current) {
366
+ setCompact(false);
367
+ }
368
+ };
369
+ fit();
370
+ if (typeof ResizeObserver === "undefined") return;
371
+ const observer = new ResizeObserver(fit);
372
+ observer.observe(frame);
373
+ return () => observer.disconnect();
374
+ }, [compact, signature]);
375
+ useEffect(() => {
376
+ const trigger = frameRef.current?.querySelector('[role="tab"][data-state="active"]');
377
+ trigger?.scrollIntoView?.({ block: "nearest", inline: "nearest" });
378
+ }, [active, compact]);
379
+ return /* @__PURE__ */ jsx2("div", { ref: frameRef, className: "min-w-0", "data-compact": compact ? "" : void 0, children: /* @__PURE__ */ jsx2(TabsList, { "aria-label": label, className: "h-9 max-w-full justify-start overflow-x-auto bg-transparent p-0", children: tabs.map((tab) => {
380
+ const iconOnly = compact && tab.icon && tab.id !== active;
381
+ return /* @__PURE__ */ jsxs2(
382
+ TabsTrigger,
383
+ {
384
+ value: tab.id,
385
+ title: iconOnly ? tab.label : void 0,
386
+ className: iconOnly ? "gap-1.5 px-2 text-sm" : "gap-1.5 px-2.5 text-sm",
387
+ children: [
388
+ tab.icon,
389
+ /* @__PURE__ */ jsx2("span", { className: iconOnly ? "sr-only" : void 0, children: tab.label })
390
+ ]
391
+ },
392
+ tab.id
393
+ );
394
+ }) }) });
395
+ }
350
396
 
351
397
  // src/workspace-react/workspace-list.tsx
352
398
  import { useId, useMemo, useState as useState3 } from "react";