@nylorun/core 0.46.0-beta → 0.48.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 +14 -0
- package/dist/compatibility.d.ts +23 -2
- package/dist/compatibility.js +21 -0
- package/dist/contracts.d.ts +61 -8
- package/dist/contracts.js +56 -12
- package/dist/folder/compile.d.ts +1 -1
- package/dist/folder/compile.js +23 -3
- package/dist/folder/decompile.js +2 -0
- package/dist/folder/nested.js +1 -0
- package/dist/folder/schemas.js +4 -3
- package/dist/harness-api/harness-api.schema.json +34 -1
- package/dist/harness-api/json-schema.js +3 -2
- package/dist/harness-api/schema.d.ts +16 -0
- package/dist/harness-api/schema.js +11 -0
- package/dist/manifest-schemas.js +4 -3
- package/dist/schemas/agent-folder/agent-md.schema.json +16 -1
- package/dist/schemas/agent-manifest.schema.json +16 -1
- package/dist/schemas/harness-manifest.schema.json +16 -1
- package/dist/types/manifest.d.ts +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @nylorun/core
|
|
2
2
|
|
|
3
|
+
## 0.48.0-beta
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 536ff54: A harness reaches a computer's new volume after a restore (ADR-149): a computer restored through `POST /v1/agents/{id}/restore`, reset, or given a new volume by its lifecycle gets a new sandbox name (`…-g0` → `…-g1`), but a harness that had opened it kept sending its sessions' `bash`, `read` and `write` to the last computer until the ticket expired, and a gateway or router that still served it ran them on the old volume. Before each request to a computer the harness now asks core where it is (`computer.current`, Harness API 5.7, `harness-api/v5.7.json`: a store read that never wakes it) and opens it again with `computer.open` when the URL moved. Core's own uses checked this already. A harness on a core older than 5.7 keeps its access until the ticket is renewed, as before.
|
|
8
|
+
|
|
9
|
+
## 0.47.0-beta
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 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).
|
|
14
|
+
- 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.
|
|
15
|
+
- 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`.
|
|
16
|
+
|
|
3
17
|
## 0.46.0-beta
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/compatibility.d.ts
CHANGED
|
@@ -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",
|
|
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;
|
package/dist/compatibility.js
CHANGED
|
@@ -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. */
|
package/dist/contracts.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
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
|
-
/**
|
|
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`), `
|
|
5734
|
-
*
|
|
5735
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
-
/**
|
|
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({
|
|
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`), `
|
|
3795
|
-
*
|
|
3796
|
-
*
|
|
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
|
})
|
package/dist/folder/compile.d.ts
CHANGED
|
@@ -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"];
|
package/dist/folder/compile.js
CHANGED
|
@@ -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
|
}
|
package/dist/folder/decompile.js
CHANGED
|
@@ -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;
|
package/dist/folder/nested.js
CHANGED
|
@@ -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)
|
package/dist/folder/schemas.js
CHANGED
|
@@ -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":
|
|
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.
|
|
3
|
+
"$id": "https://docs.nylorun.com/schemas/harness-api/v5.7.json",
|
|
4
4
|
"title": "Nylorun Harness API 5",
|
|
5
5
|
"$defs": {
|
|
6
6
|
"ArtifactMeta": {
|
|
@@ -4676,6 +4676,39 @@
|
|
|
4676
4676
|
],
|
|
4677
4677
|
"additionalProperties": false
|
|
4678
4678
|
},
|
|
4679
|
+
"computer.current.params": {
|
|
4680
|
+
"type": "object",
|
|
4681
|
+
"properties": {
|
|
4682
|
+
"runId": {
|
|
4683
|
+
"type": "string",
|
|
4684
|
+
"minLength": 1,
|
|
4685
|
+
"maxLength": 512
|
|
4686
|
+
},
|
|
4687
|
+
"environmentId": {
|
|
4688
|
+
"type": "string",
|
|
4689
|
+
"minLength": 1,
|
|
4690
|
+
"maxLength": 512
|
|
4691
|
+
}
|
|
4692
|
+
},
|
|
4693
|
+
"required": [
|
|
4694
|
+
"runId",
|
|
4695
|
+
"environmentId"
|
|
4696
|
+
],
|
|
4697
|
+
"additionalProperties": false
|
|
4698
|
+
},
|
|
4699
|
+
"computer.current.result": {
|
|
4700
|
+
"type": "object",
|
|
4701
|
+
"properties": {
|
|
4702
|
+
"url": {
|
|
4703
|
+
"type": "string",
|
|
4704
|
+
"format": "uri"
|
|
4705
|
+
}
|
|
4706
|
+
},
|
|
4707
|
+
"required": [
|
|
4708
|
+
"url"
|
|
4709
|
+
],
|
|
4710
|
+
"additionalProperties": false
|
|
4711
|
+
},
|
|
4679
4712
|
"artifact.read.params": {
|
|
4680
4713
|
"type": "object",
|
|
4681
4714
|
"properties": {
|
|
@@ -60,9 +60,10 @@ export function harnessApiSchemas() {
|
|
|
60
60
|
that never asks for it never sees. Revision 5: `artifact.write` `begin` may carry
|
|
61
61
|
`audience: "model"` (ADR-139), which core accepts and only our own engine sends. Revision 6:
|
|
62
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.
|
|
63
|
+
sees unless the Tenant's pod Agents are computers. Revision 7: the request `computer.current`,
|
|
64
|
+
which only a harness that drives computers sends.
|
|
64
65
|
*/
|
|
65
|
-
const SCHEMA_REVISION =
|
|
66
|
+
const SCHEMA_REVISION = 7;
|
|
66
67
|
/** The JSON Schema document of the Harness API (draft 2020-12). */
|
|
67
68
|
export function harnessApiJsonSchema() {
|
|
68
69
|
const $defs = {};
|
|
@@ -1024,6 +1024,22 @@ export declare const harnessRequests: {
|
|
|
1024
1024
|
expiresAt: z.ZodNumber;
|
|
1025
1025
|
}, z.core.$strict>;
|
|
1026
1026
|
};
|
|
1027
|
+
/**
|
|
1028
|
+
* Where the computer of the run's session is now (Harness API 5.7), without waking it: the
|
|
1029
|
+
* sandbox gateway's URL for its current incarnation. A restore, a reset or a lost volume's
|
|
1030
|
+
* recovery gives the computer a new volume, and with it a new URL: a harness asks before each
|
|
1031
|
+
* request to the computer and, when the URL is not the one its `computer.open` answered, opens
|
|
1032
|
+
* it again rather than reach the last one. Refused as `computer.open` is for another computer.
|
|
1033
|
+
*/
|
|
1034
|
+
"computer.current": {
|
|
1035
|
+
params: z.ZodObject<{
|
|
1036
|
+
runId: z.ZodString;
|
|
1037
|
+
environmentId: z.ZodString;
|
|
1038
|
+
}, z.core.$strict>;
|
|
1039
|
+
result: z.ZodObject<{
|
|
1040
|
+
url: z.ZodString;
|
|
1041
|
+
}, z.core.$strict>;
|
|
1042
|
+
};
|
|
1027
1043
|
/**
|
|
1028
1044
|
* An artifact the run's session may read (the artifact seam, protocol 15): one of the session's
|
|
1029
1045
|
* own, or a Tenant-wide one its messages named; anything else is `not_found`, alike. The answer
|
|
@@ -594,6 +594,17 @@ export const harnessRequests = {
|
|
|
594
594
|
params: runId.extend({ environmentId: id }).strict(),
|
|
595
595
|
result: z.object({ url: z.string().url(), ticket: z.string().min(1), expiresAt: z.number().int() }).strict(),
|
|
596
596
|
},
|
|
597
|
+
/**
|
|
598
|
+
* Where the computer of the run's session is now (Harness API 5.7), without waking it: the
|
|
599
|
+
* sandbox gateway's URL for its current incarnation. A restore, a reset or a lost volume's
|
|
600
|
+
* recovery gives the computer a new volume, and with it a new URL: a harness asks before each
|
|
601
|
+
* request to the computer and, when the URL is not the one its `computer.open` answered, opens
|
|
602
|
+
* it again rather than reach the last one. Refused as `computer.open` is for another computer.
|
|
603
|
+
*/
|
|
604
|
+
"computer.current": {
|
|
605
|
+
params: runId.extend({ environmentId: id }).strict(),
|
|
606
|
+
result: z.object({ url: z.string().url() }).strict(),
|
|
607
|
+
},
|
|
597
608
|
/**
|
|
598
609
|
* An artifact the run's session may read (the artifact seam, protocol 15): one of the session's
|
|
599
610
|
* own, or a Tenant-wide one its messages named; anything else is `not_found`, alike. The answer
|
package/dist/manifest-schemas.js
CHANGED
|
@@ -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 =
|
|
25
|
-
const HARNESS_MANIFEST_FILE_REVISION =
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
},
|
package/dist/types/manifest.d.ts
CHANGED
|
@@ -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
|
}
|