@nylorun/core 0.33.0-beta → 0.35.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/compatibility.d.ts +25 -1
  3. package/dist/compatibility.js +24 -0
  4. package/dist/contracts.d.ts +749 -17
  5. package/dist/contracts.js +360 -22
  6. package/dist/define.d.ts +1 -1
  7. package/dist/define.js +1 -1
  8. package/dist/definition/assemble.d.ts +2 -1
  9. package/dist/definition/assemble.js +1 -0
  10. package/dist/definition/from.js +1 -0
  11. package/dist/definition/manifest.d.ts +2 -1
  12. package/dist/definition/manifest.js +1 -0
  13. package/dist/definition/sections.d.ts +1 -1
  14. package/dist/definition/sections.js +5 -1
  15. package/dist/definition/variant.d.ts +16 -1
  16. package/dist/definition/variant.js +81 -3
  17. package/dist/engine/blocks.d.ts +54 -0
  18. package/dist/engine/blocks.js +162 -0
  19. package/dist/engine/explain.d.ts +36 -0
  20. package/dist/engine/explain.js +113 -0
  21. package/dist/engine/features.d.ts +28 -0
  22. package/dist/engine/features.js +34 -0
  23. package/dist/engine/index.d.ts +14 -0
  24. package/dist/engine/index.js +14 -0
  25. package/dist/engine/mcp.d.ts +119 -0
  26. package/dist/engine/mcp.js +267 -0
  27. package/dist/engine/names.d.ts +12 -0
  28. package/dist/engine/names.js +26 -0
  29. package/dist/engine/preview.d.ts +93 -0
  30. package/dist/engine/preview.js +120 -0
  31. package/dist/engine/projection.d.ts +63 -0
  32. package/dist/engine/projection.js +109 -0
  33. package/dist/engine/tools.d.ts +118 -0
  34. package/dist/engine/tools.js +508 -0
  35. package/dist/folder/compile.d.ts +11 -4
  36. package/dist/folder/compile.js +126 -13
  37. package/dist/folder/context.d.ts +5 -0
  38. package/dist/folder/decompile.js +22 -1
  39. package/dist/folder/engine.d.ts +73 -0
  40. package/dist/folder/engine.js +224 -0
  41. package/dist/folder/nested.js +6 -0
  42. package/dist/folder/schemas.js +47 -3
  43. package/dist/harness-api/harness-api.schema.json +29 -7
  44. package/dist/harness-api/json-schema.js +6 -2
  45. package/dist/harness-api/messages.d.ts +4 -2
  46. package/dist/harness-api/messages.js +4 -1
  47. package/dist/harness-api/schema.d.ts +15 -4
  48. package/dist/harness-api/schema.js +20 -4
  49. package/dist/manifest-schemas.js +9 -4
  50. package/dist/schemas/agent-folder/agent-md.schema.json +84 -3
  51. package/dist/schemas/agent-folder/runtime.schema.json +34 -1
  52. package/dist/schemas/agent-manifest.schema.json +166 -1
  53. package/dist/schemas/harness-manifest.schema.json +130 -1
  54. package/dist/schemas/runtime-manifest.schema.json +34 -1
  55. package/dist/types/manifest.d.ts +49 -0
  56. package/package.json +5 -1
@@ -22,6 +22,8 @@ import { AGENT_MANIFEST_NAME_PATTERN, ENVIRONMENT_NAME_PATTERN, HarnessIdSchema,
22
22
  import { DELEGATE_NAME_PATTERN } from "../definition/delegate.js";
23
23
  import { AGENT_KEYS, FOLDER_SCHEMAS, MCP_KEYS, PLUGIN_SERVER_SETTING_KEYS, SERVER_KEYS, TOOL_KEYS, TRIGGER_KEYS, } from "./compile.js";
24
24
  import { LOOP_KEYS, MAP_KEYS, NODE_KINDS, SWITCH_KEYS, VERIFY_KEYS } from "./flow.js";
25
+ import { SANDBOX_TOOL_NAMES } from "../utils/sandbox.js";
26
+ import { ENGINE_BLOCK_NAMES } from "../engine/names.js";
25
27
  /** The kinds of file an agent folder has a JSON Schema document for. */
26
28
  export const AGENT_FOLDER_SCHEMA_KINDS = ["agent-md", "trigger-md", "runtime", "tool", "mcp", "flow"];
27
29
  const DIALECT = "https://json-schema.org/draft/2020-12/schema";
@@ -50,9 +52,12 @@ function fromZod(schema, defs, description) {
50
52
  /**
51
53
  * A kind's revision within format 1, when its document gained an optional key (a published `$id`
52
54
  * names one document for good): `AGENT.md` took `model` (Host feature `agent-model`), published
53
- * as `agent-md.1.json`.
55
+ * as `agent-md.1.json`, then `format: agent-folder/2` and `engine` (ADR-100), as `agent-md.2.json`,
56
+ * then `engine.triggers` (D83), as `agent-md.3.json`;
57
+ * `runtime.json` took a secret slot's `toolPrefix` (Host feature `secret-routing`), published as
58
+ * `runtime.1.json`, then `limits.triggers` (D83), as `runtime.2.json`.
54
59
  */
55
- const REVISIONS = { "agent-md": 1 };
60
+ const REVISIONS = { "agent-md": 3, runtime: 2 };
56
61
  /** One document: its `$id` from its kind, then the body, then the `$defs` its parts named. */
57
62
  function document(kind, title, description, body, defs) {
58
63
  const revision = REVISIONS[kind];
@@ -91,7 +96,10 @@ function agentMd() {
91
96
  const properties = {
92
97
  name: { type: "string", pattern: AGENT_MANIFEST_NAME_PATTERN.source, description: "The agent manifest's name, the folder's when it is saved under one" },
93
98
  description: { type: "string", minLength: 1, description: "What the agent does, in a sentence" },
94
- format: { const: 1, description: "The folder's format: 1 (agent-folder/1), the default" },
99
+ format: {
100
+ enum: [1, 2, "agent-folder/1", "agent-folder/2"],
101
+ description: "The folder's format: agent-folder/1 (or 1, the default), which gets every engine feature by default, or agent-folder/2 (or 2), which declares each in engine",
102
+ },
95
103
  harness: fromZod(HarnessIdSchema, defs, "The harness that runs the loop: nylorun (ours, the default) or a custom harness's id"),
96
104
  inputSchema: ref("JsonSchemaOrPath", "A flow's input (a folder with flow.json); an agent's input is the message"),
97
105
  outputSchema: ref("JsonSchemaOrPath", "The JSON Schema of the agent's final answer"),
@@ -113,6 +121,42 @@ function agentMd() {
113
121
  description: "The harness's own settings, passed to it each turn; the nylorun harness reads plan (true offers the agent update_plan) and connections (true offers it request_connection)",
114
122
  },
115
123
  model: fromZod(AgentModelSchema, defs, "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"),
124
+ engine: {
125
+ type: "object",
126
+ 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/)",
127
+ properties: {
128
+ sandbox: {
129
+ type: "array",
130
+ items: { enum: [...SANDBOX_TOOL_NAMES] },
131
+ uniqueItems: true,
132
+ description: "The sandbox tools offered: any of bash, read, write, edit, grep and glob; needs a computer in runtime.json",
133
+ },
134
+ artifacts: {
135
+ type: "object",
136
+ properties: {
137
+ read: { type: "boolean", description: "read_artifact, and the text on results too large to show and files of earlier turns" },
138
+ save: { type: "boolean", description: "save_artifact and its text; needs a computer" },
139
+ },
140
+ additionalProperties: false,
141
+ },
142
+ outputs: { type: "boolean", description: "Save /workspace/outputs as the session's outputs folder when a turn ends; needs a computer" },
143
+ toolSearch: {
144
+ type: "boolean",
145
+ description: "Defer the MCP tools behind tool_search when their schemas pass the threshold; a server's own deferred applies either way",
146
+ },
147
+ triggers: {
148
+ type: "boolean",
149
+ description: "The triggers tool and its text: the agent sets up its own schedules and follow-ups, kept by the Agent; the root agent's only",
150
+ },
151
+ instructions: {
152
+ type: "object",
153
+ propertyNames: { enum: [...ENGINE_BLOCK_NAMES] },
154
+ additionalProperties: { type: "string", pattern: "^(\\./)?engine/.+\\.md$" },
155
+ description: "A block's wording, replaced by a Markdown file under engine/, by block name; the memory rule that outside text is data stays",
156
+ },
157
+ },
158
+ additionalProperties: false,
159
+ },
116
160
  metadata: { type: "object", description: "The manifest's metadata, as it is" },
117
161
  };
118
162
  return document("agent-md", "Nylorun agent folder: AGENT.md frontmatter", "The frontmatter of an agent folder's AGENT.md; the body below it is the instructions", { type: "object", properties, required: ["name", "description"], additionalProperties: false }, defs);
@@ -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.1.json",
3
+ "$id": "https://docs.nylorun.com/schemas/harness-api/v5.3.json",
4
4
  "title": "Nylorun Harness API 5",
5
5
  "$defs": {
6
6
  "ArtifactMeta": {
@@ -191,7 +191,8 @@
191
191
  "type": "string",
192
192
  "enum": [
193
193
  "schedule_wake",
194
- "memory"
194
+ "memory",
195
+ "triggers"
195
196
  ]
196
197
  }
197
198
  },
@@ -633,7 +634,8 @@
633
634
  "type": "string",
634
635
  "enum": [
635
636
  "schedule_wake",
636
- "memory"
637
+ "memory",
638
+ "triggers"
637
639
  ]
638
640
  }
639
641
  },
@@ -676,6 +678,10 @@
676
678
  },
677
679
  "selfWake": {
678
680
  "type": "boolean"
681
+ },
682
+ "triggers": {
683
+ "type": "boolean",
684
+ "const": true
679
685
  }
680
686
  },
681
687
  "required": [
@@ -1194,11 +1200,14 @@
1194
1200
  },
1195
1201
  "truncated": {
1196
1202
  "type": "boolean"
1203
+ },
1204
+ "refresh": {
1205
+ "type": "boolean",
1206
+ "const": true
1197
1207
  }
1198
1208
  },
1199
1209
  "required": [
1200
1210
  "access",
1201
- "index",
1202
1211
  "truncated"
1203
1212
  ],
1204
1213
  "additionalProperties": false
@@ -1559,6 +1568,10 @@
1559
1568
  },
1560
1569
  "selfWake": {
1561
1570
  "type": "boolean"
1571
+ },
1572
+ "triggers": {
1573
+ "type": "boolean",
1574
+ "const": true
1562
1575
  }
1563
1576
  },
1564
1577
  "required": [
@@ -3389,11 +3402,14 @@
3389
3402
  },
3390
3403
  "truncated": {
3391
3404
  "type": "boolean"
3405
+ },
3406
+ "refresh": {
3407
+ "type": "boolean",
3408
+ "const": true
3392
3409
  }
3393
3410
  },
3394
3411
  "required": [
3395
3412
  "access",
3396
- "index",
3397
3413
  "truncated"
3398
3414
  ],
3399
3415
  "additionalProperties": false
@@ -3754,6 +3770,10 @@
3754
3770
  },
3755
3771
  "selfWake": {
3756
3772
  "type": "boolean"
3773
+ },
3774
+ "triggers": {
3775
+ "type": "boolean",
3776
+ "const": true
3757
3777
  }
3758
3778
  },
3759
3779
  "required": [
@@ -4006,7 +4026,8 @@
4006
4026
  "type": "string",
4007
4027
  "enum": [
4008
4028
  "schedule_wake",
4009
- "memory"
4029
+ "memory",
4030
+ "triggers"
4010
4031
  ]
4011
4032
  }
4012
4033
  },
@@ -4302,7 +4323,8 @@
4302
4323
  "environment.exec",
4303
4324
  "artifact.export.skipped",
4304
4325
  "artifact.export.failed",
4305
- "plan.updated"
4326
+ "plan.updated",
4327
+ "engine.diagnostic"
4306
4328
  ]
4307
4329
  },
4308
4330
  "payload": {},
@@ -51,9 +51,13 @@ export function harnessApiSchemas() {
51
51
  /**
52
52
  * The revision of v5's document: the claims a harness may make grew within v5 (`plan.updated`,
53
53
  * additive: core accepts more, and a v5 harness that claims none of it is unchanged), and a
54
- * published `$id` names one document for good.
54
+ * published `$id` names one document for good. Revision 2: `engine.diagnostic` among the claims,
55
+ * `turn.start.memory.index` absent for a version that pins none (ADR-100), and
56
+ * `turn.start.memory.refresh` (an optional field a v5 harness may ignore, keeping the index it
57
+ * pinned). Revision 3: `turn.start.agent.triggers` and the `runtime` operation `triggers` (D83),
58
+ * which a v5 harness that offers no `triggers` tool never sees.
55
59
  */
56
- const SCHEMA_REVISION = 1;
60
+ const SCHEMA_REVISION = 3;
57
61
  /** The JSON Schema document of the Harness API (draft 2020-12). */
58
62
  export function harnessApiJsonSchema() {
59
63
  const $defs = {};
@@ -22,9 +22,11 @@ export type ReleaseReason = z.infer<typeof ReleaseReasonSchema>;
22
22
  * `environment.state` claim carries the workspace's compute record, which core keeps. Our engine
23
23
  * claims `artifact.export.skipped` and `artifact.export.failed` when the turn-end save of its
24
24
  * outputs folder stores nothing (protocol 15), and `plan.updated` when the agent calls its
25
- * built-in `update_plan` tool (additive within v5).
25
+ * built-in `update_plan` tool, and `engine.diagnostic` when an agent's declarations leave it
26
+ * something to say instead of choose, such as MCP tools past the deferral threshold of an agent
27
+ * that does not declare tool search (ADR-100; both additive within v5).
26
28
  */
27
- export declare const HARNESS_CLAIMS: readonly ["environment.state", "environment.exec", "artifact.export.skipped", "artifact.export.failed", "plan.updated"];
29
+ export declare const HARNESS_CLAIMS: readonly ["environment.state", "environment.exec", "artifact.export.skipped", "artifact.export.failed", "plan.updated", "engine.diagnostic"];
28
30
  export type HarnessClaim = (typeof HARNESS_CLAIMS)[number];
29
31
  export declare const HARNESS_ERROR_CODES: readonly ["run_not_held", "turn_cancelled", "ownership_lost", "effect_drift", "invalid", "unavailable", "internal",
30
32
  /**
@@ -6,7 +6,9 @@ export const ABORT_REASONS = ["cancel", "shutdown", "deadline", "ownership.lost"
6
6
  * `environment.state` claim carries the workspace's compute record, which core keeps. Our engine
7
7
  * claims `artifact.export.skipped` and `artifact.export.failed` when the turn-end save of its
8
8
  * outputs folder stores nothing (protocol 15), and `plan.updated` when the agent calls its
9
- * built-in `update_plan` tool (additive within v5).
9
+ * built-in `update_plan` tool, and `engine.diagnostic` when an agent's declarations leave it
10
+ * something to say instead of choose, such as MCP tools past the deferral threshold of an agent
11
+ * that does not declare tool search (ADR-100; both additive within v5).
10
12
  */
11
13
  export const HARNESS_CLAIMS = [
12
14
  "environment.state",
@@ -14,6 +16,7 @@ export const HARNESS_CLAIMS = [
14
16
  "artifact.export.skipped",
15
17
  "artifact.export.failed",
16
18
  "plan.updated",
19
+ "engine.diagnostic",
17
20
  ];
18
21
  export const HARNESS_ERROR_CODES = [
19
22
  "run_not_held",
@@ -118,6 +118,7 @@ export declare const EffectTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
118
118
  operation: z.ZodEnum<{
119
119
  memory: "memory";
120
120
  schedule_wake: "schedule_wake";
121
+ triggers: "triggers";
121
122
  }>;
122
123
  }, z.core.$strict>], "kind">;
123
124
  /**
@@ -178,6 +179,7 @@ export declare const EffectIntentSchema: z.ZodObject<{
178
179
  operation: z.ZodEnum<{
179
180
  memory: "memory";
180
181
  schedule_wake: "schedule_wake";
182
+ triggers: "triggers";
181
183
  }>;
182
184
  }, z.core.$strict>], "kind">>;
183
185
  skill: z.ZodOptional<z.ZodString>;
@@ -407,6 +409,7 @@ export declare const TurnAgentSchema: z.ZodObject<{
407
409
  workspace: z.ZodString;
408
410
  }, z.core.$strict>>;
409
411
  selfWake: z.ZodOptional<z.ZodBoolean>;
412
+ triggers: z.ZodOptional<z.ZodLiteral<true>>;
410
413
  }, z.core.$strict>;
411
414
  /**
412
415
  * The Agent's memory as a turn starts, present when the version its session runs
@@ -414,7 +417,8 @@ export declare const TurnAgentSchema: z.ZodObject<{
414
417
  * harness pins in the session (one line per memory, newest first, with its description, within
415
418
  * the Runtime limits `memoryIndexLines` and `memoryIndexBytes`; `truncated` when some were left
416
419
  * out). A harness offers the `memory` tool (a `runtime` effect, operation `memory`), view only for
417
- * `read_only` and for its sub-agents.
420
+ * `read_only` and for its sub-agents. The index is the Runtime's as the segment starts; a harness
421
+ * keeps the one it pinned, and pins it again when `refresh` says the memory changed elsewhere.
418
422
  */
419
423
  export declare const TurnMemorySchema: z.ZodObject<{
420
424
  access: z.ZodEnum<{
@@ -422,8 +426,9 @@ export declare const TurnMemorySchema: z.ZodObject<{
422
426
  read_write: "read_write";
423
427
  }>;
424
428
  instructions: z.ZodOptional<z.ZodString>;
425
- index: z.ZodString;
429
+ index: z.ZodOptional<z.ZodString>;
426
430
  truncated: z.ZodBoolean;
431
+ refresh: z.ZodOptional<z.ZodLiteral<true>>;
427
432
  }, z.core.$strict>;
428
433
  /** What a run starts from: `turn.start` (message, continue, resume) or `approval.answer`. */
429
434
  export declare const TurnStartSchema: z.ZodObject<{
@@ -447,8 +452,9 @@ export declare const TurnStartSchema: z.ZodObject<{
447
452
  read_write: "read_write";
448
453
  }>;
449
454
  instructions: z.ZodOptional<z.ZodString>;
450
- index: z.ZodString;
455
+ index: z.ZodOptional<z.ZodString>;
451
456
  truncated: z.ZodBoolean;
457
+ refresh: z.ZodOptional<z.ZodLiteral<true>>;
452
458
  }, z.core.$strict>>;
453
459
  checkpoint: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
454
460
  mcp: z.ZodOptional<z.ZodObject<{
@@ -534,6 +540,7 @@ export declare const TurnStartSchema: z.ZodObject<{
534
540
  workspace: z.ZodString;
535
541
  }, z.core.$strict>>;
536
542
  selfWake: z.ZodOptional<z.ZodBoolean>;
543
+ triggers: z.ZodOptional<z.ZodLiteral<true>>;
537
544
  }, z.core.$strict>>;
538
545
  }, z.core.$strict>;
539
546
  /**
@@ -688,8 +695,9 @@ export declare const harnessRequests: {
688
695
  read_write: "read_write";
689
696
  }>;
690
697
  instructions: z.ZodOptional<z.ZodString>;
691
- index: z.ZodString;
698
+ index: z.ZodOptional<z.ZodString>;
692
699
  truncated: z.ZodBoolean;
700
+ refresh: z.ZodOptional<z.ZodLiteral<true>>;
693
701
  }, z.core.$strict>>;
694
702
  checkpoint: z.ZodType<object, unknown, z.core.$ZodTypeInternals<object, unknown>>;
695
703
  mcp: z.ZodOptional<z.ZodObject<{
@@ -775,6 +783,7 @@ export declare const harnessRequests: {
775
783
  workspace: z.ZodString;
776
784
  }, z.core.$strict>>;
777
785
  selfWake: z.ZodOptional<z.ZodBoolean>;
786
+ triggers: z.ZodOptional<z.ZodLiteral<true>>;
778
787
  }, z.core.$strict>>;
779
788
  }, z.core.$strict>;
780
789
  }, z.core.$strict>;
@@ -839,6 +848,7 @@ export declare const harnessRequests: {
839
848
  operation: z.ZodEnum<{
840
849
  memory: "memory";
841
850
  schedule_wake: "schedule_wake";
851
+ triggers: "triggers";
842
852
  }>;
843
853
  }, z.core.$strict>], "kind">>;
844
854
  skill: z.ZodOptional<z.ZodString>;
@@ -905,6 +915,7 @@ export declare const harnessRequests: {
905
915
  type: z.ZodEnum<{
906
916
  "artifact.export.failed": "artifact.export.failed";
907
917
  "artifact.export.skipped": "artifact.export.skipped";
918
+ "engine.diagnostic": "engine.diagnostic";
908
919
  "environment.exec": "environment.exec";
909
920
  "environment.state": "environment.state";
910
921
  "plan.updated": "plan.updated";
@@ -85,9 +85,11 @@ export const EffectTargetSchema = z.discriminatedUnion("kind", [
85
85
  * An operation the Runtime itself serves, in the transaction that journals the call, keyed by
86
86
  * the effect id: `schedule_wake` books the session's next turn; `memory` is a
87
87
  * call of the `memory` tool, with Anthropic's memory tool parameters as its input,
88
- * on the Agent's memories. Answered at once; the harness never executes it.
88
+ * on the Agent's memories; `triggers` lists, creates and deletes the triggers the session made
89
+ * (D83, `TriggerToolInputSchema`). Answered at once, unless the Tenant's tool policy holds it
90
+ * for a person; the harness never executes it.
89
91
  */
90
- z.object({ kind: z.literal("runtime"), operation: z.enum(["schedule_wake", "memory"]) }).strict(),
92
+ z.object({ kind: z.literal("runtime"), operation: z.enum(["schedule_wake", "memory", "triggers"]) }).strict(),
91
93
  ]);
92
94
  /**
93
95
  * One effect the engine asks for: a `HostEffect`, by structure. Model intents carry no `input`.
@@ -325,6 +327,11 @@ export const TurnAgentSchema = z
325
327
  * `schedule_wake`, a `runtime` effect.
326
328
  */
327
329
  selfWake: z.boolean().optional(),
330
+ /**
331
+ * The version the session runs declares `harness.engine.triggers` (D83): our engine offers
332
+ * the root agent the `triggers` tool, a `runtime` effect.
333
+ */
334
+ triggers: z.literal(true).optional(),
328
335
  })
329
336
  .strict();
330
337
  /**
@@ -333,14 +340,23 @@ export const TurnAgentSchema = z
333
340
  * harness pins in the session (one line per memory, newest first, with its description, within
334
341
  * the Runtime limits `memoryIndexLines` and `memoryIndexBytes`; `truncated` when some were left
335
342
  * out). A harness offers the `memory` tool (a `runtime` effect, operation `memory`), view only for
336
- * `read_only` and for its sub-agents.
343
+ * `read_only` and for its sub-agents. The index is the Runtime's as the segment starts; a harness
344
+ * keeps the one it pinned, and pins it again when `refresh` says the memory changed elsewhere.
337
345
  */
338
346
  export const TurnMemorySchema = z
339
347
  .object({
340
348
  access: z.enum(["read_write", "read_only"]),
341
349
  instructions: z.string().optional(),
342
- index: z.string(),
350
+ /** Absent when the version sets `harness.memory.index: false` (ADR-100): nothing is pinned. */
351
+ index: z.string().optional(),
343
352
  truncated: z.boolean(),
353
+ /**
354
+ * Set at a turn's first segment when someone other than this session (another session of the
355
+ * Agent, or a person over the API) wrote its memory since the session's last turn started: the
356
+ * harness pins `index` again in place of the one it pinned before. Never set mid-turn. Within
357
+ * v5, core sends it only to Nylorun's own harness (`nylorun`, the Runtime's own version).
358
+ */
359
+ refresh: z.literal(true).optional(),
344
360
  })
345
361
  .strict();
346
362
  /** What a run starts from: `turn.start` (message, continue, resume) or `approval.answer`. */
@@ -14,10 +14,15 @@ import { AGENT_MANIFEST_V8_SCHEMA_VERSION, AgentManifestFileSchema, HARNESS_MANI
14
14
  /**
15
15
  * The revision of a document whose version kept its number while it gained an optional field (a
16
16
  * published `$id` names one document for good): agent manifest v8 and the harness file v1 took
17
- * `harness.model` (Host feature `agent-model`), published as `v8.1` and `v1.1`.
17
+ * `harness.model` (Host feature `agent-model`), published as `v8.1` and `v1.1`, then
18
+ * `harness.engine` and `harness.memory.index` (ADR-100) and a secret slot's `toolPrefix` (Host
19
+ * feature `secret-routing`), published as agent manifest `v8.2`, harness file `v1.2` and runtime
20
+ * file `v1.1`, then `harness.engine.triggers` and `runtime.limits.triggers` (D83), published as
21
+ * agent manifest `v8.3`, harness file `v1.3` and runtime file `v1.2`.
18
22
  */
19
- const AGENT_MANIFEST_REVISION = 1;
20
- const HARNESS_MANIFEST_FILE_REVISION = 1;
23
+ const AGENT_MANIFEST_REVISION = 3;
24
+ const HARNESS_MANIFEST_FILE_REVISION = 3;
25
+ const RUNTIME_MANIFEST_FILE_REVISION = 2;
21
26
  function document(schema, id, title) {
22
27
  const { $schema: _, ...definition } = z.toJSONSchema(schema, { io: "input", unrepresentable: "any" });
23
28
  const properties = (definition.properties ?? {});
@@ -46,5 +51,5 @@ export function harnessManifestJsonSchema() {
46
51
  }
47
52
  /** `runtime.manifest.json`'s JSON Schema document: the runtime section as an authoring file. */
48
53
  export function runtimeManifestJsonSchema() {
49
- return document(RuntimeManifestFileSchema, `runtime-manifest/v${RUNTIME_MANIFEST_FILE_SCHEMA_VERSION}`, `Nylorun runtime manifest ${RUNTIME_MANIFEST_FILE_SCHEMA_VERSION}`);
54
+ return document(RuntimeManifestFileSchema, `runtime-manifest/v${RUNTIME_MANIFEST_FILE_SCHEMA_VERSION}.${RUNTIME_MANIFEST_FILE_REVISION}`, `Nylorun runtime manifest ${RUNTIME_MANIFEST_FILE_SCHEMA_VERSION}`);
50
55
  }
@@ -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.1.json",
3
+ "$id": "https://docs.nylorun.com/schemas/agent-folder/v1/agent-md.3.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",
@@ -16,8 +16,13 @@
16
16
  "description": "What the agent does, in a sentence"
17
17
  },
18
18
  "format": {
19
- "const": 1,
20
- "description": "The folder's format: 1 (agent-folder/1), the default"
19
+ "enum": [
20
+ 1,
21
+ 2,
22
+ "agent-folder/1",
23
+ "agent-folder/2"
24
+ ],
25
+ "description": "The folder's format: agent-folder/1 (or 1, the default), which gets every engine feature by default, or agent-folder/2 (or 2), which declares each in engine"
21
26
  },
22
27
  "harness": {
23
28
  "type": "string",
@@ -75,6 +80,10 @@
75
80
  "description": "What this agent should remember, after the engine's own memory rules",
76
81
  "type": "string",
77
82
  "maxLength": 4096
83
+ },
84
+ "index": {
85
+ "description": "agent-folder/2: false pins no memory index in a session. Default true",
86
+ "type": "boolean"
78
87
  }
79
88
  },
80
89
  "additionalProperties": false,
@@ -90,6 +99,78 @@
90
99
  "pattern": "^[A-Za-z0-9._-]+\\/\\S+$",
91
100
  "description": "The model the agent runs on: <provider>/<model>, such as anthropic/claude-sonnet-4-5"
92
101
  },
102
+ "engine": {
103
+ "type": "object",
104
+ "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/)",
105
+ "properties": {
106
+ "sandbox": {
107
+ "type": "array",
108
+ "items": {
109
+ "enum": [
110
+ "bash",
111
+ "read",
112
+ "write",
113
+ "edit",
114
+ "grep",
115
+ "glob"
116
+ ]
117
+ },
118
+ "uniqueItems": true,
119
+ "description": "The sandbox tools offered: any of bash, read, write, edit, grep and glob; needs a computer in runtime.json"
120
+ },
121
+ "artifacts": {
122
+ "type": "object",
123
+ "properties": {
124
+ "read": {
125
+ "type": "boolean",
126
+ "description": "read_artifact, and the text on results too large to show and files of earlier turns"
127
+ },
128
+ "save": {
129
+ "type": "boolean",
130
+ "description": "save_artifact and its text; needs a computer"
131
+ }
132
+ },
133
+ "additionalProperties": false
134
+ },
135
+ "outputs": {
136
+ "type": "boolean",
137
+ "description": "Save /workspace/outputs as the session's outputs folder when a turn ends; needs a computer"
138
+ },
139
+ "toolSearch": {
140
+ "type": "boolean",
141
+ "description": "Defer the MCP tools behind tool_search when their schemas pass the threshold; a server's own deferred applies either way"
142
+ },
143
+ "triggers": {
144
+ "type": "boolean",
145
+ "description": "The triggers tool and its text: the agent sets up its own schedules and follow-ups, kept by the Agent; the root agent's only"
146
+ },
147
+ "instructions": {
148
+ "type": "object",
149
+ "propertyNames": {
150
+ "enum": [
151
+ "skills",
152
+ "sandbox",
153
+ "skill_folder",
154
+ "artifacts_save",
155
+ "outputs",
156
+ "artifacts_read",
157
+ "wake",
158
+ "triggers",
159
+ "memory",
160
+ "plan",
161
+ "connection",
162
+ "tool_search"
163
+ ]
164
+ },
165
+ "additionalProperties": {
166
+ "type": "string",
167
+ "pattern": "^(\\./)?engine/.+\\.md$"
168
+ },
169
+ "description": "A block's wording, replaced by a Markdown file under engine/, by block name; the memory rule that outside text is data stays"
170
+ }
171
+ },
172
+ "additionalProperties": false
173
+ },
93
174
  "metadata": {
94
175
  "type": "object",
95
176
  "description": "The manifest's metadata, as it is"
@@ -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/runtime.json",
3
+ "$id": "https://docs.nylorun.com/schemas/agent-folder/v1/runtime.2.json",
4
4
  "title": "Nylorun agent folder: runtime.json",
5
5
  "description": "An agent folder's runtime.json: the runtime section of the agent manifest. kind is required unless extends names a file that gives it",
6
6
  "type": "object",
@@ -194,6 +194,27 @@
194
194
  }
195
195
  },
196
196
  "additionalProperties": false
197
+ },
198
+ "triggers": {
199
+ "type": "object",
200
+ "properties": {
201
+ "count": {
202
+ "type": "integer",
203
+ "exclusiveMinimum": 0,
204
+ "maximum": 9007199254740991
205
+ },
206
+ "minIntervalMs": {
207
+ "type": "integer",
208
+ "exclusiveMinimum": 0,
209
+ "maximum": 9007199254740991
210
+ },
211
+ "runsPerHour": {
212
+ "type": "integer",
213
+ "exclusiveMinimum": 0,
214
+ "maximum": 9007199254740991
215
+ }
216
+ },
217
+ "additionalProperties": false
197
218
  }
198
219
  },
199
220
  "additionalProperties": false
@@ -296,6 +317,12 @@
296
317
  ],
297
318
  "additionalProperties": false
298
319
  },
320
+ "toolPrefix": {
321
+ "type": "string",
322
+ "minLength": 1,
323
+ "maxLength": 64,
324
+ "pattern": "^[\\x21-\\x7e]+$"
325
+ },
299
326
  "required": {
300
327
  "type": "boolean"
301
328
  },
@@ -336,6 +363,12 @@
336
363
  ],
337
364
  "additionalProperties": false
338
365
  },
366
+ "toolPrefix": {
367
+ "type": "string",
368
+ "minLength": 1,
369
+ "maxLength": 64,
370
+ "pattern": "^[\\x21-\\x7e]+$"
371
+ },
339
372
  "required": {
340
373
  "type": "boolean"
341
374
  },