@assemble-dev/shared-types 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.
package/dist/errors.js ADDED
@@ -0,0 +1,6 @@
1
+ import {
2
+ AppErrorCode
3
+ } from "./chunk-L43XAKHI.js";
4
+ export {
5
+ AppErrorCode
6
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1,467 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ AgentCallSchema: () => AgentCallSchema,
24
+ AgentCallStatusSchema: () => AgentCallStatusSchema,
25
+ AgentCompletedEventSchema: () => AgentCompletedEventSchema,
26
+ AgentFailedEventSchema: () => AgentFailedEventSchema,
27
+ AgentStartedEventSchema: () => AgentStartedEventSchema,
28
+ ApiKeyEnvironmentSchema: () => ApiKeyEnvironmentSchema,
29
+ AppErrorCode: () => AppErrorCode,
30
+ ApprovalApprovedEventSchema: () => ApprovalApprovedEventSchema,
31
+ ApprovalRejectedEventSchema: () => ApprovalRejectedEventSchema,
32
+ ApprovalRequiredEventSchema: () => ApprovalRequiredEventSchema,
33
+ ApprovalStatusSchema: () => ApprovalStatusSchema,
34
+ EvalCompletedEventSchema: () => EvalCompletedEventSchema,
35
+ EvalStartedEventSchema: () => EvalStartedEventSchema,
36
+ JsonObjectSchema: () => JsonObjectSchema,
37
+ JsonPrimitiveSchema: () => JsonPrimitiveSchema,
38
+ JsonValueSchema: () => JsonValueSchema,
39
+ PolicyActionSchema: () => PolicyActionSchema,
40
+ PolicyDecisionSchema: () => PolicyDecisionSchema,
41
+ PolicyEvaluatedEventSchema: () => PolicyEvaluatedEventSchema,
42
+ ReplayCompletedEventSchema: () => ReplayCompletedEventSchema,
43
+ ReplayStartedEventSchema: () => ReplayStartedEventSchema,
44
+ RouteSelectedEventSchema: () => RouteSelectedEventSchema,
45
+ RoutingDecisionSchema: () => RoutingDecisionSchema,
46
+ RunApprovalSchema: () => RunApprovalSchema,
47
+ RunArtifactSchema: () => RunArtifactSchema,
48
+ RunCompletedEventSchema: () => RunCompletedEventSchema,
49
+ RunErrorSchema: () => RunErrorSchema,
50
+ RunFailedEventSchema: () => RunFailedEventSchema,
51
+ RunMessageRoleSchema: () => RunMessageRoleSchema,
52
+ RunMessageSchema: () => RunMessageSchema,
53
+ RunMetadataSchema: () => RunMetadataSchema,
54
+ RunMetricsSchema: () => RunMetricsSchema,
55
+ RunStartedEventSchema: () => RunStartedEventSchema,
56
+ RunStateSchema: () => RunStateSchema,
57
+ RunStatusSchema: () => RunStatusSchema,
58
+ TokenUsageSchema: () => TokenUsageSchema,
59
+ ToolApprovedEventSchema: () => ToolApprovedEventSchema,
60
+ ToolBlockedEventSchema: () => ToolBlockedEventSchema,
61
+ ToolCallSchema: () => ToolCallSchema,
62
+ ToolCallStatusSchema: () => ToolCallStatusSchema,
63
+ ToolCompletedEventSchema: () => ToolCompletedEventSchema,
64
+ ToolFailedEventSchema: () => ToolFailedEventSchema,
65
+ ToolRequestedEventSchema: () => ToolRequestedEventSchema,
66
+ TraceEventErrorSchema: () => TraceEventErrorSchema,
67
+ TraceEventSchema: () => TraceEventSchema,
68
+ traceEventTypes: () => traceEventTypes
69
+ });
70
+ module.exports = __toCommonJS(index_exports);
71
+
72
+ // src/api-keys.ts
73
+ var import_zod = require("zod");
74
+ var ApiKeyEnvironmentSchema = import_zod.z.enum(["dev", "prod", "ci"]);
75
+
76
+ // src/errors.ts
77
+ var AppErrorCode = /* @__PURE__ */ ((AppErrorCode2) => {
78
+ AppErrorCode2["BadRequest"] = "BAD_REQUEST";
79
+ AppErrorCode2["Unauthorized"] = "UNAUTHORIZED";
80
+ AppErrorCode2["Forbidden"] = "FORBIDDEN";
81
+ AppErrorCode2["NotFound"] = "NOT_FOUND";
82
+ AppErrorCode2["Conflict"] = "CONFLICT";
83
+ AppErrorCode2["Canceled"] = "CANCELED";
84
+ AppErrorCode2["RateLimited"] = "RATE_LIMITED";
85
+ AppErrorCode2["CostBudgetExceeded"] = "COST_BUDGET_EXCEEDED";
86
+ AppErrorCode2["ValidationFailed"] = "VALIDATION_FAILED";
87
+ AppErrorCode2["UserAlreadyExists"] = "USER_ALREADY_EXISTS";
88
+ AppErrorCode2["WorkspaceNotFound"] = "WORKSPACE_NOT_FOUND";
89
+ AppErrorCode2["InternalServerError"] = "INTERNAL_SERVER_ERROR";
90
+ AppErrorCode2["ServiceUnavailable"] = "SERVICE_UNAVAILABLE";
91
+ return AppErrorCode2;
92
+ })(AppErrorCode || {});
93
+
94
+ // src/json.ts
95
+ var import_zod2 = require("zod");
96
+ var JsonPrimitiveSchema = import_zod2.z.union([
97
+ import_zod2.z.string(),
98
+ import_zod2.z.number(),
99
+ import_zod2.z.boolean(),
100
+ import_zod2.z.null()
101
+ ]);
102
+ var JsonValueSchema = import_zod2.z.lazy(
103
+ () => import_zod2.z.union([
104
+ JsonPrimitiveSchema,
105
+ import_zod2.z.array(JsonValueSchema),
106
+ import_zod2.z.record(import_zod2.z.string(), JsonValueSchema)
107
+ ])
108
+ );
109
+ var JsonObjectSchema = import_zod2.z.record(import_zod2.z.string(), JsonValueSchema);
110
+
111
+ // src/run-metadata.ts
112
+ var import_zod3 = require("zod");
113
+ var RunMetadataSchema = import_zod3.z.object({
114
+ sessionId: import_zod3.z.string().optional(),
115
+ userId: import_zod3.z.string().optional(),
116
+ tags: import_zod3.z.array(import_zod3.z.string()).optional(),
117
+ parentTraceId: import_zod3.z.string().optional(),
118
+ parentSpanId: import_zod3.z.string().optional()
119
+ });
120
+
121
+ // src/runs.ts
122
+ var import_zod4 = require("zod");
123
+ var RunStatusSchema = import_zod4.z.enum([
124
+ "pending",
125
+ "running",
126
+ "awaiting_approval",
127
+ "completed",
128
+ "failed",
129
+ "canceled",
130
+ "rejected"
131
+ ]);
132
+ var PolicyActionSchema = import_zod4.z.enum([
133
+ "allow",
134
+ "block",
135
+ "requireApproval",
136
+ "logOnly",
137
+ "redact"
138
+ ]);
139
+ var ApprovalStatusSchema = import_zod4.z.enum(["pending", "approved", "rejected"]);
140
+ var RunErrorSchema = import_zod4.z.object({
141
+ message: import_zod4.z.string(),
142
+ code: import_zod4.z.string().optional(),
143
+ agentName: import_zod4.z.string().optional(),
144
+ toolName: import_zod4.z.string().optional(),
145
+ timestamp: import_zod4.z.iso.datetime()
146
+ });
147
+ var RunMessageRoleSchema = import_zod4.z.enum([
148
+ "system",
149
+ "user",
150
+ "assistant",
151
+ "tool"
152
+ ]);
153
+ var RunMessageSchema = import_zod4.z.object({
154
+ role: RunMessageRoleSchema,
155
+ content: import_zod4.z.string(),
156
+ agentName: import_zod4.z.string().optional(),
157
+ toolName: import_zod4.z.string().optional(),
158
+ timestamp: import_zod4.z.iso.datetime()
159
+ });
160
+ var AgentCallStatusSchema = import_zod4.z.enum(["running", "completed", "failed"]);
161
+ var AgentCallSchema = import_zod4.z.object({
162
+ id: import_zod4.z.string(),
163
+ agentName: import_zod4.z.string(),
164
+ status: AgentCallStatusSchema,
165
+ input: JsonValueSchema,
166
+ output: JsonValueSchema.nullable(),
167
+ error: RunErrorSchema.nullable(),
168
+ startedAt: import_zod4.z.iso.datetime(),
169
+ completedAt: import_zod4.z.iso.datetime().nullable(),
170
+ latencyMs: import_zod4.z.number().nonnegative().nullable()
171
+ });
172
+ var ToolCallStatusSchema = import_zod4.z.enum([
173
+ "requested",
174
+ "approved",
175
+ "blocked",
176
+ "completed",
177
+ "failed"
178
+ ]);
179
+ var ToolCallSchema = import_zod4.z.object({
180
+ id: import_zod4.z.string(),
181
+ toolName: import_zod4.z.string(),
182
+ agentName: import_zod4.z.string(),
183
+ status: ToolCallStatusSchema,
184
+ input: JsonValueSchema,
185
+ output: JsonValueSchema.nullable(),
186
+ error: RunErrorSchema.nullable(),
187
+ requestedAt: import_zod4.z.iso.datetime(),
188
+ completedAt: import_zod4.z.iso.datetime().nullable(),
189
+ latencyMs: import_zod4.z.number().nonnegative().nullable()
190
+ });
191
+ var PolicyDecisionSchema = import_zod4.z.object({
192
+ policyName: import_zod4.z.string(),
193
+ action: PolicyActionSchema,
194
+ agentName: import_zod4.z.string().optional(),
195
+ toolName: import_zod4.z.string().optional(),
196
+ reason: import_zod4.z.string(),
197
+ timestamp: import_zod4.z.iso.datetime()
198
+ });
199
+ var RoutingDecisionSchema = import_zod4.z.object({
200
+ supervisorName: import_zod4.z.string(),
201
+ selectedAgentName: import_zod4.z.string(),
202
+ candidateAgentNames: import_zod4.z.array(import_zod4.z.string()),
203
+ reason: import_zod4.z.string(),
204
+ timestamp: import_zod4.z.iso.datetime()
205
+ });
206
+ var RunApprovalSchema = import_zod4.z.object({
207
+ id: import_zod4.z.string(),
208
+ status: ApprovalStatusSchema,
209
+ toolCallId: import_zod4.z.string().nullable(),
210
+ toolName: import_zod4.z.string().optional(),
211
+ agentName: import_zod4.z.string().optional(),
212
+ reason: import_zod4.z.string(),
213
+ requestedAt: import_zod4.z.iso.datetime(),
214
+ decidedAt: import_zod4.z.iso.datetime().nullable(),
215
+ decidedBy: import_zod4.z.string().nullable()
216
+ });
217
+ var RunArtifactSchema = import_zod4.z.object({
218
+ key: import_zod4.z.string(),
219
+ value: JsonValueSchema,
220
+ producedByAgentName: import_zod4.z.string().optional(),
221
+ createdAt: import_zod4.z.iso.datetime()
222
+ });
223
+ var TokenUsageSchema = import_zod4.z.object({
224
+ inputTokens: import_zod4.z.number().int().nonnegative(),
225
+ outputTokens: import_zod4.z.number().int().nonnegative(),
226
+ totalTokens: import_zod4.z.number().int().nonnegative(),
227
+ cacheCreationInputTokens: import_zod4.z.number().int().nonnegative().optional(),
228
+ cacheReadInputTokens: import_zod4.z.number().int().nonnegative().optional()
229
+ });
230
+ var RunMetricsSchema = import_zod4.z.object({
231
+ totalLatencyMs: import_zod4.z.number().nonnegative().nullable(),
232
+ tokenUsage: TokenUsageSchema.nullable(),
233
+ agentCallCount: import_zod4.z.number().int().nonnegative(),
234
+ toolCallCount: import_zod4.z.number().int().nonnegative(),
235
+ policyDecisionCount: import_zod4.z.number().int().nonnegative(),
236
+ approvalCount: import_zod4.z.number().int().nonnegative()
237
+ });
238
+ var RunStateSchema = import_zod4.z.object({
239
+ runId: import_zod4.z.string(),
240
+ workflowName: import_zod4.z.string(),
241
+ status: RunStatusSchema,
242
+ input: JsonValueSchema,
243
+ messages: import_zod4.z.array(RunMessageSchema),
244
+ agentCalls: import_zod4.z.array(AgentCallSchema),
245
+ toolCalls: import_zod4.z.array(ToolCallSchema),
246
+ policyDecisions: import_zod4.z.array(PolicyDecisionSchema),
247
+ routingDecisions: import_zod4.z.array(RoutingDecisionSchema),
248
+ approvals: import_zod4.z.array(RunApprovalSchema),
249
+ artifacts: import_zod4.z.array(RunArtifactSchema),
250
+ errors: import_zod4.z.array(RunErrorSchema),
251
+ metrics: RunMetricsSchema,
252
+ finalOutput: JsonValueSchema.nullable(),
253
+ createdAt: import_zod4.z.iso.datetime(),
254
+ startedAt: import_zod4.z.iso.datetime().nullable(),
255
+ completedAt: import_zod4.z.iso.datetime().nullable()
256
+ });
257
+
258
+ // src/trace-events.ts
259
+ var import_zod5 = require("zod");
260
+ var TraceEventErrorSchema = import_zod5.z.object({
261
+ message: import_zod5.z.string(),
262
+ code: import_zod5.z.string().optional(),
263
+ stack: import_zod5.z.string().optional()
264
+ });
265
+ var TraceEventBaseSchema = import_zod5.z.object({
266
+ id: import_zod5.z.string(),
267
+ runId: import_zod5.z.string(),
268
+ workflowName: import_zod5.z.string(),
269
+ timestamp: import_zod5.z.iso.datetime(),
270
+ parentEventId: import_zod5.z.string().nullable(),
271
+ redacted: import_zod5.z.boolean(),
272
+ metadata: RunMetadataSchema.optional()
273
+ });
274
+ var RunStartedEventSchema = TraceEventBaseSchema.extend({
275
+ type: import_zod5.z.literal("run.started"),
276
+ input: JsonValueSchema
277
+ });
278
+ var RunCompletedEventSchema = TraceEventBaseSchema.extend({
279
+ type: import_zod5.z.literal("run.completed"),
280
+ output: JsonValueSchema,
281
+ latencyMs: import_zod5.z.number().nonnegative()
282
+ });
283
+ var RunFailedEventSchema = TraceEventBaseSchema.extend({
284
+ type: import_zod5.z.literal("run.failed"),
285
+ error: TraceEventErrorSchema,
286
+ latencyMs: import_zod5.z.number().nonnegative()
287
+ });
288
+ var AgentStartedEventSchema = TraceEventBaseSchema.extend({
289
+ type: import_zod5.z.literal("agent.started"),
290
+ agentName: import_zod5.z.string(),
291
+ input: JsonValueSchema
292
+ });
293
+ var AgentCompletedEventSchema = TraceEventBaseSchema.extend({
294
+ type: import_zod5.z.literal("agent.completed"),
295
+ agentName: import_zod5.z.string(),
296
+ output: JsonValueSchema,
297
+ latencyMs: import_zod5.z.number().nonnegative()
298
+ });
299
+ var AgentFailedEventSchema = TraceEventBaseSchema.extend({
300
+ type: import_zod5.z.literal("agent.failed"),
301
+ agentName: import_zod5.z.string(),
302
+ error: TraceEventErrorSchema,
303
+ latencyMs: import_zod5.z.number().nonnegative()
304
+ });
305
+ var ToolRequestedEventSchema = TraceEventBaseSchema.extend({
306
+ type: import_zod5.z.literal("tool.requested"),
307
+ toolName: import_zod5.z.string(),
308
+ agentName: import_zod5.z.string(),
309
+ input: JsonValueSchema
310
+ });
311
+ var ToolApprovedEventSchema = TraceEventBaseSchema.extend({
312
+ type: import_zod5.z.literal("tool.approved"),
313
+ toolName: import_zod5.z.string(),
314
+ agentName: import_zod5.z.string(),
315
+ approvalId: import_zod5.z.string().nullable()
316
+ });
317
+ var ToolBlockedEventSchema = TraceEventBaseSchema.extend({
318
+ type: import_zod5.z.literal("tool.blocked"),
319
+ toolName: import_zod5.z.string(),
320
+ agentName: import_zod5.z.string(),
321
+ policyName: import_zod5.z.string(),
322
+ reason: import_zod5.z.string()
323
+ });
324
+ var ToolCompletedEventSchema = TraceEventBaseSchema.extend({
325
+ type: import_zod5.z.literal("tool.completed"),
326
+ toolName: import_zod5.z.string(),
327
+ agentName: import_zod5.z.string(),
328
+ output: JsonValueSchema,
329
+ latencyMs: import_zod5.z.number().nonnegative()
330
+ });
331
+ var ToolFailedEventSchema = TraceEventBaseSchema.extend({
332
+ type: import_zod5.z.literal("tool.failed"),
333
+ toolName: import_zod5.z.string(),
334
+ agentName: import_zod5.z.string(),
335
+ error: TraceEventErrorSchema,
336
+ latencyMs: import_zod5.z.number().nonnegative()
337
+ });
338
+ var PolicyEvaluatedEventSchema = TraceEventBaseSchema.extend({
339
+ type: import_zod5.z.literal("policy.evaluated"),
340
+ policyName: import_zod5.z.string(),
341
+ action: PolicyActionSchema,
342
+ agentName: import_zod5.z.string().optional(),
343
+ toolName: import_zod5.z.string().optional(),
344
+ reason: import_zod5.z.string()
345
+ });
346
+ var RouteSelectedEventSchema = TraceEventBaseSchema.extend({
347
+ type: import_zod5.z.literal("route.selected"),
348
+ supervisorName: import_zod5.z.string(),
349
+ selectedAgentName: import_zod5.z.string(),
350
+ candidateAgentNames: import_zod5.z.array(import_zod5.z.string()),
351
+ reason: import_zod5.z.string()
352
+ });
353
+ var ApprovalRequiredEventSchema = TraceEventBaseSchema.extend({
354
+ type: import_zod5.z.literal("approval.required"),
355
+ approvalId: import_zod5.z.string(),
356
+ toolName: import_zod5.z.string().optional(),
357
+ agentName: import_zod5.z.string().optional(),
358
+ reason: import_zod5.z.string()
359
+ });
360
+ var ApprovalApprovedEventSchema = TraceEventBaseSchema.extend({
361
+ type: import_zod5.z.literal("approval.approved"),
362
+ approvalId: import_zod5.z.string(),
363
+ decidedBy: import_zod5.z.string().nullable()
364
+ });
365
+ var ApprovalRejectedEventSchema = TraceEventBaseSchema.extend({
366
+ type: import_zod5.z.literal("approval.rejected"),
367
+ approvalId: import_zod5.z.string(),
368
+ decidedBy: import_zod5.z.string().nullable(),
369
+ reason: import_zod5.z.string()
370
+ });
371
+ var EvalStartedEventSchema = TraceEventBaseSchema.extend({
372
+ type: import_zod5.z.literal("eval.started"),
373
+ evalRunId: import_zod5.z.string(),
374
+ suiteName: import_zod5.z.string(),
375
+ caseCount: import_zod5.z.number().int().nonnegative()
376
+ });
377
+ var EvalCompletedEventSchema = TraceEventBaseSchema.extend({
378
+ type: import_zod5.z.literal("eval.completed"),
379
+ evalRunId: import_zod5.z.string(),
380
+ passedCaseCount: import_zod5.z.number().int().nonnegative(),
381
+ failedCaseCount: import_zod5.z.number().int().nonnegative(),
382
+ latencyMs: import_zod5.z.number().nonnegative()
383
+ });
384
+ var ReplayStartedEventSchema = TraceEventBaseSchema.extend({
385
+ type: import_zod5.z.literal("replay.started"),
386
+ sourceRunId: import_zod5.z.string(),
387
+ fromEventId: import_zod5.z.string().nullable()
388
+ });
389
+ var ReplayCompletedEventSchema = TraceEventBaseSchema.extend({
390
+ type: import_zod5.z.literal("replay.completed"),
391
+ sourceRunId: import_zod5.z.string(),
392
+ latencyMs: import_zod5.z.number().nonnegative()
393
+ });
394
+ var TraceEventSchema = import_zod5.z.discriminatedUnion("type", [
395
+ RunStartedEventSchema,
396
+ RunCompletedEventSchema,
397
+ RunFailedEventSchema,
398
+ AgentStartedEventSchema,
399
+ AgentCompletedEventSchema,
400
+ AgentFailedEventSchema,
401
+ ToolRequestedEventSchema,
402
+ ToolApprovedEventSchema,
403
+ ToolBlockedEventSchema,
404
+ ToolCompletedEventSchema,
405
+ ToolFailedEventSchema,
406
+ PolicyEvaluatedEventSchema,
407
+ RouteSelectedEventSchema,
408
+ ApprovalRequiredEventSchema,
409
+ ApprovalApprovedEventSchema,
410
+ ApprovalRejectedEventSchema,
411
+ EvalStartedEventSchema,
412
+ EvalCompletedEventSchema,
413
+ ReplayStartedEventSchema,
414
+ ReplayCompletedEventSchema
415
+ ]);
416
+ var traceEventTypes = TraceEventSchema.options.map(
417
+ (option) => option.shape.type.value
418
+ );
419
+ // Annotate the CommonJS export names for ESM import in node:
420
+ 0 && (module.exports = {
421
+ AgentCallSchema,
422
+ AgentCallStatusSchema,
423
+ AgentCompletedEventSchema,
424
+ AgentFailedEventSchema,
425
+ AgentStartedEventSchema,
426
+ ApiKeyEnvironmentSchema,
427
+ AppErrorCode,
428
+ ApprovalApprovedEventSchema,
429
+ ApprovalRejectedEventSchema,
430
+ ApprovalRequiredEventSchema,
431
+ ApprovalStatusSchema,
432
+ EvalCompletedEventSchema,
433
+ EvalStartedEventSchema,
434
+ JsonObjectSchema,
435
+ JsonPrimitiveSchema,
436
+ JsonValueSchema,
437
+ PolicyActionSchema,
438
+ PolicyDecisionSchema,
439
+ PolicyEvaluatedEventSchema,
440
+ ReplayCompletedEventSchema,
441
+ ReplayStartedEventSchema,
442
+ RouteSelectedEventSchema,
443
+ RoutingDecisionSchema,
444
+ RunApprovalSchema,
445
+ RunArtifactSchema,
446
+ RunCompletedEventSchema,
447
+ RunErrorSchema,
448
+ RunFailedEventSchema,
449
+ RunMessageRoleSchema,
450
+ RunMessageSchema,
451
+ RunMetadataSchema,
452
+ RunMetricsSchema,
453
+ RunStartedEventSchema,
454
+ RunStateSchema,
455
+ RunStatusSchema,
456
+ TokenUsageSchema,
457
+ ToolApprovedEventSchema,
458
+ ToolBlockedEventSchema,
459
+ ToolCallSchema,
460
+ ToolCallStatusSchema,
461
+ ToolCompletedEventSchema,
462
+ ToolFailedEventSchema,
463
+ ToolRequestedEventSchema,
464
+ TraceEventErrorSchema,
465
+ TraceEventSchema,
466
+ traceEventTypes
467
+ });
@@ -0,0 +1,8 @@
1
+ export { ApiKeyEnvironment, ApiKeyEnvironmentSchema } from './api-keys.cjs';
2
+ export { AppErrorCode, AppErrorDetails, AppErrorInput, AppErrorResponse } from './errors.cjs';
3
+ export { JsonObject, JsonObjectSchema, JsonPrimitive, JsonPrimitiveSchema, JsonValue, JsonValueSchema } from './json.cjs';
4
+ export { RunMetadata, RunMetadataSchema } from './run-metadata.cjs';
5
+ export { AgentCall, AgentCallSchema, AgentCallStatus, AgentCallStatusSchema, ApprovalStatus, ApprovalStatusSchema, PolicyAction, PolicyActionSchema, PolicyDecision, PolicyDecisionSchema, RoutingDecision, RoutingDecisionSchema, RunApproval, RunApprovalSchema, RunArtifact, RunArtifactSchema, RunError, RunErrorSchema, RunMessage, RunMessageRole, RunMessageRoleSchema, RunMessageSchema, RunMetrics, RunMetricsSchema, RunState, RunStateSchema, RunStatus, RunStatusSchema, TokenUsage, TokenUsageSchema, ToolCall, ToolCallSchema, ToolCallStatus, ToolCallStatusSchema } from './runs.cjs';
6
+ export { AgentCompletedEvent, AgentCompletedEventSchema, AgentFailedEvent, AgentFailedEventSchema, AgentStartedEvent, AgentStartedEventSchema, ApprovalApprovedEvent, ApprovalApprovedEventSchema, ApprovalRejectedEvent, ApprovalRejectedEventSchema, ApprovalRequiredEvent, ApprovalRequiredEventSchema, EvalCompletedEvent, EvalCompletedEventSchema, EvalStartedEvent, EvalStartedEventSchema, PolicyEvaluatedEvent, PolicyEvaluatedEventSchema, ReplayCompletedEvent, ReplayCompletedEventSchema, ReplayStartedEvent, ReplayStartedEventSchema, RouteSelectedEvent, RouteSelectedEventSchema, RunCompletedEvent, RunCompletedEventSchema, RunFailedEvent, RunFailedEventSchema, RunStartedEvent, RunStartedEventSchema, ToolApprovedEvent, ToolApprovedEventSchema, ToolBlockedEvent, ToolBlockedEventSchema, ToolCompletedEvent, ToolCompletedEventSchema, ToolFailedEvent, ToolFailedEventSchema, ToolRequestedEvent, ToolRequestedEventSchema, TraceEvent, TraceEventError, TraceEventErrorSchema, TraceEventSchema, TraceEventType, traceEventTypes } from './trace-events.cjs';
7
+ export { SchemaValidationFailure, SchemaValidationIssue, SchemaValidationResult, SchemaValidationSuccess, ValidationSchema } from './validation.cjs';
8
+ import 'zod';
@@ -0,0 +1,8 @@
1
+ export { ApiKeyEnvironment, ApiKeyEnvironmentSchema } from './api-keys.js';
2
+ export { AppErrorCode, AppErrorDetails, AppErrorInput, AppErrorResponse } from './errors.js';
3
+ export { JsonObject, JsonObjectSchema, JsonPrimitive, JsonPrimitiveSchema, JsonValue, JsonValueSchema } from './json.js';
4
+ export { RunMetadata, RunMetadataSchema } from './run-metadata.js';
5
+ export { AgentCall, AgentCallSchema, AgentCallStatus, AgentCallStatusSchema, ApprovalStatus, ApprovalStatusSchema, PolicyAction, PolicyActionSchema, PolicyDecision, PolicyDecisionSchema, RoutingDecision, RoutingDecisionSchema, RunApproval, RunApprovalSchema, RunArtifact, RunArtifactSchema, RunError, RunErrorSchema, RunMessage, RunMessageRole, RunMessageRoleSchema, RunMessageSchema, RunMetrics, RunMetricsSchema, RunState, RunStateSchema, RunStatus, RunStatusSchema, TokenUsage, TokenUsageSchema, ToolCall, ToolCallSchema, ToolCallStatus, ToolCallStatusSchema } from './runs.js';
6
+ export { AgentCompletedEvent, AgentCompletedEventSchema, AgentFailedEvent, AgentFailedEventSchema, AgentStartedEvent, AgentStartedEventSchema, ApprovalApprovedEvent, ApprovalApprovedEventSchema, ApprovalRejectedEvent, ApprovalRejectedEventSchema, ApprovalRequiredEvent, ApprovalRequiredEventSchema, EvalCompletedEvent, EvalCompletedEventSchema, EvalStartedEvent, EvalStartedEventSchema, PolicyEvaluatedEvent, PolicyEvaluatedEventSchema, ReplayCompletedEvent, ReplayCompletedEventSchema, ReplayStartedEvent, ReplayStartedEventSchema, RouteSelectedEvent, RouteSelectedEventSchema, RunCompletedEvent, RunCompletedEventSchema, RunFailedEvent, RunFailedEventSchema, RunStartedEvent, RunStartedEventSchema, ToolApprovedEvent, ToolApprovedEventSchema, ToolBlockedEvent, ToolBlockedEventSchema, ToolCompletedEvent, ToolCompletedEventSchema, ToolFailedEvent, ToolFailedEventSchema, ToolRequestedEvent, ToolRequestedEventSchema, TraceEvent, TraceEventError, TraceEventErrorSchema, TraceEventSchema, TraceEventType, traceEventTypes } from './trace-events.js';
7
+ export { SchemaValidationFailure, SchemaValidationIssue, SchemaValidationResult, SchemaValidationSuccess, ValidationSchema } from './validation.js';
8
+ import 'zod';
package/dist/index.js ADDED
@@ -0,0 +1,107 @@
1
+ import {
2
+ ApiKeyEnvironmentSchema
3
+ } from "./chunk-Z3WAEROF.js";
4
+ import {
5
+ AppErrorCode
6
+ } from "./chunk-L43XAKHI.js";
7
+ import {
8
+ AgentCompletedEventSchema,
9
+ AgentFailedEventSchema,
10
+ AgentStartedEventSchema,
11
+ ApprovalApprovedEventSchema,
12
+ ApprovalRejectedEventSchema,
13
+ ApprovalRequiredEventSchema,
14
+ EvalCompletedEventSchema,
15
+ EvalStartedEventSchema,
16
+ PolicyEvaluatedEventSchema,
17
+ ReplayCompletedEventSchema,
18
+ ReplayStartedEventSchema,
19
+ RouteSelectedEventSchema,
20
+ RunCompletedEventSchema,
21
+ RunFailedEventSchema,
22
+ RunStartedEventSchema,
23
+ ToolApprovedEventSchema,
24
+ ToolBlockedEventSchema,
25
+ ToolCompletedEventSchema,
26
+ ToolFailedEventSchema,
27
+ ToolRequestedEventSchema,
28
+ TraceEventErrorSchema,
29
+ TraceEventSchema,
30
+ traceEventTypes
31
+ } from "./chunk-PQRNSB4E.js";
32
+ import {
33
+ RunMetadataSchema
34
+ } from "./chunk-F5XOAPYA.js";
35
+ import {
36
+ AgentCallSchema,
37
+ AgentCallStatusSchema,
38
+ ApprovalStatusSchema,
39
+ PolicyActionSchema,
40
+ PolicyDecisionSchema,
41
+ RoutingDecisionSchema,
42
+ RunApprovalSchema,
43
+ RunArtifactSchema,
44
+ RunErrorSchema,
45
+ RunMessageRoleSchema,
46
+ RunMessageSchema,
47
+ RunMetricsSchema,
48
+ RunStateSchema,
49
+ RunStatusSchema,
50
+ TokenUsageSchema,
51
+ ToolCallSchema,
52
+ ToolCallStatusSchema
53
+ } from "./chunk-WTIOTJHP.js";
54
+ import {
55
+ JsonObjectSchema,
56
+ JsonPrimitiveSchema,
57
+ JsonValueSchema
58
+ } from "./chunk-4FCV35HE.js";
59
+ import "./chunk-MDGGODHM.js";
60
+ export {
61
+ AgentCallSchema,
62
+ AgentCallStatusSchema,
63
+ AgentCompletedEventSchema,
64
+ AgentFailedEventSchema,
65
+ AgentStartedEventSchema,
66
+ ApiKeyEnvironmentSchema,
67
+ AppErrorCode,
68
+ ApprovalApprovedEventSchema,
69
+ ApprovalRejectedEventSchema,
70
+ ApprovalRequiredEventSchema,
71
+ ApprovalStatusSchema,
72
+ EvalCompletedEventSchema,
73
+ EvalStartedEventSchema,
74
+ JsonObjectSchema,
75
+ JsonPrimitiveSchema,
76
+ JsonValueSchema,
77
+ PolicyActionSchema,
78
+ PolicyDecisionSchema,
79
+ PolicyEvaluatedEventSchema,
80
+ ReplayCompletedEventSchema,
81
+ ReplayStartedEventSchema,
82
+ RouteSelectedEventSchema,
83
+ RoutingDecisionSchema,
84
+ RunApprovalSchema,
85
+ RunArtifactSchema,
86
+ RunCompletedEventSchema,
87
+ RunErrorSchema,
88
+ RunFailedEventSchema,
89
+ RunMessageRoleSchema,
90
+ RunMessageSchema,
91
+ RunMetadataSchema,
92
+ RunMetricsSchema,
93
+ RunStartedEventSchema,
94
+ RunStateSchema,
95
+ RunStatusSchema,
96
+ TokenUsageSchema,
97
+ ToolApprovedEventSchema,
98
+ ToolBlockedEventSchema,
99
+ ToolCallSchema,
100
+ ToolCallStatusSchema,
101
+ ToolCompletedEventSchema,
102
+ ToolFailedEventSchema,
103
+ ToolRequestedEventSchema,
104
+ TraceEventErrorSchema,
105
+ TraceEventSchema,
106
+ traceEventTypes
107
+ };
package/dist/json.cjs ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/json.ts
21
+ var json_exports = {};
22
+ __export(json_exports, {
23
+ JsonObjectSchema: () => JsonObjectSchema,
24
+ JsonPrimitiveSchema: () => JsonPrimitiveSchema,
25
+ JsonValueSchema: () => JsonValueSchema
26
+ });
27
+ module.exports = __toCommonJS(json_exports);
28
+ var import_zod = require("zod");
29
+ var JsonPrimitiveSchema = import_zod.z.union([
30
+ import_zod.z.string(),
31
+ import_zod.z.number(),
32
+ import_zod.z.boolean(),
33
+ import_zod.z.null()
34
+ ]);
35
+ var JsonValueSchema = import_zod.z.lazy(
36
+ () => import_zod.z.union([
37
+ JsonPrimitiveSchema,
38
+ import_zod.z.array(JsonValueSchema),
39
+ import_zod.z.record(import_zod.z.string(), JsonValueSchema)
40
+ ])
41
+ );
42
+ var JsonObjectSchema = import_zod.z.record(import_zod.z.string(), JsonValueSchema);
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ JsonObjectSchema,
46
+ JsonPrimitiveSchema,
47
+ JsonValueSchema
48
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const JsonPrimitiveSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
4
+ type JsonPrimitive = z.infer<typeof JsonPrimitiveSchema>;
5
+ type JsonValue = JsonPrimitive | JsonValue[] | {
6
+ [key: string]: JsonValue;
7
+ };
8
+ declare const JsonValueSchema: z.ZodType<JsonValue>;
9
+ declare const JsonObjectSchema: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
10
+ type JsonObject = z.infer<typeof JsonObjectSchema>;
11
+
12
+ export { type JsonObject, JsonObjectSchema, type JsonPrimitive, JsonPrimitiveSchema, type JsonValue, JsonValueSchema };
package/dist/json.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const JsonPrimitiveSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
4
+ type JsonPrimitive = z.infer<typeof JsonPrimitiveSchema>;
5
+ type JsonValue = JsonPrimitive | JsonValue[] | {
6
+ [key: string]: JsonValue;
7
+ };
8
+ declare const JsonValueSchema: z.ZodType<JsonValue>;
9
+ declare const JsonObjectSchema: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
10
+ type JsonObject = z.infer<typeof JsonObjectSchema>;
11
+
12
+ export { type JsonObject, JsonObjectSchema, type JsonPrimitive, JsonPrimitiveSchema, type JsonValue, JsonValueSchema };
package/dist/json.js ADDED
@@ -0,0 +1,10 @@
1
+ import {
2
+ JsonObjectSchema,
3
+ JsonPrimitiveSchema,
4
+ JsonValueSchema
5
+ } from "./chunk-4FCV35HE.js";
6
+ export {
7
+ JsonObjectSchema,
8
+ JsonPrimitiveSchema,
9
+ JsonValueSchema
10
+ };