@runfile-ai/schemas 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +163 -0
  3. package/dist/canonical.d.ts +32 -0
  4. package/dist/canonical.d.ts.map +1 -0
  5. package/dist/canonical.js +46 -0
  6. package/dist/canonical.js.map +1 -0
  7. package/dist/control-mapping.d.ts +85 -0
  8. package/dist/control-mapping.d.ts.map +1 -0
  9. package/dist/control-mapping.js +31 -0
  10. package/dist/control-mapping.js.map +1 -0
  11. package/dist/event.d.ts +866 -0
  12. package/dist/event.d.ts.map +1 -0
  13. package/dist/event.js +289 -0
  14. package/dist/event.js.map +1 -0
  15. package/dist/evidence.d.ts +955 -0
  16. package/dist/evidence.d.ts.map +1 -0
  17. package/dist/evidence.js +31 -0
  18. package/dist/evidence.js.map +1 -0
  19. package/dist/index.d.ts +8 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +8 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/ingest.d.ts +1595 -0
  24. package/dist/ingest.d.ts.map +1 -0
  25. package/dist/ingest.js +177 -0
  26. package/dist/ingest.js.map +1 -0
  27. package/dist/manifest.d.ts +110 -0
  28. package/dist/manifest.d.ts.map +1 -0
  29. package/dist/manifest.js +46 -0
  30. package/dist/manifest.js.map +1 -0
  31. package/dist/vault.d.ts +459 -0
  32. package/dist/vault.d.ts.map +1 -0
  33. package/dist/vault.js +188 -0
  34. package/dist/vault.js.map +1 -0
  35. package/generated/json-schema/control_mapping.json +107 -0
  36. package/generated/json-schema/event.json +600 -0
  37. package/generated/json-schema/evidence.json +721 -0
  38. package/generated/json-schema/ingest.json +800 -0
  39. package/generated/json-schema/manifest.json +148 -0
  40. package/generated/json-schema/vault.json +468 -0
  41. package/package.json +59 -0
@@ -0,0 +1,1595 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * PayloadSubmission — the on-the-wire payload bundled into a BatchSubmission.
4
+ *
5
+ * Differs from the persisted `payload_ref` (in event-schema.json) as follows:
6
+ * - `s3_uri` is replaced by `s3_uri_intent` (hint; server assigns canonical URI)
7
+ * - `ciphertext_base64` carries the encrypted bytes inline (server uploads to S3)
8
+ */
9
+ export declare const PayloadSubmissionSchema: z.ZodObject<{
10
+ s3_uri_intent: z.ZodOptional<z.ZodString>;
11
+ sha256: z.ZodString;
12
+ size_bytes: z.ZodNumber;
13
+ encryption: z.ZodObject<{
14
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
15
+ data_key_wrapped: z.ZodString;
16
+ kms_key_arn: z.ZodOptional<z.ZodString>;
17
+ }, "strict", z.ZodTypeAny, {
18
+ algorithm: "aes-256-gcm";
19
+ data_key_wrapped: string;
20
+ kms_key_arn?: string | undefined;
21
+ }, {
22
+ algorithm: "aes-256-gcm";
23
+ data_key_wrapped: string;
24
+ kms_key_arn?: string | undefined;
25
+ }>;
26
+ content_type: z.ZodOptional<z.ZodEnum<["application/json", "text/plain", "application/vnd.runfile.llm-request+json", "application/vnd.runfile.llm-response+json", "application/vnd.runfile.tool-call+json", "application/vnd.runfile.tool-result+json", "application/vnd.runfile.state-snapshot+json"]>>;
27
+ redaction_applied: z.ZodOptional<z.ZodObject<{
28
+ redacted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
29
+ tokenized_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
30
+ classifier_version: z.ZodOptional<z.ZodString>;
31
+ }, "strict", z.ZodTypeAny, {
32
+ redacted_classes?: string[] | undefined;
33
+ tokenized_classes?: string[] | undefined;
34
+ classifier_version?: string | undefined;
35
+ }, {
36
+ redacted_classes?: string[] | undefined;
37
+ tokenized_classes?: string[] | undefined;
38
+ classifier_version?: string | undefined;
39
+ }>>;
40
+ ciphertext_base64: z.ZodString;
41
+ }, "strict", z.ZodTypeAny, {
42
+ sha256: string;
43
+ size_bytes: number;
44
+ encryption: {
45
+ algorithm: "aes-256-gcm";
46
+ data_key_wrapped: string;
47
+ kms_key_arn?: string | undefined;
48
+ };
49
+ ciphertext_base64: string;
50
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
51
+ redaction_applied?: {
52
+ redacted_classes?: string[] | undefined;
53
+ tokenized_classes?: string[] | undefined;
54
+ classifier_version?: string | undefined;
55
+ } | undefined;
56
+ s3_uri_intent?: string | undefined;
57
+ }, {
58
+ sha256: string;
59
+ size_bytes: number;
60
+ encryption: {
61
+ algorithm: "aes-256-gcm";
62
+ data_key_wrapped: string;
63
+ kms_key_arn?: string | undefined;
64
+ };
65
+ ciphertext_base64: string;
66
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
67
+ redaction_applied?: {
68
+ redacted_classes?: string[] | undefined;
69
+ tokenized_classes?: string[] | undefined;
70
+ classifier_version?: string | undefined;
71
+ } | undefined;
72
+ s3_uri_intent?: string | undefined;
73
+ }>;
74
+ export type PayloadSubmission = z.infer<typeof PayloadSubmissionSchema>;
75
+ /**
76
+ * EventSubmission — an event as submitted by the SDK. Differs from RunfileEvent:
77
+ * - `tenant_id` omitted (server resolves from API key)
78
+ * - `received_at` omitted (server stamps on receipt)
79
+ * - `event_hash` omitted (server computes after chain assembly)
80
+ * - `prev_hash` → `prev_hash_intent` (advisory; server validates)
81
+ * - `payload_ref` → `PayloadSubmission` (inline ciphertext, server assigns URI)
82
+ * - `merkle_inclusion` omitted (set later by Merkle Builder)
83
+ */
84
+ export declare const EventSubmissionSchema: z.ZodEffects<z.ZodObject<{
85
+ schema_version: z.ZodString;
86
+ event_id: z.ZodString;
87
+ agent_run_id: z.ZodString;
88
+ parent_event_id: z.ZodNullable<z.ZodString>;
89
+ captured_at: z.ZodString;
90
+ wall_clock_source: z.ZodEnum<["aws_time_sync", "ntp", "host_system", "unknown"]>;
91
+ sdk: z.ZodObject<{
92
+ name: z.ZodEnum<["runfile-py", "@runfile/sdk"]>;
93
+ version: z.ZodString;
94
+ framework: z.ZodEnum<["langgraph", "langgraph_js", "openai_agents", "openai_agents_js", "anthropic_claude", "anthropic_claude_js", "mastra", "vercel_ai_sdk", "mcp_client", "otel_generic", "manual"]>;
95
+ framework_version: z.ZodOptional<z.ZodString>;
96
+ host: z.ZodOptional<z.ZodString>;
97
+ }, "strict", z.ZodTypeAny, {
98
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
99
+ name: "runfile-py" | "@runfile/sdk";
100
+ version: string;
101
+ framework_version?: string | undefined;
102
+ host?: string | undefined;
103
+ }, {
104
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
105
+ name: "runfile-py" | "@runfile/sdk";
106
+ version: string;
107
+ framework_version?: string | undefined;
108
+ host?: string | undefined;
109
+ }>;
110
+ actor: z.ZodEffects<z.ZodObject<{
111
+ type: z.ZodEnum<["agent", "human", "tool", "system"]>;
112
+ agent_identity: z.ZodOptional<z.ZodString>;
113
+ human_principal: z.ZodOptional<z.ZodString>;
114
+ delegation_chain: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
115
+ tool_id: z.ZodOptional<z.ZodString>;
116
+ tool_version_hash: z.ZodOptional<z.ZodString>;
117
+ }, "strict", z.ZodTypeAny, {
118
+ type: "agent" | "human" | "tool" | "system";
119
+ delegation_chain: string[];
120
+ agent_identity?: string | undefined;
121
+ human_principal?: string | undefined;
122
+ tool_id?: string | undefined;
123
+ tool_version_hash?: string | undefined;
124
+ }, {
125
+ type: "agent" | "human" | "tool" | "system";
126
+ agent_identity?: string | undefined;
127
+ human_principal?: string | undefined;
128
+ delegation_chain?: string[] | undefined;
129
+ tool_id?: string | undefined;
130
+ tool_version_hash?: string | undefined;
131
+ }>, {
132
+ type: "agent" | "human" | "tool" | "system";
133
+ delegation_chain: string[];
134
+ agent_identity?: string | undefined;
135
+ human_principal?: string | undefined;
136
+ tool_id?: string | undefined;
137
+ tool_version_hash?: string | undefined;
138
+ }, {
139
+ type: "agent" | "human" | "tool" | "system";
140
+ agent_identity?: string | undefined;
141
+ human_principal?: string | undefined;
142
+ delegation_chain?: string[] | undefined;
143
+ tool_id?: string | undefined;
144
+ tool_version_hash?: string | undefined;
145
+ }>;
146
+ action: z.ZodObject<{
147
+ kind: z.ZodEnum<["agent_run_start", "agent_run_end", "graph_node_enter", "graph_node_exit", "llm_call", "tool_call", "tool_result", "state_read", "state_write", "decision", "handoff", "human_approval", "human_input", "policy_check", "anomaly_flag", "sdk_diagnostic"]>;
148
+ name: z.ZodString;
149
+ outcome: z.ZodOptional<z.ZodEnum<["success", "failure", "partial", "timeout", "cancelled"]>>;
150
+ duration_ms: z.ZodOptional<z.ZodNumber>;
151
+ }, "strict", z.ZodTypeAny, {
152
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
153
+ name: string;
154
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
155
+ duration_ms?: number | undefined;
156
+ }, {
157
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
158
+ name: string;
159
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
160
+ duration_ms?: number | undefined;
161
+ }>;
162
+ subject: z.ZodObject<{
163
+ resource_urn: z.ZodOptional<z.ZodString>;
164
+ data_classification: z.ZodOptional<z.ZodEnum<["public", "internal", "confidential", "pii", "phi", "pci", "fci"]>>;
165
+ regulatory_tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
166
+ }, "strict", z.ZodTypeAny, {
167
+ regulatory_tags?: string[] | undefined;
168
+ resource_urn?: string | undefined;
169
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
170
+ }, {
171
+ regulatory_tags?: string[] | undefined;
172
+ resource_urn?: string | undefined;
173
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
174
+ }>;
175
+ model_ref: z.ZodOptional<z.ZodObject<{
176
+ provider: z.ZodEnum<["anthropic", "openai", "google", "aws_bedrock", "azure_openai", "ollama", "self_hosted", "other"]>;
177
+ model_id: z.ZodString;
178
+ model_version_hash: z.ZodOptional<z.ZodString>;
179
+ system_prompt_hash: z.ZodOptional<z.ZodString>;
180
+ tools_hash: z.ZodOptional<z.ZodString>;
181
+ input_tokens: z.ZodOptional<z.ZodNumber>;
182
+ output_tokens: z.ZodOptional<z.ZodNumber>;
183
+ temperature: z.ZodOptional<z.ZodNumber>;
184
+ }, "strict", z.ZodTypeAny, {
185
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
186
+ model_id: string;
187
+ model_version_hash?: string | undefined;
188
+ system_prompt_hash?: string | undefined;
189
+ tools_hash?: string | undefined;
190
+ input_tokens?: number | undefined;
191
+ output_tokens?: number | undefined;
192
+ temperature?: number | undefined;
193
+ }, {
194
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
195
+ model_id: string;
196
+ model_version_hash?: string | undefined;
197
+ system_prompt_hash?: string | undefined;
198
+ tools_hash?: string | undefined;
199
+ input_tokens?: number | undefined;
200
+ output_tokens?: number | undefined;
201
+ temperature?: number | undefined;
202
+ }>>;
203
+ decision: z.ZodOptional<z.ZodObject<{
204
+ outcome: z.ZodEnum<["approved", "denied", "escalated", "deferred", "no_action", "custom"]>;
205
+ outcome_label: z.ZodOptional<z.ZodString>;
206
+ confidence: z.ZodOptional<z.ZodNumber>;
207
+ human_in_the_loop: z.ZodOptional<z.ZodBoolean>;
208
+ policy_thresholds_crossed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
209
+ reversed_by_event: z.ZodOptional<z.ZodString>;
210
+ }, "strict", z.ZodTypeAny, {
211
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
212
+ outcome_label?: string | undefined;
213
+ confidence?: number | undefined;
214
+ human_in_the_loop?: boolean | undefined;
215
+ policy_thresholds_crossed?: string[] | undefined;
216
+ reversed_by_event?: string | undefined;
217
+ }, {
218
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
219
+ outcome_label?: string | undefined;
220
+ confidence?: number | undefined;
221
+ human_in_the_loop?: boolean | undefined;
222
+ policy_thresholds_crossed?: string[] | undefined;
223
+ reversed_by_event?: string | undefined;
224
+ }>>;
225
+ payload_ref: z.ZodOptional<z.ZodObject<{
226
+ s3_uri_intent: z.ZodOptional<z.ZodString>;
227
+ sha256: z.ZodString;
228
+ size_bytes: z.ZodNumber;
229
+ encryption: z.ZodObject<{
230
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
231
+ data_key_wrapped: z.ZodString;
232
+ kms_key_arn: z.ZodOptional<z.ZodString>;
233
+ }, "strict", z.ZodTypeAny, {
234
+ algorithm: "aes-256-gcm";
235
+ data_key_wrapped: string;
236
+ kms_key_arn?: string | undefined;
237
+ }, {
238
+ algorithm: "aes-256-gcm";
239
+ data_key_wrapped: string;
240
+ kms_key_arn?: string | undefined;
241
+ }>;
242
+ content_type: z.ZodOptional<z.ZodEnum<["application/json", "text/plain", "application/vnd.runfile.llm-request+json", "application/vnd.runfile.llm-response+json", "application/vnd.runfile.tool-call+json", "application/vnd.runfile.tool-result+json", "application/vnd.runfile.state-snapshot+json"]>>;
243
+ redaction_applied: z.ZodOptional<z.ZodObject<{
244
+ redacted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
245
+ tokenized_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
246
+ classifier_version: z.ZodOptional<z.ZodString>;
247
+ }, "strict", z.ZodTypeAny, {
248
+ redacted_classes?: string[] | undefined;
249
+ tokenized_classes?: string[] | undefined;
250
+ classifier_version?: string | undefined;
251
+ }, {
252
+ redacted_classes?: string[] | undefined;
253
+ tokenized_classes?: string[] | undefined;
254
+ classifier_version?: string | undefined;
255
+ }>>;
256
+ ciphertext_base64: z.ZodString;
257
+ }, "strict", z.ZodTypeAny, {
258
+ sha256: string;
259
+ size_bytes: number;
260
+ encryption: {
261
+ algorithm: "aes-256-gcm";
262
+ data_key_wrapped: string;
263
+ kms_key_arn?: string | undefined;
264
+ };
265
+ ciphertext_base64: string;
266
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
267
+ redaction_applied?: {
268
+ redacted_classes?: string[] | undefined;
269
+ tokenized_classes?: string[] | undefined;
270
+ classifier_version?: string | undefined;
271
+ } | undefined;
272
+ s3_uri_intent?: string | undefined;
273
+ }, {
274
+ sha256: string;
275
+ size_bytes: number;
276
+ encryption: {
277
+ algorithm: "aes-256-gcm";
278
+ data_key_wrapped: string;
279
+ kms_key_arn?: string | undefined;
280
+ };
281
+ ciphertext_base64: string;
282
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
283
+ redaction_applied?: {
284
+ redacted_classes?: string[] | undefined;
285
+ tokenized_classes?: string[] | undefined;
286
+ classifier_version?: string | undefined;
287
+ } | undefined;
288
+ s3_uri_intent?: string | undefined;
289
+ }>>;
290
+ redaction_policy_version: z.ZodString;
291
+ regulatory_scope_version: z.ZodOptional<z.ZodString>;
292
+ anomaly_flags: z.ZodOptional<z.ZodArray<z.ZodObject<{
293
+ code: z.ZodEnum<["missing_ambient_context", "chain_break", "out_of_order_arrival", "model_version_drift", "unknown_agent_identity", "data_classification_mismatch", "policy_threshold_without_hitl", "unauthorized_tool_invocation", "redaction_policy_mismatch", "schema_version_warning"]>;
294
+ severity: z.ZodEnum<["info", "warning", "error", "critical"]>;
295
+ detail: z.ZodOptional<z.ZodString>;
296
+ }, "strict", z.ZodTypeAny, {
297
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
298
+ severity: "info" | "warning" | "error" | "critical";
299
+ detail?: string | undefined;
300
+ }, {
301
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
302
+ severity: "info" | "warning" | "error" | "critical";
303
+ detail?: string | undefined;
304
+ }>, "many">>;
305
+ environment: z.ZodOptional<z.ZodEnum<["production", "staging", "development"]>>;
306
+ labels: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
307
+ prev_hash_intent: z.ZodString;
308
+ }, "strict", z.ZodTypeAny, {
309
+ schema_version: string;
310
+ event_id: string;
311
+ agent_run_id: string;
312
+ parent_event_id: string | null;
313
+ captured_at: string;
314
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
315
+ sdk: {
316
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
317
+ name: "runfile-py" | "@runfile/sdk";
318
+ version: string;
319
+ framework_version?: string | undefined;
320
+ host?: string | undefined;
321
+ };
322
+ actor: {
323
+ type: "agent" | "human" | "tool" | "system";
324
+ delegation_chain: string[];
325
+ agent_identity?: string | undefined;
326
+ human_principal?: string | undefined;
327
+ tool_id?: string | undefined;
328
+ tool_version_hash?: string | undefined;
329
+ };
330
+ action: {
331
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
332
+ name: string;
333
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
334
+ duration_ms?: number | undefined;
335
+ };
336
+ subject: {
337
+ regulatory_tags?: string[] | undefined;
338
+ resource_urn?: string | undefined;
339
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
340
+ };
341
+ redaction_policy_version: string;
342
+ prev_hash_intent: string;
343
+ decision?: {
344
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
345
+ outcome_label?: string | undefined;
346
+ confidence?: number | undefined;
347
+ human_in_the_loop?: boolean | undefined;
348
+ policy_thresholds_crossed?: string[] | undefined;
349
+ reversed_by_event?: string | undefined;
350
+ } | undefined;
351
+ model_ref?: {
352
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
353
+ model_id: string;
354
+ model_version_hash?: string | undefined;
355
+ system_prompt_hash?: string | undefined;
356
+ tools_hash?: string | undefined;
357
+ input_tokens?: number | undefined;
358
+ output_tokens?: number | undefined;
359
+ temperature?: number | undefined;
360
+ } | undefined;
361
+ payload_ref?: {
362
+ sha256: string;
363
+ size_bytes: number;
364
+ encryption: {
365
+ algorithm: "aes-256-gcm";
366
+ data_key_wrapped: string;
367
+ kms_key_arn?: string | undefined;
368
+ };
369
+ ciphertext_base64: string;
370
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
371
+ redaction_applied?: {
372
+ redacted_classes?: string[] | undefined;
373
+ tokenized_classes?: string[] | undefined;
374
+ classifier_version?: string | undefined;
375
+ } | undefined;
376
+ s3_uri_intent?: string | undefined;
377
+ } | undefined;
378
+ regulatory_scope_version?: string | undefined;
379
+ anomaly_flags?: {
380
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
381
+ severity: "info" | "warning" | "error" | "critical";
382
+ detail?: string | undefined;
383
+ }[] | undefined;
384
+ environment?: "production" | "staging" | "development" | undefined;
385
+ labels?: Record<string, string> | undefined;
386
+ }, {
387
+ schema_version: string;
388
+ event_id: string;
389
+ agent_run_id: string;
390
+ parent_event_id: string | null;
391
+ captured_at: string;
392
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
393
+ sdk: {
394
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
395
+ name: "runfile-py" | "@runfile/sdk";
396
+ version: string;
397
+ framework_version?: string | undefined;
398
+ host?: string | undefined;
399
+ };
400
+ actor: {
401
+ type: "agent" | "human" | "tool" | "system";
402
+ agent_identity?: string | undefined;
403
+ human_principal?: string | undefined;
404
+ delegation_chain?: string[] | undefined;
405
+ tool_id?: string | undefined;
406
+ tool_version_hash?: string | undefined;
407
+ };
408
+ action: {
409
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
410
+ name: string;
411
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
412
+ duration_ms?: number | undefined;
413
+ };
414
+ subject: {
415
+ regulatory_tags?: string[] | undefined;
416
+ resource_urn?: string | undefined;
417
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
418
+ };
419
+ redaction_policy_version: string;
420
+ prev_hash_intent: string;
421
+ decision?: {
422
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
423
+ outcome_label?: string | undefined;
424
+ confidence?: number | undefined;
425
+ human_in_the_loop?: boolean | undefined;
426
+ policy_thresholds_crossed?: string[] | undefined;
427
+ reversed_by_event?: string | undefined;
428
+ } | undefined;
429
+ model_ref?: {
430
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
431
+ model_id: string;
432
+ model_version_hash?: string | undefined;
433
+ system_prompt_hash?: string | undefined;
434
+ tools_hash?: string | undefined;
435
+ input_tokens?: number | undefined;
436
+ output_tokens?: number | undefined;
437
+ temperature?: number | undefined;
438
+ } | undefined;
439
+ payload_ref?: {
440
+ sha256: string;
441
+ size_bytes: number;
442
+ encryption: {
443
+ algorithm: "aes-256-gcm";
444
+ data_key_wrapped: string;
445
+ kms_key_arn?: string | undefined;
446
+ };
447
+ ciphertext_base64: string;
448
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
449
+ redaction_applied?: {
450
+ redacted_classes?: string[] | undefined;
451
+ tokenized_classes?: string[] | undefined;
452
+ classifier_version?: string | undefined;
453
+ } | undefined;
454
+ s3_uri_intent?: string | undefined;
455
+ } | undefined;
456
+ regulatory_scope_version?: string | undefined;
457
+ anomaly_flags?: {
458
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
459
+ severity: "info" | "warning" | "error" | "critical";
460
+ detail?: string | undefined;
461
+ }[] | undefined;
462
+ environment?: "production" | "staging" | "development" | undefined;
463
+ labels?: Record<string, string> | undefined;
464
+ }>, {
465
+ schema_version: string;
466
+ event_id: string;
467
+ agent_run_id: string;
468
+ parent_event_id: string | null;
469
+ captured_at: string;
470
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
471
+ sdk: {
472
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
473
+ name: "runfile-py" | "@runfile/sdk";
474
+ version: string;
475
+ framework_version?: string | undefined;
476
+ host?: string | undefined;
477
+ };
478
+ actor: {
479
+ type: "agent" | "human" | "tool" | "system";
480
+ delegation_chain: string[];
481
+ agent_identity?: string | undefined;
482
+ human_principal?: string | undefined;
483
+ tool_id?: string | undefined;
484
+ tool_version_hash?: string | undefined;
485
+ };
486
+ action: {
487
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
488
+ name: string;
489
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
490
+ duration_ms?: number | undefined;
491
+ };
492
+ subject: {
493
+ regulatory_tags?: string[] | undefined;
494
+ resource_urn?: string | undefined;
495
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
496
+ };
497
+ redaction_policy_version: string;
498
+ prev_hash_intent: string;
499
+ decision?: {
500
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
501
+ outcome_label?: string | undefined;
502
+ confidence?: number | undefined;
503
+ human_in_the_loop?: boolean | undefined;
504
+ policy_thresholds_crossed?: string[] | undefined;
505
+ reversed_by_event?: string | undefined;
506
+ } | undefined;
507
+ model_ref?: {
508
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
509
+ model_id: string;
510
+ model_version_hash?: string | undefined;
511
+ system_prompt_hash?: string | undefined;
512
+ tools_hash?: string | undefined;
513
+ input_tokens?: number | undefined;
514
+ output_tokens?: number | undefined;
515
+ temperature?: number | undefined;
516
+ } | undefined;
517
+ payload_ref?: {
518
+ sha256: string;
519
+ size_bytes: number;
520
+ encryption: {
521
+ algorithm: "aes-256-gcm";
522
+ data_key_wrapped: string;
523
+ kms_key_arn?: string | undefined;
524
+ };
525
+ ciphertext_base64: string;
526
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
527
+ redaction_applied?: {
528
+ redacted_classes?: string[] | undefined;
529
+ tokenized_classes?: string[] | undefined;
530
+ classifier_version?: string | undefined;
531
+ } | undefined;
532
+ s3_uri_intent?: string | undefined;
533
+ } | undefined;
534
+ regulatory_scope_version?: string | undefined;
535
+ anomaly_flags?: {
536
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
537
+ severity: "info" | "warning" | "error" | "critical";
538
+ detail?: string | undefined;
539
+ }[] | undefined;
540
+ environment?: "production" | "staging" | "development" | undefined;
541
+ labels?: Record<string, string> | undefined;
542
+ }, {
543
+ schema_version: string;
544
+ event_id: string;
545
+ agent_run_id: string;
546
+ parent_event_id: string | null;
547
+ captured_at: string;
548
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
549
+ sdk: {
550
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
551
+ name: "runfile-py" | "@runfile/sdk";
552
+ version: string;
553
+ framework_version?: string | undefined;
554
+ host?: string | undefined;
555
+ };
556
+ actor: {
557
+ type: "agent" | "human" | "tool" | "system";
558
+ agent_identity?: string | undefined;
559
+ human_principal?: string | undefined;
560
+ delegation_chain?: string[] | undefined;
561
+ tool_id?: string | undefined;
562
+ tool_version_hash?: string | undefined;
563
+ };
564
+ action: {
565
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
566
+ name: string;
567
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
568
+ duration_ms?: number | undefined;
569
+ };
570
+ subject: {
571
+ regulatory_tags?: string[] | undefined;
572
+ resource_urn?: string | undefined;
573
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
574
+ };
575
+ redaction_policy_version: string;
576
+ prev_hash_intent: string;
577
+ decision?: {
578
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
579
+ outcome_label?: string | undefined;
580
+ confidence?: number | undefined;
581
+ human_in_the_loop?: boolean | undefined;
582
+ policy_thresholds_crossed?: string[] | undefined;
583
+ reversed_by_event?: string | undefined;
584
+ } | undefined;
585
+ model_ref?: {
586
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
587
+ model_id: string;
588
+ model_version_hash?: string | undefined;
589
+ system_prompt_hash?: string | undefined;
590
+ tools_hash?: string | undefined;
591
+ input_tokens?: number | undefined;
592
+ output_tokens?: number | undefined;
593
+ temperature?: number | undefined;
594
+ } | undefined;
595
+ payload_ref?: {
596
+ sha256: string;
597
+ size_bytes: number;
598
+ encryption: {
599
+ algorithm: "aes-256-gcm";
600
+ data_key_wrapped: string;
601
+ kms_key_arn?: string | undefined;
602
+ };
603
+ ciphertext_base64: string;
604
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
605
+ redaction_applied?: {
606
+ redacted_classes?: string[] | undefined;
607
+ tokenized_classes?: string[] | undefined;
608
+ classifier_version?: string | undefined;
609
+ } | undefined;
610
+ s3_uri_intent?: string | undefined;
611
+ } | undefined;
612
+ regulatory_scope_version?: string | undefined;
613
+ anomaly_flags?: {
614
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
615
+ severity: "info" | "warning" | "error" | "critical";
616
+ detail?: string | undefined;
617
+ }[] | undefined;
618
+ environment?: "production" | "staging" | "development" | undefined;
619
+ labels?: Record<string, string> | undefined;
620
+ }>;
621
+ export type EventSubmission = z.infer<typeof EventSubmissionSchema>;
622
+ export declare const BatchSubmissionSchema: z.ZodObject<{
623
+ batch_id: z.ZodString;
624
+ events: z.ZodArray<z.ZodEffects<z.ZodObject<{
625
+ schema_version: z.ZodString;
626
+ event_id: z.ZodString;
627
+ agent_run_id: z.ZodString;
628
+ parent_event_id: z.ZodNullable<z.ZodString>;
629
+ captured_at: z.ZodString;
630
+ wall_clock_source: z.ZodEnum<["aws_time_sync", "ntp", "host_system", "unknown"]>;
631
+ sdk: z.ZodObject<{
632
+ name: z.ZodEnum<["runfile-py", "@runfile/sdk"]>;
633
+ version: z.ZodString;
634
+ framework: z.ZodEnum<["langgraph", "langgraph_js", "openai_agents", "openai_agents_js", "anthropic_claude", "anthropic_claude_js", "mastra", "vercel_ai_sdk", "mcp_client", "otel_generic", "manual"]>;
635
+ framework_version: z.ZodOptional<z.ZodString>;
636
+ host: z.ZodOptional<z.ZodString>;
637
+ }, "strict", z.ZodTypeAny, {
638
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
639
+ name: "runfile-py" | "@runfile/sdk";
640
+ version: string;
641
+ framework_version?: string | undefined;
642
+ host?: string | undefined;
643
+ }, {
644
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
645
+ name: "runfile-py" | "@runfile/sdk";
646
+ version: string;
647
+ framework_version?: string | undefined;
648
+ host?: string | undefined;
649
+ }>;
650
+ actor: z.ZodEffects<z.ZodObject<{
651
+ type: z.ZodEnum<["agent", "human", "tool", "system"]>;
652
+ agent_identity: z.ZodOptional<z.ZodString>;
653
+ human_principal: z.ZodOptional<z.ZodString>;
654
+ delegation_chain: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
655
+ tool_id: z.ZodOptional<z.ZodString>;
656
+ tool_version_hash: z.ZodOptional<z.ZodString>;
657
+ }, "strict", z.ZodTypeAny, {
658
+ type: "agent" | "human" | "tool" | "system";
659
+ delegation_chain: string[];
660
+ agent_identity?: string | undefined;
661
+ human_principal?: string | undefined;
662
+ tool_id?: string | undefined;
663
+ tool_version_hash?: string | undefined;
664
+ }, {
665
+ type: "agent" | "human" | "tool" | "system";
666
+ agent_identity?: string | undefined;
667
+ human_principal?: string | undefined;
668
+ delegation_chain?: string[] | undefined;
669
+ tool_id?: string | undefined;
670
+ tool_version_hash?: string | undefined;
671
+ }>, {
672
+ type: "agent" | "human" | "tool" | "system";
673
+ delegation_chain: string[];
674
+ agent_identity?: string | undefined;
675
+ human_principal?: string | undefined;
676
+ tool_id?: string | undefined;
677
+ tool_version_hash?: string | undefined;
678
+ }, {
679
+ type: "agent" | "human" | "tool" | "system";
680
+ agent_identity?: string | undefined;
681
+ human_principal?: string | undefined;
682
+ delegation_chain?: string[] | undefined;
683
+ tool_id?: string | undefined;
684
+ tool_version_hash?: string | undefined;
685
+ }>;
686
+ action: z.ZodObject<{
687
+ kind: z.ZodEnum<["agent_run_start", "agent_run_end", "graph_node_enter", "graph_node_exit", "llm_call", "tool_call", "tool_result", "state_read", "state_write", "decision", "handoff", "human_approval", "human_input", "policy_check", "anomaly_flag", "sdk_diagnostic"]>;
688
+ name: z.ZodString;
689
+ outcome: z.ZodOptional<z.ZodEnum<["success", "failure", "partial", "timeout", "cancelled"]>>;
690
+ duration_ms: z.ZodOptional<z.ZodNumber>;
691
+ }, "strict", z.ZodTypeAny, {
692
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
693
+ name: string;
694
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
695
+ duration_ms?: number | undefined;
696
+ }, {
697
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
698
+ name: string;
699
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
700
+ duration_ms?: number | undefined;
701
+ }>;
702
+ subject: z.ZodObject<{
703
+ resource_urn: z.ZodOptional<z.ZodString>;
704
+ data_classification: z.ZodOptional<z.ZodEnum<["public", "internal", "confidential", "pii", "phi", "pci", "fci"]>>;
705
+ regulatory_tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
706
+ }, "strict", z.ZodTypeAny, {
707
+ regulatory_tags?: string[] | undefined;
708
+ resource_urn?: string | undefined;
709
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
710
+ }, {
711
+ regulatory_tags?: string[] | undefined;
712
+ resource_urn?: string | undefined;
713
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
714
+ }>;
715
+ model_ref: z.ZodOptional<z.ZodObject<{
716
+ provider: z.ZodEnum<["anthropic", "openai", "google", "aws_bedrock", "azure_openai", "ollama", "self_hosted", "other"]>;
717
+ model_id: z.ZodString;
718
+ model_version_hash: z.ZodOptional<z.ZodString>;
719
+ system_prompt_hash: z.ZodOptional<z.ZodString>;
720
+ tools_hash: z.ZodOptional<z.ZodString>;
721
+ input_tokens: z.ZodOptional<z.ZodNumber>;
722
+ output_tokens: z.ZodOptional<z.ZodNumber>;
723
+ temperature: z.ZodOptional<z.ZodNumber>;
724
+ }, "strict", z.ZodTypeAny, {
725
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
726
+ model_id: string;
727
+ model_version_hash?: string | undefined;
728
+ system_prompt_hash?: string | undefined;
729
+ tools_hash?: string | undefined;
730
+ input_tokens?: number | undefined;
731
+ output_tokens?: number | undefined;
732
+ temperature?: number | undefined;
733
+ }, {
734
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
735
+ model_id: string;
736
+ model_version_hash?: string | undefined;
737
+ system_prompt_hash?: string | undefined;
738
+ tools_hash?: string | undefined;
739
+ input_tokens?: number | undefined;
740
+ output_tokens?: number | undefined;
741
+ temperature?: number | undefined;
742
+ }>>;
743
+ decision: z.ZodOptional<z.ZodObject<{
744
+ outcome: z.ZodEnum<["approved", "denied", "escalated", "deferred", "no_action", "custom"]>;
745
+ outcome_label: z.ZodOptional<z.ZodString>;
746
+ confidence: z.ZodOptional<z.ZodNumber>;
747
+ human_in_the_loop: z.ZodOptional<z.ZodBoolean>;
748
+ policy_thresholds_crossed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
749
+ reversed_by_event: z.ZodOptional<z.ZodString>;
750
+ }, "strict", z.ZodTypeAny, {
751
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
752
+ outcome_label?: string | undefined;
753
+ confidence?: number | undefined;
754
+ human_in_the_loop?: boolean | undefined;
755
+ policy_thresholds_crossed?: string[] | undefined;
756
+ reversed_by_event?: string | undefined;
757
+ }, {
758
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
759
+ outcome_label?: string | undefined;
760
+ confidence?: number | undefined;
761
+ human_in_the_loop?: boolean | undefined;
762
+ policy_thresholds_crossed?: string[] | undefined;
763
+ reversed_by_event?: string | undefined;
764
+ }>>;
765
+ payload_ref: z.ZodOptional<z.ZodObject<{
766
+ s3_uri_intent: z.ZodOptional<z.ZodString>;
767
+ sha256: z.ZodString;
768
+ size_bytes: z.ZodNumber;
769
+ encryption: z.ZodObject<{
770
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
771
+ data_key_wrapped: z.ZodString;
772
+ kms_key_arn: z.ZodOptional<z.ZodString>;
773
+ }, "strict", z.ZodTypeAny, {
774
+ algorithm: "aes-256-gcm";
775
+ data_key_wrapped: string;
776
+ kms_key_arn?: string | undefined;
777
+ }, {
778
+ algorithm: "aes-256-gcm";
779
+ data_key_wrapped: string;
780
+ kms_key_arn?: string | undefined;
781
+ }>;
782
+ content_type: z.ZodOptional<z.ZodEnum<["application/json", "text/plain", "application/vnd.runfile.llm-request+json", "application/vnd.runfile.llm-response+json", "application/vnd.runfile.tool-call+json", "application/vnd.runfile.tool-result+json", "application/vnd.runfile.state-snapshot+json"]>>;
783
+ redaction_applied: z.ZodOptional<z.ZodObject<{
784
+ redacted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
785
+ tokenized_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
786
+ classifier_version: z.ZodOptional<z.ZodString>;
787
+ }, "strict", z.ZodTypeAny, {
788
+ redacted_classes?: string[] | undefined;
789
+ tokenized_classes?: string[] | undefined;
790
+ classifier_version?: string | undefined;
791
+ }, {
792
+ redacted_classes?: string[] | undefined;
793
+ tokenized_classes?: string[] | undefined;
794
+ classifier_version?: string | undefined;
795
+ }>>;
796
+ ciphertext_base64: z.ZodString;
797
+ }, "strict", z.ZodTypeAny, {
798
+ sha256: string;
799
+ size_bytes: number;
800
+ encryption: {
801
+ algorithm: "aes-256-gcm";
802
+ data_key_wrapped: string;
803
+ kms_key_arn?: string | undefined;
804
+ };
805
+ ciphertext_base64: string;
806
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
807
+ redaction_applied?: {
808
+ redacted_classes?: string[] | undefined;
809
+ tokenized_classes?: string[] | undefined;
810
+ classifier_version?: string | undefined;
811
+ } | undefined;
812
+ s3_uri_intent?: string | undefined;
813
+ }, {
814
+ sha256: string;
815
+ size_bytes: number;
816
+ encryption: {
817
+ algorithm: "aes-256-gcm";
818
+ data_key_wrapped: string;
819
+ kms_key_arn?: string | undefined;
820
+ };
821
+ ciphertext_base64: string;
822
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
823
+ redaction_applied?: {
824
+ redacted_classes?: string[] | undefined;
825
+ tokenized_classes?: string[] | undefined;
826
+ classifier_version?: string | undefined;
827
+ } | undefined;
828
+ s3_uri_intent?: string | undefined;
829
+ }>>;
830
+ redaction_policy_version: z.ZodString;
831
+ regulatory_scope_version: z.ZodOptional<z.ZodString>;
832
+ anomaly_flags: z.ZodOptional<z.ZodArray<z.ZodObject<{
833
+ code: z.ZodEnum<["missing_ambient_context", "chain_break", "out_of_order_arrival", "model_version_drift", "unknown_agent_identity", "data_classification_mismatch", "policy_threshold_without_hitl", "unauthorized_tool_invocation", "redaction_policy_mismatch", "schema_version_warning"]>;
834
+ severity: z.ZodEnum<["info", "warning", "error", "critical"]>;
835
+ detail: z.ZodOptional<z.ZodString>;
836
+ }, "strict", z.ZodTypeAny, {
837
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
838
+ severity: "info" | "warning" | "error" | "critical";
839
+ detail?: string | undefined;
840
+ }, {
841
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
842
+ severity: "info" | "warning" | "error" | "critical";
843
+ detail?: string | undefined;
844
+ }>, "many">>;
845
+ environment: z.ZodOptional<z.ZodEnum<["production", "staging", "development"]>>;
846
+ labels: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
847
+ prev_hash_intent: z.ZodString;
848
+ }, "strict", z.ZodTypeAny, {
849
+ schema_version: string;
850
+ event_id: string;
851
+ agent_run_id: string;
852
+ parent_event_id: string | null;
853
+ captured_at: string;
854
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
855
+ sdk: {
856
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
857
+ name: "runfile-py" | "@runfile/sdk";
858
+ version: string;
859
+ framework_version?: string | undefined;
860
+ host?: string | undefined;
861
+ };
862
+ actor: {
863
+ type: "agent" | "human" | "tool" | "system";
864
+ delegation_chain: string[];
865
+ agent_identity?: string | undefined;
866
+ human_principal?: string | undefined;
867
+ tool_id?: string | undefined;
868
+ tool_version_hash?: string | undefined;
869
+ };
870
+ action: {
871
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
872
+ name: string;
873
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
874
+ duration_ms?: number | undefined;
875
+ };
876
+ subject: {
877
+ regulatory_tags?: string[] | undefined;
878
+ resource_urn?: string | undefined;
879
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
880
+ };
881
+ redaction_policy_version: string;
882
+ prev_hash_intent: string;
883
+ decision?: {
884
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
885
+ outcome_label?: string | undefined;
886
+ confidence?: number | undefined;
887
+ human_in_the_loop?: boolean | undefined;
888
+ policy_thresholds_crossed?: string[] | undefined;
889
+ reversed_by_event?: string | undefined;
890
+ } | undefined;
891
+ model_ref?: {
892
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
893
+ model_id: string;
894
+ model_version_hash?: string | undefined;
895
+ system_prompt_hash?: string | undefined;
896
+ tools_hash?: string | undefined;
897
+ input_tokens?: number | undefined;
898
+ output_tokens?: number | undefined;
899
+ temperature?: number | undefined;
900
+ } | undefined;
901
+ payload_ref?: {
902
+ sha256: string;
903
+ size_bytes: number;
904
+ encryption: {
905
+ algorithm: "aes-256-gcm";
906
+ data_key_wrapped: string;
907
+ kms_key_arn?: string | undefined;
908
+ };
909
+ ciphertext_base64: string;
910
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
911
+ redaction_applied?: {
912
+ redacted_classes?: string[] | undefined;
913
+ tokenized_classes?: string[] | undefined;
914
+ classifier_version?: string | undefined;
915
+ } | undefined;
916
+ s3_uri_intent?: string | undefined;
917
+ } | undefined;
918
+ regulatory_scope_version?: string | undefined;
919
+ anomaly_flags?: {
920
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
921
+ severity: "info" | "warning" | "error" | "critical";
922
+ detail?: string | undefined;
923
+ }[] | undefined;
924
+ environment?: "production" | "staging" | "development" | undefined;
925
+ labels?: Record<string, string> | undefined;
926
+ }, {
927
+ schema_version: string;
928
+ event_id: string;
929
+ agent_run_id: string;
930
+ parent_event_id: string | null;
931
+ captured_at: string;
932
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
933
+ sdk: {
934
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
935
+ name: "runfile-py" | "@runfile/sdk";
936
+ version: string;
937
+ framework_version?: string | undefined;
938
+ host?: string | undefined;
939
+ };
940
+ actor: {
941
+ type: "agent" | "human" | "tool" | "system";
942
+ agent_identity?: string | undefined;
943
+ human_principal?: string | undefined;
944
+ delegation_chain?: string[] | undefined;
945
+ tool_id?: string | undefined;
946
+ tool_version_hash?: string | undefined;
947
+ };
948
+ action: {
949
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
950
+ name: string;
951
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
952
+ duration_ms?: number | undefined;
953
+ };
954
+ subject: {
955
+ regulatory_tags?: string[] | undefined;
956
+ resource_urn?: string | undefined;
957
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
958
+ };
959
+ redaction_policy_version: string;
960
+ prev_hash_intent: string;
961
+ decision?: {
962
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
963
+ outcome_label?: string | undefined;
964
+ confidence?: number | undefined;
965
+ human_in_the_loop?: boolean | undefined;
966
+ policy_thresholds_crossed?: string[] | undefined;
967
+ reversed_by_event?: string | undefined;
968
+ } | undefined;
969
+ model_ref?: {
970
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
971
+ model_id: string;
972
+ model_version_hash?: string | undefined;
973
+ system_prompt_hash?: string | undefined;
974
+ tools_hash?: string | undefined;
975
+ input_tokens?: number | undefined;
976
+ output_tokens?: number | undefined;
977
+ temperature?: number | undefined;
978
+ } | undefined;
979
+ payload_ref?: {
980
+ sha256: string;
981
+ size_bytes: number;
982
+ encryption: {
983
+ algorithm: "aes-256-gcm";
984
+ data_key_wrapped: string;
985
+ kms_key_arn?: string | undefined;
986
+ };
987
+ ciphertext_base64: string;
988
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
989
+ redaction_applied?: {
990
+ redacted_classes?: string[] | undefined;
991
+ tokenized_classes?: string[] | undefined;
992
+ classifier_version?: string | undefined;
993
+ } | undefined;
994
+ s3_uri_intent?: string | undefined;
995
+ } | undefined;
996
+ regulatory_scope_version?: string | undefined;
997
+ anomaly_flags?: {
998
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
999
+ severity: "info" | "warning" | "error" | "critical";
1000
+ detail?: string | undefined;
1001
+ }[] | undefined;
1002
+ environment?: "production" | "staging" | "development" | undefined;
1003
+ labels?: Record<string, string> | undefined;
1004
+ }>, {
1005
+ schema_version: string;
1006
+ event_id: string;
1007
+ agent_run_id: string;
1008
+ parent_event_id: string | null;
1009
+ captured_at: string;
1010
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
1011
+ sdk: {
1012
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
1013
+ name: "runfile-py" | "@runfile/sdk";
1014
+ version: string;
1015
+ framework_version?: string | undefined;
1016
+ host?: string | undefined;
1017
+ };
1018
+ actor: {
1019
+ type: "agent" | "human" | "tool" | "system";
1020
+ delegation_chain: string[];
1021
+ agent_identity?: string | undefined;
1022
+ human_principal?: string | undefined;
1023
+ tool_id?: string | undefined;
1024
+ tool_version_hash?: string | undefined;
1025
+ };
1026
+ action: {
1027
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
1028
+ name: string;
1029
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
1030
+ duration_ms?: number | undefined;
1031
+ };
1032
+ subject: {
1033
+ regulatory_tags?: string[] | undefined;
1034
+ resource_urn?: string | undefined;
1035
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
1036
+ };
1037
+ redaction_policy_version: string;
1038
+ prev_hash_intent: string;
1039
+ decision?: {
1040
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
1041
+ outcome_label?: string | undefined;
1042
+ confidence?: number | undefined;
1043
+ human_in_the_loop?: boolean | undefined;
1044
+ policy_thresholds_crossed?: string[] | undefined;
1045
+ reversed_by_event?: string | undefined;
1046
+ } | undefined;
1047
+ model_ref?: {
1048
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
1049
+ model_id: string;
1050
+ model_version_hash?: string | undefined;
1051
+ system_prompt_hash?: string | undefined;
1052
+ tools_hash?: string | undefined;
1053
+ input_tokens?: number | undefined;
1054
+ output_tokens?: number | undefined;
1055
+ temperature?: number | undefined;
1056
+ } | undefined;
1057
+ payload_ref?: {
1058
+ sha256: string;
1059
+ size_bytes: number;
1060
+ encryption: {
1061
+ algorithm: "aes-256-gcm";
1062
+ data_key_wrapped: string;
1063
+ kms_key_arn?: string | undefined;
1064
+ };
1065
+ ciphertext_base64: string;
1066
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
1067
+ redaction_applied?: {
1068
+ redacted_classes?: string[] | undefined;
1069
+ tokenized_classes?: string[] | undefined;
1070
+ classifier_version?: string | undefined;
1071
+ } | undefined;
1072
+ s3_uri_intent?: string | undefined;
1073
+ } | undefined;
1074
+ regulatory_scope_version?: string | undefined;
1075
+ anomaly_flags?: {
1076
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
1077
+ severity: "info" | "warning" | "error" | "critical";
1078
+ detail?: string | undefined;
1079
+ }[] | undefined;
1080
+ environment?: "production" | "staging" | "development" | undefined;
1081
+ labels?: Record<string, string> | undefined;
1082
+ }, {
1083
+ schema_version: string;
1084
+ event_id: string;
1085
+ agent_run_id: string;
1086
+ parent_event_id: string | null;
1087
+ captured_at: string;
1088
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
1089
+ sdk: {
1090
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
1091
+ name: "runfile-py" | "@runfile/sdk";
1092
+ version: string;
1093
+ framework_version?: string | undefined;
1094
+ host?: string | undefined;
1095
+ };
1096
+ actor: {
1097
+ type: "agent" | "human" | "tool" | "system";
1098
+ agent_identity?: string | undefined;
1099
+ human_principal?: string | undefined;
1100
+ delegation_chain?: string[] | undefined;
1101
+ tool_id?: string | undefined;
1102
+ tool_version_hash?: string | undefined;
1103
+ };
1104
+ action: {
1105
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
1106
+ name: string;
1107
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
1108
+ duration_ms?: number | undefined;
1109
+ };
1110
+ subject: {
1111
+ regulatory_tags?: string[] | undefined;
1112
+ resource_urn?: string | undefined;
1113
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
1114
+ };
1115
+ redaction_policy_version: string;
1116
+ prev_hash_intent: string;
1117
+ decision?: {
1118
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
1119
+ outcome_label?: string | undefined;
1120
+ confidence?: number | undefined;
1121
+ human_in_the_loop?: boolean | undefined;
1122
+ policy_thresholds_crossed?: string[] | undefined;
1123
+ reversed_by_event?: string | undefined;
1124
+ } | undefined;
1125
+ model_ref?: {
1126
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
1127
+ model_id: string;
1128
+ model_version_hash?: string | undefined;
1129
+ system_prompt_hash?: string | undefined;
1130
+ tools_hash?: string | undefined;
1131
+ input_tokens?: number | undefined;
1132
+ output_tokens?: number | undefined;
1133
+ temperature?: number | undefined;
1134
+ } | undefined;
1135
+ payload_ref?: {
1136
+ sha256: string;
1137
+ size_bytes: number;
1138
+ encryption: {
1139
+ algorithm: "aes-256-gcm";
1140
+ data_key_wrapped: string;
1141
+ kms_key_arn?: string | undefined;
1142
+ };
1143
+ ciphertext_base64: string;
1144
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
1145
+ redaction_applied?: {
1146
+ redacted_classes?: string[] | undefined;
1147
+ tokenized_classes?: string[] | undefined;
1148
+ classifier_version?: string | undefined;
1149
+ } | undefined;
1150
+ s3_uri_intent?: string | undefined;
1151
+ } | undefined;
1152
+ regulatory_scope_version?: string | undefined;
1153
+ anomaly_flags?: {
1154
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
1155
+ severity: "info" | "warning" | "error" | "critical";
1156
+ detail?: string | undefined;
1157
+ }[] | undefined;
1158
+ environment?: "production" | "staging" | "development" | undefined;
1159
+ labels?: Record<string, string> | undefined;
1160
+ }>, "many">;
1161
+ }, "strict", z.ZodTypeAny, {
1162
+ events: {
1163
+ schema_version: string;
1164
+ event_id: string;
1165
+ agent_run_id: string;
1166
+ parent_event_id: string | null;
1167
+ captured_at: string;
1168
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
1169
+ sdk: {
1170
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
1171
+ name: "runfile-py" | "@runfile/sdk";
1172
+ version: string;
1173
+ framework_version?: string | undefined;
1174
+ host?: string | undefined;
1175
+ };
1176
+ actor: {
1177
+ type: "agent" | "human" | "tool" | "system";
1178
+ delegation_chain: string[];
1179
+ agent_identity?: string | undefined;
1180
+ human_principal?: string | undefined;
1181
+ tool_id?: string | undefined;
1182
+ tool_version_hash?: string | undefined;
1183
+ };
1184
+ action: {
1185
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
1186
+ name: string;
1187
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
1188
+ duration_ms?: number | undefined;
1189
+ };
1190
+ subject: {
1191
+ regulatory_tags?: string[] | undefined;
1192
+ resource_urn?: string | undefined;
1193
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
1194
+ };
1195
+ redaction_policy_version: string;
1196
+ prev_hash_intent: string;
1197
+ decision?: {
1198
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
1199
+ outcome_label?: string | undefined;
1200
+ confidence?: number | undefined;
1201
+ human_in_the_loop?: boolean | undefined;
1202
+ policy_thresholds_crossed?: string[] | undefined;
1203
+ reversed_by_event?: string | undefined;
1204
+ } | undefined;
1205
+ model_ref?: {
1206
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
1207
+ model_id: string;
1208
+ model_version_hash?: string | undefined;
1209
+ system_prompt_hash?: string | undefined;
1210
+ tools_hash?: string | undefined;
1211
+ input_tokens?: number | undefined;
1212
+ output_tokens?: number | undefined;
1213
+ temperature?: number | undefined;
1214
+ } | undefined;
1215
+ payload_ref?: {
1216
+ sha256: string;
1217
+ size_bytes: number;
1218
+ encryption: {
1219
+ algorithm: "aes-256-gcm";
1220
+ data_key_wrapped: string;
1221
+ kms_key_arn?: string | undefined;
1222
+ };
1223
+ ciphertext_base64: string;
1224
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
1225
+ redaction_applied?: {
1226
+ redacted_classes?: string[] | undefined;
1227
+ tokenized_classes?: string[] | undefined;
1228
+ classifier_version?: string | undefined;
1229
+ } | undefined;
1230
+ s3_uri_intent?: string | undefined;
1231
+ } | undefined;
1232
+ regulatory_scope_version?: string | undefined;
1233
+ anomaly_flags?: {
1234
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
1235
+ severity: "info" | "warning" | "error" | "critical";
1236
+ detail?: string | undefined;
1237
+ }[] | undefined;
1238
+ environment?: "production" | "staging" | "development" | undefined;
1239
+ labels?: Record<string, string> | undefined;
1240
+ }[];
1241
+ batch_id: string;
1242
+ }, {
1243
+ events: {
1244
+ schema_version: string;
1245
+ event_id: string;
1246
+ agent_run_id: string;
1247
+ parent_event_id: string | null;
1248
+ captured_at: string;
1249
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
1250
+ sdk: {
1251
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
1252
+ name: "runfile-py" | "@runfile/sdk";
1253
+ version: string;
1254
+ framework_version?: string | undefined;
1255
+ host?: string | undefined;
1256
+ };
1257
+ actor: {
1258
+ type: "agent" | "human" | "tool" | "system";
1259
+ agent_identity?: string | undefined;
1260
+ human_principal?: string | undefined;
1261
+ delegation_chain?: string[] | undefined;
1262
+ tool_id?: string | undefined;
1263
+ tool_version_hash?: string | undefined;
1264
+ };
1265
+ action: {
1266
+ kind: "agent_run_start" | "agent_run_end" | "graph_node_enter" | "graph_node_exit" | "llm_call" | "tool_call" | "tool_result" | "state_read" | "state_write" | "decision" | "handoff" | "human_approval" | "human_input" | "policy_check" | "anomaly_flag" | "sdk_diagnostic";
1267
+ name: string;
1268
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
1269
+ duration_ms?: number | undefined;
1270
+ };
1271
+ subject: {
1272
+ regulatory_tags?: string[] | undefined;
1273
+ resource_urn?: string | undefined;
1274
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
1275
+ };
1276
+ redaction_policy_version: string;
1277
+ prev_hash_intent: string;
1278
+ decision?: {
1279
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
1280
+ outcome_label?: string | undefined;
1281
+ confidence?: number | undefined;
1282
+ human_in_the_loop?: boolean | undefined;
1283
+ policy_thresholds_crossed?: string[] | undefined;
1284
+ reversed_by_event?: string | undefined;
1285
+ } | undefined;
1286
+ model_ref?: {
1287
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
1288
+ model_id: string;
1289
+ model_version_hash?: string | undefined;
1290
+ system_prompt_hash?: string | undefined;
1291
+ tools_hash?: string | undefined;
1292
+ input_tokens?: number | undefined;
1293
+ output_tokens?: number | undefined;
1294
+ temperature?: number | undefined;
1295
+ } | undefined;
1296
+ payload_ref?: {
1297
+ sha256: string;
1298
+ size_bytes: number;
1299
+ encryption: {
1300
+ algorithm: "aes-256-gcm";
1301
+ data_key_wrapped: string;
1302
+ kms_key_arn?: string | undefined;
1303
+ };
1304
+ ciphertext_base64: string;
1305
+ content_type?: "application/json" | "text/plain" | "application/vnd.runfile.llm-request+json" | "application/vnd.runfile.llm-response+json" | "application/vnd.runfile.tool-call+json" | "application/vnd.runfile.tool-result+json" | "application/vnd.runfile.state-snapshot+json" | undefined;
1306
+ redaction_applied?: {
1307
+ redacted_classes?: string[] | undefined;
1308
+ tokenized_classes?: string[] | undefined;
1309
+ classifier_version?: string | undefined;
1310
+ } | undefined;
1311
+ s3_uri_intent?: string | undefined;
1312
+ } | undefined;
1313
+ regulatory_scope_version?: string | undefined;
1314
+ anomaly_flags?: {
1315
+ code: "missing_ambient_context" | "chain_break" | "out_of_order_arrival" | "model_version_drift" | "unknown_agent_identity" | "data_classification_mismatch" | "policy_threshold_without_hitl" | "unauthorized_tool_invocation" | "redaction_policy_mismatch" | "schema_version_warning";
1316
+ severity: "info" | "warning" | "error" | "critical";
1317
+ detail?: string | undefined;
1318
+ }[] | undefined;
1319
+ environment?: "production" | "staging" | "development" | undefined;
1320
+ labels?: Record<string, string> | undefined;
1321
+ }[];
1322
+ batch_id: string;
1323
+ }>;
1324
+ export type BatchSubmission = z.infer<typeof BatchSubmissionSchema>;
1325
+ export declare const AcceptedEventSchema: z.ZodObject<{
1326
+ event_id: z.ZodString;
1327
+ accepted_at: z.ZodString;
1328
+ payload_s3_uri: z.ZodString;
1329
+ processing_status: z.ZodOptional<z.ZodLiteral<"queued">>;
1330
+ }, "strict", z.ZodTypeAny, {
1331
+ event_id: string;
1332
+ accepted_at: string;
1333
+ payload_s3_uri: string;
1334
+ processing_status?: "queued" | undefined;
1335
+ }, {
1336
+ event_id: string;
1337
+ accepted_at: string;
1338
+ payload_s3_uri: string;
1339
+ processing_status?: "queued" | undefined;
1340
+ }>;
1341
+ export type AcceptedEvent = z.infer<typeof AcceptedEventSchema>;
1342
+ export declare const BatchAcceptedSchema: z.ZodObject<{
1343
+ batch_id: z.ZodString;
1344
+ accepted_count: z.ZodNumber;
1345
+ accepted_events: z.ZodArray<z.ZodObject<{
1346
+ event_id: z.ZodString;
1347
+ accepted_at: z.ZodString;
1348
+ payload_s3_uri: z.ZodString;
1349
+ processing_status: z.ZodOptional<z.ZodLiteral<"queued">>;
1350
+ }, "strict", z.ZodTypeAny, {
1351
+ event_id: string;
1352
+ accepted_at: string;
1353
+ payload_s3_uri: string;
1354
+ processing_status?: "queued" | undefined;
1355
+ }, {
1356
+ event_id: string;
1357
+ accepted_at: string;
1358
+ payload_s3_uri: string;
1359
+ processing_status?: "queued" | undefined;
1360
+ }>, "many">;
1361
+ received_at: z.ZodString;
1362
+ }, "strict", z.ZodTypeAny, {
1363
+ received_at: string;
1364
+ batch_id: string;
1365
+ accepted_count: number;
1366
+ accepted_events: {
1367
+ event_id: string;
1368
+ accepted_at: string;
1369
+ payload_s3_uri: string;
1370
+ processing_status?: "queued" | undefined;
1371
+ }[];
1372
+ }, {
1373
+ received_at: string;
1374
+ batch_id: string;
1375
+ accepted_count: number;
1376
+ accepted_events: {
1377
+ event_id: string;
1378
+ accepted_at: string;
1379
+ payload_s3_uri: string;
1380
+ processing_status?: "queued" | undefined;
1381
+ }[];
1382
+ }>;
1383
+ export type BatchAccepted = z.infer<typeof BatchAcceptedSchema>;
1384
+ export declare const EventRejectionCodeEnum: z.ZodEnum<["schema_validation_failed", "duplicate_event_id", "payload_too_large", "payload_sha256_mismatch", "kms_key_unknown", "kms_key_unauthorized", "actor_scope_violation", "environment_scope_violation", "region_scope_violation", "timestamp_out_of_range", "missing_required_conditional_field"]>;
1385
+ export declare const EventRejectionSchema: z.ZodObject<{
1386
+ event_id: z.ZodString;
1387
+ error_code: z.ZodEnum<["schema_validation_failed", "duplicate_event_id", "payload_too_large", "payload_sha256_mismatch", "kms_key_unknown", "kms_key_unauthorized", "actor_scope_violation", "environment_scope_violation", "region_scope_violation", "timestamp_out_of_range", "missing_required_conditional_field"]>;
1388
+ error_message: z.ZodString;
1389
+ field_path: z.ZodOptional<z.ZodString>;
1390
+ }, "strict", z.ZodTypeAny, {
1391
+ event_id: string;
1392
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1393
+ error_message: string;
1394
+ field_path?: string | undefined;
1395
+ }, {
1396
+ event_id: string;
1397
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1398
+ error_message: string;
1399
+ field_path?: string | undefined;
1400
+ }>;
1401
+ export type EventRejection = z.infer<typeof EventRejectionSchema>;
1402
+ export declare const BatchPartialSchema: z.ZodObject<{
1403
+ batch_id: z.ZodString;
1404
+ accepted_count: z.ZodNumber;
1405
+ rejected_count: z.ZodNumber;
1406
+ accepted_events: z.ZodArray<z.ZodObject<{
1407
+ event_id: z.ZodString;
1408
+ accepted_at: z.ZodString;
1409
+ payload_s3_uri: z.ZodString;
1410
+ processing_status: z.ZodOptional<z.ZodLiteral<"queued">>;
1411
+ }, "strict", z.ZodTypeAny, {
1412
+ event_id: string;
1413
+ accepted_at: string;
1414
+ payload_s3_uri: string;
1415
+ processing_status?: "queued" | undefined;
1416
+ }, {
1417
+ event_id: string;
1418
+ accepted_at: string;
1419
+ payload_s3_uri: string;
1420
+ processing_status?: "queued" | undefined;
1421
+ }>, "many">;
1422
+ rejected_events: z.ZodArray<z.ZodObject<{
1423
+ event_id: z.ZodString;
1424
+ error_code: z.ZodEnum<["schema_validation_failed", "duplicate_event_id", "payload_too_large", "payload_sha256_mismatch", "kms_key_unknown", "kms_key_unauthorized", "actor_scope_violation", "environment_scope_violation", "region_scope_violation", "timestamp_out_of_range", "missing_required_conditional_field"]>;
1425
+ error_message: z.ZodString;
1426
+ field_path: z.ZodOptional<z.ZodString>;
1427
+ }, "strict", z.ZodTypeAny, {
1428
+ event_id: string;
1429
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1430
+ error_message: string;
1431
+ field_path?: string | undefined;
1432
+ }, {
1433
+ event_id: string;
1434
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1435
+ error_message: string;
1436
+ field_path?: string | undefined;
1437
+ }>, "many">;
1438
+ received_at: z.ZodString;
1439
+ }, "strict", z.ZodTypeAny, {
1440
+ received_at: string;
1441
+ batch_id: string;
1442
+ accepted_count: number;
1443
+ accepted_events: {
1444
+ event_id: string;
1445
+ accepted_at: string;
1446
+ payload_s3_uri: string;
1447
+ processing_status?: "queued" | undefined;
1448
+ }[];
1449
+ rejected_count: number;
1450
+ rejected_events: {
1451
+ event_id: string;
1452
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1453
+ error_message: string;
1454
+ field_path?: string | undefined;
1455
+ }[];
1456
+ }, {
1457
+ received_at: string;
1458
+ batch_id: string;
1459
+ accepted_count: number;
1460
+ accepted_events: {
1461
+ event_id: string;
1462
+ accepted_at: string;
1463
+ payload_s3_uri: string;
1464
+ processing_status?: "queued" | undefined;
1465
+ }[];
1466
+ rejected_count: number;
1467
+ rejected_events: {
1468
+ event_id: string;
1469
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1470
+ error_message: string;
1471
+ field_path?: string | undefined;
1472
+ }[];
1473
+ }>;
1474
+ export type BatchPartial = z.infer<typeof BatchPartialSchema>;
1475
+ export declare const ErrorCodeEnum: z.ZodEnum<["unauthorized", "forbidden", "bad_request", "schema_version_unsupported", "batch_too_large", "rate_limited", "quota_exceeded", "service_unavailable", "internal_error", "idempotency_conflict"]>;
1476
+ export declare const ErrorSchema: z.ZodObject<{
1477
+ error_code: z.ZodEnum<["unauthorized", "forbidden", "bad_request", "schema_version_unsupported", "batch_too_large", "rate_limited", "quota_exceeded", "service_unavailable", "internal_error", "idempotency_conflict"]>;
1478
+ error_message: z.ZodString;
1479
+ retry_after_seconds: z.ZodOptional<z.ZodNumber>;
1480
+ request_id: z.ZodOptional<z.ZodString>;
1481
+ }, "strict", z.ZodTypeAny, {
1482
+ error_code: "unauthorized" | "forbidden" | "bad_request" | "schema_version_unsupported" | "batch_too_large" | "rate_limited" | "quota_exceeded" | "service_unavailable" | "internal_error" | "idempotency_conflict";
1483
+ error_message: string;
1484
+ retry_after_seconds?: number | undefined;
1485
+ request_id?: string | undefined;
1486
+ }, {
1487
+ error_code: "unauthorized" | "forbidden" | "bad_request" | "schema_version_unsupported" | "batch_too_large" | "rate_limited" | "quota_exceeded" | "service_unavailable" | "internal_error" | "idempotency_conflict";
1488
+ error_message: string;
1489
+ retry_after_seconds?: number | undefined;
1490
+ request_id?: string | undefined;
1491
+ }>;
1492
+ export type IngestError = z.infer<typeof ErrorSchema>;
1493
+ export declare const BatchRejectedSchema: z.ZodObject<{
1494
+ batch_id: z.ZodString;
1495
+ error: z.ZodObject<{
1496
+ error_code: z.ZodEnum<["unauthorized", "forbidden", "bad_request", "schema_version_unsupported", "batch_too_large", "rate_limited", "quota_exceeded", "service_unavailable", "internal_error", "idempotency_conflict"]>;
1497
+ error_message: z.ZodString;
1498
+ retry_after_seconds: z.ZodOptional<z.ZodNumber>;
1499
+ request_id: z.ZodOptional<z.ZodString>;
1500
+ }, "strict", z.ZodTypeAny, {
1501
+ error_code: "unauthorized" | "forbidden" | "bad_request" | "schema_version_unsupported" | "batch_too_large" | "rate_limited" | "quota_exceeded" | "service_unavailable" | "internal_error" | "idempotency_conflict";
1502
+ error_message: string;
1503
+ retry_after_seconds?: number | undefined;
1504
+ request_id?: string | undefined;
1505
+ }, {
1506
+ error_code: "unauthorized" | "forbidden" | "bad_request" | "schema_version_unsupported" | "batch_too_large" | "rate_limited" | "quota_exceeded" | "service_unavailable" | "internal_error" | "idempotency_conflict";
1507
+ error_message: string;
1508
+ retry_after_seconds?: number | undefined;
1509
+ request_id?: string | undefined;
1510
+ }>;
1511
+ rejected_events: z.ZodArray<z.ZodObject<{
1512
+ event_id: z.ZodString;
1513
+ error_code: z.ZodEnum<["schema_validation_failed", "duplicate_event_id", "payload_too_large", "payload_sha256_mismatch", "kms_key_unknown", "kms_key_unauthorized", "actor_scope_violation", "environment_scope_violation", "region_scope_violation", "timestamp_out_of_range", "missing_required_conditional_field"]>;
1514
+ error_message: z.ZodString;
1515
+ field_path: z.ZodOptional<z.ZodString>;
1516
+ }, "strict", z.ZodTypeAny, {
1517
+ event_id: string;
1518
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1519
+ error_message: string;
1520
+ field_path?: string | undefined;
1521
+ }, {
1522
+ event_id: string;
1523
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1524
+ error_message: string;
1525
+ field_path?: string | undefined;
1526
+ }>, "many">;
1527
+ }, "strict", z.ZodTypeAny, {
1528
+ error: {
1529
+ error_code: "unauthorized" | "forbidden" | "bad_request" | "schema_version_unsupported" | "batch_too_large" | "rate_limited" | "quota_exceeded" | "service_unavailable" | "internal_error" | "idempotency_conflict";
1530
+ error_message: string;
1531
+ retry_after_seconds?: number | undefined;
1532
+ request_id?: string | undefined;
1533
+ };
1534
+ batch_id: string;
1535
+ rejected_events: {
1536
+ event_id: string;
1537
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1538
+ error_message: string;
1539
+ field_path?: string | undefined;
1540
+ }[];
1541
+ }, {
1542
+ error: {
1543
+ error_code: "unauthorized" | "forbidden" | "bad_request" | "schema_version_unsupported" | "batch_too_large" | "rate_limited" | "quota_exceeded" | "service_unavailable" | "internal_error" | "idempotency_conflict";
1544
+ error_message: string;
1545
+ retry_after_seconds?: number | undefined;
1546
+ request_id?: string | undefined;
1547
+ };
1548
+ batch_id: string;
1549
+ rejected_events: {
1550
+ event_id: string;
1551
+ error_code: "schema_validation_failed" | "duplicate_event_id" | "payload_too_large" | "payload_sha256_mismatch" | "kms_key_unknown" | "kms_key_unauthorized" | "actor_scope_violation" | "environment_scope_violation" | "region_scope_violation" | "timestamp_out_of_range" | "missing_required_conditional_field";
1552
+ error_message: string;
1553
+ field_path?: string | undefined;
1554
+ }[];
1555
+ }>;
1556
+ export type BatchRejected = z.infer<typeof BatchRejectedSchema>;
1557
+ export declare const RedactionTreatmentEnum: z.ZodEnum<["redact", "tokenize", "encrypt"]>;
1558
+ export declare const RedactionPolicySchema: z.ZodObject<{
1559
+ policy_version: z.ZodString;
1560
+ classification_rules: z.ZodArray<z.ZodObject<{
1561
+ classification: z.ZodString;
1562
+ treatment: z.ZodEnum<["redact", "tokenize", "encrypt"]>;
1563
+ detector: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1564
+ }, "strict", z.ZodTypeAny, {
1565
+ classification: string;
1566
+ treatment: "redact" | "tokenize" | "encrypt";
1567
+ detector?: Record<string, unknown> | undefined;
1568
+ }, {
1569
+ classification: string;
1570
+ treatment: "redact" | "tokenize" | "encrypt";
1571
+ detector?: Record<string, unknown> | undefined;
1572
+ }>, "many">;
1573
+ fetched_at: z.ZodString;
1574
+ ttl_seconds: z.ZodDefault<z.ZodNumber>;
1575
+ }, "strict", z.ZodTypeAny, {
1576
+ policy_version: string;
1577
+ classification_rules: {
1578
+ classification: string;
1579
+ treatment: "redact" | "tokenize" | "encrypt";
1580
+ detector?: Record<string, unknown> | undefined;
1581
+ }[];
1582
+ fetched_at: string;
1583
+ ttl_seconds: number;
1584
+ }, {
1585
+ policy_version: string;
1586
+ classification_rules: {
1587
+ classification: string;
1588
+ treatment: "redact" | "tokenize" | "encrypt";
1589
+ detector?: Record<string, unknown> | undefined;
1590
+ }[];
1591
+ fetched_at: string;
1592
+ ttl_seconds?: number | undefined;
1593
+ }>;
1594
+ export type RedactionPolicy = z.infer<typeof RedactionPolicySchema>;
1595
+ //# sourceMappingURL=ingest.d.ts.map