@m6d/cortex 0.9.0 → 0.10.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 (4) hide show
  1. package/README.md +56 -10
  2. package/dist/index.d.ts +656 -342
  3. package/dist/index.js +6980 -385
  4. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -33,23 +33,74 @@ declare const serverToolSchema: z.ZodObject<{
33
33
  requiresApproval: z.ZodOptional<z.ZodBoolean>;
34
34
  }, z.core.$strip>;
35
35
  export type ServerTool = z.infer<typeof serverToolSchema>;
36
- declare const approvalRequestedEventSchema: z.ZodObject<{
37
- event: z.ZodLiteral<"approval_requested">;
38
- agentName: z.ZodString;
39
- agentId: z.ZodUUID;
36
+ declare const runWaitingEventSchema: z.ZodObject<{
40
37
  threadId: z.ZodString;
41
- runId: z.ZodString;
42
38
  userId: z.ZodString;
43
- firingId: z.ZodOptional<z.ZodUUID>;
44
- triggerName: z.ZodOptional<z.ZodString>;
45
- approvals: z.ZodArray<z.ZodObject<{
39
+ waits: z.ZodArray<z.ZodObject<{
40
+ kind: z.ZodEnum<{
41
+ approval: "approval";
42
+ client_tool: "client_tool";
43
+ }>;
46
44
  toolCallId: z.ZodString;
47
45
  toolName: z.ZodString;
48
46
  input: z.ZodOptional<z.ZodUnknown>;
49
47
  }, z.core.$strip>>;
48
+ agentName: z.ZodString;
49
+ agentId: z.ZodUUID;
50
+ runId: z.ZodUUID;
51
+ triggerName: z.ZodOptional<z.ZodString>;
50
52
  occurredAt: z.ZodISODateTime;
53
+ event: z.ZodLiteral<"run_waiting">;
51
54
  }, z.core.$strip>;
52
- export type ApprovalRequestedEvent = z.infer<typeof approvalRequestedEventSchema>;
55
+ export type RunWaitingEvent = z.infer<typeof runWaitingEventSchema>;
56
+ declare const runFinishedEventSchema: z.ZodObject<{
57
+ run: z.ZodObject<{
58
+ id: z.ZodUUID;
59
+ threadId: z.ZodNullable<z.ZodUUID>;
60
+ inputId: z.ZodNullable<z.ZodUUID>;
61
+ kind: z.ZodEnum<{
62
+ turn: "turn";
63
+ subagent: "subagent";
64
+ tool: "tool";
65
+ }>;
66
+ subagentRunId: z.ZodNullable<z.ZodString>;
67
+ status: z.ZodEnum<{
68
+ completed: "completed";
69
+ cancelled: "cancelled";
70
+ failed: "failed";
71
+ running: "running";
72
+ waiting: "waiting";
73
+ }>;
74
+ reason: z.ZodNullable<z.ZodEnum<{
75
+ timeout: "timeout";
76
+ cancelled: "cancelled";
77
+ no_output: "no_output";
78
+ invalid_output: "invalid_output";
79
+ stopped: "stopped";
80
+ parent_cancelled: "parent_cancelled";
81
+ lost: "lost";
82
+ }>>;
83
+ result: z.ZodUnknown;
84
+ waits: z.ZodArray<z.ZodObject<{
85
+ kind: z.ZodEnum<{
86
+ approval: "approval";
87
+ client_tool: "client_tool";
88
+ }>;
89
+ toolCallId: z.ZodString;
90
+ toolName: z.ZodString;
91
+ input: z.ZodUnknown;
92
+ }, z.core.$strip>>;
93
+ createdAt: z.ZodISODateTime;
94
+ finishedAt: z.ZodNullable<z.ZodISODateTime>;
95
+ }, z.core.$strip>;
96
+ agentName: z.ZodString;
97
+ agentId: z.ZodUUID;
98
+ runId: z.ZodUUID;
99
+ triggerName: z.ZodOptional<z.ZodString>;
100
+ occurredAt: z.ZodISODateTime;
101
+ event: z.ZodLiteral<"run_finished">;
102
+ }, z.core.$strip>;
103
+ export type RunFinishedEvent = z.infer<typeof runFinishedEventSchema>;
53
104
  declare const variablesRequestSchema: z.ZodObject<{
54
105
  agent: z.ZodObject<{
55
106
  id: z.ZodUUID;
@@ -61,6 +112,15 @@ declare const variablesRequestSchema: z.ZodObject<{
61
112
  user: z.ZodNullable<z.ZodObject<{
62
113
  id: z.ZodString;
63
114
  claims: z.ZodRecord<z.ZodString, z.ZodUnknown>;
115
+ delegated: z.ZodOptional<z.ZodObject<{
116
+ reason: z.ZodEnum<{
117
+ trigger: "trigger";
118
+ schedule: "schedule";
119
+ run: "run";
120
+ queued: "queued";
121
+ }>;
122
+ runId: z.ZodUUID;
123
+ }, z.core.$strip>>;
64
124
  }, z.core.$strip>>;
65
125
  trigger: z.ZodOptional<z.ZodObject<{
66
126
  name: z.ZodString;
@@ -73,6 +133,15 @@ declare const toolRequestSchema: z.ZodObject<{
73
133
  user: z.ZodNullable<z.ZodObject<{
74
134
  id: z.ZodString;
75
135
  claims: z.ZodRecord<z.ZodString, z.ZodUnknown>;
136
+ delegated: z.ZodOptional<z.ZodObject<{
137
+ reason: z.ZodEnum<{
138
+ trigger: "trigger";
139
+ schedule: "schedule";
140
+ run: "run";
141
+ queued: "queued";
142
+ }>;
143
+ runId: z.ZodUUID;
144
+ }, z.core.$strip>>;
76
145
  }, z.core.$strip>>;
77
146
  agent: z.ZodObject<{
78
147
  id: z.ZodUUID;
@@ -121,8 +190,18 @@ export type ServerOptions<TInputs extends Record<string, z.ZodType>> = {
121
190
  sub: string;
122
191
  claims?: Record<string, unknown>;
123
192
  } | null>;
193
+ /**
194
+ * Lets Cortex act for a user whose token is gone (a message that waited
195
+ * past it, a scheduled or triggered run): such a call carries no token,
196
+ * and `context.user.delegated` says why and which run acts, so a tool can
197
+ * refuse what it should not do for a user who is not there. Without it,
198
+ * such a call names no user (`context.user` is null).
199
+ */
200
+ delegation?: boolean;
201
+ /** What to do with each event the server hears. */
124
202
  events?: {
125
- approval_requested?: (event: ApprovalRequestedEvent) => Awaitable<void>;
203
+ run_waiting?: (event: RunWaitingEvent) => Awaitable<void>;
204
+ run_finished?: (event: RunFinishedEvent) => Awaitable<void>;
126
205
  };
127
206
  };
128
207
  /**
@@ -1220,100 +1299,72 @@ export type DatasetHostOptions<TUser> = {
1220
1299
  * so a source with a malformed definition fails at startup, not on a query.
1221
1300
  */
1222
1301
  export declare function defineDatasetHost<TUser>(options: DatasetHostOptions<TUser>): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
1223
- declare const triggerFiringResponseSchema: z.ZodDiscriminatedUnion<[
1224
- z.ZodObject<{
1225
- firingId: z.ZodUUID;
1226
- outcome: z.ZodLiteral<"started">;
1227
- threadId: z.ZodUUID;
1228
- runId: z.ZodString;
1229
- }, z.core.$strip>,
1230
- z.ZodObject<{
1231
- firingId: z.ZodUUID;
1232
- outcome: z.ZodLiteral<"awaiting_approval">;
1233
- threadId: z.ZodUUID;
1234
- runId: z.ZodString;
1235
- approvals: z.ZodArray<z.ZodObject<{
1236
- toolCallId: z.ZodString;
1237
- toolName: z.ZodString;
1238
- input: z.ZodUnknown;
1239
- }, z.core.$strip>>;
1240
- }, z.core.$strip>,
1241
- z.ZodObject<{
1242
- firingId: z.ZodUUID;
1243
- outcome: z.ZodLiteral<"completed">;
1244
- threadId: z.ZodUUID;
1245
- runId: z.ZodString;
1246
- output: z.ZodUnknown;
1247
- }, z.core.$strip>,
1302
+ declare const inputReceiptSchema: z.ZodDiscriminatedUnion<[
1248
1303
  z.ZodObject<{
1249
- firingId: z.ZodUUID;
1250
- outcome: z.ZodLiteral<"failed">;
1251
- threadId: z.ZodUUID;
1252
- runId: z.ZodString;
1253
- reason: z.ZodNullable<z.ZodEnum<{
1254
- busy: "busy";
1255
- approval_pending: "approval_pending";
1256
- budget: "budget";
1257
- rate_limited: "rate_limited";
1258
- invalid_payload: "invalid_payload";
1259
- missing_thread_key: "missing_thread_key";
1260
- no_turn: "no_turn";
1261
- no_output: "no_output";
1262
- invalid_output: "invalid_output";
1263
- }>>;
1304
+ inputId: z.ZodUUID;
1305
+ state: z.ZodLiteral<"waiting">;
1306
+ delivery: z.ZodEnum<{
1307
+ prompt: "prompt";
1308
+ steer: "steer";
1309
+ followUp: "followUp";
1310
+ answer: "answer";
1311
+ note: "note";
1312
+ }>;
1264
1313
  }, z.core.$strip>,
1265
1314
  z.ZodObject<{
1266
- firingId: z.ZodUUID;
1267
- outcome: z.ZodLiteral<"dropped">;
1315
+ inputId: z.ZodNullable<z.ZodUUID>;
1316
+ state: z.ZodLiteral<"refused">;
1268
1317
  reason: z.ZodEnum<{
1269
1318
  busy: "busy";
1270
1319
  approval_pending: "approval_pending";
1271
- budget: "budget";
1320
+ conflict: "conflict";
1272
1321
  rate_limited: "rate_limited";
1322
+ budget: "budget";
1323
+ full: "full";
1324
+ not_waiting: "not_waiting";
1273
1325
  }>;
1274
- threadId: z.ZodNullable<z.ZodUUID>;
1275
1326
  }, z.core.$strip>,
1276
1327
  z.ZodObject<{
1277
- firingId: z.ZodUUID;
1278
- outcome: z.ZodLiteral<"rejected">;
1279
- issues: z.ZodArray<z.ZodObject<{
1280
- path: z.ZodString;
1281
- message: z.ZodString;
1282
- }, z.core.$strip>>;
1328
+ inputId: z.ZodUUID;
1329
+ state: z.ZodLiteral<"cancelled">;
1330
+ reason: z.ZodEnum<{
1331
+ stopped: "stopped";
1332
+ }>;
1283
1333
  }, z.core.$strip>
1284
- ], "outcome">;
1285
- export type TriggerFiringResponse = z.infer<typeof triggerFiringResponseSchema>;
1286
- declare const triggerFiringAnswerSchema: z.ZodObject<{
1287
- toolCallId: z.ZodString;
1288
- approved: z.ZodBoolean;
1289
- }, z.core.$strip>;
1290
- export type TriggerFiringAnswer = z.infer<typeof triggerFiringAnswerSchema>;
1291
- declare const triggerFiringRecordSchema: z.ZodObject<{
1334
+ ], "state">;
1335
+ export type InputReceipt = z.infer<typeof inputReceiptSchema>;
1336
+ declare const runRecordSchema: z.ZodObject<{
1292
1337
  id: z.ZodUUID;
1293
- triggerName: z.ZodString;
1294
1338
  threadId: z.ZodNullable<z.ZodUUID>;
1295
- runId: z.ZodNullable<z.ZodString>;
1296
- outcome: z.ZodEnum<{
1339
+ inputId: z.ZodNullable<z.ZodUUID>;
1340
+ kind: z.ZodEnum<{
1341
+ turn: "turn";
1342
+ subagent: "subagent";
1343
+ tool: "tool";
1344
+ }>;
1345
+ subagentRunId: z.ZodNullable<z.ZodString>;
1346
+ status: z.ZodEnum<{
1297
1347
  completed: "completed";
1348
+ cancelled: "cancelled";
1298
1349
  failed: "failed";
1299
- dropped: "dropped";
1300
- started: "started";
1301
- awaiting_approval: "awaiting_approval";
1302
- rejected: "rejected";
1350
+ running: "running";
1351
+ waiting: "waiting";
1303
1352
  }>;
1304
1353
  reason: z.ZodNullable<z.ZodEnum<{
1305
- busy: "busy";
1306
- approval_pending: "approval_pending";
1307
- budget: "budget";
1308
- rate_limited: "rate_limited";
1309
- invalid_payload: "invalid_payload";
1310
- missing_thread_key: "missing_thread_key";
1311
- no_turn: "no_turn";
1354
+ timeout: "timeout";
1355
+ cancelled: "cancelled";
1312
1356
  no_output: "no_output";
1313
1357
  invalid_output: "invalid_output";
1358
+ stopped: "stopped";
1359
+ parent_cancelled: "parent_cancelled";
1360
+ lost: "lost";
1314
1361
  }>>;
1315
- output: z.ZodUnknown;
1316
- approvals: z.ZodArray<z.ZodObject<{
1362
+ result: z.ZodUnknown;
1363
+ waits: z.ZodArray<z.ZodObject<{
1364
+ kind: z.ZodEnum<{
1365
+ approval: "approval";
1366
+ client_tool: "client_tool";
1367
+ }>;
1317
1368
  toolCallId: z.ZodString;
1318
1369
  toolName: z.ZodString;
1319
1370
  input: z.ZodUnknown;
@@ -1321,131 +1372,233 @@ declare const triggerFiringRecordSchema: z.ZodObject<{
1321
1372
  createdAt: z.ZodISODateTime;
1322
1373
  finishedAt: z.ZodNullable<z.ZodISODateTime>;
1323
1374
  }, z.core.$strip>;
1324
- export type TriggerFiringRecord = z.infer<typeof triggerFiringRecordSchema>;
1375
+ export type RunRecord = z.infer<typeof runRecordSchema>;
1376
+ declare const runAnswerSchema: z.ZodObject<{
1377
+ toolCallId: z.ZodString;
1378
+ approved: z.ZodBoolean;
1379
+ }, z.core.$strip>;
1380
+ export type RunAnswer = z.infer<typeof runAnswerSchema>;
1381
+ declare const MESSAGE_BUSY: readonly [
1382
+ "queue",
1383
+ "steer"
1384
+ ];
1385
+ export type MessageBusy = (typeof MESSAGE_BUSY)[number];
1386
+ declare const fireAnswerSchema: z.ZodUnion<readonly [
1387
+ z.ZodObject<{
1388
+ inputId: z.ZodUUID;
1389
+ state: z.ZodLiteral<"started">;
1390
+ runId: z.ZodUUID;
1391
+ threadId: z.ZodUUID;
1392
+ }, z.core.$strip>,
1393
+ z.ZodObject<{
1394
+ state: z.ZodLiteral<"rejected">;
1395
+ issues: z.ZodArray<z.ZodObject<{
1396
+ path: z.ZodString;
1397
+ message: z.ZodString;
1398
+ }, z.core.$strip>>;
1399
+ }, z.core.$strip>,
1400
+ z.ZodDiscriminatedUnion<[
1401
+ z.ZodObject<{
1402
+ inputId: z.ZodUUID;
1403
+ state: z.ZodLiteral<"waiting">;
1404
+ delivery: z.ZodEnum<{
1405
+ prompt: "prompt";
1406
+ steer: "steer";
1407
+ followUp: "followUp";
1408
+ answer: "answer";
1409
+ note: "note";
1410
+ }>;
1411
+ }, z.core.$strip>,
1412
+ z.ZodObject<{
1413
+ inputId: z.ZodNullable<z.ZodUUID>;
1414
+ state: z.ZodLiteral<"refused">;
1415
+ reason: z.ZodEnum<{
1416
+ busy: "busy";
1417
+ approval_pending: "approval_pending";
1418
+ conflict: "conflict";
1419
+ rate_limited: "rate_limited";
1420
+ budget: "budget";
1421
+ full: "full";
1422
+ not_waiting: "not_waiting";
1423
+ }>;
1424
+ }, z.core.$strip>,
1425
+ z.ZodObject<{
1426
+ inputId: z.ZodUUID;
1427
+ state: z.ZodLiteral<"cancelled">;
1428
+ reason: z.ZodEnum<{
1429
+ stopped: "stopped";
1430
+ }>;
1431
+ }, z.core.$strip>
1432
+ ], "state">,
1433
+ z.ZodObject<{
1434
+ id: z.ZodUUID;
1435
+ threadId: z.ZodNullable<z.ZodUUID>;
1436
+ inputId: z.ZodNullable<z.ZodUUID>;
1437
+ kind: z.ZodEnum<{
1438
+ turn: "turn";
1439
+ subagent: "subagent";
1440
+ tool: "tool";
1441
+ }>;
1442
+ subagentRunId: z.ZodNullable<z.ZodString>;
1443
+ status: z.ZodEnum<{
1444
+ completed: "completed";
1445
+ cancelled: "cancelled";
1446
+ failed: "failed";
1447
+ running: "running";
1448
+ waiting: "waiting";
1449
+ }>;
1450
+ reason: z.ZodNullable<z.ZodEnum<{
1451
+ timeout: "timeout";
1452
+ cancelled: "cancelled";
1453
+ no_output: "no_output";
1454
+ invalid_output: "invalid_output";
1455
+ stopped: "stopped";
1456
+ parent_cancelled: "parent_cancelled";
1457
+ lost: "lost";
1458
+ }>>;
1459
+ result: z.ZodUnknown;
1460
+ waits: z.ZodArray<z.ZodObject<{
1461
+ kind: z.ZodEnum<{
1462
+ approval: "approval";
1463
+ client_tool: "client_tool";
1464
+ }>;
1465
+ toolCallId: z.ZodString;
1466
+ toolName: z.ZodString;
1467
+ input: z.ZodUnknown;
1468
+ }, z.core.$strip>>;
1469
+ createdAt: z.ZodISODateTime;
1470
+ finishedAt: z.ZodNullable<z.ZodISODateTime>;
1471
+ }, z.core.$strip>
1472
+ ]>;
1473
+ export type FireAnswer = z.infer<typeof fireAnswerSchema>;
1325
1474
  export type TriggerClientConfig = {
1326
1475
  /** The engine's public origin (`ENGINE_PUBLIC_URL`) as the caller reaches it. */
1327
1476
  url: string;
1328
1477
  /** The agent whose triggers are fired. */
1329
1478
  agent: string;
1330
- /** The value of the fire credential the caller's triggers share in Cortex: one secret for every trigger that names it. */
1479
+ /** The value of the fire credential shared by the caller's triggers. */
1331
1480
  secret?: string;
1332
- /** The secret of each trigger minted its own, by name; a non-blank one wins over `secret`. */
1481
+ /** Each trigger's own secret; a non-blank one wins over `secret`. */
1333
1482
  secrets?: Record<string, string>;
1334
- /** Defaults to the global fetch; a test hands in its own. */
1483
+ /** Defaults to the global fetch. */
1335
1484
  fetch?: typeof globalThis.fetch;
1336
1485
  };
1337
- /** Cortex answered a firing or a read with something other than a firing: a status outside 2xx, 409 and 422, or a body that is not one. */
1486
+ /** An HTTP error or a response that does not match the endpoint's contract. */
1338
1487
  export declare class TriggerClientError extends Error {
1339
1488
  readonly status: number;
1340
1489
  readonly body: string;
1341
1490
  constructor(status: number, body: string);
1342
1491
  }
1343
- /** Whether a firing is running: a later read tells how it ended. */
1344
- export declare function isFiringRunning(firing: Pick<TriggerFiringResponse | TriggerFiringRecord, "outcome">): boolean;
1492
+ export type WaitOptions = {
1493
+ wait?: number;
1494
+ signal?: AbortSignal;
1495
+ };
1345
1496
  export declare function createTriggerClient(config: TriggerClientConfig): {
1346
- /** Fires the trigger; with `wait` (ms) the answer is the outcome when the run ends inside it. */
1347
- fire(trigger: string, payload: unknown, options?: {
1348
- wait?: number;
1349
- signal?: AbortSignal;
1497
+ /**
1498
+ * Fires a trigger. Narrow the result by `state`, or by `status` for a
1499
+ * run record. `busy` picks where it goes while a run holds its
1500
+ * thread, within the trigger's busy rule: `steer` or `queue`.
1501
+ */
1502
+ fire(trigger: string, payload: unknown, options?: WaitOptions & {
1503
+ idempotencyKey?: string;
1504
+ busy?: MessageBusy;
1350
1505
  }): Promise<{
1351
- firingId: string;
1352
- outcome: "started";
1353
- threadId: string;
1354
- runId: string;
1506
+ inputId: string;
1507
+ state: "waiting";
1508
+ delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
1355
1509
  } | {
1356
- firingId: string;
1357
- outcome: "awaiting_approval";
1358
- threadId: string;
1359
- runId: string;
1360
- approvals: {
1510
+ inputId: string | null;
1511
+ state: "refused";
1512
+ reason: "busy" | "approval_pending" | "conflict" | "rate_limited" | "budget" | "full" | "not_waiting";
1513
+ } | {
1514
+ inputId: string;
1515
+ state: "cancelled";
1516
+ reason: "stopped";
1517
+ } | {
1518
+ id: string;
1519
+ threadId: string | null;
1520
+ inputId: string | null;
1521
+ kind: "turn" | "subagent" | "tool";
1522
+ subagentRunId: string | null;
1523
+ status: "completed" | "cancelled" | "failed" | "running" | "waiting";
1524
+ reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
1525
+ result: unknown;
1526
+ waits: {
1527
+ kind: "approval" | "client_tool";
1361
1528
  toolCallId: string;
1362
1529
  toolName: string;
1363
1530
  input: unknown;
1364
1531
  }[];
1532
+ createdAt: string;
1533
+ finishedAt: string | null;
1365
1534
  } | {
1366
- firingId: string;
1367
- outcome: "completed";
1368
- threadId: string;
1535
+ inputId: string;
1536
+ state: "started";
1369
1537
  runId: string;
1370
- output: unknown;
1371
- } | {
1372
- firingId: string;
1373
- outcome: "failed";
1374
1538
  threadId: string;
1375
- runId: string;
1376
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
1377
1539
  } | {
1378
- firingId: string;
1379
- outcome: "dropped";
1380
- reason: "busy" | "approval_pending" | "budget" | "rate_limited";
1381
- threadId: string | null;
1382
- } | {
1383
- firingId: string;
1384
- outcome: "rejected";
1540
+ state: "rejected";
1385
1541
  issues: {
1386
1542
  path: string;
1387
1543
  message: string;
1388
1544
  }[];
1389
1545
  }>;
1390
- /**
1391
- * Decides one call an `awaiting_approval` firing parked on; the run
1392
- * resumes and `wait` holds for how it ends, as a fire does.
1393
- */
1394
- answer(trigger: string, firingId: string, decision: TriggerFiringAnswer, options?: {
1395
- wait?: number;
1396
- signal?: AbortSignal;
1397
- }): Promise<{
1398
- firingId: string;
1399
- outcome: "started";
1400
- threadId: string;
1401
- runId: string;
1546
+ /** Decides one call a waiting run parked on, using its trigger's secret; answered as a fire is. */
1547
+ answer(trigger: string, runId: string, decision: RunAnswer, options?: WaitOptions): Promise<{
1548
+ inputId: string;
1549
+ state: "waiting";
1550
+ delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
1402
1551
  } | {
1403
- firingId: string;
1404
- outcome: "awaiting_approval";
1405
- threadId: string;
1406
- runId: string;
1407
- approvals: {
1552
+ inputId: string | null;
1553
+ state: "refused";
1554
+ reason: "busy" | "approval_pending" | "conflict" | "rate_limited" | "budget" | "full" | "not_waiting";
1555
+ } | {
1556
+ inputId: string;
1557
+ state: "cancelled";
1558
+ reason: "stopped";
1559
+ } | {
1560
+ id: string;
1561
+ threadId: string | null;
1562
+ inputId: string | null;
1563
+ kind: "turn" | "subagent" | "tool";
1564
+ subagentRunId: string | null;
1565
+ status: "completed" | "cancelled" | "failed" | "running" | "waiting";
1566
+ reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
1567
+ result: unknown;
1568
+ waits: {
1569
+ kind: "approval" | "client_tool";
1408
1570
  toolCallId: string;
1409
1571
  toolName: string;
1410
1572
  input: unknown;
1411
1573
  }[];
1574
+ createdAt: string;
1575
+ finishedAt: string | null;
1412
1576
  } | {
1413
- firingId: string;
1414
- outcome: "completed";
1415
- threadId: string;
1577
+ inputId: string;
1578
+ state: "started";
1416
1579
  runId: string;
1417
- output: unknown;
1418
- } | {
1419
- firingId: string;
1420
- outcome: "failed";
1421
1580
  threadId: string;
1422
- runId: string;
1423
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
1424
1581
  } | {
1425
- firingId: string;
1426
- outcome: "dropped";
1427
- reason: "busy" | "approval_pending" | "budget" | "rate_limited";
1428
- threadId: string | null;
1429
- } | {
1430
- firingId: string;
1431
- outcome: "rejected";
1582
+ state: "rejected";
1432
1583
  issues: {
1433
1584
  path: string;
1434
1585
  message: string;
1435
1586
  }[];
1436
1587
  }>;
1437
- /** Reads one firing back, the record a fire's `firingId` names; a parked one lists the calls it waits on. */
1438
- read(trigger: string, firingId: string, options?: {
1588
+ /** Reads a run, including the calls it waits on. */
1589
+ read(trigger: string, runId: string, options?: {
1439
1590
  signal?: AbortSignal;
1440
1591
  }): Promise<{
1441
1592
  id: string;
1442
- triggerName: string;
1443
1593
  threadId: string | null;
1444
- runId: string | null;
1445
- outcome: "completed" | "failed" | "dropped" | "started" | "awaiting_approval" | "rejected";
1446
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
1447
- output: unknown;
1448
- approvals: {
1594
+ inputId: string | null;
1595
+ kind: "turn" | "subagent" | "tool";
1596
+ subagentRunId: string | null;
1597
+ status: "completed" | "cancelled" | "failed" | "running" | "waiting";
1598
+ reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
1599
+ result: unknown;
1600
+ waits: {
1601
+ kind: "approval" | "client_tool";
1449
1602
  toolCallId: string;
1450
1603
  toolName: string;
1451
1604
  input: unknown;
@@ -1453,6 +1606,37 @@ export declare function createTriggerClient(config: TriggerClientConfig): {
1453
1606
  createdAt: string;
1454
1607
  finishedAt: string | null;
1455
1608
  }>;
1609
+ /** Lists a trigger's runs newest first. `before` is `<createdAt ISO>,<run id>`. */
1610
+ list(trigger: string, options?: {
1611
+ limit?: number;
1612
+ before?: string;
1613
+ signal?: AbortSignal;
1614
+ }): Promise<{
1615
+ runs: {
1616
+ id: string;
1617
+ threadId: string | null;
1618
+ inputId: string | null;
1619
+ kind: "turn" | "subagent" | "tool";
1620
+ subagentRunId: string | null;
1621
+ status: "completed" | "cancelled" | "failed" | "running" | "waiting";
1622
+ reason: "timeout" | "cancelled" | "no_output" | "invalid_output" | "stopped" | "parent_cancelled" | "lost" | null;
1623
+ result: unknown;
1624
+ waits: {
1625
+ kind: "approval" | "client_tool";
1626
+ toolCallId: string;
1627
+ toolName: string;
1628
+ input: unknown;
1629
+ }[];
1630
+ createdAt: string;
1631
+ finishedAt: string | null;
1632
+ }[];
1633
+ }>;
1634
+ /** Cancels a run, using its trigger's secret. */
1635
+ cancel(trigger: string, runId: string, options?: {
1636
+ signal?: AbortSignal;
1637
+ }): Promise<{
1638
+ cancelled: boolean;
1639
+ }>;
1456
1640
  };
1457
1641
  export type ManifestsPreviewSchema0 = {
1458
1642
  type: "string" | "number" | "integer" | "boolean" | "object" | "array" | [
@@ -1676,7 +1860,7 @@ export type ManagementProcedures = {
1676
1860
  updatedAt: string;
1677
1861
  };
1678
1862
  };
1679
- /** Create an agent on a registered server, or on none (`serverId` null), fixed for good either way. An agent with no server has no native tools, no server variables and no server auth, and publishes only on a chat model of its own. The draft has no prompt yet; save one with agents.savePrompt before publishing. */
1863
+ /** Create an agent on a registered server, or on none (`serverId` null), fixed for good either way. An agent with no server has no native tools, no server variables and no server auth, and publishes only on a chat model of its own. The draft has no prompt yet; save one with agents.savePrompt before publishing. Refused as `agent_limit_reached` once the license's agent count is reached. */
1680
1864
  "agents.create": {
1681
1865
  input: {
1682
1866
  /** A name: lowercase letters, digits, and single hyphens. */
@@ -1695,12 +1879,15 @@ export type ManagementProcedures = {
1695
1879
  displayName: Partial<Record<"en" | "ar", string>>;
1696
1880
  promptDraft: string;
1697
1881
  ragEnabled: boolean;
1882
+ subagentsEnabled: boolean;
1883
+ checkBacksEnabled: boolean;
1698
1884
  toolRegistryEnabled: boolean;
1699
1885
  serviceRegistryEnabled: boolean;
1700
1886
  attachmentsEnabled: boolean;
1701
1887
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
1702
1888
  locationPicker: boolean;
1703
- messageTrigger: boolean;
1889
+ messages: boolean;
1890
+ whileBusy: "refuse" | "queue" | "steer";
1704
1891
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
1705
1892
  suggestions: Record<"en" | "ar", Array<{
1706
1893
  title: string;
@@ -1740,12 +1927,15 @@ export type ManagementProcedures = {
1740
1927
  displayName: Partial<Record<"en" | "ar", string>>;
1741
1928
  promptDraft: string;
1742
1929
  ragEnabled: boolean;
1930
+ subagentsEnabled: boolean;
1931
+ checkBacksEnabled: boolean;
1743
1932
  toolRegistryEnabled: boolean;
1744
1933
  serviceRegistryEnabled: boolean;
1745
1934
  attachmentsEnabled: boolean;
1746
1935
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
1747
1936
  locationPicker: boolean;
1748
- messageTrigger: boolean;
1937
+ messages: boolean;
1938
+ whileBusy: "refuse" | "queue" | "steer";
1749
1939
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
1750
1940
  suggestions: Record<"en" | "ar", Array<{
1751
1941
  title: string;
@@ -1797,12 +1987,15 @@ export type ManagementProcedures = {
1797
1987
  displayName: Partial<Record<"en" | "ar", string>>;
1798
1988
  promptDraft: string;
1799
1989
  ragEnabled: boolean;
1990
+ subagentsEnabled: boolean;
1991
+ checkBacksEnabled: boolean;
1800
1992
  toolRegistryEnabled: boolean;
1801
1993
  serviceRegistryEnabled: boolean;
1802
1994
  attachmentsEnabled: boolean;
1803
1995
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
1804
1996
  locationPicker: boolean;
1805
- messageTrigger: boolean;
1997
+ messages: boolean;
1998
+ whileBusy: "refuse" | "queue" | "steer";
1806
1999
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
1807
2000
  suggestions: Record<"en" | "ar", Array<{
1808
2001
  title: string;
@@ -1963,12 +2156,15 @@ export type ManagementProcedures = {
1963
2156
  displayName: Partial<Record<"en" | "ar", string>>;
1964
2157
  promptDraft: string;
1965
2158
  ragEnabled: boolean;
2159
+ subagentsEnabled: boolean;
2160
+ checkBacksEnabled: boolean;
1966
2161
  toolRegistryEnabled: boolean;
1967
2162
  serviceRegistryEnabled: boolean;
1968
2163
  attachmentsEnabled: boolean;
1969
2164
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
1970
2165
  locationPicker: boolean;
1971
- messageTrigger: boolean;
2166
+ messages: boolean;
2167
+ whileBusy: "refuse" | "queue" | "steer";
1972
2168
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
1973
2169
  suggestions: Record<"en" | "ar", Array<{
1974
2170
  title: string;
@@ -1997,11 +2193,14 @@ export type ManagementProcedures = {
1997
2193
  ragEnabled?: boolean;
1998
2194
  toolRegistryEnabled?: boolean;
1999
2195
  serviceRegistryEnabled?: boolean;
2196
+ subagentsEnabled?: boolean;
2197
+ checkBacksEnabled?: boolean;
2000
2198
  attachmentsEnabled?: boolean;
2001
2199
  fetchImageHostnames?: Array<string>;
2002
2200
  locationPicker?: boolean;
2003
2201
  media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
2004
- messageTrigger?: boolean;
2202
+ messages?: boolean;
2203
+ whileBusy?: "refuse" | "queue" | "steer";
2005
2204
  defaultLocale?: "en" | "ar";
2006
2205
  context?: {
2007
2206
  maxContextTokens: number;
@@ -2073,12 +2272,15 @@ export type ManagementProcedures = {
2073
2272
  displayName: Partial<Record<"en" | "ar", string>>;
2074
2273
  promptDraft: string;
2075
2274
  ragEnabled: boolean;
2275
+ subagentsEnabled: boolean;
2276
+ checkBacksEnabled: boolean;
2076
2277
  toolRegistryEnabled: boolean;
2077
2278
  serviceRegistryEnabled: boolean;
2078
2279
  attachmentsEnabled: boolean;
2079
2280
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
2080
2281
  locationPicker: boolean;
2081
- messageTrigger: boolean;
2282
+ messages: boolean;
2283
+ whileBusy: "refuse" | "queue" | "steer";
2082
2284
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
2083
2285
  suggestions: Record<"en" | "ar", Array<{
2084
2286
  title: string;
@@ -2118,12 +2320,15 @@ export type ManagementProcedures = {
2118
2320
  displayName: Partial<Record<"en" | "ar", string>>;
2119
2321
  promptDraft: string;
2120
2322
  ragEnabled: boolean;
2323
+ subagentsEnabled: boolean;
2324
+ checkBacksEnabled: boolean;
2121
2325
  toolRegistryEnabled: boolean;
2122
2326
  serviceRegistryEnabled: boolean;
2123
2327
  attachmentsEnabled: boolean;
2124
2328
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
2125
2329
  locationPicker: boolean;
2126
- messageTrigger: boolean;
2330
+ messages: boolean;
2331
+ whileBusy: "refuse" | "queue" | "steer";
2127
2332
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
2128
2333
  suggestions: Record<"en" | "ar", Array<{
2129
2334
  title: string;
@@ -2753,7 +2958,7 @@ export type ManagementProcedures = {
2753
2958
  unchanged: boolean;
2754
2959
  };
2755
2960
  };
2756
- /** Change which agents a dataset host reaches: every agent, one server's, or a list. Refused while a reader it would lose still references it. Reaching new agents needs `secrets:write` too while it forwards the run token (`secret_binding_forbidden`): in a firing that token is the trigger's stored credential. */
2961
+ /** Change which agents a dataset host reaches: every agent, one server's, or a list. Refused while a reader it would lose still references it. Reaching new agents needs `secrets:write` too while it forwards the run token (`secret_binding_forbidden`): in a trigger run that token is the trigger's stored credential. */
2757
2962
  "datasetHosts.setAudience": {
2758
2963
  input: {
2759
2964
  id: string;
@@ -3095,11 +3300,14 @@ export type ManagementProcedures = {
3095
3300
  ragEnabled?: boolean;
3096
3301
  toolRegistryEnabled?: boolean;
3097
3302
  serviceRegistryEnabled?: boolean;
3303
+ subagentsEnabled?: boolean;
3304
+ checkBacksEnabled?: boolean;
3098
3305
  attachmentsEnabled?: boolean;
3099
3306
  fetchImageHostnames?: Array<string>;
3100
3307
  locationPicker?: boolean;
3101
3308
  media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
3102
- messageTrigger?: boolean;
3309
+ messages?: boolean;
3310
+ whileBusy?: "refuse" | "queue" | "steer";
3103
3311
  defaultLocale?: "en" | "ar";
3104
3312
  context?: {
3105
3313
  maxContextTokens?: number;
@@ -3421,13 +3629,18 @@ export type ManagementProcedures = {
3421
3629
  threadPolicy?: {
3422
3630
  policy: "single";
3423
3631
  } | {
3424
- policy: "per-firing";
3632
+ policy: "per-input";
3425
3633
  } | {
3426
3634
  policy: "ephemeral";
3427
3635
  } | {
3428
3636
  policy: "keyed";
3429
3637
  key: string;
3638
+ } | {
3639
+ policy: "thread";
3640
+ key: string;
3641
+ wake: boolean;
3430
3642
  };
3643
+ whileBusy?: "refuse" | "queue" | "steer";
3431
3644
  budgetPerDay?: number;
3432
3645
  disableAfterFailures?: number;
3433
3646
  credential?: string;
@@ -3437,12 +3650,16 @@ export type ManagementProcedures = {
3437
3650
  model: string;
3438
3651
  effort?: string;
3439
3652
  };
3653
+ schedule?: {
3654
+ cron: string;
3655
+ timeZone: string;
3656
+ };
3440
3657
  audience: "all" | {
3441
3658
  server: string;
3442
3659
  } | {
3443
3660
  agents: Array<string>;
3444
3661
  };
3445
- overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "budgetPerDay" | "disableAfterFailures" | "model">;
3662
+ overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "whileBusy" | "budgetPerDay" | "disableAfterFailures" | "model" | "schedule">;
3446
3663
  }>;
3447
3664
  datasetHosts?: Array<{
3448
3665
  name: string;
@@ -3520,7 +3737,7 @@ export type ManagementProcedures = {
3520
3737
  name: string;
3521
3738
  displayName?: Partial<Record<"en" | "ar", string>>;
3522
3739
  description?: string;
3523
- event: "approval_requested";
3740
+ event: "run_waiting" | "run_finished";
3524
3741
  url: string;
3525
3742
  headers?: Array<{
3526
3743
  header: string;
@@ -3635,11 +3852,14 @@ export type ManagementProcedures = {
3635
3852
  ragEnabled?: boolean;
3636
3853
  toolRegistryEnabled?: boolean;
3637
3854
  serviceRegistryEnabled?: boolean;
3855
+ subagentsEnabled?: boolean;
3856
+ checkBacksEnabled?: boolean;
3638
3857
  attachmentsEnabled?: boolean;
3639
3858
  fetchImageHostnames?: Array<string>;
3640
3859
  locationPicker?: boolean;
3641
3860
  media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
3642
- messageTrigger?: boolean;
3861
+ messages?: boolean;
3862
+ whileBusy?: "refuse" | "queue" | "steer";
3643
3863
  defaultLocale?: "en" | "ar";
3644
3864
  context?: {
3645
3865
  maxContextTokens?: number;
@@ -3961,13 +4181,18 @@ export type ManagementProcedures = {
3961
4181
  threadPolicy?: {
3962
4182
  policy: "single";
3963
4183
  } | {
3964
- policy: "per-firing";
4184
+ policy: "per-input";
3965
4185
  } | {
3966
4186
  policy: "ephemeral";
3967
4187
  } | {
3968
4188
  policy: "keyed";
3969
4189
  key: string;
4190
+ } | {
4191
+ policy: "thread";
4192
+ key: string;
4193
+ wake: boolean;
3970
4194
  };
4195
+ whileBusy?: "refuse" | "queue" | "steer";
3971
4196
  budgetPerDay?: number;
3972
4197
  disableAfterFailures?: number;
3973
4198
  credential?: string;
@@ -3977,12 +4202,16 @@ export type ManagementProcedures = {
3977
4202
  model: string;
3978
4203
  effort?: string;
3979
4204
  };
4205
+ schedule?: {
4206
+ cron: string;
4207
+ timeZone: string;
4208
+ };
3980
4209
  audience: "all" | {
3981
4210
  server: string;
3982
4211
  } | {
3983
4212
  agents: Array<string>;
3984
4213
  };
3985
- overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "budgetPerDay" | "disableAfterFailures" | "model">;
4214
+ overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "whileBusy" | "budgetPerDay" | "disableAfterFailures" | "model" | "schedule">;
3986
4215
  }>;
3987
4216
  datasetHosts?: Array<{
3988
4217
  name: string;
@@ -4060,7 +4289,7 @@ export type ManagementProcedures = {
4060
4289
  name: string;
4061
4290
  displayName?: Partial<Record<"en" | "ar", string>>;
4062
4291
  description?: string;
4063
- event: "approval_requested";
4292
+ event: "run_waiting" | "run_finished";
4064
4293
  url: string;
4065
4294
  headers?: Array<{
4066
4295
  header: string;
@@ -4332,7 +4561,7 @@ export type ManagementProcedures = {
4332
4561
  unchanged: boolean;
4333
4562
  };
4334
4563
  };
4335
- /** Change which agents an MCP server reaches: every agent, one server's, or a list. Reaching new agents needs `secrets:write` too while it forwards the run token (`secret_binding_forbidden`): in a firing that token is the trigger's stored credential. */
4564
+ /** Change which agents an MCP server reaches: every agent, one server's, or a list. Reaching new agents needs `secrets:write` too while it forwards the run token (`secret_binding_forbidden`): in a trigger run that token is the trigger's stored credential. */
4336
4565
  "mcpServers.setAudience": {
4337
4566
  input: {
4338
4567
  id: string;
@@ -4559,6 +4788,7 @@ export type ManagementProcedures = {
4559
4788
  displayName: Partial<Record<"en" | "ar", string>>;
4560
4789
  };
4561
4790
  triggerName: string | null;
4791
+ delegated: "queued" | "run" | "schedule" | "trigger" | null;
4562
4792
  threadId: string | null;
4563
4793
  threadTitle: string | null;
4564
4794
  input: unknown;
@@ -4625,18 +4855,20 @@ export type ManagementProcedures = {
4625
4855
  }>;
4626
4856
  };
4627
4857
  };
4628
- /** One trigger firing by id with its outcome and output, and the tool calls it waits on when it awaits approval. */
4629
- "observability.getTriggerFiring": {
4858
+ /** One run by id with what it answered with, and the tool calls it waits on while it is waiting. */
4859
+ "observability.getRun": {
4630
4860
  input: {
4631
4861
  id: string;
4632
4862
  };
4633
4863
  output: {
4634
4864
  id: string;
4635
- triggerName: string;
4636
- threadId: string | null;
4637
- outcome: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
4638
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
4639
- output: unknown;
4865
+ kind: "turn" | "subagent" | "tool";
4866
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
4867
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
4868
+ createdAt: string;
4869
+ finishedAt: string | null;
4870
+ source: "user" | "trigger" | "schedule" | "run" | null;
4871
+ triggerName: string | null;
4640
4872
  server: {
4641
4873
  name: string;
4642
4874
  displayName: Partial<Record<"en" | "ar", string>>;
@@ -4645,17 +4877,15 @@ export type ManagementProcedures = {
4645
4877
  name: string;
4646
4878
  displayName: Partial<Record<"en" | "ar", string>>;
4647
4879
  };
4880
+ threadId: string | null;
4648
4881
  threadTitle: string | null;
4649
- createdAt: string;
4650
- finishedAt: string | null;
4651
- triggerId: string | null;
4652
- agentId: string;
4653
- approvals: Array<{
4882
+ result: unknown;
4883
+ waits: Array<{
4884
+ kind: "approval" | "client_tool";
4654
4885
  toolCallId: string;
4655
4886
  toolName: string;
4656
4887
  input: unknown;
4657
4888
  }>;
4658
- decider: "operator" | "chat" | "disabled";
4659
4889
  };
4660
4890
  };
4661
4891
  /** Token and message usage of the agents the caller may read: totals and per user, server, agent and day, optionally for one agent within a day range. */
@@ -4791,6 +5021,47 @@ export type ManagementProcedures = {
4791
5021
  filteredCount: number;
4792
5022
  };
4793
5023
  };
5024
+ /** Runs on your agents, chat and trigger alike, newest first, with how they ended and their thread, with pagination and agent, source, status, trigger name, open-wait kind, and day-range filters. */
5025
+ "observability.listRuns": {
5026
+ input: {
5027
+ pageIndex?: number;
5028
+ pageSize?: number;
5029
+ q?: string;
5030
+ agentId?: string;
5031
+ source?: "user" | "trigger" | "schedule" | "run";
5032
+ status?: "running" | "waiting" | "completed" | "failed" | "cancelled";
5033
+ triggerName?: string;
5034
+ waitKind?: "approval" | "client_tool";
5035
+ dateFrom?: string;
5036
+ dateTo?: string;
5037
+ };
5038
+ output: {
5039
+ items: Array<{
5040
+ id: string;
5041
+ kind: "turn" | "subagent" | "tool";
5042
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
5043
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
5044
+ createdAt: string;
5045
+ finishedAt: string | null;
5046
+ source: "user" | "trigger" | "schedule" | "run" | null;
5047
+ triggerName: string | null;
5048
+ server: {
5049
+ name: string;
5050
+ displayName: Partial<Record<"en" | "ar", string>>;
5051
+ } | null;
5052
+ agent: {
5053
+ name: string;
5054
+ displayName: Partial<Record<"en" | "ar", string>>;
5055
+ };
5056
+ threadId: string | null;
5057
+ threadTitle: string | null;
5058
+ }>;
5059
+ /** Every row the caller may see, ignoring the search and filters. */
5060
+ count: number;
5061
+ /** The rows matching the search and filters, over all pages: the total to report. */
5062
+ filteredCount: number;
5063
+ };
5064
+ };
4794
5065
  /** Upstream responses that do not match a tool's declared schema, with pagination. */
4795
5066
  "observability.listSchemaDrifts": {
4796
5067
  input: {
@@ -4912,44 +5183,6 @@ export type ManagementProcedures = {
4912
5183
  filteredCount: number;
4913
5184
  };
4914
5185
  };
4915
- /** Trigger firings with their outcome, with pagination and agent, trigger, outcome, and day-range filters. */
4916
- "observability.listTriggerFirings": {
4917
- input: {
4918
- pageIndex?: number;
4919
- pageSize?: number;
4920
- q?: string;
4921
- agentId?: string;
4922
- triggerName?: string;
4923
- outcome?: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
4924
- dateFrom?: string;
4925
- dateTo?: string;
4926
- };
4927
- output: {
4928
- items: Array<{
4929
- id: string;
4930
- triggerName: string;
4931
- threadId: string | null;
4932
- outcome: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
4933
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
4934
- output: unknown;
4935
- server: {
4936
- name: string;
4937
- displayName: Partial<Record<"en" | "ar", string>>;
4938
- } | null;
4939
- agent: {
4940
- name: string;
4941
- displayName: Partial<Record<"en" | "ar", string>>;
4942
- };
4943
- threadTitle: string | null;
4944
- createdAt: string;
4945
- finishedAt: string | null;
4946
- }>;
4947
- /** Every row the caller may see, ignoring the search and filters. */
4948
- count: number;
4949
- /** The rows matching the search and filters, over all pages: the total to report. */
4950
- filteredCount: number;
4951
- };
4952
- };
4953
5186
  /** Ids of tools whose recent executions exceed the failure threshold. */
4954
5187
  "observability.unhealthyToolIds": {
4955
5188
  input: undefined;
@@ -5221,7 +5454,8 @@ export type ManagementProcedures = {
5221
5454
  requiresApproval?: boolean;
5222
5455
  }>;
5223
5456
  verify: boolean;
5224
- events: Array<"approval_requested">;
5457
+ delegation: boolean;
5458
+ events: Array<"run_waiting" | "run_finished">;
5225
5459
  } | null;
5226
5460
  syncedAt: string | null;
5227
5461
  syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
@@ -5267,7 +5501,8 @@ export type ManagementProcedures = {
5267
5501
  requiresApproval?: boolean;
5268
5502
  }>;
5269
5503
  verify: boolean;
5270
- events: Array<"approval_requested">;
5504
+ delegation: boolean;
5505
+ events: Array<"run_waiting" | "run_finished">;
5271
5506
  } | null;
5272
5507
  syncedAt: string | null;
5273
5508
  syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
@@ -5300,6 +5535,7 @@ export type ManagementProcedures = {
5300
5535
  syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
5301
5536
  createdAt: string;
5302
5537
  threadCount: number;
5538
+ delegation: boolean;
5303
5539
  modelProvider: string | null;
5304
5540
  modelName: string | null;
5305
5541
  modelEffort: string | null;
@@ -5407,7 +5643,8 @@ export type ManagementProcedures = {
5407
5643
  requiresApproval?: boolean;
5408
5644
  }>;
5409
5645
  verify: boolean;
5410
- events: Array<"approval_requested">;
5646
+ delegation: boolean;
5647
+ events: Array<"run_waiting" | "run_finished">;
5411
5648
  } | null;
5412
5649
  syncedAt: string | null;
5413
5650
  syncError: "egress_blocked" | "timeout" | "upstream_failed" | "response_too_large" | "upstream_status" | "invalid_manifest" | "key_unavailable" | "name_taken" | "credential_in_name" | "variable_in_use" | "verify_in_use" | "still_referenced" | "unexpected" | null;
@@ -5935,7 +6172,7 @@ export type ManagementProcedures = {
5935
6172
  pageSize?: number;
5936
6173
  q?: string;
5937
6174
  serverId?: string;
5938
- agentName?: string;
6175
+ agentId?: string;
5939
6176
  userId?: string;
5940
6177
  dateFrom?: string;
5941
6178
  dateTo?: string;
@@ -6015,7 +6252,7 @@ export type ManagementProcedures = {
6015
6252
  output: {
6016
6253
  items: Array<{
6017
6254
  id: string;
6018
- role: "system" | "user" | "assistant" | "trigger";
6255
+ role: "system" | "user" | "assistant" | "event";
6019
6256
  text: string | null;
6020
6257
  content: Record<string, unknown>;
6021
6258
  ordinal: number;
@@ -6604,7 +6841,7 @@ export type ManagementProcedures = {
6604
6841
  unchanged: boolean;
6605
6842
  };
6606
6843
  };
6607
- /** Change which agents a tool reaches: every agent, one server's, or a list. Refused while a reader it would lose still references it, or while a new reader could not reach what it references, fill the variables it reads, or fit it in its pin budget. Reaching new agents needs `secrets:write` too while it forwards the run token (`secret_binding_forbidden`): in a firing that token is the trigger's stored credential. */
6844
+ /** Change which agents a tool reaches: every agent, one server's, or a list. Refused while a reader it would lose still references it, or while a new reader could not reach what it references, fill the variables it reads, or fit it in its pin budget. Reaching new agents needs `secrets:write` too while it forwards the run token (`secret_binding_forbidden`): in a trigger run that token is the trigger's stored credential. */
6608
6845
  "tools.setAudience": {
6609
6846
  input: {
6610
6847
  id: string;
@@ -6736,67 +6973,64 @@ export type ManagementProcedures = {
6736
6973
  name: string;
6737
6974
  };
6738
6975
  };
6739
- /** Approve or deny a tool call a firing parked on; the run resumes and the outcome comes back. Refused as `not_published` while the firing's trigger is disabled. */
6740
- "triggers.answerFiring": {
6976
+ /** Approve or deny a tool call a trigger's run waits on; the run resumes and comes back as a fire's does. Refused as `not_parked` when the run no longer waits on that call. */
6977
+ "triggers.answerRun": {
6741
6978
  input: {
6742
- id: string;
6743
- agentId?: string;
6744
- firingId: string;
6979
+ runId: string;
6745
6980
  toolCallId: string;
6746
6981
  approved: boolean;
6747
6982
  };
6748
6983
  output: {
6749
- status: number;
6750
- firingId: string;
6751
- outcome: "started";
6752
- threadId: string;
6984
+ inputId: string;
6985
+ state: "started";
6753
6986
  runId: string;
6754
- } | {
6755
- status: number;
6756
- firingId: string;
6757
- outcome: "awaiting_approval";
6758
6987
  threadId: string;
6759
- runId: string;
6760
- approvals: Array<{
6761
- toolCallId: string;
6762
- toolName: string;
6763
- input: unknown;
6988
+ } | {
6989
+ state: "rejected";
6990
+ issues: Array<{
6991
+ path: string;
6992
+ message: string;
6764
6993
  }>;
6765
6994
  } | {
6766
- status: number;
6767
- firingId: string;
6768
- outcome: "completed";
6769
- threadId: string;
6770
- runId: string;
6771
- output: unknown;
6995
+ inputId: string;
6996
+ state: "waiting";
6997
+ delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
6772
6998
  } | {
6773
- status: number;
6774
- firingId: string;
6775
- outcome: "failed";
6776
- threadId: string;
6777
- runId: string;
6778
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
6999
+ inputId: string | null;
7000
+ state: "refused";
7001
+ reason: "busy" | "approval_pending" | "conflict" | "rate_limited" | "budget" | "full" | "not_waiting";
6779
7002
  } | {
6780
- status: number;
6781
- firingId: string;
6782
- outcome: "dropped";
6783
- reason: "busy" | "approval_pending" | "budget" | "rate_limited";
6784
- threadId: string | null;
7003
+ inputId: string;
7004
+ state: "cancelled";
7005
+ reason: "stopped";
6785
7006
  } | {
6786
- status: number;
6787
- firingId: string;
6788
- outcome: "rejected";
6789
- issues: Array<{
6790
- path: string;
6791
- message: string;
7007
+ id: string;
7008
+ threadId: string | null;
7009
+ inputId: string | null;
7010
+ kind: "turn" | "subagent" | "tool";
7011
+ subagentRunId: string | null;
7012
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
7013
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
7014
+ result: unknown;
7015
+ waits: Array<{
7016
+ kind: "approval" | "client_tool";
7017
+ toolCallId: string;
7018
+ toolName: string;
7019
+ input: unknown;
6792
7020
  }>;
7021
+ createdAt: string;
7022
+ finishedAt: string | null;
6793
7023
  };
6794
7024
  };
6795
- /** Create a trigger (a named entry point external systems fire on an agent) with an audience ({ kind: "all" }, { kind: "server", serverId }, or { kind: "agents", agentIds }), fired on any agent in it. The draft has no instructions yet; fill them with update before publishing. */
7025
+ /** Create a trigger (a named entry point fired on an agent) with an audience ({ kind: "all" }, { kind: "server", serverId }, or { kind: "agents", agentIds }), fired on any agent in it. With a `schedule` ({ cron, timeZone }: a five-field cron and an IANA zone) Cortex fires it itself and it has no fire secret; null makes a webhook a caller fires with the secret answered once. Which of the two is fixed for good. The draft has no instructions yet; fill them with update before publishing. */
6796
7026
  "triggers.create": {
6797
7027
  input: {
6798
7028
  /** A name: lowercase letters, digits, and single hyphens. */
6799
7029
  name: string;
7030
+ schedule: {
7031
+ cron: string;
7032
+ timeZone: string;
7033
+ } | null;
6800
7034
  displayName: Partial<Record<"en" | "ar", string>>;
6801
7035
  audience: {
6802
7036
  kind: "all";
@@ -6811,7 +7045,7 @@ export type ManagementProcedures = {
6811
7045
  output: {
6812
7046
  id: string;
6813
7047
  name: string;
6814
- rawSecret: string;
7048
+ rawSecret: string | null;
6815
7049
  };
6816
7050
  };
6817
7051
  /** Delete a trigger. */
@@ -6823,7 +7057,7 @@ export type ManagementProcedures = {
6823
7057
  id: string;
6824
7058
  };
6825
7059
  };
6826
- /** Fire a trigger with a test payload on one of its agents and return the outcome. Refused as `not_published` while the trigger is not published or is disabled. */
7060
+ /** Fire a trigger with a test payload on one of its agents and return what became of it: its run once ended or waiting on a decision, the run it started when that outlasts the wait, its input while it waits on the thread or once refused, or the payload's issues. Refused as `not_published` while the trigger is not published or is disabled. */
6827
7061
  "triggers.fire": {
6828
7062
  input: {
6829
7063
  id: string;
@@ -6831,50 +7065,45 @@ export type ManagementProcedures = {
6831
7065
  payload: unknown;
6832
7066
  };
6833
7067
  output: {
6834
- status: number;
6835
- firingId: string;
6836
- outcome: "started";
6837
- threadId: string;
7068
+ inputId: string;
7069
+ state: "started";
6838
7070
  runId: string;
6839
- } | {
6840
- status: number;
6841
- firingId: string;
6842
- outcome: "awaiting_approval";
6843
7071
  threadId: string;
6844
- runId: string;
6845
- approvals: Array<{
6846
- toolCallId: string;
6847
- toolName: string;
6848
- input: unknown;
7072
+ } | {
7073
+ state: "rejected";
7074
+ issues: Array<{
7075
+ path: string;
7076
+ message: string;
6849
7077
  }>;
6850
7078
  } | {
6851
- status: number;
6852
- firingId: string;
6853
- outcome: "completed";
6854
- threadId: string;
6855
- runId: string;
6856
- output: unknown;
7079
+ inputId: string;
7080
+ state: "waiting";
7081
+ delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
6857
7082
  } | {
6858
- status: number;
6859
- firingId: string;
6860
- outcome: "failed";
6861
- threadId: string;
6862
- runId: string;
6863
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
7083
+ inputId: string | null;
7084
+ state: "refused";
7085
+ reason: "busy" | "approval_pending" | "conflict" | "rate_limited" | "budget" | "full" | "not_waiting";
6864
7086
  } | {
6865
- status: number;
6866
- firingId: string;
6867
- outcome: "dropped";
6868
- reason: "busy" | "approval_pending" | "budget" | "rate_limited";
6869
- threadId: string | null;
7087
+ inputId: string;
7088
+ state: "cancelled";
7089
+ reason: "stopped";
6870
7090
  } | {
6871
- status: number;
6872
- firingId: string;
6873
- outcome: "rejected";
6874
- issues: Array<{
6875
- path: string;
6876
- message: string;
7091
+ id: string;
7092
+ threadId: string | null;
7093
+ inputId: string | null;
7094
+ kind: "turn" | "subagent" | "tool";
7095
+ subagentRunId: string | null;
7096
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
7097
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
7098
+ result: unknown;
7099
+ waits: Array<{
7100
+ kind: "approval" | "client_tool";
7101
+ toolCallId: string;
7102
+ toolName: string;
7103
+ input: unknown;
6877
7104
  }>;
7105
+ createdAt: string;
7106
+ finishedAt: string | null;
6878
7107
  };
6879
7108
  };
6880
7109
  /** One trigger by id with its draft instructions and payload schema. */
@@ -6891,13 +7120,22 @@ export type ManagementProcedures = {
6891
7120
  threadPolicy: {
6892
7121
  policy: "single";
6893
7122
  } | {
6894
- policy: "per-firing";
7123
+ policy: "per-input";
6895
7124
  } | {
6896
7125
  policy: "ephemeral";
6897
7126
  } | {
6898
7127
  policy: "keyed";
6899
7128
  key: string;
7129
+ } | {
7130
+ policy: "thread";
7131
+ key: string;
7132
+ wake: boolean;
6900
7133
  };
7134
+ schedule: {
7135
+ cron: string;
7136
+ timeZone: string;
7137
+ } | null;
7138
+ whileBusy: "refuse" | "queue" | "steer";
6901
7139
  budgetPerDay: number | null;
6902
7140
  disableAfterFailures: number;
6903
7141
  secretPrefix: string;
@@ -6983,13 +7221,21 @@ export type ManagementProcedures = {
6983
7221
  threadPolicy: {
6984
7222
  policy: "single";
6985
7223
  } | {
6986
- policy: "per-firing";
7224
+ policy: "per-input";
6987
7225
  } | {
6988
7226
  policy: "ephemeral";
6989
7227
  } | {
6990
7228
  policy: "keyed";
6991
7229
  key: string;
7230
+ } | {
7231
+ policy: "thread";
7232
+ key: string;
7233
+ wake: boolean;
6992
7234
  };
7235
+ schedule: {
7236
+ cron: string;
7237
+ timeZone: string;
7238
+ } | null;
6993
7239
  status: "draft" | "published" | "disabled";
6994
7240
  secretPrefix: string;
6995
7241
  displayName: Partial<Record<"en" | "ar", string>>;
@@ -7098,7 +7344,7 @@ export type ManagementProcedures = {
7098
7344
  unchanged: boolean;
7099
7345
  };
7100
7346
  };
7101
- /** Update a trigger's draft. Saved as a draft; call the entity's publish procedure to make it live. `displayName`, `credentialName`, `fireCredentialName` and the model pick are the exceptions: they apply without a publish, the display name at once, the fire credential from the next firing and the others from each agent's next turn. Giving the run a different `credentialName` needs `secrets:write`, since tools forwarding the run token send its value upstream. The model pick (`modelProvider` with one of its `modelName`s and optionally a `modelEffort`, all null to run on each agent's own) is refused as `model_not_offered` when the provider does not list the model or the effort, or an effort is picked without a model. `fireCredentialName` names a static credential whose value callers present to fire, shared by every trigger naming it; that credential and its secret may serve nothing else. Clearing it leaves the trigger shut until `triggers.rotateSecret` mints a secret. */
7347
+ /** Update a trigger's draft. Saved as a draft; call the entity's publish procedure to make it live. `displayName`, `credentialName`, `fireCredentialName` and the model pick are the exceptions: they apply without a publish, the display name at once, the fire credential from the next fire and the others from each agent's next turn. Giving the run a different `credentialName` needs `secrets:write`, since tools forwarding the run token send its value upstream. The model pick (`modelProvider` with one of its `modelName`s and optionally a `modelEffort`, all null to run on each agent's own) is refused as `model_not_offered` when the provider does not list the model or the effort, or an effort is picked without a model. `fireCredentialName` names a static credential whose value callers present to fire, shared by every trigger naming it; that credential and its secret may serve nothing else. Clearing it leaves the trigger shut until `triggers.rotateSecret` mints a secret. */
7102
7348
  "triggers.update": {
7103
7349
  input: {
7104
7350
  description: string;
@@ -7108,13 +7354,22 @@ export type ManagementProcedures = {
7108
7354
  threadPolicy: {
7109
7355
  policy: "single";
7110
7356
  } | {
7111
- policy: "per-firing";
7357
+ policy: "per-input";
7112
7358
  } | {
7113
7359
  policy: "ephemeral";
7114
7360
  } | {
7115
7361
  policy: "keyed";
7116
7362
  key: string;
7363
+ } | {
7364
+ policy: "thread";
7365
+ key: string;
7366
+ wake: boolean;
7117
7367
  };
7368
+ schedule: {
7369
+ cron: string;
7370
+ timeZone: string;
7371
+ } | null;
7372
+ whileBusy: "refuse" | "queue" | "steer";
7118
7373
  budgetPerDay: number | null;
7119
7374
  disableAfterFailures: number;
7120
7375
  id: string;
@@ -7259,7 +7514,7 @@ export type ManagementProcedures = {
7259
7514
  name: string;
7260
7515
  displayName: Partial<Record<"en" | "ar", string>>;
7261
7516
  description: string;
7262
- event: "approval_requested";
7517
+ event: "run_waiting" | "run_finished";
7263
7518
  url: string;
7264
7519
  headers: Array<{
7265
7520
  header: string;
@@ -7311,7 +7566,7 @@ export type ManagementProcedures = {
7311
7566
  items: Array<{
7312
7567
  id: string;
7313
7568
  name: string;
7314
- event: "approval_requested";
7569
+ event: "run_waiting" | "run_finished";
7315
7570
  url: string;
7316
7571
  enabled: boolean;
7317
7572
  displayName: Partial<Record<"en" | "ar", string>>;
@@ -7352,10 +7607,9 @@ export type ManagementProcedures = {
7352
7607
  id: string;
7353
7608
  serverId: string | null;
7354
7609
  agentId: string | null;
7355
- event: "approval_requested";
7356
- threadId: string;
7610
+ event: "run_waiting" | "run_finished";
7611
+ threadId: string | null;
7357
7612
  runId: string;
7358
- firingId: string | null;
7359
7613
  attempt: number;
7360
7614
  status: "delivered" | "failed";
7361
7615
  httpStatus: number | null;
@@ -7429,7 +7683,7 @@ export type ManagementProcedures = {
7429
7683
  "webhooks.update": {
7430
7684
  input: {
7431
7685
  description: string;
7432
- event: "approval_requested";
7686
+ event: "run_waiting" | "run_finished";
7433
7687
  url: string;
7434
7688
  headers: Array<{
7435
7689
  header: string;
@@ -9125,7 +9379,7 @@ declare const manifestTriggerSchema: z.ZodObject<{
9125
9379
  policy: z.ZodLiteral<"single">;
9126
9380
  }, z.core.$strip>,
9127
9381
  z.ZodObject<{
9128
- policy: z.ZodLiteral<"per-firing">;
9382
+ policy: z.ZodLiteral<"per-input">;
9129
9383
  }, z.core.$strip>,
9130
9384
  z.ZodObject<{
9131
9385
  policy: z.ZodLiteral<"ephemeral">;
@@ -9133,8 +9387,18 @@ declare const manifestTriggerSchema: z.ZodObject<{
9133
9387
  z.ZodObject<{
9134
9388
  policy: z.ZodLiteral<"keyed">;
9135
9389
  key: z.ZodString;
9390
+ }, z.core.$strip>,
9391
+ z.ZodObject<{
9392
+ policy: z.ZodLiteral<"thread">;
9393
+ key: z.ZodString;
9394
+ wake: z.ZodBoolean;
9136
9395
  }, z.core.$strip>
9137
9396
  ], "policy">>;
9397
+ whileBusy: z.ZodDefault<z.ZodEnum<{
9398
+ steer: "steer";
9399
+ refuse: "refuse";
9400
+ queue: "queue";
9401
+ }>>;
9138
9402
  budgetPerDay: z.ZodOptional<z.ZodNumber>;
9139
9403
  disableAfterFailures: z.ZodDefault<z.ZodNumber>;
9140
9404
  credential: z.ZodOptional<z.ZodString>;
@@ -9144,6 +9408,10 @@ declare const manifestTriggerSchema: z.ZodObject<{
9144
9408
  model: z.ZodString;
9145
9409
  effort: z.ZodOptional<z.ZodString>;
9146
9410
  }, z.core.$strict>>;
9411
+ schedule: z.ZodOptional<z.ZodObject<{
9412
+ cron: z.ZodString;
9413
+ timeZone: z.ZodString;
9414
+ }, z.core.$strip>>;
9147
9415
  audience: z.ZodUnion<readonly [
9148
9416
  z.ZodLiteral<"all">,
9149
9417
  z.ZodObject<{
@@ -9154,10 +9422,12 @@ declare const manifestTriggerSchema: z.ZodObject<{
9154
9422
  }, z.core.$strict>
9155
9423
  ]>;
9156
9424
  overridable: z.ZodDefault<z.ZodArray<z.ZodEnum<{
9425
+ schedule: "schedule";
9157
9426
  description: "description";
9158
9427
  displayName: "displayName";
9159
9428
  instructions: "instructions";
9160
9429
  threadPolicy: "threadPolicy";
9430
+ whileBusy: "whileBusy";
9161
9431
  budgetPerDay: "budgetPerDay";
9162
9432
  disableAfterFailures: "disableAfterFailures";
9163
9433
  model: "model";
@@ -9355,7 +9625,8 @@ declare const manifestWebhookSchema: z.ZodObject<{
9355
9625
  }> & z.core.$partial, z.ZodString>>>;
9356
9626
  description: z.ZodDefault<z.ZodString>;
9357
9627
  event: z.ZodEnum<{
9358
- approval_requested: "approval_requested";
9628
+ run_waiting: "run_waiting";
9629
+ run_finished: "run_finished";
9359
9630
  }>;
9360
9631
  url: z.ZodURL;
9361
9632
  headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -9527,16 +9798,23 @@ declare const manifestAgentSchema: z.ZodObject<{
9527
9798
  ragEnabled: z.ZodDefault<z.ZodBoolean>;
9528
9799
  toolRegistryEnabled: z.ZodDefault<z.ZodBoolean>;
9529
9800
  serviceRegistryEnabled: z.ZodDefault<z.ZodBoolean>;
9801
+ subagentsEnabled: z.ZodDefault<z.ZodBoolean>;
9802
+ checkBacksEnabled: z.ZodDefault<z.ZodBoolean>;
9530
9803
  attachmentsEnabled: z.ZodDefault<z.ZodBoolean>;
9531
9804
  fetchImageHostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
9532
9805
  locationPicker: z.ZodDefault<z.ZodBoolean>;
9533
9806
  media: z.ZodDefault<z.ZodArray<z.ZodEnum<{
9807
+ map: "map";
9534
9808
  mermaid: "mermaid";
9535
9809
  "vega-lite": "vega-lite";
9536
- map: "map";
9537
9810
  report: "report";
9538
9811
  }>>>;
9539
- messageTrigger: z.ZodDefault<z.ZodBoolean>;
9812
+ messages: z.ZodDefault<z.ZodBoolean>;
9813
+ whileBusy: z.ZodDefault<z.ZodEnum<{
9814
+ steer: "steer";
9815
+ refuse: "refuse";
9816
+ queue: "queue";
9817
+ }>>;
9540
9818
  defaultLocale: z.ZodDefault<z.ZodEnum<{
9541
9819
  en: "en";
9542
9820
  ar: "ar";
@@ -9575,8 +9853,8 @@ declare const manifestAgentSchema: z.ZodObject<{
9575
9853
  ar: "ar";
9576
9854
  }>, z.ZodString>>;
9577
9855
  overridable: z.ZodDefault<z.ZodArray<z.ZodEnum<{
9578
- displayName: "displayName";
9579
9856
  prompt: "prompt";
9857
+ displayName: "displayName";
9580
9858
  models: "models";
9581
9859
  settings: "settings";
9582
9860
  rateLimits: "rateLimits";
@@ -9650,16 +9928,23 @@ declare const manifestSchema: z.ZodObject<{
9650
9928
  ragEnabled: z.ZodDefault<z.ZodBoolean>;
9651
9929
  toolRegistryEnabled: z.ZodDefault<z.ZodBoolean>;
9652
9930
  serviceRegistryEnabled: z.ZodDefault<z.ZodBoolean>;
9931
+ subagentsEnabled: z.ZodDefault<z.ZodBoolean>;
9932
+ checkBacksEnabled: z.ZodDefault<z.ZodBoolean>;
9653
9933
  attachmentsEnabled: z.ZodDefault<z.ZodBoolean>;
9654
9934
  fetchImageHostnames: z.ZodDefault<z.ZodArray<z.ZodString>>;
9655
9935
  locationPicker: z.ZodDefault<z.ZodBoolean>;
9656
9936
  media: z.ZodDefault<z.ZodArray<z.ZodEnum<{
9937
+ map: "map";
9657
9938
  mermaid: "mermaid";
9658
9939
  "vega-lite": "vega-lite";
9659
- map: "map";
9660
9940
  report: "report";
9661
9941
  }>>>;
9662
- messageTrigger: z.ZodDefault<z.ZodBoolean>;
9942
+ messages: z.ZodDefault<z.ZodBoolean>;
9943
+ whileBusy: z.ZodDefault<z.ZodEnum<{
9944
+ steer: "steer";
9945
+ refuse: "refuse";
9946
+ queue: "queue";
9947
+ }>>;
9663
9948
  defaultLocale: z.ZodDefault<z.ZodEnum<{
9664
9949
  en: "en";
9665
9950
  ar: "ar";
@@ -9698,8 +9983,8 @@ declare const manifestSchema: z.ZodObject<{
9698
9983
  ar: "ar";
9699
9984
  }>, z.ZodString>>;
9700
9985
  overridable: z.ZodDefault<z.ZodArray<z.ZodEnum<{
9701
- displayName: "displayName";
9702
9986
  prompt: "prompt";
9987
+ displayName: "displayName";
9703
9988
  models: "models";
9704
9989
  settings: "settings";
9705
9990
  rateLimits: "rateLimits";
@@ -11399,7 +11684,7 @@ declare const manifestSchema: z.ZodObject<{
11399
11684
  policy: z.ZodLiteral<"single">;
11400
11685
  }, z.core.$strip>,
11401
11686
  z.ZodObject<{
11402
- policy: z.ZodLiteral<"per-firing">;
11687
+ policy: z.ZodLiteral<"per-input">;
11403
11688
  }, z.core.$strip>,
11404
11689
  z.ZodObject<{
11405
11690
  policy: z.ZodLiteral<"ephemeral">;
@@ -11407,8 +11692,18 @@ declare const manifestSchema: z.ZodObject<{
11407
11692
  z.ZodObject<{
11408
11693
  policy: z.ZodLiteral<"keyed">;
11409
11694
  key: z.ZodString;
11695
+ }, z.core.$strip>,
11696
+ z.ZodObject<{
11697
+ policy: z.ZodLiteral<"thread">;
11698
+ key: z.ZodString;
11699
+ wake: z.ZodBoolean;
11410
11700
  }, z.core.$strip>
11411
11701
  ], "policy">>;
11702
+ whileBusy: z.ZodDefault<z.ZodEnum<{
11703
+ steer: "steer";
11704
+ refuse: "refuse";
11705
+ queue: "queue";
11706
+ }>>;
11412
11707
  budgetPerDay: z.ZodOptional<z.ZodNumber>;
11413
11708
  disableAfterFailures: z.ZodDefault<z.ZodNumber>;
11414
11709
  credential: z.ZodOptional<z.ZodString>;
@@ -11418,6 +11713,10 @@ declare const manifestSchema: z.ZodObject<{
11418
11713
  model: z.ZodString;
11419
11714
  effort: z.ZodOptional<z.ZodString>;
11420
11715
  }, z.core.$strict>>;
11716
+ schedule: z.ZodOptional<z.ZodObject<{
11717
+ cron: z.ZodString;
11718
+ timeZone: z.ZodString;
11719
+ }, z.core.$strip>>;
11421
11720
  audience: z.ZodUnion<readonly [
11422
11721
  z.ZodLiteral<"all">,
11423
11722
  z.ZodObject<{
@@ -11428,10 +11727,12 @@ declare const manifestSchema: z.ZodObject<{
11428
11727
  }, z.core.$strict>
11429
11728
  ]>;
11430
11729
  overridable: z.ZodDefault<z.ZodArray<z.ZodEnum<{
11730
+ schedule: "schedule";
11431
11731
  description: "description";
11432
11732
  displayName: "displayName";
11433
11733
  instructions: "instructions";
11434
11734
  threadPolicy: "threadPolicy";
11735
+ whileBusy: "whileBusy";
11435
11736
  budgetPerDay: "budgetPerDay";
11436
11737
  disableAfterFailures: "disableAfterFailures";
11437
11738
  model: "model";
@@ -11626,7 +11927,8 @@ declare const manifestSchema: z.ZodObject<{
11626
11927
  }> & z.core.$partial, z.ZodString>>>;
11627
11928
  description: z.ZodDefault<z.ZodString>;
11628
11929
  event: z.ZodEnum<{
11629
- approval_requested: "approval_requested";
11930
+ run_waiting: "run_waiting";
11931
+ run_finished: "run_finished";
11630
11932
  }>;
11631
11933
  url: z.ZodURL;
11632
11934
  headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -11770,11 +12072,14 @@ export declare function defineManifest(manifest: Manifest): {
11770
12072
  ragEnabled?: boolean | undefined;
11771
12073
  toolRegistryEnabled?: boolean | undefined;
11772
12074
  serviceRegistryEnabled?: boolean | undefined;
12075
+ subagentsEnabled?: boolean | undefined;
12076
+ checkBacksEnabled?: boolean | undefined;
11773
12077
  attachmentsEnabled?: boolean | undefined;
11774
12078
  fetchImageHostnames?: string[] | undefined;
11775
12079
  locationPicker?: boolean | undefined;
11776
- media?: ("mermaid" | "vega-lite" | "map" | "report")[] | undefined;
11777
- messageTrigger?: boolean | undefined;
12080
+ media?: ("map" | "mermaid" | "vega-lite" | "report")[] | undefined;
12081
+ messages?: boolean | undefined;
12082
+ whileBusy?: "steer" | "refuse" | "queue" | undefined;
11778
12083
  defaultLocale?: "en" | "ar" | undefined;
11779
12084
  context?: {
11780
12085
  maxContextTokens?: number | undefined;
@@ -11803,7 +12108,7 @@ export declare function defineManifest(manifest: Manifest): {
11803
12108
  prompt: string;
11804
12109
  }[]> | undefined;
11805
12110
  greeting?: Record<"en" | "ar", string> | undefined;
11806
- overridable?: ("displayName" | "prompt" | "models" | "settings" | "rateLimits" | "suggestions" | "greeting")[] | undefined;
12111
+ overridable?: ("prompt" | "displayName" | "models" | "settings" | "rateLimits" | "suggestions" | "greeting")[] | undefined;
11807
12112
  }[] | undefined;
11808
12113
  tools?: ({
11809
12114
  audience: "all" | {
@@ -12621,13 +12926,18 @@ export declare function defineManifest(manifest: Manifest): {
12621
12926
  threadPolicy?: {
12622
12927
  policy: "single";
12623
12928
  } | {
12624
- policy: "per-firing";
12929
+ policy: "per-input";
12625
12930
  } | {
12626
12931
  policy: "ephemeral";
12627
12932
  } | {
12628
12933
  policy: "keyed";
12629
12934
  key: string;
12935
+ } | {
12936
+ policy: "thread";
12937
+ key: string;
12938
+ wake: boolean;
12630
12939
  } | undefined;
12940
+ whileBusy?: "steer" | "refuse" | "queue" | undefined;
12631
12941
  budgetPerDay?: number | undefined;
12632
12942
  disableAfterFailures?: number | undefined;
12633
12943
  credential?: string | undefined;
@@ -12637,7 +12947,11 @@ export declare function defineManifest(manifest: Manifest): {
12637
12947
  model: string;
12638
12948
  effort?: string | undefined;
12639
12949
  } | undefined;
12640
- overridable?: ("description" | "displayName" | "instructions" | "threadPolicy" | "budgetPerDay" | "disableAfterFailures" | "model")[] | undefined;
12950
+ schedule?: {
12951
+ cron: string;
12952
+ timeZone: string;
12953
+ } | undefined;
12954
+ overridable?: ("schedule" | "description" | "displayName" | "instructions" | "threadPolicy" | "whileBusy" | "budgetPerDay" | "disableAfterFailures" | "model")[] | undefined;
12641
12955
  }[] | undefined;
12642
12956
  datasetHosts?: {
12643
12957
  name: string;
@@ -12713,7 +13027,7 @@ export declare function defineManifest(manifest: Manifest): {
12713
13027
  }[] | undefined;
12714
13028
  webhooks?: {
12715
13029
  name: string;
12716
- event: "approval_requested";
13030
+ event: "run_waiting" | "run_finished";
12717
13031
  url: string;
12718
13032
  audience: "all" | {
12719
13033
  server: string;