@agent-native/dispatch 0.21.0 → 0.22.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/dist/actions/get-agent-thread-debug.d.ts +2 -0
- package/dist/actions/provider-api-register.d.ts +8 -8
- package/dist/actions/search-agent-threads.js +2 -2
- package/dist/actions/search-agent-threads.js.map +1 -1
- package/dist/components/layout/HeaderActions.d.ts +1 -17
- package/dist/components/layout/HeaderActions.d.ts.map +1 -1
- package/dist/components/layout/HeaderActions.js +1 -51
- package/dist/components/layout/HeaderActions.js.map +1 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +22 -14
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -19
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -22
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +1 -27
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -35
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/popover.d.ts +2 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +2 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/select.d.ts +1 -13
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -26
- package/dist/components/ui/select.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -15
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/automation-display.js +1 -1
- package/dist/lib/automation-display.js.map +1 -1
- package/dist/routes/pages/thread-debug.d.ts.map +1 -1
- package/dist/routes/pages/thread-debug.js +288 -118
- package/dist/routes/pages/thread-debug.js.map +1 -1
- package/dist/server/lib/thread-debug-store.d.ts +2 -0
- package/dist/server/lib/thread-debug-store.d.ts.map +1 -1
- package/dist/server/lib/thread-debug-store.js +6 -2
- package/dist/server/lib/thread-debug-store.js.map +1 -1
- package/package.json +3 -3
- package/src/actions/search-agent-threads.ts +2 -2
- package/src/components/layout/HeaderActions.tsx +1 -84
- package/src/components/layout/Layout.spec.tsx +94 -10
- package/src/components/layout/Layout.tsx +107 -101
- package/src/components/ui/dialog.tsx +1 -120
- package/src/components/ui/dropdown-menu.tsx +1 -198
- package/src/components/ui/popover.tsx +3 -1
- package/src/components/ui/select.tsx +1 -158
- package/src/hooks/use-mobile.tsx +1 -21
- package/src/lib/automation-display.spec.ts +1 -1
- package/src/lib/automation-display.ts +1 -1
- package/src/routes/pages/thread-debug.spec.tsx +103 -5
- package/src/routes/pages/thread-debug.tsx +1051 -451
- package/src/server/lib/thread-debug-store.spec.ts +17 -0
- package/src/server/lib/thread-debug-store.ts +9 -2
|
@@ -52,6 +52,8 @@ const run = {
|
|
|
52
52
|
worker_stage: "model",
|
|
53
53
|
diag_stage: '{"stage":"model"}',
|
|
54
54
|
peak_rss_mb: 321,
|
|
55
|
+
in_flight_since: 8,
|
|
56
|
+
dispatch_payload: '{"request":"retained"}',
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
function rowsForThreadLookup(sql: string, args: unknown[]) {
|
|
@@ -117,6 +119,19 @@ describe("thread-debug-store", () => {
|
|
|
117
119
|
expect(result.threads[0]?.id).toBe(thread.id);
|
|
118
120
|
});
|
|
119
121
|
|
|
122
|
+
it("matches owner email from the main search query", async () => {
|
|
123
|
+
const result = await searchAgentThreads({ query: "owner@example.com" });
|
|
124
|
+
|
|
125
|
+
expect(result.threads).toHaveLength(1);
|
|
126
|
+
const searchRequest = mocks.currentExecute.mock.calls.find(
|
|
127
|
+
([request]) =>
|
|
128
|
+
typeof request?.sql === "string" &&
|
|
129
|
+
request.sql.includes("LOWER(owner_email) LIKE"),
|
|
130
|
+
)?.[0];
|
|
131
|
+
expect(searchRequest?.sql).toContain("LOWER(owner_email) LIKE");
|
|
132
|
+
expect(searchRequest?.args).toContain("%owner@example.com%");
|
|
133
|
+
});
|
|
134
|
+
|
|
120
135
|
it("resolves a run id and returns rich run diagnostics", async () => {
|
|
121
136
|
const result = await getAgentThreadDebug({ runId: run.id });
|
|
122
137
|
|
|
@@ -137,6 +152,8 @@ describe("thread-debug-store", () => {
|
|
|
137
152
|
workerStage: "model",
|
|
138
153
|
diagStage: '{"stage":"model"}',
|
|
139
154
|
peakRssMb: 321,
|
|
155
|
+
inFlightSince: 8,
|
|
156
|
+
hasDispatchPayload: true,
|
|
140
157
|
});
|
|
141
158
|
expect(
|
|
142
159
|
mocks.currentExecute.mock.calls.some(([request]) =>
|
|
@@ -79,6 +79,8 @@ interface AgentRunRow {
|
|
|
79
79
|
worker_stage?: string | null;
|
|
80
80
|
diag_stage?: string | null;
|
|
81
81
|
peak_rss_mb?: number | string | null;
|
|
82
|
+
in_flight_since?: number | string | null;
|
|
83
|
+
dispatch_payload?: string | null;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
const execCache = new Map<string, Promise<DbExec>>();
|
|
@@ -586,6 +588,11 @@ function serializeRun(row: AgentRunRow, events: any[] = []) {
|
|
|
586
588
|
workerStage: row.worker_stage ? String(row.worker_stage) : null,
|
|
587
589
|
diagStage: row.diag_stage ? String(row.diag_stage) : null,
|
|
588
590
|
peakRssMb: nullableNumberField(row.peak_rss_mb),
|
|
591
|
+
inFlightSince: nullableNumberField(row.in_flight_since),
|
|
592
|
+
hasDispatchPayload:
|
|
593
|
+
row.dispatch_payload !== null &&
|
|
594
|
+
row.dispatch_payload !== undefined &&
|
|
595
|
+
String(row.dispatch_payload).length > 0,
|
|
589
596
|
events,
|
|
590
597
|
};
|
|
591
598
|
}
|
|
@@ -906,11 +913,11 @@ export async function searchAgentThreads(input: {
|
|
|
906
913
|
? " OR id IN (" + runThreadIds.map(() => "?").join(", ") + ")"
|
|
907
914
|
: "";
|
|
908
915
|
where.push(
|
|
909
|
-
"(LOWER(title) LIKE ? ESCAPE '\\' OR LOWER(preview) LIKE ? ESCAPE '\\' OR LOWER(thread_data) LIKE ? ESCAPE '\\'" +
|
|
916
|
+
"(LOWER(title) LIKE ? ESCAPE '\\' OR LOWER(preview) LIKE ? ESCAPE '\\' OR LOWER(owner_email) LIKE ? ESCAPE '\\' OR LOWER(thread_data) LIKE ? ESCAPE '\\'" +
|
|
910
917
|
runIdClause +
|
|
911
918
|
")",
|
|
912
919
|
);
|
|
913
|
-
args.push(pattern, pattern, pattern);
|
|
920
|
+
args.push(pattern, pattern, pattern, pattern);
|
|
914
921
|
args.push(...runThreadIds);
|
|
915
922
|
}
|
|
916
923
|
args.push(limit);
|