@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,866 @@
1
+ import { z } from 'zod';
2
+ export declare const ActorSchema: z.ZodEffects<z.ZodObject<{
3
+ type: z.ZodEnum<["agent", "human", "tool", "system"]>;
4
+ agent_identity: z.ZodOptional<z.ZodString>;
5
+ human_principal: z.ZodOptional<z.ZodString>;
6
+ delegation_chain: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
7
+ tool_id: z.ZodOptional<z.ZodString>;
8
+ tool_version_hash: z.ZodOptional<z.ZodString>;
9
+ }, "strict", z.ZodTypeAny, {
10
+ type: "agent" | "human" | "tool" | "system";
11
+ delegation_chain: string[];
12
+ agent_identity?: string | undefined;
13
+ human_principal?: string | undefined;
14
+ tool_id?: string | undefined;
15
+ tool_version_hash?: string | undefined;
16
+ }, {
17
+ type: "agent" | "human" | "tool" | "system";
18
+ agent_identity?: string | undefined;
19
+ human_principal?: string | undefined;
20
+ delegation_chain?: string[] | undefined;
21
+ tool_id?: string | undefined;
22
+ tool_version_hash?: string | undefined;
23
+ }>, {
24
+ type: "agent" | "human" | "tool" | "system";
25
+ delegation_chain: string[];
26
+ agent_identity?: string | undefined;
27
+ human_principal?: string | undefined;
28
+ tool_id?: string | undefined;
29
+ tool_version_hash?: string | undefined;
30
+ }, {
31
+ type: "agent" | "human" | "tool" | "system";
32
+ agent_identity?: string | undefined;
33
+ human_principal?: string | undefined;
34
+ delegation_chain?: string[] | undefined;
35
+ tool_id?: string | undefined;
36
+ tool_version_hash?: string | undefined;
37
+ }>;
38
+ export type Actor = z.infer<typeof ActorSchema>;
39
+ export declare const ActionKindEnum: 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"]>;
40
+ export type ActionKind = z.infer<typeof ActionKindEnum>;
41
+ export declare const ActionOutcomeEnum: z.ZodEnum<["success", "failure", "partial", "timeout", "cancelled"]>;
42
+ export declare const ActionSchema: z.ZodObject<{
43
+ 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"]>;
44
+ name: z.ZodString;
45
+ outcome: z.ZodOptional<z.ZodEnum<["success", "failure", "partial", "timeout", "cancelled"]>>;
46
+ duration_ms: z.ZodOptional<z.ZodNumber>;
47
+ }, "strict", z.ZodTypeAny, {
48
+ 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";
49
+ name: string;
50
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
51
+ duration_ms?: number | undefined;
52
+ }, {
53
+ 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";
54
+ name: string;
55
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
56
+ duration_ms?: number | undefined;
57
+ }>;
58
+ export type Action = z.infer<typeof ActionSchema>;
59
+ export declare const DataClassificationEnum: z.ZodEnum<["public", "internal", "confidential", "pii", "phi", "pci", "fci"]>;
60
+ export declare const SubjectSchema: z.ZodObject<{
61
+ resource_urn: z.ZodOptional<z.ZodString>;
62
+ data_classification: z.ZodOptional<z.ZodEnum<["public", "internal", "confidential", "pii", "phi", "pci", "fci"]>>;
63
+ regulatory_tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
64
+ }, "strict", z.ZodTypeAny, {
65
+ regulatory_tags?: string[] | undefined;
66
+ resource_urn?: string | undefined;
67
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
68
+ }, {
69
+ regulatory_tags?: string[] | undefined;
70
+ resource_urn?: string | undefined;
71
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
72
+ }>;
73
+ export type Subject = z.infer<typeof SubjectSchema>;
74
+ export declare const ModelProviderEnum: z.ZodEnum<["anthropic", "openai", "google", "aws_bedrock", "azure_openai", "ollama", "self_hosted", "other"]>;
75
+ export declare const ModelRefSchema: z.ZodObject<{
76
+ provider: z.ZodEnum<["anthropic", "openai", "google", "aws_bedrock", "azure_openai", "ollama", "self_hosted", "other"]>;
77
+ model_id: z.ZodString;
78
+ model_version_hash: z.ZodOptional<z.ZodString>;
79
+ system_prompt_hash: z.ZodOptional<z.ZodString>;
80
+ tools_hash: z.ZodOptional<z.ZodString>;
81
+ input_tokens: z.ZodOptional<z.ZodNumber>;
82
+ output_tokens: z.ZodOptional<z.ZodNumber>;
83
+ temperature: z.ZodOptional<z.ZodNumber>;
84
+ }, "strict", z.ZodTypeAny, {
85
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
86
+ model_id: string;
87
+ model_version_hash?: string | undefined;
88
+ system_prompt_hash?: string | undefined;
89
+ tools_hash?: string | undefined;
90
+ input_tokens?: number | undefined;
91
+ output_tokens?: number | undefined;
92
+ temperature?: number | undefined;
93
+ }, {
94
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
95
+ model_id: string;
96
+ model_version_hash?: string | undefined;
97
+ system_prompt_hash?: string | undefined;
98
+ tools_hash?: string | undefined;
99
+ input_tokens?: number | undefined;
100
+ output_tokens?: number | undefined;
101
+ temperature?: number | undefined;
102
+ }>;
103
+ export type ModelRef = z.infer<typeof ModelRefSchema>;
104
+ export declare const DecisionOutcomeEnum: z.ZodEnum<["approved", "denied", "escalated", "deferred", "no_action", "custom"]>;
105
+ export declare const DecisionSchema: z.ZodObject<{
106
+ outcome: z.ZodEnum<["approved", "denied", "escalated", "deferred", "no_action", "custom"]>;
107
+ outcome_label: z.ZodOptional<z.ZodString>;
108
+ confidence: z.ZodOptional<z.ZodNumber>;
109
+ human_in_the_loop: z.ZodOptional<z.ZodBoolean>;
110
+ policy_thresholds_crossed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
111
+ reversed_by_event: z.ZodOptional<z.ZodString>;
112
+ }, "strict", z.ZodTypeAny, {
113
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
114
+ outcome_label?: string | undefined;
115
+ confidence?: number | undefined;
116
+ human_in_the_loop?: boolean | undefined;
117
+ policy_thresholds_crossed?: string[] | undefined;
118
+ reversed_by_event?: string | undefined;
119
+ }, {
120
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
121
+ outcome_label?: string | undefined;
122
+ confidence?: number | undefined;
123
+ human_in_the_loop?: boolean | undefined;
124
+ policy_thresholds_crossed?: string[] | undefined;
125
+ reversed_by_event?: string | undefined;
126
+ }>;
127
+ export type Decision = z.infer<typeof DecisionSchema>;
128
+ export declare const ContentTypeEnum: 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"]>;
129
+ export declare const RedactionAppliedSchema: z.ZodObject<{
130
+ redacted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
131
+ tokenized_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
132
+ classifier_version: z.ZodOptional<z.ZodString>;
133
+ }, "strict", z.ZodTypeAny, {
134
+ redacted_classes?: string[] | undefined;
135
+ tokenized_classes?: string[] | undefined;
136
+ classifier_version?: string | undefined;
137
+ }, {
138
+ redacted_classes?: string[] | undefined;
139
+ tokenized_classes?: string[] | undefined;
140
+ classifier_version?: string | undefined;
141
+ }>;
142
+ export type RedactionApplied = z.infer<typeof RedactionAppliedSchema>;
143
+ export declare const PayloadEncryptionSchema: z.ZodObject<{
144
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
145
+ data_key_wrapped: z.ZodString;
146
+ kms_key_arn: z.ZodOptional<z.ZodString>;
147
+ }, "strict", z.ZodTypeAny, {
148
+ algorithm: "aes-256-gcm";
149
+ data_key_wrapped: string;
150
+ kms_key_arn?: string | undefined;
151
+ }, {
152
+ algorithm: "aes-256-gcm";
153
+ data_key_wrapped: string;
154
+ kms_key_arn?: string | undefined;
155
+ }>;
156
+ export type PayloadEncryption = z.infer<typeof PayloadEncryptionSchema>;
157
+ export declare const PayloadRefSchema: z.ZodObject<{
158
+ s3_uri: z.ZodString;
159
+ sha256: z.ZodString;
160
+ size_bytes: z.ZodNumber;
161
+ encryption: z.ZodObject<{
162
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
163
+ data_key_wrapped: z.ZodString;
164
+ kms_key_arn: z.ZodOptional<z.ZodString>;
165
+ }, "strict", z.ZodTypeAny, {
166
+ algorithm: "aes-256-gcm";
167
+ data_key_wrapped: string;
168
+ kms_key_arn?: string | undefined;
169
+ }, {
170
+ algorithm: "aes-256-gcm";
171
+ data_key_wrapped: string;
172
+ kms_key_arn?: string | undefined;
173
+ }>;
174
+ 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"]>>;
175
+ redaction_applied: z.ZodOptional<z.ZodObject<{
176
+ redacted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
177
+ tokenized_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
178
+ classifier_version: z.ZodOptional<z.ZodString>;
179
+ }, "strict", z.ZodTypeAny, {
180
+ redacted_classes?: string[] | undefined;
181
+ tokenized_classes?: string[] | undefined;
182
+ classifier_version?: string | undefined;
183
+ }, {
184
+ redacted_classes?: string[] | undefined;
185
+ tokenized_classes?: string[] | undefined;
186
+ classifier_version?: string | undefined;
187
+ }>>;
188
+ }, "strict", z.ZodTypeAny, {
189
+ sha256: string;
190
+ s3_uri: string;
191
+ size_bytes: number;
192
+ encryption: {
193
+ algorithm: "aes-256-gcm";
194
+ data_key_wrapped: string;
195
+ kms_key_arn?: string | undefined;
196
+ };
197
+ 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;
198
+ redaction_applied?: {
199
+ redacted_classes?: string[] | undefined;
200
+ tokenized_classes?: string[] | undefined;
201
+ classifier_version?: string | undefined;
202
+ } | undefined;
203
+ }, {
204
+ sha256: string;
205
+ s3_uri: string;
206
+ size_bytes: number;
207
+ encryption: {
208
+ algorithm: "aes-256-gcm";
209
+ data_key_wrapped: string;
210
+ kms_key_arn?: string | undefined;
211
+ };
212
+ 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;
213
+ redaction_applied?: {
214
+ redacted_classes?: string[] | undefined;
215
+ tokenized_classes?: string[] | undefined;
216
+ classifier_version?: string | undefined;
217
+ } | undefined;
218
+ }>;
219
+ export type PayloadRef = z.infer<typeof PayloadRefSchema>;
220
+ export declare const AnomalyCodeEnum: 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"]>;
221
+ export declare const AnomalySeverityEnum: z.ZodEnum<["info", "warning", "error", "critical"]>;
222
+ export declare const AnomalyFlagSchema: z.ZodObject<{
223
+ 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"]>;
224
+ severity: z.ZodEnum<["info", "warning", "error", "critical"]>;
225
+ detail: z.ZodOptional<z.ZodString>;
226
+ }, "strict", z.ZodTypeAny, {
227
+ 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";
228
+ severity: "info" | "warning" | "error" | "critical";
229
+ detail?: string | undefined;
230
+ }, {
231
+ 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";
232
+ severity: "info" | "warning" | "error" | "critical";
233
+ detail?: string | undefined;
234
+ }>;
235
+ export type AnomalyFlag = z.infer<typeof AnomalyFlagSchema>;
236
+ export declare const WallClockSourceEnum: z.ZodEnum<["aws_time_sync", "ntp", "host_system", "unknown"]>;
237
+ export declare const SdkNameEnum: z.ZodEnum<["runfile-py", "@runfile/sdk"]>;
238
+ export declare const SdkFrameworkEnum: z.ZodEnum<["langgraph", "langgraph_js", "openai_agents", "openai_agents_js", "anthropic_claude", "anthropic_claude_js", "mastra", "vercel_ai_sdk", "mcp_client", "otel_generic", "manual"]>;
239
+ export declare const SdkMetadataSchema: z.ZodObject<{
240
+ name: z.ZodEnum<["runfile-py", "@runfile/sdk"]>;
241
+ version: z.ZodString;
242
+ 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"]>;
243
+ framework_version: z.ZodOptional<z.ZodString>;
244
+ host: z.ZodOptional<z.ZodString>;
245
+ }, "strict", z.ZodTypeAny, {
246
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
247
+ name: "runfile-py" | "@runfile/sdk";
248
+ version: string;
249
+ framework_version?: string | undefined;
250
+ host?: string | undefined;
251
+ }, {
252
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
253
+ name: "runfile-py" | "@runfile/sdk";
254
+ version: string;
255
+ framework_version?: string | undefined;
256
+ host?: string | undefined;
257
+ }>;
258
+ export type SdkMetadata = z.infer<typeof SdkMetadataSchema>;
259
+ export declare const EnvironmentEnum: z.ZodEnum<["production", "staging", "development"]>;
260
+ export declare const LabelsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>;
261
+ export type Labels = z.infer<typeof LabelsSchema>;
262
+ export declare const MerkleInclusionSchema: z.ZodObject<{
263
+ manifest_uri: z.ZodString;
264
+ leaf_index: z.ZodNumber;
265
+ merkle_root: z.ZodString;
266
+ }, "strict", z.ZodTypeAny, {
267
+ manifest_uri: string;
268
+ leaf_index: number;
269
+ merkle_root: string;
270
+ }, {
271
+ manifest_uri: string;
272
+ leaf_index: number;
273
+ merkle_root: string;
274
+ }>;
275
+ export type MerkleInclusion = z.infer<typeof MerkleInclusionSchema>;
276
+ /**
277
+ * RunfileEvent — the canonical event shape every service in the system reads, writes, or
278
+ * reasons about. Hash-chained within `agent_run_id` and committed to a daily Merkle root.
279
+ *
280
+ * Conditional-required fields (enforced via superRefine below):
281
+ * - kind=llm_call → model_ref required
282
+ * - kind=decision → decision required
283
+ * - actor.type=agent → actor.agent_identity required (also enforced inside ActorSchema)
284
+ * - actor.type=tool → actor.tool_id + actor.tool_version_hash required (also enforced inside ActorSchema)
285
+ */
286
+ export declare const RunfileEventSchema: z.ZodEffects<z.ZodObject<{
287
+ schema_version: z.ZodString;
288
+ event_id: z.ZodString;
289
+ tenant_id: z.ZodString;
290
+ agent_run_id: z.ZodString;
291
+ parent_event_id: z.ZodNullable<z.ZodString>;
292
+ captured_at: z.ZodString;
293
+ received_at: z.ZodString;
294
+ wall_clock_source: z.ZodEnum<["aws_time_sync", "ntp", "host_system", "unknown"]>;
295
+ sdk: z.ZodObject<{
296
+ name: z.ZodEnum<["runfile-py", "@runfile/sdk"]>;
297
+ version: z.ZodString;
298
+ 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"]>;
299
+ framework_version: z.ZodOptional<z.ZodString>;
300
+ host: z.ZodOptional<z.ZodString>;
301
+ }, "strict", z.ZodTypeAny, {
302
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
303
+ name: "runfile-py" | "@runfile/sdk";
304
+ version: string;
305
+ framework_version?: string | undefined;
306
+ host?: string | undefined;
307
+ }, {
308
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
309
+ name: "runfile-py" | "@runfile/sdk";
310
+ version: string;
311
+ framework_version?: string | undefined;
312
+ host?: string | undefined;
313
+ }>;
314
+ actor: z.ZodEffects<z.ZodObject<{
315
+ type: z.ZodEnum<["agent", "human", "tool", "system"]>;
316
+ agent_identity: z.ZodOptional<z.ZodString>;
317
+ human_principal: z.ZodOptional<z.ZodString>;
318
+ delegation_chain: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
319
+ tool_id: z.ZodOptional<z.ZodString>;
320
+ tool_version_hash: z.ZodOptional<z.ZodString>;
321
+ }, "strict", z.ZodTypeAny, {
322
+ type: "agent" | "human" | "tool" | "system";
323
+ delegation_chain: string[];
324
+ agent_identity?: string | undefined;
325
+ human_principal?: string | undefined;
326
+ tool_id?: string | undefined;
327
+ tool_version_hash?: string | undefined;
328
+ }, {
329
+ type: "agent" | "human" | "tool" | "system";
330
+ agent_identity?: string | undefined;
331
+ human_principal?: string | undefined;
332
+ delegation_chain?: string[] | undefined;
333
+ tool_id?: string | undefined;
334
+ tool_version_hash?: string | undefined;
335
+ }>, {
336
+ type: "agent" | "human" | "tool" | "system";
337
+ delegation_chain: string[];
338
+ agent_identity?: string | undefined;
339
+ human_principal?: string | undefined;
340
+ tool_id?: string | undefined;
341
+ tool_version_hash?: string | undefined;
342
+ }, {
343
+ type: "agent" | "human" | "tool" | "system";
344
+ agent_identity?: string | undefined;
345
+ human_principal?: string | undefined;
346
+ delegation_chain?: string[] | undefined;
347
+ tool_id?: string | undefined;
348
+ tool_version_hash?: string | undefined;
349
+ }>;
350
+ action: z.ZodObject<{
351
+ 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"]>;
352
+ name: z.ZodString;
353
+ outcome: z.ZodOptional<z.ZodEnum<["success", "failure", "partial", "timeout", "cancelled"]>>;
354
+ duration_ms: z.ZodOptional<z.ZodNumber>;
355
+ }, "strict", z.ZodTypeAny, {
356
+ 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";
357
+ name: string;
358
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
359
+ duration_ms?: number | undefined;
360
+ }, {
361
+ 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";
362
+ name: string;
363
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
364
+ duration_ms?: number | undefined;
365
+ }>;
366
+ subject: z.ZodObject<{
367
+ resource_urn: z.ZodOptional<z.ZodString>;
368
+ data_classification: z.ZodOptional<z.ZodEnum<["public", "internal", "confidential", "pii", "phi", "pci", "fci"]>>;
369
+ regulatory_tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
370
+ }, "strict", z.ZodTypeAny, {
371
+ regulatory_tags?: string[] | undefined;
372
+ resource_urn?: string | undefined;
373
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
374
+ }, {
375
+ regulatory_tags?: string[] | undefined;
376
+ resource_urn?: string | undefined;
377
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
378
+ }>;
379
+ model_ref: z.ZodOptional<z.ZodObject<{
380
+ provider: z.ZodEnum<["anthropic", "openai", "google", "aws_bedrock", "azure_openai", "ollama", "self_hosted", "other"]>;
381
+ model_id: z.ZodString;
382
+ model_version_hash: z.ZodOptional<z.ZodString>;
383
+ system_prompt_hash: z.ZodOptional<z.ZodString>;
384
+ tools_hash: z.ZodOptional<z.ZodString>;
385
+ input_tokens: z.ZodOptional<z.ZodNumber>;
386
+ output_tokens: z.ZodOptional<z.ZodNumber>;
387
+ temperature: z.ZodOptional<z.ZodNumber>;
388
+ }, "strict", z.ZodTypeAny, {
389
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
390
+ model_id: string;
391
+ model_version_hash?: string | undefined;
392
+ system_prompt_hash?: string | undefined;
393
+ tools_hash?: string | undefined;
394
+ input_tokens?: number | undefined;
395
+ output_tokens?: number | undefined;
396
+ temperature?: number | undefined;
397
+ }, {
398
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
399
+ model_id: string;
400
+ model_version_hash?: string | undefined;
401
+ system_prompt_hash?: string | undefined;
402
+ tools_hash?: string | undefined;
403
+ input_tokens?: number | undefined;
404
+ output_tokens?: number | undefined;
405
+ temperature?: number | undefined;
406
+ }>>;
407
+ decision: z.ZodOptional<z.ZodObject<{
408
+ outcome: z.ZodEnum<["approved", "denied", "escalated", "deferred", "no_action", "custom"]>;
409
+ outcome_label: z.ZodOptional<z.ZodString>;
410
+ confidence: z.ZodOptional<z.ZodNumber>;
411
+ human_in_the_loop: z.ZodOptional<z.ZodBoolean>;
412
+ policy_thresholds_crossed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
413
+ reversed_by_event: z.ZodOptional<z.ZodString>;
414
+ }, "strict", z.ZodTypeAny, {
415
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
416
+ outcome_label?: string | undefined;
417
+ confidence?: number | undefined;
418
+ human_in_the_loop?: boolean | undefined;
419
+ policy_thresholds_crossed?: string[] | undefined;
420
+ reversed_by_event?: string | undefined;
421
+ }, {
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
+ }>>;
429
+ payload_ref: z.ZodOptional<z.ZodObject<{
430
+ s3_uri: z.ZodString;
431
+ sha256: z.ZodString;
432
+ size_bytes: z.ZodNumber;
433
+ encryption: z.ZodObject<{
434
+ algorithm: z.ZodLiteral<"aes-256-gcm">;
435
+ data_key_wrapped: z.ZodString;
436
+ kms_key_arn: z.ZodOptional<z.ZodString>;
437
+ }, "strict", z.ZodTypeAny, {
438
+ algorithm: "aes-256-gcm";
439
+ data_key_wrapped: string;
440
+ kms_key_arn?: string | undefined;
441
+ }, {
442
+ algorithm: "aes-256-gcm";
443
+ data_key_wrapped: string;
444
+ kms_key_arn?: string | undefined;
445
+ }>;
446
+ 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"]>>;
447
+ redaction_applied: z.ZodOptional<z.ZodObject<{
448
+ redacted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
449
+ tokenized_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
450
+ classifier_version: z.ZodOptional<z.ZodString>;
451
+ }, "strict", z.ZodTypeAny, {
452
+ redacted_classes?: string[] | undefined;
453
+ tokenized_classes?: string[] | undefined;
454
+ classifier_version?: string | undefined;
455
+ }, {
456
+ redacted_classes?: string[] | undefined;
457
+ tokenized_classes?: string[] | undefined;
458
+ classifier_version?: string | undefined;
459
+ }>>;
460
+ }, "strict", z.ZodTypeAny, {
461
+ sha256: string;
462
+ s3_uri: string;
463
+ size_bytes: number;
464
+ encryption: {
465
+ algorithm: "aes-256-gcm";
466
+ data_key_wrapped: string;
467
+ kms_key_arn?: string | undefined;
468
+ };
469
+ 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;
470
+ redaction_applied?: {
471
+ redacted_classes?: string[] | undefined;
472
+ tokenized_classes?: string[] | undefined;
473
+ classifier_version?: string | undefined;
474
+ } | undefined;
475
+ }, {
476
+ sha256: string;
477
+ s3_uri: string;
478
+ size_bytes: number;
479
+ encryption: {
480
+ algorithm: "aes-256-gcm";
481
+ data_key_wrapped: string;
482
+ kms_key_arn?: string | undefined;
483
+ };
484
+ 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;
485
+ redaction_applied?: {
486
+ redacted_classes?: string[] | undefined;
487
+ tokenized_classes?: string[] | undefined;
488
+ classifier_version?: string | undefined;
489
+ } | undefined;
490
+ }>>;
491
+ redaction_policy_version: z.ZodString;
492
+ regulatory_scope_version: z.ZodOptional<z.ZodString>;
493
+ anomaly_flags: z.ZodOptional<z.ZodArray<z.ZodObject<{
494
+ 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"]>;
495
+ severity: z.ZodEnum<["info", "warning", "error", "critical"]>;
496
+ detail: z.ZodOptional<z.ZodString>;
497
+ }, "strict", z.ZodTypeAny, {
498
+ 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";
499
+ severity: "info" | "warning" | "error" | "critical";
500
+ detail?: string | undefined;
501
+ }, {
502
+ 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";
503
+ severity: "info" | "warning" | "error" | "critical";
504
+ detail?: string | undefined;
505
+ }>, "many">>;
506
+ environment: z.ZodOptional<z.ZodEnum<["production", "staging", "development"]>>;
507
+ labels: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
508
+ prev_hash: z.ZodString;
509
+ event_hash: z.ZodString;
510
+ merkle_inclusion: z.ZodOptional<z.ZodObject<{
511
+ manifest_uri: z.ZodString;
512
+ leaf_index: z.ZodNumber;
513
+ merkle_root: z.ZodString;
514
+ }, "strict", z.ZodTypeAny, {
515
+ manifest_uri: string;
516
+ leaf_index: number;
517
+ merkle_root: string;
518
+ }, {
519
+ manifest_uri: string;
520
+ leaf_index: number;
521
+ merkle_root: string;
522
+ }>>;
523
+ }, "strict", z.ZodTypeAny, {
524
+ event_hash: string;
525
+ schema_version: string;
526
+ event_id: string;
527
+ tenant_id: string;
528
+ agent_run_id: string;
529
+ parent_event_id: string | null;
530
+ captured_at: string;
531
+ received_at: string;
532
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
533
+ sdk: {
534
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
535
+ name: "runfile-py" | "@runfile/sdk";
536
+ version: string;
537
+ framework_version?: string | undefined;
538
+ host?: string | undefined;
539
+ };
540
+ actor: {
541
+ type: "agent" | "human" | "tool" | "system";
542
+ delegation_chain: string[];
543
+ agent_identity?: string | undefined;
544
+ human_principal?: string | undefined;
545
+ tool_id?: string | undefined;
546
+ tool_version_hash?: string | undefined;
547
+ };
548
+ action: {
549
+ 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";
550
+ name: string;
551
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
552
+ duration_ms?: number | undefined;
553
+ };
554
+ subject: {
555
+ regulatory_tags?: string[] | undefined;
556
+ resource_urn?: string | undefined;
557
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
558
+ };
559
+ redaction_policy_version: string;
560
+ prev_hash: string;
561
+ decision?: {
562
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
563
+ outcome_label?: string | undefined;
564
+ confidence?: number | undefined;
565
+ human_in_the_loop?: boolean | undefined;
566
+ policy_thresholds_crossed?: string[] | undefined;
567
+ reversed_by_event?: string | undefined;
568
+ } | undefined;
569
+ model_ref?: {
570
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
571
+ model_id: string;
572
+ model_version_hash?: string | undefined;
573
+ system_prompt_hash?: string | undefined;
574
+ tools_hash?: string | undefined;
575
+ input_tokens?: number | undefined;
576
+ output_tokens?: number | undefined;
577
+ temperature?: number | undefined;
578
+ } | undefined;
579
+ payload_ref?: {
580
+ sha256: string;
581
+ s3_uri: string;
582
+ size_bytes: number;
583
+ encryption: {
584
+ algorithm: "aes-256-gcm";
585
+ data_key_wrapped: string;
586
+ kms_key_arn?: string | undefined;
587
+ };
588
+ 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;
589
+ redaction_applied?: {
590
+ redacted_classes?: string[] | undefined;
591
+ tokenized_classes?: string[] | undefined;
592
+ classifier_version?: string | undefined;
593
+ } | undefined;
594
+ } | undefined;
595
+ regulatory_scope_version?: string | undefined;
596
+ anomaly_flags?: {
597
+ 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";
598
+ severity: "info" | "warning" | "error" | "critical";
599
+ detail?: string | undefined;
600
+ }[] | undefined;
601
+ environment?: "production" | "staging" | "development" | undefined;
602
+ labels?: Record<string, string> | undefined;
603
+ merkle_inclusion?: {
604
+ manifest_uri: string;
605
+ leaf_index: number;
606
+ merkle_root: string;
607
+ } | undefined;
608
+ }, {
609
+ event_hash: string;
610
+ schema_version: string;
611
+ event_id: string;
612
+ tenant_id: string;
613
+ agent_run_id: string;
614
+ parent_event_id: string | null;
615
+ captured_at: string;
616
+ received_at: string;
617
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
618
+ sdk: {
619
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
620
+ name: "runfile-py" | "@runfile/sdk";
621
+ version: string;
622
+ framework_version?: string | undefined;
623
+ host?: string | undefined;
624
+ };
625
+ actor: {
626
+ type: "agent" | "human" | "tool" | "system";
627
+ agent_identity?: string | undefined;
628
+ human_principal?: string | undefined;
629
+ delegation_chain?: string[] | undefined;
630
+ tool_id?: string | undefined;
631
+ tool_version_hash?: string | undefined;
632
+ };
633
+ action: {
634
+ 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";
635
+ name: string;
636
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
637
+ duration_ms?: number | undefined;
638
+ };
639
+ subject: {
640
+ regulatory_tags?: string[] | undefined;
641
+ resource_urn?: string | undefined;
642
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
643
+ };
644
+ redaction_policy_version: string;
645
+ prev_hash: string;
646
+ decision?: {
647
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
648
+ outcome_label?: string | undefined;
649
+ confidence?: number | undefined;
650
+ human_in_the_loop?: boolean | undefined;
651
+ policy_thresholds_crossed?: string[] | undefined;
652
+ reversed_by_event?: string | undefined;
653
+ } | undefined;
654
+ model_ref?: {
655
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
656
+ model_id: string;
657
+ model_version_hash?: string | undefined;
658
+ system_prompt_hash?: string | undefined;
659
+ tools_hash?: string | undefined;
660
+ input_tokens?: number | undefined;
661
+ output_tokens?: number | undefined;
662
+ temperature?: number | undefined;
663
+ } | undefined;
664
+ payload_ref?: {
665
+ sha256: string;
666
+ s3_uri: string;
667
+ size_bytes: number;
668
+ encryption: {
669
+ algorithm: "aes-256-gcm";
670
+ data_key_wrapped: string;
671
+ kms_key_arn?: string | undefined;
672
+ };
673
+ 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;
674
+ redaction_applied?: {
675
+ redacted_classes?: string[] | undefined;
676
+ tokenized_classes?: string[] | undefined;
677
+ classifier_version?: string | undefined;
678
+ } | undefined;
679
+ } | undefined;
680
+ regulatory_scope_version?: string | undefined;
681
+ anomaly_flags?: {
682
+ 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";
683
+ severity: "info" | "warning" | "error" | "critical";
684
+ detail?: string | undefined;
685
+ }[] | undefined;
686
+ environment?: "production" | "staging" | "development" | undefined;
687
+ labels?: Record<string, string> | undefined;
688
+ merkle_inclusion?: {
689
+ manifest_uri: string;
690
+ leaf_index: number;
691
+ merkle_root: string;
692
+ } | undefined;
693
+ }>, {
694
+ event_hash: string;
695
+ schema_version: string;
696
+ event_id: string;
697
+ tenant_id: string;
698
+ agent_run_id: string;
699
+ parent_event_id: string | null;
700
+ captured_at: string;
701
+ received_at: string;
702
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
703
+ sdk: {
704
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
705
+ name: "runfile-py" | "@runfile/sdk";
706
+ version: string;
707
+ framework_version?: string | undefined;
708
+ host?: string | undefined;
709
+ };
710
+ actor: {
711
+ type: "agent" | "human" | "tool" | "system";
712
+ delegation_chain: string[];
713
+ agent_identity?: string | undefined;
714
+ human_principal?: string | undefined;
715
+ tool_id?: string | undefined;
716
+ tool_version_hash?: string | undefined;
717
+ };
718
+ action: {
719
+ 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";
720
+ name: string;
721
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
722
+ duration_ms?: number | undefined;
723
+ };
724
+ subject: {
725
+ regulatory_tags?: string[] | undefined;
726
+ resource_urn?: string | undefined;
727
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
728
+ };
729
+ redaction_policy_version: string;
730
+ prev_hash: string;
731
+ decision?: {
732
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
733
+ outcome_label?: string | undefined;
734
+ confidence?: number | undefined;
735
+ human_in_the_loop?: boolean | undefined;
736
+ policy_thresholds_crossed?: string[] | undefined;
737
+ reversed_by_event?: string | undefined;
738
+ } | undefined;
739
+ model_ref?: {
740
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
741
+ model_id: string;
742
+ model_version_hash?: string | undefined;
743
+ system_prompt_hash?: string | undefined;
744
+ tools_hash?: string | undefined;
745
+ input_tokens?: number | undefined;
746
+ output_tokens?: number | undefined;
747
+ temperature?: number | undefined;
748
+ } | undefined;
749
+ payload_ref?: {
750
+ sha256: string;
751
+ s3_uri: string;
752
+ size_bytes: number;
753
+ encryption: {
754
+ algorithm: "aes-256-gcm";
755
+ data_key_wrapped: string;
756
+ kms_key_arn?: string | undefined;
757
+ };
758
+ 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;
759
+ redaction_applied?: {
760
+ redacted_classes?: string[] | undefined;
761
+ tokenized_classes?: string[] | undefined;
762
+ classifier_version?: string | undefined;
763
+ } | undefined;
764
+ } | undefined;
765
+ regulatory_scope_version?: string | undefined;
766
+ anomaly_flags?: {
767
+ 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";
768
+ severity: "info" | "warning" | "error" | "critical";
769
+ detail?: string | undefined;
770
+ }[] | undefined;
771
+ environment?: "production" | "staging" | "development" | undefined;
772
+ labels?: Record<string, string> | undefined;
773
+ merkle_inclusion?: {
774
+ manifest_uri: string;
775
+ leaf_index: number;
776
+ merkle_root: string;
777
+ } | undefined;
778
+ }, {
779
+ event_hash: string;
780
+ schema_version: string;
781
+ event_id: string;
782
+ tenant_id: string;
783
+ agent_run_id: string;
784
+ parent_event_id: string | null;
785
+ captured_at: string;
786
+ received_at: string;
787
+ wall_clock_source: "unknown" | "aws_time_sync" | "ntp" | "host_system";
788
+ sdk: {
789
+ framework: "langgraph" | "langgraph_js" | "openai_agents" | "openai_agents_js" | "anthropic_claude" | "anthropic_claude_js" | "mastra" | "vercel_ai_sdk" | "mcp_client" | "otel_generic" | "manual";
790
+ name: "runfile-py" | "@runfile/sdk";
791
+ version: string;
792
+ framework_version?: string | undefined;
793
+ host?: string | undefined;
794
+ };
795
+ actor: {
796
+ type: "agent" | "human" | "tool" | "system";
797
+ agent_identity?: string | undefined;
798
+ human_principal?: string | undefined;
799
+ delegation_chain?: string[] | undefined;
800
+ tool_id?: string | undefined;
801
+ tool_version_hash?: string | undefined;
802
+ };
803
+ action: {
804
+ 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";
805
+ name: string;
806
+ outcome?: "success" | "failure" | "partial" | "timeout" | "cancelled" | undefined;
807
+ duration_ms?: number | undefined;
808
+ };
809
+ subject: {
810
+ regulatory_tags?: string[] | undefined;
811
+ resource_urn?: string | undefined;
812
+ data_classification?: "public" | "internal" | "confidential" | "pii" | "phi" | "pci" | "fci" | undefined;
813
+ };
814
+ redaction_policy_version: string;
815
+ prev_hash: string;
816
+ decision?: {
817
+ outcome: "custom" | "approved" | "denied" | "escalated" | "deferred" | "no_action";
818
+ outcome_label?: string | undefined;
819
+ confidence?: number | undefined;
820
+ human_in_the_loop?: boolean | undefined;
821
+ policy_thresholds_crossed?: string[] | undefined;
822
+ reversed_by_event?: string | undefined;
823
+ } | undefined;
824
+ model_ref?: {
825
+ provider: "anthropic" | "openai" | "google" | "aws_bedrock" | "azure_openai" | "ollama" | "self_hosted" | "other";
826
+ model_id: string;
827
+ model_version_hash?: string | undefined;
828
+ system_prompt_hash?: string | undefined;
829
+ tools_hash?: string | undefined;
830
+ input_tokens?: number | undefined;
831
+ output_tokens?: number | undefined;
832
+ temperature?: number | undefined;
833
+ } | undefined;
834
+ payload_ref?: {
835
+ sha256: string;
836
+ s3_uri: string;
837
+ size_bytes: number;
838
+ encryption: {
839
+ algorithm: "aes-256-gcm";
840
+ data_key_wrapped: string;
841
+ kms_key_arn?: string | undefined;
842
+ };
843
+ 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;
844
+ redaction_applied?: {
845
+ redacted_classes?: string[] | undefined;
846
+ tokenized_classes?: string[] | undefined;
847
+ classifier_version?: string | undefined;
848
+ } | undefined;
849
+ } | undefined;
850
+ regulatory_scope_version?: string | undefined;
851
+ anomaly_flags?: {
852
+ 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";
853
+ severity: "info" | "warning" | "error" | "critical";
854
+ detail?: string | undefined;
855
+ }[] | undefined;
856
+ environment?: "production" | "staging" | "development" | undefined;
857
+ labels?: Record<string, string> | undefined;
858
+ merkle_inclusion?: {
859
+ manifest_uri: string;
860
+ leaf_index: number;
861
+ merkle_root: string;
862
+ } | undefined;
863
+ }>;
864
+ export type RunfileEvent = z.infer<typeof RunfileEventSchema>;
865
+ export declare const ZERO_PREV_HASH: `sha256:${string}`;
866
+ //# sourceMappingURL=event.d.ts.map