@nylorun/runtime 0.51.2-beta → 0.53.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/dist/adapters/sandbox/computer.d.ts +28 -0
  3. package/dist/adapters/sandbox/computer.js +184 -0
  4. package/dist/api/components.d.ts +48 -0
  5. package/dist/api/components.js +3 -1
  6. package/dist/api/http/routes/triggers.js +38 -6
  7. package/dist/api/openapi.js +1 -0
  8. package/dist/artifacts/disk.js +10 -2
  9. package/dist/harness/computer.d.ts +86 -0
  10. package/dist/harness/computer.js +273 -0
  11. package/dist/harness/executors.d.ts +5 -0
  12. package/dist/harness/executors.js +13 -5
  13. package/dist/harness/pod.d.ts +2 -0
  14. package/dist/harness/pod.js +1 -1
  15. package/dist/harness/service.js +58 -22
  16. package/dist/harness-api/server.js +17 -0
  17. package/dist/harness-api/start.js +2 -0
  18. package/dist/harness-api/workspace.d.ts +5 -0
  19. package/dist/harness-api/workspace.js +9 -5
  20. package/dist/host/harness-entry.js +7 -2
  21. package/dist/host/main.js +13 -0
  22. package/dist/host/stack-config.d.ts +13 -1
  23. package/dist/host/stack-config.js +42 -2
  24. package/dist/management-openapi.json +2 -1
  25. package/dist/openapi.json +348 -44
  26. package/dist/sandbox/computer.d.ts +53 -0
  27. package/dist/sandbox/computer.js +271 -0
  28. package/dist/sandbox/placement.d.ts +5 -2
  29. package/dist/sandbox/placement.js +6 -3
  30. package/dist/sandbox/pods/reconcile.js +1 -0
  31. package/dist/sandbox/pods/spec.d.ts +5 -0
  32. package/dist/sandbox/pods/spec.js +1 -1
  33. package/dist/sandbox/records.d.ts +2 -0
  34. package/dist/sandbox/records.js +11 -0
  35. package/dist/sandbox/types.d.ts +5 -2
  36. package/dist/store/postgres/drizzle/0049_agent_triggers_api.sql +3 -0
  37. package/dist/store/postgres/drizzle/meta/_journal.json +7 -0
  38. package/dist/store/postgres/schema.d.ts +21 -4
  39. package/dist/store/postgres/schema.js +10 -7
  40. package/dist/tenant/advance.js +6 -3
  41. package/dist/tenant/agent-triggers.js +5 -2
  42. package/dist/tenant/api-triggers.d.ts +33 -0
  43. package/dist/tenant/api-triggers.js +140 -0
  44. package/dist/tenant/context.d.ts +3 -0
  45. package/dist/tenant/runtime.js +34 -0
  46. package/dist/tenant/sessions.js +2 -1
  47. package/dist/tenant/sweep.js +2 -1
  48. package/dist/tenant/transcript.d.ts +8 -8
  49. package/dist/tenant/triggers.d.ts +6 -4
  50. package/dist/tenant/triggers.js +22 -11
  51. package/dist/version.d.ts +1 -1
  52. package/dist/version.js +1 -1
  53. package/package.json +3 -3
@@ -53,7 +53,7 @@ import { LOOPBACK_HOSTS } from "@nylorun/core/contracts";
53
53
  import { blockedAddresses } from "../sandbox/pods/network-gate.js";
54
54
  import { HostTuningError, parseHostTuning } from "../tuning.js";
55
55
  import { HOST_IDENTITY_PROVIDERS } from "../vault/host-identity.js";
56
- export const RUNTIME_SERVICES = ["core", "loop", "gates", "keys", "egress", "harness"];
56
+ export const RUNTIME_SERVICES = ["core", "loop", "gates", "keys", "egress", "harness", "computer"];
57
57
  /**
58
58
  * Services that may share a process (D12): they hold the same secrets and parse the same
59
59
  * trust class of input. keys joins gates (F4.2), and egress joins them (F7.2). The harness
@@ -63,6 +63,7 @@ const SERVICE_GROUPS = [
63
63
  ["core", "loop"],
64
64
  ["gates", "keys", "egress"],
65
65
  ["harness"],
66
+ ["computer"],
66
67
  ];
67
68
  /** Where the gates service listens by default. */
68
69
  export const DEFAULT_GATES_LISTEN_PORT = 4100;
@@ -264,6 +265,8 @@ export function parseStackConfig(env, argv) {
264
265
  const tuning = parseTuning(env);
265
266
  if (services.has("harness"))
266
267
  return { services, harness: parseHarnessService(env), endpoints: {}, ...(tuning ? { tuning } : {}) };
268
+ if (services.has("computer"))
269
+ return { services, computer: parseComputerService(env), endpoints: {}, ...(tuning ? { tuning } : {}) };
267
270
  // The image sets NYLORUN_LISTEN_*: only the API's processes read them.
268
271
  const servesApi = services.has("core") || services.has("loop");
269
272
  const listen = servesApi ? parseListen(env) : undefined;
@@ -567,7 +570,16 @@ function parseSandboxes(env) {
567
570
  const harnessImage = read(env, "NYLORUN_SANDBOX_HARNESS_IMAGE");
568
571
  if (harnessImage === undefined || /\s/.test(harnessImage))
569
572
  throw new StackConfigError("NYLORUN_SANDBOX_HARNESS_IMAGE is required with NYLORUN_SANDBOXES_URL: the Runtime image sandbox pods copy the engine from (`nylorun start` sets it)");
570
- return { url: url.replace(/\/+$/, ""), token, harnessImage };
573
+ const gatewayUrl = parseUrl(env, "NYLORUN_SANDBOX_GATEWAY_URL", ["http:", "https:"]);
574
+ const ticketKeyFile = read(env, "NYLORUN_COMPUTER_TICKET_KEY_FILE");
575
+ if ((gatewayUrl === undefined) !== (ticketKeyFile === undefined))
576
+ throw new StackConfigError("NYLORUN_SANDBOX_GATEWAY_URL and NYLORUN_COMPUTER_TICKET_KEY_FILE go together: computers need the sandbox gateway and the key core signs their tickets with");
577
+ return {
578
+ url: url.replace(/\/+$/, ""),
579
+ token,
580
+ harnessImage,
581
+ ...(gatewayUrl && ticketKeyFile ? { computer: { gatewayUrl: gatewayUrl.replace(/\/+$/, ""), ticketKeyFile } } : {}),
582
+ };
571
583
  }
572
584
  /**
573
585
  * `StackConfig.harnessListener` from `NYLORUN_HARNESS_LISTEN_*` and `NYLORUN_HARNESS_TOKEN`
@@ -585,6 +597,34 @@ function parseHarnessListener(env, tokenRequired = true) {
585
597
  }
586
598
  /** What a harness process must not hold: it runs next to agent code. */
587
599
  const HARNESS_REFUSED = ["NYLORUN_DATABASE_URL", "NYLORUN_GATES_TOKEN", "NYLORUN_KEYS_URL"];
600
+ /**
601
+ * The engine in a computer (ADR-149), from the variables its template carries: the port, the
602
+ * ticket key's public half and the file with the actor's name. It holds no Runtime credential.
603
+ */
604
+ function parseComputerService(env) {
605
+ const held = [...HARNESS_REFUSED, "NYLORUN_HARNESS_TOKEN", "NYLORUN_JOIN_TOKEN"].filter((name) => read(env, name) !== undefined);
606
+ if (held.length > 0)
607
+ throw new StackConfigError(`--service computer refuses to start with ${held.join(", ")} set: a computer holds no Runtime credential`);
608
+ const ticketKey = read(env, "NYLORUN_COMPUTER_TICKET_KEY");
609
+ if (ticketKey === undefined || !ticketKey.includes("PUBLIC KEY"))
610
+ throw new StackConfigError("NYLORUN_COMPUTER_TICKET_KEY is required for --service computer: the PEM public key tickets are checked with");
611
+ const nameFile = read(env, "NYLORUN_COMPUTER_NAME_FILE");
612
+ if (nameFile === undefined)
613
+ throw new StackConfigError("NYLORUN_COMPUTER_NAME_FILE is required for --service computer: the file holding the actor's name");
614
+ const rawPort = read(env, "NYLORUN_COMPUTER_PORT");
615
+ const root = read(env, "NYLORUN_HARNESS_ROOT") ?? "/harness";
616
+ if (!root.startsWith("/"))
617
+ throw new StackConfigError(`NYLORUN_HARNESS_ROOT must be an absolute path, not ${root}`);
618
+ const egressCaFile = read(env, "NYLORUN_SANDBOX_EGRESS_CA_FILE");
619
+ return {
620
+ port: rawPort === undefined ? 8080 : parsePort("NYLORUN_COMPUTER_PORT", rawPort),
621
+ ticketKey,
622
+ nameFile,
623
+ root,
624
+ ...(egressCaFile ? { egressCaFile } : {}),
625
+ substrate: read(env, "NYLORUN_SANDBOX_SUBSTRATE") === "1",
626
+ };
627
+ }
588
628
  /** `StackConfig.harness` from `NYLORUN_HARNESS_*` and `NYLORUN_GATES_URL`. */
589
629
  function parseHarnessService(env) {
590
630
  const held = [
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.2.0",
3
3
  "info": {
4
4
  "title": "Nylorun Management API",
5
- "version": "0.51.2-beta",
5
+ "version": "0.53.0-beta",
6
6
  "x-nylorun-protocol": {
7
7
  "min": 16,
8
8
  "max": 18,
@@ -44,6 +44,7 @@
44
44
  "secret-routing",
45
45
  "remove-tools",
46
46
  "agent-triggers",
47
+ "api-triggers",
47
48
  "steer",
48
49
  "queue-recovery",
49
50
  "a2a-steer"
package/dist/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.2.0",
3
3
  "info": {
4
4
  "title": "Nylorun Runtime API",
5
- "version": "0.51.2-beta",
5
+ "version": "0.53.0-beta",
6
6
  "x-nylorun-protocol": {
7
7
  "min": 16,
8
8
  "max": 18,
@@ -44,6 +44,7 @@
44
44
  "secret-routing",
45
45
  "remove-tools",
46
46
  "agent-triggers",
47
+ "api-triggers",
47
48
  "steer",
48
49
  "queue-recovery",
49
50
  "a2a-steer"
@@ -23102,6 +23103,7 @@
23102
23103
  "enum": [
23103
23104
  "manifest",
23104
23105
  "agent",
23106
+ "api",
23105
23107
  "wake"
23106
23108
  ]
23107
23109
  },
@@ -23117,6 +23119,12 @@
23117
23119
  "null"
23118
23120
  ]
23119
23121
  },
23122
+ "principal": {
23123
+ "type": [
23124
+ "string",
23125
+ "null"
23126
+ ]
23127
+ },
23120
23128
  "status": {
23121
23129
  "type": "string",
23122
23130
  "enum": [
@@ -23186,6 +23194,152 @@
23186
23194
  ],
23187
23195
  "additionalProperties": false
23188
23196
  },
23197
+ "TriggerView": {
23198
+ "type": "object",
23199
+ "properties": {
23200
+ "id": {
23201
+ "type": "string"
23202
+ },
23203
+ "kind": {
23204
+ "type": "string",
23205
+ "enum": [
23206
+ "schedule",
23207
+ "at",
23208
+ "webhook",
23209
+ "wake"
23210
+ ]
23211
+ },
23212
+ "origin": {
23213
+ "type": "string",
23214
+ "enum": [
23215
+ "manifest",
23216
+ "agent",
23217
+ "api",
23218
+ "wake"
23219
+ ]
23220
+ },
23221
+ "title": {
23222
+ "type": [
23223
+ "string",
23224
+ "null"
23225
+ ]
23226
+ },
23227
+ "createdSessionId": {
23228
+ "type": [
23229
+ "string",
23230
+ "null"
23231
+ ]
23232
+ },
23233
+ "principal": {
23234
+ "type": [
23235
+ "string",
23236
+ "null"
23237
+ ]
23238
+ },
23239
+ "status": {
23240
+ "type": "string",
23241
+ "enum": [
23242
+ "active",
23243
+ "paused",
23244
+ "completed"
23245
+ ]
23246
+ },
23247
+ "pausedReason": {
23248
+ "type": [
23249
+ "string",
23250
+ "null"
23251
+ ]
23252
+ },
23253
+ "schedule": {
23254
+ "type": "string"
23255
+ },
23256
+ "timezone": {
23257
+ "type": "string"
23258
+ },
23259
+ "at": {
23260
+ "type": "string"
23261
+ },
23262
+ "session": {
23263
+ "type": "string"
23264
+ },
23265
+ "nextRunAt": {
23266
+ "type": [
23267
+ "string",
23268
+ "null"
23269
+ ]
23270
+ },
23271
+ "lastRunAt": {
23272
+ "type": [
23273
+ "string",
23274
+ "null"
23275
+ ]
23276
+ },
23277
+ "webhookUrl": {
23278
+ "type": "string"
23279
+ },
23280
+ "secretSet": {
23281
+ "type": "boolean"
23282
+ },
23283
+ "prompt": {
23284
+ "type": "string"
23285
+ }
23286
+ },
23287
+ "required": [
23288
+ "id",
23289
+ "kind",
23290
+ "origin",
23291
+ "title",
23292
+ "createdSessionId",
23293
+ "status",
23294
+ "pausedReason",
23295
+ "session",
23296
+ "nextRunAt",
23297
+ "lastRunAt"
23298
+ ],
23299
+ "additionalProperties": false
23300
+ },
23301
+ "PutTriggerRequest": {
23302
+ "type": "object",
23303
+ "properties": {
23304
+ "schedule": {
23305
+ "type": "string",
23306
+ "pattern": "^\\S+(\\s+\\S+){4}$"
23307
+ },
23308
+ "timezone": {
23309
+ "type": "string",
23310
+ "minLength": 1
23311
+ },
23312
+ "at": {
23313
+ "type": "string",
23314
+ "format": "date-time"
23315
+ },
23316
+ "webhook": {
23317
+ "type": "string",
23318
+ "enum": [
23319
+ "standard-webhooks"
23320
+ ]
23321
+ },
23322
+ "session": {
23323
+ "type": "string",
23324
+ "minLength": 1,
23325
+ "maxLength": 200
23326
+ },
23327
+ "prompt": {
23328
+ "type": "string",
23329
+ "minLength": 1
23330
+ },
23331
+ "title": {
23332
+ "type": "string",
23333
+ "minLength": 1,
23334
+ "maxLength": 80
23335
+ }
23336
+ },
23337
+ "required": [
23338
+ "session",
23339
+ "prompt"
23340
+ ],
23341
+ "additionalProperties": false
23342
+ },
23189
23343
  "RunTriggerResponse": {
23190
23344
  "type": "object",
23191
23345
  "properties": {
@@ -23440,6 +23594,7 @@
23440
23594
  "enum": [
23441
23595
  "manifest",
23442
23596
  "agent",
23597
+ "api",
23443
23598
  "wake"
23444
23599
  ]
23445
23600
  },
@@ -31997,7 +32152,7 @@
31997
32152
  "Triggers"
31998
32153
  ],
31999
32154
  "summary": "List an Agent's triggers",
32000
- "description": "Each trigger its manifest declares, and each its agents made with the `triggers` tool (`origin: agent`, with the title and the session that made it), with what the Agent holds of it: its status (`active`, `paused` with a reason, `completed` for an `at` that ran), its prompt, when it runs next and last ran. A session's booked wake is not listed.",
32155
+ "description": "Each trigger its manifest declares, each its agents made with the `triggers` tool (`origin: agent`, with the title and the session that made it), and each a client put over the API (`origin: api`, with the title and the `principal` that put it), with what the Agent holds of it: its status (`active`, `paused` with a reason, `completed` for an `at` that ran), its prompt, when it runs next and last ran. A session's booked wake is not listed.",
32001
32156
  "security": [
32002
32157
  {
32003
32158
  "applicationKey": []
@@ -32132,13 +32287,13 @@
32132
32287
  }
32133
32288
  }
32134
32289
  },
32135
- "/v1/agents/{agentId}/triggers/{triggerId}/pause": {
32136
- "post": {
32290
+ "/v1/agents/{agentId}/triggers/{triggerId}": {
32291
+ "put": {
32137
32292
  "tags": [
32138
32293
  "Triggers"
32139
32294
  ],
32140
- "summary": "Pause a trigger",
32141
- "description": "It stops firing until it is resumed; a run already started or queued goes on.",
32295
+ "summary": "Put a trigger on an Agent",
32296
+ "description": "Creates or replaces the Agent's trigger `triggerId` of origin `api`: a `Trigger` exactly as a definition's `runtime.triggers` entry holds it (one of `schedule` with `timezone`, `at` or `webhook`; `session`; `prompt`), and an optional `title`. A new one is active with its next time; a replaced one gets its next time again and keeps its status, so a paused one stays paused. The same body again changes nothing and records no event. The checks and limits are a definition's; `runtime.limits.triggers.count` covers the triggers the Agent's agents made and those put here. Upgrades never touch it; `DELETE` removes it. Records `agent.trigger_created` or `agent.trigger_updated` (with `changed`) on the Agent's events. Host feature `api-triggers`.",
32142
32297
  "security": [
32143
32298
  {
32144
32299
  "applicationKey": []
@@ -32207,19 +32362,32 @@
32207
32362
  "in": "header"
32208
32363
  }
32209
32364
  ],
32365
+ "requestBody": {
32366
+ "required": true,
32367
+ "content": {
32368
+ "application/json": {
32369
+ "schema": {
32370
+ "$ref": "#/components/schemas/PutTriggerRequest"
32371
+ }
32372
+ }
32373
+ }
32374
+ },
32210
32375
  "responses": {
32211
32376
  "200": {
32212
- "description": "The Agent's triggers",
32377
+ "description": "The trigger, as the list shows it",
32213
32378
  "content": {
32214
32379
  "application/json": {
32215
32380
  "schema": {
32216
- "$ref": "#/components/schemas/TriggerList"
32381
+ "$ref": "#/components/schemas/TriggerView"
32217
32382
  }
32218
32383
  }
32219
32384
  }
32220
32385
  },
32221
32386
  "400": {
32222
- "description": "Invalid headers, path, body or cursor",
32387
+ "description": "Not a trigger, or one the checks refuse: a bad cron or time zone, runs closer than the minimum interval, an `at` not in the future, a prompt too long"
32388
+ },
32389
+ "401": {
32390
+ "description": "No credential (`credential_required`), one the Tenant does not accept (`credential_invalid`), a token that expired (`token_expired`), or a token whose issuer's keys cannot be fetched now (`issuer_unavailable`). `WWW-Authenticate: Bearer` names the protected resource metadata (`resource_metadata`)",
32223
32391
  "content": {
32224
32392
  "application/json": {
32225
32393
  "schema": {
@@ -32228,8 +32396,8 @@
32228
32396
  }
32229
32397
  }
32230
32398
  },
32231
- "401": {
32232
- "description": "No credential (`credential_required`), one the Tenant does not accept (`credential_invalid`), a token that expired (`token_expired`), or a token whose issuer's keys cannot be fetched now (`issuer_unavailable`). `WWW-Authenticate: Bearer` names the protected resource metadata (`resource_metadata`)",
32399
+ "403": {
32400
+ "description": "Not allowed for this credential or subject scope (`scope_required`; a token also gets `WWW-Authenticate: Bearer error=\"insufficient_scope\"` and the scope), a key of the other API (`key_role_mismatch`), or an application key from a browser (`origin_rejected`)",
32233
32401
  "content": {
32234
32402
  "application/json": {
32235
32403
  "schema": {
@@ -32238,8 +32406,27 @@
32238
32406
  }
32239
32407
  }
32240
32408
  },
32241
- "403": {
32242
- "description": "Not allowed for this credential or subject scope (`scope_required`; a token also gets `WWW-Authenticate: Bearer error=\"insufficient_scope\"` and the scope), a key of the other API (`key_role_mismatch`), or an application key from a browser (`origin_rejected`)",
32409
+ "404": {
32410
+ "description": "No such Agent"
32411
+ },
32412
+ "409": {
32413
+ "description": "The definition declares this id, or an agent's trigger or a booked wake holds it (`trigger_conflict`)"
32414
+ },
32415
+ "422": {
32416
+ "description": "The Agent holds as many triggers its agents or clients made as `limits.triggers.count` allows (`trigger_limit`)"
32417
+ },
32418
+ "426": {
32419
+ "description": "`Nylorun-Protocol` missing or unsupported",
32420
+ "content": {
32421
+ "application/json": {
32422
+ "schema": {
32423
+ "$ref": "#/components/schemas/ProtocolRejected"
32424
+ }
32425
+ }
32426
+ }
32427
+ },
32428
+ "503": {
32429
+ "description": "The Tenant's storage or streams are unavailable",
32243
32430
  "content": {
32244
32431
  "application/json": {
32245
32432
  "schema": {
@@ -32247,9 +32434,96 @@
32247
32434
  }
32248
32435
  }
32249
32436
  }
32437
+ }
32438
+ }
32439
+ },
32440
+ "delete": {
32441
+ "tags": [
32442
+ "Triggers"
32443
+ ],
32444
+ "summary": "Delete a trigger an agent made or a client put",
32445
+ "description": "Deletes a trigger one of the Agent's agents made with the `triggers` tool (`origin: agent`) or a client put (`origin: api`), with `agent.trigger_deleted` on the Agent's events; its runs stay. A trigger its manifest declares is refused (`trigger_from_manifest`): save a version without it, or pause it.",
32446
+ "security": [
32447
+ {
32448
+ "applicationKey": []
32250
32449
  },
32251
- "404": {
32252
- "description": "Not found (`not_found`)",
32450
+ {
32451
+ "issuerToken": []
32452
+ }
32453
+ ],
32454
+ "x-nylorun-credentials": [
32455
+ "application",
32456
+ "subject",
32457
+ "token"
32458
+ ],
32459
+ "x-nylorun-scopes": [
32460
+ "agents:write"
32461
+ ],
32462
+ "parameters": [
32463
+ {
32464
+ "schema": {
32465
+ "type": "string",
32466
+ "description": "The Agent id, percent-encoded"
32467
+ },
32468
+ "required": true,
32469
+ "description": "The Agent id, percent-encoded",
32470
+ "name": "agentId",
32471
+ "in": "path"
32472
+ },
32473
+ {
32474
+ "schema": {
32475
+ "type": "string",
32476
+ "description": "The trigger's id: in the manifest's `runtime.triggers`, or the one its agent gave it"
32477
+ },
32478
+ "required": true,
32479
+ "description": "The trigger's id: in the manifest's `runtime.triggers`, or the one its agent gave it",
32480
+ "name": "triggerId",
32481
+ "in": "path"
32482
+ },
32483
+ {
32484
+ "schema": {
32485
+ "type": "string",
32486
+ "description": "The protocol version, `18`"
32487
+ },
32488
+ "required": true,
32489
+ "description": "The protocol version, `18`",
32490
+ "name": "Nylorun-Protocol",
32491
+ "in": "header"
32492
+ },
32493
+ {
32494
+ "schema": {
32495
+ "type": "string",
32496
+ "description": "The person an application key acts for"
32497
+ },
32498
+ "required": false,
32499
+ "description": "The person an application key acts for",
32500
+ "name": "Nylorun-Subject",
32501
+ "in": "header"
32502
+ },
32503
+ {
32504
+ "schema": {
32505
+ "type": "string",
32506
+ "description": "The subject's space-separated scopes; required with a subject"
32507
+ },
32508
+ "required": false,
32509
+ "description": "The subject's space-separated scopes; required with a subject",
32510
+ "name": "Nylorun-Scopes",
32511
+ "in": "header"
32512
+ }
32513
+ ],
32514
+ "responses": {
32515
+ "200": {
32516
+ "description": "Deleted",
32517
+ "content": {
32518
+ "application/json": {
32519
+ "schema": {
32520
+ "$ref": "#/components/schemas/DeletedResponse"
32521
+ }
32522
+ }
32523
+ }
32524
+ },
32525
+ "400": {
32526
+ "description": "Invalid headers, path, body or cursor",
32253
32527
  "content": {
32254
32528
  "application/json": {
32255
32529
  "schema": {
@@ -32258,8 +32532,31 @@
32258
32532
  }
32259
32533
  }
32260
32534
  },
32535
+ "401": {
32536
+ "description": "No credential (`credential_required`), one the Tenant does not accept (`credential_invalid`), a token that expired (`token_expired`), or a token whose issuer's keys cannot be fetched now (`issuer_unavailable`). `WWW-Authenticate: Bearer` names the protected resource metadata (`resource_metadata`)",
32537
+ "content": {
32538
+ "application/json": {
32539
+ "schema": {
32540
+ "$ref": "#/components/schemas/Rejected"
32541
+ }
32542
+ }
32543
+ }
32544
+ },
32545
+ "403": {
32546
+ "description": "Not allowed for this credential or subject scope (`scope_required`; a token also gets `WWW-Authenticate: Bearer error=\"insufficient_scope\"` and the scope), a key of the other API (`key_role_mismatch`), or an application key from a browser (`origin_rejected`)",
32547
+ "content": {
32548
+ "application/json": {
32549
+ "schema": {
32550
+ "$ref": "#/components/schemas/Rejected"
32551
+ }
32552
+ }
32553
+ }
32554
+ },
32555
+ "404": {
32556
+ "description": "The Agent has no such trigger"
32557
+ },
32261
32558
  "409": {
32262
- "description": "An `at` whose time has passed (`trigger_expired`)"
32559
+ "description": "The manifest declares it (`trigger_from_manifest`)"
32263
32560
  },
32264
32561
  "426": {
32265
32562
  "description": "`Nylorun-Protocol` missing or unsupported",
@@ -32284,13 +32581,13 @@
32284
32581
  }
32285
32582
  }
32286
32583
  },
32287
- "/v1/agents/{agentId}/triggers/{triggerId}/resume": {
32584
+ "/v1/agents/{agentId}/triggers/{triggerId}/pause": {
32288
32585
  "post": {
32289
32586
  "tags": [
32290
32587
  "Triggers"
32291
32588
  ],
32292
- "summary": "Resume a trigger",
32293
- "description": "It fires again from its next time after now; missed times are not run. An `at` whose time has passed is refused (`trigger_expired`).",
32589
+ "summary": "Pause a trigger",
32590
+ "description": "It stops firing until it is resumed; a run already started or queued goes on.",
32294
32591
  "security": [
32295
32592
  {
32296
32593
  "applicationKey": []
@@ -32436,13 +32733,13 @@
32436
32733
  }
32437
32734
  }
32438
32735
  },
32439
- "/v1/agents/{agentId}/triggers/{triggerId}/run": {
32736
+ "/v1/agents/{agentId}/triggers/{triggerId}/resume": {
32440
32737
  "post": {
32441
32738
  "tags": [
32442
32739
  "Triggers"
32443
32740
  ],
32444
- "summary": "Run a trigger now",
32445
- "description": "Runs it once now, paused or not, as if it had fired: a turn on its session, or a queued message when a turn runs there. A retried request with the same `Idempotency-Key` answers the same run.",
32741
+ "summary": "Resume a trigger",
32742
+ "description": "It fires again from its next time after now; missed times are not run. An `at` whose time has passed is refused (`trigger_expired`).",
32446
32743
  "security": [
32447
32744
  {
32448
32745
  "applicationKey": []
@@ -32509,25 +32806,15 @@
32509
32806
  "description": "The subject's space-separated scopes; required with a subject",
32510
32807
  "name": "Nylorun-Scopes",
32511
32808
  "in": "header"
32512
- },
32513
- {
32514
- "schema": {
32515
- "type": "string",
32516
- "minLength": 1,
32517
- "maxLength": 200
32518
- },
32519
- "required": true,
32520
- "name": "Idempotency-Key",
32521
- "in": "header"
32522
32809
  }
32523
32810
  ],
32524
32811
  "responses": {
32525
32812
  "200": {
32526
- "description": "The run",
32813
+ "description": "The Agent's triggers",
32527
32814
  "content": {
32528
32815
  "application/json": {
32529
32816
  "schema": {
32530
- "$ref": "#/components/schemas/RunTriggerResponse"
32817
+ "$ref": "#/components/schemas/TriggerList"
32531
32818
  }
32532
32819
  }
32533
32820
  }
@@ -32572,6 +32859,9 @@
32572
32859
  }
32573
32860
  }
32574
32861
  },
32862
+ "409": {
32863
+ "description": "An `at` whose time has passed (`trigger_expired`)"
32864
+ },
32575
32865
  "426": {
32576
32866
  "description": "`Nylorun-Protocol` missing or unsupported",
32577
32867
  "content": {
@@ -32595,13 +32885,13 @@
32595
32885
  }
32596
32886
  }
32597
32887
  },
32598
- "/v1/agents/{agentId}/triggers/{triggerId}": {
32599
- "delete": {
32888
+ "/v1/agents/{agentId}/triggers/{triggerId}/run": {
32889
+ "post": {
32600
32890
  "tags": [
32601
32891
  "Triggers"
32602
32892
  ],
32603
- "summary": "Delete a trigger an agent made",
32604
- "description": "Deletes a trigger one of the Agent's agents made with the `triggers` tool (`origin: agent`), with `agent.trigger_deleted` on the Agent's events; its runs stay. A trigger its manifest declares is refused (`trigger_from_manifest`): save a version without it, or pause it.",
32893
+ "summary": "Run a trigger now",
32894
+ "description": "Runs it once now, paused or not, as if it had fired: a turn on its session, or a queued message when a turn runs there. A retried request with the same `Idempotency-Key` answers the same run.",
32605
32895
  "security": [
32606
32896
  {
32607
32897
  "applicationKey": []
@@ -32668,15 +32958,25 @@
32668
32958
  "description": "The subject's space-separated scopes; required with a subject",
32669
32959
  "name": "Nylorun-Scopes",
32670
32960
  "in": "header"
32961
+ },
32962
+ {
32963
+ "schema": {
32964
+ "type": "string",
32965
+ "minLength": 1,
32966
+ "maxLength": 200
32967
+ },
32968
+ "required": true,
32969
+ "name": "Idempotency-Key",
32970
+ "in": "header"
32671
32971
  }
32672
32972
  ],
32673
32973
  "responses": {
32674
32974
  "200": {
32675
- "description": "Deleted",
32975
+ "description": "The run",
32676
32976
  "content": {
32677
32977
  "application/json": {
32678
32978
  "schema": {
32679
- "$ref": "#/components/schemas/DeletedResponse"
32979
+ "$ref": "#/components/schemas/RunTriggerResponse"
32680
32980
  }
32681
32981
  }
32682
32982
  }
@@ -32712,10 +33012,14 @@
32712
33012
  }
32713
33013
  },
32714
33014
  "404": {
32715
- "description": "The Agent has no such trigger"
32716
- },
32717
- "409": {
32718
- "description": "The manifest declares it (`trigger_from_manifest`)"
33015
+ "description": "Not found (`not_found`)",
33016
+ "content": {
33017
+ "application/json": {
33018
+ "schema": {
33019
+ "$ref": "#/components/schemas/Rejected"
33020
+ }
33021
+ }
33022
+ }
32719
33023
  },
32720
33024
  "426": {
32721
33025
  "description": "`Nylorun-Protocol` missing or unsupported",