@nylorun/core 0.45.0-beta → 0.47.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,22 @@
1
1
  # @nylorun/core
2
2
 
3
+ ## 0.47.0-beta
4
+
5
+ ### Minor Changes
6
+
7
+ - 7b56c2b: A computer's disk is measured (ADR-154 D1): before an idle suspend the Runtime runs `du -sk /workspace /skills` on a running computer (at most 20 s; a failure records nothing and holds nothing up) and records the size as `diskBytes` on `agent.suspended`, with a `computer suspended` host log line. A wake logs `computer ready` with `waitedMs`, and the sandboxes service logs each Substrate suspend (`substrate suspended`, with `ms` or the error).
8
+ - 7b56c2b: A `virtual` Agent can become a computer (ADR-154, Host feature `computer-move`): on a Runtime whose pod Agents are computers, a `PUT /v1/agents/{id}` naming a `pod` version of its manifest changes its kind in place, keeping its id, sessions, memory, vault, triggers, events and labels. `from` seeds the new volume from a disk version of another Agent with the same owner. Its virtual workspace is deleted, and the move is `agent.version_changed` with `kindFrom` and `kindTo`. It is refused while a turn runs or its disk is copied (`agent_busy`), on a version that would wait for a secret (`request_rejected`), and for any other kind change or on a Runtime without computers (`agent_fixed_field`). A manifest save never changes an Agent's kind.
9
+ - 7b56c2b: Model roles (ADR-154, Host feature `model-roles`): `AGENT.md` may declare `roles`, a map from a role's name to a model (`<provider>/<model>`), compiled into `harness.roles` beside `model`. A session opened with `role` (`PUT /v1/sessions/{id}`, `client.createSession({ role })`, or an A2A message's `metadata.role` when it opens the context) runs on that role's model, through the same checks as `harness.model`; its model record says `source: "role"` and the role. A role the version does not declare is `400 unknown_role`. The JSON Schemas are republished as `agent-manifest/v8.5`, `harness-manifest/v1.5` and `agent-folder/v1/agent-md.5`.
10
+
11
+ ## 0.46.0-beta
12
+
13
+ ### Minor Changes
14
+
15
+ - 5b49361: A pod Agent on an Agent Substrate cluster can be a computer (ADR-149, ADR-150): with `NYLORUN_SANDBOX_GATEWAY_URL` and `NYLORUN_COMPUTER_TICKET_KEY_FILE` set (the Runtime's Helm chart sets both), its sessions' runs go to the harness container, and their sandbox tools, file reads and writes, skill folders and disk versions reach the Agent's actor through the sandbox gateway and `atenet-router`, with a ticket core signs (Ed25519). The engine's `--service computer` runs no loop: it serves commands (a start and attaches, each under 50 s) and files on port 8080, checks each ticket against the key its template carries, and answers the wake-up probe on `/ready`. A harness opens a computer with `computer.open`; core wakes it, waits until it is ready, writes a seed onto a new disk, runs the disk's setup through it and passes a version's start check. The tools, `runtime.json` and every other backend are unchanged.
16
+
17
+ - `@nylorun/core`: Harness API 5.6 (`harness-api/v5.6.json`): `routing.sandbox.computer` and the request `computer.open`.
18
+ - `@nylorun/runtime`: `--service computer`; the `computer` sandbox backend; `NYLORUN_SANDBOX_GATEWAY_URL` and `NYLORUN_COMPUTER_TICKET_KEY_FILE`.
19
+
3
20
  ## 0.45.0-beta
4
21
 
5
22
  ### Minor Changes
@@ -290,7 +290,23 @@ export declare const OPTIONAL_HOST_FEATURES: readonly ["tenant-fixture-model", "
290
290
  * turn past its last step it is an ordinary queued message. The task `SendMessage` answers
291
291
  * carries `metadata.delivery`: `steered` or `queued`.
292
292
  */
293
- "a2a-steer"];
293
+ "a2a-steer",
294
+ /**
295
+ * An Agent becomes a computer (ADR-154): on a Runtime whose pods are computers, a
296
+ * `PUT /v1/agents/{id}` that moves a `virtual` Agent to a `pod` version changes its kind in place,
297
+ * keeping its id, sessions, memory, vault and triggers; `from` seeds the new volume from a disk
298
+ * version of another Agent with the same owner. `agent.version_changed` records `kindFrom` and
299
+ * `kindTo`. A manifest save never changes an Agent's kind.
300
+ */
301
+ "computer-move",
302
+ /**
303
+ * Model roles (ADR-154): an agent manifest's `harness.roles` (`roles:` in `AGENT.md`) maps a
304
+ * role's name to a model, and a session opened with `role` (`PUT /v1/sessions/{id}`, or an A2A
305
+ * message's `metadata.role`) runs on that role's model, checked as `harness.model` is; its model
306
+ * record says `source: "role"` and the role. A role the version does not declare is
307
+ * `400 unknown_role`.
308
+ */
309
+ "model-roles"];
294
310
  export type OptionalHostFeature = (typeof OPTIONAL_HOST_FEATURES)[number];
295
311
  export interface ProtocolRange {
296
312
  min: number;
@@ -448,7 +464,12 @@ export declare const ERROR_CODES: readonly ["not_found",
448
464
  * `details.diagnostics` names every problem, each with its file and, for parse and schema
449
465
  * errors, its line and column.
450
466
  */
451
- "folder_invalid", "internal_error"];
467
+ "folder_invalid",
468
+ /**
469
+ * A session opened with a `role` its Agent's version does not declare in `harness.roles`
470
+ * (Host feature `model-roles`): `400`. `details.roles` lists the roles it declares.
471
+ */
472
+ "unknown_role", "internal_error"];
452
473
  export type ErrorCode = (typeof ERROR_CODES)[number];
453
474
  export declare const TENANT_ID_PATTERN: RegExp;
454
475
  export declare const PRINCIPAL_ID_PATTERN: RegExp;
@@ -313,6 +313,22 @@ export const OPTIONAL_HOST_FEATURES = [
313
313
  * carries `metadata.delivery`: `steered` or `queued`.
314
314
  */
315
315
  "a2a-steer",
316
+ /**
317
+ * An Agent becomes a computer (ADR-154): on a Runtime whose pods are computers, a
318
+ * `PUT /v1/agents/{id}` that moves a `virtual` Agent to a `pod` version changes its kind in place,
319
+ * keeping its id, sessions, memory, vault and triggers; `from` seeds the new volume from a disk
320
+ * version of another Agent with the same owner. `agent.version_changed` records `kindFrom` and
321
+ * `kindTo`. A manifest save never changes an Agent's kind.
322
+ */
323
+ "computer-move",
324
+ /**
325
+ * Model roles (ADR-154): an agent manifest's `harness.roles` (`roles:` in `AGENT.md`) maps a
326
+ * role's name to a model, and a session opened with `role` (`PUT /v1/sessions/{id}`, or an A2A
327
+ * message's `metadata.role`) runs on that role's model, checked as `harness.model` is; its model
328
+ * record says `source: "role"` and the role. A role the version does not declare is
329
+ * `400 unknown_role`.
330
+ */
331
+ "model-roles",
316
332
  ];
317
333
  /**
318
334
  * What this Host serves: protocol 16, 17 and 18. Protocol 16 replaced agent definitions and
@@ -481,6 +497,11 @@ export const ERROR_CODES = [
481
497
  * errors, its line and column.
482
498
  */
483
499
  "folder_invalid",
500
+ /**
501
+ * A session opened with a `role` its Agent's version does not declare in `harness.roles`
502
+ * (Host feature `model-roles`): `400`. `details.roles` lists the roles it declares.
503
+ */
504
+ "unknown_role",
484
505
  "internal_error",
485
506
  ];
486
507
  /** Crockford Base32 alphabet (lowercase); excludes i, l, o, u. */
@@ -252,8 +252,10 @@ export type EnvironmentLimits = z.infer<typeof EnvironmentLimitsSchema>;
252
252
  * to another version of its manifest, tracking or pinned. A move changes no data: its id,
253
253
  * disk, vault and sessions stay. A harness-only change applies at once; a runtime change of a pod
254
254
  * waits for its next start; one that adds a required secret waits for its value. Its manifest's
255
- * name, kind, harness and storage are fixed (`409 agent_fixed_field`); fork it to change them.
256
- * `?dryRun=true` answers the move's plan (`AgentMovePlan`) and changes nothing.
255
+ * name, kind, harness and storage are fixed (`409 agent_fixed_field`); fork it to change them. One
256
+ * kind change is not: on a Runtime whose pods are computers, a `PUT` that moves a `virtual` Agent to
257
+ * a `pod` version makes it a computer in place (ADR-154), with its id, sessions, memory, vault and
258
+ * triggers. `?dryRun=true` answers the move's plan (`AgentMovePlan`) and changes nothing.
257
259
  */
258
260
  export declare const PutAgentRequestSchema: z.ZodObject<{
259
261
  requestId: z.ZodOptional<z.ZodString>;
@@ -795,7 +797,8 @@ export declare const AGENT_EVENT_PAYLOADS: {
795
797
  /**
796
798
  * Stopped (`POST .../stop`, or idle): the volume is kept; the next turn starts it again.
797
799
  * `drain` (Agent Substrate): its worker stopped, so it was suspended with everything it held
798
- * and resumed on another worker; nothing was lost.
800
+ * and resumed on another worker; nothing was lost. `diskBytes`: a computer suspended as idle
801
+ * had its disk measured first (`/workspace` and `/skills`, ADR-154); absent when it could not be.
799
802
  */
800
803
  readonly "agent.suspended": z.ZodObject<{
801
804
  reason: z.ZodEnum<{
@@ -804,6 +807,7 @@ export declare const AGENT_EVENT_PAYLOADS: {
804
807
  restart: "restart";
805
808
  stop: "stop";
806
809
  }>;
810
+ diskBytes: z.ZodOptional<z.ZodNumber>;
807
811
  }, z.core.$loose>;
808
812
  /** Its pod was replaced (same volume): the old pod's host token no longer works. */
809
813
  readonly "agent.relaunched": z.ZodObject<{
@@ -843,10 +847,23 @@ export declare const AGENT_EVENT_PAYLOADS: {
843
847
  start: "start";
844
848
  }>;
845
849
  }, z.core.$loose>;
846
- /** Runs version `to` of its manifest now: turns that start from here run it. */
850
+ /**
851
+ * Runs version `to` of its manifest now: turns that start from here run it. `kindFrom` and
852
+ * `kindTo` when the move changed its kind: a `virtual` Agent became a computer (ADR-154).
853
+ */
847
854
  readonly "agent.version_changed": z.ZodObject<{
848
855
  from: z.ZodNumber;
849
856
  to: z.ZodNumber;
857
+ kindFrom: z.ZodOptional<z.ZodEnum<{
858
+ none: "none";
859
+ pod: "pod";
860
+ virtual: "virtual";
861
+ }>>;
862
+ kindTo: z.ZodOptional<z.ZodEnum<{
863
+ none: "none";
864
+ pod: "pod";
865
+ virtual: "virtual";
866
+ }>>;
850
867
  }, z.core.$loose>;
851
868
  /**
852
869
  * Its pod did not start on version `to` (its setup failed, the pod failed, or it took longer
@@ -1059,6 +1076,12 @@ export declare const ListAgentEventsResponseSchema: z.ZodObject<{
1059
1076
  payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1060
1077
  }, z.core.$strict>>;
1061
1078
  }, z.core.$strict>;
1079
+ /**
1080
+ * A model role's name (Host feature `model-roles`, ADR-154): a lowercase letter, then up to 31
1081
+ * lowercase letters, digits and `-`, such as `builder`.
1082
+ */
1083
+ export declare const AGENT_ROLE_PATTERN: RegExp;
1084
+ export declare const AgentRoleNameSchema: z.ZodString;
1062
1085
  /**
1063
1086
  * `PUT /v1/sessions/{id}` (protocol 16): the session's Agent, owner and info. The session runs on
1064
1087
  * the Agent for its life (its sandbox, its vault's credentials) and pins the manifest version the
@@ -1070,6 +1093,7 @@ export declare const PutSessionRequestSchema: z.ZodObject<{
1070
1093
  agent: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
1071
1094
  ownerUserId: z.ZodString;
1072
1095
  info: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1096
+ role: z.ZodOptional<z.ZodString>;
1073
1097
  }, z.core.$strict>;
1074
1098
  export type PutSessionRequest = z.infer<typeof PutSessionRequestSchema>;
1075
1099
  /** The hosts a harness can run on. */
@@ -1379,6 +1403,12 @@ export declare function agentModelChoice(value: string): {
1379
1403
  provider: string;
1380
1404
  model: string;
1381
1405
  } | undefined;
1406
+ /**
1407
+ * `harness.roles` (Host feature `model-roles`, ADR-154): a model for each role a session may be
1408
+ * opened with (`PUT /v1/sessions/{id}` `role`, an A2A message's `metadata.role`), checked as
1409
+ * `harness.model` is. A session opened with no role runs on `harness.model`.
1410
+ */
1411
+ export declare const AgentRolesSchema: z.ZodRecord<z.ZodString, z.ZodString>;
1382
1412
  /** What runs inside the loop of an agent: the `harness` section of agent manifest v8. */
1383
1413
  export declare const AgentHarnessSectionSchema: z.ZodType<AgentHarnessSection>;
1384
1414
  /** A flow's `harness` section (`kind: "workflow"`). */
@@ -2201,6 +2231,7 @@ export declare const HarnessManifestFileSchema: z.ZodObject<{
2201
2231
  index: z.ZodOptional<z.ZodBoolean>;
2202
2232
  }, z.core.$strict>>;
2203
2233
  model: z.ZodOptional<z.ZodString>;
2234
+ roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2204
2235
  engine: z.ZodOptional<z.ZodObject<{
2205
2236
  sandbox: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2206
2237
  bash: "bash";
@@ -2481,6 +2512,7 @@ export declare const AgentManifestFileSchema: z.ZodObject<{
2481
2512
  index: z.ZodOptional<z.ZodBoolean>;
2482
2513
  }, z.core.$strict>>;
2483
2514
  model: z.ZodOptional<z.ZodString>;
2515
+ roles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2484
2516
  engine: z.ZodOptional<z.ZodObject<{
2485
2517
  sandbox: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2486
2518
  bash: "bash";
@@ -4791,6 +4823,7 @@ export declare const RejectedResponseSchema: z.ZodObject<{
4791
4823
  token_expired: "token_expired";
4792
4824
  trigger_expired: "trigger_expired";
4793
4825
  trigger_paused: "trigger_paused";
4826
+ unknown_role: "unknown_role";
4794
4827
  unsupported_media_type: "unsupported_media_type";
4795
4828
  }>;
4796
4829
  message: z.ZodString;
@@ -5720,7 +5753,7 @@ export declare const EngineDiagnosticPayloadSchema: z.ZodObject<{
5720
5753
  agentId: z.ZodOptional<z.ZodString>;
5721
5754
  }, z.core.$loose>;
5722
5755
  /** Where the model a session's turns call comes from (`SessionModelRecord.source`). */
5723
- export declare const SESSION_MODEL_SOURCES: readonly ["manifest", "session", "tenant"];
5756
+ export declare const SESSION_MODEL_SOURCES: readonly ["manifest", "role", "session", "tenant"];
5724
5757
  /**
5725
5758
  * Why a session's turns call the Tenant's model and not the one its manifest (`harness.model`) or
5726
5759
  * its own choice (`PUT /v1/sessions/{id}/model`) names: that model's provider is not connected,
@@ -5730,18 +5763,21 @@ export declare const SESSION_MODEL_FALLBACK_REASONS: readonly ["provider_not_con
5730
5763
  /**
5731
5764
  * The model a session's turns call, and why (`model` on `GET /v1/sessions/{id}`, and the
5732
5765
  * `session.model` event): `source` `manifest` for the model its Agent's version names
5733
- * (`harness.model`, Host feature `agent-model`), `session` for its own choice, `tenant` for the
5734
- * Tenant's model. On a fallback to the Tenant's, `reason` says why the model `requested` (by the
5735
- * manifest or the session) is not used.
5766
+ * (`harness.model`, Host feature `agent-model`), `role` for the model of the role it was opened
5767
+ * with (`harness.roles`, Host feature `model-roles`, named in `role`), `session` for its own
5768
+ * choice, `tenant` for the Tenant's model. On a fallback to the Tenant's, `reason` says why the
5769
+ * model `requested` (by the manifest, the role or the session) is not used.
5736
5770
  */
5737
5771
  export declare const SessionModelRecordSchema: z.ZodObject<{
5738
5772
  provider: z.ZodString;
5739
5773
  model: z.ZodString;
5740
5774
  source: z.ZodEnum<{
5741
5775
  manifest: "manifest";
5776
+ role: "role";
5742
5777
  session: "session";
5743
5778
  tenant: "tenant";
5744
5779
  }>;
5780
+ role: z.ZodOptional<z.ZodString>;
5745
5781
  reason: z.ZodOptional<z.ZodEnum<{
5746
5782
  invalid_model: "invalid_model";
5747
5783
  not_in_catalog: "not_in_catalog";
@@ -5752,6 +5788,7 @@ export declare const SessionModelRecordSchema: z.ZodObject<{
5752
5788
  model: z.ZodString;
5753
5789
  by: z.ZodEnum<{
5754
5790
  manifest: "manifest";
5791
+ role: "role";
5755
5792
  session: "session";
5756
5793
  }>;
5757
5794
  }, z.core.$strict>>;
@@ -5767,9 +5804,11 @@ export declare const SessionModelPayloadSchema: z.ZodObject<{
5767
5804
  model: z.ZodString;
5768
5805
  source: z.ZodEnum<{
5769
5806
  manifest: "manifest";
5807
+ role: "role";
5770
5808
  session: "session";
5771
5809
  tenant: "tenant";
5772
5810
  }>;
5811
+ role: z.ZodOptional<z.ZodString>;
5773
5812
  reason: z.ZodOptional<z.ZodEnum<{
5774
5813
  invalid_model: "invalid_model";
5775
5814
  not_in_catalog: "not_in_catalog";
@@ -5780,6 +5819,7 @@ export declare const SessionModelPayloadSchema: z.ZodObject<{
5780
5819
  model: z.ZodString;
5781
5820
  by: z.ZodEnum<{
5782
5821
  manifest: "manifest";
5822
+ role: "role";
5783
5823
  session: "session";
5784
5824
  }>;
5785
5825
  }, z.core.$strict>>;
@@ -5788,9 +5828,11 @@ export declare const SessionModelPayloadSchema: z.ZodObject<{
5788
5828
  model: z.ZodString;
5789
5829
  source: z.ZodEnum<{
5790
5830
  manifest: "manifest";
5831
+ role: "role";
5791
5832
  session: "session";
5792
5833
  tenant: "tenant";
5793
5834
  }>;
5835
+ role: z.ZodOptional<z.ZodString>;
5794
5836
  reason: z.ZodOptional<z.ZodEnum<{
5795
5837
  invalid_model: "invalid_model";
5796
5838
  not_in_catalog: "not_in_catalog";
@@ -5801,6 +5843,7 @@ export declare const SessionModelPayloadSchema: z.ZodObject<{
5801
5843
  model: z.ZodString;
5802
5844
  by: z.ZodEnum<{
5803
5845
  manifest: "manifest";
5846
+ role: "role";
5804
5847
  session: "session";
5805
5848
  }>;
5806
5849
  }, z.core.$strict>>;
@@ -6047,9 +6090,11 @@ export declare const EVENT_CATALOG: {
6047
6090
  model: z.ZodString;
6048
6091
  source: z.ZodEnum<{
6049
6092
  manifest: "manifest";
6093
+ role: "role";
6050
6094
  session: "session";
6051
6095
  tenant: "tenant";
6052
6096
  }>;
6097
+ role: z.ZodOptional<z.ZodString>;
6053
6098
  reason: z.ZodOptional<z.ZodEnum<{
6054
6099
  invalid_model: "invalid_model";
6055
6100
  not_in_catalog: "not_in_catalog";
@@ -6060,6 +6105,7 @@ export declare const EVENT_CATALOG: {
6060
6105
  model: z.ZodString;
6061
6106
  by: z.ZodEnum<{
6062
6107
  manifest: "manifest";
6108
+ role: "role";
6063
6109
  session: "session";
6064
6110
  }>;
6065
6111
  }, z.core.$strict>>;
@@ -6068,9 +6114,11 @@ export declare const EVENT_CATALOG: {
6068
6114
  model: z.ZodString;
6069
6115
  source: z.ZodEnum<{
6070
6116
  manifest: "manifest";
6117
+ role: "role";
6071
6118
  session: "session";
6072
6119
  tenant: "tenant";
6073
6120
  }>;
6121
+ role: z.ZodOptional<z.ZodString>;
6074
6122
  reason: z.ZodOptional<z.ZodEnum<{
6075
6123
  invalid_model: "invalid_model";
6076
6124
  not_in_catalog: "not_in_catalog";
@@ -6081,6 +6129,7 @@ export declare const EVENT_CATALOG: {
6081
6129
  model: z.ZodString;
6082
6130
  by: z.ZodEnum<{
6083
6131
  manifest: "manifest";
6132
+ role: "role";
6084
6133
  session: "session";
6085
6134
  }>;
6086
6135
  }, z.core.$strict>>;
@@ -7563,9 +7612,11 @@ export declare const SessionViewSchema: z.ZodObject<{
7563
7612
  model: z.ZodString;
7564
7613
  source: z.ZodEnum<{
7565
7614
  manifest: "manifest";
7615
+ role: "role";
7566
7616
  session: "session";
7567
7617
  tenant: "tenant";
7568
7618
  }>;
7619
+ role: z.ZodOptional<z.ZodString>;
7569
7620
  reason: z.ZodOptional<z.ZodEnum<{
7570
7621
  invalid_model: "invalid_model";
7571
7622
  not_in_catalog: "not_in_catalog";
@@ -7576,6 +7627,7 @@ export declare const SessionViewSchema: z.ZodObject<{
7576
7627
  model: z.ZodString;
7577
7628
  by: z.ZodEnum<{
7578
7629
  manifest: "manifest";
7630
+ role: "role";
7579
7631
  session: "session";
7580
7632
  }>;
7581
7633
  }, z.core.$strict>>;
@@ -8176,6 +8228,7 @@ export declare const AgUiRunErrorCodeSchema: z.ZodEnum<{
8176
8228
  token_expired: "token_expired";
8177
8229
  trigger_expired: "trigger_expired";
8178
8230
  trigger_paused: "trigger_paused";
8231
+ unknown_role: "unknown_role";
8179
8232
  unsupported_media_type: "unsupported_media_type";
8180
8233
  }>;
8181
8234
  export type AgUiRunErrorCode = z.infer<typeof AgUiRunErrorCodeSchema>;
package/dist/contracts.js CHANGED
@@ -812,8 +812,10 @@ const runtimeFields = {
812
812
  * to another version of its manifest, tracking or pinned. A move changes no data: its id,
813
813
  * disk, vault and sessions stay. A harness-only change applies at once; a runtime change of a pod
814
814
  * waits for its next start; one that adds a required secret waits for its value. Its manifest's
815
- * name, kind, harness and storage are fixed (`409 agent_fixed_field`); fork it to change them.
816
- * `?dryRun=true` answers the move's plan (`AgentMovePlan`) and changes nothing.
815
+ * name, kind, harness and storage are fixed (`409 agent_fixed_field`); fork it to change them. One
816
+ * kind change is not: on a Runtime whose pods are computers, a `PUT` that moves a `virtual` Agent to
817
+ * a `pod` version makes it a computer in place (ADR-154), with its id, sessions, memory, vault and
818
+ * triggers. `?dryRun=true` answers the move's plan (`AgentMovePlan`) and changes nothing.
817
819
  */
818
820
  export const PutAgentRequestSchema = z
819
821
  .object({
@@ -828,7 +830,9 @@ export const PutAgentRequestSchema = z
828
830
  labels: EnvironmentLabelsSchema.optional(),
829
831
  /**
830
832
  * Only when the `PUT` creates the Agent (Host feature `environment-disk-versions`): its disk
831
- * starts from this version of another Agent's disk. Its vault starts empty.
833
+ * starts from this version of another Agent's disk. Its vault starts empty. Or when it makes a
834
+ * `virtual` Agent a computer (Host feature `computer-move`): its new volume starts from this
835
+ * version of another Agent's disk, an Agent with the same owner.
832
836
  */
833
837
  from: z
834
838
  .object({
@@ -1223,9 +1227,12 @@ export const AGENT_EVENT_PAYLOADS = {
1223
1227
  /**
1224
1228
  * Stopped (`POST .../stop`, or idle): the volume is kept; the next turn starts it again.
1225
1229
  * `drain` (Agent Substrate): its worker stopped, so it was suspended with everything it held
1226
- * and resumed on another worker; nothing was lost.
1230
+ * and resumed on another worker; nothing was lost. `diskBytes`: a computer suspended as idle
1231
+ * had its disk measured first (`/workspace` and `/skills`, ADR-154); absent when it could not be.
1227
1232
  */
1228
- "agent.suspended": z.object({ reason: z.enum(["stop", "idle", "restart", "drain"]) }).passthrough(),
1233
+ "agent.suspended": z
1234
+ .object({ reason: z.enum(["stop", "idle", "restart", "drain"]), diskBytes: z.number().int().nonnegative().optional() })
1235
+ .passthrough(),
1229
1236
  /** Its pod was replaced (same volume): the old pod's host token no longer works. */
1230
1237
  "agent.relaunched": z.object({ hostEpoch: z.number().int() }).passthrough(),
1231
1238
  /** Its volume or node is gone: turns are refused until a reset. */
@@ -1254,9 +1261,17 @@ export const AGENT_EVENT_PAYLOADS = {
1254
1261
  waitingFor: z.enum(["secrets", "start"]),
1255
1262
  })
1256
1263
  .passthrough(),
1257
- /** Runs version `to` of its manifest now: turns that start from here run it. */
1264
+ /**
1265
+ * Runs version `to` of its manifest now: turns that start from here run it. `kindFrom` and
1266
+ * `kindTo` when the move changed its kind: a `virtual` Agent became a computer (ADR-154).
1267
+ */
1258
1268
  "agent.version_changed": z
1259
- .object({ from: z.number().int().positive(), to: z.number().int().positive() })
1269
+ .object({
1270
+ from: z.number().int().positive(),
1271
+ to: z.number().int().positive(),
1272
+ kindFrom: z.enum(ENVIRONMENT_KINDS).optional(),
1273
+ kindTo: z.enum(ENVIRONMENT_KINDS).optional(),
1274
+ })
1260
1275
  .passthrough(),
1261
1276
  /**
1262
1277
  * Its pod did not start on version `to` (its setup failed, the pod failed, or it took longer
@@ -1328,6 +1343,15 @@ export const AgentEventSchema = z
1328
1343
  export const ListAgentEventsResponseSchema = z
1329
1344
  .object({ events: z.array(AgentEventSchema) })
1330
1345
  .strict();
1346
+ /**
1347
+ * A model role's name (Host feature `model-roles`, ADR-154): a lowercase letter, then up to 31
1348
+ * lowercase letters, digits and `-`, such as `builder`.
1349
+ */
1350
+ export const AGENT_ROLE_PATTERN = /^[a-z][a-z0-9-]{0,31}$/;
1351
+ export const AgentRoleNameSchema = z
1352
+ .string()
1353
+ .regex(AGENT_ROLE_PATTERN, "a role is a lowercase letter, then up to 31 lowercase letters, digits and '-', such as builder")
1354
+ .meta({ description: "A model role's name, such as builder" });
1331
1355
  /**
1332
1356
  * `PUT /v1/sessions/{id}` (protocol 16): the session's Agent, owner and info. The session runs on
1333
1357
  * the Agent for its life (its sandbox, its vault's credentials) and pins the manifest version the
@@ -1341,6 +1365,12 @@ export const PutSessionRequestSchema = z
1341
1365
  agent: AgentIdSchema,
1342
1366
  ownerUserId: z.string().min(1),
1343
1367
  info: jsonObject.optional(),
1368
+ /**
1369
+ * The model role the session runs on (Host feature `model-roles`): its model is the one the
1370
+ * Agent's version names for it (`harness.roles`), checked as `harness.model` is. A role the
1371
+ * version does not declare is `400 unknown_role`. Fixed once the session exists.
1372
+ */
1373
+ role: AgentRoleNameSchema.optional(),
1344
1374
  })
1345
1375
  .strict();
1346
1376
  /** The hosts a harness can run on. */
@@ -1806,6 +1836,15 @@ export function agentModelChoice(value) {
1806
1836
  return { provider: value.slice(0, slash), model: value.slice(slash + 1) };
1807
1837
  }
1808
1838
  const harnessModelField = AgentModelSchema.optional();
1839
+ /**
1840
+ * `harness.roles` (Host feature `model-roles`, ADR-154): a model for each role a session may be
1841
+ * opened with (`PUT /v1/sessions/{id}` `role`, an A2A message's `metadata.role`), checked as
1842
+ * `harness.model` is. A session opened with no role runs on `harness.model`.
1843
+ */
1844
+ export const AgentRolesSchema = z
1845
+ .record(AgentRoleNameSchema, AgentModelSchema)
1846
+ .meta({ description: "The model of each role a session may be opened with: <role>: <provider>/<model>" });
1847
+ const harnessRolesField = AgentRolesSchema.optional();
1809
1848
  /** Fields the harness section refuses with where they went. */
1810
1849
  const REMOVED_HARNESS_FIELDS = Object.freeze({
1811
1850
  requires: "harness.requires left the API in agent manifest v8: the Runtime checks the harness against the runtime section when the manifest is saved. Keep requires in harness.manifest.json, where the CLI checks it",
@@ -1827,6 +1866,7 @@ const agentHarnessObject = z
1827
1866
  loop: harnessLoopField,
1828
1867
  memory: harnessMemoryField,
1829
1868
  model: harnessModelField,
1869
+ roles: harnessRolesField,
1830
1870
  engine: harnessEngineField,
1831
1871
  functions: z.unknown().optional().meta({ description: "Reserved: Functions are not available yet" }),
1832
1872
  }, { error: removedFieldError(REMOVED_HARNESS_FIELDS) })
@@ -2268,6 +2308,7 @@ export const HarnessManifestFileSchema = z
2268
2308
  loop: harnessLoopField,
2269
2309
  memory: harnessMemoryField,
2270
2310
  model: harnessModelField,
2311
+ roles: harnessRolesField,
2271
2312
  engine: harnessEngineField,
2272
2313
  /** MCP server or HTTP tool name → the `runtime.secrets` slot it authenticates with. */
2273
2314
  credentials: z.record(z.string().min(1), z.string().min(1)).optional(),
@@ -3781,7 +3822,7 @@ export const EngineDiagnosticPayloadSchema = z
3781
3822
  })
3782
3823
  .passthrough();
3783
3824
  /** Where the model a session's turns call comes from (`SessionModelRecord.source`). */
3784
- export const SESSION_MODEL_SOURCES = ["manifest", "session", "tenant"];
3825
+ export const SESSION_MODEL_SOURCES = ["manifest", "role", "session", "tenant"];
3785
3826
  /**
3786
3827
  * Why a session's turns call the Tenant's model and not the one its manifest (`harness.model`) or
3787
3828
  * its own choice (`PUT /v1/sessions/{id}/model`) names: that model's provider is not connected,
@@ -3791,18 +3832,21 @@ export const SESSION_MODEL_FALLBACK_REASONS = ["provider_not_connected", "not_in
3791
3832
  /**
3792
3833
  * The model a session's turns call, and why (`model` on `GET /v1/sessions/{id}`, and the
3793
3834
  * `session.model` event): `source` `manifest` for the model its Agent's version names
3794
- * (`harness.model`, Host feature `agent-model`), `session` for its own choice, `tenant` for the
3795
- * Tenant's model. On a fallback to the Tenant's, `reason` says why the model `requested` (by the
3796
- * manifest or the session) is not used.
3835
+ * (`harness.model`, Host feature `agent-model`), `role` for the model of the role it was opened
3836
+ * with (`harness.roles`, Host feature `model-roles`, named in `role`), `session` for its own
3837
+ * choice, `tenant` for the Tenant's model. On a fallback to the Tenant's, `reason` says why the
3838
+ * model `requested` (by the manifest, the role or the session) is not used.
3797
3839
  */
3798
3840
  export const SessionModelRecordSchema = z
3799
3841
  .object({
3800
3842
  provider: z.string(),
3801
3843
  model: z.string(),
3802
3844
  source: z.enum(SESSION_MODEL_SOURCES),
3845
+ /** The role the session was opened with, when its model is, or was asked to be, the role's. */
3846
+ role: z.string().optional(),
3803
3847
  reason: z.enum(SESSION_MODEL_FALLBACK_REASONS).optional(),
3804
3848
  requested: z
3805
- .object({ provider: z.string(), model: z.string(), by: z.enum(["manifest", "session"]) })
3849
+ .object({ provider: z.string(), model: z.string(), by: z.enum(["manifest", "role", "session"]) })
3806
3850
  .strict()
3807
3851
  .optional(),
3808
3852
  })
@@ -77,7 +77,7 @@ export declare const SCHEMA_URLS: {
77
77
  readonly mcp: readonly ["https://docs.nylorun.com/schemas/agent-folder/v1/mcp.json", "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json"];
78
78
  readonly flow: readonly ["https://docs.nylorun.com/schemas/agent-folder/v1/flow.json"];
79
79
  };
80
- export declare const AGENT_KEYS: readonly ["name", "description", "format", "harness", "inputSchema", "outputSchema", "mcpServers", "skills", "memory", "loop", "model", "engine", "plugins", "metadata"];
80
+ export declare const AGENT_KEYS: readonly ["name", "description", "format", "harness", "inputSchema", "outputSchema", "mcpServers", "skills", "memory", "loop", "model", "roles", "engine", "plugins", "metadata"];
81
81
  export declare const TRIGGER_KEYS: readonly ["schedule", "timezone", "at", "webhook", "session"];
82
82
  export declare const MCP_KEYS: readonly ["$schema", "mcpServers"];
83
83
  export declare const SERVER_KEYS: readonly ["type", "url", "headers"];
@@ -1,4 +1,4 @@
1
- import { AGENT_MANIFEST_V8_SCHEMA_VERSION, AGENT_MODEL_MAX_CHARS, AgentManifestV8Schema, ENVIRONMENT_NAME_PATTERN, HarnessIdSchema, RuntimeSectionSchema, TOOL_SECRET_NAME_PATTERN, TriggerSchema, agentModelChoice, isAgentManifestName, } from "../contracts.js";
1
+ import { AGENT_MANIFEST_V8_SCHEMA_VERSION, AGENT_MODEL_MAX_CHARS, AGENT_ROLE_PATTERN, AgentManifestV8Schema, ENVIRONMENT_NAME_PATTERN, HarnessIdSchema, RuntimeSectionSchema, TOOL_SECRET_NAME_PATTERN, TriggerSchema, agentModelChoice, isAgentManifestName, } from "../contracts.js";
2
2
  import { cronScheduleIssue, isTimeZone, timeZoneNames } from "../definition/cron.js";
3
3
  import { RUNTIME_SERVER } from "../plugins/index.js";
4
4
  import { enginePlugins, isFolderV3, pluginSkillNames, v3Declarations } from "./v3.js";
@@ -56,7 +56,7 @@ export const SCHEMA_URLS = {
56
56
  flow: [`${FOLDER_SCHEMAS}flow.json`],
57
57
  };
58
58
  const SKILL_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
59
- export const AGENT_KEYS = ["name", "description", "format", "harness", "inputSchema", "outputSchema", "mcpServers", "skills", "memory", "loop", "model", "engine", "plugins", "metadata"];
59
+ export const AGENT_KEYS = ["name", "description", "format", "harness", "inputSchema", "outputSchema", "mcpServers", "skills", "memory", "loop", "model", "roles", "engine", "plugins", "metadata"];
60
60
  const SKILL_KEYS = ["name", "description", "license", "compatibility", "metadata", "allowed-tools"];
61
61
  export const TRIGGER_KEYS = ["schedule", "timezone", "at", "webhook", "session"];
62
62
  export const MCP_KEYS = ["$schema", "mcpServers"];
@@ -565,6 +565,26 @@ export function compileAgentFolder(input, scope) {
565
565
  else
566
566
  error("value_invalid", `model is <provider>/<model>, such as anthropic/claude-sonnet-4-5: the provider's id (letters, digits, '.', '_' or '-'), a '/', then the model's id, at most ${AGENT_MODEL_MAX_CHARS} characters and no spaces${typeof front.model === "string" ? `, not ${JSON.stringify(front.model)}` : ""}`, AGENT_FILE, ["model"]);
567
567
  }
568
+ // The model of each role a session may be opened with (Host feature `model-roles`, ADR-154).
569
+ if (front.roles !== undefined) {
570
+ if (!isObject(front.roles))
571
+ error("value_invalid", "roles is a map from a role's name to its model, such as builder: anthropic/claude-sonnet-4-5", AGENT_FILE, ["roles"]);
572
+ else {
573
+ const roles = {};
574
+ for (const [role, value] of Object.entries(front.roles)) {
575
+ if (!AGENT_ROLE_PATTERN.test(role)) {
576
+ error("value_invalid", `roles.${role}: a role is a lowercase letter, then up to 31 lowercase letters, digits and '-', such as builder`, AGENT_FILE, ["roles", role], { key: true });
577
+ continue;
578
+ }
579
+ if (typeof value === "string" && agentModelChoice(value.trim()) !== undefined)
580
+ roles[role] = value.trim();
581
+ else
582
+ error("value_invalid", `roles.${role} is <provider>/<model>, such as anthropic/claude-sonnet-4-5, at most ${AGENT_MODEL_MAX_CHARS} characters and no spaces${typeof value === "string" ? `, not ${JSON.stringify(value)}` : ""}`, AGENT_FILE, ["roles", role]);
583
+ }
584
+ if (Object.keys(roles).length > 0)
585
+ harness.roles = roles;
586
+ }
587
+ }
568
588
  if (front.metadata !== undefined) {
569
589
  if (isObject(front.metadata))
570
590
  metadata = front.metadata;
@@ -575,7 +595,7 @@ export function compileAgentFolder(input, scope) {
575
595
  if (body !== "")
576
596
  instructions.push(body);
577
597
  origins.push([["harness", "instructions"], { file: AGENT_FILE, path: [] }]);
578
- for (const key of ["memory", "loop", "model", "outputSchema"])
598
+ for (const key of ["memory", "loop", "model", "roles", "outputSchema"])
579
599
  origins.push([["harness", key], { file: AGENT_FILE, path: [key] }]);
580
600
  origins.push([["harness", "id"], { file: AGENT_FILE, path: ["harness"] }]);
581
601
  }
@@ -268,6 +268,8 @@ function writeAgent(writer, place, identity, harness) {
268
268
  front.memory = harness.memory;
269
269
  if (harness.model !== undefined)
270
270
  front.model = harness.model;
271
+ if (harness.roles !== undefined)
272
+ front.roles = { ...harness.roles };
271
273
  if (harness.loop !== undefined) {
272
274
  if (isObject(harness.loop))
273
275
  front.loop = harness.loop;
@@ -193,6 +193,7 @@ function nestedChecks(ctx) {
193
193
  memory: `memory is the root agent's: ${what} keeps none of its own`,
194
194
  loop: `loop settings are the root agent's: ${what} has none of its own`,
195
195
  model: `model is the root agent's: ${what} runs in the root agent's session, on its model`,
196
+ roles: `roles are the root agent's: ${what} runs in the root agent's session, on its model`,
196
197
  };
197
198
  for (const [key, message] of Object.entries(keys))
198
199
  if (ctx.front[key] !== undefined)
@@ -19,7 +19,7 @@
19
19
  */
20
20
  import { PLUGIN_NAMES } from "../plugins/index.js";
21
21
  import { z } from "zod";
22
- import { AGENT_MANIFEST_NAME_PATTERN, ENVIRONMENT_NAME_PATTERN, HarnessIdSchema, AgentModelSchema, HarnessMemorySchema, HttpToolTargetSchema, McpToolSettingsSchema, RuntimeSectionSchema, TOOL_SECRET_NAME_PATTERN, TriggerSchema, } from "../contracts.js";
22
+ import { AGENT_MANIFEST_NAME_PATTERN, ENVIRONMENT_NAME_PATTERN, HarnessIdSchema, AgentModelSchema, AgentRolesSchema, HarnessMemorySchema, HttpToolTargetSchema, McpToolSettingsSchema, RuntimeSectionSchema, TOOL_SECRET_NAME_PATTERN, TriggerSchema, } from "../contracts.js";
23
23
  import { DELEGATE_NAME_PATTERN } from "../definition/delegate.js";
24
24
  import { AGENT_KEYS, FOLDER_SCHEMAS, MCP_KEYS, PLUGIN_SERVER_SETTING_KEYS, SERVER_KEYS, TOOL_KEYS, TRIGGER_KEYS, } from "./compile.js";
25
25
  import { LOOP_KEYS, MAP_KEYS, NODE_KINDS, SWITCH_KEYS, VERIFY_KEYS } from "./flow.js";
@@ -55,11 +55,11 @@ function fromZod(schema, defs, description) {
55
55
  * names one document for good): `AGENT.md` took `model` (Host feature `agent-model`), published
56
56
  * as `agent-md.1.json`, then `format: agent-folder/2` and `engine` (ADR-100), as `agent-md.2.json`,
57
57
  * then `engine.triggers` (D83), as `agent-md.3.json`, then `format: agent-folder/3` and
58
- * `plugins` (ADR-106), as `agent-md.4.json`;
58
+ * `plugins` (ADR-106), as `agent-md.4.json`, then `roles` (ADR-154), as `agent-md.5.json`;
59
59
  * `runtime.json` took a secret slot's `toolPrefix` (Host feature `secret-routing`), published as
60
60
  * `runtime.1.json`, then `limits.triggers` (D83), as `runtime.2.json`.
61
61
  */
62
- const REVISIONS = { "agent-md": 4, runtime: 2 };
62
+ const REVISIONS = { "agent-md": 5, runtime: 2 };
63
63
  /** One document: its `$id` from its kind, then the body, then the `$defs` its parts named. */
64
64
  function document(kind, title, description, body, defs) {
65
65
  const revision = REVISIONS[kind];
@@ -129,6 +129,7 @@ function agentMd() {
129
129
  description: "agent-folder/3: the Runtime's plugins the agent uses, which share the server nylorun (mcpServers.nylorun.tools turns one of their tools off): nylorun-memory, nylorun-triggers, nylorun-plan, nylorun-interactions, nylorun-artifacts, nylorun-sandbox (needs a computer)",
130
130
  },
131
131
  model: fromZod(AgentModelSchema, defs, "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"),
132
+ roles: fromZod(AgentRolesSchema, defs, "The model of each role a session may be opened with (role on PUT /v1/sessions/{id}, or an A2A message's metadata.role): <role>: <provider>/<model>"),
132
133
  engine: {
133
134
  type: "object",
134
135
  description: "agent-folder/2: the engine features the agent uses, and nothing else is added: sandbox (the sandbox tools), artifacts (read_artifact, save_artifact), outputs (the outputs folder), toolSearch (MCP tools deferred past the threshold), triggers (the triggers tool, the root agent's), instructions (a block's wording, from a file under engine/)",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://docs.nylorun.com/schemas/harness-api/v5.5.json",
3
+ "$id": "https://docs.nylorun.com/schemas/harness-api/v5.6.json",
4
4
  "title": "Nylorun Harness API 5",
5
5
  "$defs": {
6
6
  "ArtifactMeta": {
@@ -845,6 +845,10 @@
845
845
  "additionalProperties": {
846
846
  "type": "string"
847
847
  }
848
+ },
849
+ "computer": {
850
+ "type": "boolean",
851
+ "const": true
848
852
  }
849
853
  },
850
854
  "required": [
@@ -1410,6 +1414,10 @@
1410
1414
  "additionalProperties": {
1411
1415
  "type": "string"
1412
1416
  }
1417
+ },
1418
+ "computer": {
1419
+ "type": "boolean",
1420
+ "const": true
1413
1421
  }
1414
1422
  },
1415
1423
  "required": [
@@ -3612,6 +3620,10 @@
3612
3620
  "additionalProperties": {
3613
3621
  "type": "string"
3614
3622
  }
3623
+ },
3624
+ "computer": {
3625
+ "type": "boolean",
3626
+ "const": true
3615
3627
  }
3616
3628
  },
3617
3629
  "required": [
@@ -4620,6 +4632,50 @@
4620
4632
  ],
4621
4633
  "additionalProperties": false
4622
4634
  },
4635
+ "computer.open.params": {
4636
+ "type": "object",
4637
+ "properties": {
4638
+ "runId": {
4639
+ "type": "string",
4640
+ "minLength": 1,
4641
+ "maxLength": 512
4642
+ },
4643
+ "environmentId": {
4644
+ "type": "string",
4645
+ "minLength": 1,
4646
+ "maxLength": 512
4647
+ }
4648
+ },
4649
+ "required": [
4650
+ "runId",
4651
+ "environmentId"
4652
+ ],
4653
+ "additionalProperties": false
4654
+ },
4655
+ "computer.open.result": {
4656
+ "type": "object",
4657
+ "properties": {
4658
+ "url": {
4659
+ "type": "string",
4660
+ "format": "uri"
4661
+ },
4662
+ "ticket": {
4663
+ "type": "string",
4664
+ "minLength": 1
4665
+ },
4666
+ "expiresAt": {
4667
+ "type": "integer",
4668
+ "minimum": -9007199254740991,
4669
+ "maximum": 9007199254740991
4670
+ }
4671
+ },
4672
+ "required": [
4673
+ "url",
4674
+ "ticket",
4675
+ "expiresAt"
4676
+ ],
4677
+ "additionalProperties": false
4678
+ },
4623
4679
  "artifact.read.params": {
4624
4680
  "type": "object",
4625
4681
  "properties": {
@@ -58,9 +58,11 @@ export function harnessApiSchemas() {
58
58
  * which a v5 harness that offers no `triggers` tool never sees. Revision 4: the effect kind `inputs`
59
59
  (D85): the messages steered into the running turn, which core answers at once and a v5 harness
60
60
  that never asks for it never sees. Revision 5: `artifact.write` `begin` may carry
61
- `audience: "model"` (ADR-139), which core accepts and only our own engine sends.
61
+ `audience: "model"` (ADR-139), which core accepts and only our own engine sends. Revision 6:
62
+ `routing.sandbox.computer` and the request `computer.open` (ADR-149), which a v5 harness never
63
+ sees unless the Tenant's pod Agents are computers.
62
64
  */
63
- const SCHEMA_REVISION = 5;
65
+ const SCHEMA_REVISION = 6;
64
66
  /** The JSON Schema document of the Harness API (draft 2020-12). */
65
67
  export function harnessApiJsonSchema() {
66
68
  const $defs = {};
@@ -348,6 +348,7 @@ export declare const RunRoutingSchema: z.ZodObject<{
348
348
  environmentId: z.ZodOptional<z.ZodString>;
349
349
  spec: z.ZodOptional<z.ZodUnknown>;
350
350
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
351
+ computer: z.ZodOptional<z.ZodLiteral<true>>;
351
352
  }, z.core.$strict>>;
352
353
  }, z.core.$strict>;
353
354
  /**
@@ -505,6 +506,7 @@ export declare const TurnStartSchema: z.ZodObject<{
505
506
  environmentId: z.ZodOptional<z.ZodString>;
506
507
  spec: z.ZodOptional<z.ZodUnknown>;
507
508
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
509
+ computer: z.ZodOptional<z.ZodLiteral<true>>;
508
510
  }, z.core.$strict>>;
509
511
  }, z.core.$strict>;
510
512
  trace: z.ZodOptional<z.ZodObject<{
@@ -748,6 +750,7 @@ export declare const harnessRequests: {
748
750
  environmentId: z.ZodOptional<z.ZodString>;
749
751
  spec: z.ZodOptional<z.ZodUnknown>;
750
752
  environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
753
+ computer: z.ZodOptional<z.ZodLiteral<true>>;
751
754
  }, z.core.$strict>>;
752
755
  }, z.core.$strict>;
753
756
  trace: z.ZodOptional<z.ZodObject<{
@@ -1003,6 +1006,24 @@ export declare const harnessRequests: {
1003
1006
  base64: z.ZodString;
1004
1007
  }, z.core.$strict>;
1005
1008
  };
1009
+ /**
1010
+ * Opens the computer of the run's session (ADR-149, Harness API 5.6): `environmentId` must be
1011
+ * the run's `routing.sandbox.environmentId` with `computer: true`. Core wakes it, waits until it
1012
+ * is ready, writes a seed onto a new disk and runs the disk's setup when needed, and answers the
1013
+ * sandbox gateway's URL for it, a ticket the gateway and the computer check, and when the ticket
1014
+ * expires (ms since the epoch). A harness opens it again before then.
1015
+ */
1016
+ "computer.open": {
1017
+ params: z.ZodObject<{
1018
+ runId: z.ZodString;
1019
+ environmentId: z.ZodString;
1020
+ }, z.core.$strict>;
1021
+ result: z.ZodObject<{
1022
+ url: z.ZodString;
1023
+ ticket: z.ZodString;
1024
+ expiresAt: z.ZodNumber;
1025
+ }, z.core.$strict>;
1026
+ };
1006
1027
  /**
1007
1028
  * An artifact the run's session may read (the artifact seam, protocol 15): one of the session's
1008
1029
  * own, or a Tenant-wide one its messages named; anything else is `not_found`, alike. The answer
@@ -265,6 +265,12 @@ export const RunRoutingSchema = z
265
265
  * the sentinel `nylorun_managed`, and each `environment_variable`'s value. Never a secret.
266
266
  */
267
267
  environment: z.record(z.string(), z.string()).optional(),
268
+ /**
269
+ * The sandbox is a computer (ADR-149, Harness API 5.6): an Agent Substrate actor whose
270
+ * engine runs no loop. A harness opens it with `computer.open` and sends its sandbox
271
+ * calls to it through the sandbox gateway.
272
+ */
273
+ computer: z.literal(true).optional(),
268
274
  })
269
275
  .strict()
270
276
  .optional(),
@@ -577,6 +583,17 @@ export const harnessRequests = {
577
583
  .strict(),
578
584
  result: z.object({ base64: z.string() }).strict(),
579
585
  },
586
+ /**
587
+ * Opens the computer of the run's session (ADR-149, Harness API 5.6): `environmentId` must be
588
+ * the run's `routing.sandbox.environmentId` with `computer: true`. Core wakes it, waits until it
589
+ * is ready, writes a seed onto a new disk and runs the disk's setup when needed, and answers the
590
+ * sandbox gateway's URL for it, a ticket the gateway and the computer check, and when the ticket
591
+ * expires (ms since the epoch). A harness opens it again before then.
592
+ */
593
+ "computer.open": {
594
+ params: runId.extend({ environmentId: id }).strict(),
595
+ result: z.object({ url: z.string().url(), ticket: z.string().min(1), expiresAt: z.number().int() }).strict(),
596
+ },
580
597
  /**
581
598
  * An artifact the run's session may read (the artifact seam, protocol 15): one of the session's
582
599
  * own, or a Tenant-wide one its messages named; anything else is `not_found`, alike. The answer
@@ -19,10 +19,11 @@ import { AGENT_MANIFEST_V8_SCHEMA_VERSION, AgentManifestFileSchema, HARNESS_MANI
19
19
  * feature `secret-routing`), published as agent manifest `v8.2`, harness file `v1.2` and runtime
20
20
  * file `v1.1`, then `harness.engine.triggers` and `runtime.limits.triggers` (D83), published as
21
21
  * agent manifest `v8.3`, harness file `v1.3` and runtime file `v1.2`, then `harness.engine.plugins`
22
- * (ADR-106), published as agent manifest `v8.4` and harness file `v1.4`.
22
+ * (ADR-106), published as agent manifest `v8.4` and harness file `v1.4`, then `harness.roles`
23
+ * (ADR-154), published as agent manifest `v8.5` and harness file `v1.5`.
23
24
  */
24
- const AGENT_MANIFEST_REVISION = 4;
25
- const HARNESS_MANIFEST_FILE_REVISION = 4;
25
+ const AGENT_MANIFEST_REVISION = 5;
26
+ const HARNESS_MANIFEST_FILE_REVISION = 5;
26
27
  const RUNTIME_MANIFEST_FILE_REVISION = 2;
27
28
  function document(schema, id, title) {
28
29
  const { $schema: _, ...definition } = z.toJSONSchema(schema, { io: "input", unrepresentable: "any" });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://docs.nylorun.com/schemas/agent-folder/v1/agent-md.4.json",
3
+ "$id": "https://docs.nylorun.com/schemas/agent-folder/v1/agent-md.5.json",
4
4
  "title": "Nylorun agent folder: AGENT.md frontmatter",
5
5
  "description": "The frontmatter of an agent folder's AGENT.md; the body below it is the instructions",
6
6
  "type": "object",
@@ -116,6 +116,21 @@
116
116
  "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
117
117
  "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
118
118
  },
119
+ "roles": {
120
+ "type": "object",
121
+ "propertyNames": {
122
+ "type": "string",
123
+ "pattern": "^[a-z][a-z0-9-]{0,31}$",
124
+ "description": "A model role's name, such as builder"
125
+ },
126
+ "additionalProperties": {
127
+ "type": "string",
128
+ "maxLength": 200,
129
+ "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
130
+ "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
131
+ },
132
+ "description": "The model of each role a session may be opened with (role on PUT /v1/sessions/{id}, or an A2A message's metadata.role): <role>: <provider>/<model>"
133
+ },
119
134
  "engine": {
120
135
  "type": "object",
121
136
  "description": "agent-folder/2: the engine features the agent uses, and nothing else is added: sandbox (the sandbox tools), artifacts (read_artifact, save_artifact), outputs (the outputs folder), toolSearch (MCP tools deferred past the threshold), triggers (the triggers tool, the root agent's), instructions (a block's wording, from a file under engine/)",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://docs.nylorun.com/schemas/agent-manifest/v8.4.json",
3
+ "$id": "https://docs.nylorun.com/schemas/agent-manifest/v8.5.json",
4
4
  "title": "Nylorun agent manifest 8",
5
5
  "type": "object",
6
6
  "properties": {
@@ -291,6 +291,21 @@
291
291
  "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
292
292
  "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
293
293
  },
294
+ "roles": {
295
+ "type": "object",
296
+ "propertyNames": {
297
+ "type": "string",
298
+ "pattern": "^[a-z][a-z0-9-]{0,31}$",
299
+ "description": "A model role's name, such as builder"
300
+ },
301
+ "additionalProperties": {
302
+ "type": "string",
303
+ "maxLength": 200,
304
+ "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
305
+ "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
306
+ },
307
+ "description": "The model of each role a session may be opened with: <role>: <provider>/<model>"
308
+ },
294
309
  "engine": {
295
310
  "$ref": "#/$defs/HarnessEngine"
296
311
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://docs.nylorun.com/schemas/harness-manifest/v1.4.json",
3
+ "$id": "https://docs.nylorun.com/schemas/harness-manifest/v1.5.json",
4
4
  "title": "Nylorun harness manifest 1",
5
5
  "type": "object",
6
6
  "properties": {
@@ -260,6 +260,21 @@
260
260
  "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
261
261
  "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
262
262
  },
263
+ "roles": {
264
+ "type": "object",
265
+ "propertyNames": {
266
+ "type": "string",
267
+ "pattern": "^[a-z][a-z0-9-]{0,31}$",
268
+ "description": "A model role's name, such as builder"
269
+ },
270
+ "additionalProperties": {
271
+ "type": "string",
272
+ "maxLength": 200,
273
+ "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
274
+ "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
275
+ },
276
+ "description": "The model of each role a session may be opened with: <role>: <provider>/<model>"
277
+ },
263
278
  "engine": {
264
279
  "$ref": "#/$defs/HarnessEngine"
265
280
  },
@@ -262,6 +262,11 @@ export interface AgentHarnessSection {
262
262
  * is connected and lists it (Host feature `agent-model`).
263
263
  */
264
264
  readonly model?: string;
265
+ /**
266
+ * The model of each role a session may be opened with, `<role>: <provider>/<model>` (Host
267
+ * feature `model-roles`): a session opened with `role` runs on that role's model.
268
+ */
269
+ readonly roles?: Readonly<Record<string, string>>;
265
270
  /** The engine features the agent declares (ADR-100), for itself; its subagents declare their own. */
266
271
  readonly engine?: HarnessEngine;
267
272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nylorun/core",
3
- "version": "0.45.0-beta",
3
+ "version": "0.47.0-beta",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Shared agent definitions and wire contracts",