pulseed 0.6.4 → 0.6.5

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 (228) hide show
  1. package/dist/adapters/datasources/artifact-metric-datasource.js +18 -1
  2. package/dist/adapters/datasources/artifact-metric-datasource.js.map +1 -1
  3. package/dist/base/config/global-config.d.ts +3 -0
  4. package/dist/base/config/global-config.d.ts.map +1 -1
  5. package/dist/base/config/global-config.js +3 -1
  6. package/dist/base/config/global-config.js.map +1 -1
  7. package/dist/base/utils/paths.d.ts +5 -0
  8. package/dist/base/utils/paths.d.ts.map +1 -1
  9. package/dist/base/utils/paths.js +7 -0
  10. package/dist/base/utils/paths.js.map +1 -1
  11. package/dist/base/utils/workspace-root.d.ts +6 -0
  12. package/dist/base/utils/workspace-root.d.ts.map +1 -0
  13. package/dist/base/utils/workspace-root.js +87 -0
  14. package/dist/base/utils/workspace-root.js.map +1 -0
  15. package/dist/interface/chat/chat-runner-commands.d.ts +2 -0
  16. package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -1
  17. package/dist/interface/chat/chat-runner-commands.js +61 -4
  18. package/dist/interface/chat/chat-runner-commands.js.map +1 -1
  19. package/dist/interface/chat/freeform-route-classifier.d.ts +2 -2
  20. package/dist/interface/cli/cli-runner.js +0 -0
  21. package/dist/interface/cli/commands/daemon-shared.d.ts +4 -1
  22. package/dist/interface/cli/commands/daemon-shared.d.ts.map +1 -1
  23. package/dist/interface/cli/commands/daemon-shared.js +9 -3
  24. package/dist/interface/cli/commands/daemon-shared.js.map +1 -1
  25. package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
  26. package/dist/interface/cli/commands/daemon.js +61 -7
  27. package/dist/interface/cli/commands/daemon.js.map +1 -1
  28. package/dist/interface/cli/commands/doctor.d.ts +1 -1
  29. package/dist/interface/cli/commands/doctor.d.ts.map +1 -1
  30. package/dist/interface/cli/commands/doctor.js +48 -29
  31. package/dist/interface/cli/commands/doctor.js.map +1 -1
  32. package/dist/orchestrator/execution/adapter-layer.d.ts +5 -1
  33. package/dist/orchestrator/execution/adapter-layer.d.ts.map +1 -1
  34. package/dist/orchestrator/execution/adapter-layer.js.map +1 -1
  35. package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.d.ts.map +1 -1
  36. package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.js +18 -1
  37. package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.js.map +1 -1
  38. package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.d.ts.map +1 -1
  39. package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js +1 -0
  40. package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js.map +1 -1
  41. package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts +2 -0
  42. package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts.map +1 -1
  43. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts +2 -0
  44. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts.map +1 -1
  45. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js +41 -2
  46. package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js.map +1 -1
  47. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.d.ts.map +1 -1
  48. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.js +1 -0
  49. package/dist/orchestrator/execution/agent-loop/response-item-tool-router.js.map +1 -1
  50. package/dist/orchestrator/execution/agent-loop/response-item.d.ts +36 -36
  51. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.d.ts.map +1 -1
  52. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.js +13 -0
  53. package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.js.map +1 -1
  54. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts +27 -14
  55. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts.map +1 -1
  56. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.js +67 -8
  57. package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.js.map +1 -1
  58. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.d.ts.map +1 -1
  59. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.js +1 -0
  60. package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.js.map +1 -1
  61. package/dist/orchestrator/execution/task/task-artifact-contract.js +27 -4
  62. package/dist/orchestrator/execution/task/task-artifact-contract.js.map +1 -1
  63. package/dist/orchestrator/execution/task/task-diff-capture.d.ts +1 -0
  64. package/dist/orchestrator/execution/task/task-diff-capture.d.ts.map +1 -1
  65. package/dist/orchestrator/execution/task/task-diff-capture.js +10 -9
  66. package/dist/orchestrator/execution/task/task-diff-capture.js.map +1 -1
  67. package/dist/orchestrator/execution/task/task-execution-types.d.ts +2 -0
  68. package/dist/orchestrator/execution/task/task-execution-types.d.ts.map +1 -1
  69. package/dist/orchestrator/execution/task/task-execution-types.js.map +1 -1
  70. package/dist/orchestrator/execution/task/task-executor.d.ts.map +1 -1
  71. package/dist/orchestrator/execution/task/task-executor.js +1 -0
  72. package/dist/orchestrator/execution/task/task-executor.js.map +1 -1
  73. package/dist/orchestrator/execution/task/task-generation.d.ts +8 -1
  74. package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
  75. package/dist/orchestrator/execution/task/task-generation.js +12 -11
  76. package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
  77. package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts.map +1 -1
  78. package/dist/orchestrator/execution/task/task-lifecycle-runner.js +1 -0
  79. package/dist/orchestrator/execution/task/task-lifecycle-runner.js.map +1 -1
  80. package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
  81. package/dist/orchestrator/execution/task/task-lifecycle.js +59 -1
  82. package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
  83. package/dist/orchestrator/execution/task/task-outcome-ledger.d.ts +1 -0
  84. package/dist/orchestrator/execution/task/task-outcome-ledger.d.ts.map +1 -1
  85. package/dist/orchestrator/execution/task/task-outcome-ledger.js +5 -0
  86. package/dist/orchestrator/execution/task/task-outcome-ledger.js.map +1 -1
  87. package/dist/orchestrator/execution/task/task-prompt-builder.d.ts.map +1 -1
  88. package/dist/orchestrator/execution/task/task-prompt-builder.js +7 -3
  89. package/dist/orchestrator/execution/task/task-prompt-builder.js.map +1 -1
  90. package/dist/orchestrator/execution/task/task-verifier-rules.d.ts.map +1 -1
  91. package/dist/orchestrator/execution/task/task-verifier-rules.js +59 -10
  92. package/dist/orchestrator/execution/task/task-verifier-rules.js.map +1 -1
  93. package/dist/orchestrator/execution/task/task-verifier-types.d.ts +1 -1
  94. package/dist/orchestrator/execution/task/task-verifier-types.d.ts.map +1 -1
  95. package/dist/orchestrator/execution/task/task-verifier.d.ts.map +1 -1
  96. package/dist/orchestrator/execution/task/task-verifier.js +173 -9
  97. package/dist/orchestrator/execution/task/task-verifier.js.map +1 -1
  98. package/dist/orchestrator/execution/types/task-group.d.ts +9 -0
  99. package/dist/orchestrator/execution/types/task-group.d.ts.map +1 -1
  100. package/dist/orchestrator/execution/types/task.d.ts +38 -0
  101. package/dist/orchestrator/execution/types/task.d.ts.map +1 -1
  102. package/dist/orchestrator/execution/types/task.js +6 -0
  103. package/dist/orchestrator/execution/types/task.js.map +1 -1
  104. package/dist/orchestrator/loop/durable-loop/contracts.d.ts +2 -0
  105. package/dist/orchestrator/loop/durable-loop/contracts.d.ts.map +1 -1
  106. package/dist/orchestrator/loop/durable-loop/contracts.js.map +1 -1
  107. package/dist/orchestrator/loop/durable-loop/phase-specs.d.ts +12 -12
  108. package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
  109. package/dist/orchestrator/loop/loop-report-helper.js +2 -0
  110. package/dist/orchestrator/loop/loop-report-helper.js.map +1 -1
  111. package/dist/platform/corrections/memory-quarantine.d.ts +2 -2
  112. package/dist/platform/dream/playbook-memory.d.ts +4 -4
  113. package/dist/platform/knowledge/types/agent-memory.d.ts +16 -16
  114. package/dist/platform/soil/contracts.d.ts +2 -2
  115. package/dist/prompt/purposes/verification.d.ts +2 -2
  116. package/dist/reporting/report-formatters.d.ts.map +1 -1
  117. package/dist/reporting/report-formatters.js +26 -1
  118. package/dist/reporting/report-formatters.js.map +1 -1
  119. package/dist/reporting/reporting-engine.d.ts.map +1 -1
  120. package/dist/reporting/reporting-engine.js +1 -0
  121. package/dist/reporting/reporting-engine.js.map +1 -1
  122. package/dist/reporting/reporting-types.d.ts +7 -0
  123. package/dist/reporting/reporting-types.d.ts.map +1 -1
  124. package/dist/reporting/types/report.d.ts +5 -0
  125. package/dist/reporting/types/report.d.ts.map +1 -1
  126. package/dist/reporting/types/report.js +1 -0
  127. package/dist/reporting/types/report.js.map +1 -1
  128. package/dist/runtime/control/runtime-control-service.d.ts +25 -0
  129. package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
  130. package/dist/runtime/control/runtime-control-service.js +172 -0
  131. package/dist/runtime/control/runtime-control-service.js.map +1 -1
  132. package/dist/runtime/daemon/browser-backpressure-policy.d.ts +22 -0
  133. package/dist/runtime/daemon/browser-backpressure-policy.d.ts.map +1 -0
  134. package/dist/runtime/daemon/browser-backpressure-policy.js +95 -0
  135. package/dist/runtime/daemon/browser-backpressure-policy.js.map +1 -0
  136. package/dist/runtime/daemon/client.d.ts +1 -0
  137. package/dist/runtime/daemon/client.d.ts.map +1 -1
  138. package/dist/runtime/daemon/client.js.map +1 -1
  139. package/dist/runtime/daemon/runner.d.ts.map +1 -1
  140. package/dist/runtime/daemon/runner.js +10 -1
  141. package/dist/runtime/daemon/runner.js.map +1 -1
  142. package/dist/runtime/daemon/runtime-ownership.d.ts +7 -0
  143. package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -1
  144. package/dist/runtime/daemon/runtime-ownership.js +153 -7
  145. package/dist/runtime/daemon/runtime-ownership.js.map +1 -1
  146. package/dist/runtime/event/server-snapshot-reader.d.ts +3 -1
  147. package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -1
  148. package/dist/runtime/event/server-snapshot-reader.js +68 -2
  149. package/dist/runtime/event/server-snapshot-reader.js.map +1 -1
  150. package/dist/runtime/event/server-types.d.ts +2 -0
  151. package/dist/runtime/event/server-types.d.ts.map +1 -1
  152. package/dist/runtime/interactive-automation/browser-session-resolver.d.ts +26 -0
  153. package/dist/runtime/interactive-automation/browser-session-resolver.d.ts.map +1 -0
  154. package/dist/runtime/interactive-automation/browser-session-resolver.js +75 -0
  155. package/dist/runtime/interactive-automation/browser-session-resolver.js.map +1 -0
  156. package/dist/runtime/interactive-automation/index.d.ts +2 -0
  157. package/dist/runtime/interactive-automation/index.d.ts.map +1 -1
  158. package/dist/runtime/interactive-automation/index.js +2 -0
  159. package/dist/runtime/interactive-automation/index.js.map +1 -1
  160. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.d.ts +35 -0
  161. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.d.ts.map +1 -0
  162. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.js +125 -0
  163. package/dist/runtime/interactive-automation/runtime-auth-handoff-store.js.map +1 -0
  164. package/dist/runtime/run-spec/handoff.d.ts.map +1 -1
  165. package/dist/runtime/run-spec/handoff.js +31 -0
  166. package/dist/runtime/run-spec/handoff.js.map +1 -1
  167. package/dist/runtime/store/evidence-types.d.ts +136 -136
  168. package/dist/runtime/store/index.d.ts +2 -2
  169. package/dist/runtime/store/index.d.ts.map +1 -1
  170. package/dist/runtime/store/index.js +1 -1
  171. package/dist/runtime/store/index.js.map +1 -1
  172. package/dist/runtime/store/operator-handoff-store.d.ts +3 -3
  173. package/dist/runtime/store/runtime-operation-schemas.d.ts +101 -68
  174. package/dist/runtime/store/runtime-operation-schemas.d.ts.map +1 -1
  175. package/dist/runtime/store/runtime-operation-schemas.js +8 -0
  176. package/dist/runtime/store/runtime-operation-schemas.js.map +1 -1
  177. package/dist/runtime/store/runtime-paths.d.ts +2 -0
  178. package/dist/runtime/store/runtime-paths.d.ts.map +1 -1
  179. package/dist/runtime/store/runtime-paths.js +6 -0
  180. package/dist/runtime/store/runtime-paths.js.map +1 -1
  181. package/dist/runtime/store/runtime-schemas.d.ts +2200 -20
  182. package/dist/runtime/store/runtime-schemas.d.ts.map +1 -1
  183. package/dist/runtime/store/runtime-schemas.js +84 -0
  184. package/dist/runtime/store/runtime-schemas.js.map +1 -1
  185. package/dist/runtime/types/companion.d.ts +52 -52
  186. package/dist/runtime/types/daemon.d.ts +31 -31
  187. package/dist/tools/automation/InteractiveAutomationTools.d.ts +22 -2
  188. package/dist/tools/automation/InteractiveAutomationTools.d.ts.map +1 -1
  189. package/dist/tools/automation/InteractiveAutomationTools.js +75 -10
  190. package/dist/tools/automation/InteractiveAutomationTools.js.map +1 -1
  191. package/dist/tools/builtin/factory.d.ts +2 -1
  192. package/dist/tools/builtin/factory.d.ts.map +1 -1
  193. package/dist/tools/builtin/factory.js +6 -2
  194. package/dist/tools/builtin/factory.js.map +1 -1
  195. package/dist/tools/execution/MemorySaveTool/MemorySaveTool.d.ts +12 -12
  196. package/dist/tools/kaggle/KaggleExperimentTools.js +4 -3
  197. package/dist/tools/kaggle/KaggleExperimentTools.js.map +1 -1
  198. package/dist/tools/kaggle/KaggleSubmissionTools.js +6 -5
  199. package/dist/tools/kaggle/KaggleSubmissionTools.js.map +1 -1
  200. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js +6 -5
  201. package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js.map +1 -1
  202. package/dist/tools/kaggle/paths.d.ts.map +1 -1
  203. package/dist/tools/kaggle/paths.js +12 -8
  204. package/dist/tools/kaggle/paths.js.map +1 -1
  205. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts +2 -2
  206. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts.map +1 -1
  207. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js +49 -7
  208. package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
  209. package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +12 -12
  210. package/dist/tools/system/EnvTool/EnvTool.d.ts +4 -4
  211. package/dist/tools/system/GitLogTool/GitLogTool.d.ts +4 -4
  212. package/dist/tools/system/ShellCommandTool/ShellCommandTool.js +1 -1
  213. package/dist/tools/system/ShellCommandTool/ShellCommandTool.js.map +1 -1
  214. package/dist/tools/system/ShellTool/ShellTool.d.ts.map +1 -1
  215. package/dist/tools/system/ShellTool/ShellTool.js +6 -2
  216. package/dist/tools/system/ShellTool/ShellTool.js.map +1 -1
  217. package/dist/tools/system/ShellTool/command-policy.d.ts +1 -0
  218. package/dist/tools/system/ShellTool/command-policy.d.ts.map +1 -1
  219. package/dist/tools/system/ShellTool/command-policy.js +10 -0
  220. package/dist/tools/system/ShellTool/command-policy.js.map +1 -1
  221. package/dist/tools/system/ShellTool/prompt.d.ts +1 -1
  222. package/dist/tools/system/ShellTool/prompt.d.ts.map +1 -1
  223. package/dist/tools/system/ShellTool/prompt.js +1 -1
  224. package/dist/tools/system/ShellTool/prompt.js.map +1 -1
  225. package/dist/tools/types.d.ts +2 -0
  226. package/dist/tools/types.d.ts.map +1 -1
  227. package/dist/tools/types.js.map +1 -1
  228. package/package.json +2 -2
@@ -174,9 +174,9 @@ export declare const RuntimeSafePauseRecordSchema: z.ZodObject<{
174
174
  completed_at?: string | undefined;
175
175
  reason?: string | undefined;
176
176
  requested_at?: string | undefined;
177
+ requested_by?: string | undefined;
177
178
  paused_at?: string | undefined;
178
179
  resumed_at?: string | undefined;
179
- requested_by?: string | undefined;
180
180
  checkpoint?: {
181
181
  artifact_refs: string[];
182
182
  checkpoint_id: string;
@@ -198,9 +198,9 @@ export declare const RuntimeSafePauseRecordSchema: z.ZodObject<{
198
198
  completed_at?: string | undefined;
199
199
  reason?: string | undefined;
200
200
  requested_at?: string | undefined;
201
+ requested_by?: string | undefined;
201
202
  paused_at?: string | undefined;
202
203
  resumed_at?: string | undefined;
203
- requested_by?: string | undefined;
204
204
  checkpoint?: {
205
205
  artifact_refs: string[];
206
206
  checkpoint_id: string;
@@ -252,19 +252,19 @@ export declare const ApprovalOriginSchema: z.ZodObject<{
252
252
  turn_id: z.ZodOptional<z.ZodString>;
253
253
  reply_target: z.ZodOptional<z.ZodUnknown>;
254
254
  }, "strip", z.ZodTypeAny, {
255
- channel: string;
256
255
  conversation_id: string;
256
+ channel: string;
257
257
  session_id?: string | undefined;
258
258
  user_id?: string | undefined;
259
- turn_id?: string | undefined;
260
259
  reply_target?: unknown;
260
+ turn_id?: string | undefined;
261
261
  }, {
262
- channel: string;
263
262
  conversation_id: string;
263
+ channel: string;
264
264
  session_id?: string | undefined;
265
265
  user_id?: string | undefined;
266
- turn_id?: string | undefined;
267
266
  reply_target?: unknown;
267
+ turn_id?: string | undefined;
268
268
  }>;
269
269
  export type ApprovalOrigin = z.infer<typeof ApprovalOriginSchema>;
270
270
  export declare const ApprovalRecordSchema: z.ZodObject<{
@@ -285,59 +285,59 @@ export declare const ApprovalRecordSchema: z.ZodObject<{
285
285
  turn_id: z.ZodOptional<z.ZodString>;
286
286
  reply_target: z.ZodOptional<z.ZodUnknown>;
287
287
  }, "strip", z.ZodTypeAny, {
288
- channel: string;
289
288
  conversation_id: string;
289
+ channel: string;
290
290
  session_id?: string | undefined;
291
291
  user_id?: string | undefined;
292
- turn_id?: string | undefined;
293
292
  reply_target?: unknown;
293
+ turn_id?: string | undefined;
294
294
  }, {
295
- channel: string;
296
295
  conversation_id: string;
296
+ channel: string;
297
297
  session_id?: string | undefined;
298
298
  user_id?: string | undefined;
299
- turn_id?: string | undefined;
300
299
  reply_target?: unknown;
300
+ turn_id?: string | undefined;
301
301
  }>>;
302
302
  payload: z.ZodUnknown;
303
303
  }, "strip", z.ZodTypeAny, {
304
304
  created_at: number;
305
305
  state: "pending" | "cancelled" | "expired" | "approved" | "denied";
306
- correlation_id: string;
307
306
  approval_id: string;
307
+ correlation_id: string;
308
308
  request_envelope_id: string;
309
309
  expires_at: number;
310
310
  origin?: {
311
- channel: string;
312
311
  conversation_id: string;
312
+ channel: string;
313
313
  session_id?: string | undefined;
314
314
  user_id?: string | undefined;
315
- turn_id?: string | undefined;
316
315
  reply_target?: unknown;
316
+ turn_id?: string | undefined;
317
317
  } | undefined;
318
318
  goal_id?: string | undefined;
319
+ response_channel?: string | undefined;
319
320
  payload?: unknown;
320
321
  resolved_at?: number | undefined;
321
- response_channel?: string | undefined;
322
322
  }, {
323
323
  created_at: number;
324
324
  state: "pending" | "cancelled" | "expired" | "approved" | "denied";
325
- correlation_id: string;
326
325
  approval_id: string;
326
+ correlation_id: string;
327
327
  request_envelope_id: string;
328
328
  expires_at: number;
329
329
  origin?: {
330
- channel: string;
331
330
  conversation_id: string;
331
+ channel: string;
332
332
  session_id?: string | undefined;
333
333
  user_id?: string | undefined;
334
- turn_id?: string | undefined;
335
334
  reply_target?: unknown;
335
+ turn_id?: string | undefined;
336
336
  } | undefined;
337
337
  goal_id?: string | undefined;
338
+ response_channel?: string | undefined;
338
339
  payload?: unknown;
339
340
  resolved_at?: number | undefined;
340
- response_channel?: string | undefined;
341
341
  }>;
342
342
  export type ApprovalRecord = z.infer<typeof ApprovalRecordSchema>;
343
343
  export declare const OutboxRecordSchema: z.ZodObject<{
@@ -513,16 +513,28 @@ export declare const RuntimeLongRunHealthSignalsSchema: z.ZodObject<{
513
513
  reason: z.ZodOptional<z.ZodString>;
514
514
  } & {
515
515
  status: z.ZodEnum<["none", "approval_wait", "auth_wait", "operator_wait", "resource_pressure", "blocked", "unknown"]>;
516
+ active_goal_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
517
+ pending_approval_count: z.ZodOptional<z.ZodNumber>;
518
+ goal_scoped_pending_approval_count: z.ZodOptional<z.ZodNumber>;
519
+ unrelated_pending_approval_count: z.ZodOptional<z.ZodNumber>;
516
520
  }, "strip", z.ZodTypeAny, {
517
521
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
518
522
  checked_at: number;
519
523
  reason?: string | undefined;
520
524
  observed_at?: number | undefined;
525
+ active_goal_ids?: string[] | undefined;
526
+ pending_approval_count?: number | undefined;
527
+ goal_scoped_pending_approval_count?: number | undefined;
528
+ unrelated_pending_approval_count?: number | undefined;
521
529
  }, {
522
530
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
523
531
  checked_at: number;
524
532
  reason?: string | undefined;
525
533
  observed_at?: number | undefined;
534
+ active_goal_ids?: string[] | undefined;
535
+ pending_approval_count?: number | undefined;
536
+ goal_scoped_pending_approval_count?: number | undefined;
537
+ unrelated_pending_approval_count?: number | undefined;
526
538
  }>;
527
539
  expected_next_checkpoint_at: z.ZodOptional<z.ZodNumber>;
528
540
  resumable: z.ZodOptional<z.ZodBoolean>;
@@ -577,6 +589,10 @@ export declare const RuntimeLongRunHealthSignalsSchema: z.ZodObject<{
577
589
  checked_at: number;
578
590
  reason?: string | undefined;
579
591
  observed_at?: number | undefined;
592
+ active_goal_ids?: string[] | undefined;
593
+ pending_approval_count?: number | undefined;
594
+ goal_scoped_pending_approval_count?: number | undefined;
595
+ unrelated_pending_approval_count?: number | undefined;
580
596
  };
581
597
  expected_next_checkpoint_at?: number | undefined;
582
598
  resumable?: boolean | undefined;
@@ -631,6 +647,10 @@ export declare const RuntimeLongRunHealthSignalsSchema: z.ZodObject<{
631
647
  checked_at: number;
632
648
  reason?: string | undefined;
633
649
  observed_at?: number | undefined;
650
+ active_goal_ids?: string[] | undefined;
651
+ pending_approval_count?: number | undefined;
652
+ goal_scoped_pending_approval_count?: number | undefined;
653
+ unrelated_pending_approval_count?: number | undefined;
634
654
  };
635
655
  expected_next_checkpoint_at?: number | undefined;
636
656
  resumable?: boolean | undefined;
@@ -775,16 +795,28 @@ export declare const RuntimeLongRunHealthSchema: z.ZodObject<{
775
795
  reason: z.ZodOptional<z.ZodString>;
776
796
  } & {
777
797
  status: z.ZodEnum<["none", "approval_wait", "auth_wait", "operator_wait", "resource_pressure", "blocked", "unknown"]>;
798
+ active_goal_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
799
+ pending_approval_count: z.ZodOptional<z.ZodNumber>;
800
+ goal_scoped_pending_approval_count: z.ZodOptional<z.ZodNumber>;
801
+ unrelated_pending_approval_count: z.ZodOptional<z.ZodNumber>;
778
802
  }, "strip", z.ZodTypeAny, {
779
803
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
780
804
  checked_at: number;
781
805
  reason?: string | undefined;
782
806
  observed_at?: number | undefined;
807
+ active_goal_ids?: string[] | undefined;
808
+ pending_approval_count?: number | undefined;
809
+ goal_scoped_pending_approval_count?: number | undefined;
810
+ unrelated_pending_approval_count?: number | undefined;
783
811
  }, {
784
812
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
785
813
  checked_at: number;
786
814
  reason?: string | undefined;
787
815
  observed_at?: number | undefined;
816
+ active_goal_ids?: string[] | undefined;
817
+ pending_approval_count?: number | undefined;
818
+ goal_scoped_pending_approval_count?: number | undefined;
819
+ unrelated_pending_approval_count?: number | undefined;
788
820
  }>;
789
821
  expected_next_checkpoint_at: z.ZodOptional<z.ZodNumber>;
790
822
  resumable: z.ZodOptional<z.ZodBoolean>;
@@ -839,6 +871,10 @@ export declare const RuntimeLongRunHealthSchema: z.ZodObject<{
839
871
  checked_at: number;
840
872
  reason?: string | undefined;
841
873
  observed_at?: number | undefined;
874
+ active_goal_ids?: string[] | undefined;
875
+ pending_approval_count?: number | undefined;
876
+ goal_scoped_pending_approval_count?: number | undefined;
877
+ unrelated_pending_approval_count?: number | undefined;
842
878
  };
843
879
  expected_next_checkpoint_at?: number | undefined;
844
880
  resumable?: boolean | undefined;
@@ -893,6 +929,10 @@ export declare const RuntimeLongRunHealthSchema: z.ZodObject<{
893
929
  checked_at: number;
894
930
  reason?: string | undefined;
895
931
  observed_at?: number | undefined;
932
+ active_goal_ids?: string[] | undefined;
933
+ pending_approval_count?: number | undefined;
934
+ goal_scoped_pending_approval_count?: number | undefined;
935
+ unrelated_pending_approval_count?: number | undefined;
896
936
  };
897
937
  expected_next_checkpoint_at?: number | undefined;
898
938
  resumable?: boolean | undefined;
@@ -951,6 +991,10 @@ export declare const RuntimeLongRunHealthSchema: z.ZodObject<{
951
991
  checked_at: number;
952
992
  reason?: string | undefined;
953
993
  observed_at?: number | undefined;
994
+ active_goal_ids?: string[] | undefined;
995
+ pending_approval_count?: number | undefined;
996
+ goal_scoped_pending_approval_count?: number | undefined;
997
+ unrelated_pending_approval_count?: number | undefined;
954
998
  };
955
999
  expected_next_checkpoint_at?: number | undefined;
956
1000
  resumable?: boolean | undefined;
@@ -1009,6 +1053,10 @@ export declare const RuntimeLongRunHealthSchema: z.ZodObject<{
1009
1053
  checked_at: number;
1010
1054
  reason?: string | undefined;
1011
1055
  observed_at?: number | undefined;
1056
+ active_goal_ids?: string[] | undefined;
1057
+ pending_approval_count?: number | undefined;
1058
+ goal_scoped_pending_approval_count?: number | undefined;
1059
+ unrelated_pending_approval_count?: number | undefined;
1012
1060
  };
1013
1061
  expected_next_checkpoint_at?: number | undefined;
1014
1062
  resumable?: boolean | undefined;
@@ -1443,16 +1491,28 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1443
1491
  reason: z.ZodOptional<z.ZodString>;
1444
1492
  } & {
1445
1493
  status: z.ZodEnum<["none", "approval_wait", "auth_wait", "operator_wait", "resource_pressure", "blocked", "unknown"]>;
1494
+ active_goal_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1495
+ pending_approval_count: z.ZodOptional<z.ZodNumber>;
1496
+ goal_scoped_pending_approval_count: z.ZodOptional<z.ZodNumber>;
1497
+ unrelated_pending_approval_count: z.ZodOptional<z.ZodNumber>;
1446
1498
  }, "strip", z.ZodTypeAny, {
1447
1499
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
1448
1500
  checked_at: number;
1449
1501
  reason?: string | undefined;
1450
1502
  observed_at?: number | undefined;
1503
+ active_goal_ids?: string[] | undefined;
1504
+ pending_approval_count?: number | undefined;
1505
+ goal_scoped_pending_approval_count?: number | undefined;
1506
+ unrelated_pending_approval_count?: number | undefined;
1451
1507
  }, {
1452
1508
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
1453
1509
  checked_at: number;
1454
1510
  reason?: string | undefined;
1455
1511
  observed_at?: number | undefined;
1512
+ active_goal_ids?: string[] | undefined;
1513
+ pending_approval_count?: number | undefined;
1514
+ goal_scoped_pending_approval_count?: number | undefined;
1515
+ unrelated_pending_approval_count?: number | undefined;
1456
1516
  }>;
1457
1517
  expected_next_checkpoint_at: z.ZodOptional<z.ZodNumber>;
1458
1518
  resumable: z.ZodOptional<z.ZodBoolean>;
@@ -1507,6 +1567,10 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1507
1567
  checked_at: number;
1508
1568
  reason?: string | undefined;
1509
1569
  observed_at?: number | undefined;
1570
+ active_goal_ids?: string[] | undefined;
1571
+ pending_approval_count?: number | undefined;
1572
+ goal_scoped_pending_approval_count?: number | undefined;
1573
+ unrelated_pending_approval_count?: number | undefined;
1510
1574
  };
1511
1575
  expected_next_checkpoint_at?: number | undefined;
1512
1576
  resumable?: boolean | undefined;
@@ -1561,6 +1625,10 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1561
1625
  checked_at: number;
1562
1626
  reason?: string | undefined;
1563
1627
  observed_at?: number | undefined;
1628
+ active_goal_ids?: string[] | undefined;
1629
+ pending_approval_count?: number | undefined;
1630
+ goal_scoped_pending_approval_count?: number | undefined;
1631
+ unrelated_pending_approval_count?: number | undefined;
1564
1632
  };
1565
1633
  expected_next_checkpoint_at?: number | undefined;
1566
1634
  resumable?: boolean | undefined;
@@ -1619,6 +1687,10 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1619
1687
  checked_at: number;
1620
1688
  reason?: string | undefined;
1621
1689
  observed_at?: number | undefined;
1690
+ active_goal_ids?: string[] | undefined;
1691
+ pending_approval_count?: number | undefined;
1692
+ goal_scoped_pending_approval_count?: number | undefined;
1693
+ unrelated_pending_approval_count?: number | undefined;
1622
1694
  };
1623
1695
  expected_next_checkpoint_at?: number | undefined;
1624
1696
  resumable?: boolean | undefined;
@@ -1677,6 +1749,10 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1677
1749
  checked_at: number;
1678
1750
  reason?: string | undefined;
1679
1751
  observed_at?: number | undefined;
1752
+ active_goal_ids?: string[] | undefined;
1753
+ pending_approval_count?: number | undefined;
1754
+ goal_scoped_pending_approval_count?: number | undefined;
1755
+ unrelated_pending_approval_count?: number | undefined;
1680
1756
  };
1681
1757
  expected_next_checkpoint_at?: number | undefined;
1682
1758
  resumable?: boolean | undefined;
@@ -1770,6 +1846,10 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1770
1846
  checked_at: number;
1771
1847
  reason?: string | undefined;
1772
1848
  observed_at?: number | undefined;
1849
+ active_goal_ids?: string[] | undefined;
1850
+ pending_approval_count?: number | undefined;
1851
+ goal_scoped_pending_approval_count?: number | undefined;
1852
+ unrelated_pending_approval_count?: number | undefined;
1773
1853
  };
1774
1854
  expected_next_checkpoint_at?: number | undefined;
1775
1855
  resumable?: boolean | undefined;
@@ -1862,6 +1942,10 @@ export declare const RuntimeDaemonHealthSchema: z.ZodObject<{
1862
1942
  checked_at: number;
1863
1943
  reason?: string | undefined;
1864
1944
  observed_at?: number | undefined;
1945
+ active_goal_ids?: string[] | undefined;
1946
+ pending_approval_count?: number | undefined;
1947
+ goal_scoped_pending_approval_count?: number | undefined;
1948
+ unrelated_pending_approval_count?: number | undefined;
1865
1949
  };
1866
1950
  expected_next_checkpoint_at?: number | undefined;
1867
1951
  resumable?: boolean | undefined;
@@ -2148,16 +2232,28 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2148
2232
  reason: z.ZodOptional<z.ZodString>;
2149
2233
  } & {
2150
2234
  status: z.ZodEnum<["none", "approval_wait", "auth_wait", "operator_wait", "resource_pressure", "blocked", "unknown"]>;
2235
+ active_goal_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2236
+ pending_approval_count: z.ZodOptional<z.ZodNumber>;
2237
+ goal_scoped_pending_approval_count: z.ZodOptional<z.ZodNumber>;
2238
+ unrelated_pending_approval_count: z.ZodOptional<z.ZodNumber>;
2151
2239
  }, "strip", z.ZodTypeAny, {
2152
2240
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
2153
2241
  checked_at: number;
2154
2242
  reason?: string | undefined;
2155
2243
  observed_at?: number | undefined;
2244
+ active_goal_ids?: string[] | undefined;
2245
+ pending_approval_count?: number | undefined;
2246
+ goal_scoped_pending_approval_count?: number | undefined;
2247
+ unrelated_pending_approval_count?: number | undefined;
2156
2248
  }, {
2157
2249
  status: "unknown" | "blocked" | "none" | "approval_wait" | "auth_wait" | "operator_wait" | "resource_pressure";
2158
2250
  checked_at: number;
2159
2251
  reason?: string | undefined;
2160
2252
  observed_at?: number | undefined;
2253
+ active_goal_ids?: string[] | undefined;
2254
+ pending_approval_count?: number | undefined;
2255
+ goal_scoped_pending_approval_count?: number | undefined;
2256
+ unrelated_pending_approval_count?: number | undefined;
2161
2257
  }>;
2162
2258
  expected_next_checkpoint_at: z.ZodOptional<z.ZodNumber>;
2163
2259
  resumable: z.ZodOptional<z.ZodBoolean>;
@@ -2212,6 +2308,10 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2212
2308
  checked_at: number;
2213
2309
  reason?: string | undefined;
2214
2310
  observed_at?: number | undefined;
2311
+ active_goal_ids?: string[] | undefined;
2312
+ pending_approval_count?: number | undefined;
2313
+ goal_scoped_pending_approval_count?: number | undefined;
2314
+ unrelated_pending_approval_count?: number | undefined;
2215
2315
  };
2216
2316
  expected_next_checkpoint_at?: number | undefined;
2217
2317
  resumable?: boolean | undefined;
@@ -2266,6 +2366,10 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2266
2366
  checked_at: number;
2267
2367
  reason?: string | undefined;
2268
2368
  observed_at?: number | undefined;
2369
+ active_goal_ids?: string[] | undefined;
2370
+ pending_approval_count?: number | undefined;
2371
+ goal_scoped_pending_approval_count?: number | undefined;
2372
+ unrelated_pending_approval_count?: number | undefined;
2269
2373
  };
2270
2374
  expected_next_checkpoint_at?: number | undefined;
2271
2375
  resumable?: boolean | undefined;
@@ -2324,6 +2428,10 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2324
2428
  checked_at: number;
2325
2429
  reason?: string | undefined;
2326
2430
  observed_at?: number | undefined;
2431
+ active_goal_ids?: string[] | undefined;
2432
+ pending_approval_count?: number | undefined;
2433
+ goal_scoped_pending_approval_count?: number | undefined;
2434
+ unrelated_pending_approval_count?: number | undefined;
2327
2435
  };
2328
2436
  expected_next_checkpoint_at?: number | undefined;
2329
2437
  resumable?: boolean | undefined;
@@ -2382,6 +2490,10 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2382
2490
  checked_at: number;
2383
2491
  reason?: string | undefined;
2384
2492
  observed_at?: number | undefined;
2493
+ active_goal_ids?: string[] | undefined;
2494
+ pending_approval_count?: number | undefined;
2495
+ goal_scoped_pending_approval_count?: number | undefined;
2496
+ unrelated_pending_approval_count?: number | undefined;
2385
2497
  };
2386
2498
  expected_next_checkpoint_at?: number | undefined;
2387
2499
  resumable?: boolean | undefined;
@@ -2476,6 +2588,10 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2476
2588
  checked_at: number;
2477
2589
  reason?: string | undefined;
2478
2590
  observed_at?: number | undefined;
2591
+ active_goal_ids?: string[] | undefined;
2592
+ pending_approval_count?: number | undefined;
2593
+ goal_scoped_pending_approval_count?: number | undefined;
2594
+ unrelated_pending_approval_count?: number | undefined;
2479
2595
  };
2480
2596
  expected_next_checkpoint_at?: number | undefined;
2481
2597
  resumable?: boolean | undefined;
@@ -2569,6 +2685,10 @@ export declare const RuntimeHealthSnapshotSchema: z.ZodObject<{
2569
2685
  checked_at: number;
2570
2686
  reason?: string | undefined;
2571
2687
  observed_at?: number | undefined;
2688
+ active_goal_ids?: string[] | undefined;
2689
+ pending_approval_count?: number | undefined;
2690
+ goal_scoped_pending_approval_count?: number | undefined;
2691
+ unrelated_pending_approval_count?: number | undefined;
2572
2692
  };
2573
2693
  expected_next_checkpoint_at?: number | undefined;
2574
2694
  resumable?: boolean | undefined;
@@ -2595,7 +2715,7 @@ export declare const BrowserAutomationSessionRecordSchema: z.ZodObject<{
2595
2715
  }, "strip", z.ZodTypeAny, {
2596
2716
  created_at: string;
2597
2717
  updated_at: string;
2598
- state: "blocked" | "expired" | "fresh" | "authenticated" | "auth_required" | "unavailable";
2718
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
2599
2719
  session_id: string;
2600
2720
  provider_id: string;
2601
2721
  service_key: string;
@@ -2609,7 +2729,7 @@ export declare const BrowserAutomationSessionRecordSchema: z.ZodObject<{
2609
2729
  }, {
2610
2730
  created_at: string;
2611
2731
  updated_at: string;
2612
- state: "blocked" | "expired" | "fresh" | "authenticated" | "auth_required" | "unavailable";
2732
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
2613
2733
  session_id: string;
2614
2734
  provider_id: string;
2615
2735
  service_key: string;
@@ -2622,6 +2742,211 @@ export declare const BrowserAutomationSessionRecordSchema: z.ZodObject<{
2622
2742
  last_failure_message?: string | null | undefined;
2623
2743
  }>;
2624
2744
  export type BrowserAutomationSessionRecord = z.infer<typeof BrowserAutomationSessionRecordSchema>;
2745
+ export declare const RuntimeAuthHandoffStateSchema: z.ZodEnum<["requested", "pending_operator", "in_progress", "completed", "cancelled", "expired", "superseded", "blocked"]>;
2746
+ export type RuntimeAuthHandoffState = z.infer<typeof RuntimeAuthHandoffStateSchema>;
2747
+ export declare const RuntimeAuthHandoffRecordSchema: z.ZodObject<{
2748
+ schema_version: z.ZodLiteral<"runtime-auth-handoff-v1">;
2749
+ handoff_id: z.ZodString;
2750
+ provider_id: z.ZodString;
2751
+ service_key: z.ZodString;
2752
+ workspace: z.ZodString;
2753
+ actor_key: z.ZodString;
2754
+ state: z.ZodEnum<["requested", "pending_operator", "in_progress", "completed", "cancelled", "expired", "superseded", "blocked"]>;
2755
+ requested_at: z.ZodString;
2756
+ updated_at: z.ZodString;
2757
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2758
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2759
+ browser_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2760
+ resumable_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2761
+ supersedes_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2762
+ superseded_by_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2763
+ reply_target: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2764
+ surface: z.ZodOptional<z.ZodEnum<["chat", "gateway", "cli", "tui"]>>;
2765
+ channel: z.ZodOptional<z.ZodEnum<["tui", "plugin_gateway", "cli", "web"]>>;
2766
+ platform: z.ZodOptional<z.ZodString>;
2767
+ conversation_id: z.ZodOptional<z.ZodString>;
2768
+ message_id: z.ZodOptional<z.ZodString>;
2769
+ response_channel: z.ZodOptional<z.ZodString>;
2770
+ outbox_topic: z.ZodOptional<z.ZodString>;
2771
+ identity_key: z.ZodOptional<z.ZodString>;
2772
+ user_id: z.ZodOptional<z.ZodString>;
2773
+ deliveryMode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
2774
+ delivery_mode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
2775
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2776
+ }, "strip", z.ZodTypeAny, {
2777
+ metadata?: Record<string, unknown> | undefined;
2778
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
2779
+ platform?: string | undefined;
2780
+ conversation_id?: string | undefined;
2781
+ identity_key?: string | undefined;
2782
+ user_id?: string | undefined;
2783
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
2784
+ message_id?: string | undefined;
2785
+ response_channel?: string | undefined;
2786
+ outbox_topic?: string | undefined;
2787
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
2788
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
2789
+ }, {
2790
+ metadata?: Record<string, unknown> | undefined;
2791
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
2792
+ platform?: string | undefined;
2793
+ conversation_id?: string | undefined;
2794
+ identity_key?: string | undefined;
2795
+ user_id?: string | undefined;
2796
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
2797
+ message_id?: string | undefined;
2798
+ response_channel?: string | undefined;
2799
+ outbox_topic?: string | undefined;
2800
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
2801
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
2802
+ }>>>;
2803
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2804
+ surface: z.ZodEnum<["chat", "gateway", "cli", "tui"]>;
2805
+ platform: z.ZodOptional<z.ZodString>;
2806
+ conversation_id: z.ZodOptional<z.ZodString>;
2807
+ identity_key: z.ZodOptional<z.ZodString>;
2808
+ user_id: z.ZodOptional<z.ZodString>;
2809
+ }, "strip", z.ZodTypeAny, {
2810
+ surface: "chat" | "gateway" | "cli" | "tui";
2811
+ platform?: string | undefined;
2812
+ conversation_id?: string | undefined;
2813
+ identity_key?: string | undefined;
2814
+ user_id?: string | undefined;
2815
+ }, {
2816
+ surface: "chat" | "gateway" | "cli" | "tui";
2817
+ platform?: string | undefined;
2818
+ conversation_id?: string | undefined;
2819
+ identity_key?: string | undefined;
2820
+ user_id?: string | undefined;
2821
+ }>>>;
2822
+ failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2823
+ failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2824
+ resume_hint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2825
+ tool_name: z.ZodLiteral<"browser_run_workflow">;
2826
+ input_ref: z.ZodOptional<z.ZodString>;
2827
+ task_summary: z.ZodString;
2828
+ }, "strip", z.ZodTypeAny, {
2829
+ tool_name: "browser_run_workflow";
2830
+ task_summary: string;
2831
+ input_ref?: string | undefined;
2832
+ }, {
2833
+ tool_name: "browser_run_workflow";
2834
+ task_summary: string;
2835
+ input_ref?: string | undefined;
2836
+ }>>>;
2837
+ evidence_refs: z.ZodDefault<z.ZodArray<z.ZodObject<{
2838
+ kind: z.ZodString;
2839
+ ref: z.ZodString;
2840
+ observed_at: z.ZodOptional<z.ZodString>;
2841
+ }, "strip", z.ZodTypeAny, {
2842
+ kind: string;
2843
+ ref: string;
2844
+ observed_at?: string | undefined;
2845
+ }, {
2846
+ kind: string;
2847
+ ref: string;
2848
+ observed_at?: string | undefined;
2849
+ }>, "many">>;
2850
+ }, "strip", z.ZodTypeAny, {
2851
+ updated_at: string;
2852
+ schema_version: "runtime-auth-handoff-v1";
2853
+ evidence_refs: {
2854
+ kind: string;
2855
+ ref: string;
2856
+ observed_at?: string | undefined;
2857
+ }[];
2858
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
2859
+ requested_at: string;
2860
+ handoff_id: string;
2861
+ provider_id: string;
2862
+ service_key: string;
2863
+ workspace: string;
2864
+ actor_key: string;
2865
+ completed_at?: string | null | undefined;
2866
+ resume_hint?: {
2867
+ tool_name: "browser_run_workflow";
2868
+ task_summary: string;
2869
+ input_ref?: string | undefined;
2870
+ } | null | undefined;
2871
+ requested_by?: {
2872
+ surface: "chat" | "gateway" | "cli" | "tui";
2873
+ platform?: string | undefined;
2874
+ conversation_id?: string | undefined;
2875
+ identity_key?: string | undefined;
2876
+ user_id?: string | undefined;
2877
+ } | null | undefined;
2878
+ reply_target?: {
2879
+ metadata?: Record<string, unknown> | undefined;
2880
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
2881
+ platform?: string | undefined;
2882
+ conversation_id?: string | undefined;
2883
+ identity_key?: string | undefined;
2884
+ user_id?: string | undefined;
2885
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
2886
+ message_id?: string | undefined;
2887
+ response_channel?: string | undefined;
2888
+ outbox_topic?: string | undefined;
2889
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
2890
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
2891
+ } | null | undefined;
2892
+ expires_at?: string | null | undefined;
2893
+ browser_session_id?: string | null | undefined;
2894
+ resumable_session_id?: string | null | undefined;
2895
+ supersedes_handoff_id?: string | null | undefined;
2896
+ superseded_by_handoff_id?: string | null | undefined;
2897
+ failure_code?: string | null | undefined;
2898
+ failure_message?: string | null | undefined;
2899
+ }, {
2900
+ updated_at: string;
2901
+ schema_version: "runtime-auth-handoff-v1";
2902
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
2903
+ requested_at: string;
2904
+ handoff_id: string;
2905
+ provider_id: string;
2906
+ service_key: string;
2907
+ workspace: string;
2908
+ actor_key: string;
2909
+ completed_at?: string | null | undefined;
2910
+ evidence_refs?: {
2911
+ kind: string;
2912
+ ref: string;
2913
+ observed_at?: string | undefined;
2914
+ }[] | undefined;
2915
+ resume_hint?: {
2916
+ tool_name: "browser_run_workflow";
2917
+ task_summary: string;
2918
+ input_ref?: string | undefined;
2919
+ } | null | undefined;
2920
+ requested_by?: {
2921
+ surface: "chat" | "gateway" | "cli" | "tui";
2922
+ platform?: string | undefined;
2923
+ conversation_id?: string | undefined;
2924
+ identity_key?: string | undefined;
2925
+ user_id?: string | undefined;
2926
+ } | null | undefined;
2927
+ reply_target?: {
2928
+ metadata?: Record<string, unknown> | undefined;
2929
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
2930
+ platform?: string | undefined;
2931
+ conversation_id?: string | undefined;
2932
+ identity_key?: string | undefined;
2933
+ user_id?: string | undefined;
2934
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
2935
+ message_id?: string | undefined;
2936
+ response_channel?: string | undefined;
2937
+ outbox_topic?: string | undefined;
2938
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
2939
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
2940
+ } | null | undefined;
2941
+ expires_at?: string | null | undefined;
2942
+ browser_session_id?: string | null | undefined;
2943
+ resumable_session_id?: string | null | undefined;
2944
+ supersedes_handoff_id?: string | null | undefined;
2945
+ superseded_by_handoff_id?: string | null | undefined;
2946
+ failure_code?: string | null | undefined;
2947
+ failure_message?: string | null | undefined;
2948
+ }>;
2949
+ export type RuntimeAuthHandoffRecord = z.infer<typeof RuntimeAuthHandoffRecordSchema>;
2625
2950
  export declare const CircuitBreakerStateSchema: z.ZodEnum<["closed", "open", "half_open", "paused"]>;
2626
2951
  export type CircuitBreakerState = z.infer<typeof CircuitBreakerStateSchema>;
2627
2952
  export declare const CircuitBreakerRecordSchema: z.ZodObject<{
@@ -2743,6 +3068,1861 @@ export declare const BackpressureSnapshotSchema: z.ZodObject<{
2743
3068
  }[] | undefined;
2744
3069
  }>;
2745
3070
  export type BackpressureSnapshot = z.infer<typeof BackpressureSnapshotSchema>;
3071
+ export declare const RuntimeAutomationSnapshotSchema: z.ZodObject<{
3072
+ schema_version: z.ZodLiteral<"runtime-automation-snapshot-v1">;
3073
+ generated_at: z.ZodString;
3074
+ auth_handoffs: z.ZodObject<{
3075
+ pending: z.ZodArray<z.ZodObject<{
3076
+ schema_version: z.ZodLiteral<"runtime-auth-handoff-v1">;
3077
+ handoff_id: z.ZodString;
3078
+ provider_id: z.ZodString;
3079
+ service_key: z.ZodString;
3080
+ workspace: z.ZodString;
3081
+ actor_key: z.ZodString;
3082
+ state: z.ZodEnum<["requested", "pending_operator", "in_progress", "completed", "cancelled", "expired", "superseded", "blocked"]>;
3083
+ requested_at: z.ZodString;
3084
+ updated_at: z.ZodString;
3085
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3086
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3087
+ browser_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3088
+ resumable_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3089
+ supersedes_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3090
+ superseded_by_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3091
+ reply_target: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3092
+ surface: z.ZodOptional<z.ZodEnum<["chat", "gateway", "cli", "tui"]>>;
3093
+ channel: z.ZodOptional<z.ZodEnum<["tui", "plugin_gateway", "cli", "web"]>>;
3094
+ platform: z.ZodOptional<z.ZodString>;
3095
+ conversation_id: z.ZodOptional<z.ZodString>;
3096
+ message_id: z.ZodOptional<z.ZodString>;
3097
+ response_channel: z.ZodOptional<z.ZodString>;
3098
+ outbox_topic: z.ZodOptional<z.ZodString>;
3099
+ identity_key: z.ZodOptional<z.ZodString>;
3100
+ user_id: z.ZodOptional<z.ZodString>;
3101
+ deliveryMode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
3102
+ delivery_mode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
3103
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3104
+ }, "strip", z.ZodTypeAny, {
3105
+ metadata?: Record<string, unknown> | undefined;
3106
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3107
+ platform?: string | undefined;
3108
+ conversation_id?: string | undefined;
3109
+ identity_key?: string | undefined;
3110
+ user_id?: string | undefined;
3111
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3112
+ message_id?: string | undefined;
3113
+ response_channel?: string | undefined;
3114
+ outbox_topic?: string | undefined;
3115
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3116
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3117
+ }, {
3118
+ metadata?: Record<string, unknown> | undefined;
3119
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3120
+ platform?: string | undefined;
3121
+ conversation_id?: string | undefined;
3122
+ identity_key?: string | undefined;
3123
+ user_id?: string | undefined;
3124
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3125
+ message_id?: string | undefined;
3126
+ response_channel?: string | undefined;
3127
+ outbox_topic?: string | undefined;
3128
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3129
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3130
+ }>>>;
3131
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3132
+ surface: z.ZodEnum<["chat", "gateway", "cli", "tui"]>;
3133
+ platform: z.ZodOptional<z.ZodString>;
3134
+ conversation_id: z.ZodOptional<z.ZodString>;
3135
+ identity_key: z.ZodOptional<z.ZodString>;
3136
+ user_id: z.ZodOptional<z.ZodString>;
3137
+ }, "strip", z.ZodTypeAny, {
3138
+ surface: "chat" | "gateway" | "cli" | "tui";
3139
+ platform?: string | undefined;
3140
+ conversation_id?: string | undefined;
3141
+ identity_key?: string | undefined;
3142
+ user_id?: string | undefined;
3143
+ }, {
3144
+ surface: "chat" | "gateway" | "cli" | "tui";
3145
+ platform?: string | undefined;
3146
+ conversation_id?: string | undefined;
3147
+ identity_key?: string | undefined;
3148
+ user_id?: string | undefined;
3149
+ }>>>;
3150
+ failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3151
+ failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3152
+ resume_hint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3153
+ tool_name: z.ZodLiteral<"browser_run_workflow">;
3154
+ input_ref: z.ZodOptional<z.ZodString>;
3155
+ task_summary: z.ZodString;
3156
+ }, "strip", z.ZodTypeAny, {
3157
+ tool_name: "browser_run_workflow";
3158
+ task_summary: string;
3159
+ input_ref?: string | undefined;
3160
+ }, {
3161
+ tool_name: "browser_run_workflow";
3162
+ task_summary: string;
3163
+ input_ref?: string | undefined;
3164
+ }>>>;
3165
+ evidence_refs: z.ZodDefault<z.ZodArray<z.ZodObject<{
3166
+ kind: z.ZodString;
3167
+ ref: z.ZodString;
3168
+ observed_at: z.ZodOptional<z.ZodString>;
3169
+ }, "strip", z.ZodTypeAny, {
3170
+ kind: string;
3171
+ ref: string;
3172
+ observed_at?: string | undefined;
3173
+ }, {
3174
+ kind: string;
3175
+ ref: string;
3176
+ observed_at?: string | undefined;
3177
+ }>, "many">>;
3178
+ }, "strip", z.ZodTypeAny, {
3179
+ updated_at: string;
3180
+ schema_version: "runtime-auth-handoff-v1";
3181
+ evidence_refs: {
3182
+ kind: string;
3183
+ ref: string;
3184
+ observed_at?: string | undefined;
3185
+ }[];
3186
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3187
+ requested_at: string;
3188
+ handoff_id: string;
3189
+ provider_id: string;
3190
+ service_key: string;
3191
+ workspace: string;
3192
+ actor_key: string;
3193
+ completed_at?: string | null | undefined;
3194
+ resume_hint?: {
3195
+ tool_name: "browser_run_workflow";
3196
+ task_summary: string;
3197
+ input_ref?: string | undefined;
3198
+ } | null | undefined;
3199
+ requested_by?: {
3200
+ surface: "chat" | "gateway" | "cli" | "tui";
3201
+ platform?: string | undefined;
3202
+ conversation_id?: string | undefined;
3203
+ identity_key?: string | undefined;
3204
+ user_id?: string | undefined;
3205
+ } | null | undefined;
3206
+ reply_target?: {
3207
+ metadata?: Record<string, unknown> | undefined;
3208
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3209
+ platform?: string | undefined;
3210
+ conversation_id?: string | undefined;
3211
+ identity_key?: string | undefined;
3212
+ user_id?: string | undefined;
3213
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3214
+ message_id?: string | undefined;
3215
+ response_channel?: string | undefined;
3216
+ outbox_topic?: string | undefined;
3217
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3218
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3219
+ } | null | undefined;
3220
+ expires_at?: string | null | undefined;
3221
+ browser_session_id?: string | null | undefined;
3222
+ resumable_session_id?: string | null | undefined;
3223
+ supersedes_handoff_id?: string | null | undefined;
3224
+ superseded_by_handoff_id?: string | null | undefined;
3225
+ failure_code?: string | null | undefined;
3226
+ failure_message?: string | null | undefined;
3227
+ }, {
3228
+ updated_at: string;
3229
+ schema_version: "runtime-auth-handoff-v1";
3230
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3231
+ requested_at: string;
3232
+ handoff_id: string;
3233
+ provider_id: string;
3234
+ service_key: string;
3235
+ workspace: string;
3236
+ actor_key: string;
3237
+ completed_at?: string | null | undefined;
3238
+ evidence_refs?: {
3239
+ kind: string;
3240
+ ref: string;
3241
+ observed_at?: string | undefined;
3242
+ }[] | undefined;
3243
+ resume_hint?: {
3244
+ tool_name: "browser_run_workflow";
3245
+ task_summary: string;
3246
+ input_ref?: string | undefined;
3247
+ } | null | undefined;
3248
+ requested_by?: {
3249
+ surface: "chat" | "gateway" | "cli" | "tui";
3250
+ platform?: string | undefined;
3251
+ conversation_id?: string | undefined;
3252
+ identity_key?: string | undefined;
3253
+ user_id?: string | undefined;
3254
+ } | null | undefined;
3255
+ reply_target?: {
3256
+ metadata?: Record<string, unknown> | undefined;
3257
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3258
+ platform?: string | undefined;
3259
+ conversation_id?: string | undefined;
3260
+ identity_key?: string | undefined;
3261
+ user_id?: string | undefined;
3262
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3263
+ message_id?: string | undefined;
3264
+ response_channel?: string | undefined;
3265
+ outbox_topic?: string | undefined;
3266
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3267
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3268
+ } | null | undefined;
3269
+ expires_at?: string | null | undefined;
3270
+ browser_session_id?: string | null | undefined;
3271
+ resumable_session_id?: string | null | undefined;
3272
+ supersedes_handoff_id?: string | null | undefined;
3273
+ superseded_by_handoff_id?: string | null | undefined;
3274
+ failure_code?: string | null | undefined;
3275
+ failure_message?: string | null | undefined;
3276
+ }>, "many">;
3277
+ stale: z.ZodArray<z.ZodObject<{
3278
+ schema_version: z.ZodLiteral<"runtime-auth-handoff-v1">;
3279
+ handoff_id: z.ZodString;
3280
+ provider_id: z.ZodString;
3281
+ service_key: z.ZodString;
3282
+ workspace: z.ZodString;
3283
+ actor_key: z.ZodString;
3284
+ state: z.ZodEnum<["requested", "pending_operator", "in_progress", "completed", "cancelled", "expired", "superseded", "blocked"]>;
3285
+ requested_at: z.ZodString;
3286
+ updated_at: z.ZodString;
3287
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3288
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3289
+ browser_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3290
+ resumable_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3291
+ supersedes_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3292
+ superseded_by_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3293
+ reply_target: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3294
+ surface: z.ZodOptional<z.ZodEnum<["chat", "gateway", "cli", "tui"]>>;
3295
+ channel: z.ZodOptional<z.ZodEnum<["tui", "plugin_gateway", "cli", "web"]>>;
3296
+ platform: z.ZodOptional<z.ZodString>;
3297
+ conversation_id: z.ZodOptional<z.ZodString>;
3298
+ message_id: z.ZodOptional<z.ZodString>;
3299
+ response_channel: z.ZodOptional<z.ZodString>;
3300
+ outbox_topic: z.ZodOptional<z.ZodString>;
3301
+ identity_key: z.ZodOptional<z.ZodString>;
3302
+ user_id: z.ZodOptional<z.ZodString>;
3303
+ deliveryMode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
3304
+ delivery_mode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
3305
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3306
+ }, "strip", z.ZodTypeAny, {
3307
+ metadata?: Record<string, unknown> | undefined;
3308
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3309
+ platform?: string | undefined;
3310
+ conversation_id?: string | undefined;
3311
+ identity_key?: string | undefined;
3312
+ user_id?: string | undefined;
3313
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3314
+ message_id?: string | undefined;
3315
+ response_channel?: string | undefined;
3316
+ outbox_topic?: string | undefined;
3317
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3318
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3319
+ }, {
3320
+ metadata?: Record<string, unknown> | undefined;
3321
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3322
+ platform?: string | undefined;
3323
+ conversation_id?: string | undefined;
3324
+ identity_key?: string | undefined;
3325
+ user_id?: string | undefined;
3326
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3327
+ message_id?: string | undefined;
3328
+ response_channel?: string | undefined;
3329
+ outbox_topic?: string | undefined;
3330
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3331
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3332
+ }>>>;
3333
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3334
+ surface: z.ZodEnum<["chat", "gateway", "cli", "tui"]>;
3335
+ platform: z.ZodOptional<z.ZodString>;
3336
+ conversation_id: z.ZodOptional<z.ZodString>;
3337
+ identity_key: z.ZodOptional<z.ZodString>;
3338
+ user_id: z.ZodOptional<z.ZodString>;
3339
+ }, "strip", z.ZodTypeAny, {
3340
+ surface: "chat" | "gateway" | "cli" | "tui";
3341
+ platform?: string | undefined;
3342
+ conversation_id?: string | undefined;
3343
+ identity_key?: string | undefined;
3344
+ user_id?: string | undefined;
3345
+ }, {
3346
+ surface: "chat" | "gateway" | "cli" | "tui";
3347
+ platform?: string | undefined;
3348
+ conversation_id?: string | undefined;
3349
+ identity_key?: string | undefined;
3350
+ user_id?: string | undefined;
3351
+ }>>>;
3352
+ failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3353
+ failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3354
+ resume_hint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3355
+ tool_name: z.ZodLiteral<"browser_run_workflow">;
3356
+ input_ref: z.ZodOptional<z.ZodString>;
3357
+ task_summary: z.ZodString;
3358
+ }, "strip", z.ZodTypeAny, {
3359
+ tool_name: "browser_run_workflow";
3360
+ task_summary: string;
3361
+ input_ref?: string | undefined;
3362
+ }, {
3363
+ tool_name: "browser_run_workflow";
3364
+ task_summary: string;
3365
+ input_ref?: string | undefined;
3366
+ }>>>;
3367
+ evidence_refs: z.ZodDefault<z.ZodArray<z.ZodObject<{
3368
+ kind: z.ZodString;
3369
+ ref: z.ZodString;
3370
+ observed_at: z.ZodOptional<z.ZodString>;
3371
+ }, "strip", z.ZodTypeAny, {
3372
+ kind: string;
3373
+ ref: string;
3374
+ observed_at?: string | undefined;
3375
+ }, {
3376
+ kind: string;
3377
+ ref: string;
3378
+ observed_at?: string | undefined;
3379
+ }>, "many">>;
3380
+ }, "strip", z.ZodTypeAny, {
3381
+ updated_at: string;
3382
+ schema_version: "runtime-auth-handoff-v1";
3383
+ evidence_refs: {
3384
+ kind: string;
3385
+ ref: string;
3386
+ observed_at?: string | undefined;
3387
+ }[];
3388
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3389
+ requested_at: string;
3390
+ handoff_id: string;
3391
+ provider_id: string;
3392
+ service_key: string;
3393
+ workspace: string;
3394
+ actor_key: string;
3395
+ completed_at?: string | null | undefined;
3396
+ resume_hint?: {
3397
+ tool_name: "browser_run_workflow";
3398
+ task_summary: string;
3399
+ input_ref?: string | undefined;
3400
+ } | null | undefined;
3401
+ requested_by?: {
3402
+ surface: "chat" | "gateway" | "cli" | "tui";
3403
+ platform?: string | undefined;
3404
+ conversation_id?: string | undefined;
3405
+ identity_key?: string | undefined;
3406
+ user_id?: string | undefined;
3407
+ } | null | undefined;
3408
+ reply_target?: {
3409
+ metadata?: Record<string, unknown> | undefined;
3410
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3411
+ platform?: string | undefined;
3412
+ conversation_id?: string | undefined;
3413
+ identity_key?: string | undefined;
3414
+ user_id?: string | undefined;
3415
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3416
+ message_id?: string | undefined;
3417
+ response_channel?: string | undefined;
3418
+ outbox_topic?: string | undefined;
3419
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3420
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3421
+ } | null | undefined;
3422
+ expires_at?: string | null | undefined;
3423
+ browser_session_id?: string | null | undefined;
3424
+ resumable_session_id?: string | null | undefined;
3425
+ supersedes_handoff_id?: string | null | undefined;
3426
+ superseded_by_handoff_id?: string | null | undefined;
3427
+ failure_code?: string | null | undefined;
3428
+ failure_message?: string | null | undefined;
3429
+ }, {
3430
+ updated_at: string;
3431
+ schema_version: "runtime-auth-handoff-v1";
3432
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3433
+ requested_at: string;
3434
+ handoff_id: string;
3435
+ provider_id: string;
3436
+ service_key: string;
3437
+ workspace: string;
3438
+ actor_key: string;
3439
+ completed_at?: string | null | undefined;
3440
+ evidence_refs?: {
3441
+ kind: string;
3442
+ ref: string;
3443
+ observed_at?: string | undefined;
3444
+ }[] | undefined;
3445
+ resume_hint?: {
3446
+ tool_name: "browser_run_workflow";
3447
+ task_summary: string;
3448
+ input_ref?: string | undefined;
3449
+ } | null | undefined;
3450
+ requested_by?: {
3451
+ surface: "chat" | "gateway" | "cli" | "tui";
3452
+ platform?: string | undefined;
3453
+ conversation_id?: string | undefined;
3454
+ identity_key?: string | undefined;
3455
+ user_id?: string | undefined;
3456
+ } | null | undefined;
3457
+ reply_target?: {
3458
+ metadata?: Record<string, unknown> | undefined;
3459
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3460
+ platform?: string | undefined;
3461
+ conversation_id?: string | undefined;
3462
+ identity_key?: string | undefined;
3463
+ user_id?: string | undefined;
3464
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3465
+ message_id?: string | undefined;
3466
+ response_channel?: string | undefined;
3467
+ outbox_topic?: string | undefined;
3468
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3469
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3470
+ } | null | undefined;
3471
+ expires_at?: string | null | undefined;
3472
+ browser_session_id?: string | null | undefined;
3473
+ resumable_session_id?: string | null | undefined;
3474
+ supersedes_handoff_id?: string | null | undefined;
3475
+ superseded_by_handoff_id?: string | null | undefined;
3476
+ failure_code?: string | null | undefined;
3477
+ failure_message?: string | null | undefined;
3478
+ }>, "many">;
3479
+ recent_terminal: z.ZodArray<z.ZodObject<{
3480
+ schema_version: z.ZodLiteral<"runtime-auth-handoff-v1">;
3481
+ handoff_id: z.ZodString;
3482
+ provider_id: z.ZodString;
3483
+ service_key: z.ZodString;
3484
+ workspace: z.ZodString;
3485
+ actor_key: z.ZodString;
3486
+ state: z.ZodEnum<["requested", "pending_operator", "in_progress", "completed", "cancelled", "expired", "superseded", "blocked"]>;
3487
+ requested_at: z.ZodString;
3488
+ updated_at: z.ZodString;
3489
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3490
+ completed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3491
+ browser_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3492
+ resumable_session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3493
+ supersedes_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3494
+ superseded_by_handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3495
+ reply_target: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3496
+ surface: z.ZodOptional<z.ZodEnum<["chat", "gateway", "cli", "tui"]>>;
3497
+ channel: z.ZodOptional<z.ZodEnum<["tui", "plugin_gateway", "cli", "web"]>>;
3498
+ platform: z.ZodOptional<z.ZodString>;
3499
+ conversation_id: z.ZodOptional<z.ZodString>;
3500
+ message_id: z.ZodOptional<z.ZodString>;
3501
+ response_channel: z.ZodOptional<z.ZodString>;
3502
+ outbox_topic: z.ZodOptional<z.ZodString>;
3503
+ identity_key: z.ZodOptional<z.ZodString>;
3504
+ user_id: z.ZodOptional<z.ZodString>;
3505
+ deliveryMode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
3506
+ delivery_mode: z.ZodOptional<z.ZodEnum<["reply", "notify", "thread_reply"]>>;
3507
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3508
+ }, "strip", z.ZodTypeAny, {
3509
+ metadata?: Record<string, unknown> | undefined;
3510
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3511
+ platform?: string | undefined;
3512
+ conversation_id?: string | undefined;
3513
+ identity_key?: string | undefined;
3514
+ user_id?: string | undefined;
3515
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3516
+ message_id?: string | undefined;
3517
+ response_channel?: string | undefined;
3518
+ outbox_topic?: string | undefined;
3519
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3520
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3521
+ }, {
3522
+ metadata?: Record<string, unknown> | undefined;
3523
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3524
+ platform?: string | undefined;
3525
+ conversation_id?: string | undefined;
3526
+ identity_key?: string | undefined;
3527
+ user_id?: string | undefined;
3528
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3529
+ message_id?: string | undefined;
3530
+ response_channel?: string | undefined;
3531
+ outbox_topic?: string | undefined;
3532
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3533
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3534
+ }>>>;
3535
+ requested_by: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3536
+ surface: z.ZodEnum<["chat", "gateway", "cli", "tui"]>;
3537
+ platform: z.ZodOptional<z.ZodString>;
3538
+ conversation_id: z.ZodOptional<z.ZodString>;
3539
+ identity_key: z.ZodOptional<z.ZodString>;
3540
+ user_id: z.ZodOptional<z.ZodString>;
3541
+ }, "strip", z.ZodTypeAny, {
3542
+ surface: "chat" | "gateway" | "cli" | "tui";
3543
+ platform?: string | undefined;
3544
+ conversation_id?: string | undefined;
3545
+ identity_key?: string | undefined;
3546
+ user_id?: string | undefined;
3547
+ }, {
3548
+ surface: "chat" | "gateway" | "cli" | "tui";
3549
+ platform?: string | undefined;
3550
+ conversation_id?: string | undefined;
3551
+ identity_key?: string | undefined;
3552
+ user_id?: string | undefined;
3553
+ }>>>;
3554
+ failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3555
+ failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3556
+ resume_hint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3557
+ tool_name: z.ZodLiteral<"browser_run_workflow">;
3558
+ input_ref: z.ZodOptional<z.ZodString>;
3559
+ task_summary: z.ZodString;
3560
+ }, "strip", z.ZodTypeAny, {
3561
+ tool_name: "browser_run_workflow";
3562
+ task_summary: string;
3563
+ input_ref?: string | undefined;
3564
+ }, {
3565
+ tool_name: "browser_run_workflow";
3566
+ task_summary: string;
3567
+ input_ref?: string | undefined;
3568
+ }>>>;
3569
+ evidence_refs: z.ZodDefault<z.ZodArray<z.ZodObject<{
3570
+ kind: z.ZodString;
3571
+ ref: z.ZodString;
3572
+ observed_at: z.ZodOptional<z.ZodString>;
3573
+ }, "strip", z.ZodTypeAny, {
3574
+ kind: string;
3575
+ ref: string;
3576
+ observed_at?: string | undefined;
3577
+ }, {
3578
+ kind: string;
3579
+ ref: string;
3580
+ observed_at?: string | undefined;
3581
+ }>, "many">>;
3582
+ }, "strip", z.ZodTypeAny, {
3583
+ updated_at: string;
3584
+ schema_version: "runtime-auth-handoff-v1";
3585
+ evidence_refs: {
3586
+ kind: string;
3587
+ ref: string;
3588
+ observed_at?: string | undefined;
3589
+ }[];
3590
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3591
+ requested_at: string;
3592
+ handoff_id: string;
3593
+ provider_id: string;
3594
+ service_key: string;
3595
+ workspace: string;
3596
+ actor_key: string;
3597
+ completed_at?: string | null | undefined;
3598
+ resume_hint?: {
3599
+ tool_name: "browser_run_workflow";
3600
+ task_summary: string;
3601
+ input_ref?: string | undefined;
3602
+ } | null | undefined;
3603
+ requested_by?: {
3604
+ surface: "chat" | "gateway" | "cli" | "tui";
3605
+ platform?: string | undefined;
3606
+ conversation_id?: string | undefined;
3607
+ identity_key?: string | undefined;
3608
+ user_id?: string | undefined;
3609
+ } | null | undefined;
3610
+ reply_target?: {
3611
+ metadata?: Record<string, unknown> | undefined;
3612
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3613
+ platform?: string | undefined;
3614
+ conversation_id?: string | undefined;
3615
+ identity_key?: string | undefined;
3616
+ user_id?: string | undefined;
3617
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3618
+ message_id?: string | undefined;
3619
+ response_channel?: string | undefined;
3620
+ outbox_topic?: string | undefined;
3621
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3622
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3623
+ } | null | undefined;
3624
+ expires_at?: string | null | undefined;
3625
+ browser_session_id?: string | null | undefined;
3626
+ resumable_session_id?: string | null | undefined;
3627
+ supersedes_handoff_id?: string | null | undefined;
3628
+ superseded_by_handoff_id?: string | null | undefined;
3629
+ failure_code?: string | null | undefined;
3630
+ failure_message?: string | null | undefined;
3631
+ }, {
3632
+ updated_at: string;
3633
+ schema_version: "runtime-auth-handoff-v1";
3634
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3635
+ requested_at: string;
3636
+ handoff_id: string;
3637
+ provider_id: string;
3638
+ service_key: string;
3639
+ workspace: string;
3640
+ actor_key: string;
3641
+ completed_at?: string | null | undefined;
3642
+ evidence_refs?: {
3643
+ kind: string;
3644
+ ref: string;
3645
+ observed_at?: string | undefined;
3646
+ }[] | undefined;
3647
+ resume_hint?: {
3648
+ tool_name: "browser_run_workflow";
3649
+ task_summary: string;
3650
+ input_ref?: string | undefined;
3651
+ } | null | undefined;
3652
+ requested_by?: {
3653
+ surface: "chat" | "gateway" | "cli" | "tui";
3654
+ platform?: string | undefined;
3655
+ conversation_id?: string | undefined;
3656
+ identity_key?: string | undefined;
3657
+ user_id?: string | undefined;
3658
+ } | null | undefined;
3659
+ reply_target?: {
3660
+ metadata?: Record<string, unknown> | undefined;
3661
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3662
+ platform?: string | undefined;
3663
+ conversation_id?: string | undefined;
3664
+ identity_key?: string | undefined;
3665
+ user_id?: string | undefined;
3666
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3667
+ message_id?: string | undefined;
3668
+ response_channel?: string | undefined;
3669
+ outbox_topic?: string | undefined;
3670
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3671
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3672
+ } | null | undefined;
3673
+ expires_at?: string | null | undefined;
3674
+ browser_session_id?: string | null | undefined;
3675
+ resumable_session_id?: string | null | undefined;
3676
+ supersedes_handoff_id?: string | null | undefined;
3677
+ superseded_by_handoff_id?: string | null | undefined;
3678
+ failure_code?: string | null | undefined;
3679
+ failure_message?: string | null | undefined;
3680
+ }>, "many">;
3681
+ }, "strip", z.ZodTypeAny, {
3682
+ pending: {
3683
+ updated_at: string;
3684
+ schema_version: "runtime-auth-handoff-v1";
3685
+ evidence_refs: {
3686
+ kind: string;
3687
+ ref: string;
3688
+ observed_at?: string | undefined;
3689
+ }[];
3690
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3691
+ requested_at: string;
3692
+ handoff_id: string;
3693
+ provider_id: string;
3694
+ service_key: string;
3695
+ workspace: string;
3696
+ actor_key: string;
3697
+ completed_at?: string | null | undefined;
3698
+ resume_hint?: {
3699
+ tool_name: "browser_run_workflow";
3700
+ task_summary: string;
3701
+ input_ref?: string | undefined;
3702
+ } | null | undefined;
3703
+ requested_by?: {
3704
+ surface: "chat" | "gateway" | "cli" | "tui";
3705
+ platform?: string | undefined;
3706
+ conversation_id?: string | undefined;
3707
+ identity_key?: string | undefined;
3708
+ user_id?: string | undefined;
3709
+ } | null | undefined;
3710
+ reply_target?: {
3711
+ metadata?: Record<string, unknown> | undefined;
3712
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3713
+ platform?: string | undefined;
3714
+ conversation_id?: string | undefined;
3715
+ identity_key?: string | undefined;
3716
+ user_id?: string | undefined;
3717
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3718
+ message_id?: string | undefined;
3719
+ response_channel?: string | undefined;
3720
+ outbox_topic?: string | undefined;
3721
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3722
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3723
+ } | null | undefined;
3724
+ expires_at?: string | null | undefined;
3725
+ browser_session_id?: string | null | undefined;
3726
+ resumable_session_id?: string | null | undefined;
3727
+ supersedes_handoff_id?: string | null | undefined;
3728
+ superseded_by_handoff_id?: string | null | undefined;
3729
+ failure_code?: string | null | undefined;
3730
+ failure_message?: string | null | undefined;
3731
+ }[];
3732
+ stale: {
3733
+ updated_at: string;
3734
+ schema_version: "runtime-auth-handoff-v1";
3735
+ evidence_refs: {
3736
+ kind: string;
3737
+ ref: string;
3738
+ observed_at?: string | undefined;
3739
+ }[];
3740
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3741
+ requested_at: string;
3742
+ handoff_id: string;
3743
+ provider_id: string;
3744
+ service_key: string;
3745
+ workspace: string;
3746
+ actor_key: string;
3747
+ completed_at?: string | null | undefined;
3748
+ resume_hint?: {
3749
+ tool_name: "browser_run_workflow";
3750
+ task_summary: string;
3751
+ input_ref?: string | undefined;
3752
+ } | null | undefined;
3753
+ requested_by?: {
3754
+ surface: "chat" | "gateway" | "cli" | "tui";
3755
+ platform?: string | undefined;
3756
+ conversation_id?: string | undefined;
3757
+ identity_key?: string | undefined;
3758
+ user_id?: string | undefined;
3759
+ } | null | undefined;
3760
+ reply_target?: {
3761
+ metadata?: Record<string, unknown> | undefined;
3762
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3763
+ platform?: string | undefined;
3764
+ conversation_id?: string | undefined;
3765
+ identity_key?: string | undefined;
3766
+ user_id?: string | undefined;
3767
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3768
+ message_id?: string | undefined;
3769
+ response_channel?: string | undefined;
3770
+ outbox_topic?: string | undefined;
3771
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3772
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3773
+ } | null | undefined;
3774
+ expires_at?: string | null | undefined;
3775
+ browser_session_id?: string | null | undefined;
3776
+ resumable_session_id?: string | null | undefined;
3777
+ supersedes_handoff_id?: string | null | undefined;
3778
+ superseded_by_handoff_id?: string | null | undefined;
3779
+ failure_code?: string | null | undefined;
3780
+ failure_message?: string | null | undefined;
3781
+ }[];
3782
+ recent_terminal: {
3783
+ updated_at: string;
3784
+ schema_version: "runtime-auth-handoff-v1";
3785
+ evidence_refs: {
3786
+ kind: string;
3787
+ ref: string;
3788
+ observed_at?: string | undefined;
3789
+ }[];
3790
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3791
+ requested_at: string;
3792
+ handoff_id: string;
3793
+ provider_id: string;
3794
+ service_key: string;
3795
+ workspace: string;
3796
+ actor_key: string;
3797
+ completed_at?: string | null | undefined;
3798
+ resume_hint?: {
3799
+ tool_name: "browser_run_workflow";
3800
+ task_summary: string;
3801
+ input_ref?: string | undefined;
3802
+ } | null | undefined;
3803
+ requested_by?: {
3804
+ surface: "chat" | "gateway" | "cli" | "tui";
3805
+ platform?: string | undefined;
3806
+ conversation_id?: string | undefined;
3807
+ identity_key?: string | undefined;
3808
+ user_id?: string | undefined;
3809
+ } | null | undefined;
3810
+ reply_target?: {
3811
+ metadata?: Record<string, unknown> | undefined;
3812
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3813
+ platform?: string | undefined;
3814
+ conversation_id?: string | undefined;
3815
+ identity_key?: string | undefined;
3816
+ user_id?: string | undefined;
3817
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3818
+ message_id?: string | undefined;
3819
+ response_channel?: string | undefined;
3820
+ outbox_topic?: string | undefined;
3821
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3822
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3823
+ } | null | undefined;
3824
+ expires_at?: string | null | undefined;
3825
+ browser_session_id?: string | null | undefined;
3826
+ resumable_session_id?: string | null | undefined;
3827
+ supersedes_handoff_id?: string | null | undefined;
3828
+ superseded_by_handoff_id?: string | null | undefined;
3829
+ failure_code?: string | null | undefined;
3830
+ failure_message?: string | null | undefined;
3831
+ }[];
3832
+ }, {
3833
+ pending: {
3834
+ updated_at: string;
3835
+ schema_version: "runtime-auth-handoff-v1";
3836
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3837
+ requested_at: string;
3838
+ handoff_id: string;
3839
+ provider_id: string;
3840
+ service_key: string;
3841
+ workspace: string;
3842
+ actor_key: string;
3843
+ completed_at?: string | null | undefined;
3844
+ evidence_refs?: {
3845
+ kind: string;
3846
+ ref: string;
3847
+ observed_at?: string | undefined;
3848
+ }[] | undefined;
3849
+ resume_hint?: {
3850
+ tool_name: "browser_run_workflow";
3851
+ task_summary: string;
3852
+ input_ref?: string | undefined;
3853
+ } | null | undefined;
3854
+ requested_by?: {
3855
+ surface: "chat" | "gateway" | "cli" | "tui";
3856
+ platform?: string | undefined;
3857
+ conversation_id?: string | undefined;
3858
+ identity_key?: string | undefined;
3859
+ user_id?: string | undefined;
3860
+ } | null | undefined;
3861
+ reply_target?: {
3862
+ metadata?: Record<string, unknown> | undefined;
3863
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3864
+ platform?: string | undefined;
3865
+ conversation_id?: string | undefined;
3866
+ identity_key?: string | undefined;
3867
+ user_id?: string | undefined;
3868
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3869
+ message_id?: string | undefined;
3870
+ response_channel?: string | undefined;
3871
+ outbox_topic?: string | undefined;
3872
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3873
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3874
+ } | null | undefined;
3875
+ expires_at?: string | null | undefined;
3876
+ browser_session_id?: string | null | undefined;
3877
+ resumable_session_id?: string | null | undefined;
3878
+ supersedes_handoff_id?: string | null | undefined;
3879
+ superseded_by_handoff_id?: string | null | undefined;
3880
+ failure_code?: string | null | undefined;
3881
+ failure_message?: string | null | undefined;
3882
+ }[];
3883
+ stale: {
3884
+ updated_at: string;
3885
+ schema_version: "runtime-auth-handoff-v1";
3886
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3887
+ requested_at: string;
3888
+ handoff_id: string;
3889
+ provider_id: string;
3890
+ service_key: string;
3891
+ workspace: string;
3892
+ actor_key: string;
3893
+ completed_at?: string | null | undefined;
3894
+ evidence_refs?: {
3895
+ kind: string;
3896
+ ref: string;
3897
+ observed_at?: string | undefined;
3898
+ }[] | undefined;
3899
+ resume_hint?: {
3900
+ tool_name: "browser_run_workflow";
3901
+ task_summary: string;
3902
+ input_ref?: string | undefined;
3903
+ } | null | undefined;
3904
+ requested_by?: {
3905
+ surface: "chat" | "gateway" | "cli" | "tui";
3906
+ platform?: string | undefined;
3907
+ conversation_id?: string | undefined;
3908
+ identity_key?: string | undefined;
3909
+ user_id?: string | undefined;
3910
+ } | null | undefined;
3911
+ reply_target?: {
3912
+ metadata?: Record<string, unknown> | undefined;
3913
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3914
+ platform?: string | undefined;
3915
+ conversation_id?: string | undefined;
3916
+ identity_key?: string | undefined;
3917
+ user_id?: string | undefined;
3918
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3919
+ message_id?: string | undefined;
3920
+ response_channel?: string | undefined;
3921
+ outbox_topic?: string | undefined;
3922
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3923
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3924
+ } | null | undefined;
3925
+ expires_at?: string | null | undefined;
3926
+ browser_session_id?: string | null | undefined;
3927
+ resumable_session_id?: string | null | undefined;
3928
+ supersedes_handoff_id?: string | null | undefined;
3929
+ superseded_by_handoff_id?: string | null | undefined;
3930
+ failure_code?: string | null | undefined;
3931
+ failure_message?: string | null | undefined;
3932
+ }[];
3933
+ recent_terminal: {
3934
+ updated_at: string;
3935
+ schema_version: "runtime-auth-handoff-v1";
3936
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
3937
+ requested_at: string;
3938
+ handoff_id: string;
3939
+ provider_id: string;
3940
+ service_key: string;
3941
+ workspace: string;
3942
+ actor_key: string;
3943
+ completed_at?: string | null | undefined;
3944
+ evidence_refs?: {
3945
+ kind: string;
3946
+ ref: string;
3947
+ observed_at?: string | undefined;
3948
+ }[] | undefined;
3949
+ resume_hint?: {
3950
+ tool_name: "browser_run_workflow";
3951
+ task_summary: string;
3952
+ input_ref?: string | undefined;
3953
+ } | null | undefined;
3954
+ requested_by?: {
3955
+ surface: "chat" | "gateway" | "cli" | "tui";
3956
+ platform?: string | undefined;
3957
+ conversation_id?: string | undefined;
3958
+ identity_key?: string | undefined;
3959
+ user_id?: string | undefined;
3960
+ } | null | undefined;
3961
+ reply_target?: {
3962
+ metadata?: Record<string, unknown> | undefined;
3963
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
3964
+ platform?: string | undefined;
3965
+ conversation_id?: string | undefined;
3966
+ identity_key?: string | undefined;
3967
+ user_id?: string | undefined;
3968
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
3969
+ message_id?: string | undefined;
3970
+ response_channel?: string | undefined;
3971
+ outbox_topic?: string | undefined;
3972
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
3973
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
3974
+ } | null | undefined;
3975
+ expires_at?: string | null | undefined;
3976
+ browser_session_id?: string | null | undefined;
3977
+ resumable_session_id?: string | null | undefined;
3978
+ supersedes_handoff_id?: string | null | undefined;
3979
+ superseded_by_handoff_id?: string | null | undefined;
3980
+ failure_code?: string | null | undefined;
3981
+ failure_message?: string | null | undefined;
3982
+ }[];
3983
+ }>;
3984
+ browser_sessions: z.ZodObject<{
3985
+ authenticated: z.ZodArray<z.ZodObject<{
3986
+ session_id: z.ZodString;
3987
+ provider_id: z.ZodString;
3988
+ service_key: z.ZodString;
3989
+ workspace: z.ZodString;
3990
+ actor_key: z.ZodString;
3991
+ state: z.ZodEnum<["fresh", "authenticated", "auth_required", "expired", "blocked", "unavailable"]>;
3992
+ created_at: z.ZodString;
3993
+ updated_at: z.ZodString;
3994
+ last_auth_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3995
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3996
+ last_failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3997
+ last_failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3998
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3999
+ }, "strip", z.ZodTypeAny, {
4000
+ created_at: string;
4001
+ updated_at: string;
4002
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4003
+ session_id: string;
4004
+ provider_id: string;
4005
+ service_key: string;
4006
+ workspace: string;
4007
+ actor_key: string;
4008
+ metadata?: Record<string, unknown> | undefined;
4009
+ expires_at?: string | null | undefined;
4010
+ last_auth_at?: string | null | undefined;
4011
+ last_failure_code?: string | null | undefined;
4012
+ last_failure_message?: string | null | undefined;
4013
+ }, {
4014
+ created_at: string;
4015
+ updated_at: string;
4016
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4017
+ session_id: string;
4018
+ provider_id: string;
4019
+ service_key: string;
4020
+ workspace: string;
4021
+ actor_key: string;
4022
+ metadata?: Record<string, unknown> | undefined;
4023
+ expires_at?: string | null | undefined;
4024
+ last_auth_at?: string | null | undefined;
4025
+ last_failure_code?: string | null | undefined;
4026
+ last_failure_message?: string | null | undefined;
4027
+ }>, "many">;
4028
+ stale: z.ZodArray<z.ZodObject<{
4029
+ session_id: z.ZodString;
4030
+ provider_id: z.ZodString;
4031
+ service_key: z.ZodString;
4032
+ workspace: z.ZodString;
4033
+ actor_key: z.ZodString;
4034
+ state: z.ZodEnum<["fresh", "authenticated", "auth_required", "expired", "blocked", "unavailable"]>;
4035
+ created_at: z.ZodString;
4036
+ updated_at: z.ZodString;
4037
+ last_auth_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4038
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4039
+ last_failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4040
+ last_failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4041
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4042
+ }, "strip", z.ZodTypeAny, {
4043
+ created_at: string;
4044
+ updated_at: string;
4045
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4046
+ session_id: string;
4047
+ provider_id: string;
4048
+ service_key: string;
4049
+ workspace: string;
4050
+ actor_key: string;
4051
+ metadata?: Record<string, unknown> | undefined;
4052
+ expires_at?: string | null | undefined;
4053
+ last_auth_at?: string | null | undefined;
4054
+ last_failure_code?: string | null | undefined;
4055
+ last_failure_message?: string | null | undefined;
4056
+ }, {
4057
+ created_at: string;
4058
+ updated_at: string;
4059
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4060
+ session_id: string;
4061
+ provider_id: string;
4062
+ service_key: string;
4063
+ workspace: string;
4064
+ actor_key: string;
4065
+ metadata?: Record<string, unknown> | undefined;
4066
+ expires_at?: string | null | undefined;
4067
+ last_auth_at?: string | null | undefined;
4068
+ last_failure_code?: string | null | undefined;
4069
+ last_failure_message?: string | null | undefined;
4070
+ }>, "many">;
4071
+ }, "strip", z.ZodTypeAny, {
4072
+ stale: {
4073
+ created_at: string;
4074
+ updated_at: string;
4075
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4076
+ session_id: string;
4077
+ provider_id: string;
4078
+ service_key: string;
4079
+ workspace: string;
4080
+ actor_key: string;
4081
+ metadata?: Record<string, unknown> | undefined;
4082
+ expires_at?: string | null | undefined;
4083
+ last_auth_at?: string | null | undefined;
4084
+ last_failure_code?: string | null | undefined;
4085
+ last_failure_message?: string | null | undefined;
4086
+ }[];
4087
+ authenticated: {
4088
+ created_at: string;
4089
+ updated_at: string;
4090
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4091
+ session_id: string;
4092
+ provider_id: string;
4093
+ service_key: string;
4094
+ workspace: string;
4095
+ actor_key: string;
4096
+ metadata?: Record<string, unknown> | undefined;
4097
+ expires_at?: string | null | undefined;
4098
+ last_auth_at?: string | null | undefined;
4099
+ last_failure_code?: string | null | undefined;
4100
+ last_failure_message?: string | null | undefined;
4101
+ }[];
4102
+ }, {
4103
+ stale: {
4104
+ created_at: string;
4105
+ updated_at: string;
4106
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4107
+ session_id: string;
4108
+ provider_id: string;
4109
+ service_key: string;
4110
+ workspace: string;
4111
+ actor_key: string;
4112
+ metadata?: Record<string, unknown> | undefined;
4113
+ expires_at?: string | null | undefined;
4114
+ last_auth_at?: string | null | undefined;
4115
+ last_failure_code?: string | null | undefined;
4116
+ last_failure_message?: string | null | undefined;
4117
+ }[];
4118
+ authenticated: {
4119
+ created_at: string;
4120
+ updated_at: string;
4121
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4122
+ session_id: string;
4123
+ provider_id: string;
4124
+ service_key: string;
4125
+ workspace: string;
4126
+ actor_key: string;
4127
+ metadata?: Record<string, unknown> | undefined;
4128
+ expires_at?: string | null | undefined;
4129
+ last_auth_at?: string | null | undefined;
4130
+ last_failure_code?: string | null | undefined;
4131
+ last_failure_message?: string | null | undefined;
4132
+ }[];
4133
+ }>;
4134
+ guardrails: z.ZodObject<{
4135
+ open_breakers: z.ZodArray<z.ZodObject<{
4136
+ key: z.ZodString;
4137
+ provider_id: z.ZodString;
4138
+ service_key: z.ZodString;
4139
+ state: z.ZodEnum<["closed", "open", "half_open", "paused"]>;
4140
+ failure_count: z.ZodNumber;
4141
+ last_failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4142
+ last_failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4143
+ last_failure_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4144
+ opened_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4145
+ cooldown_until: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4146
+ updated_at: z.ZodString;
4147
+ }, "strip", z.ZodTypeAny, {
4148
+ updated_at: string;
4149
+ state: "paused" | "closed" | "open" | "half_open";
4150
+ provider_id: string;
4151
+ service_key: string;
4152
+ key: string;
4153
+ failure_count: number;
4154
+ cooldown_until?: string | null | undefined;
4155
+ last_failure_code?: string | null | undefined;
4156
+ last_failure_message?: string | null | undefined;
4157
+ last_failure_at?: string | null | undefined;
4158
+ opened_at?: string | null | undefined;
4159
+ }, {
4160
+ updated_at: string;
4161
+ state: "paused" | "closed" | "open" | "half_open";
4162
+ provider_id: string;
4163
+ service_key: string;
4164
+ key: string;
4165
+ failure_count: number;
4166
+ cooldown_until?: string | null | undefined;
4167
+ last_failure_code?: string | null | undefined;
4168
+ last_failure_message?: string | null | undefined;
4169
+ last_failure_at?: string | null | undefined;
4170
+ opened_at?: string | null | undefined;
4171
+ }>, "many">;
4172
+ paused_breakers: z.ZodArray<z.ZodObject<{
4173
+ key: z.ZodString;
4174
+ provider_id: z.ZodString;
4175
+ service_key: z.ZodString;
4176
+ state: z.ZodEnum<["closed", "open", "half_open", "paused"]>;
4177
+ failure_count: z.ZodNumber;
4178
+ last_failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4179
+ last_failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4180
+ last_failure_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4181
+ opened_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4182
+ cooldown_until: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4183
+ updated_at: z.ZodString;
4184
+ }, "strip", z.ZodTypeAny, {
4185
+ updated_at: string;
4186
+ state: "paused" | "closed" | "open" | "half_open";
4187
+ provider_id: string;
4188
+ service_key: string;
4189
+ key: string;
4190
+ failure_count: number;
4191
+ cooldown_until?: string | null | undefined;
4192
+ last_failure_code?: string | null | undefined;
4193
+ last_failure_message?: string | null | undefined;
4194
+ last_failure_at?: string | null | undefined;
4195
+ opened_at?: string | null | undefined;
4196
+ }, {
4197
+ updated_at: string;
4198
+ state: "paused" | "closed" | "open" | "half_open";
4199
+ provider_id: string;
4200
+ service_key: string;
4201
+ key: string;
4202
+ failure_count: number;
4203
+ cooldown_until?: string | null | undefined;
4204
+ last_failure_code?: string | null | undefined;
4205
+ last_failure_message?: string | null | undefined;
4206
+ last_failure_at?: string | null | undefined;
4207
+ opened_at?: string | null | undefined;
4208
+ }>, "many">;
4209
+ half_open_breakers: z.ZodArray<z.ZodObject<{
4210
+ key: z.ZodString;
4211
+ provider_id: z.ZodString;
4212
+ service_key: z.ZodString;
4213
+ state: z.ZodEnum<["closed", "open", "half_open", "paused"]>;
4214
+ failure_count: z.ZodNumber;
4215
+ last_failure_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4216
+ last_failure_message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4217
+ last_failure_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4218
+ opened_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4219
+ cooldown_until: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4220
+ updated_at: z.ZodString;
4221
+ }, "strip", z.ZodTypeAny, {
4222
+ updated_at: string;
4223
+ state: "paused" | "closed" | "open" | "half_open";
4224
+ provider_id: string;
4225
+ service_key: string;
4226
+ key: string;
4227
+ failure_count: number;
4228
+ cooldown_until?: string | null | undefined;
4229
+ last_failure_code?: string | null | undefined;
4230
+ last_failure_message?: string | null | undefined;
4231
+ last_failure_at?: string | null | undefined;
4232
+ opened_at?: string | null | undefined;
4233
+ }, {
4234
+ updated_at: string;
4235
+ state: "paused" | "closed" | "open" | "half_open";
4236
+ provider_id: string;
4237
+ service_key: string;
4238
+ key: string;
4239
+ failure_count: number;
4240
+ cooldown_until?: string | null | undefined;
4241
+ last_failure_code?: string | null | undefined;
4242
+ last_failure_message?: string | null | undefined;
4243
+ last_failure_at?: string | null | undefined;
4244
+ opened_at?: string | null | undefined;
4245
+ }>, "many">;
4246
+ }, "strip", z.ZodTypeAny, {
4247
+ open_breakers: {
4248
+ updated_at: string;
4249
+ state: "paused" | "closed" | "open" | "half_open";
4250
+ provider_id: string;
4251
+ service_key: string;
4252
+ key: string;
4253
+ failure_count: number;
4254
+ cooldown_until?: string | null | undefined;
4255
+ last_failure_code?: string | null | undefined;
4256
+ last_failure_message?: string | null | undefined;
4257
+ last_failure_at?: string | null | undefined;
4258
+ opened_at?: string | null | undefined;
4259
+ }[];
4260
+ paused_breakers: {
4261
+ updated_at: string;
4262
+ state: "paused" | "closed" | "open" | "half_open";
4263
+ provider_id: string;
4264
+ service_key: string;
4265
+ key: string;
4266
+ failure_count: number;
4267
+ cooldown_until?: string | null | undefined;
4268
+ last_failure_code?: string | null | undefined;
4269
+ last_failure_message?: string | null | undefined;
4270
+ last_failure_at?: string | null | undefined;
4271
+ opened_at?: string | null | undefined;
4272
+ }[];
4273
+ half_open_breakers: {
4274
+ updated_at: string;
4275
+ state: "paused" | "closed" | "open" | "half_open";
4276
+ provider_id: string;
4277
+ service_key: string;
4278
+ key: string;
4279
+ failure_count: number;
4280
+ cooldown_until?: string | null | undefined;
4281
+ last_failure_code?: string | null | undefined;
4282
+ last_failure_message?: string | null | undefined;
4283
+ last_failure_at?: string | null | undefined;
4284
+ opened_at?: string | null | undefined;
4285
+ }[];
4286
+ }, {
4287
+ open_breakers: {
4288
+ updated_at: string;
4289
+ state: "paused" | "closed" | "open" | "half_open";
4290
+ provider_id: string;
4291
+ service_key: string;
4292
+ key: string;
4293
+ failure_count: number;
4294
+ cooldown_until?: string | null | undefined;
4295
+ last_failure_code?: string | null | undefined;
4296
+ last_failure_message?: string | null | undefined;
4297
+ last_failure_at?: string | null | undefined;
4298
+ opened_at?: string | null | undefined;
4299
+ }[];
4300
+ paused_breakers: {
4301
+ updated_at: string;
4302
+ state: "paused" | "closed" | "open" | "half_open";
4303
+ provider_id: string;
4304
+ service_key: string;
4305
+ key: string;
4306
+ failure_count: number;
4307
+ cooldown_until?: string | null | undefined;
4308
+ last_failure_code?: string | null | undefined;
4309
+ last_failure_message?: string | null | undefined;
4310
+ last_failure_at?: string | null | undefined;
4311
+ opened_at?: string | null | undefined;
4312
+ }[];
4313
+ half_open_breakers: {
4314
+ updated_at: string;
4315
+ state: "paused" | "closed" | "open" | "half_open";
4316
+ provider_id: string;
4317
+ service_key: string;
4318
+ key: string;
4319
+ failure_count: number;
4320
+ cooldown_until?: string | null | undefined;
4321
+ last_failure_code?: string | null | undefined;
4322
+ last_failure_message?: string | null | undefined;
4323
+ last_failure_at?: string | null | undefined;
4324
+ opened_at?: string | null | undefined;
4325
+ }[];
4326
+ }>;
4327
+ backpressure: z.ZodObject<{
4328
+ active: z.ZodArray<z.ZodObject<{
4329
+ provider_id: z.ZodString;
4330
+ service_key: z.ZodString;
4331
+ run_key: z.ZodString;
4332
+ acquired_at: z.ZodString;
4333
+ }, "strip", z.ZodTypeAny, {
4334
+ acquired_at: string;
4335
+ provider_id: string;
4336
+ service_key: string;
4337
+ run_key: string;
4338
+ }, {
4339
+ acquired_at: string;
4340
+ provider_id: string;
4341
+ service_key: string;
4342
+ run_key: string;
4343
+ }>, "many">;
4344
+ throttled: z.ZodArray<z.ZodObject<{
4345
+ provider_id: z.ZodString;
4346
+ service_key: z.ZodString;
4347
+ reason: z.ZodString;
4348
+ at: z.ZodString;
4349
+ }, "strip", z.ZodTypeAny, {
4350
+ at: string;
4351
+ reason: string;
4352
+ provider_id: string;
4353
+ service_key: string;
4354
+ }, {
4355
+ at: string;
4356
+ reason: string;
4357
+ provider_id: string;
4358
+ service_key: string;
4359
+ }>, "many">;
4360
+ }, "strip", z.ZodTypeAny, {
4361
+ active: {
4362
+ acquired_at: string;
4363
+ provider_id: string;
4364
+ service_key: string;
4365
+ run_key: string;
4366
+ }[];
4367
+ throttled: {
4368
+ at: string;
4369
+ reason: string;
4370
+ provider_id: string;
4371
+ service_key: string;
4372
+ }[];
4373
+ }, {
4374
+ active: {
4375
+ acquired_at: string;
4376
+ provider_id: string;
4377
+ service_key: string;
4378
+ run_key: string;
4379
+ }[];
4380
+ throttled: {
4381
+ at: string;
4382
+ reason: string;
4383
+ provider_id: string;
4384
+ service_key: string;
4385
+ }[];
4386
+ }>;
4387
+ blocked_work: z.ZodArray<z.ZodObject<{
4388
+ kind: z.ZodEnum<["auth_wait", "guardrail_open", "backpressure", "provider_unavailable"]>;
4389
+ provider_id: z.ZodString;
4390
+ service_key: z.ZodString;
4391
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4392
+ goal_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4393
+ handoff_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4394
+ reason: z.ZodString;
4395
+ since: z.ZodString;
4396
+ retry_after: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4397
+ }, "strip", z.ZodTypeAny, {
4398
+ kind: "backpressure" | "auth_wait" | "guardrail_open" | "provider_unavailable";
4399
+ reason: string;
4400
+ provider_id: string;
4401
+ service_key: string;
4402
+ since: string;
4403
+ goal_id?: string | null | undefined;
4404
+ run_id?: string | null | undefined;
4405
+ handoff_id?: string | null | undefined;
4406
+ retry_after?: string | null | undefined;
4407
+ }, {
4408
+ kind: "backpressure" | "auth_wait" | "guardrail_open" | "provider_unavailable";
4409
+ reason: string;
4410
+ provider_id: string;
4411
+ service_key: string;
4412
+ since: string;
4413
+ goal_id?: string | null | undefined;
4414
+ run_id?: string | null | undefined;
4415
+ handoff_id?: string | null | undefined;
4416
+ retry_after?: string | null | undefined;
4417
+ }>, "many">;
4418
+ }, "strip", z.ZodTypeAny, {
4419
+ generated_at: string;
4420
+ schema_version: "runtime-automation-snapshot-v1";
4421
+ backpressure: {
4422
+ active: {
4423
+ acquired_at: string;
4424
+ provider_id: string;
4425
+ service_key: string;
4426
+ run_key: string;
4427
+ }[];
4428
+ throttled: {
4429
+ at: string;
4430
+ reason: string;
4431
+ provider_id: string;
4432
+ service_key: string;
4433
+ }[];
4434
+ };
4435
+ auth_handoffs: {
4436
+ pending: {
4437
+ updated_at: string;
4438
+ schema_version: "runtime-auth-handoff-v1";
4439
+ evidence_refs: {
4440
+ kind: string;
4441
+ ref: string;
4442
+ observed_at?: string | undefined;
4443
+ }[];
4444
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
4445
+ requested_at: string;
4446
+ handoff_id: string;
4447
+ provider_id: string;
4448
+ service_key: string;
4449
+ workspace: string;
4450
+ actor_key: string;
4451
+ completed_at?: string | null | undefined;
4452
+ resume_hint?: {
4453
+ tool_name: "browser_run_workflow";
4454
+ task_summary: string;
4455
+ input_ref?: string | undefined;
4456
+ } | null | undefined;
4457
+ requested_by?: {
4458
+ surface: "chat" | "gateway" | "cli" | "tui";
4459
+ platform?: string | undefined;
4460
+ conversation_id?: string | undefined;
4461
+ identity_key?: string | undefined;
4462
+ user_id?: string | undefined;
4463
+ } | null | undefined;
4464
+ reply_target?: {
4465
+ metadata?: Record<string, unknown> | undefined;
4466
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
4467
+ platform?: string | undefined;
4468
+ conversation_id?: string | undefined;
4469
+ identity_key?: string | undefined;
4470
+ user_id?: string | undefined;
4471
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
4472
+ message_id?: string | undefined;
4473
+ response_channel?: string | undefined;
4474
+ outbox_topic?: string | undefined;
4475
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
4476
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
4477
+ } | null | undefined;
4478
+ expires_at?: string | null | undefined;
4479
+ browser_session_id?: string | null | undefined;
4480
+ resumable_session_id?: string | null | undefined;
4481
+ supersedes_handoff_id?: string | null | undefined;
4482
+ superseded_by_handoff_id?: string | null | undefined;
4483
+ failure_code?: string | null | undefined;
4484
+ failure_message?: string | null | undefined;
4485
+ }[];
4486
+ stale: {
4487
+ updated_at: string;
4488
+ schema_version: "runtime-auth-handoff-v1";
4489
+ evidence_refs: {
4490
+ kind: string;
4491
+ ref: string;
4492
+ observed_at?: string | undefined;
4493
+ }[];
4494
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
4495
+ requested_at: string;
4496
+ handoff_id: string;
4497
+ provider_id: string;
4498
+ service_key: string;
4499
+ workspace: string;
4500
+ actor_key: string;
4501
+ completed_at?: string | null | undefined;
4502
+ resume_hint?: {
4503
+ tool_name: "browser_run_workflow";
4504
+ task_summary: string;
4505
+ input_ref?: string | undefined;
4506
+ } | null | undefined;
4507
+ requested_by?: {
4508
+ surface: "chat" | "gateway" | "cli" | "tui";
4509
+ platform?: string | undefined;
4510
+ conversation_id?: string | undefined;
4511
+ identity_key?: string | undefined;
4512
+ user_id?: string | undefined;
4513
+ } | null | undefined;
4514
+ reply_target?: {
4515
+ metadata?: Record<string, unknown> | undefined;
4516
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
4517
+ platform?: string | undefined;
4518
+ conversation_id?: string | undefined;
4519
+ identity_key?: string | undefined;
4520
+ user_id?: string | undefined;
4521
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
4522
+ message_id?: string | undefined;
4523
+ response_channel?: string | undefined;
4524
+ outbox_topic?: string | undefined;
4525
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
4526
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
4527
+ } | null | undefined;
4528
+ expires_at?: string | null | undefined;
4529
+ browser_session_id?: string | null | undefined;
4530
+ resumable_session_id?: string | null | undefined;
4531
+ supersedes_handoff_id?: string | null | undefined;
4532
+ superseded_by_handoff_id?: string | null | undefined;
4533
+ failure_code?: string | null | undefined;
4534
+ failure_message?: string | null | undefined;
4535
+ }[];
4536
+ recent_terminal: {
4537
+ updated_at: string;
4538
+ schema_version: "runtime-auth-handoff-v1";
4539
+ evidence_refs: {
4540
+ kind: string;
4541
+ ref: string;
4542
+ observed_at?: string | undefined;
4543
+ }[];
4544
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
4545
+ requested_at: string;
4546
+ handoff_id: string;
4547
+ provider_id: string;
4548
+ service_key: string;
4549
+ workspace: string;
4550
+ actor_key: string;
4551
+ completed_at?: string | null | undefined;
4552
+ resume_hint?: {
4553
+ tool_name: "browser_run_workflow";
4554
+ task_summary: string;
4555
+ input_ref?: string | undefined;
4556
+ } | null | undefined;
4557
+ requested_by?: {
4558
+ surface: "chat" | "gateway" | "cli" | "tui";
4559
+ platform?: string | undefined;
4560
+ conversation_id?: string | undefined;
4561
+ identity_key?: string | undefined;
4562
+ user_id?: string | undefined;
4563
+ } | null | undefined;
4564
+ reply_target?: {
4565
+ metadata?: Record<string, unknown> | undefined;
4566
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
4567
+ platform?: string | undefined;
4568
+ conversation_id?: string | undefined;
4569
+ identity_key?: string | undefined;
4570
+ user_id?: string | undefined;
4571
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
4572
+ message_id?: string | undefined;
4573
+ response_channel?: string | undefined;
4574
+ outbox_topic?: string | undefined;
4575
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
4576
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
4577
+ } | null | undefined;
4578
+ expires_at?: string | null | undefined;
4579
+ browser_session_id?: string | null | undefined;
4580
+ resumable_session_id?: string | null | undefined;
4581
+ supersedes_handoff_id?: string | null | undefined;
4582
+ superseded_by_handoff_id?: string | null | undefined;
4583
+ failure_code?: string | null | undefined;
4584
+ failure_message?: string | null | undefined;
4585
+ }[];
4586
+ };
4587
+ browser_sessions: {
4588
+ stale: {
4589
+ created_at: string;
4590
+ updated_at: string;
4591
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4592
+ session_id: string;
4593
+ provider_id: string;
4594
+ service_key: string;
4595
+ workspace: string;
4596
+ actor_key: string;
4597
+ metadata?: Record<string, unknown> | undefined;
4598
+ expires_at?: string | null | undefined;
4599
+ last_auth_at?: string | null | undefined;
4600
+ last_failure_code?: string | null | undefined;
4601
+ last_failure_message?: string | null | undefined;
4602
+ }[];
4603
+ authenticated: {
4604
+ created_at: string;
4605
+ updated_at: string;
4606
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4607
+ session_id: string;
4608
+ provider_id: string;
4609
+ service_key: string;
4610
+ workspace: string;
4611
+ actor_key: string;
4612
+ metadata?: Record<string, unknown> | undefined;
4613
+ expires_at?: string | null | undefined;
4614
+ last_auth_at?: string | null | undefined;
4615
+ last_failure_code?: string | null | undefined;
4616
+ last_failure_message?: string | null | undefined;
4617
+ }[];
4618
+ };
4619
+ guardrails: {
4620
+ open_breakers: {
4621
+ updated_at: string;
4622
+ state: "paused" | "closed" | "open" | "half_open";
4623
+ provider_id: string;
4624
+ service_key: string;
4625
+ key: string;
4626
+ failure_count: number;
4627
+ cooldown_until?: string | null | undefined;
4628
+ last_failure_code?: string | null | undefined;
4629
+ last_failure_message?: string | null | undefined;
4630
+ last_failure_at?: string | null | undefined;
4631
+ opened_at?: string | null | undefined;
4632
+ }[];
4633
+ paused_breakers: {
4634
+ updated_at: string;
4635
+ state: "paused" | "closed" | "open" | "half_open";
4636
+ provider_id: string;
4637
+ service_key: string;
4638
+ key: string;
4639
+ failure_count: number;
4640
+ cooldown_until?: string | null | undefined;
4641
+ last_failure_code?: string | null | undefined;
4642
+ last_failure_message?: string | null | undefined;
4643
+ last_failure_at?: string | null | undefined;
4644
+ opened_at?: string | null | undefined;
4645
+ }[];
4646
+ half_open_breakers: {
4647
+ updated_at: string;
4648
+ state: "paused" | "closed" | "open" | "half_open";
4649
+ provider_id: string;
4650
+ service_key: string;
4651
+ key: string;
4652
+ failure_count: number;
4653
+ cooldown_until?: string | null | undefined;
4654
+ last_failure_code?: string | null | undefined;
4655
+ last_failure_message?: string | null | undefined;
4656
+ last_failure_at?: string | null | undefined;
4657
+ opened_at?: string | null | undefined;
4658
+ }[];
4659
+ };
4660
+ blocked_work: {
4661
+ kind: "backpressure" | "auth_wait" | "guardrail_open" | "provider_unavailable";
4662
+ reason: string;
4663
+ provider_id: string;
4664
+ service_key: string;
4665
+ since: string;
4666
+ goal_id?: string | null | undefined;
4667
+ run_id?: string | null | undefined;
4668
+ handoff_id?: string | null | undefined;
4669
+ retry_after?: string | null | undefined;
4670
+ }[];
4671
+ }, {
4672
+ generated_at: string;
4673
+ schema_version: "runtime-automation-snapshot-v1";
4674
+ backpressure: {
4675
+ active: {
4676
+ acquired_at: string;
4677
+ provider_id: string;
4678
+ service_key: string;
4679
+ run_key: string;
4680
+ }[];
4681
+ throttled: {
4682
+ at: string;
4683
+ reason: string;
4684
+ provider_id: string;
4685
+ service_key: string;
4686
+ }[];
4687
+ };
4688
+ auth_handoffs: {
4689
+ pending: {
4690
+ updated_at: string;
4691
+ schema_version: "runtime-auth-handoff-v1";
4692
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
4693
+ requested_at: string;
4694
+ handoff_id: string;
4695
+ provider_id: string;
4696
+ service_key: string;
4697
+ workspace: string;
4698
+ actor_key: string;
4699
+ completed_at?: string | null | undefined;
4700
+ evidence_refs?: {
4701
+ kind: string;
4702
+ ref: string;
4703
+ observed_at?: string | undefined;
4704
+ }[] | undefined;
4705
+ resume_hint?: {
4706
+ tool_name: "browser_run_workflow";
4707
+ task_summary: string;
4708
+ input_ref?: string | undefined;
4709
+ } | null | undefined;
4710
+ requested_by?: {
4711
+ surface: "chat" | "gateway" | "cli" | "tui";
4712
+ platform?: string | undefined;
4713
+ conversation_id?: string | undefined;
4714
+ identity_key?: string | undefined;
4715
+ user_id?: string | undefined;
4716
+ } | null | undefined;
4717
+ reply_target?: {
4718
+ metadata?: Record<string, unknown> | undefined;
4719
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
4720
+ platform?: string | undefined;
4721
+ conversation_id?: string | undefined;
4722
+ identity_key?: string | undefined;
4723
+ user_id?: string | undefined;
4724
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
4725
+ message_id?: string | undefined;
4726
+ response_channel?: string | undefined;
4727
+ outbox_topic?: string | undefined;
4728
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
4729
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
4730
+ } | null | undefined;
4731
+ expires_at?: string | null | undefined;
4732
+ browser_session_id?: string | null | undefined;
4733
+ resumable_session_id?: string | null | undefined;
4734
+ supersedes_handoff_id?: string | null | undefined;
4735
+ superseded_by_handoff_id?: string | null | undefined;
4736
+ failure_code?: string | null | undefined;
4737
+ failure_message?: string | null | undefined;
4738
+ }[];
4739
+ stale: {
4740
+ updated_at: string;
4741
+ schema_version: "runtime-auth-handoff-v1";
4742
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
4743
+ requested_at: string;
4744
+ handoff_id: string;
4745
+ provider_id: string;
4746
+ service_key: string;
4747
+ workspace: string;
4748
+ actor_key: string;
4749
+ completed_at?: string | null | undefined;
4750
+ evidence_refs?: {
4751
+ kind: string;
4752
+ ref: string;
4753
+ observed_at?: string | undefined;
4754
+ }[] | undefined;
4755
+ resume_hint?: {
4756
+ tool_name: "browser_run_workflow";
4757
+ task_summary: string;
4758
+ input_ref?: string | undefined;
4759
+ } | null | undefined;
4760
+ requested_by?: {
4761
+ surface: "chat" | "gateway" | "cli" | "tui";
4762
+ platform?: string | undefined;
4763
+ conversation_id?: string | undefined;
4764
+ identity_key?: string | undefined;
4765
+ user_id?: string | undefined;
4766
+ } | null | undefined;
4767
+ reply_target?: {
4768
+ metadata?: Record<string, unknown> | undefined;
4769
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
4770
+ platform?: string | undefined;
4771
+ conversation_id?: string | undefined;
4772
+ identity_key?: string | undefined;
4773
+ user_id?: string | undefined;
4774
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
4775
+ message_id?: string | undefined;
4776
+ response_channel?: string | undefined;
4777
+ outbox_topic?: string | undefined;
4778
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
4779
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
4780
+ } | null | undefined;
4781
+ expires_at?: string | null | undefined;
4782
+ browser_session_id?: string | null | undefined;
4783
+ resumable_session_id?: string | null | undefined;
4784
+ supersedes_handoff_id?: string | null | undefined;
4785
+ superseded_by_handoff_id?: string | null | undefined;
4786
+ failure_code?: string | null | undefined;
4787
+ failure_message?: string | null | undefined;
4788
+ }[];
4789
+ recent_terminal: {
4790
+ updated_at: string;
4791
+ schema_version: "runtime-auth-handoff-v1";
4792
+ state: "completed" | "cancelled" | "blocked" | "expired" | "in_progress" | "requested" | "pending_operator" | "superseded";
4793
+ requested_at: string;
4794
+ handoff_id: string;
4795
+ provider_id: string;
4796
+ service_key: string;
4797
+ workspace: string;
4798
+ actor_key: string;
4799
+ completed_at?: string | null | undefined;
4800
+ evidence_refs?: {
4801
+ kind: string;
4802
+ ref: string;
4803
+ observed_at?: string | undefined;
4804
+ }[] | undefined;
4805
+ resume_hint?: {
4806
+ tool_name: "browser_run_workflow";
4807
+ task_summary: string;
4808
+ input_ref?: string | undefined;
4809
+ } | null | undefined;
4810
+ requested_by?: {
4811
+ surface: "chat" | "gateway" | "cli" | "tui";
4812
+ platform?: string | undefined;
4813
+ conversation_id?: string | undefined;
4814
+ identity_key?: string | undefined;
4815
+ user_id?: string | undefined;
4816
+ } | null | undefined;
4817
+ reply_target?: {
4818
+ metadata?: Record<string, unknown> | undefined;
4819
+ surface?: "chat" | "gateway" | "cli" | "tui" | undefined;
4820
+ platform?: string | undefined;
4821
+ conversation_id?: string | undefined;
4822
+ identity_key?: string | undefined;
4823
+ user_id?: string | undefined;
4824
+ channel?: "web" | "cli" | "tui" | "plugin_gateway" | undefined;
4825
+ message_id?: string | undefined;
4826
+ response_channel?: string | undefined;
4827
+ outbox_topic?: string | undefined;
4828
+ deliveryMode?: "reply" | "notify" | "thread_reply" | undefined;
4829
+ delivery_mode?: "reply" | "notify" | "thread_reply" | undefined;
4830
+ } | null | undefined;
4831
+ expires_at?: string | null | undefined;
4832
+ browser_session_id?: string | null | undefined;
4833
+ resumable_session_id?: string | null | undefined;
4834
+ supersedes_handoff_id?: string | null | undefined;
4835
+ superseded_by_handoff_id?: string | null | undefined;
4836
+ failure_code?: string | null | undefined;
4837
+ failure_message?: string | null | undefined;
4838
+ }[];
4839
+ };
4840
+ browser_sessions: {
4841
+ stale: {
4842
+ created_at: string;
4843
+ updated_at: string;
4844
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4845
+ session_id: string;
4846
+ provider_id: string;
4847
+ service_key: string;
4848
+ workspace: string;
4849
+ actor_key: string;
4850
+ metadata?: Record<string, unknown> | undefined;
4851
+ expires_at?: string | null | undefined;
4852
+ last_auth_at?: string | null | undefined;
4853
+ last_failure_code?: string | null | undefined;
4854
+ last_failure_message?: string | null | undefined;
4855
+ }[];
4856
+ authenticated: {
4857
+ created_at: string;
4858
+ updated_at: string;
4859
+ state: "blocked" | "expired" | "unavailable" | "fresh" | "authenticated" | "auth_required";
4860
+ session_id: string;
4861
+ provider_id: string;
4862
+ service_key: string;
4863
+ workspace: string;
4864
+ actor_key: string;
4865
+ metadata?: Record<string, unknown> | undefined;
4866
+ expires_at?: string | null | undefined;
4867
+ last_auth_at?: string | null | undefined;
4868
+ last_failure_code?: string | null | undefined;
4869
+ last_failure_message?: string | null | undefined;
4870
+ }[];
4871
+ };
4872
+ guardrails: {
4873
+ open_breakers: {
4874
+ updated_at: string;
4875
+ state: "paused" | "closed" | "open" | "half_open";
4876
+ provider_id: string;
4877
+ service_key: string;
4878
+ key: string;
4879
+ failure_count: number;
4880
+ cooldown_until?: string | null | undefined;
4881
+ last_failure_code?: string | null | undefined;
4882
+ last_failure_message?: string | null | undefined;
4883
+ last_failure_at?: string | null | undefined;
4884
+ opened_at?: string | null | undefined;
4885
+ }[];
4886
+ paused_breakers: {
4887
+ updated_at: string;
4888
+ state: "paused" | "closed" | "open" | "half_open";
4889
+ provider_id: string;
4890
+ service_key: string;
4891
+ key: string;
4892
+ failure_count: number;
4893
+ cooldown_until?: string | null | undefined;
4894
+ last_failure_code?: string | null | undefined;
4895
+ last_failure_message?: string | null | undefined;
4896
+ last_failure_at?: string | null | undefined;
4897
+ opened_at?: string | null | undefined;
4898
+ }[];
4899
+ half_open_breakers: {
4900
+ updated_at: string;
4901
+ state: "paused" | "closed" | "open" | "half_open";
4902
+ provider_id: string;
4903
+ service_key: string;
4904
+ key: string;
4905
+ failure_count: number;
4906
+ cooldown_until?: string | null | undefined;
4907
+ last_failure_code?: string | null | undefined;
4908
+ last_failure_message?: string | null | undefined;
4909
+ last_failure_at?: string | null | undefined;
4910
+ opened_at?: string | null | undefined;
4911
+ }[];
4912
+ };
4913
+ blocked_work: {
4914
+ kind: "backpressure" | "auth_wait" | "guardrail_open" | "provider_unavailable";
4915
+ reason: string;
4916
+ provider_id: string;
4917
+ service_key: string;
4918
+ since: string;
4919
+ goal_id?: string | null | undefined;
4920
+ run_id?: string | null | undefined;
4921
+ handoff_id?: string | null | undefined;
4922
+ retry_after?: string | null | undefined;
4923
+ }[];
4924
+ }>;
4925
+ export type RuntimeAutomationSnapshot = z.infer<typeof RuntimeAutomationSnapshotSchema>;
2746
4926
  export declare function summarizeRuntimeHealthStatus(components: Record<string, RuntimeHealthStatus>): RuntimeHealthStatus;
2747
4927
  export declare function classifyLongRunHealth(signals: RuntimeLongRunHealthSignals): RuntimeLongRunHealthSummary;
2748
4928
  export declare function buildLongRunHealth(signals: RuntimeLongRunHealthSignals, checkedAt?: number): RuntimeLongRunHealth;