@meistrari/agent-sdk 0.3.1 → 0.5.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/README.md +101 -4
- package/dist/index.cjs +81 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.mts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.mjs +82 -3
- package/dist/schemas.cjs +148 -1
- package/dist/schemas.d.cts +3 -2
- package/dist/schemas.d.mts +3 -2
- package/dist/schemas.d.ts +3 -2
- package/dist/schemas.mjs +135 -2
- package/dist/shared/{agent-sdk.3fcc7aba.d.cts → agent-sdk.ed11095c.d.cts} +173 -4
- package/dist/shared/{agent-sdk.3fcc7aba.d.mts → agent-sdk.ed11095c.d.mts} +173 -4
- package/dist/shared/{agent-sdk.3fcc7aba.d.ts → agent-sdk.ed11095c.d.ts} +173 -4
- package/package.json +1 -1
|
@@ -19,6 +19,19 @@ declare const executeAgentRequestSchema: z.ZodObject<{
|
|
|
19
19
|
}, z.core.$strict>>>;
|
|
20
20
|
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
21
21
|
recover: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
webhooks: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
23
|
+
url: z.ZodString;
|
|
24
|
+
events: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
25
|
+
"session.started": "session.started";
|
|
26
|
+
"session.completed": "session.completed";
|
|
27
|
+
"session.failed": "session.failed";
|
|
28
|
+
"session.cancelled": "session.cancelled";
|
|
29
|
+
"session.waiting_messages": "session.waiting_messages";
|
|
30
|
+
"subagent.started": "subagent.started";
|
|
31
|
+
"subagent.completed": "subagent.completed";
|
|
32
|
+
}>>>;
|
|
33
|
+
secret: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>>>;
|
|
22
35
|
}, z.core.$strict>;
|
|
23
36
|
type ExecuteAgentRequest = z.infer<typeof executeAgentRequestSchema>;
|
|
24
37
|
declare const executeAgentSuccessResponseSchema: z.ZodObject<{
|
|
@@ -150,9 +163,9 @@ declare const timelineEventSchema: z.ZodObject<{
|
|
|
150
163
|
other: "other";
|
|
151
164
|
}>>;
|
|
152
165
|
status: z.ZodOptional<z.ZodEnum<{
|
|
166
|
+
success: "success";
|
|
153
167
|
failed: "failed";
|
|
154
168
|
cancelled: "cancelled";
|
|
155
|
-
success: "success";
|
|
156
169
|
timeout: "timeout";
|
|
157
170
|
}>>;
|
|
158
171
|
result: z.ZodOptional<z.ZodObject<{
|
|
@@ -229,6 +242,26 @@ declare const sessionTimelineResponseSchema: z.ZodObject<{
|
|
|
229
242
|
}, z.core.$strip>>;
|
|
230
243
|
}, z.core.$strip>;
|
|
231
244
|
type SessionTimelineResponse = z.infer<typeof sessionTimelineResponseSchema>;
|
|
245
|
+
declare const sessionFilesTreeResponseSchema: z.ZodObject<{
|
|
246
|
+
sessionId: z.ZodString;
|
|
247
|
+
tree: z.ZodArray<z.ZodObject<{
|
|
248
|
+
path: z.ZodString;
|
|
249
|
+
size: z.ZodNumber;
|
|
250
|
+
}, z.core.$strip>>;
|
|
251
|
+
truncated: z.ZodBoolean;
|
|
252
|
+
capturedAt: z.ZodNumber;
|
|
253
|
+
}, z.core.$strip>;
|
|
254
|
+
type SessionFilesTreeResponse = z.infer<typeof sessionFilesTreeResponseSchema>;
|
|
255
|
+
declare const sessionFileContentResponseSchema: z.ZodObject<{
|
|
256
|
+
filePath: z.ZodString;
|
|
257
|
+
content: z.ZodString;
|
|
258
|
+
encoding: z.ZodEnum<{
|
|
259
|
+
raw: "raw";
|
|
260
|
+
base64: "base64";
|
|
261
|
+
}>;
|
|
262
|
+
size: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
type SessionFileContentResponse = z.infer<typeof sessionFileContentResponseSchema>;
|
|
232
265
|
declare const sessionStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
233
266
|
kind: z.ZodLiteral<"status">;
|
|
234
267
|
sessionId: z.ZodString;
|
|
@@ -341,9 +374,9 @@ declare const sessionStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
341
374
|
other: "other";
|
|
342
375
|
}>>;
|
|
343
376
|
status: z.ZodOptional<z.ZodEnum<{
|
|
377
|
+
success: "success";
|
|
344
378
|
failed: "failed";
|
|
345
379
|
cancelled: "cancelled";
|
|
346
|
-
success: "success";
|
|
347
380
|
timeout: "timeout";
|
|
348
381
|
}>>;
|
|
349
382
|
result: z.ZodOptional<z.ZodObject<{
|
|
@@ -367,6 +400,142 @@ declare const sessionStreamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
367
400
|
}, z.core.$strip>], "kind">;
|
|
368
401
|
type SessionStreamEvent = z.infer<typeof sessionStreamEventSchema>;
|
|
369
402
|
declare const SESSION_STREAM_EVENT_KINDS: Set<string>;
|
|
403
|
+
declare const cancelSessionResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
404
|
+
success: z.ZodLiteral<true>;
|
|
405
|
+
message: z.ZodString;
|
|
406
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
407
|
+
success: z.ZodLiteral<false>;
|
|
408
|
+
error: z.ZodString;
|
|
409
|
+
}, z.core.$strip>], "success">;
|
|
410
|
+
type CancelSessionResponse = z.infer<typeof cancelSessionResponseSchema>;
|
|
411
|
+
|
|
412
|
+
declare const sessionWebhookEventTypeSchema: z.ZodEnum<{
|
|
413
|
+
"session.started": "session.started";
|
|
414
|
+
"session.completed": "session.completed";
|
|
415
|
+
"session.failed": "session.failed";
|
|
416
|
+
"session.cancelled": "session.cancelled";
|
|
417
|
+
"session.waiting_messages": "session.waiting_messages";
|
|
418
|
+
"subagent.started": "subagent.started";
|
|
419
|
+
"subagent.completed": "subagent.completed";
|
|
420
|
+
}>;
|
|
421
|
+
type SessionWebhookEventType = z.infer<typeof sessionWebhookEventTypeSchema>;
|
|
422
|
+
declare const SESSION_WEBHOOK_DEFAULT_EVENTS: SessionWebhookEventType[];
|
|
423
|
+
declare function isBlockedWebhookHostname(hostname: string): boolean;
|
|
424
|
+
declare function validateWebhookUrl(value: string): string | null;
|
|
425
|
+
declare const sessionWebhookConfigSchema: z.ZodObject<{
|
|
426
|
+
url: z.ZodString;
|
|
427
|
+
events: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
428
|
+
"session.started": "session.started";
|
|
429
|
+
"session.completed": "session.completed";
|
|
430
|
+
"session.failed": "session.failed";
|
|
431
|
+
"session.cancelled": "session.cancelled";
|
|
432
|
+
"session.waiting_messages": "session.waiting_messages";
|
|
433
|
+
"subagent.started": "subagent.started";
|
|
434
|
+
"subagent.completed": "subagent.completed";
|
|
435
|
+
}>>>;
|
|
436
|
+
secret: z.ZodOptional<z.ZodString>;
|
|
437
|
+
}, z.core.$strict>;
|
|
438
|
+
type SessionWebhookConfig = z.infer<typeof sessionWebhookConfigSchema>;
|
|
439
|
+
declare const sessionWebhooksSchema: z.ZodArray<z.ZodObject<{
|
|
440
|
+
url: z.ZodString;
|
|
441
|
+
events: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
442
|
+
"session.started": "session.started";
|
|
443
|
+
"session.completed": "session.completed";
|
|
444
|
+
"session.failed": "session.failed";
|
|
445
|
+
"session.cancelled": "session.cancelled";
|
|
446
|
+
"session.waiting_messages": "session.waiting_messages";
|
|
447
|
+
"subagent.started": "subagent.started";
|
|
448
|
+
"subagent.completed": "subagent.completed";
|
|
449
|
+
}>>>;
|
|
450
|
+
secret: z.ZodOptional<z.ZodString>;
|
|
451
|
+
}, z.core.$strict>>;
|
|
452
|
+
declare const sessionWebhookUsageSchema: z.ZodObject<{
|
|
453
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
454
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
455
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
456
|
+
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
457
|
+
totalCostUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
458
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
numTurns: z.ZodOptional<z.ZodNumber>;
|
|
460
|
+
}, z.core.$strict>;
|
|
461
|
+
type SessionWebhookUsage = z.infer<typeof sessionWebhookUsageSchema>;
|
|
462
|
+
declare const sessionWebhookSubagentSchema: z.ZodObject<{
|
|
463
|
+
callId: z.ZodString;
|
|
464
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
465
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
466
|
+
success: "success";
|
|
467
|
+
failed: "failed";
|
|
468
|
+
}>>;
|
|
469
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
470
|
+
}, z.core.$strict>;
|
|
471
|
+
type SessionWebhookSubagent = z.infer<typeof sessionWebhookSubagentSchema>;
|
|
472
|
+
declare const sessionWebhookEventPayloadSchema: z.ZodObject<{
|
|
473
|
+
eventType: z.ZodEnum<{
|
|
474
|
+
"session.started": "session.started";
|
|
475
|
+
"session.completed": "session.completed";
|
|
476
|
+
"session.failed": "session.failed";
|
|
477
|
+
"session.cancelled": "session.cancelled";
|
|
478
|
+
"session.waiting_messages": "session.waiting_messages";
|
|
479
|
+
"subagent.started": "subagent.started";
|
|
480
|
+
"subagent.completed": "subagent.completed";
|
|
481
|
+
}>;
|
|
482
|
+
sessionId: z.ZodString;
|
|
483
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
484
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
485
|
+
status: z.ZodString;
|
|
486
|
+
error: z.ZodOptional<z.ZodString>;
|
|
487
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
488
|
+
inputTokens: z.ZodOptional<z.ZodNumber>;
|
|
489
|
+
outputTokens: z.ZodOptional<z.ZodNumber>;
|
|
490
|
+
cacheReadInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
491
|
+
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
492
|
+
totalCostUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
493
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
494
|
+
numTurns: z.ZodOptional<z.ZodNumber>;
|
|
495
|
+
}, z.core.$strict>>;
|
|
496
|
+
subagent: z.ZodOptional<z.ZodObject<{
|
|
497
|
+
callId: z.ZodString;
|
|
498
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
499
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
500
|
+
success: "success";
|
|
501
|
+
failed: "failed";
|
|
502
|
+
}>>;
|
|
503
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
504
|
+
}, z.core.$strict>>;
|
|
505
|
+
timestamp: z.ZodString;
|
|
506
|
+
apiVersion: z.ZodLiteral<"v4">;
|
|
507
|
+
deliveryId: z.ZodString;
|
|
508
|
+
}, z.core.$strip>;
|
|
509
|
+
type SessionWebhookEventPayload = z.infer<typeof sessionWebhookEventPayloadSchema>;
|
|
510
|
+
declare const sessionAgentEventSchema: z.ZodObject<{
|
|
511
|
+
type: z.ZodEnum<{
|
|
512
|
+
"subagent.started": "subagent.started";
|
|
513
|
+
"subagent.completed": "subagent.completed";
|
|
514
|
+
}>;
|
|
515
|
+
callId: z.ZodString;
|
|
516
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
517
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
518
|
+
success: "success";
|
|
519
|
+
failed: "failed";
|
|
520
|
+
}>>;
|
|
521
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
522
|
+
timestamp: z.ZodNumber;
|
|
523
|
+
}, z.core.$strict>;
|
|
524
|
+
type SessionAgentEvent = z.infer<typeof sessionAgentEventSchema>;
|
|
525
|
+
declare const sessionAgentEventsSchema: z.ZodArray<z.ZodObject<{
|
|
526
|
+
type: z.ZodEnum<{
|
|
527
|
+
"subagent.started": "subagent.started";
|
|
528
|
+
"subagent.completed": "subagent.completed";
|
|
529
|
+
}>;
|
|
530
|
+
callId: z.ZodString;
|
|
531
|
+
subagentType: z.ZodOptional<z.ZodString>;
|
|
532
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
533
|
+
success: "success";
|
|
534
|
+
failed: "failed";
|
|
535
|
+
}>>;
|
|
536
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
537
|
+
timestamp: z.ZodNumber;
|
|
538
|
+
}, z.core.$strict>>;
|
|
370
539
|
|
|
371
|
-
export {
|
|
372
|
-
export type { AgentInput as A, ExecuteAgentRequest as E, SessionTimelineResponse as S, TimelineEvent as T, UpdateAgentModelRequest as U, ExecuteAgentResponse as a, UpdateAgentModelResponse as b,
|
|
540
|
+
export { sessionWebhookEventPayloadSchema as $, sessionTimelineIdSchema as B, timelineMetricsSchema as D, timelinePromptSchema as F, timelineToolResultSchema as G, timelineRunTurnMetricsSchema as H, timelineEventSchema as I, timelineSpanSchema as J, sessionTimelineResponseSchema as K, sessionFilesTreeResponseSchema as L, sessionFileContentResponseSchema as M, sessionStreamEventSchema as N, SESSION_STREAM_EVENT_KINDS as O, cancelSessionResponseSchema as P, sessionWebhookEventTypeSchema as Q, SESSION_WEBHOOK_DEFAULT_EVENTS as R, isBlockedWebhookHostname as V, validateWebhookUrl as W, sessionWebhookConfigSchema as X, sessionWebhooksSchema as Y, sessionWebhookUsageSchema as Z, sessionWebhookSubagentSchema as _, sessionAgentEventSchema as a0, sessionAgentEventsSchema as a2, agentInputSchema as q, executeAgentRequestSchema as r, executeAgentSuccessResponseSchema as s, executeAgentErrorResponseSchema as t, executeAgentResponseSchema as u, updateAgentModelRequestSchema as v, updateAgentModelSuccessResponseSchema as w, updateAgentModelErrorResponseSchema as x, updateAgentModelResponseSchema as y, sessionStatusSchema as z };
|
|
541
|
+
export type { AgentInput as A, CancelSessionResponse as C, ExecuteAgentRequest as E, SessionTimelineResponse as S, TimelineEvent as T, UpdateAgentModelRequest as U, ExecuteAgentResponse as a, SessionAgentEvent as a1, UpdateAgentModelResponse as b, SessionFilesTreeResponse as c, SessionFileContentResponse as d, SessionStreamEvent as e, SessionStatus as f, SessionWebhookConfig as g, SessionWebhookEventPayload as h, SessionWebhookEventType as i, SessionWebhookSubagent as j, SessionWebhookUsage as k, TimelineMetrics as l, TimelinePrompt as m, TimelineRunTurnMetrics as n, TimelineSpan as o, TimelineToolResult as p };
|