@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.
- package/LICENSE +105 -0
- package/README.md +3 -0
- package/dist/lib/index.mjs +2868 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/testing.mjs +338 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +19 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/types/src/components/Gantt/Gantt.d.ts +68 -0
- package/dist/types/src/components/Gantt/Gantt.d.ts.map +1 -0
- package/dist/types/src/components/Gantt/Gantt.stories.d.ts +30 -0
- package/dist/types/src/components/Gantt/Gantt.stories.d.ts.map +1 -0
- package/dist/types/src/components/Gantt/index.d.ts +2 -0
- package/dist/types/src/components/Gantt/index.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +32 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -0
- package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
- package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
- package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/Timeline.d.ts +50 -0
- package/dist/types/src/components/Timeline/Timeline.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts +24 -0
- package/dist/types/src/components/Timeline/Timeline.stories.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/index.d.ts +4 -0
- package/dist/types/src/components/Timeline/index.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/timeline-options.d.ts +9 -0
- package/dist/types/src/components/Timeline/timeline-options.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/timeline-printer.d.ts +7 -0
- package/dist/types/src/components/Timeline/timeline-printer.d.ts.map +1 -0
- package/dist/types/src/components/Timeline/timeline-printer.test.d.ts +2 -0
- package/dist/types/src/components/Timeline/timeline-printer.test.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/TracePanel.d.ts +28 -0
- package/dist/types/src/components/TracePanel/TracePanel.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/dxn-extractor.d.ts +19 -0
- package/dist/types/src/components/TracePanel/dxn-extractor.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/dxn-extractor.test.d.ts +2 -0
- package/dist/types/src/components/TracePanel/dxn-extractor.test.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/index.d.ts +4 -0
- package/dist/types/src/components/TracePanel/index.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/trace-filter.d.ts +39 -0
- package/dist/types/src/components/TracePanel/trace-filter.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/trace-filter.test.d.ts +2 -0
- package/dist/types/src/components/TracePanel/trace-filter.test.d.ts.map +1 -0
- package/dist/types/src/components/TracePanel/useTraceMenu.d.ts +15 -0
- package/dist/types/src/components/TracePanel/useTraceMenu.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts +139 -0
- package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts +2 -0
- package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/index.d.ts +4 -0
- package/dist/types/src/execution-graph/index.d.ts.map +1 -0
- package/dist/types/src/execution-graph/pending-block-status.d.ts +26 -0
- package/dist/types/src/execution-graph/pending-block-status.d.ts.map +1 -0
- package/dist/types/src/execution-graph/pending-block-status.test.d.ts +2 -0
- package/dist/types/src/execution-graph/pending-block-status.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts +2 -0
- package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.d.ts +106 -0
- package/dist/types/src/execution-graph/span-tree.d.ts.map +1 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts +2 -0
- package/dist/types/src/execution-graph/span-tree.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts +2 -0
- package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +40 -0
- package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +1 -0
- package/dist/types/src/execution-graph/testing/index.d.ts +2 -0
- package/dist/types/src/execution-graph/testing/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts +17 -0
- package/dist/types/src/hooks/useExecutionGraph.d.ts.map +1 -0
- package/dist/types/src/hooks/useSessionTimeline.d.ts +17 -0
- package/dist/types/src/hooks/useSessionTimeline.d.ts.map +1 -0
- package/dist/types/src/hooks/useTraceMessages.d.ts +17 -0
- package/dist/types/src/hooks/useTraceMessages.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +5 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/session-timeline/index.d.ts +3 -0
- package/dist/types/src/session-timeline/index.d.ts.map +1 -0
- package/dist/types/src/session-timeline/session-timeline.d.ts +19 -0
- package/dist/types/src/session-timeline/session-timeline.d.ts.map +1 -0
- package/dist/types/src/session-timeline/session-timeline.test.d.ts +2 -0
- package/dist/types/src/session-timeline/session-timeline.test.d.ts.map +1 -0
- package/dist/types/src/session-timeline/types.d.ts +129 -0
- package/dist/types/src/session-timeline/types.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +5 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/simulated-agent.d.ts +63 -0
- package/dist/types/src/testing/simulated-agent.d.ts.map +1 -0
- package/dist/types/src/testing/snapshot-playback.d.ts +12 -0
- package/dist/types/src/testing/snapshot-playback.d.ts.map +1 -0
- package/dist/types/src/testing/test-trace.d.ts +5 -0
- package/dist/types/src/testing/test-trace.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +19 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +77 -0
- package/src/components/Gantt/Gantt.stories.tsx +241 -0
- package/src/components/Gantt/Gantt.tsx +589 -0
- package/src/components/Gantt/index.ts +5 -0
- package/src/components/ProcessTree/ProcessTree.stories.tsx +95 -0
- package/src/components/ProcessTree/ProcessTree.tsx +265 -0
- package/src/components/ProcessTree/index.ts +5 -0
- package/src/components/Timeline/Timeline.stories.tsx +326 -0
- package/src/components/Timeline/Timeline.tsx +534 -0
- package/src/components/Timeline/git.drawio.svg +821 -0
- package/src/components/Timeline/index.ts +7 -0
- package/src/components/Timeline/timeline-options.ts +27 -0
- package/src/components/Timeline/timeline-printer.test.ts +76 -0
- package/src/components/Timeline/timeline-printer.ts +223 -0
- package/src/components/TracePanel/TracePanel.tsx +248 -0
- package/src/components/TracePanel/dxn-extractor.test.ts +153 -0
- package/src/components/TracePanel/dxn-extractor.ts +166 -0
- package/src/components/TracePanel/index.ts +7 -0
- package/src/components/TracePanel/trace-filter.test.ts +137 -0
- package/src/components/TracePanel/trace-filter.ts +120 -0
- package/src/components/TracePanel/useTraceMenu.ts +95 -0
- package/src/components/index.ts +8 -0
- package/src/execution-graph/SPEC.md +749 -0
- package/src/execution-graph/execution-graph.test.ts +1205 -0
- package/src/execution-graph/execution-graph.ts +1076 -0
- package/src/execution-graph/index.ts +35 -0
- package/src/execution-graph/pending-block-status.test.ts +118 -0
- package/src/execution-graph/pending-block-status.ts +88 -0
- package/src/execution-graph/remote-snapshot.test.ts +116 -0
- package/src/execution-graph/span-tree.test.ts +370 -0
- package/src/execution-graph/span-tree.ts +404 -0
- package/src/execution-graph/sub-agent-delegation.test.ts +65 -0
- package/src/execution-graph/testing/collect-trace-events.ts +76 -0
- package/src/execution-graph/testing/index.ts +5 -0
- package/src/execution-graph/testing/sub-agent-delegation.json +1285 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useExecutionGraph.ts +107 -0
- package/src/hooks/useSessionTimeline.ts +53 -0
- package/src/hooks/useTraceMessages.ts +58 -0
- package/src/index.ts +8 -0
- package/src/session-timeline/index.ts +6 -0
- package/src/session-timeline/session-timeline.test.ts +662 -0
- package/src/session-timeline/session-timeline.ts +605 -0
- package/src/session-timeline/types.ts +100 -0
- package/src/testing/index.ts +8 -0
- package/src/testing/simulated-agent.ts +293 -0
- package/src/testing/snapshot-playback.ts +45 -0
- package/src/testing/test-trace.ts +22 -0
- package/src/translations.ts +29 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
export type GanttLaneKind = 'session' | 'task';
|
|
4
|
+
export type GanttLaneStatus = 'pending' | 'blocked' | 'running' | 'review' | 'done' | 'failed';
|
|
5
|
+
export type GanttMarkerKind = 'request' | 'operation' | 'tool' | 'message' | 'error' | 'delegation' | 'task';
|
|
6
|
+
export type GanttLane = {
|
|
7
|
+
id: string;
|
|
8
|
+
kind: GanttLaneKind;
|
|
9
|
+
label: string;
|
|
10
|
+
status: GanttLaneStatus;
|
|
11
|
+
start?: number;
|
|
12
|
+
end?: number;
|
|
13
|
+
parentId?: string;
|
|
14
|
+
taskId?: string;
|
|
15
|
+
blockedOn?: readonly string[];
|
|
16
|
+
delegatedFrom?: {
|
|
17
|
+
laneId: string;
|
|
18
|
+
markerId: string;
|
|
19
|
+
};
|
|
20
|
+
tokens?: {
|
|
21
|
+
input: number;
|
|
22
|
+
output: number;
|
|
23
|
+
total: number;
|
|
24
|
+
};
|
|
25
|
+
toolCalls?: number;
|
|
26
|
+
};
|
|
27
|
+
export type GanttMarker = {
|
|
28
|
+
id: string;
|
|
29
|
+
laneId: string;
|
|
30
|
+
kind: GanttMarkerKind;
|
|
31
|
+
timestamp: number;
|
|
32
|
+
label: string;
|
|
33
|
+
level?: 'info' | 'warn' | 'error';
|
|
34
|
+
};
|
|
35
|
+
export type GanttData = {
|
|
36
|
+
lanes: readonly GanttLane[];
|
|
37
|
+
markers?: readonly GanttMarker[];
|
|
38
|
+
range?: {
|
|
39
|
+
start: number;
|
|
40
|
+
end: number;
|
|
41
|
+
};
|
|
42
|
+
now?: number;
|
|
43
|
+
showNow?: boolean;
|
|
44
|
+
onLaneSelect?: (lane: GanttLane) => void;
|
|
45
|
+
onMarkerSelect?: (marker: GanttMarker) => void;
|
|
46
|
+
};
|
|
47
|
+
type GanttRootProps = ThemedClassName<GanttData & {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
}>;
|
|
50
|
+
type GanttLegendProps = ThemedClassName<{}>;
|
|
51
|
+
type GanttMetaProps = ThemedClassName<{}>;
|
|
52
|
+
type GanttChartProps = ThemedClassName<{}>;
|
|
53
|
+
export declare const Gantt: {
|
|
54
|
+
Root: React.ForwardRefExoticComponent<Omit<GanttRootProps, "className"> & {
|
|
55
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
56
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
57
|
+
Legend: React.ForwardRefExoticComponent<Omit<GanttLegendProps, "className"> & {
|
|
58
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
59
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
Chart: React.ForwardRefExoticComponent<Omit<{}, "className"> & {
|
|
61
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
62
|
+
} & React.RefAttributes<SVGSVGElement>>;
|
|
63
|
+
Meta: React.ForwardRefExoticComponent<Omit<GanttMetaProps, "className"> & {
|
|
64
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
65
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
66
|
+
};
|
|
67
|
+
export type { GanttChartProps, GanttLegendProps, GanttMetaProps, GanttRootProps };
|
|
68
|
+
//# sourceMappingURL=Gantt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gantt.d.ts","sourceRoot":"","sources":["../../../../../src/components/Gantt/Gantt.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAsB,KAAK,SAAS,EAAoD,MAAM,OAAO,CAAC;AAGpH,OAAO,EAAa,KAAK,eAAe,EAA+B,MAAM,gBAAgB,CAAC;AAI9F,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAC/C,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC/F,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC;AAE7G,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,aAAa,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC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0,0 +1,30 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type GanttData, type GanttLane, type GanttMarker } from './Gantt.tsx';
|
|
4
|
+
type StoryArgs = GanttData & {
|
|
5
|
+
/** Render the drawing alone, as a host that already lists the lanes does. */
|
|
6
|
+
chartOnly?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const DefaultStory: (props: StoryArgs) => React.JSX.Element;
|
|
9
|
+
declare const meta: {
|
|
10
|
+
title: string;
|
|
11
|
+
render: typeof DefaultStory;
|
|
12
|
+
decorators: import("@storybook/react").Decorator[];
|
|
13
|
+
args: {
|
|
14
|
+
lanes: GanttLane[];
|
|
15
|
+
markers: GanttMarker[];
|
|
16
|
+
now: number;
|
|
17
|
+
range: {
|
|
18
|
+
start: number;
|
|
19
|
+
end: number;
|
|
20
|
+
};
|
|
21
|
+
onLaneSelect: (lane: GanttLane) => void;
|
|
22
|
+
onMarkerSelect: (marker: GanttMarker) => void;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default meta;
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
export declare const Default: Story;
|
|
28
|
+
export declare const ChartOnly: Story;
|
|
29
|
+
export declare const Live: Story;
|
|
30
|
+
//# sourceMappingURL=Gantt.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gantt.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Gantt/Gantt.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA8C,MAAM,OAAO,CAAC;AAMnE,OAAO,EAAS,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAuJtF,KAAK,SAAS,GAAG,SAAS,GAAG;IAC3B,6EAA6E;IAC7E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAUF,QAAA,MAAM,YAAY,UAAW,SAAS,sBAKrC,CAAC;AAkCF,QAAA,MAAM,IAAI;;;;;;;;;YAQG,KAAK;YAAM,GAAG;;6BACF,SAAS;iCACL,WAAW;;CAEH,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAEvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAElB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Gantt/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as Process from '@dxos/compute/Process';
|
|
3
|
+
export type ProcessTreeProps = {
|
|
4
|
+
processes: readonly Process.Info[];
|
|
5
|
+
/**
|
|
6
|
+
* Maximum nesting depth from the root (1 = top-level processes only).
|
|
7
|
+
*
|
|
8
|
+
* @default 1
|
|
9
|
+
*/
|
|
10
|
+
depth?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Overrides the row label for a process (e.g. the name of the chat it is serving), falling back to
|
|
13
|
+
* the process name when it returns `undefined`.
|
|
14
|
+
*
|
|
15
|
+
* Must be referentially stable — `ProcessTree` is memoized on its props.
|
|
16
|
+
*/
|
|
17
|
+
resolveLabel?: (process: Process.Info) => string | undefined;
|
|
18
|
+
/** Pids drawn as selected; the tree is controlled, so a click reports through `onSelectedChange`. */
|
|
19
|
+
selected?: readonly string[];
|
|
20
|
+
/** The selection after a click: the clicked pid alone, or toggled among the others on a meta-click. */
|
|
21
|
+
onSelectedChange?: (selected: string[]) => void;
|
|
22
|
+
onProcessTerminate?: (process: Process.Info) => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The agent's running processes as a tree, one row per process with its status glyph and metrics
|
|
26
|
+
* in trailing columns. The forest is rebuilt on every metrics tick, so open state lives outside the
|
|
27
|
+
* model and is re-seeded — a collapse must survive the next tick. Renders through `Tree`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const ProcessTree: React.NamedExoticComponent<Omit<ProcessTreeProps, "className"> & {
|
|
30
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
31
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
//# sourceMappingURL=ProcessTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessTree.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProcessTree/ProcessTree.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AAcjD,MAAM,MAAM,gBAAgB,GAAG;IAE7B,SAAS,EAAE,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC;IACnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,KAAK,MAAM,GAAG,SAAS,CAAC;IAC7D,qGAAqG;IACrG,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,uGAAuG;IACvG,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAChD,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,CAAC;CACtD,CAAC;AAeF;;;;GAIG;AACH,eAAO,MAAM,WAAW;;6GAkFvB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ProcessTree } from './ProcessTree.tsx';
|
|
3
|
+
declare const meta: Meta<typeof ProcessTree>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithNestedChildren: Story;
|
|
8
|
+
//# sourceMappingURL=ProcessTree.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProcessTree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProcessTree/ProcessTree.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAUjE,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AAuDvE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAKC,CAAC;eAEtB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAKhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProcessTree/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LogLevel } from '@dxos/log';
|
|
3
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type TimelineOptions } from './timeline-options.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Mercurial-style Commit.
|
|
7
|
+
*/
|
|
8
|
+
export type Commit = {
|
|
9
|
+
id: string;
|
|
10
|
+
timestamp?: Date;
|
|
11
|
+
parents?: string[];
|
|
12
|
+
branch: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
level?: LogLevel;
|
|
15
|
+
message: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
/** DXN link for navigation to referenced objects. */
|
|
18
|
+
link?: string;
|
|
19
|
+
};
|
|
20
|
+
export type TimelineProps = ThemedClassName<{
|
|
21
|
+
/** Optional whitelist. */
|
|
22
|
+
branches?: string[];
|
|
23
|
+
/**
|
|
24
|
+
* Controlled value for the highlighted branch.
|
|
25
|
+
* When provided, takes precedence over the branch derived from the currently selected commit.
|
|
26
|
+
*/
|
|
27
|
+
branch?: string | null;
|
|
28
|
+
commits?: Commit[];
|
|
29
|
+
showTimestamp?: boolean;
|
|
30
|
+
showIcon?: boolean;
|
|
31
|
+
compact?: boolean;
|
|
32
|
+
options?: TimelineOptions;
|
|
33
|
+
debug?: boolean;
|
|
34
|
+
onChange?: (props: {
|
|
35
|
+
current?: number;
|
|
36
|
+
commit?: Commit;
|
|
37
|
+
}) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Callback when a commit with a link is clicked.
|
|
40
|
+
* If provided, commits with links will be navigable.
|
|
41
|
+
*/
|
|
42
|
+
onSelect?: (commit: Commit | undefined) => void;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* GitGraph-style timeline.
|
|
46
|
+
*/
|
|
47
|
+
export declare const Timeline: React.NamedExoticComponent<Omit<TimelineProps, "className"> & {
|
|
48
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
49
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
//# sourceMappingURL=Timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Timeline/Timeline.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAGlE,OAAO,EAAE,QAAQ,EAAE,MAAM,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 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TimelineProps } from './Timeline.tsx';
|
|
4
|
+
declare const DefaultStory: (props: TimelineProps) => React.JSX.Element;
|
|
5
|
+
declare const meta: {
|
|
6
|
+
title: string;
|
|
7
|
+
component: React.NamedExoticComponent<Omit<TimelineProps, "className"> & {
|
|
8
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
9
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
render: typeof DefaultStory;
|
|
11
|
+
decorators: import("@storybook/react").Decorator[];
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
type Story = StoryObj<typeof meta>;
|
|
15
|
+
export declare const Default: Story;
|
|
16
|
+
export declare const Branch: Story;
|
|
17
|
+
export declare const Timestamp: Story;
|
|
18
|
+
export declare const Merge: Story;
|
|
19
|
+
export declare const Linear: Story;
|
|
20
|
+
export declare const Empty: Story;
|
|
21
|
+
export declare const Random: Story;
|
|
22
|
+
export declare const Compact: Story;
|
|
23
|
+
export declare const Streaming: Story;
|
|
24
|
+
//# sourceMappingURL=Timeline.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Timeline/Timeline.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA2B,MAAM,OAAO,CAAC;AAQhD,OAAO,EAAyB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAuHtE,QAAA,MAAM,YAAY,UAAW,aAAa,sBAQzC,CAAC;AAEF,QAAA,MAAM,IAAI;;;;;;;CAKuB,CAAC;eAEnB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAgBrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAUpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KA4BvB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAenB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAUpB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAAU,CAAC;AAE/B,eAAO,MAAM,MAAM,EAAE,KAEpB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAqEvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Timeline/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type TimelineOptions = {
|
|
2
|
+
lineHeight: number;
|
|
3
|
+
columnWidth: number;
|
|
4
|
+
nodeRadius: number;
|
|
5
|
+
lineStyle: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const defaultOptions: TimelineOptions;
|
|
8
|
+
export declare const compactOptions: TimelineOptions;
|
|
9
|
+
//# sourceMappingURL=timeline-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-options.d.ts","sourceRoot":"","sources":["../../../../../src/components/Timeline/timeline-options.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,eAK5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,eAK5B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Commit } from './Timeline.tsx';
|
|
2
|
+
/**
|
|
3
|
+
* Renders commits as a monospace ASCII graph with rounded box-drawing arcs and vertical rails.
|
|
4
|
+
* Commits must be ordered chronologically (oldest first, newest last). Parents must refer to older commits.
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderTimelineAscii: (commits: Commit[], branches: string[]) => string;
|
|
7
|
+
//# sourceMappingURL=timeline-printer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-printer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Timeline/timeline-printer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAQ7C;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,MAAM,EAAE,YAAY,MAAM,EAAE,KAAG,MAmB3E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline-printer.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/Timeline/timeline-printer.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type * as Process from '@dxos/compute/Process';
|
|
3
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
4
|
+
import { type ExecutionGraph } from '../../execution-graph/index.ts';
|
|
5
|
+
import { type ProcessTreeProps } from '../ProcessTree/index.ts';
|
|
6
|
+
import { type ProcessEnvironment } from './trace-filter.ts';
|
|
7
|
+
export type TracePanelProps = ThemedClassName<Pick<ProcessTreeProps, 'resolveLabel' | 'selected' | 'onSelectedChange' | 'onProcessTerminate'> & {
|
|
8
|
+
/** The live process tree; narrowed here by `environments`. */
|
|
9
|
+
processes: readonly Process.Info[];
|
|
10
|
+
/** The trace as a commit graph, built by `useExecutionGraph` (already narrowed to `selected`). */
|
|
11
|
+
graph: ExecutionGraph;
|
|
12
|
+
/** Process environments shown; the toolbar's funnel edits it. */
|
|
13
|
+
environments: readonly ProcessEnvironment[];
|
|
14
|
+
onEnvironmentsChange: (environments: ProcessEnvironment[]) => void;
|
|
15
|
+
/** Shows the span tree as JSON in place of the timeline. */
|
|
16
|
+
debug?: boolean;
|
|
17
|
+
/** A commit whose message links an object was picked; the host decides what opening it means. */
|
|
18
|
+
onOpenLink?: (uri: string) => void;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* A space's runtime: its processes as a tree, its trace as a commit graph, and the picked commit's
|
|
22
|
+
* event. Presentation only — the host resolves the process monitor, the trace feed, settings and
|
|
23
|
+
* navigation and hands them in as props.
|
|
24
|
+
*/
|
|
25
|
+
export declare const TracePanel: React.ForwardRefExoticComponent<Omit<TracePanelProps, "className"> & {
|
|
26
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
27
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
//# sourceMappingURL=TracePanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TracePanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/TracePanel/TracePanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAEhF,OAAO,KAAK,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAIL,KAAK,eAAe,EAIrB,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG7E,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,mBAAmB,CAAC;AAG7E,MAAM,MAAM,eAAe,GAAG,eAAe,CAC3C,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,UAAU,GAAG,kBAAkB,GAAG,oBAAoB,CAAC,GAAG;IAChG,8DAA8D;IAC9D,SAAS,EAAE,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC;IACnC,kGAAkG;IAClG,KAAK,EAAE,cAAc,CAAC;IACtB,iEAAiE;IACjE,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC5C,oBAAoB,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IACnE,4DAA4D;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iGAAiG;IACjG,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CACF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU;;6GAuJtB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { URI } from '@dxos/keys';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts all reference URIs from a string.
|
|
4
|
+
*/
|
|
5
|
+
export declare const extractDxnFromString: (text: string) => URI.URI[];
|
|
6
|
+
/**
|
|
7
|
+
* Extracts DXN references from a JSON object.
|
|
8
|
+
* Handles IPLD-style references `{ "/": "dxn:..." }` and `{ "@dxn": "dxn:..." }`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const extractDxnsFromObject: (obj: unknown) => URI.URI[];
|
|
11
|
+
/**
|
|
12
|
+
* Extracts the first DXN from a tool call input string (JSON).
|
|
13
|
+
*/
|
|
14
|
+
export declare const extractFirstDxnFromToolInput: (input: string) => URI.URI | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Extracts the first DXN from a tool result string (JSON).
|
|
17
|
+
*/
|
|
18
|
+
export declare const extractFirstDxnFromToolResult: (result: string | undefined) => URI.URI | undefined;
|
|
19
|
+
//# sourceMappingURL=dxn-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dxn-extractor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TracePanel/dxn-extractor.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAsBjC;;GAEG;AACH,eAAO,MAAM,oBAAoB,SAAU,MAAM,KAAG,GAAG,CAAC,GAAG,EAuB1D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAS,OAAO,KAAG,GAAG,CAAC,GAAG,EAyE3D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,UAAW,MAAM,KAAG,GAAG,CAAC,GAAG,GAAG,SAUtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,WAAY,MAAM,GAAG,SAAS,KAAG,GAAG,CAAC,GAAG,GAAG,SAcpF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dxn-extractor.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/TracePanel/dxn-extractor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TracePanel/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type * as Process from '@dxos/compute/Process';
|
|
2
|
+
import type * as Trace from '@dxos/compute/Trace';
|
|
3
|
+
/**
|
|
4
|
+
* What a running process is working on behalf of, as a single bucket.
|
|
5
|
+
*
|
|
6
|
+
* Bucketed from the inherited {@link Process.Environment}, so filtering keeps whole subtrees together.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ProcessEnvironment: {
|
|
9
|
+
/** Not scoped to a space: layout, navigation, identity, settings, space lifecycle. */
|
|
10
|
+
readonly App: 'app';
|
|
11
|
+
/** Scoped to a space, but not to a conversation within it. */
|
|
12
|
+
readonly Space: 'space';
|
|
13
|
+
/** Serving a conversation: an agent's turn and every tool call it spawns. */
|
|
14
|
+
readonly Conversation: 'conversation';
|
|
15
|
+
};
|
|
16
|
+
export type ProcessEnvironment = (typeof ProcessEnvironment)[keyof typeof ProcessEnvironment];
|
|
17
|
+
/** Every environment, in menu order — widening scope, so the filter reads the same on every trace. */
|
|
18
|
+
export declare const ALL_PROCESS_ENVIRONMENTS: readonly ProcessEnvironment[];
|
|
19
|
+
/** App-level processes start hidden: that bucket fires on every click, whatever the user is watching. */
|
|
20
|
+
export declare const DEFAULT_PROCESS_ENVIRONMENTS: readonly ProcessEnvironment[];
|
|
21
|
+
export declare const environmentIcon: (environment: ProcessEnvironment) => string;
|
|
22
|
+
/** `conversation` outranks `space`, since a conversation always runs inside one. */
|
|
23
|
+
export declare const processEnvironment: (process: Process.Info) => ProcessEnvironment;
|
|
24
|
+
export declare const filterProcesses: (processes: readonly Process.Info[], selected: readonly ProcessEnvironment[]) => readonly Process.Info[];
|
|
25
|
+
/** Toggles an environment, preserving the canonical order. */
|
|
26
|
+
export declare const toggleProcessEnvironment: (selected: readonly ProcessEnvironment[], environment: ProcessEnvironment) => ProcessEnvironment[];
|
|
27
|
+
/**
|
|
28
|
+
* Narrows a persisted selection to the known environments, in canonical order.
|
|
29
|
+
*
|
|
30
|
+
* Settings outlive the vocabulary that wrote them; an unrecognized value would filter the panel to nothing.
|
|
31
|
+
*/
|
|
32
|
+
export declare const parseProcessEnvironments: (selected: readonly string[] | undefined) => readonly ProcessEnvironment[];
|
|
33
|
+
/**
|
|
34
|
+
* Narrows trace messages to the selected processes and their descendants: a tool call or sub-agent
|
|
35
|
+
* runs as a child of the process it serves, so its events are that process's work. An empty
|
|
36
|
+
* selection is no filter.
|
|
37
|
+
*/
|
|
38
|
+
export declare const filterTraceMessages: (messages: readonly Trace.Message[], selected: readonly string[]) => readonly Trace.Message[];
|
|
39
|
+
//# sourceMappingURL=trace-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-filter.d.ts","sourceRoot":"","sources":["../../../../../src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
|
1
|
+
{"version":3,"file":"trace-filter.test.d.ts","sourceRoot":"","sources":["../../../../../src/components/TracePanel/trace-filter.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ProcessEnvironment } from './trace-filter.ts';
|
|
2
|
+
export type UseTraceMenuOptions = {
|
|
3
|
+
/** Process environments currently shown. */
|
|
4
|
+
selected: readonly ProcessEnvironment[];
|
|
5
|
+
onSelectedChange: (environments: ProcessEnvironment[]) => void;
|
|
6
|
+
/** How many processes are picked; the clear action shows only while there are some. */
|
|
7
|
+
selectionCount?: number;
|
|
8
|
+
onClearSelection?: () => void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Environment filter menu for the trace panel's toolbar.
|
|
12
|
+
* The group collapses to a funnel trigger, so the panel's own rows keep the width.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useTraceMenu: ({ selected, onSelectedChange, selectionCount, onClearSelection, }: UseTraceMenuOptions) => import("@dxos/react-ui-menu").MenuActions;
|
|
15
|
+
//# sourceMappingURL=useTraceMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTraceMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/TracePanel/useTraceMenu.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,kBAAkB,EAGxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,mBAAmB,GAAG;IAChC,4CAA4C;IAC5C,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACxC,gBAAgB,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,KAAK,IAAI,CAAC;IAC/D,uFAAuF;IACvF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,sEAKtB,mBAAmB,8CA2DrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as Pipeable from 'effect/Pipeable';
|
|
2
|
+
import * as Process from '@dxos/compute/Process';
|
|
3
|
+
import * as Trace from '@dxos/compute/Trace';
|
|
4
|
+
import { type Commit } from '../components/Timeline/index.ts';
|
|
5
|
+
import { type Span } from './span-tree.ts';
|
|
6
|
+
export interface BuildExecutionGraphParams {
|
|
7
|
+
traceMessages: readonly Trace.Message[];
|
|
8
|
+
activeProcesses?: readonly Process.Info[];
|
|
9
|
+
collapseCompletedSpans?: boolean;
|
|
10
|
+
eventLimit?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Duration a span may sit open with no new events before it's force-closed with a synthetic
|
|
13
|
+
* end event. Only takes effect when `now` is also provided. Defaults to
|
|
14
|
+
* `DEFAULT_SPAN_TIMEOUT_MS`.
|
|
15
|
+
*/
|
|
16
|
+
spanTimeoutMs?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Reference time used to detect abandoned spans. Force-closing is skipped entirely when this
|
|
19
|
+
* is omitted.
|
|
20
|
+
*/
|
|
21
|
+
now?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds a Timeline-compatible execution graph from trace messages and active processes.
|
|
25
|
+
*
|
|
26
|
+
* The conversion runs in two stages:
|
|
27
|
+
* 1. `buildSpanTree` converts the flat list of trace messages into a hierarchical
|
|
28
|
+
* tree of spans grouped by process id (pid). See `./span-tree.ts`.
|
|
29
|
+
* 2. `spanTreeToCommits` walks the tree and emits one commit per event, using the
|
|
30
|
+
* tree structure to decide which branch each commit belongs to and how to wire parents.
|
|
31
|
+
*
|
|
32
|
+
* Pure function — no signals or atoms.
|
|
33
|
+
*/
|
|
34
|
+
export type ExecutionGraph = {
|
|
35
|
+
branches: string[];
|
|
36
|
+
commits: Commit[];
|
|
37
|
+
spanTree: Span;
|
|
38
|
+
/** Commit id -> trace event. */
|
|
39
|
+
details: ExecutionGraphDetailsMap;
|
|
40
|
+
};
|
|
41
|
+
export type ExecutionGraphDetailsMap = Record<string, Trace.FlatEvent | undefined>;
|
|
42
|
+
export declare const buildExecutionGraph: ({ traceMessages, activeProcesses, collapseCompletedSpans, eventLimit, spanTimeoutMs, now, }: BuildExecutionGraphParams) => ExecutionGraph;
|
|
43
|
+
export type CollectProcessActivityOptions = {
|
|
44
|
+
/**
|
|
45
|
+
* When set, messages with a `conversationId` that disagrees are excluded.
|
|
46
|
+
* Messages without `conversationId` still match when their pid is in the subtree.
|
|
47
|
+
*/
|
|
48
|
+
conversationId?: string;
|
|
49
|
+
eventLimit?: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Collects human-readable activity lines for a process subtree (root pid and descendants).
|
|
53
|
+
* Used to surface live sub-agent status in the task list.
|
|
54
|
+
*/
|
|
55
|
+
export declare const collectProcessActivityLines: (messages: readonly Trace.Message[], rootPid: string, options?: CollectProcessActivityOptions) => string[];
|
|
56
|
+
/**
|
|
57
|
+
* Derives a single in-flight status line from durable trace when ephemeral subscription
|
|
58
|
+
* is unavailable (e.g. between partial blocks or while a child operation is running).
|
|
59
|
+
*/
|
|
60
|
+
export declare const deriveInFlightActivityLine: (messages: readonly Trace.Message[], rootPid: string, options?: CollectProcessActivityOptions) => string | undefined;
|
|
61
|
+
type Falsy = false | null | undefined;
|
|
62
|
+
export interface CommitSelector extends Pipeable.Pipeable {
|
|
63
|
+
select: (commits: Commit[]) => Commit[];
|
|
64
|
+
}
|
|
65
|
+
export declare const CommitSelector: {
|
|
66
|
+
make: (select: CommitSelector['select']) => CommitSelector;
|
|
67
|
+
identity: () => CommitSelector;
|
|
68
|
+
/**
|
|
69
|
+
* Selects commits that match the given predicate.
|
|
70
|
+
*/
|
|
71
|
+
filter: (predicate: (commit: Commit) => unknown) => CommitSelector;
|
|
72
|
+
/**
|
|
73
|
+
* Selects commits by id.
|
|
74
|
+
*/
|
|
75
|
+
id: (id: string) => CommitSelector;
|
|
76
|
+
/**
|
|
77
|
+
* Selects commits by tag.
|
|
78
|
+
*/
|
|
79
|
+
tag: (tag: string | Falsy) => CommitSelector;
|
|
80
|
+
/**
|
|
81
|
+
* Selects commits by if any of the given tags are present.
|
|
82
|
+
*/
|
|
83
|
+
anyTags: (tags: (string | Falsy)[]) => CommitSelector;
|
|
84
|
+
/**
|
|
85
|
+
* Selects commits by branch.
|
|
86
|
+
*/
|
|
87
|
+
branch: (branch: string | Falsy) => CommitSelector;
|
|
88
|
+
/**
|
|
89
|
+
* Chains two selectors together, applying the second selector to the result of the first.
|
|
90
|
+
*
|
|
91
|
+
* Example:
|
|
92
|
+
*
|
|
93
|
+
* ```
|
|
94
|
+
* CommitSelector.tag('tag').pipe(CommitSelector.compose(CommitSelector.branch('main')));
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
compose: (next: CommitSelector) => (prev: CommitSelector) => CommitSelector;
|
|
98
|
+
/**
|
|
99
|
+
* If `prev` selector matches no commits, return `next` selector, otherwise return `prev` selector.
|
|
100
|
+
* Same as `CommitSelector.firstOf(prev, next)`.
|
|
101
|
+
*
|
|
102
|
+
* Example:
|
|
103
|
+
*
|
|
104
|
+
* ```
|
|
105
|
+
* CommitSelector.tag('tag').pipe(CommitSelector.orElse(CommitSelector.branch('main')));
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
orElse: (next: CommitSelector) => (prev: CommitSelector) => CommitSelector;
|
|
109
|
+
/**
|
|
110
|
+
* Selects commits that match either of the given selectors.
|
|
111
|
+
*/
|
|
112
|
+
andAlso: (next: CommitSelector) => (prev: CommitSelector) => CommitSelector;
|
|
113
|
+
/**
|
|
114
|
+
* Selects the first n commits.
|
|
115
|
+
*/
|
|
116
|
+
first: (n?: number) => CommitSelector;
|
|
117
|
+
/**
|
|
118
|
+
* Selects the last n commits (reverses the order of the commits).
|
|
119
|
+
*/
|
|
120
|
+
last: (n?: number) => CommitSelector;
|
|
121
|
+
/**
|
|
122
|
+
* Selects commits that do not match the given selector.
|
|
123
|
+
*/
|
|
124
|
+
not: (selector: CommitSelector) => CommitSelector;
|
|
125
|
+
/**
|
|
126
|
+
* Selects commits that match any of the given selectors.
|
|
127
|
+
*/
|
|
128
|
+
unionAll: (...selectors: CommitSelector[]) => CommitSelector;
|
|
129
|
+
/**
|
|
130
|
+
* Selects commits that match all of the given selectors.
|
|
131
|
+
*/
|
|
132
|
+
intersectAll: (...selectors: CommitSelector[]) => CommitSelector;
|
|
133
|
+
/**
|
|
134
|
+
* Returns the result of the first selector that matches any commits.
|
|
135
|
+
*/
|
|
136
|
+
firstOf: (...selectors: CommitSelector[]) => CommitSelector;
|
|
137
|
+
};
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=execution-graph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-graph.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/execution-graph.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAK5C,OAAO,KAAK,OAAO,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAI7C,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,EAAgB,KAAK,IAAI,EAAiE,MAAM,gBAAgB,CAAC;AAyExH,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,SAAS,KAAK,CAAC,OAAO,EAAE,CAAC;IACxC,eAAe,CAAC,EAAE,SAAS,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1C,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;I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c;IAGhE;;OAEG;IACH,EAAE,OAAO,MAAM,KAAG,cAAc;IAChC;;OAEG;IACH,GAAG,QAAQ,MAAM,GAAG,KAAK,KAAG,cAAc;IAC1C;;OAEG;IACH,OAAO,SAAS,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,KAAG,cAAc;IAEnD;;OAEG;IACH,MAAM,WAAW,MAAM,GAAG,KAAK,KAAG,cAAc;IAGhD;;;;;;;;OAQG;IACH,OAAO,SACE,cAAc,YACd,cAAc,KAAG,cAAc;IAGxC;;;;;;;;;OASG;IACH,MAAM,SACG,cAAc,YACd,cAAc,KAAG,cAAc;IASxC;;OAEG;IACH,OAAO,SACE,cAAc,YACd,cAAc,KAAG,cAAc;IAGxC;;OAEG;IACH,KAAK,OAAM,MAAM,KAAO,cAAc;IACtC;;OAEG;IACH,IAAI,OAAM,MAAM,KAAO,cAAc;IACrC;;OAEG;IACH,GAAG,aAAa,cAAc,KAAG,cAAc;IAM/C;;OAEG;IACH,QAAQ,iBAAiB,cAAc,EAAE,KAAG,cAAc;IAQ1D;;OAEG;IACH,YAAY,iBAAiB,cAAc,EAAE,KAAG,cAAc;IAS9D;;OAEG;IACH,OAAO,iBAAiB,cAAc,EAAE,KAAG,cAAc;CAU1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-graph.test.d.ts","sourceRoot":"","sources":["../../../../src/execution-graph/execution-graph.test.ts"],"names":[],"mappings":""}
|