@mongodb-js/agent-engine-runner-shared 0.11.3

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 (220) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/LICENSE.md +201 -0
  3. package/README.md +29 -0
  4. package/dist/agent_config.d.ts +167 -0
  5. package/dist/agent_config.d.ts.map +1 -0
  6. package/dist/agent_config.js +544 -0
  7. package/dist/call_interrupted.d.ts +12 -0
  8. package/dist/call_interrupted.d.ts.map +1 -0
  9. package/dist/call_interrupted.js +11 -0
  10. package/dist/checkpoint_workspace.d.ts +25 -0
  11. package/dist/checkpoint_workspace.d.ts.map +1 -0
  12. package/dist/checkpoint_workspace.js +44 -0
  13. package/dist/context.d.ts +235 -0
  14. package/dist/context.d.ts.map +1 -0
  15. package/dist/context.js +322 -0
  16. package/dist/db_config.d.ts +28 -0
  17. package/dist/db_config.d.ts.map +1 -0
  18. package/dist/db_config.js +66 -0
  19. package/dist/db_naming.d.ts +54 -0
  20. package/dist/db_naming.d.ts.map +1 -0
  21. package/dist/db_naming.js +94 -0
  22. package/dist/error_reporting.d.ts +67 -0
  23. package/dist/error_reporting.d.ts.map +1 -0
  24. package/dist/error_reporting.js +311 -0
  25. package/dist/generated/workflow/v1/activity_pb.d.ts +342 -0
  26. package/dist/generated/workflow/v1/activity_pb.d.ts.map +1 -0
  27. package/dist/generated/workflow/v1/activity_pb.js +115 -0
  28. package/dist/generated/workflow/v1/common_pb.d.ts +184 -0
  29. package/dist/generated/workflow/v1/common_pb.d.ts.map +1 -0
  30. package/dist/generated/workflow/v1/common_pb.js +86 -0
  31. package/dist/generated/workflow/v1/runtime_pb.d.ts +200 -0
  32. package/dist/generated/workflow/v1/runtime_pb.d.ts.map +1 -0
  33. package/dist/generated/workflow/v1/runtime_pb.js +40 -0
  34. package/dist/generated/workflow/v1/state_pb.d.ts +254 -0
  35. package/dist/generated/workflow/v1/state_pb.d.ts.map +1 -0
  36. package/dist/generated/workflow/v1/state_pb.js +68 -0
  37. package/dist/guardrails_evaluator/core.d.ts +23 -0
  38. package/dist/guardrails_evaluator/core.d.ts.map +1 -0
  39. package/dist/guardrails_evaluator/core.js +122 -0
  40. package/dist/guardrails_evaluator/index.d.ts +10 -0
  41. package/dist/guardrails_evaluator/index.d.ts.map +1 -0
  42. package/dist/guardrails_evaluator/index.js +11 -0
  43. package/dist/guardrails_evaluator/regex.d.ts +20 -0
  44. package/dist/guardrails_evaluator/regex.d.ts.map +1 -0
  45. package/dist/guardrails_evaluator/regex.js +233 -0
  46. package/dist/hooks.d.ts +109 -0
  47. package/dist/hooks.d.ts.map +1 -0
  48. package/dist/hooks.js +216 -0
  49. package/dist/http_path.d.ts +18 -0
  50. package/dist/http_path.d.ts.map +1 -0
  51. package/dist/http_path.js +53 -0
  52. package/dist/index.d.ts +35 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +41 -0
  55. package/dist/launcher.d.ts +130 -0
  56. package/dist/launcher.d.ts.map +1 -0
  57. package/dist/launcher.js +325 -0
  58. package/dist/logger.d.ts +96 -0
  59. package/dist/logger.d.ts.map +1 -0
  60. package/dist/logger.js +204 -0
  61. package/dist/mcp_oauth.d.ts +51 -0
  62. package/dist/mcp_oauth.d.ts.map +1 -0
  63. package/dist/mcp_oauth.js +389 -0
  64. package/dist/mcp_oauth_secret.d.ts +21 -0
  65. package/dist/mcp_oauth_secret.d.ts.map +1 -0
  66. package/dist/mcp_oauth_secret.js +122 -0
  67. package/dist/mcp_tools.d.ts +71 -0
  68. package/dist/mcp_tools.d.ts.map +1 -0
  69. package/dist/mcp_tools.js +301 -0
  70. package/dist/memory_appbound.d.ts +42 -0
  71. package/dist/memory_appbound.d.ts.map +1 -0
  72. package/dist/memory_appbound.js +159 -0
  73. package/dist/memory_writer.d.ts +49 -0
  74. package/dist/memory_writer.d.ts.map +1 -0
  75. package/dist/memory_writer.js +171 -0
  76. package/dist/metrics.d.ts +84 -0
  77. package/dist/metrics.d.ts.map +1 -0
  78. package/dist/metrics.js +205 -0
  79. package/dist/models.d.ts +1458 -0
  80. package/dist/models.d.ts.map +1 -0
  81. package/dist/models.js +1726 -0
  82. package/dist/node_logger.d.ts +43 -0
  83. package/dist/node_logger.d.ts.map +1 -0
  84. package/dist/node_logger.js +158 -0
  85. package/dist/owner_callback.d.ts +16 -0
  86. package/dist/owner_callback.d.ts.map +1 -0
  87. package/dist/owner_callback.js +40 -0
  88. package/dist/progress.d.ts +57 -0
  89. package/dist/progress.d.ts.map +1 -0
  90. package/dist/progress.js +140 -0
  91. package/dist/runtime.d.ts +131 -0
  92. package/dist/runtime.d.ts.map +1 -0
  93. package/dist/runtime.js +351 -0
  94. package/dist/secure_llm_proxy.d.ts +115 -0
  95. package/dist/secure_llm_proxy.d.ts.map +1 -0
  96. package/dist/secure_llm_proxy.js +922 -0
  97. package/dist/secure_wrapper.d.ts +332 -0
  98. package/dist/secure_wrapper.d.ts.map +1 -0
  99. package/dist/secure_wrapper.js +1249 -0
  100. package/dist/server/aer.d.ts +61 -0
  101. package/dist/server/aer.d.ts.map +1 -0
  102. package/dist/server/aer.js +1124 -0
  103. package/dist/server/auth.d.ts +56 -0
  104. package/dist/server/auth.d.ts.map +1 -0
  105. package/dist/server/auth.js +132 -0
  106. package/dist/server/base.d.ts +104 -0
  107. package/dist/server/base.d.ts.map +1 -0
  108. package/dist/server/base.js +150 -0
  109. package/dist/server/callInterrupt.d.ts +49 -0
  110. package/dist/server/callInterrupt.d.ts.map +1 -0
  111. package/dist/server/callInterrupt.js +68 -0
  112. package/dist/server/callback_delivery.d.ts +14 -0
  113. package/dist/server/callback_delivery.d.ts.map +1 -0
  114. package/dist/server/callback_delivery.js +141 -0
  115. package/dist/server/chunk_types.d.ts +50 -0
  116. package/dist/server/chunk_types.d.ts.map +1 -0
  117. package/dist/server/chunk_types.js +62 -0
  118. package/dist/server/cors.d.ts +52 -0
  119. package/dist/server/cors.d.ts.map +1 -0
  120. package/dist/server/cors.js +107 -0
  121. package/dist/server/drain.d.ts +169 -0
  122. package/dist/server/drain.d.ts.map +1 -0
  123. package/dist/server/drain.js +455 -0
  124. package/dist/server/function.d.ts +77 -0
  125. package/dist/server/function.d.ts.map +1 -0
  126. package/dist/server/function.js +337 -0
  127. package/dist/server/http_retry.d.ts +37 -0
  128. package/dist/server/http_retry.d.ts.map +1 -0
  129. package/dist/server/http_retry.js +157 -0
  130. package/dist/server/index.d.ts +7 -0
  131. package/dist/server/index.d.ts.map +1 -0
  132. package/dist/server/index.js +5 -0
  133. package/dist/server/metadata.d.ts +50 -0
  134. package/dist/server/metadata.d.ts.map +1 -0
  135. package/dist/server/metadata.js +193 -0
  136. package/dist/server/oe_url.d.ts +36 -0
  137. package/dist/server/oe_url.d.ts.map +1 -0
  138. package/dist/server/oe_url.js +50 -0
  139. package/dist/server/owner_url.d.ts +35 -0
  140. package/dist/server/owner_url.d.ts.map +1 -0
  141. package/dist/server/owner_url.js +146 -0
  142. package/dist/server/query.d.ts +42 -0
  143. package/dist/server/query.d.ts.map +1 -0
  144. package/dist/server/query.js +28 -0
  145. package/dist/server/tool.d.ts +138 -0
  146. package/dist/server/tool.d.ts.map +1 -0
  147. package/dist/server/tool.js +1017 -0
  148. package/dist/span_names.d.ts +21 -0
  149. package/dist/span_names.d.ts.map +1 -0
  150. package/dist/span_names.js +31 -0
  151. package/dist/structured_logging/constants.d.ts +17 -0
  152. package/dist/structured_logging/constants.d.ts.map +1 -0
  153. package/dist/structured_logging/constants.js +71 -0
  154. package/dist/structured_logging/env.d.ts +18 -0
  155. package/dist/structured_logging/env.d.ts.map +1 -0
  156. package/dist/structured_logging/env.js +39 -0
  157. package/dist/structured_logging/install.d.ts +56 -0
  158. package/dist/structured_logging/install.d.ts.map +1 -0
  159. package/dist/structured_logging/install.js +107 -0
  160. package/dist/structured_logging/layout.d.ts +9 -0
  161. package/dist/structured_logging/layout.d.ts.map +1 -0
  162. package/dist/structured_logging/layout.js +144 -0
  163. package/dist/structured_logging/serialize.d.ts +27 -0
  164. package/dist/structured_logging/serialize.d.ts.map +1 -0
  165. package/dist/structured_logging/serialize.js +61 -0
  166. package/dist/structured_logging/stdio_capture.d.ts +59 -0
  167. package/dist/structured_logging/stdio_capture.d.ts.map +1 -0
  168. package/dist/structured_logging/stdio_capture.js +164 -0
  169. package/dist/structured_logging/uncaught.d.ts +14 -0
  170. package/dist/structured_logging/uncaught.d.ts.map +1 -0
  171. package/dist/structured_logging/uncaught.js +58 -0
  172. package/dist/structured_logging.d.ts +48 -0
  173. package/dist/structured_logging.d.ts.map +1 -0
  174. package/dist/structured_logging.js +47 -0
  175. package/dist/tls_client.d.ts +61 -0
  176. package/dist/tls_client.d.ts.map +1 -0
  177. package/dist/tls_client.js +298 -0
  178. package/dist/tool_api_error.d.ts +62 -0
  179. package/dist/tool_api_error.d.ts.map +1 -0
  180. package/dist/tool_api_error.js +399 -0
  181. package/dist/tool_memory_ownership.d.ts +10 -0
  182. package/dist/tool_memory_ownership.d.ts.map +1 -0
  183. package/dist/tool_memory_ownership.js +36 -0
  184. package/dist/toolpod_handlers.d.ts +126 -0
  185. package/dist/toolpod_handlers.d.ts.map +1 -0
  186. package/dist/toolpod_handlers.js +1016 -0
  187. package/dist/tracing/exporters.d.ts +51 -0
  188. package/dist/tracing/exporters.d.ts.map +1 -0
  189. package/dist/tracing/exporters.js +327 -0
  190. package/dist/tracing/index.d.ts +3 -0
  191. package/dist/tracing/index.d.ts.map +1 -0
  192. package/dist/tracing/index.js +2 -0
  193. package/dist/tracing/setup.d.ts +76 -0
  194. package/dist/tracing/setup.d.ts.map +1 -0
  195. package/dist/tracing/setup.js +436 -0
  196. package/dist/utils.d.ts +204 -0
  197. package/dist/utils.d.ts.map +1 -0
  198. package/dist/utils.js +867 -0
  199. package/dist/workflow/activity.d.ts +71 -0
  200. package/dist/workflow/activity.d.ts.map +1 -0
  201. package/dist/workflow/activity.js +357 -0
  202. package/dist/workflow/attempt.d.ts +12 -0
  203. package/dist/workflow/attempt.d.ts.map +1 -0
  204. package/dist/workflow/attempt.js +96 -0
  205. package/dist/workflow/client.d.ts +46 -0
  206. package/dist/workflow/client.d.ts.map +1 -0
  207. package/dist/workflow/client.js +299 -0
  208. package/dist/workflow/context.d.ts +37 -0
  209. package/dist/workflow/context.d.ts.map +1 -0
  210. package/dist/workflow/context.js +350 -0
  211. package/dist/workflow/heartbeat.d.ts +15 -0
  212. package/dist/workflow/heartbeat.d.ts.map +1 -0
  213. package/dist/workflow/heartbeat.js +78 -0
  214. package/dist/workflow/index.d.ts +14 -0
  215. package/dist/workflow/index.d.ts.map +1 -0
  216. package/dist/workflow/index.js +10 -0
  217. package/dist/workflow/memory.d.ts +17 -0
  218. package/dist/workflow/memory.d.ts.map +1 -0
  219. package/dist/workflow/memory.js +184 -0
  220. package/package.json +73 -0
@@ -0,0 +1,1458 @@
1
+ /**
2
+ * Shared wire-protocol models for Runner SDK components.
3
+ *
4
+ * Defines the API contracts between:
5
+ * - Orchestration Engine (OE)
6
+ * - Agent Execution Runtime (AER)
7
+ * - Tool Executor Pod
8
+ *
9
+ * Each Pydantic model in `agent_engine_runner_shared/models.py` maps to:
10
+ * - a Zod schema (`FooSchema`) for runtime validation, and
11
+ * - the inferred TS type (`Foo = z.infer<typeof FooSchema>`).
12
+ *
13
+ * Models with non-trivial methods (`LLMResult`) follow the agent-engine-sdk
14
+ * pattern of class + separate schema.
15
+ */
16
+ import { z } from "zod";
17
+ import type { JsonValue } from "@mongodb-js/agent-engine-sdk";
18
+ import { LLMInvocationOptions, LLMResponse, LLMTokenUsage, LLMToolCall, LLMToolSchema, type Message, type ToolCallChunk } from "@mongodb-js/agent-engine-sdk";
19
+ /** Status of an agent execution. */
20
+ export declare const ExecutionStatusSchema: z.ZodEnum<{
21
+ error: "error";
22
+ pending: "pending";
23
+ running: "running";
24
+ suspended: "suspended";
25
+ resuming: "resuming";
26
+ completed: "completed";
27
+ cancelled: "cancelled";
28
+ }>;
29
+ export type ExecutionStatus = z.infer<typeof ExecutionStatusSchema>;
30
+ export declare const ExecutionStatus: {
31
+ readonly PENDING: "pending";
32
+ readonly RUNNING: "running";
33
+ readonly SUSPENDED: "suspended";
34
+ readonly RESUMING: "resuming";
35
+ readonly COMPLETED: "completed";
36
+ readonly ERROR: "error";
37
+ readonly CANCELLED: "cancelled";
38
+ };
39
+ /**
40
+ * Payload returned by an agent tool to trigger human-in-the-loop suspension.
41
+ *
42
+ * Agent tools signal a suspend by returning a JSON string containing these
43
+ * fields. The `__suspend__` flag is stripped before the payload is passed
44
+ * to the framework's interrupt() handler.
45
+ *
46
+ * Example usage in an agent tool:
47
+ *
48
+ * import { suspendPayloadToJson } from '@mongodb-js/agent-engine-runner-shared'
49
+ * return suspendPayloadToJson({
50
+ * suspend_reason: 'awaiting_human_review',
51
+ * suspend_context: { claim_id: 'C-123', task_id: 'T-456' },
52
+ * })
53
+ */
54
+ export declare const SuspendPayloadSchema: z.ZodObject<{
55
+ suspend_reason: z.ZodString;
56
+ suspend_context: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
57
+ }, z.core.$strip>;
58
+ export type SuspendPayload = z.infer<typeof SuspendPayloadSchema>;
59
+ /**
60
+ * Serialize a SuspendPayload to the suspend wire marker, and record an
61
+ * out-of-band suspend request on the current execution frame.
62
+ *
63
+ * The Tool Pod honors suspend from that recorded signal — set only here, in
64
+ * the tool author's own code — not by sniffing tool-result content, so
65
+ * untrusted data a tool relays can no longer forge a HITL suspend. The marker
66
+ * string is still returned unchanged for wire/replay compatibility.
67
+ */
68
+ export declare function suspendPayloadToJson(payload: SuspendPayload): string;
69
+ /**
70
+ * Result from agent execution when the agent is suspended.
71
+ *
72
+ * Contains the suspend payload directly (framework-agnostic) rather than
73
+ * wrapping framework-specific Interrupt objects. Any framework-specific
74
+ * state needed to resume (LangGraph checkpoint id, ADK function-call
75
+ * correlation, etc.) is carried opaquely in `metadata` — the AER never
76
+ * inspects it; the framework adapter writes it on suspend and reads it back
77
+ * from `RequestContext.metadata` on resume.
78
+ */
79
+ export declare const PendingInterruptSchema: z.ZodObject<{
80
+ id: z.ZodString;
81
+ value: z.ZodUnknown;
82
+ }, z.core.$strip>;
83
+ export type PendingInterrupt = z.infer<typeof PendingInterruptSchema>;
84
+ export declare const InterruptResultSchema: z.ZodObject<{
85
+ suspend_payload: z.ZodUnknown;
86
+ interrupts: z.ZodOptional<z.ZodArray<z.ZodObject<{
87
+ id: z.ZodString;
88
+ value: z.ZodUnknown;
89
+ }, z.core.$strip>>>;
90
+ resume_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
91
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
92
+ messages: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
93
+ role: z.ZodEnum<{
94
+ user: "user";
95
+ assistant: "assistant";
96
+ tool: "tool";
97
+ system: "system";
98
+ }>;
99
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
100
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
101
+ text: z.ZodString;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ type: z.ZodDefault<z.ZodLiteral<"image">>;
104
+ url: z.ZodString;
105
+ mime_type: z.ZodOptional<z.ZodString>;
106
+ }, z.core.$strip>, z.ZodObject<{
107
+ type: z.ZodDefault<z.ZodLiteral<"document">>;
108
+ url: z.ZodString;
109
+ mime_type: z.ZodOptional<z.ZodString>;
110
+ filename: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strip>], "type">>]>;
112
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
113
+ id: z.ZodOptional<z.ZodString>;
114
+ name: z.ZodOptional<z.ZodString>;
115
+ args: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
116
+ arguments: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
117
+ type: z.ZodOptional<z.ZodString>;
118
+ index: z.ZodOptional<z.ZodNumber>;
119
+ }, z.core.$strip>, z.ZodTransform<LLMToolCall, {
120
+ id?: string | undefined;
121
+ name?: string | undefined;
122
+ args?: JsonValue | undefined;
123
+ arguments?: JsonValue | undefined;
124
+ type?: string | undefined;
125
+ index?: number | undefined;
126
+ }>>>>;
127
+ tool_call_id: z.ZodOptional<z.ZodString>;
128
+ is_error: z.ZodOptional<z.ZodBoolean>;
129
+ name: z.ZodOptional<z.ZodString>;
130
+ id: z.ZodOptional<z.ZodString>;
131
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
132
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
133
+ }, z.core.$loose>, z.ZodTransform<Message, {
134
+ [x: string]: unknown;
135
+ role: "user" | "assistant" | "tool" | "system";
136
+ content: string | ({
137
+ type: "text";
138
+ text: string;
139
+ } | {
140
+ type: "image";
141
+ url: string;
142
+ mime_type?: string | undefined;
143
+ } | {
144
+ type: "document";
145
+ url: string;
146
+ mime_type?: string | undefined;
147
+ filename?: string | undefined;
148
+ })[];
149
+ tool_calls?: LLMToolCall[] | undefined;
150
+ tool_call_id?: string | undefined;
151
+ is_error?: boolean | undefined;
152
+ name?: string | undefined;
153
+ id?: string | undefined;
154
+ additional_kwargs?: Record<string, JsonValue> | undefined;
155
+ response_metadata?: Record<string, JsonValue> | undefined;
156
+ }>>>>;
157
+ }, z.core.$strip>;
158
+ export type InterruptResult = z.infer<typeof InterruptResultSchema>;
159
+ /**
160
+ * Result from agent execution for normal completion.
161
+ *
162
+ * Returned by _execute_via_agent_stream when the agent finishes without
163
+ * suspend. The caller uses content for the final response and messages
164
+ * for memory writing.
165
+ */
166
+ export declare const StreamingResultSchema: z.ZodObject<{
167
+ content: z.ZodDefault<z.ZodString>;
168
+ messages: z.ZodDefault<z.ZodArray<z.ZodPipe<z.ZodObject<{
169
+ role: z.ZodEnum<{
170
+ user: "user";
171
+ assistant: "assistant";
172
+ tool: "tool";
173
+ system: "system";
174
+ }>;
175
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
176
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
177
+ text: z.ZodString;
178
+ }, z.core.$strip>, z.ZodObject<{
179
+ type: z.ZodDefault<z.ZodLiteral<"image">>;
180
+ url: z.ZodString;
181
+ mime_type: z.ZodOptional<z.ZodString>;
182
+ }, z.core.$strip>, z.ZodObject<{
183
+ type: z.ZodDefault<z.ZodLiteral<"document">>;
184
+ url: z.ZodString;
185
+ mime_type: z.ZodOptional<z.ZodString>;
186
+ filename: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$strip>], "type">>]>;
188
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
189
+ id: z.ZodOptional<z.ZodString>;
190
+ name: z.ZodOptional<z.ZodString>;
191
+ args: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
192
+ arguments: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
193
+ type: z.ZodOptional<z.ZodString>;
194
+ index: z.ZodOptional<z.ZodNumber>;
195
+ }, z.core.$strip>, z.ZodTransform<LLMToolCall, {
196
+ id?: string | undefined;
197
+ name?: string | undefined;
198
+ args?: JsonValue | undefined;
199
+ arguments?: JsonValue | undefined;
200
+ type?: string | undefined;
201
+ index?: number | undefined;
202
+ }>>>>;
203
+ tool_call_id: z.ZodOptional<z.ZodString>;
204
+ is_error: z.ZodOptional<z.ZodBoolean>;
205
+ name: z.ZodOptional<z.ZodString>;
206
+ id: z.ZodOptional<z.ZodString>;
207
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
208
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
209
+ }, z.core.$loose>, z.ZodTransform<Message, {
210
+ [x: string]: unknown;
211
+ role: "user" | "assistant" | "tool" | "system";
212
+ content: string | ({
213
+ type: "text";
214
+ text: string;
215
+ } | {
216
+ type: "image";
217
+ url: string;
218
+ mime_type?: string | undefined;
219
+ } | {
220
+ type: "document";
221
+ url: string;
222
+ mime_type?: string | undefined;
223
+ filename?: string | undefined;
224
+ })[];
225
+ tool_calls?: LLMToolCall[] | undefined;
226
+ tool_call_id?: string | undefined;
227
+ is_error?: boolean | undefined;
228
+ name?: string | undefined;
229
+ id?: string | undefined;
230
+ additional_kwargs?: Record<string, JsonValue> | undefined;
231
+ response_metadata?: Record<string, JsonValue> | undefined;
232
+ }>>>>;
233
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
234
+ }, z.core.$strip>;
235
+ export type StreamingResult = z.infer<typeof StreamingResultSchema>;
236
+ /** Request to invoke the agent (compatible with agent-runtime). */
237
+ export declare const InvokeRequestSchema: z.ZodObject<{
238
+ message: z.ZodString;
239
+ session_id: z.ZodOptional<z.ZodString>;
240
+ org_id: z.ZodOptional<z.ZodString>;
241
+ user_id: z.ZodOptional<z.ZodString>;
242
+ workspace_id: z.ZodOptional<z.ZodString>;
243
+ project_id: z.ZodOptional<z.ZodString>;
244
+ aer_url: z.ZodOptional<z.ZodString>;
245
+ tool_url: z.ZodOptional<z.ZodString>;
246
+ wait: z.ZodDefault<z.ZodBoolean>;
247
+ custom_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
248
+ }, z.core.$strip>;
249
+ export type InvokeRequest = z.infer<typeof InvokeRequestSchema>;
250
+ /** Response from invoking the agent (compatible with agent-runtime). */
251
+ export declare const InvokeResponseSchema: z.ZodObject<{
252
+ result: z.ZodOptional<z.ZodUnknown>;
253
+ session_id: z.ZodOptional<z.ZodString>;
254
+ user_id: z.ZodOptional<z.ZodString>;
255
+ execution_id: z.ZodOptional<z.ZodString>;
256
+ status: z.ZodOptional<z.ZodString>;
257
+ error: z.ZodOptional<z.ZodString>;
258
+ }, z.core.$strip>;
259
+ export type InvokeResponse = z.infer<typeof InvokeResponseSchema>;
260
+ /** Request to execute an agent in AER. */
261
+ export declare const ExecuteRequestSchema: z.ZodObject<{
262
+ platform_trace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
263
+ execution_id: z.ZodString;
264
+ message: z.ZodDefault<z.ZodString>;
265
+ platform_api_url: z.ZodString;
266
+ suspend_generation: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | undefined, number | null>>>;
267
+ platform_api_owner_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
268
+ resume: z.ZodDefault<z.ZodBoolean>;
269
+ resume_from_step: z.ZodOptional<z.ZodNumber>;
270
+ resume_data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
271
+ org_id: z.ZodOptional<z.ZodString>;
272
+ user_id: z.ZodOptional<z.ZodString>;
273
+ session_id: z.ZodOptional<z.ZodString>;
274
+ workspace_id: z.ZodOptional<z.ZodString>;
275
+ project_id: z.ZodOptional<z.ZodString>;
276
+ custom_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
277
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
278
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
279
+ previous_execution_cancelled: z.ZodDefault<z.ZodBoolean>;
280
+ }, z.core.$strip>;
281
+ export type ExecuteRequest = z.infer<typeof ExecuteRequestSchema>;
282
+ /**
283
+ * Request to execute a tool (AER → OE for approval).
284
+ */
285
+ export declare const ToolExecuteRequestSchema: z.ZodObject<{
286
+ execution_id: z.ZodString;
287
+ tool_name: z.ZodString;
288
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
289
+ step_number: z.ZodNumber;
290
+ tool_call_id: z.ZodOptional<z.ZodString>;
291
+ kind: z.ZodOptional<z.ZodString>;
292
+ is_local: z.ZodDefault<z.ZodBoolean>;
293
+ redact_fields: z.ZodDefault<z.ZodArray<z.ZodString>>;
294
+ provider_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
295
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
296
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
297
+ custom_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
298
+ trace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
299
+ span_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
300
+ }, z.core.$strip>;
301
+ export type ToolExecuteRequest = z.infer<typeof ToolExecuteRequestSchema>;
302
+ /** Authorization details returned when broker consent is required. */
303
+ export declare const ElicitationInfoSchema: z.ZodObject<{
304
+ elicitation_id: z.ZodString;
305
+ authorization_url: z.ZodString;
306
+ message: z.ZodDefault<z.ZodString>;
307
+ created: z.ZodDefault<z.ZodBoolean>;
308
+ }, z.core.$strip>;
309
+ export type ElicitationInfo = z.infer<typeof ElicitationInfoSchema>;
310
+ /** Identity of the policy that caused a guardrail block or require_review halt. */
311
+ export declare const GuardrailMetaSchema: z.ZodObject<{
312
+ guardrail_id: z.ZodString;
313
+ guardrail_category: z.ZodString;
314
+ }, z.core.$strip>;
315
+ export type GuardrailMeta = z.infer<typeof GuardrailMetaSchema>;
316
+ /**
317
+ * Assemble `guardrail_meta` from the flat `guardrail_id`/`guardrail_category`
318
+ * fields the OE wire format sends, so callers work with a single structured
319
+ * object. Mirrors Python's `_assemble_guardrail_meta` model validator.
320
+ */
321
+ export declare const ToolExecuteResponseSchema: z.ZodPreprocess<z.ZodObject<{
322
+ proceed: z.ZodBoolean;
323
+ cached_result: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
324
+ route_to: z.ZodOptional<z.ZodNullable<z.ZodString>>;
325
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
+ elicitation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
327
+ elicitation_id: z.ZodString;
328
+ authorization_url: z.ZodString;
329
+ message: z.ZodDefault<z.ZodString>;
330
+ created: z.ZodDefault<z.ZodBoolean>;
331
+ }, z.core.$strip>>>;
332
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
+ result: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
334
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
335
+ error_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
336
+ retryable: z.ZodDefault<z.ZodBoolean>;
337
+ latest_step_number: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
338
+ from_cache: z.ZodDefault<z.ZodBoolean>;
339
+ duration_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
340
+ pod_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
341
+ guardrail_meta: z.ZodOptional<z.ZodNullable<z.ZodObject<{
342
+ guardrail_id: z.ZodString;
343
+ guardrail_category: z.ZodString;
344
+ }, z.core.$strip>>>;
345
+ tool_api_error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
346
+ provider_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
+ classification: z.ZodString;
348
+ http_status: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
349
+ retryable: z.ZodBoolean;
350
+ error_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
351
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
352
+ }, z.core.$strip>>>;
353
+ }, z.core.$strip>>;
354
+ export type ToolExecuteResponse = z.infer<typeof ToolExecuteResponseSchema>;
355
+ /**
356
+ * Report tool execution result (AER → OE).
357
+ */
358
+ export declare const ToolResultRequestSchema: z.ZodObject<{
359
+ execution_id: z.ZodString;
360
+ step_number: z.ZodNumber;
361
+ tool_name: z.ZodString;
362
+ tool_call_id: z.ZodOptional<z.ZodString>;
363
+ status: z.ZodString;
364
+ result: z.ZodOptional<z.ZodUnknown>;
365
+ error: z.ZodOptional<z.ZodString>;
366
+ duration_ms: z.ZodNumber;
367
+ pod_name: z.ZodOptional<z.ZodString>;
368
+ prompt_tokens: z.ZodOptional<z.ZodNumber>;
369
+ completion_tokens: z.ZodOptional<z.ZodNumber>;
370
+ total_tokens: z.ZodOptional<z.ZodNumber>;
371
+ model: z.ZodOptional<z.ZodString>;
372
+ workspace_id: z.ZodOptional<z.ZodString>;
373
+ kind: z.ZodOptional<z.ZodString>;
374
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
375
+ trace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
376
+ span_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
377
+ tool_api_error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
378
+ provider_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
379
+ classification: z.ZodString;
380
+ http_status: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
381
+ retryable: z.ZodBoolean;
382
+ error_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
383
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
384
+ }, z.core.$strip>>>;
385
+ }, z.core.$strip>;
386
+ export type ToolResultRequest = z.infer<typeof ToolResultRequestSchema>;
387
+ export declare const MAX_TOOL_ARGUMENT_BYTES: number;
388
+ /** Delegated credential injected by OE for tool execution. */
389
+ export declare const ToolAuthorizationSchema: z.ZodObject<{
390
+ token: z.ZodString;
391
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
392
+ }, z.core.$strip>;
393
+ export type ToolAuthorization = z.infer<typeof ToolAuthorizationSchema>;
394
+ /** Request to execute a tool in a Tool Pod. */
395
+ export declare const ToolPodExecuteRequestSchema: z.ZodObject<{
396
+ platform_trace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
397
+ execution_id: z.ZodString;
398
+ tool_name: z.ZodString;
399
+ arguments: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
400
+ tool_call_id: z.ZodOptional<z.ZodString>;
401
+ step_number: z.ZodOptional<z.ZodNumber>;
402
+ session_id: z.ZodString;
403
+ user_id: z.ZodOptional<z.ZodString>;
404
+ oe_url: z.ZodOptional<z.ZodString>;
405
+ oe_owner_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
406
+ authorization: z.ZodOptional<z.ZodObject<{
407
+ token: z.ZodString;
408
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
409
+ }, z.core.$strip>>;
410
+ custom_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
411
+ payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
412
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
413
+ }, z.core.$strip>;
414
+ export type ToolPodExecuteRequest = z.infer<typeof ToolPodExecuteRequestSchema>;
415
+ /** Response from Tool Pod execution. */
416
+ export declare const ToolPodExecuteResponseSchema: z.ZodObject<{
417
+ status: z.ZodString;
418
+ result: z.ZodOptional<z.ZodUnknown>;
419
+ error: z.ZodOptional<z.ZodString>;
420
+ pod_name: z.ZodOptional<z.ZodString>;
421
+ kind: z.ZodOptional<z.ZodString>;
422
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
423
+ oob_suspend_supported: z.ZodOptional<z.ZodBoolean>;
424
+ tool_api_error: z.ZodOptional<z.ZodNullable<z.ZodObject<{
425
+ provider_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
426
+ classification: z.ZodString;
427
+ http_status: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
428
+ retryable: z.ZodBoolean;
429
+ error_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
430
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
431
+ }, z.core.$strip>>>;
432
+ }, z.core.$strip>;
433
+ export type ToolPodExecuteResponse = z.infer<typeof ToolPodExecuteResponseSchema>;
434
+ /** Runtime stage where OE is asking the Tool Pod to evaluate guardrails. */
435
+ export declare const GuardrailRuntimeStageSchema: z.ZodEnum<{
436
+ llm_input: "llm_input";
437
+ llm_output: "llm_output";
438
+ tool_input: "tool_input";
439
+ tool_output: "tool_output";
440
+ }>;
441
+ export type GuardrailRuntimeStage = z.infer<typeof GuardrailRuntimeStageSchema>;
442
+ export declare const GuardrailRuntimeStage: {
443
+ readonly LLM_INPUT: "llm_input";
444
+ readonly LLM_OUTPUT: "llm_output";
445
+ readonly TOOL_INPUT: "tool_input";
446
+ readonly TOOL_OUTPUT: "tool_output";
447
+ };
448
+ /** Decision returned by the Tool Pod guardrails evaluator. */
449
+ export declare const GuardrailCheckDecisionSchema: z.ZodEnum<{
450
+ allow: "allow";
451
+ block: "block";
452
+ modify: "modify";
453
+ require_review: "require_review";
454
+ log_only: "log_only";
455
+ }>;
456
+ export type GuardrailCheckDecision = z.infer<typeof GuardrailCheckDecisionSchema>;
457
+ export declare const GuardrailCheckDecision: {
458
+ readonly ALLOW: "allow";
459
+ readonly BLOCK: "block";
460
+ readonly MODIFY: "modify";
461
+ readonly REQUIRE_REVIEW: "require_review";
462
+ readonly LOG_ONLY: "log_only";
463
+ };
464
+ /** OE-selected guardrail policy sent to the Tool Pod for evaluation. */
465
+ export declare const GuardrailRuntimePolicySchema: z.ZodObject<{
466
+ id: z.ZodString;
467
+ type: z.ZodString;
468
+ status: z.ZodDefault<z.ZodString>;
469
+ action: z.ZodString;
470
+ stage_filter: z.ZodDefault<z.ZodArray<z.ZodString>>;
471
+ config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
472
+ }, z.core.$strip>;
473
+ export type GuardrailRuntimePolicy = z.infer<typeof GuardrailRuntimePolicySchema>;
474
+ /**
475
+ * Whether `policy` applies at `stage`. Inactive policies never apply; an empty
476
+ * stage filter applies to all stages; otherwise the stage must match (case- and
477
+ * whitespace-insensitive). Mirrors `GuardrailRuntimePolicy.applies_to_stage`.
478
+ */
479
+ export declare function appliesToStage(policy: GuardrailRuntimePolicy, stage: GuardrailRuntimeStage): boolean;
480
+ /**
481
+ * Resolve the decision a triggered policy requests, from its `action` (falling
482
+ * back to `config.on_fail`). Mirrors `GuardrailRuntimePolicy.check_decision`.
483
+ */
484
+ export declare function checkDecision(policy: GuardrailRuntimePolicy): GuardrailCheckDecision;
485
+ /** Runtime content and metadata to evaluate. */
486
+ export declare const GuardrailCheckInputSchema: z.ZodObject<{
487
+ text: z.ZodString;
488
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
489
+ }, z.core.$strip>;
490
+ export type GuardrailCheckInput = z.infer<typeof GuardrailCheckInputSchema>;
491
+ /** Execution context for a guardrail check. */
492
+ export declare const GuardrailCheckContextSchema: z.ZodObject<{
493
+ org_id: z.ZodString;
494
+ project_id: z.ZodString;
495
+ workspace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
496
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
497
+ user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
498
+ }, z.core.$strip>;
499
+ export type GuardrailCheckContext = z.infer<typeof GuardrailCheckContextSchema>;
500
+ /** Request from OE to Tool Pod to evaluate selected guardrail policies. */
501
+ export declare const GuardrailCheckRequestSchema: z.ZodObject<{
502
+ execution_id: z.ZodString;
503
+ stage: z.ZodEnum<{
504
+ llm_input: "llm_input";
505
+ llm_output: "llm_output";
506
+ tool_input: "tool_input";
507
+ tool_output: "tool_output";
508
+ }>;
509
+ input: z.ZodObject<{
510
+ text: z.ZodString;
511
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
512
+ }, z.core.$strip>;
513
+ context: z.ZodObject<{
514
+ org_id: z.ZodString;
515
+ project_id: z.ZodString;
516
+ workspace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
517
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
518
+ user_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
519
+ }, z.core.$strip>;
520
+ policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
521
+ id: z.ZodString;
522
+ type: z.ZodString;
523
+ status: z.ZodDefault<z.ZodString>;
524
+ action: z.ZodString;
525
+ stage_filter: z.ZodDefault<z.ZodArray<z.ZodString>>;
526
+ config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
527
+ }, z.core.$strip>>>;
528
+ }, z.core.$strip>;
529
+ export type GuardrailCheckRequest = z.infer<typeof GuardrailCheckRequestSchema>;
530
+ /** Evidence explaining why a guardrail policy triggered. */
531
+ export declare const GuardrailCheckEvidenceSchema: z.ZodObject<{
532
+ policy_id: z.ZodString;
533
+ message: z.ZodDefault<z.ZodString>;
534
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
535
+ }, z.core.$strip>;
536
+ export type GuardrailCheckEvidence = z.infer<typeof GuardrailCheckEvidenceSchema>;
537
+ /** Decision returned by the Tool Pod guardrails evaluator. */
538
+ export declare const GuardrailCheckResponseSchema: z.ZodObject<{
539
+ decision: z.ZodEnum<{
540
+ allow: "allow";
541
+ block: "block";
542
+ modify: "modify";
543
+ require_review: "require_review";
544
+ log_only: "log_only";
545
+ }>;
546
+ allowed: z.ZodBoolean;
547
+ transformed_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
548
+ triggered_policy_ids: z.ZodDefault<z.ZodArray<z.ZodString>>;
549
+ evidence: z.ZodDefault<z.ZodArray<z.ZodObject<{
550
+ policy_id: z.ZodString;
551
+ message: z.ZodDefault<z.ZodString>;
552
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
553
+ }, z.core.$strip>>>;
554
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
555
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
556
+ }, z.core.$strip>;
557
+ export type GuardrailCheckResponse = z.infer<typeof GuardrailCheckResponseSchema>;
558
+ /**
559
+ * Typed invoke_llm arguments forwarded through OE and tool pods.
560
+ *
561
+ * Python uses Pydantic aliases:
562
+ * - validation alias `stop` ↔ `stop_sequences`, serialization alias `stop`
563
+ * - pre-validator renames `kwargs` → `options`
564
+ *
565
+ * In Zod we replicate this with a `z.preprocess` that normalizes incoming
566
+ * payloads into the canonical schema (using `stop_sequences` and
567
+ * `options`). For outgoing serialization that needs the wire alias `stop`,
568
+ * use `serializeInvokeLLMRequestArguments()`.
569
+ */
570
+ export declare const InvokeLLMRequestArgumentsSchema: z.ZodPreprocess<z.ZodObject<{
571
+ model: z.ZodString;
572
+ messages: z.ZodArray<z.ZodPipe<z.ZodObject<{
573
+ role: z.ZodEnum<{
574
+ user: "user";
575
+ assistant: "assistant";
576
+ tool: "tool";
577
+ system: "system";
578
+ }>;
579
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
580
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
581
+ text: z.ZodString;
582
+ }, z.core.$strip>, z.ZodObject<{
583
+ type: z.ZodDefault<z.ZodLiteral<"image">>;
584
+ url: z.ZodString;
585
+ mime_type: z.ZodOptional<z.ZodString>;
586
+ }, z.core.$strip>, z.ZodObject<{
587
+ type: z.ZodDefault<z.ZodLiteral<"document">>;
588
+ url: z.ZodString;
589
+ mime_type: z.ZodOptional<z.ZodString>;
590
+ filename: z.ZodOptional<z.ZodString>;
591
+ }, z.core.$strip>], "type">>]>;
592
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
593
+ id: z.ZodOptional<z.ZodString>;
594
+ name: z.ZodOptional<z.ZodString>;
595
+ args: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
596
+ arguments: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
597
+ type: z.ZodOptional<z.ZodString>;
598
+ index: z.ZodOptional<z.ZodNumber>;
599
+ }, z.core.$strip>, z.ZodTransform<LLMToolCall, {
600
+ id?: string | undefined;
601
+ name?: string | undefined;
602
+ args?: JsonValue | undefined;
603
+ arguments?: JsonValue | undefined;
604
+ type?: string | undefined;
605
+ index?: number | undefined;
606
+ }>>>>;
607
+ tool_call_id: z.ZodOptional<z.ZodString>;
608
+ is_error: z.ZodOptional<z.ZodBoolean>;
609
+ name: z.ZodOptional<z.ZodString>;
610
+ id: z.ZodOptional<z.ZodString>;
611
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
612
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
613
+ }, z.core.$loose>, z.ZodTransform<Message, {
614
+ [x: string]: unknown;
615
+ role: "user" | "assistant" | "tool" | "system";
616
+ content: string | ({
617
+ type: "text";
618
+ text: string;
619
+ } | {
620
+ type: "image";
621
+ url: string;
622
+ mime_type?: string | undefined;
623
+ } | {
624
+ type: "document";
625
+ url: string;
626
+ mime_type?: string | undefined;
627
+ filename?: string | undefined;
628
+ })[];
629
+ tool_calls?: LLMToolCall[] | undefined;
630
+ tool_call_id?: string | undefined;
631
+ is_error?: boolean | undefined;
632
+ name?: string | undefined;
633
+ id?: string | undefined;
634
+ additional_kwargs?: Record<string, JsonValue> | undefined;
635
+ response_metadata?: Record<string, JsonValue> | undefined;
636
+ }>>>;
637
+ llm_id: z.ZodDefault<z.ZodString>;
638
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
639
+ tools: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
640
+ name: z.ZodOptional<z.ZodString>;
641
+ description: z.ZodOptional<z.ZodString>;
642
+ parameters: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
643
+ type: z.ZodOptional<z.ZodString>;
644
+ strict: z.ZodOptional<z.ZodBoolean>;
645
+ function: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
646
+ }, z.core.$strip>, z.ZodTransform<LLMToolSchema, {
647
+ name?: string | undefined;
648
+ description?: string | undefined;
649
+ parameters?: JsonValue | undefined;
650
+ type?: string | undefined;
651
+ strict?: boolean | undefined;
652
+ function?: JsonValue | undefined;
653
+ }>>>>;
654
+ tool_choice: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
655
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
656
+ max_tokens: z.ZodOptional<z.ZodNumber>;
657
+ response_format: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
658
+ top_p: z.ZodOptional<z.ZodNumber>;
659
+ top_k: z.ZodOptional<z.ZodNumber>;
660
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
661
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
662
+ seed: z.ZodOptional<z.ZodNumber>;
663
+ timeout: z.ZodOptional<z.ZodNumber>;
664
+ parallel_tool_calls: z.ZodOptional<z.ZodBoolean>;
665
+ reasoning_effort: z.ZodOptional<z.ZodString>;
666
+ }, z.core.$loose>, z.ZodTransform<LLMInvocationOptions, {
667
+ [x: string]: unknown;
668
+ max_tokens?: number | undefined;
669
+ response_format?: JsonValue | undefined;
670
+ top_p?: number | undefined;
671
+ top_k?: number | undefined;
672
+ frequency_penalty?: number | undefined;
673
+ presence_penalty?: number | undefined;
674
+ seed?: number | undefined;
675
+ timeout?: number | undefined;
676
+ parallel_tool_calls?: boolean | undefined;
677
+ reasoning_effort?: string | undefined;
678
+ }>>>>;
679
+ stream: z.ZodDefault<z.ZodBoolean>;
680
+ }, z.core.$strip>>;
681
+ export type InvokeLLMRequestArguments = z.infer<typeof InvokeLLMRequestArgumentsSchema>;
682
+ /**
683
+ * Serialize InvokeLLMRequestArguments to the snake_case wire shape, the
684
+ * equivalent of Python's `model_dump(by_alias=True)`:
685
+ * - `stop_sequences` → `stop` (Pydantic `serialization_alias="stop"`), and
686
+ * - each Message is dumped camel→snake via `serializeMessage`.
687
+ *
688
+ * Use this when sending to a Python consumer (OE / Tool Pod) that expects the
689
+ * snake_case wire fields.
690
+ */
691
+ export declare function serializeInvokeLLMRequestArguments(args: InvokeLLMRequestArguments): Record<string, unknown>;
692
+ /**
693
+ * Request to invoke LLM on a tool executor pod.
694
+ *
695
+ * Python pre-validator `_normalize_flat_payload`: if `arguments` is
696
+ * missing but `execution_id` is present, treat the remaining keys as
697
+ * the arguments payload. Same logic replicated via `z.preprocess`.
698
+ */
699
+ export declare const LLMPodInvokeRequestSchema: z.ZodPreprocess<z.ZodObject<{
700
+ platform_trace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
701
+ execution_id: z.ZodString;
702
+ arguments: z.ZodPreprocess<z.ZodObject<{
703
+ model: z.ZodString;
704
+ messages: z.ZodArray<z.ZodPipe<z.ZodObject<{
705
+ role: z.ZodEnum<{
706
+ user: "user";
707
+ assistant: "assistant";
708
+ tool: "tool";
709
+ system: "system";
710
+ }>;
711
+ content: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
712
+ type: z.ZodDefault<z.ZodLiteral<"text">>;
713
+ text: z.ZodString;
714
+ }, z.core.$strip>, z.ZodObject<{
715
+ type: z.ZodDefault<z.ZodLiteral<"image">>;
716
+ url: z.ZodString;
717
+ mime_type: z.ZodOptional<z.ZodString>;
718
+ }, z.core.$strip>, z.ZodObject<{
719
+ type: z.ZodDefault<z.ZodLiteral<"document">>;
720
+ url: z.ZodString;
721
+ mime_type: z.ZodOptional<z.ZodString>;
722
+ filename: z.ZodOptional<z.ZodString>;
723
+ }, z.core.$strip>], "type">>]>;
724
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
725
+ id: z.ZodOptional<z.ZodString>;
726
+ name: z.ZodOptional<z.ZodString>;
727
+ args: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
728
+ arguments: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
729
+ type: z.ZodOptional<z.ZodString>;
730
+ index: z.ZodOptional<z.ZodNumber>;
731
+ }, z.core.$strip>, z.ZodTransform<LLMToolCall, {
732
+ id?: string | undefined;
733
+ name?: string | undefined;
734
+ args?: JsonValue | undefined;
735
+ arguments?: JsonValue | undefined;
736
+ type?: string | undefined;
737
+ index?: number | undefined;
738
+ }>>>>;
739
+ tool_call_id: z.ZodOptional<z.ZodString>;
740
+ is_error: z.ZodOptional<z.ZodBoolean>;
741
+ name: z.ZodOptional<z.ZodString>;
742
+ id: z.ZodOptional<z.ZodString>;
743
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
744
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
745
+ }, z.core.$loose>, z.ZodTransform<Message, {
746
+ [x: string]: unknown;
747
+ role: "user" | "assistant" | "tool" | "system";
748
+ content: string | ({
749
+ type: "text";
750
+ text: string;
751
+ } | {
752
+ type: "image";
753
+ url: string;
754
+ mime_type?: string | undefined;
755
+ } | {
756
+ type: "document";
757
+ url: string;
758
+ mime_type?: string | undefined;
759
+ filename?: string | undefined;
760
+ })[];
761
+ tool_calls?: LLMToolCall[] | undefined;
762
+ tool_call_id?: string | undefined;
763
+ is_error?: boolean | undefined;
764
+ name?: string | undefined;
765
+ id?: string | undefined;
766
+ additional_kwargs?: Record<string, JsonValue> | undefined;
767
+ response_metadata?: Record<string, JsonValue> | undefined;
768
+ }>>>;
769
+ llm_id: z.ZodDefault<z.ZodString>;
770
+ stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
771
+ tools: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
772
+ name: z.ZodOptional<z.ZodString>;
773
+ description: z.ZodOptional<z.ZodString>;
774
+ parameters: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
775
+ type: z.ZodOptional<z.ZodString>;
776
+ strict: z.ZodOptional<z.ZodBoolean>;
777
+ function: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
778
+ }, z.core.$strip>, z.ZodTransform<LLMToolSchema, {
779
+ name?: string | undefined;
780
+ description?: string | undefined;
781
+ parameters?: JsonValue | undefined;
782
+ type?: string | undefined;
783
+ strict?: boolean | undefined;
784
+ function?: JsonValue | undefined;
785
+ }>>>>;
786
+ tool_choice: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
787
+ options: z.ZodOptional<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
788
+ max_tokens: z.ZodOptional<z.ZodNumber>;
789
+ response_format: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
790
+ top_p: z.ZodOptional<z.ZodNumber>;
791
+ top_k: z.ZodOptional<z.ZodNumber>;
792
+ frequency_penalty: z.ZodOptional<z.ZodNumber>;
793
+ presence_penalty: z.ZodOptional<z.ZodNumber>;
794
+ seed: z.ZodOptional<z.ZodNumber>;
795
+ timeout: z.ZodOptional<z.ZodNumber>;
796
+ parallel_tool_calls: z.ZodOptional<z.ZodBoolean>;
797
+ reasoning_effort: z.ZodOptional<z.ZodString>;
798
+ }, z.core.$loose>, z.ZodTransform<LLMInvocationOptions, {
799
+ [x: string]: unknown;
800
+ max_tokens?: number | undefined;
801
+ response_format?: JsonValue | undefined;
802
+ top_p?: number | undefined;
803
+ top_k?: number | undefined;
804
+ frequency_penalty?: number | undefined;
805
+ presence_penalty?: number | undefined;
806
+ seed?: number | undefined;
807
+ timeout?: number | undefined;
808
+ parallel_tool_calls?: boolean | undefined;
809
+ reasoning_effort?: string | undefined;
810
+ }>>>>;
811
+ stream: z.ZodDefault<z.ZodBoolean>;
812
+ }, z.core.$strip>>;
813
+ step_number: z.ZodOptional<z.ZodNumber>;
814
+ }, z.core.$strip>>;
815
+ export type LLMPodInvokeRequest = z.infer<typeof LLMPodInvokeRequestSchema>;
816
+ /**
817
+ * Normalized result from an LLM invocation.
818
+ *
819
+ * Provides a consistent shape for LLM responses regardless of the
820
+ * underlying provider (OpenAI, Gemini, Anthropic, etc.). Implemented as
821
+ * a class to mirror `LLMResponse` in agent-engine-sdk and to host the
822
+ * `fromResponse` / `toResponse` / `extractUsage` conversion methods.
823
+ */
824
+ export declare class LLMResult {
825
+ readonly content: string;
826
+ readonly toolCalls: LLMToolCall[];
827
+ readonly usage?: LLMTokenUsage;
828
+ readonly metadata: Record<string, JsonValue>;
829
+ readonly id?: string;
830
+ readonly name?: string;
831
+ readonly additionalKwargs?: Record<string, JsonValue>;
832
+ readonly responseMetadata?: Record<string, JsonValue>;
833
+ constructor(data: {
834
+ content?: string;
835
+ toolCalls?: LLMToolCall[];
836
+ usage?: LLMTokenUsage;
837
+ metadata?: Record<string, JsonValue>;
838
+ id?: string;
839
+ name?: string;
840
+ additionalKwargs?: Record<string, JsonValue>;
841
+ responseMetadata?: Record<string, JsonValue>;
842
+ });
843
+ /**
844
+ * Extract a normalized result from any LLM response object.
845
+ *
846
+ * Accepts an sdk-core `LLMResponse` directly, or a duck-typed object
847
+ * (e.g. raw provider response) by falling back to string-coerced
848
+ * content extraction.
849
+ */
850
+ static fromResponse(response: unknown): LLMResult;
851
+ /**
852
+ * Extract token usage metadata from any response or chunk.
853
+ *
854
+ * Checks (in order): sdk-core `LLMResponse.usage`, `usage_metadata`,
855
+ * `response_metadata.usage`, `response_metadata.token_usage`,
856
+ * `usage`, `metadata.usage`.
857
+ */
858
+ static extractUsage(response: unknown): LLMTokenUsage | undefined;
859
+ /** Convert the normalized runner result to sdk-core's LLMResponse shape. */
860
+ toResponse(): LLMResponse;
861
+ }
862
+ /** Coerce a provider usage blob into LLMTokenUsage, or undefined. */
863
+ export declare function coerceTokenUsage(value: unknown): LLMTokenUsage | undefined;
864
+ /** Merge stream usage field-by-field; incoming non-null fields win. */
865
+ export declare function mergeTokenUsage(existing: LLMTokenUsage | undefined, incoming: unknown): LLMTokenUsage | undefined;
866
+ /** Copy provider metadata into JSON-safe values, or undefined. */
867
+ export declare function jsonSafeMetadata(value: unknown, depth?: number): Record<string, JsonValue> | undefined;
868
+ /** Sum LangChain-style additive usage deltas into a cumulative snapshot. */
869
+ export declare function addTokenUsage(existing: LLMTokenUsage | undefined, incoming: unknown): LLMTokenUsage | undefined;
870
+ /** Fold a stream chunk's usage into a running snapshot.
871
+ *
872
+ * Cumulative providers repeat growing totals (`10/1` then `10/2`);
873
+ * last-wins merge keeps `10/2`. Additive providers zero-fill the
874
+ * unchanged side (`18/1` then `0/4`); those deltas are summed.
875
+ */
876
+ export declare function accumulateStreamUsage(existing: LLMTokenUsage | undefined, incoming: unknown): LLMTokenUsage | undefined;
877
+ /** Runtime validation schema for LLMResult wire data. `content` is the only required field. */
878
+ export declare const LLMResultSchema: z.ZodObject<{
879
+ content: z.ZodDefault<z.ZodString>;
880
+ tool_calls: z.ZodDefault<z.ZodArray<z.ZodUnknown>>;
881
+ usage: z.ZodOptional<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
882
+ input_tokens: z.ZodOptional<z.ZodNumber>;
883
+ output_tokens: z.ZodOptional<z.ZodNumber>;
884
+ prompt_tokens: z.ZodOptional<z.ZodNumber>;
885
+ completion_tokens: z.ZodOptional<z.ZodNumber>;
886
+ total_tokens: z.ZodOptional<z.ZodNumber>;
887
+ model: z.ZodOptional<z.ZodString>;
888
+ }, z.core.$strip>, z.ZodTransform<LLMTokenUsage, {
889
+ input_tokens?: number | undefined;
890
+ output_tokens?: number | undefined;
891
+ prompt_tokens?: number | undefined;
892
+ completion_tokens?: number | undefined;
893
+ total_tokens?: number | undefined;
894
+ model?: string | undefined;
895
+ }>>>>;
896
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
897
+ id: z.ZodOptional<z.ZodString>;
898
+ name: z.ZodOptional<z.ZodString>;
899
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
900
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
901
+ }, z.core.$loose>;
902
+ /**
903
+ * Response from LLM invocation on a tool executor pod.
904
+ *
905
+ * Python `_sync_usage_with_result` is a model_validator that mutates
906
+ * `result.usage` ↔ `usage`. TS `LLMResponse.usage` is readonly, so
907
+ * mutation isn't possible; callers should use
908
+ * `normalizeLLMPodInvokeResponse()` after parsing to sync the two fields
909
+ * by constructing a fresh LLMResponse when needed.
910
+ */
911
+ export declare const LLMPodInvokeResponseSchema: z.ZodObject<{
912
+ status: z.ZodString;
913
+ result: z.ZodOptional<z.ZodObject<{
914
+ content: z.ZodString;
915
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
916
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
917
+ usage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
918
+ id: z.ZodOptional<z.ZodString>;
919
+ name: z.ZodOptional<z.ZodString>;
920
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
921
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
922
+ }, z.core.$loose>>;
923
+ error: z.ZodOptional<z.ZodString>;
924
+ error_code: z.ZodOptional<z.ZodString>;
925
+ pod_name: z.ZodString;
926
+ duration_ms: z.ZodNumber;
927
+ usage: z.ZodOptional<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
928
+ input_tokens: z.ZodOptional<z.ZodNumber>;
929
+ output_tokens: z.ZodOptional<z.ZodNumber>;
930
+ prompt_tokens: z.ZodOptional<z.ZodNumber>;
931
+ completion_tokens: z.ZodOptional<z.ZodNumber>;
932
+ total_tokens: z.ZodOptional<z.ZodNumber>;
933
+ model: z.ZodOptional<z.ZodString>;
934
+ }, z.core.$strip>, z.ZodTransform<LLMTokenUsage, {
935
+ input_tokens?: number | undefined;
936
+ output_tokens?: number | undefined;
937
+ prompt_tokens?: number | undefined;
938
+ completion_tokens?: number | undefined;
939
+ total_tokens?: number | undefined;
940
+ model?: string | undefined;
941
+ }>>>>;
942
+ }, z.core.$strip>;
943
+ export type LLMPodInvokeResponse = z.infer<typeof LLMPodInvokeResponseSchema>;
944
+ /**
945
+ * Sync `usage` and `result.usage` on a parsed LLMPodInvokeResponse,
946
+ * mirroring Python's `_sync_usage_with_result` model_validator.
947
+ *
948
+ * - If `result.usage` is unset and `usage` is present, returns a new
949
+ * response whose result carries the top-level usage.
950
+ * - If `usage` is unset and `result.usage` is present, lifts that
951
+ * `result.usage` to the top level.
952
+ *
953
+ * Returns the response (possibly with a freshly-built `result`/`usage`).
954
+ */
955
+ export declare function normalizeLLMPodInvokeResponse(resp: LLMPodInvokeResponse): LLMPodInvokeResponse;
956
+ /** SSE event emitted by a tool pod during invoke_llm streaming. */
957
+ export declare const LLMPodStreamEventSchema: z.ZodObject<{
958
+ content: z.ZodOptional<z.ZodString>;
959
+ tool_call_chunks: z.ZodOptional<z.ZodArray<z.ZodObject<{
960
+ id: z.ZodOptional<z.ZodString>;
961
+ name: z.ZodOptional<z.ZodString>;
962
+ args: z.ZodOptional<z.ZodString>;
963
+ type: z.ZodOptional<z.ZodString>;
964
+ index: z.ZodOptional<z.ZodNumber>;
965
+ }, z.core.$strip>>>;
966
+ tool_calls: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
967
+ id: z.ZodOptional<z.ZodString>;
968
+ name: z.ZodOptional<z.ZodString>;
969
+ additional_kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
970
+ response_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
971
+ done: z.ZodOptional<z.ZodBoolean>;
972
+ interrupted: z.ZodOptional<z.ZodBoolean>;
973
+ error: z.ZodOptional<z.ZodString>;
974
+ error_code: z.ZodOptional<z.ZodString>;
975
+ retryable: z.ZodOptional<z.ZodBoolean>;
976
+ retry_after_ms: z.ZodOptional<z.ZodNumber>;
977
+ pod_name: z.ZodOptional<z.ZodString>;
978
+ duration_ms: z.ZodOptional<z.ZodNumber>;
979
+ usage: z.ZodOptional<z.ZodPreprocess<z.ZodPipe<z.ZodObject<{
980
+ input_tokens: z.ZodOptional<z.ZodNumber>;
981
+ output_tokens: z.ZodOptional<z.ZodNumber>;
982
+ prompt_tokens: z.ZodOptional<z.ZodNumber>;
983
+ completion_tokens: z.ZodOptional<z.ZodNumber>;
984
+ total_tokens: z.ZodOptional<z.ZodNumber>;
985
+ model: z.ZodOptional<z.ZodString>;
986
+ }, z.core.$strip>, z.ZodTransform<LLMTokenUsage, {
987
+ input_tokens?: number | undefined;
988
+ output_tokens?: number | undefined;
989
+ prompt_tokens?: number | undefined;
990
+ completion_tokens?: number | undefined;
991
+ total_tokens?: number | undefined;
992
+ model?: string | undefined;
993
+ }>>>>;
994
+ }, z.core.$strip>;
995
+ export type LLMPodStreamEvent = z.infer<typeof LLMPodStreamEventSchema>;
996
+ /** Callback from AER to OE when execution completes or suspends. */
997
+ export declare const ExecutorCallbackRequestSchema: z.ZodObject<{
998
+ execution_id: z.ZodString;
999
+ status: z.ZodString;
1000
+ suspend_generation: z.ZodOptional<z.ZodPipe<z.ZodNullable<z.ZodNumber>, z.ZodTransform<number | undefined, number | null>>>;
1001
+ result: z.ZodOptional<z.ZodUnknown>;
1002
+ error: z.ZodOptional<z.ZodString>;
1003
+ suspend_reason: z.ZodOptional<z.ZodString>;
1004
+ suspend_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1005
+ interrupts: z.ZodOptional<z.ZodArray<z.ZodObject<{
1006
+ id: z.ZodString;
1007
+ value: z.ZodUnknown;
1008
+ }, z.core.$strip>>>;
1009
+ resume_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1010
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1011
+ }, z.core.$strip>;
1012
+ export type ExecutorCallbackRequest = z.infer<typeof ExecutorCallbackRequestSchema>;
1013
+ /** Data provided by human reviewer when resuming a suspended execution. */
1014
+ export declare const HumanReviewDataSchema: z.ZodObject<{
1015
+ decision: z.ZodString;
1016
+ reviewer_notes: z.ZodOptional<z.ZodString>;
1017
+ }, z.core.$strip>;
1018
+ export type HumanReviewData = z.infer<typeof HumanReviewDataSchema>;
1019
+ /** Request to resume a suspended execution. */
1020
+ export declare const AgentResumeRequestSchema: z.ZodObject<{
1021
+ human_review: z.ZodObject<{
1022
+ decision: z.ZodString;
1023
+ reviewer_notes: z.ZodOptional<z.ZodString>;
1024
+ }, z.core.$strip>;
1025
+ custom_headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1026
+ }, z.core.$strip>;
1027
+ export type AgentResumeRequest = z.infer<typeof AgentResumeRequestSchema>;
1028
+ /** Response from resuming an execution. */
1029
+ export declare const AgentResumeResponseSchema: z.ZodObject<{
1030
+ execution_id: z.ZodString;
1031
+ status: z.ZodString;
1032
+ }, z.core.$strip>;
1033
+ export type AgentResumeResponse = z.infer<typeof AgentResumeResponseSchema>;
1034
+ /** Response for execution status query. */
1035
+ export declare const ExecutionStatusResponseSchema: z.ZodObject<{
1036
+ execution_id: z.ZodString;
1037
+ status: z.ZodEnum<{
1038
+ error: "error";
1039
+ pending: "pending";
1040
+ running: "running";
1041
+ suspended: "suspended";
1042
+ resuming: "resuming";
1043
+ completed: "completed";
1044
+ cancelled: "cancelled";
1045
+ }>;
1046
+ result: z.ZodOptional<z.ZodUnknown>;
1047
+ error: z.ZodOptional<z.ZodString>;
1048
+ suspend_reason: z.ZodOptional<z.ZodString>;
1049
+ suspend_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1050
+ created_at: z.ZodCoercedDate<unknown>;
1051
+ updated_at: z.ZodCoercedDate<unknown>;
1052
+ }, z.core.$strip>;
1053
+ export type ExecutionStatusResponse = z.infer<typeof ExecutionStatusResponseSchema>;
1054
+ /** Execution record stored in TenantDB. */
1055
+ export declare const ExecutionSchema: z.ZodObject<{
1056
+ id: z.ZodString;
1057
+ status: z.ZodEnum<{
1058
+ error: "error";
1059
+ pending: "pending";
1060
+ running: "running";
1061
+ suspended: "suspended";
1062
+ resuming: "resuming";
1063
+ completed: "completed";
1064
+ cancelled: "cancelled";
1065
+ }>;
1066
+ message: z.ZodString;
1067
+ result: z.ZodOptional<z.ZodUnknown>;
1068
+ error: z.ZodOptional<z.ZodString>;
1069
+ suspend_reason: z.ZodOptional<z.ZodString>;
1070
+ suspend_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1071
+ session_id: z.ZodOptional<z.ZodString>;
1072
+ org_id: z.ZodOptional<z.ZodString>;
1073
+ user_id: z.ZodOptional<z.ZodString>;
1074
+ workspace_id: z.ZodOptional<z.ZodString>;
1075
+ project_id: z.ZodOptional<z.ZodString>;
1076
+ aer_url: z.ZodOptional<z.ZodString>;
1077
+ tool_url: z.ZodOptional<z.ZodString>;
1078
+ created_at: z.ZodDefault<z.ZodCoercedDate<unknown>>;
1079
+ updated_at: z.ZodDefault<z.ZodCoercedDate<unknown>>;
1080
+ }, z.core.$strip>;
1081
+ export type Execution = z.infer<typeof ExecutionSchema>;
1082
+ /**
1083
+ * Normalize a value (Date, ISO string, or null/undefined) to a UTC Date.
1084
+ *
1085
+ * MongoDB stores naive datetimes in UTC; this helper rehydrates them as
1086
+ * proper Date instances so callers don't mix string and Date types.
1087
+ *
1088
+ * Mirrors Python `Execution._ensure_utc`. JS `Date` has no naive/aware
1089
+ * distinction (every Date is internally UTC ms-since-epoch), so the TS
1090
+ * version exercises the same "normalize input to a canonical Date" intent
1091
+ * by coercing ISO strings and passing Date instances through unchanged.
1092
+ */
1093
+ export declare function ensureUtc(value: unknown): Date | undefined;
1094
+ /**
1095
+ * Convert an Execution to a MongoDB persistence document.
1096
+ *
1097
+ * `updatedAt` defaults to now if omitted.
1098
+ */
1099
+ export declare function executionToPersistenceDoc(exec: Execution, updatedAt?: Date): Record<string, unknown>;
1100
+ /**
1101
+ * Rehydrate an Execution from a MongoDB document.
1102
+ *
1103
+ * Uses default values for Optional fields so documents created before
1104
+ * new fields were added still deserialize safely.
1105
+ */
1106
+ export declare function executionFromPersistenceDoc(doc: Record<string, unknown>): Execution;
1107
+ /** Execution step record stored in TenantDB. */
1108
+ export declare const ExecutionStepSchema: z.ZodObject<{
1109
+ id: z.ZodString;
1110
+ execution_id: z.ZodString;
1111
+ step_number: z.ZodNumber;
1112
+ tool_name: z.ZodString;
1113
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1114
+ status: z.ZodString;
1115
+ result: z.ZodOptional<z.ZodUnknown>;
1116
+ error: z.ZodOptional<z.ZodString>;
1117
+ duration_ms: z.ZodOptional<z.ZodNumber>;
1118
+ timestamp: z.ZodDefault<z.ZodCoercedDate<unknown>>;
1119
+ }, z.core.$strip>;
1120
+ export type ExecutionStep = z.infer<typeof ExecutionStepSchema>;
1121
+ /**
1122
+ * Reconstruct an ExecutionStep from an execution_logs MongoDB document.
1123
+ *
1124
+ * The execution_logs collection stores tool start/result events with
1125
+ * fields: execution_id, step_number, tool, inputs, status, output,
1126
+ * error, duration_ms, timestamp. This maps those fields back to the
1127
+ * ExecutionStep model for step-cache rehydration after OE restart.
1128
+ */
1129
+ export declare function executionStepFromLogDoc(doc: Record<string, unknown>): ExecutionStep;
1130
+ /** Health status of a component. */
1131
+ export declare const HealthStatusSchema: z.ZodEnum<{
1132
+ healthy: "healthy";
1133
+ unhealthy: "unhealthy";
1134
+ degraded: "degraded";
1135
+ }>;
1136
+ export type HealthStatus = z.infer<typeof HealthStatusSchema>;
1137
+ export declare const HealthStatus: {
1138
+ readonly HEALTHY: "healthy";
1139
+ readonly UNHEALTHY: "unhealthy";
1140
+ readonly DEGRADED: "degraded";
1141
+ };
1142
+ /** Health check response. */
1143
+ export declare const HealthResponseSchema: z.ZodObject<{
1144
+ status: z.ZodEnum<{
1145
+ healthy: "healthy";
1146
+ unhealthy: "unhealthy";
1147
+ degraded: "degraded";
1148
+ }>;
1149
+ component: z.ZodString;
1150
+ mode: z.ZodString;
1151
+ version: z.ZodDefault<z.ZodString>;
1152
+ details: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1153
+ }, z.core.$strip>;
1154
+ export type HealthResponse = z.infer<typeof HealthResponseSchema>;
1155
+ /** Definition of a registered tool. */
1156
+ export declare const ToolDefinitionSchema: z.ZodObject<{
1157
+ name: z.ZodString;
1158
+ description: z.ZodDefault<z.ZodString>;
1159
+ is_local: z.ZodDefault<z.ZodBoolean>;
1160
+ provider_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1161
+ scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
1162
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1163
+ }, z.core.$strip>;
1164
+ export type ToolDefinition = z.infer<typeof ToolDefinitionSchema>;
1165
+ /**
1166
+ * Response from AER /execute endpoint.
1167
+ *
1168
+ * Returned on both normal completion and HITL suspension.
1169
+ */
1170
+ export declare const AERExecuteResponseSchema: z.ZodObject<{
1171
+ status: z.ZodString;
1172
+ result: z.ZodOptional<z.ZodString>;
1173
+ suspend_reason: z.ZodOptional<z.ZodString>;
1174
+ }, z.core.$strip>;
1175
+ export type AERExecuteResponse = z.infer<typeof AERExecuteResponseSchema>;
1176
+ /** Response from /tools endpoint listing registered tools. */
1177
+ export declare const ToolsListResponseSchema: z.ZodObject<{
1178
+ tools: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1179
+ count: z.ZodOptional<z.ZodNumber>;
1180
+ }, z.core.$strip>;
1181
+ export type ToolsListResponse = z.infer<typeof ToolsListResponseSchema>;
1182
+ /**
1183
+ * A chunk of streaming response from the agent.
1184
+ *
1185
+ * Used for real-time streaming of agent responses via SSE or gRPC.
1186
+ */
1187
+ export declare const StreamChunkSchema: z.ZodObject<{
1188
+ chunk_type: z.ZodString;
1189
+ content: z.ZodDefault<z.ZodString>;
1190
+ metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
1191
+ error: z.ZodOptional<z.ZodString>;
1192
+ code: z.ZodOptional<z.ZodString>;
1193
+ tool_name: z.ZodOptional<z.ZodString>;
1194
+ tool_call_id: z.ZodOptional<z.ZodString>;
1195
+ execution_id: z.ZodOptional<z.ZodString>;
1196
+ step_number: z.ZodOptional<z.ZodNumber>;
1197
+ }, z.core.$strip>;
1198
+ export type StreamChunk = z.infer<typeof StreamChunkSchema>;
1199
+ /** Request to start an agent execution with streaming response. */
1200
+ export declare const AgentStartStreamRequestSchema: z.ZodObject<{
1201
+ message: z.ZodString;
1202
+ session_id: z.ZodOptional<z.ZodString>;
1203
+ org_id: z.ZodOptional<z.ZodString>;
1204
+ user_id: z.ZodOptional<z.ZodString>;
1205
+ }, z.core.$strip>;
1206
+ export type AgentStartStreamRequest = z.infer<typeof AgentStartStreamRequestSchema>;
1207
+ /** Response for execution logs query (used by API Gateway proxy). */
1208
+ export declare const ExecutionLogsQueryResponseSchema: z.ZodObject<{
1209
+ logs: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1210
+ count: z.ZodDefault<z.ZodNumber>;
1211
+ }, z.core.$strip>;
1212
+ export type ExecutionLogsQueryResponse = z.infer<typeof ExecutionLogsQueryResponseSchema>;
1213
+ /** Response for node executions query (used by API Gateway proxy). */
1214
+ export declare const NodeExecutionsQueryResponseSchema: z.ZodObject<{
1215
+ executions: z.ZodDefault<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
1216
+ count: z.ZodDefault<z.ZodNumber>;
1217
+ }, z.core.$strip>;
1218
+ export type NodeExecutionsQueryResponse = z.infer<typeof NodeExecutionsQueryResponseSchema>;
1219
+ /** A single session entry returned by /query/sessions. */
1220
+ export declare const SessionInfoSchema: z.ZodObject<{
1221
+ session_id: z.ZodString;
1222
+ last_activity: z.ZodString;
1223
+ created_at: z.ZodString;
1224
+ message_count: z.ZodDefault<z.ZodNumber>;
1225
+ last_message_preview: z.ZodDefault<z.ZodString>;
1226
+ visibility: z.ZodDefault<z.ZodString>;
1227
+ user_id: z.ZodDefault<z.ZodString>;
1228
+ project_id: z.ZodDefault<z.ZodString>;
1229
+ workspace_id: z.ZodDefault<z.ZodString>;
1230
+ }, z.core.$strip>;
1231
+ export type SessionInfo = z.infer<typeof SessionInfoSchema>;
1232
+ /** Response for sessions list query (used by API Gateway proxy). */
1233
+ export declare const SessionsQueryResponseSchema: z.ZodObject<{
1234
+ sessions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1235
+ session_id: z.ZodString;
1236
+ last_activity: z.ZodString;
1237
+ created_at: z.ZodString;
1238
+ message_count: z.ZodDefault<z.ZodNumber>;
1239
+ last_message_preview: z.ZodDefault<z.ZodString>;
1240
+ visibility: z.ZodDefault<z.ZodString>;
1241
+ user_id: z.ZodDefault<z.ZodString>;
1242
+ project_id: z.ZodDefault<z.ZodString>;
1243
+ workspace_id: z.ZodDefault<z.ZodString>;
1244
+ }, z.core.$strip>>>;
1245
+ total_count: z.ZodDefault<z.ZodNumber>;
1246
+ offset: z.ZodDefault<z.ZodNumber>;
1247
+ limit: z.ZodDefault<z.ZodNumber>;
1248
+ }, z.core.$strip>;
1249
+ export type SessionsQueryResponse = z.infer<typeof SessionsQueryResponseSchema>;
1250
+ /** A single message within a session. */
1251
+ export declare const SessionMessageSchema: z.ZodObject<{
1252
+ id: z.ZodString;
1253
+ role: z.ZodString;
1254
+ content: z.ZodString;
1255
+ timestamp: z.ZodString;
1256
+ session_id: z.ZodString;
1257
+ name: z.ZodOptional<z.ZodString>;
1258
+ tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodPipe<z.ZodObject<{
1259
+ id: z.ZodOptional<z.ZodString>;
1260
+ name: z.ZodOptional<z.ZodString>;
1261
+ args: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1262
+ arguments: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1263
+ type: z.ZodOptional<z.ZodString>;
1264
+ index: z.ZodOptional<z.ZodNumber>;
1265
+ }, z.core.$strip>, z.ZodTransform<LLMToolCall, {
1266
+ id?: string | undefined;
1267
+ name?: string | undefined;
1268
+ args?: JsonValue | undefined;
1269
+ arguments?: JsonValue | undefined;
1270
+ type?: string | undefined;
1271
+ index?: number | undefined;
1272
+ }>>>>>;
1273
+ tool_call_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1274
+ }, z.core.$strip>;
1275
+ export type SessionMessage = z.infer<typeof SessionMessageSchema>;
1276
+ /** Response for session messages query (used by API Gateway proxy). */
1277
+ export declare const SessionMessagesQueryResponseSchema: z.ZodObject<{
1278
+ messages: z.ZodDefault<z.ZodArray<z.ZodObject<{
1279
+ id: z.ZodString;
1280
+ role: z.ZodString;
1281
+ content: z.ZodString;
1282
+ timestamp: z.ZodString;
1283
+ session_id: z.ZodString;
1284
+ name: z.ZodOptional<z.ZodString>;
1285
+ tool_calls: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodPipe<z.ZodObject<{
1286
+ id: z.ZodOptional<z.ZodString>;
1287
+ name: z.ZodOptional<z.ZodString>;
1288
+ args: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1289
+ arguments: z.ZodOptional<z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
1290
+ type: z.ZodOptional<z.ZodString>;
1291
+ index: z.ZodOptional<z.ZodNumber>;
1292
+ }, z.core.$strip>, z.ZodTransform<LLMToolCall, {
1293
+ id?: string | undefined;
1294
+ name?: string | undefined;
1295
+ args?: JsonValue | undefined;
1296
+ arguments?: JsonValue | undefined;
1297
+ type?: string | undefined;
1298
+ index?: number | undefined;
1299
+ }>>>>>;
1300
+ tool_call_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1301
+ }, z.core.$strip>>>;
1302
+ }, z.core.$strip>;
1303
+ export type SessionMessagesQueryResponse = z.infer<typeof SessionMessagesQueryResponseSchema>;
1304
+ /** Aggregate cost metrics for the requested period. */
1305
+ export declare const CostSummarySchema: z.ZodObject<{
1306
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1307
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1308
+ total_prompt_tokens: z.ZodDefault<z.ZodNumber>;
1309
+ total_completion_tokens: z.ZodDefault<z.ZodNumber>;
1310
+ total_llm_calls: z.ZodDefault<z.ZodNumber>;
1311
+ unpriced_llm_calls: z.ZodDefault<z.ZodNumber>;
1312
+ }, z.core.$strip>;
1313
+ export type CostSummary = z.infer<typeof CostSummarySchema>;
1314
+ /** Cost breakdown for a single workspace. */
1315
+ export declare const CostByWorkspaceSchema: z.ZodObject<{
1316
+ workspace_id: z.ZodString;
1317
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1318
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1319
+ call_count: z.ZodDefault<z.ZodNumber>;
1320
+ percentage: z.ZodDefault<z.ZodNumber>;
1321
+ }, z.core.$strip>;
1322
+ export type CostByWorkspace = z.infer<typeof CostByWorkspaceSchema>;
1323
+ /** Cost breakdown for a single model. */
1324
+ export declare const CostByModelSchema: z.ZodObject<{
1325
+ model: z.ZodString;
1326
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1327
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1328
+ call_count: z.ZodDefault<z.ZodNumber>;
1329
+ percentage: z.ZodDefault<z.ZodNumber>;
1330
+ }, z.core.$strip>;
1331
+ export type CostByModel = z.infer<typeof CostByModelSchema>;
1332
+ /** Cost data for a single day. */
1333
+ export declare const DailyCostEntrySchema: z.ZodObject<{
1334
+ date: z.ZodString;
1335
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1336
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1337
+ call_count: z.ZodDefault<z.ZodNumber>;
1338
+ }, z.core.$strip>;
1339
+ export type DailyCostEntry = z.infer<typeof DailyCostEntrySchema>;
1340
+ /** Response for cost dashboard aggregation (used by API Gateway proxy). */
1341
+ export declare const CostDashboardResponseSchema: z.ZodObject<{
1342
+ summary: z.ZodDefault<z.ZodObject<{
1343
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1344
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1345
+ total_prompt_tokens: z.ZodDefault<z.ZodNumber>;
1346
+ total_completion_tokens: z.ZodDefault<z.ZodNumber>;
1347
+ total_llm_calls: z.ZodDefault<z.ZodNumber>;
1348
+ unpriced_llm_calls: z.ZodDefault<z.ZodNumber>;
1349
+ }, z.core.$strip>>;
1350
+ by_workspace: z.ZodDefault<z.ZodArray<z.ZodObject<{
1351
+ workspace_id: z.ZodString;
1352
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1353
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1354
+ call_count: z.ZodDefault<z.ZodNumber>;
1355
+ percentage: z.ZodDefault<z.ZodNumber>;
1356
+ }, z.core.$strip>>>;
1357
+ by_model: z.ZodDefault<z.ZodArray<z.ZodObject<{
1358
+ model: z.ZodString;
1359
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1360
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1361
+ call_count: z.ZodDefault<z.ZodNumber>;
1362
+ percentage: z.ZodDefault<z.ZodNumber>;
1363
+ }, z.core.$strip>>>;
1364
+ daily_trend: z.ZodDefault<z.ZodArray<z.ZodObject<{
1365
+ date: z.ZodString;
1366
+ total_cost_usd: z.ZodDefault<z.ZodNumber>;
1367
+ total_tokens: z.ZodDefault<z.ZodNumber>;
1368
+ call_count: z.ZodDefault<z.ZodNumber>;
1369
+ }, z.core.$strip>>>;
1370
+ }, z.core.$strip>;
1371
+ export type CostDashboardResponse = z.infer<typeof CostDashboardResponseSchema>;
1372
+ /** An execution document as stored in the platform database. */
1373
+ export declare const ExecutionDocumentSchema: z.ZodObject<{
1374
+ execution_id: z.ZodString;
1375
+ status: z.ZodDefault<z.ZodString>;
1376
+ message: z.ZodDefault<z.ZodString>;
1377
+ session_id: z.ZodDefault<z.ZodString>;
1378
+ user_id: z.ZodDefault<z.ZodString>;
1379
+ org_id: z.ZodDefault<z.ZodString>;
1380
+ project_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1381
+ workspace_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1382
+ result: z.ZodOptional<z.ZodUnknown>;
1383
+ error: z.ZodOptional<z.ZodString>;
1384
+ suspend_reason: z.ZodOptional<z.ZodString>;
1385
+ suspend_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1386
+ created_at: z.ZodOptional<z.ZodString>;
1387
+ updated_at: z.ZodOptional<z.ZodString>;
1388
+ }, z.core.$strip>;
1389
+ export type ExecutionDocument = z.infer<typeof ExecutionDocumentSchema>;
1390
+ /** Response for executions list query (used by API Gateway proxy). */
1391
+ export declare const ExecutionsListQueryResponseSchema: z.ZodObject<{
1392
+ success: z.ZodDefault<z.ZodBoolean>;
1393
+ executions: z.ZodDefault<z.ZodArray<z.ZodObject<{
1394
+ execution_id: z.ZodString;
1395
+ status: z.ZodDefault<z.ZodString>;
1396
+ message: z.ZodDefault<z.ZodString>;
1397
+ session_id: z.ZodDefault<z.ZodString>;
1398
+ user_id: z.ZodDefault<z.ZodString>;
1399
+ org_id: z.ZodDefault<z.ZodString>;
1400
+ project_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1401
+ workspace_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1402
+ result: z.ZodOptional<z.ZodUnknown>;
1403
+ error: z.ZodOptional<z.ZodString>;
1404
+ suspend_reason: z.ZodOptional<z.ZodString>;
1405
+ suspend_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1406
+ created_at: z.ZodOptional<z.ZodString>;
1407
+ updated_at: z.ZodOptional<z.ZodString>;
1408
+ }, z.core.$strip>>>;
1409
+ count: z.ZodDefault<z.ZodNumber>;
1410
+ }, z.core.$strip>;
1411
+ export type ExecutionsListQueryResponse = z.infer<typeof ExecutionsListQueryResponseSchema>;
1412
+ /** Response for single execution detail query (used by API Gateway proxy). */
1413
+ export declare const ExecutionDetailQueryResponseSchema: z.ZodObject<{
1414
+ success: z.ZodDefault<z.ZodBoolean>;
1415
+ execution: z.ZodOptional<z.ZodObject<{
1416
+ execution_id: z.ZodString;
1417
+ status: z.ZodDefault<z.ZodString>;
1418
+ message: z.ZodDefault<z.ZodString>;
1419
+ session_id: z.ZodDefault<z.ZodString>;
1420
+ user_id: z.ZodDefault<z.ZodString>;
1421
+ org_id: z.ZodDefault<z.ZodString>;
1422
+ project_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1423
+ workspace_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1424
+ result: z.ZodOptional<z.ZodUnknown>;
1425
+ error: z.ZodOptional<z.ZodString>;
1426
+ suspend_reason: z.ZodOptional<z.ZodString>;
1427
+ suspend_context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1428
+ created_at: z.ZodOptional<z.ZodString>;
1429
+ updated_at: z.ZodOptional<z.ZodString>;
1430
+ }, z.core.$strip>>;
1431
+ error: z.ZodOptional<z.ZodString>;
1432
+ }, z.core.$strip>;
1433
+ export type ExecutionDetailQueryResponse = z.infer<typeof ExecutionDetailQueryResponseSchema>;
1434
+ /**
1435
+ * Report node execution event (AER → OE for logging).
1436
+ */
1437
+ export declare const NodeExecutionRequestSchema: z.ZodObject<{
1438
+ execution_id: z.ZodString;
1439
+ node_name: z.ZodString;
1440
+ status: z.ZodString;
1441
+ timestamp: z.ZodCoercedDate<unknown>;
1442
+ run_id: z.ZodString;
1443
+ parent_run_id: z.ZodOptional<z.ZodString>;
1444
+ session_id: z.ZodOptional<z.ZodString>;
1445
+ user_id: z.ZodOptional<z.ZodString>;
1446
+ inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1447
+ outputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1448
+ error: z.ZodOptional<z.ZodString>;
1449
+ duration_ms: z.ZodOptional<z.ZodNumber>;
1450
+ org_id: z.ZodOptional<z.ZodString>;
1451
+ project_id: z.ZodOptional<z.ZodString>;
1452
+ trace_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1453
+ span_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1454
+ }, z.core.$strip>;
1455
+ export type NodeExecutionRequest = z.infer<typeof NodeExecutionRequestSchema>;
1456
+ export type { Message, ToolCallChunk, JsonValue };
1457
+ export { LLMResponse, LLMTokenUsage, LLMToolCall, LLMToolSchema, LLMInvocationOptions, };
1458
+ //# sourceMappingURL=models.d.ts.map