@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-trace",
3
- "version": "0.13.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.13.0",
42
- "@dxos/compute": "0.13.0",
43
- "@dxos/compute-runtime": "0.13.0",
44
- "@dxos/echo": "0.13.0",
45
- "@dxos/keys": "0.13.0",
46
- "@dxos/log": "0.13.0",
47
- "@dxos/react-client": "0.13.0",
48
- "@dxos/react-ui-components": "0.13.0",
49
- "@dxos/react-ui-editor": "0.13.0",
50
- "@dxos/react-hooks": "0.13.0",
51
- "@dxos/react-ui-menu": "0.13.0",
52
- "@dxos/react-ui-syntax-highlighter": "0.13.0",
53
- "@dxos/react-ui-list": "0.13.0",
54
- "@dxos/react-ui-virtual": "0.13.0",
55
- "@dxos/util": "0.13.0",
56
- "@dxos/types": "0.13.0",
57
- "@dxos/ui-editor": "0.13.0"
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/random": "0.13.0",
67
- "@dxos/react-ui": "0.13.0",
68
- "@dxos/ui-theme": "0.13.0",
69
- "@dxos/echo-client": "0.13.0"
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.13.0",
76
- "@dxos/ui-theme": "^0.13.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.Process> & Pick<Process.Process, 'pid' | 'key' | 'state'>,
192
- ): Process.Process => ({
193
- parentPid: null,
194
- params: { name: null, annotations: {} },
195
- environment: {},
196
- error: null,
197
- startedAt: 0,
198
- completedAt: Option.none(),
199
- metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
200
- ...overrides,
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
- pid: Process.ID.make(pid),
1155
- parentPid: null,
1156
- key: 'agent',
1157
- params: {
1158
- name: null,
1159
- annotations: Annotation.buildDictionary((dictionary) => {
1160
- Annotation.setDictionary(dictionary, Process.HarnessHostAnnotation, true);
1161
- Annotation.setDictionary(dictionary, Process.TargetAnnotation, URI.make(chat.session.uri));
1162
- }),
1163
- },
1164
- environment: {},
1165
- state,
1166
- error: null,
1167
- startedAt: 0,
1168
- completedAt: Option.none(),
1169
- metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
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
- key: 'org.dxos.testing.process.agent',
113
- input: AgentStep,
114
- output: Schema.Void,
115
- services: [Trace.TraceService],
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
- key: 'org.dxos.testing.process.operation',
203
- input: OperationInput,
204
- output: Schema.Void,
205
- services: [Trace.TraceService],
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.Process> & Pick<Process.Process, 'pid' | 'state'> & { name: string },
12
- ): Process.Process => ({
13
- parentPid: null,
14
- key: `test.process.${overrides.name}`,
15
- params: { name: overrides.name, annotations: Annotation.buildDictionary(() => {}) },
16
- environment: {},
17
- error: null,
18
- startedAt: Date.now() - 10_000,
19
- completedAt: Option.none(),
20
- metrics: { wallTime: 0, inputCount: 0, outputCount: 0 },
21
- ...overrides,
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
+ });