@tangle-network/agent-app 4.0.25 → 4.0.27

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 (47) hide show
  1. package/dist/assistant/index.js +2 -1
  2. package/dist/assistant/index.js.map +1 -1
  3. package/dist/chat-routes/draft-persistence.d.ts +1 -4
  4. package/dist/chat-routes/index.js +10 -8
  5. package/dist/chat-routes/index.js.map +1 -1
  6. package/dist/{chunk-GPCQRTWF.js → chunk-7ZNW7NOX.js} +11 -8
  7. package/dist/chunk-7ZNW7NOX.js.map +1 -0
  8. package/dist/{chunk-ZZZLYVZX.js → chunk-H7NMUXNZ.js} +6 -5
  9. package/dist/chunk-H7NMUXNZ.js.map +1 -0
  10. package/dist/chunk-IMSNXL2S.js +1 -0
  11. package/dist/{chunk-V3YVG7DJ.js → chunk-LSUJ2RIC.js} +2 -2
  12. package/dist/{chunk-BQH5HAKO.js → chunk-O6MFZVNS.js} +1 -5
  13. package/dist/chunk-O6MFZVNS.js.map +1 -0
  14. package/dist/chunk-QM5TPZQY.js +18 -0
  15. package/dist/chunk-QM5TPZQY.js.map +1 -0
  16. package/dist/{chunk-M4LA7JMU.js → chunk-R57ZNKJB.js} +976 -784
  17. package/dist/chunk-R57ZNKJB.js.map +1 -0
  18. package/dist/{chunk-HCNEVBPJ.js → chunk-RK2VCJQW.js} +2 -2
  19. package/dist/{chunk-Z5M2Z2QK.js → chunk-U4HKZV5U.js} +2 -2
  20. package/dist/{chunk-75DKKZQ3.js → chunk-UFR4BXCC.js} +2 -2
  21. package/dist/preset-cloudflare/index.js +7 -5
  22. package/dist/preset-cloudflare/index.js.map +1 -1
  23. package/dist/public-consultation/index.d.ts +1 -1
  24. package/dist/public-consultation/index.js +6 -5
  25. package/dist/public-consultation/index.js.map +1 -1
  26. package/dist/runtime/index.js +3 -3
  27. package/dist/runtime/router-turn.js +2 -2
  28. package/dist/sandbox/index.js +2 -2
  29. package/dist/stories/fixtures/turn-trace.d.ts +1799 -0
  30. package/dist/turn-trace/index.d.ts +1 -0
  31. package/dist/turn-trace/index.js +9 -3
  32. package/dist/turn-trace/url.d.ts +12 -0
  33. package/dist/web-react/index.d.ts +2 -0
  34. package/dist/web-react/index.js +10 -1
  35. package/dist/web-react/turn-trace-drawer.d.ts +26 -0
  36. package/dist/web-react/turn-trace-flow.d.ts +20 -0
  37. package/package.json +1 -1
  38. package/dist/chunk-BQH5HAKO.js.map +0 -1
  39. package/dist/chunk-GPCQRTWF.js.map +0 -1
  40. package/dist/chunk-KG2Y44XT.js +0 -1
  41. package/dist/chunk-M4LA7JMU.js.map +0 -1
  42. package/dist/chunk-ZZZLYVZX.js.map +0 -1
  43. /package/dist/{chunk-KG2Y44XT.js.map → chunk-IMSNXL2S.js.map} +0 -0
  44. /package/dist/{chunk-V3YVG7DJ.js.map → chunk-LSUJ2RIC.js.map} +0 -0
  45. /package/dist/{chunk-HCNEVBPJ.js.map → chunk-RK2VCJQW.js.map} +0 -0
  46. /package/dist/{chunk-Z5M2Z2QK.js.map → chunk-U4HKZV5U.js.map} +0 -0
  47. /package/dist/{chunk-75DKKZQ3.js.map → chunk-UFR4BXCC.js.map} +0 -0
@@ -30,7 +30,7 @@ import {
30
30
  sandboxRunFailureDetail,
31
31
  streamSandboxPrompt,
32
32
  turnStorageBindings
33
- } from "./chunk-Z5M2Z2QK.js";
33
+ } from "./chunk-U4HKZV5U.js";
34
34
  import {
35
35
  redactErrorMessage
36
36
  } from "./chunk-MH74DY2I.js";
@@ -40,7 +40,6 @@ import {
40
40
  WITHHELD_FAILURE,
41
41
  abortOnSignal,
42
42
  addStepFinishUsage,
43
- assistantRowIdForTurn,
44
43
  concatStreams,
45
44
  createAssistantDraftWriter,
46
45
  failureCode,
@@ -64,7 +63,11 @@ import {
64
63
  transformVisibleTextParts,
65
64
  withStreamHeartbeat,
66
65
  withoutToolList
67
- } from "./chunk-BQH5HAKO.js";
66
+ } from "./chunk-O6MFZVNS.js";
67
+ import {
68
+ assistantRowIdForTurn,
69
+ turnTraceUrl
70
+ } from "./chunk-QM5TPZQY.js";
68
71
  import {
69
72
  normalizeClientTurnId,
70
73
  resolveChatTurn
@@ -143,7 +146,7 @@ import {
143
146
  composeRouterTurnPromptSections,
144
147
  narratesBefore,
145
148
  runRouterTurn
146
- } from "./chunk-V3YVG7DJ.js";
149
+ } from "./chunk-LSUJ2RIC.js";
147
150
  import {
148
151
  createIntelligenceTurnTraceReader,
149
152
  createIntelligenceTurnTraceSink,
@@ -151,7 +154,7 @@ import {
151
154
  formatServerTiming,
152
155
  otlpTraceId,
153
156
  turnTraceId
154
- } from "./chunk-ZZZLYVZX.js";
157
+ } from "./chunk-H7NMUXNZ.js";
155
158
  import {
156
159
  readSandboxBinaryBytes,
157
160
  statSandboxFileSize
@@ -2019,7 +2022,7 @@ function turnTraceWiring(projectId, turnTrace) {
2019
2022
  const traceReader = turnTrace === false ? void 0 : traceOptions?.read ?? (traceOptions?.sink ? void 0 : createIntelligenceTurnTraceReader({ project: projectId }));
2020
2023
  const traceReceipt = (request, executionId) => ({
2021
2024
  ...traceSink ? { traceId: otlpTraceId(turnTraceId(executionId)) } : {},
2022
- ...traceReader ? { traceUrl: `${new URL(request.url).pathname.replace(/\/+$/, "")}/turns/${encodeURIComponent(executionId)}/trace` } : {}
2025
+ ...traceReader ? { traceUrl: turnTraceUrl(new URL(request.url).pathname, executionId) } : {}
2023
2026
  });
2024
2027
  return { traceOptions, traceSink, traceReader, traceReceipt };
2025
2028
  }
@@ -2036,7 +2039,7 @@ function createTurnTraceRoute({ projectId, authorize, reader, log }) {
2036
2039
  const threadId = executionThreadId(executionId, projectId);
2037
2040
  if (!threadId) return notFound("turn_trace_not_found");
2038
2041
  const auth = await authorize({ request, intent: "running", threadId });
2039
- if (!auth.ok) return auth.response.status === 401 ? auth.response : notFound("turn_trace_not_found");
2042
+ if (!auth.ok) return auth.response.status === 401 || auth.response.status >= 500 ? auth.response : notFound("turn_trace_not_found");
2040
2043
  if (auth.intent !== void 0 && auth.intent !== "running") return notFound("turn_trace_not_found");
2041
2044
  if (!reader) return notFound("turn_trace_unreadable");
2042
2045
  let exported;
@@ -3720,4 +3723,4 @@ export {
3720
3723
  createChatTurnRoutes,
3721
3724
  streamChatRouteAsSandboxEvents
3722
3725
  };
3723
- //# sourceMappingURL=chunk-GPCQRTWF.js.map
3726
+ //# sourceMappingURL=chunk-7ZNW7NOX.js.map