@nylorun/core 0.34.0-beta → 0.35.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @nylorun/core
2
2
 
3
+ ## 0.35.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - 714bee2: The triggers capability (Host feature `agent-triggers`): an agent-folder/2 folder declares `engine: { triggers: true }` (the root agent's only; `engine.instructions.triggers` replaces its wording), which compiles to `harness.engine.triggers` and offers the root agent the `triggers` tool (`list`, `create`, `delete`) and the text block `triggers@1`. The Runtime serves each call as a `runtime` effect (operation `triggers`, `turn.start.agent.triggers`, Harness API v5.3): a trigger an agent makes is the Agent's (`origin: "agent"`, with its title and the session that made it), runs in the calling session (`session: "this"`) or one of its own (`"own"`, `<session>_t_<id>`), is checked against the limits in force (`runtime.limits.triggers` within the Tenant's), survives upgrades and waits paused while a version lacks the capability; a turn a trigger started can't create one. Tool rules take `kind: "runtime"`, so an `ask` rule can hold a `triggers` call (its interaction carries `metadata.input`); `DELETE /v1/agents/{id}/triggers/{triggerId}` deletes an agent's trigger (`409 trigger_from_manifest` for a manifest's); `GET /v1/runs/stream` serves the Tenant's runs as server-sent events from a cursor (`410 cursor_expired` across a reset). `client.agents.deleteTrigger`, `client.runs.stream` and `nylorun agents triggers rm` follow. The JSON Schemas are republished as `agent-manifest/v8.3`, `harness-manifest/v1.3`, `runtime-manifest/v1.2`, `agent-folder/v1/agent-md.3`, `agent-folder/v1/runtime.2` and `harness-api/v5.3`.
8
+
3
9
  ## 0.34.0-beta
4
10
 
5
11
  ### Minor Changes
@@ -250,7 +250,15 @@ export declare const OPTIONAL_HOST_FEATURES: readonly ["tenant-fixture-model", "
250
250
  * version the turn runs after its first segment re-pins it to the Agent's, so a session that
251
251
  * always sends it still moves to new versions.
252
252
  */
253
- "remove-tools"];
253
+ "remove-tools",
254
+ /**
255
+ * The triggers capability (D83): an agent whose version declares `harness.engine.triggers` sets
256
+ * up its own triggers with the `triggers` tool, kept by the Agent (`origin: agent` in
257
+ * `GET /v1/agents/{id}/triggers`); `DELETE /v1/agents/{id}/triggers/{triggerId}` deletes one;
258
+ * a tool rule of `kind: "runtime"` decides the operations the Runtime serves; the manifest's
259
+ * `runtime.limits.triggers`; and `GET /v1/runs/stream`, the Tenant's runs as server-sent events.
260
+ */
261
+ "agent-triggers"];
254
262
  export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
255
263
  export interface ProtocolRange {
256
264
  min: number;
@@ -273,6 +273,14 @@ export const OPTIONAL_HOST_FEATURES = [
273
273
  * always sends it still moves to new versions.
274
274
  */
275
275
  "remove-tools",
276
+ /**
277
+ * The triggers capability (D83): an agent whose version declares `harness.engine.triggers` sets
278
+ * up its own triggers with the `triggers` tool, kept by the Agent (`origin: agent` in
279
+ * `GET /v1/agents/{id}/triggers`); `DELETE /v1/agents/{id}/triggers/{triggerId}` deletes one;
280
+ * a tool rule of `kind: "runtime"` decides the operations the Runtime serves; the manifest's
281
+ * `runtime.limits.triggers`; and `GET /v1/runs/stream`, the Tenant's runs as server-sent events.
282
+ */
283
+ "agent-triggers",
276
284
  ];
277
285
  /**
278
286
  * What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
@@ -62,6 +62,7 @@ export declare const HarnessEngineSchema: z.ZodObject<{
62
62
  }, z.core.$strict>>;
63
63
  outputs: z.ZodOptional<z.ZodBoolean>;
64
64
  toolSearch: z.ZodOptional<z.ZodBoolean>;
65
+ triggers: z.ZodOptional<z.ZodBoolean>;
65
66
  instructions: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
66
67
  artifacts_read: "artifacts_read";
67
68
  artifacts_save: "artifacts_save";
@@ -73,6 +74,7 @@ export declare const HarnessEngineSchema: z.ZodObject<{
73
74
  skill_folder: "skill_folder";
74
75
  skills: "skills";
75
76
  tool_search: "tool_search";
77
+ triggers: "triggers";
76
78
  wake: "wake";
77
79
  }> & z.core.$partial, z.ZodString>>;
78
80
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -87,6 +89,7 @@ export declare const HarnessEngineSchema: z.ZodObject<{
87
89
  skill_folder: "skill_folder";
88
90
  skills: "skills";
89
91
  tool_search: "tool_search";
92
+ triggers: "triggers";
90
93
  wake: "wake";
91
94
  }>;
92
95
  version: z.ZodNumber;
@@ -219,6 +222,11 @@ export declare const EnvironmentLimitsSchema: z.ZodObject<{
219
222
  versionBytes: z.ZodOptional<z.ZodNumber>;
220
223
  versionEntries: z.ZodOptional<z.ZodNumber>;
221
224
  }, z.core.$strict>>;
225
+ triggers: z.ZodOptional<z.ZodObject<{
226
+ count: z.ZodOptional<z.ZodNumber>;
227
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
228
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
229
+ }, z.core.$strict>>;
222
230
  }, z.core.$strict>;
223
231
  export type EnvironmentLimits = z.infer<typeof EnvironmentLimitsSchema>;
224
232
  /**
@@ -291,6 +299,11 @@ export declare const EnvironmentRecipeSchema: z.ZodObject<{
291
299
  versionBytes: z.ZodOptional<z.ZodNumber>;
292
300
  versionEntries: z.ZodOptional<z.ZodNumber>;
293
301
  }, z.core.$strict>>;
302
+ triggers: z.ZodOptional<z.ZodObject<{
303
+ count: z.ZodOptional<z.ZodNumber>;
304
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
305
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
306
+ }, z.core.$strict>>;
294
307
  }, z.core.$strict>>;
295
308
  secrets: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
296
309
  required: z.ZodOptional<z.ZodBoolean>;
@@ -500,6 +513,11 @@ export declare const AgentViewSchema: z.ZodObject<{
500
513
  versionBytes: z.ZodOptional<z.ZodNumber>;
501
514
  versionEntries: z.ZodOptional<z.ZodNumber>;
502
515
  }, z.core.$strict>>;
516
+ triggers: z.ZodOptional<z.ZodObject<{
517
+ count: z.ZodOptional<z.ZodNumber>;
518
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
519
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
520
+ }, z.core.$strict>>;
503
521
  }, z.core.$strict>>;
504
522
  secrets: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
505
523
  required: z.ZodOptional<z.ZodBoolean>;
@@ -695,7 +713,7 @@ export declare const MemoryUpdatedPayloadSchema: z.ZodObject<{
695
713
  version: z.ZodNumber;
696
714
  }, z.core.$strict>>;
697
715
  }, z.core.$loose>;
698
- export declare const AGENT_EVENT_TYPES: readonly ["agent.created", "agent.attached", "agent.detached", "agent.deleted", "agent.running", "agent.suspended", "agent.relaunched", "agent.lost", "agent.reset", "agent.failed", "agent.forked", "agent.outdated", "agent.version_changed", "agent.start_failed", "agent.egress", "agent.run", "agent.trigger_paused", "agent.trigger_resumed", "agent.trigger_secret_rotated", "agent.memory_updated"];
716
+ export declare const AGENT_EVENT_TYPES: readonly ["agent.created", "agent.attached", "agent.detached", "agent.deleted", "agent.running", "agent.suspended", "agent.relaunched", "agent.lost", "agent.reset", "agent.failed", "agent.forked", "agent.outdated", "agent.version_changed", "agent.start_failed", "agent.egress", "agent.run", "agent.trigger_paused", "agent.trigger_resumed", "agent.trigger_secret_rotated", "agent.trigger_created", "agent.trigger_updated", "agent.trigger_deleted", "agent.memory_updated"];
699
717
  export type AgentEventType = (typeof AGENT_EVENT_TYPES)[number];
700
718
  /** The payload of each Agent lifecycle event. */
701
719
  export declare const AGENT_EVENT_PAYLOADS: {
@@ -848,6 +866,39 @@ export declare const AGENT_EVENT_PAYLOADS: {
848
866
  readonly "agent.trigger_secret_rotated": z.ZodObject<{
849
867
  triggerId: z.ZodString;
850
868
  }, z.core.$loose>;
869
+ /**
870
+ * An agent made a trigger with the `triggers` tool (D83), or replaced one with the same id
871
+ * (`agent.trigger_updated`): the session whose agent made it (`sessionId`), the session it runs
872
+ * in (`session`), its title and its next run.
873
+ */
874
+ readonly "agent.trigger_created": z.ZodObject<{
875
+ triggerId: z.ZodString;
876
+ kind: z.ZodEnum<{
877
+ at: "at";
878
+ schedule: "schedule";
879
+ }>;
880
+ sessionId: z.ZodString;
881
+ session: z.ZodString;
882
+ title: z.ZodOptional<z.ZodString>;
883
+ nextRunAt: z.ZodNullable<z.ZodString>;
884
+ }, z.core.$loose>;
885
+ readonly "agent.trigger_updated": z.ZodObject<{
886
+ triggerId: z.ZodString;
887
+ kind: z.ZodEnum<{
888
+ at: "at";
889
+ schedule: "schedule";
890
+ }>;
891
+ sessionId: z.ZodString;
892
+ session: z.ZodString;
893
+ title: z.ZodOptional<z.ZodString>;
894
+ nextRunAt: z.ZodNullable<z.ZodString>;
895
+ }, z.core.$loose>;
896
+ /** A trigger an agent made was deleted: by an agent of `sessionId`, or over the API (`principal`). */
897
+ readonly "agent.trigger_deleted": z.ZodObject<{
898
+ triggerId: z.ZodString;
899
+ sessionId: z.ZodOptional<z.ZodString>;
900
+ principal: z.ZodOptional<z.ZodString>;
901
+ }, z.core.$loose>;
851
902
  /** A turn changed the Agent's memories (`memory.updated` in its session): which, and how. */
852
903
  readonly "agent.memory_updated": z.ZodObject<{
853
904
  effectId: z.ZodString;
@@ -892,9 +943,12 @@ export declare const AgentEventSchema: z.ZodObject<{
892
943
  "agent.running": "agent.running";
893
944
  "agent.start_failed": "agent.start_failed";
894
945
  "agent.suspended": "agent.suspended";
946
+ "agent.trigger_created": "agent.trigger_created";
947
+ "agent.trigger_deleted": "agent.trigger_deleted";
895
948
  "agent.trigger_paused": "agent.trigger_paused";
896
949
  "agent.trigger_resumed": "agent.trigger_resumed";
897
950
  "agent.trigger_secret_rotated": "agent.trigger_secret_rotated";
951
+ "agent.trigger_updated": "agent.trigger_updated";
898
952
  "agent.version_changed": "agent.version_changed";
899
953
  }>;
900
954
  payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -925,9 +979,12 @@ export declare const ListAgentEventsResponseSchema: z.ZodObject<{
925
979
  "agent.running": "agent.running";
926
980
  "agent.start_failed": "agent.start_failed";
927
981
  "agent.suspended": "agent.suspended";
982
+ "agent.trigger_created": "agent.trigger_created";
983
+ "agent.trigger_deleted": "agent.trigger_deleted";
928
984
  "agent.trigger_paused": "agent.trigger_paused";
929
985
  "agent.trigger_resumed": "agent.trigger_resumed";
930
986
  "agent.trigger_secret_rotated": "agent.trigger_secret_rotated";
987
+ "agent.trigger_updated": "agent.trigger_updated";
931
988
  "agent.version_changed": "agent.version_changed";
932
989
  }>;
933
990
  payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -1298,7 +1355,17 @@ export declare function triggerKindOf(trigger: Trigger): Exclude<TriggerKind, "w
1298
1355
  * `manual`, or `new` for one an upgrade added), `completed` is an `at` that ran.
1299
1356
  */
1300
1357
  export declare const TRIGGER_STATUSES: readonly ["active", "paused", "completed"];
1301
- /** `GET /v1/agents/{id}/triggers`: one trigger, from its manifest entry and the Agent's state. */
1358
+ /**
1359
+ * Where a trigger's definition comes from (D83): `manifest` (the version's `runtime.triggers`),
1360
+ * `agent` (made by an agent of the Agent's sessions with the `triggers` tool, kept by the Agent)
1361
+ * or `wake` (a session's booked wake, never listed).
1362
+ */
1363
+ export declare const TRIGGER_ORIGINS: readonly ["manifest", "agent", "wake"];
1364
+ export type TriggerOrigin = (typeof TRIGGER_ORIGINS)[number];
1365
+ /**
1366
+ * `GET /v1/agents/{id}/triggers`: one trigger, from its manifest entry (or, for one an agent made,
1367
+ * its own definition) and the Agent's state.
1368
+ */
1302
1369
  export declare const TriggerViewSchema: z.ZodObject<{
1303
1370
  id: z.ZodString;
1304
1371
  kind: z.ZodEnum<{
@@ -1307,6 +1374,13 @@ export declare const TriggerViewSchema: z.ZodObject<{
1307
1374
  wake: "wake";
1308
1375
  webhook: "webhook";
1309
1376
  }>;
1377
+ origin: z.ZodEnum<{
1378
+ agent: "agent";
1379
+ manifest: "manifest";
1380
+ wake: "wake";
1381
+ }>;
1382
+ title: z.ZodNullable<z.ZodString>;
1383
+ createdSessionId: z.ZodNullable<z.ZodString>;
1310
1384
  status: z.ZodEnum<{
1311
1385
  active: "active";
1312
1386
  completed: "completed";
@@ -1321,6 +1395,7 @@ export declare const TriggerViewSchema: z.ZodObject<{
1321
1395
  lastRunAt: z.ZodNullable<z.ZodString>;
1322
1396
  webhookUrl: z.ZodOptional<z.ZodString>;
1323
1397
  secretSet: z.ZodOptional<z.ZodBoolean>;
1398
+ prompt: z.ZodOptional<z.ZodString>;
1324
1399
  }, z.core.$strict>;
1325
1400
  export type TriggerView = z.infer<typeof TriggerViewSchema>;
1326
1401
  export declare const TriggerListSchema: z.ZodObject<{
@@ -1332,6 +1407,13 @@ export declare const TriggerListSchema: z.ZodObject<{
1332
1407
  wake: "wake";
1333
1408
  webhook: "webhook";
1334
1409
  }>;
1410
+ origin: z.ZodEnum<{
1411
+ agent: "agent";
1412
+ manifest: "manifest";
1413
+ wake: "wake";
1414
+ }>;
1415
+ title: z.ZodNullable<z.ZodString>;
1416
+ createdSessionId: z.ZodNullable<z.ZodString>;
1335
1417
  status: z.ZodEnum<{
1336
1418
  active: "active";
1337
1419
  completed: "completed";
@@ -1346,8 +1428,88 @@ export declare const TriggerListSchema: z.ZodObject<{
1346
1428
  lastRunAt: z.ZodNullable<z.ZodString>;
1347
1429
  webhookUrl: z.ZodOptional<z.ZodString>;
1348
1430
  secretSet: z.ZodOptional<z.ZodBoolean>;
1431
+ prompt: z.ZodOptional<z.ZodString>;
1349
1432
  }, z.core.$strict>>;
1350
1433
  }, z.core.$strict>;
1434
+ /** `in` of the `triggers` tool (D83): a delay in minutes, hours or days, such as `30m`, `2h`, `1d`. */
1435
+ export declare const TRIGGER_DELAY_PATTERN: RegExp;
1436
+ /** The longest title an agent gives a trigger it makes. */
1437
+ export declare const TRIGGER_TITLE_MAX = 80;
1438
+ /** Where an agent-made trigger runs: the calling session (`this`), or a session of its own (`own`). */
1439
+ export declare const TRIGGER_TOOL_SESSIONS: readonly ["this", "own"];
1440
+ /**
1441
+ * A call of the `triggers` tool (D83), which the Runtime serves for an agent whose version
1442
+ * declares `engine.triggers`: `list` the triggers the calling session made; `create` one (or
1443
+ * replace the session's own with the same `id`) with exactly one of `schedule` (with `timezone`),
1444
+ * `at` or `in`, the `session` it runs in and its `prompt`; `delete` one by `id`.
1445
+ */
1446
+ export declare const TriggerToolInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1447
+ command: z.ZodLiteral<"list">;
1448
+ }, z.core.$strict>, z.ZodObject<{
1449
+ command: z.ZodLiteral<"create">;
1450
+ id: z.ZodString;
1451
+ title: z.ZodOptional<z.ZodString>;
1452
+ schedule: z.ZodOptional<z.ZodString>;
1453
+ timezone: z.ZodOptional<z.ZodString>;
1454
+ at: z.ZodOptional<z.ZodISODateTime>;
1455
+ in: z.ZodOptional<z.ZodString>;
1456
+ session: z.ZodEnum<{
1457
+ own: "own";
1458
+ this: "this";
1459
+ }>;
1460
+ prompt: z.ZodString;
1461
+ }, z.core.$strict>, z.ZodObject<{
1462
+ command: z.ZodLiteral<"delete">;
1463
+ id: z.ZodString;
1464
+ }, z.core.$strict>], "command">;
1465
+ export type TriggerToolInput = z.infer<typeof TriggerToolInputSchema>;
1466
+ /** One trigger as the `triggers` tool lists it. */
1467
+ export declare const TriggerToolItemSchema: z.ZodObject<{
1468
+ id: z.ZodString;
1469
+ title: z.ZodNullable<z.ZodString>;
1470
+ status: z.ZodEnum<{
1471
+ active: "active";
1472
+ completed: "completed";
1473
+ paused: "paused";
1474
+ }>;
1475
+ schedule: z.ZodOptional<z.ZodString>;
1476
+ timezone: z.ZodOptional<z.ZodString>;
1477
+ at: z.ZodOptional<z.ZodString>;
1478
+ session: z.ZodString;
1479
+ nextRunAt: z.ZodNullable<z.ZodString>;
1480
+ prompt: z.ZodString;
1481
+ }, z.core.$strict>;
1482
+ /** What a `triggers` call answers: the trigger made, the list, or the one deleted. */
1483
+ export declare const TriggerToolOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
1484
+ id: z.ZodString;
1485
+ status: z.ZodEnum<{
1486
+ active: "active";
1487
+ completed: "completed";
1488
+ paused: "paused";
1489
+ }>;
1490
+ nextRunAt: z.ZodNullable<z.ZodString>;
1491
+ session: z.ZodString;
1492
+ }, z.core.$strict>, z.ZodObject<{
1493
+ triggers: z.ZodArray<z.ZodObject<{
1494
+ id: z.ZodString;
1495
+ title: z.ZodNullable<z.ZodString>;
1496
+ status: z.ZodEnum<{
1497
+ active: "active";
1498
+ completed: "completed";
1499
+ paused: "paused";
1500
+ }>;
1501
+ schedule: z.ZodOptional<z.ZodString>;
1502
+ timezone: z.ZodOptional<z.ZodString>;
1503
+ at: z.ZodOptional<z.ZodString>;
1504
+ session: z.ZodString;
1505
+ nextRunAt: z.ZodNullable<z.ZodString>;
1506
+ prompt: z.ZodString;
1507
+ }, z.core.$strict>>;
1508
+ }, z.core.$strict>, z.ZodObject<{
1509
+ id: z.ZodString;
1510
+ deleted: z.ZodLiteral<true>;
1511
+ }, z.core.$strict>]>;
1512
+ export type TriggerToolOutput = z.infer<typeof TriggerToolOutputSchema>;
1351
1513
  /**
1352
1514
  * What a run came to: `started` a turn, `queued` a message behind a running turn,
1353
1515
  * `skipped` (nothing started: `overlap`, `rate_limited`, `paused`) or `failed` (`queue_full`,
@@ -1379,6 +1541,78 @@ export declare const TriggerRunSchema: z.ZodObject<{
1379
1541
  queuedMessageId: z.ZodNullable<z.ZodString>;
1380
1542
  }, z.core.$strict>;
1381
1543
  export type TriggerRun = z.infer<typeof TriggerRunSchema>;
1544
+ /**
1545
+ * One run on the Tenant's runs stream (D83, `GET /v1/runs/stream`): a run of any Agent's
1546
+ * triggers, as `TriggerRunSchema` has it, with its Agent and its trigger's origin and title. A
1547
+ * run may arrive twice (after a crash between append and mark); a reader drops a `runId` it has
1548
+ * seen.
1549
+ */
1550
+ export declare const TenantRunSchema: z.ZodObject<{
1551
+ runId: z.ZodString;
1552
+ agentId: z.ZodString;
1553
+ triggerId: z.ZodString;
1554
+ kind: z.ZodEnum<{
1555
+ at: "at";
1556
+ schedule: "schedule";
1557
+ wake: "wake";
1558
+ webhook: "webhook";
1559
+ }>;
1560
+ status: z.ZodEnum<{
1561
+ failed: "failed";
1562
+ queued: "queued";
1563
+ skipped: "skipped";
1564
+ started: "started";
1565
+ }>;
1566
+ reason: z.ZodNullable<z.ZodString>;
1567
+ sessionId: z.ZodNullable<z.ZodString>;
1568
+ turnId: z.ZodNullable<z.ZodString>;
1569
+ queuedMessageId: z.ZodNullable<z.ZodString>;
1570
+ dueAt: z.ZodString;
1571
+ firedAt: z.ZodString;
1572
+ late: z.ZodBoolean;
1573
+ origin: z.ZodEnum<{
1574
+ agent: "agent";
1575
+ manifest: "manifest";
1576
+ wake: "wake";
1577
+ }>;
1578
+ title: z.ZodNullable<z.ZodString>;
1579
+ }, z.core.$strict>;
1580
+ export type TenantRun = z.infer<typeof TenantRunSchema>;
1581
+ /** One event of `GET /v1/runs/stream` (`event: run`): the run, and the cursor to resume after it. */
1582
+ export declare const TenantRunEventSchema: z.ZodObject<{
1583
+ cursor: z.ZodString;
1584
+ run: z.ZodObject<{
1585
+ runId: z.ZodString;
1586
+ agentId: z.ZodString;
1587
+ triggerId: z.ZodString;
1588
+ kind: z.ZodEnum<{
1589
+ at: "at";
1590
+ schedule: "schedule";
1591
+ wake: "wake";
1592
+ webhook: "webhook";
1593
+ }>;
1594
+ status: z.ZodEnum<{
1595
+ failed: "failed";
1596
+ queued: "queued";
1597
+ skipped: "skipped";
1598
+ started: "started";
1599
+ }>;
1600
+ reason: z.ZodNullable<z.ZodString>;
1601
+ sessionId: z.ZodNullable<z.ZodString>;
1602
+ turnId: z.ZodNullable<z.ZodString>;
1603
+ queuedMessageId: z.ZodNullable<z.ZodString>;
1604
+ dueAt: z.ZodString;
1605
+ firedAt: z.ZodString;
1606
+ late: z.ZodBoolean;
1607
+ origin: z.ZodEnum<{
1608
+ agent: "agent";
1609
+ manifest: "manifest";
1610
+ wake: "wake";
1611
+ }>;
1612
+ title: z.ZodNullable<z.ZodString>;
1613
+ }, z.core.$strict>;
1614
+ }, z.core.$strict>;
1615
+ export type TenantRunEvent = z.infer<typeof TenantRunEventSchema>;
1382
1616
  /** `GET /v1/agents/{id}/runs`: runs, newest first. */
1383
1617
  export declare const TriggerRunPageSchema: z.ZodObject<{
1384
1618
  runs: z.ZodArray<z.ZodObject<{
@@ -1619,6 +1853,11 @@ export declare const RuntimeSectionSchema: z.ZodObject<{
1619
1853
  versionBytes: z.ZodOptional<z.ZodNumber>;
1620
1854
  versionEntries: z.ZodOptional<z.ZodNumber>;
1621
1855
  }, z.core.$strict>>;
1856
+ triggers: z.ZodOptional<z.ZodObject<{
1857
+ count: z.ZodOptional<z.ZodNumber>;
1858
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
1859
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
1860
+ }, z.core.$strict>>;
1622
1861
  }, z.core.$strict>>;
1623
1862
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1624
1863
  required: z.ZodOptional<z.ZodBoolean>;
@@ -1723,6 +1962,11 @@ export declare const AgentManifestV8Schema: z.ZodObject<{
1723
1962
  versionBytes: z.ZodOptional<z.ZodNumber>;
1724
1963
  versionEntries: z.ZodOptional<z.ZodNumber>;
1725
1964
  }, z.core.$strict>>;
1965
+ triggers: z.ZodOptional<z.ZodObject<{
1966
+ count: z.ZodOptional<z.ZodNumber>;
1967
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
1968
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
1969
+ }, z.core.$strict>>;
1726
1970
  }, z.core.$strict>>;
1727
1971
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1728
1972
  required: z.ZodOptional<z.ZodBoolean>;
@@ -1888,6 +2132,7 @@ export declare const HarnessManifestFileSchema: z.ZodObject<{
1888
2132
  }, z.core.$strict>>;
1889
2133
  outputs: z.ZodOptional<z.ZodBoolean>;
1890
2134
  toolSearch: z.ZodOptional<z.ZodBoolean>;
2135
+ triggers: z.ZodOptional<z.ZodBoolean>;
1891
2136
  instructions: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
1892
2137
  artifacts_read: "artifacts_read";
1893
2138
  artifacts_save: "artifacts_save";
@@ -1899,6 +2144,7 @@ export declare const HarnessManifestFileSchema: z.ZodObject<{
1899
2144
  skill_folder: "skill_folder";
1900
2145
  skills: "skills";
1901
2146
  tool_search: "tool_search";
2147
+ triggers: "triggers";
1902
2148
  wake: "wake";
1903
2149
  }> & z.core.$partial, z.ZodString>>;
1904
2150
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1913,6 +2159,7 @@ export declare const HarnessManifestFileSchema: z.ZodObject<{
1913
2159
  skill_folder: "skill_folder";
1914
2160
  skills: "skills";
1915
2161
  tool_search: "tool_search";
2162
+ triggers: "triggers";
1916
2163
  wake: "wake";
1917
2164
  }>;
1918
2165
  version: z.ZodNumber;
@@ -1969,6 +2216,11 @@ export declare const RuntimeManifestFileSchema: z.ZodObject<{
1969
2216
  versionBytes: z.ZodOptional<z.ZodNumber>;
1970
2217
  versionEntries: z.ZodOptional<z.ZodNumber>;
1971
2218
  }, z.core.$strict>>;
2219
+ triggers: z.ZodOptional<z.ZodObject<{
2220
+ count: z.ZodOptional<z.ZodNumber>;
2221
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
2222
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
2223
+ }, z.core.$strict>>;
1972
2224
  }, z.core.$strict>>;
1973
2225
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
1974
2226
  required: z.ZodOptional<z.ZodBoolean>;
@@ -2147,6 +2399,7 @@ export declare const AgentManifestFileSchema: z.ZodObject<{
2147
2399
  }, z.core.$strict>>;
2148
2400
  outputs: z.ZodOptional<z.ZodBoolean>;
2149
2401
  toolSearch: z.ZodOptional<z.ZodBoolean>;
2402
+ triggers: z.ZodOptional<z.ZodBoolean>;
2150
2403
  instructions: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
2151
2404
  artifacts_read: "artifacts_read";
2152
2405
  artifacts_save: "artifacts_save";
@@ -2158,6 +2411,7 @@ export declare const AgentManifestFileSchema: z.ZodObject<{
2158
2411
  skill_folder: "skill_folder";
2159
2412
  skills: "skills";
2160
2413
  tool_search: "tool_search";
2414
+ triggers: "triggers";
2161
2415
  wake: "wake";
2162
2416
  }> & z.core.$partial, z.ZodString>>;
2163
2417
  blocks: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -2172,6 +2426,7 @@ export declare const AgentManifestFileSchema: z.ZodObject<{
2172
2426
  skill_folder: "skill_folder";
2173
2427
  skills: "skills";
2174
2428
  tool_search: "tool_search";
2429
+ triggers: "triggers";
2175
2430
  wake: "wake";
2176
2431
  }>;
2177
2432
  version: z.ZodNumber;
@@ -2225,6 +2480,11 @@ export declare const AgentManifestFileSchema: z.ZodObject<{
2225
2480
  versionBytes: z.ZodOptional<z.ZodNumber>;
2226
2481
  versionEntries: z.ZodOptional<z.ZodNumber>;
2227
2482
  }, z.core.$strict>>;
2483
+ triggers: z.ZodOptional<z.ZodObject<{
2484
+ count: z.ZodOptional<z.ZodNumber>;
2485
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
2486
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
2487
+ }, z.core.$strict>>;
2228
2488
  }, z.core.$strict>>;
2229
2489
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2230
2490
  required: z.ZodOptional<z.ZodBoolean>;
@@ -2337,6 +2597,11 @@ export declare const PutAgentManifestRequestSchema: z.ZodObject<{
2337
2597
  versionBytes: z.ZodOptional<z.ZodNumber>;
2338
2598
  versionEntries: z.ZodOptional<z.ZodNumber>;
2339
2599
  }, z.core.$strict>>;
2600
+ triggers: z.ZodOptional<z.ZodObject<{
2601
+ count: z.ZodOptional<z.ZodNumber>;
2602
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
2603
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
2604
+ }, z.core.$strict>>;
2340
2605
  }, z.core.$strict>>;
2341
2606
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2342
2607
  required: z.ZodOptional<z.ZodBoolean>;
@@ -2512,6 +2777,11 @@ export declare const AgentManifestViewSchema: z.ZodObject<{
2512
2777
  versionBytes: z.ZodOptional<z.ZodNumber>;
2513
2778
  versionEntries: z.ZodOptional<z.ZodNumber>;
2514
2779
  }, z.core.$strict>>;
2780
+ triggers: z.ZodOptional<z.ZodObject<{
2781
+ count: z.ZodOptional<z.ZodNumber>;
2782
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
2783
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
2784
+ }, z.core.$strict>>;
2515
2785
  }, z.core.$strict>>;
2516
2786
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2517
2787
  required: z.ZodOptional<z.ZodBoolean>;
@@ -2702,6 +2972,11 @@ export declare const ListAgentManifestsResponseSchema: z.ZodObject<{
2702
2972
  versionBytes: z.ZodOptional<z.ZodNumber>;
2703
2973
  versionEntries: z.ZodOptional<z.ZodNumber>;
2704
2974
  }, z.core.$strict>>;
2975
+ triggers: z.ZodOptional<z.ZodObject<{
2976
+ count: z.ZodOptional<z.ZodNumber>;
2977
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
2978
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
2979
+ }, z.core.$strict>>;
2705
2980
  }, z.core.$strict>>;
2706
2981
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2707
2982
  required: z.ZodOptional<z.ZodBoolean>;
@@ -2889,6 +3164,11 @@ export declare const AgentManifestPlanSchema: z.ZodObject<{
2889
3164
  versionBytes: z.ZodOptional<z.ZodNumber>;
2890
3165
  versionEntries: z.ZodOptional<z.ZodNumber>;
2891
3166
  }, z.core.$strict>>;
3167
+ triggers: z.ZodOptional<z.ZodObject<{
3168
+ count: z.ZodOptional<z.ZodNumber>;
3169
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
3170
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
3171
+ }, z.core.$strict>>;
2892
3172
  }, z.core.$strict>>;
2893
3173
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
2894
3174
  required: z.ZodOptional<z.ZodBoolean>;
@@ -3026,6 +3306,11 @@ export declare const SaveAgentManifestResponseSchema: z.ZodObject<{
3026
3306
  versionBytes: z.ZodOptional<z.ZodNumber>;
3027
3307
  versionEntries: z.ZodOptional<z.ZodNumber>;
3028
3308
  }, z.core.$strict>>;
3309
+ triggers: z.ZodOptional<z.ZodObject<{
3310
+ count: z.ZodOptional<z.ZodNumber>;
3311
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
3312
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
3313
+ }, z.core.$strict>>;
3029
3314
  }, z.core.$strict>>;
3030
3315
  secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
3031
3316
  required: z.ZodOptional<z.ZodBoolean>;
@@ -3313,6 +3598,11 @@ export declare const ForkAgentResponseSchema: z.ZodUnion<readonly [z.ZodObject<{
3313
3598
  versionBytes: z.ZodOptional<z.ZodNumber>;
3314
3599
  versionEntries: z.ZodOptional<z.ZodNumber>;
3315
3600
  }, z.core.$strict>>;
3601
+ triggers: z.ZodOptional<z.ZodObject<{
3602
+ count: z.ZodOptional<z.ZodNumber>;
3603
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
3604
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
3605
+ }, z.core.$strict>>;
3316
3606
  }, z.core.$strict>>;
3317
3607
  secrets: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
3318
3608
  required: z.ZodOptional<z.ZodBoolean>;
@@ -6852,6 +7142,11 @@ export declare const ListAgentsResponseSchema: z.ZodObject<{
6852
7142
  versionBytes: z.ZodOptional<z.ZodNumber>;
6853
7143
  versionEntries: z.ZodOptional<z.ZodNumber>;
6854
7144
  }, z.core.$strict>>;
7145
+ triggers: z.ZodOptional<z.ZodObject<{
7146
+ count: z.ZodOptional<z.ZodNumber>;
7147
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
7148
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
7149
+ }, z.core.$strict>>;
6855
7150
  }, z.core.$strict>>;
6856
7151
  secrets: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
6857
7152
  required: z.ZodOptional<z.ZodBoolean>;
@@ -7411,10 +7706,12 @@ export declare const ToolInputConditionSchema: z.ZodObject<{
7411
7706
  export type ToolInputCondition = z.infer<typeof ToolInputConditionSchema>;
7412
7707
  /**
7413
7708
  * One rule of the Tenant's tool policy, applied at the Tool Gate to every MCP and HTTP tool call
7414
- * of every harness. A rule matches a call when every selector it sets matches: `tool` (the tool's
7415
- * identity: an MCP tool's own name on its server, or an HTTP tool's declared name; never the name
7416
- * a harness gave the model; `*` for any run of characters), `server` (an MCP server's name),
7417
- * `kind`, `agent` (the agent that calls it: the agent manifest's name, or the id of an agent used
7709
+ * of every harness, and to the operations the Runtime serves itself (`kind: "runtime"`, D83). A
7710
+ * rule matches a call when every selector it sets matches: `tool` (the tool's identity: an MCP
7711
+ * tool's own name on its server, an HTTP tool's declared name, or a runtime operation:
7712
+ * `triggers`, `memory`, `schedule_wake`; never the name a harness gave the model; `*` for any run
7713
+ * of characters), `server` (an MCP server's name), `kind` (a runtime operation matches only a rule
7714
+ * that names `kind: "runtime"`), `agent` (the agent that calls it: the agent manifest's name, or the id of an agent used
7418
7715
  * as a tool or of a flow's agent; never an Agent's id; the session's root agent's name matches its
7419
7716
  * subagents' calls too, those of the agents it uses as tools) and `when` (fields of the input, by
7420
7717
  * dotted path). The strictest matching rule decides: `deny` refuses the call before it is sent,
@@ -7435,6 +7732,7 @@ export declare const ToolRuleSchema: z.ZodObject<{
7435
7732
  kind: z.ZodOptional<z.ZodEnum<{
7436
7733
  http: "http";
7437
7734
  mcp: "mcp";
7735
+ runtime: "runtime";
7438
7736
  }>>;
7439
7737
  agent: z.ZodOptional<z.ZodString>;
7440
7738
  when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -7463,6 +7761,7 @@ export declare const PutToolPolicyRequestSchema: z.ZodObject<{
7463
7761
  kind: z.ZodOptional<z.ZodEnum<{
7464
7762
  http: "http";
7465
7763
  mcp: "mcp";
7764
+ runtime: "runtime";
7466
7765
  }>>;
7467
7766
  agent: z.ZodOptional<z.ZodString>;
7468
7767
  when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -7491,6 +7790,7 @@ export declare const ToolPolicySchema: z.ZodObject<{
7491
7790
  kind: z.ZodOptional<z.ZodEnum<{
7492
7791
  http: "http";
7493
7792
  mcp: "mcp";
7793
+ runtime: "runtime";
7494
7794
  }>>;
7495
7795
  agent: z.ZodOptional<z.ZodString>;
7496
7796
  when: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
@@ -8901,6 +9201,11 @@ export declare const AgentPageSchema: z.ZodObject<{
8901
9201
  versionBytes: z.ZodOptional<z.ZodNumber>;
8902
9202
  versionEntries: z.ZodOptional<z.ZodNumber>;
8903
9203
  }, z.core.$strict>>;
9204
+ triggers: z.ZodOptional<z.ZodObject<{
9205
+ count: z.ZodOptional<z.ZodNumber>;
9206
+ minIntervalMs: z.ZodOptional<z.ZodNumber>;
9207
+ runsPerHour: z.ZodOptional<z.ZodNumber>;
9208
+ }, z.core.$strict>>;
8904
9209
  }, z.core.$strict>>;
8905
9210
  secrets: z.ZodOptional<z.ZodLazy<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
8906
9211
  required: z.ZodOptional<z.ZodBoolean>;