@m6d/cortex-cli 0.21.0 → 0.23.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.
@@ -233,6 +233,7 @@ export const managementProcedureKinds = {
233
233
  "credentials.delete": "mutation",
234
234
  "credentials.list": "query",
235
235
  "credentials.names": "query",
236
+ "credentials.rotateKey": "mutation",
236
237
  "credentials.update": "mutation",
237
238
  "datasetHosts.create": "mutation",
238
239
  "datasetHosts.delete": "mutation",
@@ -257,6 +258,8 @@ export const managementProcedureKinds = {
257
258
  "manifests.sync": "mutation",
258
259
  "mcpServers.create": "mutation",
259
260
  "mcpServers.delete": "mutation",
261
+ "mcpServers.detectSignIn": "query",
262
+ "mcpServers.disconnect": "mutation",
260
263
  "mcpServers.get": "query",
261
264
  "mcpServers.list": "query",
262
265
  "mcpServers.publish": "mutation",
@@ -274,16 +277,16 @@ export const managementProcedureKinds = {
274
277
  "observability.getExecution": "query",
275
278
  "observability.getExecutionSummary": "query",
276
279
  "observability.getRetrievalQuality": "query",
277
- "observability.getTriggerFiring": "query",
280
+ "observability.getRun": "query",
278
281
  "observability.getUsage": "query",
279
282
  "observability.listDatasetReads": "query",
280
283
  "observability.listExecutions": "query",
284
+ "observability.listRuns": "query",
281
285
  "observability.listSchemaDrifts": "query",
282
286
  "observability.listSkillLoads": "query",
283
287
  "observability.listSkillMisses": "query",
284
288
  "observability.listSkillUsage": "query",
285
289
  "observability.listToolHealth": "query",
286
- "observability.listTriggerFirings": "query",
287
290
  "observability.unhealthyToolIds": "query",
288
291
  "observability.unusedSkillIds": "query",
289
292
  "observability.updateSchemaDrift": "mutation",
@@ -349,7 +352,7 @@ export const managementProcedureKinds = {
349
352
  "tools.test": "mutation",
350
353
  "tools.toggle": "mutation",
351
354
  "tools.update": "mutation",
352
- "triggers.answerFiring": "mutation",
355
+ "triggers.answerRun": "mutation",
353
356
  "triggers.create": "mutation",
354
357
  "triggers.delete": "mutation",
355
358
  "triggers.fire": "mutation",
@@ -394,7 +397,7 @@ export type ManagementProcedures = {
394
397
  updatedAt: string;
395
398
  };
396
399
  };
397
- /** 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. */
400
+ /** 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. */
398
401
  "agents.create": {
399
402
  input: {
400
403
  /** A name: lowercase letters, digits, and single hyphens. */
@@ -413,12 +416,15 @@ export type ManagementProcedures = {
413
416
  displayName: Partial<Record<"en" | "ar", string>>;
414
417
  promptDraft: string;
415
418
  ragEnabled: boolean;
419
+ subagentsEnabled: boolean;
420
+ checkBacksEnabled: boolean;
416
421
  toolRegistryEnabled: boolean;
417
422
  serviceRegistryEnabled: boolean;
418
423
  attachmentsEnabled: boolean;
419
424
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
420
425
  locationPicker: boolean;
421
- messageTrigger: boolean;
426
+ messages: boolean;
427
+ whileBusy: "refuse" | "queue" | "steer";
422
428
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
423
429
  suggestions: Record<"en" | "ar", Array<{
424
430
  title: string;
@@ -458,12 +464,15 @@ export type ManagementProcedures = {
458
464
  displayName: Partial<Record<"en" | "ar", string>>;
459
465
  promptDraft: string;
460
466
  ragEnabled: boolean;
467
+ subagentsEnabled: boolean;
468
+ checkBacksEnabled: boolean;
461
469
  toolRegistryEnabled: boolean;
462
470
  serviceRegistryEnabled: boolean;
463
471
  attachmentsEnabled: boolean;
464
472
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
465
473
  locationPicker: boolean;
466
- messageTrigger: boolean;
474
+ messages: boolean;
475
+ whileBusy: "refuse" | "queue" | "steer";
467
476
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
468
477
  suggestions: Record<"en" | "ar", Array<{
469
478
  title: string;
@@ -515,12 +524,15 @@ export type ManagementProcedures = {
515
524
  displayName: Partial<Record<"en" | "ar", string>>;
516
525
  promptDraft: string;
517
526
  ragEnabled: boolean;
527
+ subagentsEnabled: boolean;
528
+ checkBacksEnabled: boolean;
518
529
  toolRegistryEnabled: boolean;
519
530
  serviceRegistryEnabled: boolean;
520
531
  attachmentsEnabled: boolean;
521
532
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
522
533
  locationPicker: boolean;
523
- messageTrigger: boolean;
534
+ messages: boolean;
535
+ whileBusy: "refuse" | "queue" | "steer";
524
536
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
525
537
  suggestions: Record<"en" | "ar", Array<{
526
538
  title: string;
@@ -681,12 +693,15 @@ export type ManagementProcedures = {
681
693
  displayName: Partial<Record<"en" | "ar", string>>;
682
694
  promptDraft: string;
683
695
  ragEnabled: boolean;
696
+ subagentsEnabled: boolean;
697
+ checkBacksEnabled: boolean;
684
698
  toolRegistryEnabled: boolean;
685
699
  serviceRegistryEnabled: boolean;
686
700
  attachmentsEnabled: boolean;
687
701
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
688
702
  locationPicker: boolean;
689
- messageTrigger: boolean;
703
+ messages: boolean;
704
+ whileBusy: "refuse" | "queue" | "steer";
690
705
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
691
706
  suggestions: Record<"en" | "ar", Array<{
692
707
  title: string;
@@ -715,11 +730,14 @@ export type ManagementProcedures = {
715
730
  ragEnabled?: boolean;
716
731
  toolRegistryEnabled?: boolean;
717
732
  serviceRegistryEnabled?: boolean;
733
+ subagentsEnabled?: boolean;
734
+ checkBacksEnabled?: boolean;
718
735
  attachmentsEnabled?: boolean;
719
736
  fetchImageHostnames?: Array<string>;
720
737
  locationPicker?: boolean;
721
738
  media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
722
- messageTrigger?: boolean;
739
+ messages?: boolean;
740
+ whileBusy?: "refuse" | "queue" | "steer";
723
741
  defaultLocale?: "en" | "ar";
724
742
  context?: {
725
743
  maxContextTokens: number;
@@ -791,12 +809,15 @@ export type ManagementProcedures = {
791
809
  displayName: Partial<Record<"en" | "ar", string>>;
792
810
  promptDraft: string;
793
811
  ragEnabled: boolean;
812
+ subagentsEnabled: boolean;
813
+ checkBacksEnabled: boolean;
794
814
  toolRegistryEnabled: boolean;
795
815
  serviceRegistryEnabled: boolean;
796
816
  attachmentsEnabled: boolean;
797
817
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
798
818
  locationPicker: boolean;
799
- messageTrigger: boolean;
819
+ messages: boolean;
820
+ whileBusy: "refuse" | "queue" | "steer";
800
821
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
801
822
  suggestions: Record<"en" | "ar", Array<{
802
823
  title: string;
@@ -836,12 +857,15 @@ export type ManagementProcedures = {
836
857
  displayName: Partial<Record<"en" | "ar", string>>;
837
858
  promptDraft: string;
838
859
  ragEnabled: boolean;
860
+ subagentsEnabled: boolean;
861
+ checkBacksEnabled: boolean;
839
862
  toolRegistryEnabled: boolean;
840
863
  serviceRegistryEnabled: boolean;
841
864
  attachmentsEnabled: boolean;
842
865
  fetchImageHostnames: string | number | boolean | null | Record<string, unknown> | Array<unknown>;
843
866
  locationPicker: boolean;
844
- messageTrigger: boolean;
867
+ messages: boolean;
868
+ whileBusy: "refuse" | "queue" | "steer";
845
869
  media: Array<"mermaid" | "vega-lite" | "map" | "report">;
846
870
  suggestions: Record<"en" | "ar", Array<{
847
871
  title: string;
@@ -885,7 +909,7 @@ export type ManagementProcedures = {
885
909
  output: {
886
910
  id: string;
887
911
  actorId: string;
888
- credentialKind: "session" | "managementKey" | "operatorToken" | "system";
912
+ credentialKind: "session" | "managementKey" | "operatorToken" | "oauthToken" | "system";
889
913
  credentialId: string | null;
890
914
  entityType: string;
891
915
  entityId: string;
@@ -902,6 +926,7 @@ export type ManagementProcedures = {
902
926
  displayName: Partial<Record<"en" | "ar", string>>;
903
927
  fingerprint: string;
904
928
  } | null;
929
+ oauthClientName: string | null;
905
930
  before: unknown;
906
931
  after: unknown;
907
932
  };
@@ -922,7 +947,7 @@ export type ManagementProcedures = {
922
947
  items: Array<{
923
948
  id: string;
924
949
  actorId: string;
925
- credentialKind: "session" | "managementKey" | "operatorToken" | "system";
950
+ credentialKind: "session" | "managementKey" | "operatorToken" | "oauthToken" | "system";
926
951
  credentialId: string | null;
927
952
  entityType: string;
928
953
  entityId: string;
@@ -939,6 +964,7 @@ export type ManagementProcedures = {
939
964
  displayName: Partial<Record<"en" | "ar", string>>;
940
965
  fingerprint: string;
941
966
  } | null;
967
+ oauthClientName: string | null;
942
968
  }>;
943
969
  /** Every row the caller may see, ignoring the search and filters. */
944
970
  count: number;
@@ -1134,15 +1160,17 @@ export type ManagementProcedures = {
1134
1160
  name: string;
1135
1161
  };
1136
1162
  };
1137
- /** Create a named credential, with a display name (a text per locale, `{}` for none), over a stored secret: `static` presents the secret's value; `oauth2-client-credentials` exchanges it, as the client secret of `clientId`, for a bearer at `tokenUrl` (https, or http on loopback or on a host `EGRESS_ALLOWED_HOSTS` admits). A credential's name and kind never change. Needs `secrets:write` too: whatever presents the credential sends its secret. */
1163
+ /** Create a credential over a stored secret, with a display name (`{}` for none). `static` presents the secret's value; `oauth2-client-credentials` gets a bearer at `tokenUrl` (https) as `clientId`, by `authMethod`: `client_secret_basic` sends the secret; `private_key_jwt` signs with a key Cortex generates into a new secret named `secretName`, which nothing else may compose or rewrite (`signing_key_secret`), and needs `issuer` and an engine public URL to publish its key under (`jwks_unavailable`); `none` is a public app for MCP sign-in at `issuer`, with no secret. `issuer` is the authorization server's exact identifier. Name, kind and auth method never change. Needs `secrets:write`. */
1138
1164
  "credentials.create": {
1139
1165
  input: {
1140
1166
  displayName: Partial<Record<"en" | "ar", string>>;
1141
1167
  kind: "static" | "oauth2-client-credentials";
1168
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none";
1142
1169
  secretName: string;
1143
1170
  tokenUrl: string;
1144
1171
  clientId: string;
1145
1172
  scope: string;
1173
+ issuer: string;
1146
1174
  /** A name: lowercase letters, digits, and single hyphens. */
1147
1175
  name: string;
1148
1176
  };
@@ -1151,10 +1179,12 @@ export type ManagementProcedures = {
1151
1179
  name: string;
1152
1180
  displayName: Partial<Record<"en" | "ar", string>>;
1153
1181
  kind: "static" | "oauth2-client-credentials";
1154
- secretName: string;
1182
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none" | null;
1183
+ secretName: string | null;
1155
1184
  tokenUrl: string | null;
1156
1185
  clientId: string | null;
1157
1186
  scope: string | null;
1187
+ issuer: string | null;
1158
1188
  createdAt: string;
1159
1189
  updatedAt: string;
1160
1190
  };
@@ -1169,15 +1199,17 @@ export type ManagementProcedures = {
1169
1199
  name: string;
1170
1200
  displayName: Partial<Record<"en" | "ar", string>>;
1171
1201
  kind: "static" | "oauth2-client-credentials";
1172
- secretName: string;
1202
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none" | null;
1203
+ secretName: string | null;
1173
1204
  tokenUrl: string | null;
1174
1205
  clientId: string | null;
1175
1206
  scope: string | null;
1207
+ issuer: string | null;
1176
1208
  createdAt: string;
1177
1209
  updatedAt: string;
1178
1210
  };
1179
1211
  };
1180
- /** List credentials with pagination and search: the name tools, dataset hosts and triggers reference, its display name, its kind, the secret it composes, and how many rows name it with the first few (`usedBy`). */
1212
+ /** List credentials with pagination and search: the name tools, dataset hosts and triggers reference, its display name, its kind and auth method, the secret it composes, how many rows name it with the first few (`usedBy`), and, for a `private_key_jwt` one, the URL of its public key set (`jwksUrl`, null without an engine public URL), which its authorization server is registered with, and the `kid` of the key it signs with now (null for any other). */
1181
1213
  "credentials.list": {
1182
1214
  input: {
1183
1215
  pageIndex?: number;
@@ -1190,10 +1222,12 @@ export type ManagementProcedures = {
1190
1222
  name: string;
1191
1223
  displayName: Partial<Record<"en" | "ar", string>>;
1192
1224
  kind: "static" | "oauth2-client-credentials";
1193
- secretName: string;
1225
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none" | null;
1226
+ secretName: string | null;
1194
1227
  tokenUrl: string | null;
1195
1228
  clientId: string | null;
1196
1229
  scope: string | null;
1230
+ issuer: string | null;
1197
1231
  createdAt: string;
1198
1232
  updatedAt: string;
1199
1233
  usedBy: {
@@ -1205,6 +1239,8 @@ export type ManagementProcedures = {
1205
1239
  id: string;
1206
1240
  }>;
1207
1241
  };
1242
+ jwksUrl: string | null;
1243
+ kid: string | null;
1208
1244
  }>;
1209
1245
  /** Every row the caller may see, ignoring the search and filters. */
1210
1246
  count: number;
@@ -1212,25 +1248,47 @@ export type ManagementProcedures = {
1212
1248
  filteredCount: number;
1213
1249
  };
1214
1250
  };
1215
- /** Each credential's name and display name, in name order, for a picker. `present`: what a tool, dataset host, webhook or trigger run may present upstream (every credential but a trigger's fire credential). `fire`: what a trigger may be fired with (static credentials). */
1251
+ /** Each credential's name and display name, in name order, for a picker. `present`: what a tool, dataset host, webhook or trigger run may present upstream (every credential but a trigger's fire credential). `fire`: what a trigger may be fired with (static credentials). `signIn`: what an MCP server's sign-in may present as its pre-registered app (OAuth2 client credentials ones naming their `issuer`). */
1216
1252
  "credentials.names": {
1217
1253
  input: {
1218
- use: "present" | "fire";
1254
+ use: "present" | "fire" | "signIn";
1219
1255
  };
1220
1256
  output: Array<{
1221
1257
  name: string;
1222
1258
  displayName: Partial<Record<"en" | "ar", string>>;
1223
1259
  }>;
1224
1260
  };
1225
- /** Change a credential's display name, the secret it composes and, for an OAuth2 one, its token URL, client id and scope. Applies to the next call of every tool, dataset host and trigger naming it. Changing the secret or the token URL needs `secrets:write` too (`secret_binding_forbidden`): either sends a stored secret somewhere new. */
1261
+ /** Replace a `private_key_jwt` credential's signing key with a new one, under a new `kid`, rewriting its secret (`no_signing_key` for any other credential). Its key set serves only the new public key at once, so assertions verify again once the authorization server refetches it. */
1262
+ "credentials.rotateKey": {
1263
+ input: {
1264
+ id: string;
1265
+ };
1266
+ output: {
1267
+ id: string;
1268
+ name: string;
1269
+ displayName: Partial<Record<"en" | "ar", string>>;
1270
+ kind: "static" | "oauth2-client-credentials";
1271
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none" | null;
1272
+ secretName: string | null;
1273
+ tokenUrl: string | null;
1274
+ clientId: string | null;
1275
+ scope: string | null;
1276
+ issuer: string | null;
1277
+ createdAt: string;
1278
+ updatedAt: string;
1279
+ };
1280
+ };
1281
+ /** Change a credential's display name, the secret it composes and, for an OAuth2 one, its token URL, client id, scope and issuer. Applies to the next call of every tool, dataset host and trigger naming it. Changing the secret, the token URL or the issuer needs `secrets:write` too (`secret_binding_forbidden`): each sends a stored secret somewhere new. A `private_key_jwt` one keeps its secret, which holds its key, like its kind and auth method (`kind_locked`). */
1226
1282
  "credentials.update": {
1227
1283
  input: {
1228
1284
  displayName: Partial<Record<"en" | "ar", string>>;
1229
1285
  kind: "static" | "oauth2-client-credentials";
1286
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none";
1230
1287
  secretName: string;
1231
1288
  tokenUrl: string;
1232
1289
  clientId: string;
1233
1290
  scope: string;
1291
+ issuer: string;
1234
1292
  id: string;
1235
1293
  };
1236
1294
  output: {
@@ -1238,10 +1296,12 @@ export type ManagementProcedures = {
1238
1296
  name: string;
1239
1297
  displayName: Partial<Record<"en" | "ar", string>>;
1240
1298
  kind: "static" | "oauth2-client-credentials";
1241
- secretName: string;
1299
+ authMethod: "client_secret_basic" | "private_key_jwt" | "none" | null;
1300
+ secretName: string | null;
1242
1301
  tokenUrl: string | null;
1243
1302
  clientId: string | null;
1244
1303
  scope: string | null;
1304
+ issuer: string | null;
1245
1305
  createdAt: string;
1246
1306
  updatedAt: string;
1247
1307
  };
@@ -1429,7 +1489,7 @@ export type ManagementProcedures = {
1429
1489
  unchanged: boolean;
1430
1490
  };
1431
1491
  };
1432
- /** 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. */
1492
+ /** 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. */
1433
1493
  "datasetHosts.setAudience": {
1434
1494
  input: {
1435
1495
  id: string;
@@ -1771,11 +1831,14 @@ export type ManagementProcedures = {
1771
1831
  ragEnabled?: boolean;
1772
1832
  toolRegistryEnabled?: boolean;
1773
1833
  serviceRegistryEnabled?: boolean;
1834
+ subagentsEnabled?: boolean;
1835
+ checkBacksEnabled?: boolean;
1774
1836
  attachmentsEnabled?: boolean;
1775
1837
  fetchImageHostnames?: Array<string>;
1776
1838
  locationPicker?: boolean;
1777
1839
  media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
1778
- messageTrigger?: boolean;
1840
+ messages?: boolean;
1841
+ whileBusy?: "refuse" | "queue" | "steer";
1779
1842
  defaultLocale?: "en" | "ar";
1780
1843
  context?: {
1781
1844
  maxContextTokens?: number;
@@ -2097,13 +2160,18 @@ export type ManagementProcedures = {
2097
2160
  threadPolicy?: {
2098
2161
  policy: "single";
2099
2162
  } | {
2100
- policy: "per-firing";
2163
+ policy: "per-input";
2101
2164
  } | {
2102
2165
  policy: "ephemeral";
2103
2166
  } | {
2104
2167
  policy: "keyed";
2105
2168
  key: string;
2169
+ } | {
2170
+ policy: "thread";
2171
+ key: string;
2172
+ wake: boolean;
2106
2173
  };
2174
+ whileBusy?: "refuse" | "queue" | "steer";
2107
2175
  budgetPerDay?: number;
2108
2176
  disableAfterFailures?: number;
2109
2177
  credential?: string;
@@ -2113,12 +2181,16 @@ export type ManagementProcedures = {
2113
2181
  model: string;
2114
2182
  effort?: string;
2115
2183
  };
2184
+ schedule?: {
2185
+ cron: string;
2186
+ timeZone: string;
2187
+ };
2116
2188
  audience: "all" | {
2117
2189
  server: string;
2118
2190
  } | {
2119
2191
  agents: Array<string>;
2120
2192
  };
2121
- overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "budgetPerDay" | "disableAfterFailures" | "model">;
2193
+ overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "whileBusy" | "budgetPerDay" | "disableAfterFailures" | "model" | "schedule">;
2122
2194
  }>;
2123
2195
  datasetHosts?: Array<{
2124
2196
  name: string;
@@ -2178,6 +2250,11 @@ export type ManagementProcedures = {
2178
2250
  value: string;
2179
2251
  };
2180
2252
  }>;
2253
+ signIn?: {
2254
+ connects: "shared" | "endUser";
2255
+ scope?: string;
2256
+ credential?: string;
2257
+ };
2181
2258
  include?: Array<string>;
2182
2259
  exclude?: Array<string>;
2183
2260
  audience: "all" | {
@@ -2185,13 +2262,13 @@ export type ManagementProcedures = {
2185
2262
  } | {
2186
2263
  agents: Array<string>;
2187
2264
  };
2188
- overridable?: Array<"displayName" | "include" | "exclude" | "headers">;
2265
+ overridable?: Array<"displayName" | "include" | "exclude" | "headers" | "signIn">;
2189
2266
  }>;
2190
2267
  webhooks?: Array<{
2191
2268
  name: string;
2192
2269
  displayName?: Partial<Record<"en" | "ar", string>>;
2193
2270
  description?: string;
2194
- event: "approval_requested";
2271
+ event: "run_waiting" | "run_finished";
2195
2272
  url: string;
2196
2273
  headers?: Array<{
2197
2274
  header: string;
@@ -2306,11 +2383,14 @@ export type ManagementProcedures = {
2306
2383
  ragEnabled?: boolean;
2307
2384
  toolRegistryEnabled?: boolean;
2308
2385
  serviceRegistryEnabled?: boolean;
2386
+ subagentsEnabled?: boolean;
2387
+ checkBacksEnabled?: boolean;
2309
2388
  attachmentsEnabled?: boolean;
2310
2389
  fetchImageHostnames?: Array<string>;
2311
2390
  locationPicker?: boolean;
2312
2391
  media?: Array<"mermaid" | "vega-lite" | "map" | "report">;
2313
- messageTrigger?: boolean;
2392
+ messages?: boolean;
2393
+ whileBusy?: "refuse" | "queue" | "steer";
2314
2394
  defaultLocale?: "en" | "ar";
2315
2395
  context?: {
2316
2396
  maxContextTokens?: number;
@@ -2632,13 +2712,18 @@ export type ManagementProcedures = {
2632
2712
  threadPolicy?: {
2633
2713
  policy: "single";
2634
2714
  } | {
2635
- policy: "per-firing";
2715
+ policy: "per-input";
2636
2716
  } | {
2637
2717
  policy: "ephemeral";
2638
2718
  } | {
2639
2719
  policy: "keyed";
2640
2720
  key: string;
2721
+ } | {
2722
+ policy: "thread";
2723
+ key: string;
2724
+ wake: boolean;
2641
2725
  };
2726
+ whileBusy?: "refuse" | "queue" | "steer";
2642
2727
  budgetPerDay?: number;
2643
2728
  disableAfterFailures?: number;
2644
2729
  credential?: string;
@@ -2648,12 +2733,16 @@ export type ManagementProcedures = {
2648
2733
  model: string;
2649
2734
  effort?: string;
2650
2735
  };
2736
+ schedule?: {
2737
+ cron: string;
2738
+ timeZone: string;
2739
+ };
2651
2740
  audience: "all" | {
2652
2741
  server: string;
2653
2742
  } | {
2654
2743
  agents: Array<string>;
2655
2744
  };
2656
- overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "budgetPerDay" | "disableAfterFailures" | "model">;
2745
+ overridable?: Array<"displayName" | "description" | "instructions" | "threadPolicy" | "whileBusy" | "budgetPerDay" | "disableAfterFailures" | "model" | "schedule">;
2657
2746
  }>;
2658
2747
  datasetHosts?: Array<{
2659
2748
  name: string;
@@ -2713,6 +2802,11 @@ export type ManagementProcedures = {
2713
2802
  value: string;
2714
2803
  };
2715
2804
  }>;
2805
+ signIn?: {
2806
+ connects: "shared" | "endUser";
2807
+ scope?: string;
2808
+ credential?: string;
2809
+ };
2716
2810
  include?: Array<string>;
2717
2811
  exclude?: Array<string>;
2718
2812
  audience: "all" | {
@@ -2720,13 +2814,13 @@ export type ManagementProcedures = {
2720
2814
  } | {
2721
2815
  agents: Array<string>;
2722
2816
  };
2723
- overridable?: Array<"displayName" | "include" | "exclude" | "headers">;
2817
+ overridable?: Array<"displayName" | "include" | "exclude" | "headers" | "signIn">;
2724
2818
  }>;
2725
2819
  webhooks?: Array<{
2726
2820
  name: string;
2727
2821
  displayName?: Partial<Record<"en" | "ar", string>>;
2728
2822
  description?: string;
2729
- event: "approval_requested";
2823
+ event: "run_waiting" | "run_finished";
2730
2824
  url: string;
2731
2825
  headers?: Array<{
2732
2826
  header: string;
@@ -2816,7 +2910,30 @@ export type ManagementProcedures = {
2816
2910
  id: string;
2817
2911
  };
2818
2912
  };
2819
- /** One MCP server by id with its url, headers, tool filters, and sharing. */
2913
+ /** Find how Cortex would sign in to the MCP server with OAuth, from its metadata: the authorization server's issuer, the method Cortex would use (`preRegistered`, `clientIdDocument`, `dynamicRegistration`, or null for none), the scopes on offer, whether PKCE with S256 is supported, and the resource tokens are for. A pre-registered app for another issuer is refused as `sign_in_issuer_mismatch`. */
2914
+ "mcpServers.detectSignIn": {
2915
+ input: {
2916
+ id: string;
2917
+ };
2918
+ output: {
2919
+ issuer: string;
2920
+ method: "preRegistered" | "clientIdDocument" | "dynamicRegistration" | null;
2921
+ scopes: Array<string>;
2922
+ pkce: boolean;
2923
+ resource: string;
2924
+ };
2925
+ };
2926
+ /** Forget every connection Cortex holds to the MCP server: the shared one, or every end user's. Its turns report it not connected until someone signs in again. The tokens are not revoked at the authorization server. */
2927
+ "mcpServers.disconnect": {
2928
+ input: {
2929
+ id: string;
2930
+ };
2931
+ output: {
2932
+ id: string;
2933
+ name: string;
2934
+ };
2935
+ };
2936
+ /** One MCP server by id with its url, headers, sign-in, tool filters, and sharing; its shared connection, never its tokens, with `stepUp` once its server refused a call for lack of scope (the scopes it lacks, and whether a sign-in may still ask for them); how many end users are connected or must sign in again; and `signInUrl`, where a browser form-posts an operator token and the server's id to connect it (null while the engine or the console has no public URL). */
2820
2937
  "mcpServers.get": {
2821
2938
  input: {
2822
2939
  id: string;
@@ -2855,6 +2972,11 @@ export type ManagementProcedures = {
2855
2972
  value: string;
2856
2973
  };
2857
2974
  }>;
2975
+ signIn: {
2976
+ connects: "shared" | "endUser";
2977
+ scope?: string;
2978
+ credential?: string;
2979
+ } | null;
2858
2980
  include: Array<string>;
2859
2981
  exclude: Array<string>;
2860
2982
  status: "draft" | "published" | "disabled";
@@ -2881,6 +3003,22 @@ export type ManagementProcedures = {
2881
3003
  type: "string" | "number" | "boolean";
2882
3004
  computed: boolean;
2883
3005
  }>;
3006
+ connection: {
3007
+ status: "connected" | "needs_scope" | "broken";
3008
+ issuer: string;
3009
+ scope: string;
3010
+ expiresAt: string | null;
3011
+ updatedAt: string;
3012
+ stepUp: {
3013
+ missing: string;
3014
+ grantable: boolean;
3015
+ } | null;
3016
+ } | null;
3017
+ endUsers: {
3018
+ connected: number;
3019
+ broken: number;
3020
+ };
3021
+ signInUrl: string | null;
2884
3022
  };
2885
3023
  };
2886
3024
  /** List MCP servers with pagination and search. */
@@ -2954,7 +3092,7 @@ export type ManagementProcedures = {
2954
3092
  unchanged: boolean;
2955
3093
  };
2956
3094
  };
2957
- /** 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. */
3095
+ /** 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. */
2958
3096
  "mcpServers.setAudience": {
2959
3097
  input: {
2960
3098
  id: string;
@@ -3010,7 +3148,7 @@ export type ManagementProcedures = {
3010
3148
  unchanged: boolean;
3011
3149
  };
3012
3150
  };
3013
- /** Update an MCP server's draft: which of its tools agents may call (`include`, empty for every tool, and `exclude`, tool names as the server spells them). Saved as a draft; call publish to make it live. The url and headers (each with a prefix and its value from a credential, the run token, a variable or a constant) apply live without a publish. */
3151
+ /** Update an MCP server's draft: which of its tools agents may call (`include`, empty for every tool, and `exclude`, tool names as the server spells them). Saved as a draft; call publish to make it live. The url, headers (each with a prefix and its value from a credential, the run token, a variable or a constant) and `signIn` apply live without a publish. `signIn` (null for none) has Cortex sign in with OAuth: `connects` is `shared` (an operator connects once for every agent) or `endUser` (each end user connects their own), `scope` what to ask for, and `credential` names the app registered with the authorization server beforehand, an `oauth2-client-credentials` credential naming its `issuer`. A server that signs in declares no Authorization header. */
3014
3152
  "mcpServers.update": {
3015
3153
  input: {
3016
3154
  url: string;
@@ -3030,6 +3168,11 @@ export type ManagementProcedures = {
3030
3168
  value: string;
3031
3169
  };
3032
3170
  }>;
3171
+ signIn: {
3172
+ connects: "shared" | "endUser";
3173
+ scope?: string;
3174
+ credential?: string;
3175
+ } | null;
3033
3176
  include: Array<string>;
3034
3177
  exclude: Array<string>;
3035
3178
  id: string;
@@ -3176,6 +3319,7 @@ export type ManagementProcedures = {
3176
3319
  displayName: Partial<Record<"en" | "ar", string>>;
3177
3320
  };
3178
3321
  triggerName: string | null;
3322
+ delegated: "queued" | "run" | "schedule" | "trigger" | null;
3179
3323
  threadId: string | null;
3180
3324
  threadTitle: string | null;
3181
3325
  input: unknown;
@@ -3242,18 +3386,20 @@ export type ManagementProcedures = {
3242
3386
  }>;
3243
3387
  };
3244
3388
  };
3245
- /** One trigger firing by id with its outcome and output, and the tool calls it waits on when it awaits approval. */
3246
- "observability.getTriggerFiring": {
3389
+ /** One run by id with what it answered with, and the tool calls it waits on while it is waiting. */
3390
+ "observability.getRun": {
3247
3391
  input: {
3248
3392
  id: string;
3249
3393
  };
3250
3394
  output: {
3251
3395
  id: string;
3252
- triggerName: string;
3253
- threadId: string | null;
3254
- outcome: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
3255
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
3256
- output: unknown;
3396
+ kind: "turn" | "subagent" | "tool";
3397
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
3398
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
3399
+ createdAt: string;
3400
+ finishedAt: string | null;
3401
+ source: "user" | "trigger" | "schedule" | "run" | null;
3402
+ triggerName: string | null;
3257
3403
  server: {
3258
3404
  name: string;
3259
3405
  displayName: Partial<Record<"en" | "ar", string>>;
@@ -3262,17 +3408,15 @@ export type ManagementProcedures = {
3262
3408
  name: string;
3263
3409
  displayName: Partial<Record<"en" | "ar", string>>;
3264
3410
  };
3411
+ threadId: string | null;
3265
3412
  threadTitle: string | null;
3266
- createdAt: string;
3267
- finishedAt: string | null;
3268
- triggerId: string | null;
3269
- agentId: string;
3270
- approvals: Array<{
3413
+ result: unknown;
3414
+ waits: Array<{
3415
+ kind: "approval" | "client_tool";
3271
3416
  toolCallId: string;
3272
3417
  toolName: string;
3273
3418
  input: unknown;
3274
3419
  }>;
3275
- decider: "operator" | "chat" | "disabled";
3276
3420
  };
3277
3421
  };
3278
3422
  /** 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. */
@@ -3408,6 +3552,47 @@ export type ManagementProcedures = {
3408
3552
  filteredCount: number;
3409
3553
  };
3410
3554
  };
3555
+ /** 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. */
3556
+ "observability.listRuns": {
3557
+ input: {
3558
+ pageIndex?: number;
3559
+ pageSize?: number;
3560
+ q?: string;
3561
+ agentId?: string;
3562
+ source?: "user" | "trigger" | "schedule" | "run";
3563
+ status?: "running" | "waiting" | "completed" | "failed" | "cancelled";
3564
+ triggerName?: string;
3565
+ waitKind?: "approval" | "client_tool";
3566
+ dateFrom?: string;
3567
+ dateTo?: string;
3568
+ };
3569
+ output: {
3570
+ items: Array<{
3571
+ id: string;
3572
+ kind: "turn" | "subagent" | "tool";
3573
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
3574
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
3575
+ createdAt: string;
3576
+ finishedAt: string | null;
3577
+ source: "user" | "trigger" | "schedule" | "run" | null;
3578
+ triggerName: string | null;
3579
+ server: {
3580
+ name: string;
3581
+ displayName: Partial<Record<"en" | "ar", string>>;
3582
+ } | null;
3583
+ agent: {
3584
+ name: string;
3585
+ displayName: Partial<Record<"en" | "ar", string>>;
3586
+ };
3587
+ threadId: string | null;
3588
+ threadTitle: string | null;
3589
+ }>;
3590
+ /** Every row the caller may see, ignoring the search and filters. */
3591
+ count: number;
3592
+ /** The rows matching the search and filters, over all pages: the total to report. */
3593
+ filteredCount: number;
3594
+ };
3595
+ };
3411
3596
  /** Upstream responses that do not match a tool's declared schema, with pagination. */
3412
3597
  "observability.listSchemaDrifts": {
3413
3598
  input: {
@@ -3529,44 +3714,6 @@ export type ManagementProcedures = {
3529
3714
  filteredCount: number;
3530
3715
  };
3531
3716
  };
3532
- /** Trigger firings with their outcome, with pagination and agent, trigger, outcome, and day-range filters. */
3533
- "observability.listTriggerFirings": {
3534
- input: {
3535
- pageIndex?: number;
3536
- pageSize?: number;
3537
- q?: string;
3538
- agentId?: string;
3539
- triggerName?: string;
3540
- outcome?: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
3541
- dateFrom?: string;
3542
- dateTo?: string;
3543
- };
3544
- output: {
3545
- items: Array<{
3546
- id: string;
3547
- triggerName: string;
3548
- threadId: string | null;
3549
- outcome: "started" | "awaiting_approval" | "completed" | "failed" | "rejected" | "dropped";
3550
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
3551
- output: unknown;
3552
- server: {
3553
- name: string;
3554
- displayName: Partial<Record<"en" | "ar", string>>;
3555
- } | null;
3556
- agent: {
3557
- name: string;
3558
- displayName: Partial<Record<"en" | "ar", string>>;
3559
- };
3560
- threadTitle: string | null;
3561
- createdAt: string;
3562
- finishedAt: string | null;
3563
- }>;
3564
- /** Every row the caller may see, ignoring the search and filters. */
3565
- count: number;
3566
- /** The rows matching the search and filters, over all pages: the total to report. */
3567
- filteredCount: number;
3568
- };
3569
- };
3570
3717
  /** Ids of tools whose recent executions exceed the failure threshold. */
3571
3718
  "observability.unhealthyToolIds": {
3572
3719
  input: undefined;
@@ -3754,7 +3901,7 @@ export type ManagementProcedures = {
3754
3901
  displayName: Partial<Record<"en" | "ar", string>>;
3755
3902
  }>;
3756
3903
  };
3757
- /** Replace a secret's value in place. */
3904
+ /** Replace a secret's value in place; a `private_key_jwt` credential's generated key is refused (`signing_key_secret`), since only `credentials.rotateKey` rewrites it. */
3758
3905
  "secrets.rotate": {
3759
3906
  input: {
3760
3907
  id: string;
@@ -3838,7 +3985,8 @@ export type ManagementProcedures = {
3838
3985
  requiresApproval?: boolean;
3839
3986
  }>;
3840
3987
  verify: boolean;
3841
- events: Array<"approval_requested">;
3988
+ delegation: boolean;
3989
+ events: Array<"run_waiting" | "run_finished">;
3842
3990
  } | null;
3843
3991
  syncedAt: string | null;
3844
3992
  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;
@@ -3884,7 +4032,8 @@ export type ManagementProcedures = {
3884
4032
  requiresApproval?: boolean;
3885
4033
  }>;
3886
4034
  verify: boolean;
3887
- events: Array<"approval_requested">;
4035
+ delegation: boolean;
4036
+ events: Array<"run_waiting" | "run_finished">;
3888
4037
  } | null;
3889
4038
  syncedAt: string | null;
3890
4039
  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;
@@ -3917,6 +4066,7 @@ export type ManagementProcedures = {
3917
4066
  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;
3918
4067
  createdAt: string;
3919
4068
  threadCount: number;
4069
+ delegation: boolean;
3920
4070
  modelProvider: string | null;
3921
4071
  modelName: string | null;
3922
4072
  modelEffort: string | null;
@@ -4024,7 +4174,8 @@ export type ManagementProcedures = {
4024
4174
  requiresApproval?: boolean;
4025
4175
  }>;
4026
4176
  verify: boolean;
4027
- events: Array<"approval_requested">;
4177
+ delegation: boolean;
4178
+ events: Array<"run_waiting" | "run_finished">;
4028
4179
  } | null;
4029
4180
  syncedAt: string | null;
4030
4181
  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;
@@ -4552,7 +4703,7 @@ export type ManagementProcedures = {
4552
4703
  pageSize?: number;
4553
4704
  q?: string;
4554
4705
  serverId?: string;
4555
- agentName?: string;
4706
+ agentId?: string;
4556
4707
  userId?: string;
4557
4708
  dateFrom?: string;
4558
4709
  dateTo?: string;
@@ -4632,7 +4783,7 @@ export type ManagementProcedures = {
4632
4783
  output: {
4633
4784
  items: Array<{
4634
4785
  id: string;
4635
- role: "system" | "user" | "assistant" | "trigger";
4786
+ role: "system" | "user" | "assistant" | "event";
4636
4787
  text: string | null;
4637
4788
  content: Record<string, unknown>;
4638
4789
  ordinal: number;
@@ -5221,7 +5372,7 @@ export type ManagementProcedures = {
5221
5372
  unchanged: boolean;
5222
5373
  };
5223
5374
  };
5224
- /** 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. */
5375
+ /** 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. */
5225
5376
  "tools.setAudience": {
5226
5377
  input: {
5227
5378
  id: string;
@@ -5353,67 +5504,64 @@ export type ManagementProcedures = {
5353
5504
  name: string;
5354
5505
  };
5355
5506
  };
5356
- /** 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. */
5357
- "triggers.answerFiring": {
5507
+ /** 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. */
5508
+ "triggers.answerRun": {
5358
5509
  input: {
5359
- id: string;
5360
- agentId?: string;
5361
- firingId: string;
5510
+ runId: string;
5362
5511
  toolCallId: string;
5363
5512
  approved: boolean;
5364
5513
  };
5365
5514
  output: {
5366
- status: number;
5367
- firingId: string;
5368
- outcome: "started";
5369
- threadId: string;
5515
+ inputId: string;
5516
+ state: "started";
5370
5517
  runId: string;
5371
- } | {
5372
- status: number;
5373
- firingId: string;
5374
- outcome: "awaiting_approval";
5375
5518
  threadId: string;
5376
- runId: string;
5377
- approvals: Array<{
5378
- toolCallId: string;
5379
- toolName: string;
5380
- input: unknown;
5519
+ } | {
5520
+ state: "rejected";
5521
+ issues: Array<{
5522
+ path: string;
5523
+ message: string;
5381
5524
  }>;
5382
5525
  } | {
5383
- status: number;
5384
- firingId: string;
5385
- outcome: "completed";
5386
- threadId: string;
5387
- runId: string;
5388
- output: unknown;
5526
+ inputId: string;
5527
+ state: "waiting";
5528
+ delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
5389
5529
  } | {
5390
- status: number;
5391
- firingId: string;
5392
- outcome: "failed";
5393
- threadId: string;
5394
- runId: string;
5395
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
5530
+ inputId: string | null;
5531
+ state: "refused";
5532
+ reason: "busy" | "approval_pending" | "conflict" | "rate_limited" | "budget" | "full" | "not_waiting";
5396
5533
  } | {
5397
- status: number;
5398
- firingId: string;
5399
- outcome: "dropped";
5400
- reason: "busy" | "approval_pending" | "budget" | "rate_limited";
5401
- threadId: string | null;
5534
+ inputId: string;
5535
+ state: "cancelled";
5536
+ reason: "stopped";
5402
5537
  } | {
5403
- status: number;
5404
- firingId: string;
5405
- outcome: "rejected";
5406
- issues: Array<{
5407
- path: string;
5408
- message: string;
5538
+ id: string;
5539
+ threadId: string | null;
5540
+ inputId: string | null;
5541
+ kind: "turn" | "subagent" | "tool";
5542
+ subagentRunId: string | null;
5543
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
5544
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
5545
+ result: unknown;
5546
+ waits: Array<{
5547
+ kind: "approval" | "client_tool";
5548
+ toolCallId: string;
5549
+ toolName: string;
5550
+ input: unknown;
5409
5551
  }>;
5552
+ createdAt: string;
5553
+ finishedAt: string | null;
5410
5554
  };
5411
5555
  };
5412
- /** 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. */
5556
+ /** 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. */
5413
5557
  "triggers.create": {
5414
5558
  input: {
5415
5559
  /** A name: lowercase letters, digits, and single hyphens. */
5416
5560
  name: string;
5561
+ schedule: {
5562
+ cron: string;
5563
+ timeZone: string;
5564
+ } | null;
5417
5565
  displayName: Partial<Record<"en" | "ar", string>>;
5418
5566
  audience: {
5419
5567
  kind: "all";
@@ -5428,7 +5576,7 @@ export type ManagementProcedures = {
5428
5576
  output: {
5429
5577
  id: string;
5430
5578
  name: string;
5431
- rawSecret: string;
5579
+ rawSecret: string | null;
5432
5580
  };
5433
5581
  };
5434
5582
  /** Delete a trigger. */
@@ -5440,7 +5588,7 @@ export type ManagementProcedures = {
5440
5588
  id: string;
5441
5589
  };
5442
5590
  };
5443
- /** 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. */
5591
+ /** 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. */
5444
5592
  "triggers.fire": {
5445
5593
  input: {
5446
5594
  id: string;
@@ -5448,50 +5596,45 @@ export type ManagementProcedures = {
5448
5596
  payload: unknown;
5449
5597
  };
5450
5598
  output: {
5451
- status: number;
5452
- firingId: string;
5453
- outcome: "started";
5454
- threadId: string;
5599
+ inputId: string;
5600
+ state: "started";
5455
5601
  runId: string;
5456
- } | {
5457
- status: number;
5458
- firingId: string;
5459
- outcome: "awaiting_approval";
5460
5602
  threadId: string;
5461
- runId: string;
5462
- approvals: Array<{
5463
- toolCallId: string;
5464
- toolName: string;
5465
- input: unknown;
5603
+ } | {
5604
+ state: "rejected";
5605
+ issues: Array<{
5606
+ path: string;
5607
+ message: string;
5466
5608
  }>;
5467
5609
  } | {
5468
- status: number;
5469
- firingId: string;
5470
- outcome: "completed";
5471
- threadId: string;
5472
- runId: string;
5473
- output: unknown;
5610
+ inputId: string;
5611
+ state: "waiting";
5612
+ delivery: "prompt" | "steer" | "followUp" | "answer" | "note";
5474
5613
  } | {
5475
- status: number;
5476
- firingId: string;
5477
- outcome: "failed";
5478
- threadId: string;
5479
- runId: string;
5480
- reason: "busy" | "approval_pending" | "budget" | "rate_limited" | "invalid_payload" | "missing_thread_key" | "no_turn" | "no_output" | "invalid_output" | null;
5614
+ inputId: string | null;
5615
+ state: "refused";
5616
+ reason: "busy" | "approval_pending" | "conflict" | "rate_limited" | "budget" | "full" | "not_waiting";
5481
5617
  } | {
5482
- status: number;
5483
- firingId: string;
5484
- outcome: "dropped";
5485
- reason: "busy" | "approval_pending" | "budget" | "rate_limited";
5486
- threadId: string | null;
5618
+ inputId: string;
5619
+ state: "cancelled";
5620
+ reason: "stopped";
5487
5621
  } | {
5488
- status: number;
5489
- firingId: string;
5490
- outcome: "rejected";
5491
- issues: Array<{
5492
- path: string;
5493
- message: string;
5622
+ id: string;
5623
+ threadId: string | null;
5624
+ inputId: string | null;
5625
+ kind: "turn" | "subagent" | "tool";
5626
+ subagentRunId: string | null;
5627
+ status: "running" | "waiting" | "completed" | "failed" | "cancelled";
5628
+ reason: "no_output" | "invalid_output" | "stopped" | "cancelled" | "parent_cancelled" | "lost" | "timeout" | null;
5629
+ result: unknown;
5630
+ waits: Array<{
5631
+ kind: "approval" | "client_tool";
5632
+ toolCallId: string;
5633
+ toolName: string;
5634
+ input: unknown;
5494
5635
  }>;
5636
+ createdAt: string;
5637
+ finishedAt: string | null;
5495
5638
  };
5496
5639
  };
5497
5640
  /** One trigger by id with its draft instructions and payload schema. */
@@ -5508,13 +5651,22 @@ export type ManagementProcedures = {
5508
5651
  threadPolicy: {
5509
5652
  policy: "single";
5510
5653
  } | {
5511
- policy: "per-firing";
5654
+ policy: "per-input";
5512
5655
  } | {
5513
5656
  policy: "ephemeral";
5514
5657
  } | {
5515
5658
  policy: "keyed";
5516
5659
  key: string;
5660
+ } | {
5661
+ policy: "thread";
5662
+ key: string;
5663
+ wake: boolean;
5517
5664
  };
5665
+ schedule: {
5666
+ cron: string;
5667
+ timeZone: string;
5668
+ } | null;
5669
+ whileBusy: "refuse" | "queue" | "steer";
5518
5670
  budgetPerDay: number | null;
5519
5671
  disableAfterFailures: number;
5520
5672
  secretPrefix: string;
@@ -5600,13 +5752,21 @@ export type ManagementProcedures = {
5600
5752
  threadPolicy: {
5601
5753
  policy: "single";
5602
5754
  } | {
5603
- policy: "per-firing";
5755
+ policy: "per-input";
5604
5756
  } | {
5605
5757
  policy: "ephemeral";
5606
5758
  } | {
5607
5759
  policy: "keyed";
5608
5760
  key: string;
5761
+ } | {
5762
+ policy: "thread";
5763
+ key: string;
5764
+ wake: boolean;
5609
5765
  };
5766
+ schedule: {
5767
+ cron: string;
5768
+ timeZone: string;
5769
+ } | null;
5610
5770
  status: "draft" | "published" | "disabled";
5611
5771
  secretPrefix: string;
5612
5772
  displayName: Partial<Record<"en" | "ar", string>>;
@@ -5715,7 +5875,7 @@ export type ManagementProcedures = {
5715
5875
  unchanged: boolean;
5716
5876
  };
5717
5877
  };
5718
- /** 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. */
5878
+ /** 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. */
5719
5879
  "triggers.update": {
5720
5880
  input: {
5721
5881
  description: string;
@@ -5725,13 +5885,22 @@ export type ManagementProcedures = {
5725
5885
  threadPolicy: {
5726
5886
  policy: "single";
5727
5887
  } | {
5728
- policy: "per-firing";
5888
+ policy: "per-input";
5729
5889
  } | {
5730
5890
  policy: "ephemeral";
5731
5891
  } | {
5732
5892
  policy: "keyed";
5733
5893
  key: string;
5894
+ } | {
5895
+ policy: "thread";
5896
+ key: string;
5897
+ wake: boolean;
5734
5898
  };
5899
+ schedule: {
5900
+ cron: string;
5901
+ timeZone: string;
5902
+ } | null;
5903
+ whileBusy: "refuse" | "queue" | "steer";
5735
5904
  budgetPerDay: number | null;
5736
5905
  disableAfterFailures: number;
5737
5906
  id: string;
@@ -5876,7 +6045,7 @@ export type ManagementProcedures = {
5876
6045
  name: string;
5877
6046
  displayName: Partial<Record<"en" | "ar", string>>;
5878
6047
  description: string;
5879
- event: "approval_requested";
6048
+ event: "run_waiting" | "run_finished";
5880
6049
  url: string;
5881
6050
  headers: Array<{
5882
6051
  header: string;
@@ -5928,7 +6097,7 @@ export type ManagementProcedures = {
5928
6097
  items: Array<{
5929
6098
  id: string;
5930
6099
  name: string;
5931
- event: "approval_requested";
6100
+ event: "run_waiting" | "run_finished";
5932
6101
  url: string;
5933
6102
  enabled: boolean;
5934
6103
  displayName: Partial<Record<"en" | "ar", string>>;
@@ -5969,10 +6138,9 @@ export type ManagementProcedures = {
5969
6138
  id: string;
5970
6139
  serverId: string | null;
5971
6140
  agentId: string | null;
5972
- event: "approval_requested";
5973
- threadId: string;
6141
+ event: "run_waiting" | "run_finished";
6142
+ threadId: string | null;
5974
6143
  runId: string;
5975
- firingId: string | null;
5976
6144
  attempt: number;
5977
6145
  status: "delivered" | "failed";
5978
6146
  httpStatus: number | null;
@@ -6046,7 +6214,7 @@ export type ManagementProcedures = {
6046
6214
  "webhooks.update": {
6047
6215
  input: {
6048
6216
  description: string;
6049
- event: "approval_requested";
6217
+ event: "run_waiting" | "run_finished";
6050
6218
  url: string;
6051
6219
  headers: Array<{
6052
6220
  header: string;