@tangle-network/sandbox-ui 2.0.21 → 3.0.0

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 (40) hide show
  1. package/README.md +23 -0
  2. package/dist/{record-CnxPRyxC.js → AgentTree-CJRVpgPq.js} +196 -83
  3. package/dist/ResearchReport-CSNpZ-pj.js +2063 -0
  4. package/dist/ResearchReport-CmFYqNVY.d.ts +36 -0
  5. package/dist/{WorkflowGraph-CADReIDl.js → WorkflowGraph-B8cRtVaw.js} +2 -2
  6. package/dist/{chat-BU39pb2j.js → chat-BrlLa4rg.js} +2 -2
  7. package/dist/chat.d.ts +1 -1
  8. package/dist/chat.js +1 -1
  9. package/dist/globals.css +5837 -419
  10. package/dist/hooks.d.ts +2 -2
  11. package/dist/hooks.js +2 -2
  12. package/dist/{index-Due7tY0w.d.ts → index-5zOVKgDT.d.ts} +2 -2
  13. package/dist/{index-DxMX-DlX.d.ts → index-YU_b9xCK.d.ts} +3 -3
  14. package/dist/{index-1qlc9-S2.d.ts → index-gXcuwPOX.d.ts} +5 -6
  15. package/dist/index.d.ts +5 -5
  16. package/dist/index.js +7 -6
  17. package/dist/record/ResearchReport.d.ts +2 -0
  18. package/dist/record/ResearchReport.js +1 -0
  19. package/dist/record-Ct_MZeZC.js +47 -0
  20. package/dist/record.d.ts +33 -0
  21. package/dist/record.js +270 -0
  22. package/dist/report-viewer.js +554 -0
  23. package/dist/run/live.js +14 -33
  24. package/dist/run/record.d.ts +2 -2
  25. package/dist/run/record.js +3 -2
  26. package/dist/run.d.ts +3 -3
  27. package/dist/run.js +5 -4
  28. package/dist/runtime-viewer/{AgentGraphCanvas-B74GN1o6-DC3EH_ss.js → AgentGraphCanvas-CcBWMidO-DIW8tof6.js} +1366 -1348
  29. package/dist/runtime-viewer/{latest-events-iiWwpIck-BTK0vSlR.js → latest-events-BfRc-7l9-QhJD89rn.js} +899 -748
  30. package/dist/runtime-viewer/sandbox-ui-CUj4Q1P_.css +2 -0
  31. package/dist/styles.css +5838 -420
  32. package/dist/tailwind.css +5677 -5
  33. package/dist/tokens.css +7 -1
  34. package/dist/{trace-workspace-DkakKRLV.js → trace-workspace-BiJbv9WQ.js} +2 -2
  35. package/dist/use-follow-tail-Ht7fZGQQ.js +1 -0
  36. package/dist/workflows.js +1 -1
  37. package/dist/workspace-viewer.js +8785 -11045
  38. package/package.json +30 -12
  39. package/dist/runtime-viewer/sandbox-ui-z5RGk327.css +0 -2
  40. package/dist/use-follow-tail-Ckx5ZSV2.js +0 -1
package/dist/run/live.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { t as WorkspaceFilesPane } from "../workspace-files-pane-C0PeY6rY.js";
2
2
  import { t as DiffView } from "../diff-view-B9mNeTLF.js";
3
3
  import { t as CodeView } from "../code-view-BlhCS1SD.js";
4
- import { a as useEventStream, t as TraceWorkspace } from "../trace-workspace-DkakKRLV.js";
4
+ import { a as useEventStream, t as TraceWorkspace } from "../trace-workspace-BiJbv9WQ.js";
5
5
  import { useDocument } from "../hooks/use-document.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useEffect, useMemo, useRef, useState } from "react";
8
- import { runStatus } from "@tangle-network/ui/run";
8
+ import { isOpen, runStatus } from "@tangle-network/ui/run/status-meta";
9
9
  // src/run/live-inspection.tsx
10
10
  /** The graph, conversation and files share one selected agent and one product-owned API. */
11
11
  function useLiveInspection(url, live, fetcher) {
@@ -143,16 +143,6 @@ const withNodes = (run, nodes) => [...run.workers.map((worker) => {
143
143
  endedAt: iso(node.timing?.settledAt ?? node.settledAt)
144
144
  }))];
145
145
  const cost = (...spends) => spends.every((spend) => spend && spend.usdKnown !== false && Number.isFinite(spend.usd) && spend.usd >= 0) ? spends.reduce((sum, spend) => sum + (spend?.usd ?? 0), 0) : void 0;
146
- const flowStatus = (status) => runStatus(status === "down" ? "failed" : status === "cancelled" || status === "no-winner" ? "stopped" : status);
147
- const graphStatus = (status) => {
148
- const state = flowStatus(status);
149
- return state === "done" ? "succeeded" : state;
150
- };
151
- const isOpen = (status) => [
152
- "running",
153
- "waiting",
154
- "needs-you"
155
- ].includes(flowStatus(status));
156
146
  /** Both the Discovery host and agent-runtime-top mount this same stream consumer and shared run workspace. */
157
147
  function LiveRun(props) {
158
148
  const scope = useRef({
@@ -238,21 +228,17 @@ function LiveRunView({ api, transport }) {
238
228
  kind: "pipeline",
239
229
  startMs: start,
240
230
  endMs: Math.max(start, end - first),
241
- status: flowStatus(worker.status),
231
+ status: runStatus(worker.status),
242
232
  ...costUsd !== void 0 ? { costUsd } : {},
243
233
  ...worker.lastActivityAt !== void 0 ? {
244
234
  activityAt: [worker.lastActivityAt - first],
245
235
  medianEventGapMs: worker.medianEventGapMs
246
236
  } : {},
247
237
  ...detail(worker.id) ? { detail: detail(worker.id) } : {},
248
- ...flowStatus(worker.status) === "failed" && worker.reason ? { facts: [{
238
+ ...runStatus(worker.status) === "failed" && worker.reason ? { facts: [{
249
239
  label: "Failure",
250
240
  value: worker.reason
251
- }] } : {},
252
- ...worker.status === "cancelled" ? { outcome: {
253
- tone: "neutral",
254
- label: "Cancelled"
255
- } } : {}
241
+ }] } : {}
256
242
  }];
257
243
  });
258
244
  if (run?.startedAt && run.status !== "unobserved" && !spans.some((span) => span.id === run.id)) spans.unshift({
@@ -262,8 +248,8 @@ function LiveRunView({ api, transport }) {
262
248
  detail: detail(run.id),
263
249
  startMs: Math.max(0, Date.parse(run.startedAt) - first),
264
250
  endMs: Math.max(0, Date.parse(run.completedAt ?? new Date(at).toISOString()) - first),
265
- status: flowStatus(run.status),
266
- ...flowStatus(run.status) === "failed" && run.reason ? { facts: [{
251
+ status: runStatus(run.status),
252
+ ...runStatus(run.status) === "failed" && run.reason ? { facts: [{
267
253
  label: "Failure",
268
254
  value: run.reason
269
255
  }] } : {},
@@ -271,11 +257,7 @@ function LiveRunView({ api, transport }) {
271
257
  activityAt: [run.lastActivityAt - first],
272
258
  medianEventGapMs: run.medianEventGapMs
273
259
  } : {},
274
- ...cost(run.driverSpend) !== void 0 ? { costUsd: cost(run.driverSpend) } : {},
275
- ...run.status === "cancelled" ? { outcome: {
276
- tone: "neutral",
277
- label: "Cancelled"
278
- } } : {}
260
+ ...cost(run.driverSpend) !== void 0 ? { costUsd: cost(run.driverSpend) } : {}
279
261
  });
280
262
  const totals = run?.totals;
281
263
  return {
@@ -294,19 +276,19 @@ function LiveRunView({ api, transport }) {
294
276
  const nodes = run ? [{
295
277
  id: run.id,
296
278
  label: "root",
297
- status: graphStatus(run.status),
279
+ status: runStatus(run.status),
298
280
  model: detail(run.id),
299
281
  costUsd: cost(run.driverSpend),
300
282
  startedAt: time(run.startedAt),
301
283
  lastActivityAt: run.lastActivityAt,
302
284
  medianEventGapMs: run.medianEventGapMs,
303
- result: outcomeText ?? (run.status === "cancelled" ? "Cancelled" : graphStatus(run.status) === "failed" ? run.reason || "Failure cause not recorded" : void 0)
285
+ result: outcomeText ?? run.reason ?? (runStatus(run.status) === "failed" ? "Failure cause not recorded" : void 0)
304
286
  }, ...workers.map((worker) => ({
305
287
  id: worker.id,
306
288
  label: worker.label,
307
289
  harness: worker.runtime,
308
290
  model: detail(worker.id),
309
- status: graphStatus(worker.status),
291
+ status: runStatus(worker.status),
310
292
  costUsd: cost(worker.spend, worker.metered),
311
293
  startedAt: time(worker.startedAt),
312
294
  lastActivityAt: worker.lastActivityAt,
@@ -316,10 +298,9 @@ function LiveRunView({ api, transport }) {
316
298
  id: `${worker.id}:${index}:${label}`,
317
299
  label
318
300
  })),
319
- result: worker.status === "cancelled" ? "Cancelled" : graphStatus(worker.status) === "failed" ? worker.reason || "Failure cause not recorded" : worker.verdict
301
+ result: worker.reason ?? (runStatus(worker.status) === "failed" ? "Failure cause not recorded" : worker.verdict)
320
302
  }))] : [];
321
- const selectedAgent = agent;
322
- const inspection = useLiveInspection(active && selectedAgent ? `${api}/agents/${active.root}/${encodeURIComponent(active.run.id)}/${encodeURIComponent(selectedAgent)}` : void 0, !!run && isOpen(run.status), transport?.fetch);
303
+ const inspection = useLiveInspection(active && agent ? `${api}/agents/${active.root}/${encodeURIComponent(active.run.id)}/${encodeURIComponent(agent)}` : void 0, !!run && isOpen(run.status), transport?.fetch);
323
304
  const known = new Set(nodes.map((node) => node.id));
324
305
  const edges = workers.map((worker) => ({
325
306
  from: worker.parent && worker.parent !== worker.id && known.has(worker.parent) ? worker.parent : run.id,
@@ -381,7 +362,7 @@ function LiveRunView({ api, transport }) {
381
362
  active ? /* @__PURE__ */ jsx(TraceWorkspace, {
382
363
  trace,
383
364
  label: "Run",
384
- selectedAgentId: selectedAgent,
365
+ selectedAgentId: agent,
385
366
  conversationOpen,
386
367
  openEventSource: transport?.openEventSource,
387
368
  onSelectAgent: (id) => {
@@ -1,2 +1,2 @@
1
- import { a as ConversationProps, c as ToolCall, d as ConversationEvent, f as ConversationNode, i as Conversation, l as indexRecord, n as VirtualList, o as EventFlag, p as ConversationRecord, r as withPrompts, s as RecordIndex, t as AgentTree, u as model_d_exports } from "../index-1qlc9-S2.js";
2
- export { AgentTree, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type RecordIndex, type ToolCall, VirtualList, indexRecord, model_d_exports as recordModel, withPrompts };
1
+ import { a as ConversationProps, c as ToolCall, d as recordFlowTrace, f as ConversationEvent, i as Conversation, l as indexRecord, m as ConversationRecord, n as VirtualList, o as EventFlag, p as ConversationNode, r as withPrompts, s as RecordIndex, t as AgentTree, u as model_d_exports } from "../index-gXcuwPOX.js";
2
+ export { AgentTree, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type RecordIndex, type ToolCall, VirtualList, indexRecord, recordFlowTrace, model_d_exports as recordModel, withPrompts };
@@ -1,3 +1,4 @@
1
1
  import { t as VirtualList } from "../VirtualList-DLh2JE0F.js";
2
- import { a as model_exports, i as indexRecord, n as withPrompts, r as Conversation, t as AgentTree } from "../record-CnxPRyxC.js";
3
- export { AgentTree, Conversation, VirtualList, indexRecord, model_exports as recordModel, withPrompts };
2
+ import { d as recordFlowTrace, l as model_exports, n as Conversation, o as indexRecord, t as AgentTree } from "../AgentTree-CJRVpgPq.js";
3
+ import { t as withPrompts } from "../record-Ct_MZeZC.js";
4
+ export { AgentTree, Conversation, VirtualList, indexRecord, recordFlowTrace, model_exports as recordModel, withPrompts };
package/dist/run.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as traceSpanMark, A as ToolCallData, B as taskStatus, C as RunStatusIcon, D as TaskListItem, E as TaskList, F as parseToolEvent, G as TraceWorkspaceProps, H as LatestEventsProps, I as runStatus, J as AgentTranscriptEntry, K as AgentStreamRow, L as showsTaskPriority, M as ToolCallFeedProps, N as ToolCallStatus, O as TaskListProps, P as ToolCallType, Q as TraceWaterfallProps, R as statusMeta, S as RunStatus, T as StatusMeta, U as TraceEvent, V as LatestEvents, W as TraceWorkspace, X as useAgentStream, Y as foldAgentRows, Z as TraceWaterfall, _ as RunPhaseList, a as ApprovalPlanStep, b as RunRowStatus, c as FeedSegment, d as InlineToolItem, f as InlineToolItemProps, g as RunPhase, h as RunGroupProps, i as ApprovalDiffSummary, j as ToolCallFeed, k as TaskStatus, l as InlineThinkingItem, m as RunGroup, n as ApprovalCardProps, o as ExpandedToolDetail, p as LiveDuration, q as AgentStreamState, r as ApprovalDiffFile, s as ExpandedToolDetailProps, t as ApprovalCard, u as InlineThinkingItemProps, v as RunRowShell, w as RunStatusIconProps, x as RunRowStatusDot, y as RunRowShellProps, z as taskProgress } from "./index-DxMX-DlX.js";
1
+ import { $ as TraceWaterfallProps, A as ToolCallData, B as taskProgress, C as RunStatusIcon, D as TaskListItem, E as TaskList, F as isOpen, G as TraceWorkspace, H as LatestEvents, I as parseToolEvent, J as AgentStreamState, K as TraceWorkspaceProps, L as runStatus, M as ToolCallFeedProps, N as ToolCallStatus, O as TaskListProps, P as ToolCallType, Q as TraceWaterfall, R as showsTaskPriority, S as RunStatus, T as StatusMeta, U as LatestEventsProps, V as taskStatus, W as TraceEvent, X as foldAgentRows, Y as AgentTranscriptEntry, Z as useAgentStream, _ as RunPhaseList, a as ApprovalPlanStep, b as RunRowStatus, c as FeedSegment, d as InlineToolItem, et as traceSpanMark, f as InlineToolItemProps, g as RunPhase, h as RunGroupProps, i as ApprovalDiffSummary, j as ToolCallFeed, k as TaskStatus, l as InlineThinkingItem, m as RunGroup, n as ApprovalCardProps, o as ExpandedToolDetail, p as LiveDuration, q as AgentStreamRow, r as ApprovalDiffFile, s as ExpandedToolDetailProps, t as ApprovalCard, u as InlineThinkingItemProps, v as RunRowShell, w as RunStatusIconProps, x as RunRowStatusDot, y as RunRowShellProps, z as statusMeta } from "./index-YU_b9xCK.js";
2
2
  import { i as useEventStream, n as AgentStreamSource, r as EventStreamHandlers, t as AgentStreamOpener } from "./event-stream-DNEbvx4s.js";
3
- import { a as ConversationProps, c as ToolCall, d as ConversationEvent, f as ConversationNode, i as Conversation, l as indexRecord, n as VirtualList, o as EventFlag, p as ConversationRecord, r as withPrompts, s as RecordIndex, t as AgentTree, u as model_d_exports } from "./index-1qlc9-S2.js";
4
- export { type AgentStreamOpener, type AgentStreamRow, type AgentStreamSource, type AgentStreamState, type AgentTranscriptEntry, AgentTree, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type EventStreamHandlers, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LatestEvents, type LatestEventsProps, LiveDuration, type RecordIndex, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, type RunStatus, RunStatusIcon, type RunStatusIconProps, type StatusMeta, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, type ToolCall, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, type TraceEvent, TraceWaterfall, type TraceWaterfallProps, TraceWorkspace, type TraceWorkspaceProps, VirtualList, foldAgentRows, indexRecord, parseToolEvent, model_d_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, useEventStream, withPrompts };
3
+ import { a as ConversationProps, c as ToolCall, d as recordFlowTrace, f as ConversationEvent, i as Conversation, l as indexRecord, m as ConversationRecord, n as VirtualList, o as EventFlag, p as ConversationNode, r as withPrompts, s as RecordIndex, t as AgentTree, u as model_d_exports } from "./index-gXcuwPOX.js";
4
+ export { type AgentStreamOpener, type AgentStreamRow, type AgentStreamSource, type AgentStreamState, type AgentTranscriptEntry, AgentTree, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, Conversation, type ConversationEvent, type ConversationNode, type ConversationProps, type ConversationRecord, type EventFlag, type EventStreamHandlers, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, LatestEvents, type LatestEventsProps, LiveDuration, type RecordIndex, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, type RunStatus, RunStatusIcon, type RunStatusIconProps, type StatusMeta, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, type ToolCall, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, type TraceEvent, TraceWaterfall, type TraceWaterfallProps, TraceWorkspace, type TraceWorkspaceProps, VirtualList, foldAgentRows, indexRecord, isOpen, parseToolEvent, recordFlowTrace, model_d_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, useEventStream, withPrompts };
package/dist/run.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { t as VirtualList } from "./VirtualList-DLh2JE0F.js";
2
- import { a as useEventStream, i as useAgentStream, n as LatestEvents, o as TraceWaterfall, r as foldAgentRows, s as traceSpanMark, t as TraceWorkspace } from "./trace-workspace-DkakKRLV.js";
3
- import { a as model_exports, i as indexRecord, n as withPrompts, r as Conversation, t as AgentTree } from "./record-CnxPRyxC.js";
4
- import { ApprovalCard, ApprovalDiffSummary, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus } from "@tangle-network/ui/run";
5
- export { AgentTree, ApprovalCard, ApprovalDiffSummary, Conversation, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LatestEvents, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, TraceWaterfall, TraceWorkspace, VirtualList, foldAgentRows, indexRecord, parseToolEvent, model_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, useEventStream, withPrompts };
2
+ import { a as useEventStream, i as useAgentStream, n as LatestEvents, o as TraceWaterfall, r as foldAgentRows, s as traceSpanMark, t as TraceWorkspace } from "./trace-workspace-BiJbv9WQ.js";
3
+ import { d as recordFlowTrace, l as model_exports, n as Conversation, o as indexRecord, t as AgentTree } from "./AgentTree-CJRVpgPq.js";
4
+ import { t as withPrompts } from "./record-Ct_MZeZC.js";
5
+ import { ApprovalCard, ApprovalDiffSummary, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, isOpen, parseToolEvent, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus } from "@tangle-network/ui/run";
6
+ export { AgentTree, ApprovalCard, ApprovalDiffSummary, Conversation, ExpandedToolDetail, InlineThinkingItem, InlineToolItem, LatestEvents, LiveDuration, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, TaskList, ToolCallFeed, TraceWaterfall, TraceWorkspace, VirtualList, foldAgentRows, indexRecord, isOpen, parseToolEvent, recordFlowTrace, model_exports as recordModel, runStatus, showsTaskPriority, statusMeta, taskProgress, taskStatus, traceSpanMark, useAgentStream, useEventStream, withPrompts };