@agent-native/dispatch 0.21.0 → 0.22.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.
Files changed (56) hide show
  1. package/dist/actions/get-agent-thread-debug.d.ts +2 -0
  2. package/dist/actions/provider-api-register.d.ts +8 -8
  3. package/dist/actions/search-agent-threads.js +2 -2
  4. package/dist/actions/search-agent-threads.js.map +1 -1
  5. package/dist/components/layout/HeaderActions.d.ts +1 -17
  6. package/dist/components/layout/HeaderActions.d.ts.map +1 -1
  7. package/dist/components/layout/HeaderActions.js +1 -51
  8. package/dist/components/layout/HeaderActions.js.map +1 -1
  9. package/dist/components/layout/Layout.d.ts.map +1 -1
  10. package/dist/components/layout/Layout.js +16 -14
  11. package/dist/components/layout/Layout.js.map +1 -1
  12. package/dist/components/ui/dialog.d.ts +1 -19
  13. package/dist/components/ui/dialog.d.ts.map +1 -1
  14. package/dist/components/ui/dialog.js +1 -22
  15. package/dist/components/ui/dialog.js.map +1 -1
  16. package/dist/components/ui/dropdown-menu.d.ts +1 -27
  17. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  18. package/dist/components/ui/dropdown-menu.js +1 -35
  19. package/dist/components/ui/dropdown-menu.js.map +1 -1
  20. package/dist/components/ui/popover.d.ts +2 -1
  21. package/dist/components/ui/popover.d.ts.map +1 -1
  22. package/dist/components/ui/popover.js +2 -1
  23. package/dist/components/ui/popover.js.map +1 -1
  24. package/dist/components/ui/select.d.ts +1 -13
  25. package/dist/components/ui/select.d.ts.map +1 -1
  26. package/dist/components/ui/select.js +1 -26
  27. package/dist/components/ui/select.js.map +1 -1
  28. package/dist/hooks/use-mobile.d.ts +1 -1
  29. package/dist/hooks/use-mobile.d.ts.map +1 -1
  30. package/dist/hooks/use-mobile.js +1 -15
  31. package/dist/hooks/use-mobile.js.map +1 -1
  32. package/dist/lib/automation-display.js +1 -1
  33. package/dist/lib/automation-display.js.map +1 -1
  34. package/dist/routes/pages/thread-debug.d.ts.map +1 -1
  35. package/dist/routes/pages/thread-debug.js +288 -118
  36. package/dist/routes/pages/thread-debug.js.map +1 -1
  37. package/dist/server/lib/thread-debug-store.d.ts +2 -0
  38. package/dist/server/lib/thread-debug-store.d.ts.map +1 -1
  39. package/dist/server/lib/thread-debug-store.js +6 -2
  40. package/dist/server/lib/thread-debug-store.js.map +1 -1
  41. package/package.json +3 -3
  42. package/src/actions/search-agent-threads.ts +2 -2
  43. package/src/components/layout/HeaderActions.tsx +1 -84
  44. package/src/components/layout/Layout.spec.tsx +19 -9
  45. package/src/components/layout/Layout.tsx +69 -71
  46. package/src/components/ui/dialog.tsx +1 -120
  47. package/src/components/ui/dropdown-menu.tsx +1 -198
  48. package/src/components/ui/popover.tsx +3 -1
  49. package/src/components/ui/select.tsx +1 -158
  50. package/src/hooks/use-mobile.tsx +1 -21
  51. package/src/lib/automation-display.spec.ts +1 -1
  52. package/src/lib/automation-display.ts +1 -1
  53. package/src/routes/pages/thread-debug.spec.tsx +103 -5
  54. package/src/routes/pages/thread-debug.tsx +1051 -451
  55. package/src/server/lib/thread-debug-store.spec.ts +17 -0
  56. 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);