@agent-native/dispatch 0.40.22 → 0.40.23-nightly-20261014070126

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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @agent-native/dispatch
2
2
 
3
+ ## 0.40.23-nightly-20261014070126
4
+
5
+ ### Patch Changes
6
+
7
+ - 3b9d3cd: Show how long each tool call took in Thread Debug.
8
+ - Updated dependencies [d52c0b3]
9
+ - Updated dependencies [fadfb1b]
10
+ - Updated dependencies [1856007]
11
+ - Updated dependencies [7407dca]
12
+ - Updated dependencies [d31e11d]
13
+ - Updated dependencies [7407dca]
14
+ - Updated dependencies [11c3988]
15
+ - Updated dependencies [62cc000]
16
+ - Updated dependencies [3be2c82]
17
+ - Updated dependencies [8961aeb]
18
+ - Updated dependencies [3be2c82]
19
+ - Updated dependencies [3be2c82]
20
+ - Updated dependencies [6c0529a]
21
+ - Updated dependencies [3b9d3cd]
22
+ - Updated dependencies [9bb5cda]
23
+ - @agent-native/core@0.209.0-nightly-20261014070126
24
+ - @agent-native/toolkit@0.209.0-nightly-20261014070126
25
+
3
26
  ## 0.40.22
4
27
 
5
28
  ### Patch Changes
@@ -6,19 +6,6 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
6
6
  content: string;
7
7
  scope: "all" | "selected";
8
8
  }, {
9
- id: string;
10
- ownerEmail: string;
11
- orgId: string | null;
12
- kind: string;
13
- name: string;
14
- description: string | null;
15
- path: string;
16
- content: string;
17
- scope: string;
18
- createdBy: string;
19
- createdAt: number;
20
- updatedAt: number;
21
- } | {
22
9
  id: string;
23
10
  ownerEmail: string;
24
11
  orgId: string | null;
@@ -35,6 +22,19 @@ declare const _default: import("@agent-native/core/action").ActionDefinition<{
35
22
  reviewedAt: number | null;
36
23
  createdAt: number;
37
24
  updatedAt: number;
25
+ } | {
26
+ id: string;
27
+ ownerEmail: string;
28
+ orgId: string | null;
29
+ kind: string;
30
+ name: string;
31
+ description: string | null;
32
+ path: string;
33
+ content: string;
34
+ scope: string;
35
+ createdBy: string;
36
+ createdAt: number;
37
+ updatedAt: number;
38
38
  }>;
39
39
  export default _default;
40
40
  //# sourceMappingURL=create-workspace-resource.d.ts.map
@@ -47,10 +47,10 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
47
47
  notes?: string | undefined;
48
48
  scope?: "org" | "user" | undefined;
49
49
  }, {
50
- message?: undefined;
51
- id?: undefined;
52
50
  provider?: undefined;
53
51
  deleted?: undefined;
52
+ id?: undefined;
53
+ found?: undefined;
54
54
  providers: {
55
55
  id: string;
56
56
  label: string;
@@ -61,45 +61,45 @@ declare const _default: import("node_modules/@agent-native/core/dist").ActionDef
61
61
  updatedAt: number;
62
62
  }[];
63
63
  count: number;
64
- found?: undefined;
65
64
  registered?: undefined;
66
65
  label?: undefined;
67
- } | {
68
66
  message?: undefined;
69
- id?: undefined;
67
+ } | {
70
68
  deleted?: undefined;
71
- providers?: undefined;
69
+ id?: undefined;
72
70
  count?: undefined;
71
+ providers?: undefined;
73
72
  found: boolean;
74
73
  provider: import("node_modules/@agent-native/core/dist/provider-api").CustomProviderConfig;
75
74
  registered?: undefined;
76
75
  label?: undefined;
77
- } | {
78
76
  message?: undefined;
77
+ } | {
79
78
  provider?: undefined;
80
79
  deleted?: undefined;
81
- providers?: undefined;
82
80
  count?: undefined;
81
+ providers?: undefined;
83
82
  found: boolean;
84
83
  id: string;
85
84
  registered?: undefined;
86
85
  label?: undefined;
87
- } | {
88
86
  message?: undefined;
87
+ } | {
89
88
  provider?: undefined;
90
- providers?: undefined;
91
89
  count?: undefined;
92
90
  found?: undefined;
91
+ providers?: undefined;
93
92
  deleted: boolean;
94
93
  id: string;
95
94
  registered?: undefined;
96
95
  label?: undefined;
96
+ message?: undefined;
97
97
  } | {
98
98
  provider?: undefined;
99
99
  deleted?: undefined;
100
- providers?: undefined;
101
100
  count?: undefined;
102
101
  found?: undefined;
102
+ providers?: undefined;
103
103
  registered: boolean;
104
104
  id: string;
105
105
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-debug.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/thread-debug.tsx"],"names":[],"mappings":"AAmDA,wBAAgB,IAAI;;IAEnB;AAmkCD,MAAM,CAAC,OAAO,UAAU,gBAAgB,oDA8sBvC"}
1
+ {"version":3,"file":"thread-debug.d.ts","sourceRoot":"","sources":["../../../src/routes/pages/thread-debug.tsx"],"names":[],"mappings":"AAoDA,wBAAgB,IAAI;;IAEnB;AAumCD,MAAM,CAAC,OAAO,UAAU,gBAAgB,oDA8sBvC"}
@@ -17,6 +17,7 @@ import { Switch } from "../../components/ui/switch.js";
17
17
  import { Tabs, TabsContent, TabsList, TabsTrigger, } from "../../components/ui/tabs.js";
18
18
  import { buildConversationRows, defaultConversationRowKey, } from "../../lib/thread-debug-conversation.js";
19
19
  import { cn } from "../../lib/utils.js";
20
+ import { isThreadDebugNoiseEventType } from "../../shared/thread-debug-noise.js";
20
21
  export function meta() {
21
22
  return [{ title: "Thread Debug — Dispatch" }];
22
23
  }
@@ -144,13 +145,7 @@ function eventType(event) {
144
145
  return typeof event?.type === "string" ? event.type : "event";
145
146
  }
146
147
  function eventIsNoise(event) {
147
- return [
148
- "thinking",
149
- "text",
150
- "tool_input_delta",
151
- "stream_keepalive",
152
- "activity",
153
- ].includes(eventType(event));
148
+ return isThreadDebugNoiseEventType(eventType(event));
154
149
  }
155
150
  function json(value) {
156
151
  try {
@@ -173,6 +168,29 @@ function eventLabel(event) {
173
168
  return `error · ${event.errorCode ?? "agent"}`;
174
169
  return String(event.type ?? "event");
175
170
  }
171
+ // Legacy rows have no event_at, so their tools get no duration rather than 0ms.
172
+ function toolDurations(events) {
173
+ const bySeq = new Map();
174
+ const byId = new Map();
175
+ const pending = new Map();
176
+ for (const { seq, eventAt, event } of events) {
177
+ if (eventAt == null)
178
+ continue;
179
+ const key = event?.id ? String(event.id) : `tool:${event?.tool}`;
180
+ if (event?.type === "tool_start") {
181
+ pending.set(key, [...(pending.get(key) ?? []), eventAt]);
182
+ }
183
+ else if (event?.type === "tool_done") {
184
+ const startedAt = pending.get(key)?.shift();
185
+ if (startedAt == null)
186
+ continue;
187
+ bySeq.set(seq, eventAt - startedAt);
188
+ if (event.id)
189
+ byId.set(String(event.id), eventAt - startedAt);
190
+ }
191
+ }
192
+ return { bySeq, byId };
193
+ }
176
194
  function toolParts(message) {
177
195
  return message.contentParts.filter((part) => part?.type === "tool-call");
178
196
  }
@@ -302,7 +320,8 @@ function RunEvents({ run }) {
302
320
  const events = showStream
303
321
  ? run.events
304
322
  : run.events.filter((entry) => !eventIsNoise(entry.event));
305
- return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Switch, { id: switchId, checked: showStream, onCheckedChange: setShowStream }), _jsx(Label, { htmlFor: switchId, className: "text-xs font-normal", children: "Show stream events" })] }), events.length > 0 ? (_jsx("div", { className: "space-y-2", children: events.map((entry) => (_jsxs("details", { className: "rounded-md border bg-muted/20 px-3 py-2", children: [_jsxs("summary", { className: "cursor-pointer text-xs text-foreground", children: [_jsxs("span", { className: "font-mono text-muted-foreground", children: ["#", entry.seq] }), " ", eventLabel(entry.event)] }), _jsx(RawBlock, { value: entry.event, className: "mt-2 max-h-72" })] }, `${run.id}-event-${entry.seq}`))) })) : (_jsx("div", { className: "text-sm text-muted-foreground", children: "No events were retained for this run." }))] }));
323
+ const durations = useMemo(() => toolDurations(run.events).bySeq, [run]);
324
+ return (_jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Switch, { id: switchId, checked: showStream, onCheckedChange: setShowStream }), _jsx(Label, { htmlFor: switchId, className: "text-xs font-normal", children: "Show stream events" })] }), events.length > 0 ? (_jsx("div", { className: "space-y-2", children: events.map((entry) => (_jsxs("details", { className: "rounded-md border bg-muted/20 px-3 py-2", children: [_jsxs("summary", { className: "cursor-pointer text-xs text-foreground", children: [_jsxs("span", { className: "font-mono text-muted-foreground", children: ["#", entry.seq] }), " ", eventLabel(entry.event), durations.has(entry.seq) ? (_jsxs("span", { className: "text-muted-foreground", children: [" ", "\u00B7 ", formatDuration(durations.get(entry.seq))] })) : null] }), _jsx(RawBlock, { value: entry.event, className: "mt-2 max-h-72" })] }, `${run.id}-event-${entry.seq}`))) })) : (_jsx("div", { className: "text-sm text-muted-foreground", children: "No events were retained for this run." }))] }));
306
325
  }
307
326
  const THREAD_ITEM = "thread";
308
327
  function ThreadRecords({ detail }) {
@@ -340,6 +359,7 @@ function RowInspector({ row, detail, }) {
340
359
  ...(run ? ["run", "events", "traces"] : []),
341
360
  ];
342
361
  const activeTab = available.includes(tab) ? tab : available[0];
362
+ const toolDurationsById = useMemo(() => toolDurations(row.run?.events ?? []).byId, [row.run]);
343
363
  const traces = useMemo(() => {
344
364
  if (!run)
345
365
  return { summaries: [], spans: [] };
@@ -349,7 +369,7 @@ function RowInspector({ row, detail, }) {
349
369
  spans: detail.traces.spans.filter(forRun),
350
370
  };
351
371
  }, [detail.traces, run]);
352
- return (_jsxs(Tabs, { value: activeTab, onValueChange: (value) => setTab(value), className: "p-4", children: [_jsxs(TabsList, { children: [row.kind === "message" ? (_jsx(TabsTrigger, { value: "message", children: "Message" })) : null, run ? (_jsxs(_Fragment, { children: [_jsx(TabsTrigger, { value: "run", children: "Run" }), _jsx(TabsTrigger, { value: "events", children: "Events" }), _jsx(TabsTrigger, { value: "traces", children: "Traces" })] })) : null] }), row.kind === "message" ? (_jsxs(TabsContent, { value: "message", className: "mt-4 space-y-3", children: [toolParts(row.message).map((tool, index) => (_jsxs("details", { className: "rounded-md border bg-muted/30 px-3 py-2", children: [_jsx("summary", { className: "cursor-pointer text-xs font-medium text-foreground", children: tool.toolName ?? tool.name ?? "tool-call" }), _jsx(RawBlock, { value: tool, className: "mt-2 max-h-72" })] }, `${row.key}-tool-${index}`))), _jsx(RawBlock, { value: row.message })] })) : null, run ? (_jsxs(_Fragment, { children: [_jsx(TabsContent, { value: "run", className: "mt-4", children: _jsx(RunRecord, { run: run }) }), _jsx(TabsContent, { value: "events", className: "mt-4", children: _jsx(RunEvents, { run: run }, run.id) }), _jsx(TabsContent, { value: "traces", className: "mt-4 space-y-3", children: traces.summaries.length > 0 || traces.spans.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(RawBlock, { value: traces.summaries }), _jsx(RawBlock, { value: traces.spans })] })) : (_jsx("div", { className: "text-sm text-muted-foreground", children: "No traces were recorded for this run." })) })] })) : null] }));
372
+ return (_jsxs(Tabs, { value: activeTab, onValueChange: (value) => setTab(value), className: "p-4", children: [_jsxs(TabsList, { children: [row.kind === "message" ? (_jsx(TabsTrigger, { value: "message", children: "Message" })) : null, run ? (_jsxs(_Fragment, { children: [_jsx(TabsTrigger, { value: "run", children: "Run" }), _jsx(TabsTrigger, { value: "events", children: "Events" }), _jsx(TabsTrigger, { value: "traces", children: "Traces" })] })) : null] }), row.kind === "message" ? (_jsxs(TabsContent, { value: "message", className: "mt-4 space-y-3", children: [toolParts(row.message).map((tool, index) => (_jsxs("details", { className: "rounded-md border bg-muted/30 px-3 py-2", children: [_jsxs("summary", { className: "cursor-pointer text-xs font-medium text-foreground", children: [tool.toolName ?? tool.name ?? "tool-call", toolDurationsById.has(tool.toolCallId) ? (_jsxs("span", { className: "font-normal text-muted-foreground", children: [" ", "\u00B7 ", formatDuration(toolDurationsById.get(tool.toolCallId))] })) : null] }), _jsx(RawBlock, { value: tool, className: "mt-2 max-h-72" })] }, `${row.key}-tool-${index}`))), _jsx(RawBlock, { value: row.message })] })) : null, run ? (_jsxs(_Fragment, { children: [_jsx(TabsContent, { value: "run", className: "mt-4", children: _jsx(RunRecord, { run: run }) }), _jsx(TabsContent, { value: "events", className: "mt-4", children: _jsx(RunEvents, { run: run }, run.id) }), _jsx(TabsContent, { value: "traces", className: "mt-4 space-y-3", children: traces.summaries.length > 0 || traces.spans.length > 0 ? (_jsxs(_Fragment, { children: [_jsx(RawBlock, { value: traces.summaries }), _jsx(RawBlock, { value: traces.spans })] })) : (_jsx("div", { className: "text-sm text-muted-foreground", children: "No traces were recorded for this run." })) })] })) : null] }));
353
373
  }
354
374
  function rowMatches(row, needle) {
355
375
  const run = row.kind === "run" ? row.run : null;