@dxos/react-ui-trace 0.11.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 (148) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +3 -0
  3. package/dist/lib/index.mjs +2868 -0
  4. package/dist/lib/index.mjs.map +1 -0
  5. package/dist/lib/testing.mjs +338 -0
  6. package/dist/lib/testing.mjs.map +1 -0
  7. package/dist/lib/translations.mjs +19 -0
  8. package/dist/lib/translations.mjs.map +1 -0
  9. package/dist/types/src/components/Gantt/Gantt.d.ts +68 -0
  10. package/dist/types/src/components/Gantt/Gantt.d.ts.map +1 -0
  11. package/dist/types/src/components/Gantt/Gantt.stories.d.ts +30 -0
  12. package/dist/types/src/components/Gantt/Gantt.stories.d.ts.map +1 -0
  13. package/dist/types/src/components/Gantt/index.d.ts +2 -0
  14. package/dist/types/src/components/Gantt/index.d.ts.map +1 -0
  15. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +32 -0
  16. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
  17. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -0
  18. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
  19. package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
  20. package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
  21. package/dist/types/src/components/Timeline/Timeline.d.ts +50 -0
  22. package/dist/types/src/components/Timeline/Timeline.d.ts.map +1 -0
  23. package/dist/types/src/components/Timeline/Timeline.stories.d.ts +24 -0
  24. package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +1 -0
  25. package/dist/types/src/components/Timeline/index.d.ts +4 -0
  26. package/dist/types/src/components/Timeline/index.d.ts.map +1 -0
  27. package/dist/types/src/components/Timeline/timeline-options.d.ts +9 -0
  28. package/dist/types/src/components/Timeline/timeline-options.d.ts.map +1 -0
  29. package/dist/types/src/components/Timeline/timeline-printer.d.ts +7 -0
  30. package/dist/types/src/components/Timeline/timeline-printer.d.ts.map +1 -0
  31. package/dist/types/src/components/Timeline/timeline-printer.test.d.ts +2 -0
  32. package/dist/types/src/components/Timeline/timeline-printer.test.d.ts.map +1 -0
  33. package/dist/types/src/components/TracePanel/TracePanel.d.ts +28 -0
  34. package/dist/types/src/components/TracePanel/TracePanel.d.ts.map +1 -0
  35. package/dist/types/src/components/TracePanel/dxn-extractor.d.ts +19 -0
  36. package/dist/types/src/components/TracePanel/dxn-extractor.d.ts.map +1 -0
  37. package/dist/types/src/components/TracePanel/dxn-extractor.test.d.ts +2 -0
  38. package/dist/types/src/components/TracePanel/dxn-extractor.test.d.ts.map +1 -0
  39. package/dist/types/src/components/TracePanel/index.d.ts +4 -0
  40. package/dist/types/src/components/TracePanel/index.d.ts.map +1 -0
  41. package/dist/types/src/components/TracePanel/trace-filter.d.ts +39 -0
  42. package/dist/types/src/components/TracePanel/trace-filter.d.ts.map +1 -0
  43. package/dist/types/src/components/TracePanel/trace-filter.test.d.ts +2 -0
  44. package/dist/types/src/components/TracePanel/trace-filter.test.d.ts.map +1 -0
  45. package/dist/types/src/components/TracePanel/useTraceMenu.d.ts +15 -0
  46. package/dist/types/src/components/TracePanel/useTraceMenu.d.ts.map +1 -0
  47. package/dist/types/src/components/index.d.ts +5 -0
  48. package/dist/types/src/components/index.d.ts.map +1 -0
  49. package/dist/types/src/execution-graph/execution-graph.d.ts +139 -0
  50. package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
  51. package/dist/types/src/execution-graph/execution-graph.test.d.ts +2 -0
  52. package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +1 -0
  53. package/dist/types/src/execution-graph/index.d.ts +4 -0
  54. package/dist/types/src/execution-graph/index.d.ts.map +1 -0
  55. package/dist/types/src/execution-graph/pending-block-status.d.ts +26 -0
  56. package/dist/types/src/execution-graph/pending-block-status.d.ts.map +1 -0
  57. package/dist/types/src/execution-graph/pending-block-status.test.d.ts +2 -0
  58. package/dist/types/src/execution-graph/pending-block-status.test.d.ts.map +1 -0
  59. package/dist/types/src/execution-graph/remote-snapshot.test.d.ts +2 -0
  60. package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +1 -0
  61. package/dist/types/src/execution-graph/span-tree.d.ts +106 -0
  62. package/dist/types/src/execution-graph/span-tree.d.ts.map +1 -0
  63. package/dist/types/src/execution-graph/span-tree.test.d.ts +2 -0
  64. package/dist/types/src/execution-graph/span-tree.test.d.ts.map +1 -0
  65. package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts +2 -0
  66. package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts.map +1 -0
  67. package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +40 -0
  68. package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +1 -0
  69. package/dist/types/src/execution-graph/testing/index.d.ts +2 -0
  70. package/dist/types/src/execution-graph/testing/index.d.ts.map +1 -0
  71. package/dist/types/src/hooks/index.d.ts +4 -0
  72. package/dist/types/src/hooks/index.d.ts.map +1 -0
  73. package/dist/types/src/hooks/useExecutionGraph.d.ts +17 -0
  74. package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
  75. package/dist/types/src/hooks/useSessionTimeline.d.ts +17 -0
  76. package/dist/types/src/hooks/useSessionTimeline.d.ts.map +1 -0
  77. package/dist/types/src/hooks/useTraceMessages.d.ts +17 -0
  78. package/dist/types/src/hooks/useTraceMessages.d.ts.map +1 -0
  79. package/dist/types/src/index.d.ts +5 -0
  80. package/dist/types/src/index.d.ts.map +1 -0
  81. package/dist/types/src/session-timeline/index.d.ts +3 -0
  82. package/dist/types/src/session-timeline/index.d.ts.map +1 -0
  83. package/dist/types/src/session-timeline/session-timeline.d.ts +19 -0
  84. package/dist/types/src/session-timeline/session-timeline.d.ts.map +1 -0
  85. package/dist/types/src/session-timeline/session-timeline.test.d.ts +2 -0
  86. package/dist/types/src/session-timeline/session-timeline.test.d.ts.map +1 -0
  87. package/dist/types/src/session-timeline/types.d.ts +129 -0
  88. package/dist/types/src/session-timeline/types.d.ts.map +1 -0
  89. package/dist/types/src/testing/index.d.ts +5 -0
  90. package/dist/types/src/testing/index.d.ts.map +1 -0
  91. package/dist/types/src/testing/simulated-agent.d.ts +63 -0
  92. package/dist/types/src/testing/simulated-agent.d.ts.map +1 -0
  93. package/dist/types/src/testing/snapshot-playback.d.ts +12 -0
  94. package/dist/types/src/testing/snapshot-playback.d.ts.map +1 -0
  95. package/dist/types/src/testing/test-trace.d.ts +5 -0
  96. package/dist/types/src/testing/test-trace.d.ts.map +1 -0
  97. package/dist/types/src/translations.d.ts +19 -0
  98. package/dist/types/src/translations.d.ts.map +1 -0
  99. package/dist/types/tsconfig.tsbuildinfo +1 -0
  100. package/package.json +77 -0
  101. package/src/components/Gantt/Gantt.stories.tsx +241 -0
  102. package/src/components/Gantt/Gantt.tsx +589 -0
  103. package/src/components/Gantt/index.ts +5 -0
  104. package/src/components/ProcessTree/ProcessTree.stories.tsx +95 -0
  105. package/src/components/ProcessTree/ProcessTree.tsx +265 -0
  106. package/src/components/ProcessTree/index.ts +5 -0
  107. package/src/components/Timeline/Timeline.stories.tsx +326 -0
  108. package/src/components/Timeline/Timeline.tsx +534 -0
  109. package/src/components/Timeline/git.drawio.svg +821 -0
  110. package/src/components/Timeline/index.ts +7 -0
  111. package/src/components/Timeline/timeline-options.ts +27 -0
  112. package/src/components/Timeline/timeline-printer.test.ts +76 -0
  113. package/src/components/Timeline/timeline-printer.ts +223 -0
  114. package/src/components/TracePanel/TracePanel.tsx +248 -0
  115. package/src/components/TracePanel/dxn-extractor.test.ts +153 -0
  116. package/src/components/TracePanel/dxn-extractor.ts +166 -0
  117. package/src/components/TracePanel/index.ts +7 -0
  118. package/src/components/TracePanel/trace-filter.test.ts +137 -0
  119. package/src/components/TracePanel/trace-filter.ts +120 -0
  120. package/src/components/TracePanel/useTraceMenu.ts +95 -0
  121. package/src/components/index.ts +8 -0
  122. package/src/execution-graph/SPEC.md +749 -0
  123. package/src/execution-graph/execution-graph.test.ts +1205 -0
  124. package/src/execution-graph/execution-graph.ts +1076 -0
  125. package/src/execution-graph/index.ts +35 -0
  126. package/src/execution-graph/pending-block-status.test.ts +118 -0
  127. package/src/execution-graph/pending-block-status.ts +88 -0
  128. package/src/execution-graph/remote-snapshot.test.ts +116 -0
  129. package/src/execution-graph/span-tree.test.ts +370 -0
  130. package/src/execution-graph/span-tree.ts +404 -0
  131. package/src/execution-graph/sub-agent-delegation.test.ts +65 -0
  132. package/src/execution-graph/testing/collect-trace-events.ts +76 -0
  133. package/src/execution-graph/testing/index.ts +5 -0
  134. package/src/execution-graph/testing/sub-agent-delegation.json +1285 -0
  135. package/src/hooks/index.ts +7 -0
  136. package/src/hooks/useExecutionGraph.ts +107 -0
  137. package/src/hooks/useSessionTimeline.ts +53 -0
  138. package/src/hooks/useTraceMessages.ts +58 -0
  139. package/src/index.ts +8 -0
  140. package/src/session-timeline/index.ts +6 -0
  141. package/src/session-timeline/session-timeline.test.ts +662 -0
  142. package/src/session-timeline/session-timeline.ts +605 -0
  143. package/src/session-timeline/types.ts +100 -0
  144. package/src/testing/index.ts +8 -0
  145. package/src/testing/simulated-agent.ts +293 -0
  146. package/src/testing/snapshot-playback.ts +45 -0
  147. package/src/testing/test-trace.ts +22 -0
  148. package/src/translations.ts +29 -0
@@ -0,0 +1,4 @@
1
+ export { type BuildExecutionGraphParams, type CollectProcessActivityOptions, CommitSelector, type ExecutionGraph, type ExecutionGraphDetailsMap, buildExecutionGraph, collectProcessActivityLines, deriveInFlightActivityLine, } from './execution-graph.ts';
2
+ export { type EphemeralStatusUpdate, estimateTokenCount, formatPendingBlockStatus, pendingStatusFromEphemeralMessage, resolveEphemeralStatusUpdate, } from './pending-block-status.ts';
3
+ export { BEGIN_EVENT_TYPES, type BuildSpanTreeOptions, DEFAULT_SPAN_TIMEOUT_MS, END_EVENT_TYPES, ROOT_SPAN_ID, type Span, type SpanMeta, buildSpanTree, flattenSpanTree, isSpanBeginEvent, isSpanEndEvent, walkSpanTree, } from './span-tree.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,6BAA6B,EAClC,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,qBAAqB,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,iCAAiC,EACjC,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import * as Trace from '@dxos/compute/Trace';
2
+ import { type ContentBlock } from '@dxos/types';
3
+ /**
4
+ * Approximate streamed token count from partial text (UTF-8 length / 4).
5
+ */
6
+ export declare const estimateTokenCount: (text: string) => number;
7
+ /**
8
+ * Formats a pending assistant block for the delegated-task status line.
9
+ */
10
+ export declare const formatPendingBlockStatus: (block: ContentBlock.Any) => string | undefined;
11
+ /**
12
+ * Reads the latest pending partial block from an ephemeral trace message.
13
+ */
14
+ export declare const pendingStatusFromEphemeralMessage: (message: Trace.Message) => string | undefined;
15
+ export type EphemeralStatusUpdate = 'unchanged' | {
16
+ readonly line: string;
17
+ };
18
+ /**
19
+ * Maps an ephemeral trace message to a task-status update.
20
+ *
21
+ * The status line is "sticky": a message without a pending line (e.g. a completed block during an
22
+ * LLM-thinking gap) leaves the previous line in place rather than clearing it, so the row keeps
23
+ * showing the latest meaningful activity until a new line arrives or the subscription ends.
24
+ */
25
+ export declare const resolveEphemeralStatusUpdate: (message: Trace.Message) => EphemeralStatusUpdate;
26
+ //# sourceMappingURL=pending-block-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-block-status.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/pending-block-status.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,MACiB,CAAC;AAWpE;;GAEG;AACH,eAAO,MAAM,wBAAwB,UAAW,YAAY,CAAC,GAAG,KAAG,MAAM,GAAG,SAgB3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iCAAiC,YAAa,KAAK,CAAC,OAAO,KAAG,MAAM,GAAG,SAwBnF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,YAAa,KAAK,CAAC,OAAO,KAAG,qBAMrE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pending-block-status.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pending-block-status.test.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/pending-block-status.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=remote-snapshot.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-snapshot.test.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/remote-snapshot.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,106 @@
1
+ import * as Trace from '@dxos/compute/Trace';
2
+ /**
3
+ * Default duration a span may sit open with no new events before it's considered abandoned
4
+ * (the runtime crashed, lost connectivity, or otherwise never wrote the closing event).
5
+ */
6
+ export declare const DEFAULT_SPAN_TIMEOUT_MS: number;
7
+ /**
8
+ * Synthetic id assigned to the root span.
9
+ * The root is a virtual container for top-level spans (those without a parent in the captured trace).
10
+ */
11
+ export declare const ROOT_SPAN_ID = "<main>";
12
+ /**
13
+ * Computed metadata for a span.
14
+ * Derived from the meta of the begin event that opened the span.
15
+ */
16
+ export interface SpanMeta {
17
+ readonly pid?: string;
18
+ readonly parentPid?: string;
19
+ readonly processName?: string;
20
+ readonly conversationId?: string;
21
+ readonly triggerId?: string;
22
+ readonly toolCallId?: string;
23
+ readonly runtimeName?: string;
24
+ }
25
+ /**
26
+ * A span in the trace hierarchy.
27
+ *
28
+ * Each span represents a single bounded unit of work — an operation invocation or an
29
+ * agent request. Spans are opened by `OperationStart` / `Trace.AgentRequestBegin` events and
30
+ * closed by their matching `OperationEnd` / `Trace.AgentRequestEnd` events. A single process
31
+ * (pid) may produce multiple sequential spans (for example, an agent session that serves
32
+ * three prompts produces three sibling spans sharing the agent's pid).
33
+ *
34
+ * `events` contains the bounded events for this span only — child spans' events are not
35
+ * duplicated here. `children` contains sub-spans that opened while this span was active.
36
+ */
37
+ export interface Span {
38
+ readonly id: string;
39
+ readonly meta: SpanMeta;
40
+ readonly events: Trace.FlatEvent[];
41
+ readonly children: Span[];
42
+ }
43
+ export declare const BEGIN_EVENT_TYPES: Set<string>;
44
+ export declare const END_EVENT_TYPES: Set<string>;
45
+ export declare const isSpanBeginEvent: (event: Trace.FlatEvent) => boolean;
46
+ export declare const isSpanEndEvent: (event: Trace.FlatEvent) => boolean;
47
+ export interface BuildSpanTreeOptions {
48
+ /**
49
+ * If provided, caps how many *non-boundary* events (status updates, partial blocks, etc.)
50
+ * are retained — only the most recent `eventLimit` of them survive. Span boundary events
51
+ * (`OperationStart` / `OperationEnd` / `Trace.AgentRequestBegin` / `Trace.AgentRequestEnd`) are *always*
52
+ * retained regardless of the limit, because dropping them would orphan their child spans
53
+ * and collapse them onto the root branch.
54
+ */
55
+ eventLimit?: number;
56
+ /**
57
+ * Duration a span may sit open with no new events before it's force-closed with a synthetic
58
+ * end event. Only takes effect when `now` is also provided. Defaults to
59
+ * `DEFAULT_SPAN_TIMEOUT_MS`.
60
+ */
61
+ spanTimeoutMs?: number;
62
+ /**
63
+ * Reference time used to detect abandoned spans. Force-closing is skipped entirely when this
64
+ * is omitted, so callers that don't pass it (tests, deterministic snapshots) keep the prior
65
+ * behavior of leaving unterminated spans open regardless of their fixture timestamps.
66
+ */
67
+ now?: number;
68
+ }
69
+ /**
70
+ * Builds a hierarchical span tree from a list of trace messages.
71
+ *
72
+ * Algorithm:
73
+ * 1. Flatten messages into events and sort them chronologically.
74
+ * 2. For each event:
75
+ * - Begin events (`OperationStart`, `Trace.AgentRequestBegin`) open a new span whose parent
76
+ * is the currently-open span of the event's `meta.parentPid`, or the root if there is
77
+ * none. The begin event itself becomes the first event of the new span.
78
+ * - End events (`OperationEnd`, `Trace.AgentRequestEnd`) close the currently-open span for
79
+ * the event's `meta.pid` and become its last event.
80
+ * - Other events attach to the currently-open span for their `meta.pid`, or to the
81
+ * root span if no span is currently open for that pid (or the event has no pid).
82
+ * 3. Sort each span's children by their earliest event timestamp.
83
+ */
84
+ export declare const buildSpanTree: (messages: readonly Trace.Message[], options?: BuildSpanTreeOptions) => Span;
85
+ /**
86
+ * A single event positioned within the span tree for commit emission.
87
+ */
88
+ export interface SpanEventCursor {
89
+ readonly span: Span;
90
+ readonly event: Trace.FlatEvent;
91
+ readonly eventIndex: number;
92
+ }
93
+ /**
94
+ * Flattens span-tree events in categorical (depth-first) order: each span's begin events, its
95
+ * child subtrees in sibling order, then its remaining events (middle and end).
96
+ */
97
+ export declare const collectSpanTreeEventsCategorically: (root: Span) => SpanEventCursor[];
98
+ /**
99
+ * Walks the span tree in depth-first pre-order, invoking `visit` for each span (root included).
100
+ */
101
+ export declare const walkSpanTree: (root: Span, visit: (span: Span, depth: number) => void, depth?: number) => void;
102
+ /**
103
+ * Returns all spans in the tree in depth-first pre-order, root first.
104
+ */
105
+ export declare const flattenSpanTree: (root: Span) => Span[];
106
+ //# sourceMappingURL=span-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"span-tree.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/span-tree.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAG7C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAAkB,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;CAC3B;AAED,eAAO,MAAM,iBAAiB,aAA2E,CAAC;AAC1G,eAAO,MAAM,eAAe,aAAuE,CAAC;AAEpG,eAAO,MAAM,gBAAgB,UAAW,KAAK,CAAC,SAAS,KAAG,OAA4C,CAAC;AACvG,eAAO,MAAM,cAAc,UAAW,KAAK,CAAC,SAAS,KAAG,OAA0C,CAAC;AAmCnG,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,aAAc,SAAS,KAAK,CAAC,OAAO,EAAE,YAAW,oBAAoB,KAAQ,IA8HtG,CAAC;AAsFF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,eAAO,MAAM,kCAAkC,SAAU,IAAI,KAAG,eAAe,EAyB9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,SAAU,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,qBAAc,IAKhG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,IAAI,KAAG,IAAI,EAIhD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=span-tree.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"span-tree.test.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/span-tree.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sub-agent-delegation.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-agent-delegation.test.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/sub-agent-delegation.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,40 @@
1
+ import * as Context from 'effect/Context';
2
+ import * as Effect from 'effect/Effect';
3
+ import * as Trace from '@dxos/compute/Trace';
4
+ declare const TestClock_base: Context.ServiceClass<TestClock, "@dxos/plugin-assistant/CollectTraceEvents/TestClock", () => number>;
5
+ /**
6
+ * Internal tag carrying the monotonic clock created by {@link collectTraceEvents}. Nested
7
+ * {@link withMeta} scopes read it so every emitted message gets a strictly increasing
8
+ * timestamp regardless of how many writes happened in the same wall-clock millisecond.
9
+ */
10
+ declare class TestClock extends TestClock_base {
11
+ }
12
+ /**
13
+ * Runs the given Effect with a mock {@link Trace.TraceService} and {@link Trace.TraceSink}
14
+ * whose writes accumulate into an in-memory list of {@link Trace.Message}s.
15
+ *
16
+ * Each `Trace.write(...)` call inside the effect produces one `Trace.Message` carrying the
17
+ * meta of the innermost {@link withMeta} scope (or empty meta if none is provided). Useful
18
+ * for building deterministic span fixtures without spinning up a feed sink.
19
+ *
20
+ * Timestamps are produced by an internal monotonic counter so multiple synchronous writes
21
+ * are ordered in insertion order — wall-clock `Date.now()` would otherwise tie and corrupt
22
+ * the resulting graph for fast tests.
23
+ *
24
+ * The effect is run synchronously; any failure is rethrown so callers don't pay error
25
+ * boilerplate in tests.
26
+ */
27
+ export declare const collectTraceEvents: <A, E>(effect: Effect.Effect<A, E, Trace.TraceService | Trace.TraceSink | TestClock>) => Trace.Message[];
28
+ /**
29
+ * Wraps an effect so that {@link Trace.write} calls inside it tag their messages with the
30
+ * given {@link Trace.Meta}. Nested `withMeta` scopes shadow the outer meta for their inner
31
+ * effect — exactly the pattern needed to fixture multi-process traces (e.g. an agent
32
+ * process containing nested operation processes).
33
+ *
34
+ * Implemented by re-providing a fresh {@link Trace.TraceService} layer over the existing
35
+ * {@link Trace.TraceSink} and shared monotonic clock, so all messages still flow into the
36
+ * same accumulator with monotonically increasing timestamps.
37
+ */
38
+ export declare const withMeta: <A, E, R>(meta: Trace.Meta, effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Trace.TraceService> | Trace.TraceSink | TestClock>;
39
+ export {};
40
+ //# sourceMappingURL=collect-trace-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-trace-events.d.ts","sourceRoot":"","sources":["../../../../../src/execution-graph/testing/collect-trace-events.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;2HAOY,MAAM;AAL/D;;;;GAIG;AACH,cAAM,SAAU,SAAQ,cAEvB;CAAG;AAEJ;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,EAAE,CAAC,UAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,KAC5E,KAAK,CAAC,OAAO,EAsBf,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,QACxB,KAAK,CAAC,IAAI,UACR,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC7B,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,SAAS,GAAG,SAAS,CACoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { collectTraceEvents, withMeta } from './collect-trace-events.ts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/execution-graph/testing/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './useExecutionGraph.ts';
2
+ export * from './useSessionTimeline.ts';
3
+ export * from './useTraceMessages.ts';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * as Atom from 'effect/unstable/reactivity/Atom';
2
+ import * as Process from '@dxos/compute/Process';
3
+ import { type Space } from '@dxos/react-client/echo';
4
+ import { type ExecutionGraph } from '../execution-graph/index.ts';
5
+ export type UseExecutionGraphOptions = {
6
+ collapseCompletedSpans?: boolean;
7
+ eventLimit?: number;
8
+ /** Pids to narrow the graph to (with their descendants); empty shows everything. */
9
+ selectedPids?: readonly string[];
10
+ };
11
+ /**
12
+ * The commit graph of a space's trace, rebuilt as messages land and as the process tree changes.
13
+ * `processesAtom` is the host's live process tree (a running agent draws a spinner commit); without
14
+ * it the graph is the durable trace alone.
15
+ */
16
+ export declare const useExecutionGraph: (space: Space, processesAtom: Atom.Atom<readonly Process.Info[]> | undefined, { collapseCompletedSpans, eventLimit, selectedPids }?: UseExecutionGraphOptions) => ExecutionGraph;
17
+ //# sourceMappingURL=useExecutionGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExecutionGraph.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useExecutionGraph.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,IAAI,MAAM,iCAAiC,CAAC;AAGxD,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,6BAA6B,CAAC;AAavF,MAAM,MAAM,wBAAwB,GAAG;IACrC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oFAAoF;IACpF,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UACrB,KAAK,iBACG,IAAI,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,yDACG,wBAAwB,KACvF,cAkBF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type * as Process from '@dxos/compute/Process';
2
+ import { type Space } from '@dxos/react-client/echo';
3
+ import { type Task } from '@dxos/types';
4
+ import { type Session, type SessionTimeline } from '../session-timeline/index.ts';
5
+ export type UseSessionTimelineOptions = {
6
+ /** The sessions shown; each contributes a session lane and its checklist's task lanes. */
7
+ sessions: readonly Session[];
8
+ tasks?: readonly Task.Task[];
9
+ /** The live process tree, from whichever monitor the host has; without it a session's liveness is read from the trace alone. */
10
+ processes?: readonly Process.Info[];
11
+ };
12
+ /**
13
+ * The live gantt-shaped view of the given sessions: rebuilt as trace events land on the space's
14
+ * trace feed and as the process tree changes, and ticked so open lanes keep extending.
15
+ */
16
+ export declare const useSessionTimeline: (space: Space | undefined, { sessions, tasks, processes }: UseSessionTimelineOptions) => SessionTimeline;
17
+ //# sourceMappingURL=useSessionTimeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSessionTimeline.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useSessionTimeline.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAwB,MAAM,8BAA8B,CAAC;AAaxG,MAAM,MAAM,yBAAyB,GAAG;IACtC,0FAA0F;IAC1F,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,gIAAgI;IAChI,SAAS,CAAC,EAAE,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC;CACrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UACtB,KAAK,GAAG,SAAS,kCACuB,yBAAyB,KACvE,eAaF,CAAC"}
@@ -0,0 +1,17 @@
1
+ import * as Duration from 'effect/Duration';
2
+ import * as Atom from 'effect/unstable/reactivity/Atom';
3
+ import * as Trace from '@dxos/compute/Trace';
4
+ import { type Space } from '@dxos/react-client/echo';
5
+ /**
6
+ * Atom of raw trace messages for a space — the input to `buildExecutionGraph`.
7
+ */
8
+ export declare const getTraceMessagesAtom: (space: Space) => Atom.Atom<readonly Trace.Message[]>;
9
+ export type UseTraceMessagesOptions = {
10
+ /** Caps the re-render rate; the feed emits per message, which is far faster than a reader can read. */
11
+ debounce?: Duration.Duration;
12
+ };
13
+ /**
14
+ * Subscribes to the space invocation trace feed.
15
+ */
16
+ export declare const useTraceMessages: (space?: Space, { debounce }?: UseTraceMessagesOptions) => readonly Trace.Message[];
17
+ //# sourceMappingURL=useTraceMessages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTraceMessages.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTraceMessages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,IAAI,MAAM,iCAAiC,CAAC;AAIxD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIrD;;GAEG;AACH,eAAO,MAAM,oBAAoB,UAAW,KAAK,KAAG,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,OAAO,EAAE,CAenF,CAAC;AAEJ,MAAM,MAAM,uBAAuB,GAAG;IACpC,uGAAuG;IACvG,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;CAC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WACnB,KAAK,iBACC,uBAAuB,KACpC,SAAS,KAAK,CAAC,OAAO,EASxB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './components/index.ts';
2
+ export * from './execution-graph/index.ts';
3
+ export * from './hooks/index.ts';
4
+ export * from './session-timeline/index.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './session-timeline.ts';
2
+ export * from './types.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/session-timeline/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
@@ -0,0 +1,19 @@
1
+ import * as Process from '@dxos/compute/Process';
2
+ import * as Trace from '@dxos/compute/Trace';
3
+ import { Task } from '@dxos/types';
4
+ import { type Session, type SessionTimeline } from './types.ts';
5
+ export interface BuildSessionTimelineInput {
6
+ traceMessages: readonly Trace.Message[];
7
+ processes?: readonly Process.Info[];
8
+ /** The sessions to draw; each contributes a lane and its checklist's task lanes. */
9
+ sessions?: readonly Session[];
10
+ tasks?: readonly Task.Task[];
11
+ /** Reference time; extends the range past open lanes. */
12
+ now?: number;
13
+ }
14
+ /**
15
+ * Builds the gantt-shaped view of one or more assistant sessions from their trace: session lanes
16
+ * (supervisors and the sub-agents they delegate to), task lanes, and the markers on each.
17
+ */
18
+ export declare const buildSessionTimeline: ({ traceMessages, processes, sessions, tasks, now, }: BuildSessionTimelineInput) => SessionTimeline;
19
+ //# sourceMappingURL=session-timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-timeline.d.ts","sourceRoot":"","sources":["../../../../src/session-timeline/session-timeline.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAG7C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAInC,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,eAAe,EAErB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,SAAS,KAAK,CAAC,OAAO,EAAE,CAAC;IACxC,SAAS,CAAC,EAAE,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC;IACpC,oFAAoF;IACpF,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAgJD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,wDAM9B,yBAAyB,KAAG,eAsV9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=session-timeline.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-timeline.test.d.ts","sourceRoot":"","sources":["../../../../src/session-timeline/session-timeline.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,129 @@
1
+ import * as Schema from 'effect/Schema';
2
+ export declare const LaneKind: Schema.Literals<readonly ["session", "task"]>;
3
+ export type LaneKind = Schema.Schema.Type<typeof LaneKind>;
4
+ export declare const LaneStatus: Schema.Literals<readonly ["pending", "blocked", "running", "review", "done", "failed"]>;
5
+ export type LaneStatus = Schema.Schema.Type<typeof LaneStatus>;
6
+ export declare const TokenUsage: Schema.Struct<{
7
+ readonly input: Schema.Number;
8
+ readonly output: Schema.Number;
9
+ readonly total: Schema.Number;
10
+ }>;
11
+ export type TokenUsage = Schema.Schema.Type<typeof TokenUsage>;
12
+ /**
13
+ * A conversation the timeline draws as a session lane: the chat, reduced to what the join needs so
14
+ * the builder does not depend on the chat's schema. `uri` is what the agent process targets and
15
+ * `feedId` what its trace meta names; `taskIds` is the checklist.
16
+ */
17
+ export declare const Session: Schema.Struct<{
18
+ readonly id: Schema.String;
19
+ readonly label: Schema.optional<Schema.String>;
20
+ readonly uri: Schema.String;
21
+ readonly feedId: Schema.optional<Schema.String>;
22
+ readonly taskIds: Schema.$Array<Schema.String>;
23
+ }>;
24
+ export type Session = Schema.Schema.Type<typeof Session>;
25
+ /**
26
+ * Node in the supervisor lane a child session was spawned from, so the connector can start at the
27
+ * exact marker rather than at the lane's edge.
28
+ */
29
+ export declare const DelegationSource: Schema.Struct<{
30
+ readonly laneId: Schema.String;
31
+ readonly markerId: Schema.String;
32
+ }>;
33
+ export type DelegationSource = Schema.Schema.Type<typeof DelegationSource>;
34
+ /**
35
+ * One row of the timeline: a session (supervisor or delegated sub-agent) rendered as a box spanning
36
+ * `start`..`end`, or a task rendered as a thin line grouped under its session.
37
+ */
38
+ export declare const Lane: Schema.Struct<{
39
+ readonly id: Schema.String;
40
+ readonly kind: Schema.Literals<readonly ["session", "task"]>;
41
+ readonly label: Schema.String;
42
+ readonly status: Schema.Literals<readonly ["pending", "blocked", "running", "review", "done", "failed"]>;
43
+ /** Epoch ms. */
44
+ readonly start: Schema.optional<Schema.Number>;
45
+ readonly end: Schema.optional<Schema.Number>;
46
+ readonly parentId: Schema.optional<Schema.String>;
47
+ readonly sessionId: Schema.optional<Schema.String>;
48
+ readonly taskId: Schema.optional<Schema.String>;
49
+ readonly pid: Schema.optional<Schema.String>;
50
+ /** Lane ids this lane waits on (task dependencies). */
51
+ readonly blockedOn: Schema.optional<Schema.$Array<Schema.String>>;
52
+ readonly delegatedFrom: Schema.optional<Schema.Struct<{
53
+ readonly laneId: Schema.String;
54
+ readonly markerId: Schema.String;
55
+ }>>;
56
+ readonly tokens: Schema.optional<Schema.Struct<{
57
+ readonly input: Schema.Number;
58
+ readonly output: Schema.Number;
59
+ readonly total: Schema.Number;
60
+ }>>;
61
+ readonly toolCalls: Schema.optional<Schema.Number>;
62
+ }>;
63
+ export type Lane = Schema.Schema.Type<typeof Lane>;
64
+ export declare const MarkerKind: Schema.Literals<readonly ["request", "operation", "tool", "message", "error", "delegation", "task"]>;
65
+ export type MarkerKind = Schema.Schema.Type<typeof MarkerKind>;
66
+ export declare const MarkerLevel: Schema.Literals<readonly ["info", "warn", "error"]>;
67
+ export type MarkerLevel = Schema.Schema.Type<typeof MarkerLevel>;
68
+ /**
69
+ * A point event on a lane, rendered as a node inside the session box.
70
+ */
71
+ export declare const Marker: Schema.Struct<{
72
+ readonly id: Schema.String;
73
+ readonly laneId: Schema.String;
74
+ readonly kind: Schema.Literals<readonly ["request", "operation", "tool", "message", "error", "delegation", "task"]>;
75
+ readonly timestamp: Schema.Number;
76
+ readonly label: Schema.String;
77
+ readonly level: Schema.optional<Schema.Literals<readonly ["info", "warn", "error"]>>;
78
+ readonly pid: Schema.optional<Schema.String>;
79
+ readonly detail: Schema.optional<Schema.Unknown>;
80
+ }>;
81
+ export type Marker = Schema.Schema.Type<typeof Marker>;
82
+ export declare const TimeRange: Schema.Struct<{
83
+ readonly start: Schema.Number;
84
+ readonly end: Schema.Number;
85
+ }>;
86
+ export type TimeRange = Schema.Schema.Type<typeof TimeRange>;
87
+ export declare const SessionTimeline: Schema.Struct<{
88
+ readonly lanes: Schema.$Array<Schema.Struct<{
89
+ readonly id: Schema.String;
90
+ readonly kind: Schema.Literals<readonly ["session", "task"]>;
91
+ readonly label: Schema.String;
92
+ readonly status: Schema.Literals<readonly ["pending", "blocked", "running", "review", "done", "failed"]>;
93
+ /** Epoch ms. */
94
+ readonly start: Schema.optional<Schema.Number>;
95
+ readonly end: Schema.optional<Schema.Number>;
96
+ readonly parentId: Schema.optional<Schema.String>;
97
+ readonly sessionId: Schema.optional<Schema.String>;
98
+ readonly taskId: Schema.optional<Schema.String>;
99
+ readonly pid: Schema.optional<Schema.String>;
100
+ /** Lane ids this lane waits on (task dependencies). */
101
+ readonly blockedOn: Schema.optional<Schema.$Array<Schema.String>>;
102
+ readonly delegatedFrom: Schema.optional<Schema.Struct<{
103
+ readonly laneId: Schema.String;
104
+ readonly markerId: Schema.String;
105
+ }>>;
106
+ readonly tokens: Schema.optional<Schema.Struct<{
107
+ readonly input: Schema.Number;
108
+ readonly output: Schema.Number;
109
+ readonly total: Schema.Number;
110
+ }>>;
111
+ readonly toolCalls: Schema.optional<Schema.Number>;
112
+ }>>;
113
+ readonly markers: Schema.$Array<Schema.Struct<{
114
+ readonly id: Schema.String;
115
+ readonly laneId: Schema.String;
116
+ readonly kind: Schema.Literals<readonly ["request", "operation", "tool", "message", "error", "delegation", "task"]>;
117
+ readonly timestamp: Schema.Number;
118
+ readonly label: Schema.String;
119
+ readonly level: Schema.optional<Schema.Literals<readonly ["info", "warn", "error"]>>;
120
+ readonly pid: Schema.optional<Schema.String>;
121
+ readonly detail: Schema.optional<Schema.Unknown>;
122
+ }>>;
123
+ readonly range: Schema.Struct<{
124
+ readonly start: Schema.Number;
125
+ readonly end: Schema.Number;
126
+ }>;
127
+ }>;
128
+ export type SessionTimeline = Schema.Schema.Type<typeof SessionTimeline>;
129
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/session-timeline/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,QAAQ,+CAAuC,CAAC;AAC7D,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE3D,eAAO,MAAM,UAAU,yFAAiF,CAAC;AACzG,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,UAAU;;;;EAIrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;;;EAMlB,CAAC;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,OAAO,CAAC,CAAC;AAEzD;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;EAG3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E;;;GAGG;AACH,eAAO,MAAM,IAAI;;;;;IAKf,gBAAgB;;;;;;;IAOhB,uDAAuD;;;;;;;;;;;;EAKvD,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnD,eAAO,MAAM,UAAU,sGAA8F,CAAC;AACtH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,eAAO,MAAM,WAAW,qDAA6C,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;EASjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,SAAS;;;EAGpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,SAAS,CAAC,CAAC;AAE7D,eAAO,MAAM,eAAe;;;;;;QA1C1B,gBAAgB;;;;;;;QAOhB,uDAAuD;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCvD,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './simulated-agent.ts';
2
+ export * from './snapshot-playback.ts';
3
+ export * from './test-trace.ts';
4
+ export { default as subAgentDelegationFixture } from '../execution-graph/testing/sub-agent-delegation.json';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,sDAAsD,CAAC"}
@@ -0,0 +1,63 @@
1
+ import * as Effect from 'effect/Effect';
2
+ import { type ProcessManager } from '@dxos/compute-runtime';
3
+ import * as Process from '@dxos/compute/Process';
4
+ import * as Trace from '@dxos/compute/Trace';
5
+ /**
6
+ * One simulated operation. Rendered as a child process in the tree and as an `operation.start`/
7
+ * `operation.end` span on the timeline.
8
+ */
9
+ export interface SimulatedTool {
10
+ readonly key: string;
11
+ readonly name: string;
12
+ readonly icon?: string;
13
+ readonly durationMs: number;
14
+ /** Nested operations, spawned under this one so the tree exercises more than one level. */
15
+ readonly children?: readonly SimulatedTool[];
16
+ /** Run `children` concurrently, producing parallel lanes on the timeline. */
17
+ readonly concurrent?: boolean;
18
+ /** End with `outcome: 'failure'` and fail the process. */
19
+ readonly fail?: boolean;
20
+ }
21
+ export interface AgentScenario {
22
+ readonly name: string;
23
+ readonly prompt: string;
24
+ readonly tools: readonly SimulatedTool[];
25
+ }
26
+ export declare const agentScenarios: readonly AgentScenario[];
27
+ /**
28
+ * Storybook fixture: a {@link Process} standing in for a conversational agent. Each input advances
29
+ * it one step, so the caller can interleave the agent's own trace events with the child operation
30
+ * processes that {@link runScenario} spawns beneath it.
31
+ */
32
+ export declare const SimulatedAgent: Process.Process<{
33
+ readonly _tag: "begin";
34
+ readonly prompt: string;
35
+ } | {
36
+ readonly _tag: "toolCall";
37
+ readonly toolCallId: string;
38
+ readonly name: string;
39
+ } | {
40
+ readonly _tag: "toolResult";
41
+ readonly toolCallId: string;
42
+ readonly name: string;
43
+ } | {
44
+ readonly _tag: "end";
45
+ readonly status: "error" | "success";
46
+ }, void, Trace.TraceService, never>;
47
+ /**
48
+ * Storybook fixture: a {@link Process} that emits the `operation.start`/`operation.end` pair a real
49
+ * operation process emits, with a simulated execution time in between.
50
+ */
51
+ export declare const SimulatedOperation: Process.Process<{
52
+ readonly key: string;
53
+ readonly name: string;
54
+ readonly icon?: string | undefined;
55
+ readonly durationMs: number;
56
+ readonly fail?: boolean | undefined;
57
+ }, void, Trace.TraceService, never>;
58
+ /**
59
+ * Runs one {@link agentScenarios} entry end to end: an agent process with a child operation process
60
+ * per tool, so the panel has both a populated process tree and a timeline with nested spans.
61
+ */
62
+ export declare const runScenario: (manager: ProcessManager.Manager, index: number, environment: Process.Environment) => Effect.Effect<void>;
63
+ //# sourceMappingURL=simulated-agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simulated-agent.d.ts","sourceRoot":"","sources":["../../../../src/testing/simulated-agent.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAG7C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;CAC1C;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,aAAa,EA0ClD,CAAC;AA0BF;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;mCAsE1B,CAAC;AAgBF;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;mCA8B9B,CAAC;AAqCF;;;GAGG;AACH,eAAO,MAAM,WAAW,YACb,cAAc,CAAC,OAAO,SACxB,MAAM,eACA,OAAO,CAAC,WAAW,KAC/B,MAAM,CAAC,MAAM,CAAC,IAAI,CAmBE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type Dispatch, type SetStateAction } from 'react';
2
+ /**
3
+ * Interval (ms) between auto-played trace messages in the snapshot playback story.
4
+ */
5
+ export declare const PLAYBACK_INTERVAL_MS = 250;
6
+ export declare const STEP_STORAGE_KEY = "plugin-assistant.trace-panel.snapshot.step";
7
+ /**
8
+ * `useState<number>` that hydrates from and persists to `localStorage`.
9
+ * The third tuple member is `true` iff a valid value was loaded on first render.
10
+ */
11
+ export declare const useLocalStorageNumber: (key: string, initial: number) => [number, Dispatch<SetStateAction<number>>, boolean];
12
+ //# sourceMappingURL=snapshot-playback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snapshot-playback.d.ts","sourceRoot":"","sources":["../../../../src/testing/snapshot-playback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAA+B,MAAM,OAAO,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAC3B,MAAM,WACF,MAAM,KACd,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAwBpD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import * as Process from '@dxos/compute/Process';
2
+ export declare const makeProcess: (overrides: Partial<Process.Info> & Pick<Process.Info, 'pid' | 'state'> & {
3
+ name: string;
4
+ }) => Process.Info;
5
+ //# sourceMappingURL=test-trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-trace.d.ts","sourceRoot":"","sources":["../../../../src/testing/test-trace.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAGjD,eAAO,MAAM,WAAW,cACX,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,KACxF,OAAO,CAAC,IAUT,CAAC"}