@dxos/react-ui-trace 0.13.0 → 0.14.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.
- package/dist/lib/testing.mjs +6 -5
- package/dist/lib/testing.mjs.map +1 -1
- package/dist/types/src/testing/simulated-agent.d.ts +4 -4
- package/dist/types/src/testing/simulated-agent.d.ts.map +1 -1
- package/dist/types/src/testing/test-trace.d.ts +1 -1
- package/dist/types/src/testing/test-trace.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -24
- package/src/execution-graph/execution-graph.test.ts +13 -11
- package/src/session-timeline/session-timeline.test.ts +20 -18
- package/src/testing/simulated-agent.ts +16 -16
- package/src/testing/test-trace.ts +14 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-trace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Runtime observability: process tree, trace timeline, session gantt.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -38,23 +38,23 @@
|
|
|
38
38
|
"@effect/atom-react": "4.0.0",
|
|
39
39
|
"date-fns": "^3.6.0",
|
|
40
40
|
"effect": "4.0.0",
|
|
41
|
-
"@dxos/async": "0.
|
|
42
|
-
"@dxos/compute": "0.
|
|
43
|
-
"@dxos/compute
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/log": "0.
|
|
47
|
-
"@dxos/react-client": "0.
|
|
48
|
-
"@dxos/react-
|
|
49
|
-
"@dxos/react-ui-
|
|
50
|
-
"@dxos/react-
|
|
51
|
-
"@dxos/react-ui-
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/react-ui-
|
|
54
|
-
"@dxos/react-ui-virtual": "0.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
41
|
+
"@dxos/async": "0.14.0",
|
|
42
|
+
"@dxos/compute-runtime": "0.14.0",
|
|
43
|
+
"@dxos/compute": "0.14.0",
|
|
44
|
+
"@dxos/keys": "0.14.0",
|
|
45
|
+
"@dxos/echo": "0.14.0",
|
|
46
|
+
"@dxos/log": "0.14.0",
|
|
47
|
+
"@dxos/react-client": "0.14.0",
|
|
48
|
+
"@dxos/react-hooks": "0.14.0",
|
|
49
|
+
"@dxos/react-ui-components": "0.14.0",
|
|
50
|
+
"@dxos/react-ui-editor": "0.14.0",
|
|
51
|
+
"@dxos/react-ui-list": "0.14.0",
|
|
52
|
+
"@dxos/react-ui-menu": "0.14.0",
|
|
53
|
+
"@dxos/react-ui-syntax-highlighter": "0.14.0",
|
|
54
|
+
"@dxos/react-ui-virtual": "0.14.0",
|
|
55
|
+
"@dxos/types": "0.14.0",
|
|
56
|
+
"@dxos/ui-editor": "0.14.0",
|
|
57
|
+
"@dxos/util": "0.14.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@storybook/react-vite": "^10.6.0",
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
"react": "~19.2.7",
|
|
64
64
|
"react-dom": "~19.2.7",
|
|
65
65
|
"vite": "^8.2.2",
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/ui
|
|
69
|
-
"@dxos/
|
|
66
|
+
"@dxos/echo-client": "0.14.0",
|
|
67
|
+
"@dxos/random": "0.14.0",
|
|
68
|
+
"@dxos/react-ui": "0.14.0",
|
|
69
|
+
"@dxos/ui-theme": "0.14.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"effect": "4.0.0",
|
|
73
73
|
"react": "~19.2.7",
|
|
74
74
|
"react-dom": "~19.2.7",
|
|
75
|
-
"@dxos/react-ui": "^0.
|
|
76
|
-
"@dxos/ui-theme": "^0.
|
|
75
|
+
"@dxos/react-ui": "^0.14.0",
|
|
76
|
+
"@dxos/ui-theme": "^0.14.0"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
@@ -6,6 +6,7 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import * as Option from 'effect/Option';
|
|
7
7
|
import { describe, test } from 'vitest';
|
|
8
8
|
|
|
9
|
+
import { makeTestProcess } from '@dxos/compute-runtime/testing';
|
|
9
10
|
import * as Process from '@dxos/compute/Process';
|
|
10
11
|
import * as Trace from '@dxos/compute/Trace';
|
|
11
12
|
import { Annotation } from '@dxos/echo';
|
|
@@ -188,17 +189,18 @@ const MESSAGE_ID = '01HQ0000000000000000000000';
|
|
|
188
189
|
const SHIMMER_EFFECT_TAG = 'effect:shimmer';
|
|
189
190
|
|
|
190
191
|
const makeActiveProcess = (
|
|
191
|
-
overrides: Partial<Process.
|
|
192
|
-
): Process.Process =>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
192
|
+
overrides: Partial<Process.Data> & Pick<Process.Data, 'pid' | 'key' | 'state'>,
|
|
193
|
+
): Process.Process =>
|
|
194
|
+
makeTestProcess({
|
|
195
|
+
parentPid: null,
|
|
196
|
+
params: { name: null, annotations: {} },
|
|
197
|
+
environment: {},
|
|
198
|
+
error: null,
|
|
199
|
+
startedAt: 0,
|
|
200
|
+
completedAt: Option.none(),
|
|
201
|
+
metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
|
|
202
|
+
...overrides,
|
|
203
|
+
});
|
|
202
204
|
|
|
203
205
|
describe('buildExecutionGraph (span-tree based)', () => {
|
|
204
206
|
test('empty input → no commits', ({ expect }) => {
|
|
@@ -7,6 +7,7 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
8
|
import { describe, test } from 'vitest';
|
|
9
9
|
|
|
10
|
+
import { makeTestProcess } from '@dxos/compute-runtime/testing';
|
|
10
11
|
import * as Process from '@dxos/compute/Process';
|
|
11
12
|
import { TestTraceService } from '@dxos/compute/testing';
|
|
12
13
|
import * as Trace from '@dxos/compute/Trace';
|
|
@@ -1150,24 +1151,25 @@ describe('readTaskStatusChanges', () => {
|
|
|
1150
1151
|
);
|
|
1151
1152
|
});
|
|
1152
1153
|
|
|
1153
|
-
const agentProcess = (pid: string, chat: TestChat, state: Process.State): Process.Process =>
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
Annotation.
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
}
|
|
1154
|
+
const agentProcess = (pid: string, chat: TestChat, state: Process.State): Process.Process =>
|
|
1155
|
+
makeTestProcess({
|
|
1156
|
+
pid: Process.ID.make(pid),
|
|
1157
|
+
parentPid: null,
|
|
1158
|
+
key: 'agent',
|
|
1159
|
+
params: {
|
|
1160
|
+
name: null,
|
|
1161
|
+
annotations: Annotation.buildDictionary((dictionary) => {
|
|
1162
|
+
Annotation.setDictionary(dictionary, Process.HarnessHostAnnotation, true);
|
|
1163
|
+
Annotation.setDictionary(dictionary, Process.TargetAnnotation, URI.make(chat.session.uri));
|
|
1164
|
+
}),
|
|
1165
|
+
},
|
|
1166
|
+
environment: {},
|
|
1167
|
+
state,
|
|
1168
|
+
error: null,
|
|
1169
|
+
startedAt: 0,
|
|
1170
|
+
completedAt: Option.none(),
|
|
1171
|
+
metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
|
|
1172
|
+
});
|
|
1171
1173
|
|
|
1172
1174
|
/** A chat reduced to what the builder joins on, with the feed ref its trace meta would carry. */
|
|
1173
1175
|
type TestChat = { id: string; feed: Ref.Ref<Feed.Feed>; session: Session };
|
|
@@ -107,14 +107,13 @@ type AgentStep = Schema.Schema.Type<typeof AgentStep>;
|
|
|
107
107
|
* it one step, so the caller can interleave the agent's own trace events with the child operation
|
|
108
108
|
* processes that {@link runScenario} spawns beneath it.
|
|
109
109
|
*/
|
|
110
|
-
export const SimulatedAgent = Operation.makeDurable(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(ctx) =>
|
|
110
|
+
export const SimulatedAgent = Operation.makeDurable({
|
|
111
|
+
key: 'org.dxos.testing.process.agent',
|
|
112
|
+
input: AgentStep,
|
|
113
|
+
output: Schema.Void,
|
|
114
|
+
services: [Trace.TraceService],
|
|
115
|
+
}).pipe(
|
|
116
|
+
Operation.withDurableHandler((ctx) =>
|
|
118
117
|
Effect.gen(function* () {
|
|
119
118
|
// One message id spans the whole turn, so every block groups under a single message.
|
|
120
119
|
const messageId = EntityId.random();
|
|
@@ -177,6 +176,7 @@ export const SimulatedAgent = Operation.makeDurable(
|
|
|
177
176
|
onChildEvent: () => Effect.void,
|
|
178
177
|
};
|
|
179
178
|
}),
|
|
179
|
+
),
|
|
180
180
|
);
|
|
181
181
|
|
|
182
182
|
//
|
|
@@ -197,14 +197,13 @@ type OperationInput = Schema.Schema.Type<typeof OperationInput>;
|
|
|
197
197
|
* Storybook fixture: a {@link Process} that emits the `operation.start`/`operation.end` pair a real
|
|
198
198
|
* operation process emits, with a simulated execution time in between.
|
|
199
199
|
*/
|
|
200
|
-
export const SimulatedOperation = Operation.makeDurable(
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
(ctx) =>
|
|
200
|
+
export const SimulatedOperation = Operation.makeDurable({
|
|
201
|
+
key: 'org.dxos.testing.process.operation',
|
|
202
|
+
input: OperationInput,
|
|
203
|
+
output: Schema.Void,
|
|
204
|
+
services: [Trace.TraceService],
|
|
205
|
+
}).pipe(
|
|
206
|
+
Operation.withDurableHandler((ctx) =>
|
|
208
207
|
Effect.succeed({
|
|
209
208
|
onInput: ({ key, name, icon, durationMs, fail }: OperationInput) =>
|
|
210
209
|
Effect.gen(function* () {
|
|
@@ -227,6 +226,7 @@ export const SimulatedOperation = Operation.makeDurable(
|
|
|
227
226
|
onAlarm: () => Effect.void,
|
|
228
227
|
onChildEvent: () => Effect.void,
|
|
229
228
|
}),
|
|
229
|
+
),
|
|
230
230
|
);
|
|
231
231
|
|
|
232
232
|
//
|
|
@@ -4,19 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Option from 'effect/Option';
|
|
6
6
|
|
|
7
|
+
import { makeTestProcess } from '@dxos/compute-runtime/testing';
|
|
7
8
|
import * as Process from '@dxos/compute/Process';
|
|
8
9
|
import { Annotation } from '@dxos/echo';
|
|
9
10
|
|
|
10
11
|
export const makeProcess = (
|
|
11
|
-
overrides: Partial<Process.
|
|
12
|
-
): Process.Process =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
overrides: Partial<Process.Data> & Pick<Process.Data, 'pid' | 'state'> & { name: string },
|
|
13
|
+
): Process.Process =>
|
|
14
|
+
makeTestProcess({
|
|
15
|
+
parentPid: null,
|
|
16
|
+
key: `test.process.${overrides.name}`,
|
|
17
|
+
params: { name: overrides.name, annotations: Annotation.buildDictionary(() => {}) },
|
|
18
|
+
environment: {},
|
|
19
|
+
error: null,
|
|
20
|
+
startedAt: Date.now() - 10_000,
|
|
21
|
+
completedAt: Option.none(),
|
|
22
|
+
metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
|
|
23
|
+
...overrides,
|
|
24
|
+
});
|