@parcha/agentrun-serve 0.1.0-beta.52 → 0.1.0-beta.53

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 (261) hide show
  1. package/CHANGELOG.md +122 -1
  2. package/README.md +213 -24
  3. package/dist/agent-delete.d.ts +5 -6
  4. package/dist/agent-delete.js +30 -67
  5. package/dist/agent-package.d.ts +71 -0
  6. package/dist/agent-package.js +345 -0
  7. package/dist/agents-store.d.ts +26 -20
  8. package/dist/agents-store.js +41 -33
  9. package/dist/api-only.d.ts +26 -6
  10. package/dist/api-only.js +35 -13
  11. package/dist/claude-login.d.ts +1 -0
  12. package/dist/claude-login.js +1 -1
  13. package/dist/cli-learning/cli.d.ts +3 -0
  14. package/dist/cli-learning/cli.js +17 -3
  15. package/dist/cli-learning/connections.js +3 -2
  16. package/dist/cli-learning/schema.js +2 -1
  17. package/dist/cli.js +70 -7
  18. package/dist/composio-preset.d.ts +2 -1
  19. package/dist/composio-preset.js +4 -3
  20. package/dist/composio-triggers.d.ts +4 -0
  21. package/dist/composio-triggers.js +4 -1
  22. package/dist/computer-needs.d.ts +32 -0
  23. package/dist/computer-needs.js +80 -0
  24. package/dist/computer-setting.d.ts +1 -0
  25. package/dist/computer-setting.js +8 -1
  26. package/dist/console/assets/index-BFgyZzF_.js +734 -0
  27. package/dist/console/assets/index-DbilxljH.css +1 -0
  28. package/dist/console/index.html +2 -2
  29. package/dist/console-links.d.ts +1 -0
  30. package/dist/console-links.js +2 -0
  31. package/dist/env-switch.d.ts +14 -0
  32. package/dist/env-switch.js +23 -0
  33. package/dist/errors.d.ts +1 -0
  34. package/dist/errors.js +3 -0
  35. package/dist/eval-previous.js +4 -3
  36. package/dist/fal-price.js +10 -13
  37. package/dist/handed-secret.d.ts +4 -0
  38. package/dist/handed-secret.js +10 -0
  39. package/dist/harness-archive.d.ts +15 -5
  40. package/dist/harness-archive.js +71 -34
  41. package/dist/harness-check.d.ts +2 -1
  42. package/dist/harness-check.js +36 -95
  43. package/dist/harness-egress.d.ts +23 -0
  44. package/dist/harness-egress.js +69 -0
  45. package/dist/harness-recipe-entry.d.ts +71 -0
  46. package/dist/harness-recipe-entry.js +184 -0
  47. package/dist/harness-recipe.d.ts +73 -6
  48. package/dist/harness-recipe.js +185 -31
  49. package/dist/harness-sign-in.d.ts +29 -0
  50. package/dist/harness-sign-in.js +122 -0
  51. package/dist/harness-table.d.ts +21 -0
  52. package/dist/harness-table.js +58 -3
  53. package/dist/harness-zip.d.ts +6 -0
  54. package/dist/harness-zip.js +203 -0
  55. package/dist/ids.d.ts +11 -0
  56. package/dist/ids.js +36 -0
  57. package/dist/learn/commit.d.ts +14 -1
  58. package/dist/learn/commit.js +156 -1
  59. package/dist/learn/compile.js +22 -8
  60. package/dist/learn/folder.d.ts +5 -0
  61. package/dist/learn/folder.js +10 -1
  62. package/dist/learn/learning.sh +15 -3
  63. package/dist/learn/promote.d.ts +2 -2
  64. package/dist/learn/secrets.js +30 -7
  65. package/dist/learning-routes.d.ts +23 -11
  66. package/dist/learning-routes.js +110 -20
  67. package/dist/learning.d.ts +9 -6
  68. package/dist/learning.js +9 -4
  69. package/dist/mcp-gateway.js +15 -2
  70. package/dist/mcp-probe.d.ts +3 -0
  71. package/dist/mcp-probe.js +7 -2
  72. package/dist/mcp-resources.d.ts +44 -0
  73. package/dist/mcp-resources.js +100 -0
  74. package/dist/mcp-servers-store.d.ts +16 -12
  75. package/dist/model.d.ts +4 -4
  76. package/dist/model.js +6 -6
  77. package/dist/native/cli.js +9 -2
  78. package/dist/native/connection.d.ts +2 -2
  79. package/dist/native/connection.js +5 -2
  80. package/dist/native/discovery.d.ts +2 -0
  81. package/dist/native/discovery.js +10 -6
  82. package/dist/native/remote-worker-bridge.js +36 -4
  83. package/dist/native/remote.d.ts +18 -1
  84. package/dist/native/remote.js +126 -37
  85. package/dist/native/schema.d.ts +6 -0
  86. package/dist/native/schema.js +31 -6
  87. package/dist/native/source-account.d.ts +13 -0
  88. package/dist/native/source-account.js +114 -0
  89. package/dist/native/source-capture-hooks.d.ts +5 -0
  90. package/dist/native/source-capture-hooks.js +102 -0
  91. package/dist/native/source-mcp-selection.d.ts +13 -0
  92. package/dist/native/source-mcp-selection.js +72 -0
  93. package/dist/native/source-runtime-tools.d.ts +19 -0
  94. package/dist/native/source-runtime-tools.js +103 -0
  95. package/dist/native/source-snapshot-types.d.ts +138 -0
  96. package/dist/native/source-snapshot-types.js +12 -0
  97. package/dist/native/source-snapshot.d.ts +8 -0
  98. package/dist/native/source-snapshot.js +1201 -0
  99. package/dist/observation/learning.js +3 -2
  100. package/dist/openapi.js +167 -36
  101. package/dist/print.js +1 -1
  102. package/dist/purged-workflow.d.ts +12 -0
  103. package/dist/purged-workflow.js +43 -0
  104. package/dist/run-keys.d.ts +46 -0
  105. package/dist/run-keys.js +109 -0
  106. package/dist/run-launch.d.ts +16 -1
  107. package/dist/run-launch.js +30 -1
  108. package/dist/run-learning-served.d.ts +2 -2
  109. package/dist/run-model-key.d.ts +2 -2
  110. package/dist/run-model-key.js +5 -5
  111. package/dist/run-secrets.d.ts +2 -0
  112. package/dist/run-secrets.js +7 -4
  113. package/dist/run-view.d.ts +17 -0
  114. package/dist/run-view.js +25 -1
  115. package/dist/runner/adapter-loop.d.ts +11 -3
  116. package/dist/runner/adapter-loop.js +138 -22
  117. package/dist/runner/adapter-run-spec.js +25 -12
  118. package/dist/runner/audit.d.ts +2 -0
  119. package/dist/runner/audit.js +9 -1
  120. package/dist/runner/beside.js +2 -1
  121. package/dist/runner/claim-secrets.d.ts +29 -3
  122. package/dist/runner/claim-secrets.js +38 -4
  123. package/dist/runner/cli-run-spec.js +23 -12
  124. package/dist/runner/harness-loops.d.ts +6 -0
  125. package/dist/runner/harness-loops.js +11 -1
  126. package/dist/runner/held.d.ts +4 -0
  127. package/dist/runner/journal-kinds.d.ts +2 -0
  128. package/dist/runner/learned-first.d.ts +2 -0
  129. package/dist/runner/learned-first.js +1 -1
  130. package/dist/runner/learning-end.d.ts +7 -2
  131. package/dist/runner/learning-end.js +22 -10
  132. package/dist/runner/learning-seed.d.ts +9 -3
  133. package/dist/runner/learning-seed.js +2 -2
  134. package/dist/runner/main.d.ts +1 -0
  135. package/dist/runner/main.js +20 -13
  136. package/dist/runner/mcp-claim.js +6 -1
  137. package/dist/runner/mcp-run.d.ts +10 -7
  138. package/dist/runner/mcp-run.js +3 -5
  139. package/dist/runner/monid-run.js +9 -11
  140. package/dist/runner/project-checkpoint.d.ts +35 -0
  141. package/dist/runner/project-checkpoint.js +116 -0
  142. package/dist/runner/project-drain.d.ts +8 -0
  143. package/dist/runner/project-drain.js +25 -0
  144. package/dist/runner/project-host.d.ts +10 -0
  145. package/dist/runner/project-host.js +52 -0
  146. package/dist/runner/promotion.d.ts +14 -6
  147. package/dist/runner/promotion.js +98 -41
  148. package/dist/runner/redact.d.ts +13 -0
  149. package/dist/runner/redact.js +67 -1
  150. package/dist/runner/run-channel.d.ts +9 -0
  151. package/dist/runner/run-channel.js +15 -2
  152. package/dist/runner/run-child-host.d.ts +8 -4
  153. package/dist/runner/run-child-host.js +171 -41
  154. package/dist/runner/run-errors.js +2 -2
  155. package/dist/runner/runner-check.js +5 -2
  156. package/dist/runner/runner.js +26 -9
  157. package/dist/runner/store-secrets.js +7 -3
  158. package/dist/runner/workflow-first.d.ts +4 -0
  159. package/dist/runner/workflow-first.js +13 -0
  160. package/dist/runner/workflow-loop.d.ts +2 -1
  161. package/dist/runner/workflow-loop.js +2 -1
  162. package/dist/runner/workflow-spec.js +1 -1
  163. package/dist/runs-over-store.d.ts +34 -6
  164. package/dist/runs-over-store.js +133 -25
  165. package/dist/sdk/runs.d.ts +11 -1
  166. package/dist/sdk/runs.js +117 -26
  167. package/dist/sdk/schema.js +12 -2
  168. package/dist/sdk/workflows.d.ts +1 -1
  169. package/dist/server.d.ts +68 -32
  170. package/dist/server.js +600 -110
  171. package/dist/skills/agentrun-serve/SKILL.md +2 -1
  172. package/dist/source-sync/adoption.d.ts +15 -0
  173. package/dist/source-sync/adoption.js +36 -0
  174. package/dist/source-sync/auxiliary.d.ts +23 -0
  175. package/dist/source-sync/auxiliary.js +64 -0
  176. package/dist/source-sync/capture-git.d.ts +5 -0
  177. package/dist/source-sync/capture-git.js +272 -0
  178. package/dist/source-sync/capture-project.d.ts +53 -0
  179. package/dist/source-sync/capture-project.js +206 -0
  180. package/dist/source-sync/capture-refusal.d.ts +7 -0
  181. package/dist/source-sync/capture-refusal.js +16 -0
  182. package/dist/source-sync/capture.d.ts +11 -0
  183. package/dist/source-sync/capture.js +22 -0
  184. package/dist/source-sync/checkpoint-gate.d.ts +21 -0
  185. package/dist/source-sync/checkpoint-gate.js +52 -0
  186. package/dist/source-sync/checkpoints.d.ts +66 -0
  187. package/dist/source-sync/checkpoints.js +168 -0
  188. package/dist/source-sync/claim.d.ts +11 -0
  189. package/dist/source-sync/claim.js +48 -0
  190. package/dist/source-sync/destination.d.ts +47 -0
  191. package/dist/source-sync/destination.js +239 -0
  192. package/dist/source-sync/io.d.ts +15 -0
  193. package/dist/source-sync/io.js +52 -0
  194. package/dist/source-sync/local.d.ts +43 -0
  195. package/dist/source-sync/local.js +229 -0
  196. package/dist/source-sync/prepare.d.ts +59 -0
  197. package/dist/source-sync/prepare.js +93 -0
  198. package/dist/source-sync/projects.d.ts +61 -0
  199. package/dist/source-sync/projects.js +130 -0
  200. package/dist/source-sync/registry.d.ts +95 -0
  201. package/dist/source-sync/registry.js +226 -0
  202. package/dist/source-sync/service.d.ts +33 -0
  203. package/dist/source-sync/service.js +118 -0
  204. package/dist/source-sync/skill-edits.d.ts +12 -0
  205. package/dist/source-sync/skill-edits.js +122 -0
  206. package/dist/source-sync/snapshots.d.ts +48 -0
  207. package/dist/source-sync/snapshots.js +448 -0
  208. package/dist/source-sync/types.d.ts +9 -0
  209. package/dist/source-sync/types.js +14 -0
  210. package/dist/source-sync/workspace.d.ts +66 -0
  211. package/dist/source-sync/workspace.js +273 -0
  212. package/dist/store/agent-body.d.ts +4 -0
  213. package/dist/store/agent-body.js +16 -5
  214. package/dist/store/index.d.ts +2 -2
  215. package/dist/store/index.js +1 -1
  216. package/dist/store/schema.d.ts +2 -1
  217. package/dist/store/schema.js +2 -1
  218. package/dist/store/seal.d.ts +5 -1
  219. package/dist/store/seal.js +12 -3
  220. package/dist/store/sqlite/project-checkpoints.d.ts +11 -0
  221. package/dist/store/sqlite/project-checkpoints.js +70 -0
  222. package/dist/store/sqlite/run-launch.d.ts +4 -12
  223. package/dist/store/sqlite/run-launch.js +5 -19
  224. package/dist/store/sqlite/store.js +224 -170
  225. package/dist/store/store.d.ts +116 -39
  226. package/dist/store/store.js +14 -1
  227. package/dist/store-reads/learning.d.ts +2 -2
  228. package/dist/store-view.d.ts +3 -1
  229. package/dist/store-view.js +17 -5
  230. package/dist/template-import.d.ts +10 -2
  231. package/dist/template-import.js +116 -13
  232. package/dist/templates.d.ts +26 -5
  233. package/dist/templates.js +62 -10
  234. package/dist/timeline/index.d.ts +1 -1
  235. package/dist/timeline/index.js +1 -1
  236. package/dist/timeline/timeline.d.ts +5 -0
  237. package/dist/timeline/timeline.js +8 -0
  238. package/dist/tool-plane.d.ts +12 -12
  239. package/dist/tools.d.ts +8 -8
  240. package/dist/trigger-launch-hook.d.ts +47 -0
  241. package/dist/trigger-launch-hook.js +90 -0
  242. package/dist/trigger-targets.d.ts +14 -1
  243. package/dist/trigger-targets.js +20 -0
  244. package/dist/triggers.d.ts +54 -5
  245. package/dist/triggers.js +143 -8
  246. package/dist/uploads-archil.js +1 -1
  247. package/dist/uploads.js +1 -1
  248. package/dist/validate.js +1 -2
  249. package/dist/workspace/computer-for-claim.d.ts +2 -0
  250. package/dist/workspace/computer-for-claim.js +43 -0
  251. package/dist/workspace/paths.d.ts +6 -0
  252. package/dist/workspace/paths.js +6 -0
  253. package/dist/workspace/resolve-computer.d.ts +1 -0
  254. package/dist/workspace/run-tools.d.ts +2 -0
  255. package/dist/workspace/run-tools.js +8 -0
  256. package/launcher/agentrun-serve +1 -1
  257. package/package.json +10 -10
  258. package/skills/agentrun-serve/SKILL.md +2 -1
  259. package/templates/README.md +5 -2
  260. package/dist/console/assets/index-B-D0EM3j.js +0 -733
  261. package/dist/console/assets/index-DlQepP2J.css +0 -1
@@ -33,7 +33,7 @@ import { agentDirName, runKey } from "./workspace/paths.js";
33
33
  import { runDiskOf } from "./workspace/run-disk.js";
34
34
  import { isWorkspaceError, WorkspaceError } from "./workspace/index.js";
35
35
  import { answerOf, copyFilesInto, INPUTS_DIR, isUploadedFile, MAX_FILES_PER_RUN, MAX_UPLOAD_BYTES, mismatchOf, pathProblem, readyFilesOf, reservation, sentInOneCall, slots, } from "./uploads.js";
36
- import { uuidv7 } from "./agents-store.js";
36
+ import { uuidv7 } from "./ids.js";
37
37
  /** The folder of the uploads disk the files are kept under. */
38
38
  export const UPLOADS_KEY = "files";
39
39
  const RECORD = "file.json";
package/dist/uploads.js CHANGED
@@ -7,7 +7,7 @@ import { createHash } from "node:crypto";
7
7
  import { copyFile, link, lstat, mkdir, open, readdir, readFile, rename, rm, unlink } from "node:fs/promises";
8
8
  import { DISK_DIR } from "./server-fs.js";
9
9
  import { dirname, join } from "node:path";
10
- import { uuidv7 } from "./agents-store.js";
10
+ import { uuidv7 } from "./ids.js";
11
11
  import { ApiError, invalid } from "./errors.js";
12
12
  import { typeOf } from "./file-types.js";
13
13
  import { readJson, serialBy, tempOf, writeDurable } from "./files.js";
package/dist/validate.js CHANGED
@@ -175,8 +175,7 @@ export function definitionIssues(definition, { at = "definition", creating = tru
175
175
  if (!(typeof d.max_cost_usd === "number" && Number.isFinite(d.max_cost_usd) && d.max_cost_usd >= 0))
176
176
  out.push(issue(`${at}.max_cost_usd`, "wrong_type", `${at}.max_cost_usd is a number of at least 0, in US dollars: above 0 sets the agent's default cap, 0 clears it`));
177
177
  }
178
- // The agent's own limit on each run's requests on free models, under the server's (AGENTRUN_FREE_MODEL_REQUESTS, which
179
- // wins when lower): above 0 sets it, 0 clears it, and an edit that leaves it out keeps the agent's (agents-store.ts).
178
+ // The agent's limit on each run's free-model requests: see DefinitionInput.max_requests (openapi.ts).
180
179
  if (d.max_requests !== undefined && !(typeof d.max_requests === "number" && Number.isSafeInteger(d.max_requests) && d.max_requests >= 0))
181
180
  out.push(issue(`${at}.max_requests`, "wrong_type", `${at}.max_requests is a whole number of at least 0: above 0 sets the most requests on free models each run makes (the server's own limit holds when it is lower), 0 clears it`));
182
181
  // The server's checkout before each run's first turn: kept by an edit that leaves it out, cleared by `none`.
@@ -208,6 +208,8 @@ export interface ClaimComputer {
208
208
  * stopped (compute-cost.ts): run before the run's end or park is written (the spec's beforeRelease), so the end's
209
209
  * cost holds it. Absent where nothing is metered. */
210
210
  settle?(): Promise<void>;
211
+ /** Strict durable folder sync for project checkpoints; distinct from metering settlement. */
212
+ syncProject?(signal?: AbortSignal): Promise<void>;
211
213
  release(why?: ViewEnd): Promise<void>;
212
214
  /** The claim's release at the run's park, for `cause`: a computer it `keeps` is kept for KEEP_MS (computer-kept.ts),
213
215
  * its live view closed with the park's cause and the keep's time (ParkedEnd) and its hold ended, but the machine left
@@ -43,6 +43,7 @@ import { startRecording } from "../computer-record.js";
43
43
  import { computerOfPlace } from "../computer-setting.js";
44
44
  import { KEY_TABLE, providerOptions, settingOptions } from "../computer-keys.js";
45
45
  import { LOST_RECREATES, lostEnd, lostInCallWords, lostRecreatedWords } from "../computer-lost.js";
46
+ import { missingNeeds, needsNoSandboxWords, needsWords } from "../computer-needs.js";
46
47
  import { inToolCall, stopRun } from "../paid-calls.js";
47
48
  import { getSealedKey } from "../server-keys.js";
48
49
  import { agentComputerOf, forgetAgentComputer, holdAgentComputer, keepAgentComputer, liveHolderOf, reconcileAgentComputer, serverIdOf } from "./agent-computer.js";
@@ -872,6 +873,13 @@ store, deps) {
872
873
  },
873
874
  };
874
875
  const setting = await settingOf(launch, store);
876
+ // Programs it needs (computer.needs) are checked in a sandbox's box alone: a setting that needs them and is any other
877
+ // kind is refused before anything is rented, never run without them.
878
+ const needs = setting?.needs;
879
+ if (needs?.length && setting?.kind !== "sandbox") {
880
+ const label = setting?.provider ? kinds.PROVIDERS.find((one) => one.id === setting.provider)?.label ?? setting.provider : undefined;
881
+ throw unavailable(needsNoSandboxWords(needs, setting?.kind === "none" || !setting ? "none" : `a ${setting.kind}${label ? ` on ${label}` : ""}`));
882
+ }
875
883
  const resolved = await resolveComputer(setting, deps.mode, kinds, side);
876
884
  if ("refused" in resolved)
877
885
  throw unavailable(resolved.refused);
@@ -900,6 +908,19 @@ store, deps) {
900
908
  throw error;
901
909
  }
902
910
  const computer = started.computer;
911
+ // What the agent needs its sandbox to have (computer.needs): asked of the box it started, before anything of the run
912
+ // reaches a model. A box that lacks one, or that could not be asked, is let go and the run ends in words: never a run on
913
+ // a box without what its work needs.
914
+ if (needs?.length) {
915
+ // A sandbox setting whose start gave no sandbox is no box to check: refused as one that could not be asked.
916
+ const answer = computer?.kind === "sandbox" ? await missingNeeds(computer.computer.client, needs, deps.signal) : { unchecked: "its start gave no sandbox" };
917
+ if ("unchecked" in answer || answer.missing.length > 0) {
918
+ await started.release().catch(() => undefined);
919
+ await meter?.stopAll().catch(() => undefined);
920
+ await revoke().catch(() => undefined);
921
+ throw unavailable(needsWords(answer, needs, kinds.PROVIDERS.find((one) => one.id === resolved.provider)));
922
+ }
923
+ }
903
924
  // A desktop's or a phone's: its hold, parking the run's ports while a person holds it, and its live view, proxy-only (no
904
925
  // vendor's URL reaches a person), opened under this claim. A fenced open is a lost claim. The release ends the hold.
905
926
  let endHold = () => { };
@@ -968,6 +989,28 @@ store, deps) {
968
989
  ...(keeps ? { keeps: keeps.kind } : {}),
969
990
  ...(meter ? { settle: () => meter.stopAll() } : {}),
970
991
  release,
992
+ async syncProject(signal) {
993
+ const cancellation = signal && deps.signal ? AbortSignal.any([signal, deps.signal]) : signal ?? deps.signal;
994
+ cancellation?.throwIfAborted();
995
+ if (started.sync) {
996
+ if (!(await started.sync()).ok)
997
+ throw new Error("The project folder could not be durably synchronized.");
998
+ }
999
+ else if (resolved.folder === "bind") {
1000
+ // A bind is already this Workspace's filesystem, so there is no remote folder delta to pull. File tools
1001
+ // fsync their own writes, but arbitrary shell edits need this final syncfs after dispatch has settled.
1002
+ // Use the supplied host Workspace, never the lost-aware computer client (which could recreate a machine).
1003
+ const flushed = await deps.workspace.exec(["/usr/bin/sync", "-f", "."], {
1004
+ env: { PATH: "/usr/bin:/bin", LANG: "C", LC_ALL: "C" }, timeoutMs: 30_000, maxOutput: 1024,
1005
+ ...(cancellation ? { signal: cancellation } : {}),
1006
+ });
1007
+ if (flushed.code !== 0 || flushed.signal || flushed.timedOut || flushed.truncated)
1008
+ throw new Error("The bound project folder could not be durably synchronized.");
1009
+ }
1010
+ else if (runComputer && "check" in runComputer && runComputer.check)
1011
+ throw new Error("This mounted project has no verified synchronization capability.");
1012
+ cancellation?.throwIfAborted();
1013
+ },
971
1014
  async park(cause) {
972
1015
  if (!keeps || !settings || released) {
973
1016
  await release();
@@ -20,6 +20,12 @@ export declare const agentLearningFolder: (dataDir: string, agentId: string) =>
20
20
  export declare const homeKey: (agentId: string) => string;
21
21
  /** Agent `agentId`'s home, the root of its home Workspace: `<data>/disk/agents/<agent>/home`. */
22
22
  export declare const agentHomeFolder: (dataDir: string, agentId: string) => string;
23
+ /** Immutable source bundles, private to the server and outside every run's tool root. */
24
+ export declare const sourceSnapshotsKey: (agentId: string) => string;
25
+ export declare const sourceSnapshotsFolder: (dataDir: string, agentId: string) => string;
26
+ /** A run's source placement receipt, beside work/ so its tools cannot rewrite the admission proof. */
27
+ export declare const sourceRunControlKey: (agentId: string, runId: string) => string;
28
+ export declare const sourceRunControlFolder: (dataDir: string, agentId: string, runId: string) => string;
23
29
  /** Run `runId`'s scratch folder on this machine: `<data>/scratch/<agent>/<run>`. Outside the disk, so no Workspace
24
30
  * holds it, in either mode. */
25
31
  export declare const scratchFolder: (dataDir: string, agentId: string, runId: string) => string;
@@ -55,6 +55,12 @@ export const agentLearningFolder = (dataDir, agentId) => join(dataDir, DISK_DIR,
55
55
  export const homeKey = (agentId) => `agents/${agentDirName(agentId)}/home`;
56
56
  /** Agent `agentId`'s home, the root of its home Workspace: `<data>/disk/agents/<agent>/home`. */
57
57
  export const agentHomeFolder = (dataDir, agentId) => join(dataDir, DISK_DIR, homeKey(agentId));
58
+ /** Immutable source bundles, private to the server and outside every run's tool root. */
59
+ export const sourceSnapshotsKey = (agentId) => `agents/${agentDirName(agentId)}/source-snapshots`;
60
+ export const sourceSnapshotsFolder = (dataDir, agentId) => join(dataDir, DISK_DIR, sourceSnapshotsKey(agentId));
61
+ /** A run's source placement receipt, beside work/ so its tools cannot rewrite the admission proof. */
62
+ export const sourceRunControlKey = (agentId, runId) => `agents/${agentDirName(agentId)}/runs/${checkId(runId, "run")}/source-control`;
63
+ export const sourceRunControlFolder = (dataDir, agentId, runId) => join(dataDir, DISK_DIR, sourceRunControlKey(agentId, runId));
58
64
  /** Run `runId`'s scratch folder on this machine: `<data>/scratch/<agent>/<run>`. Outside the disk, so no Workspace
59
65
  * holds it, in either mode. */
60
66
  export const scratchFolder = (dataDir, agentId, runId) => join(dataDir, "scratch", agentDirName(agentId), checkId(runId, "run"));
@@ -23,6 +23,7 @@ export type ComputerSetting = {
23
23
  readonly surface?: "code" | "tools";
24
24
  readonly exec?: boolean;
25
25
  readonly record?: boolean;
26
+ readonly needs?: readonly string[];
26
27
  };
27
28
  /** Whether a computer (or its setting) takes its agent's programs away: `exec: false`. Only a desktop or a phone takes
28
29
  * `exec` (computer-setting.ts refuses it on any other kind at save), so a computer without programs is one of those. */
@@ -167,6 +167,8 @@ export type RunTools = {
167
167
  /** The run's end, before the computer is let go: its background processes ended (TERM, then KILL 3 s later; none with
168
168
  * no computer), then bash's full outputs and TMPDIR swept. */
169
169
  end(): Promise<void>;
170
+ /** Strict checkpoint stop: cleanup errors or any still-running tracked process refuse publication. */
171
+ settleProject(): Promise<readonly string[]>;
170
172
  };
171
173
  /**
172
174
  * A run's tools on `workspace`, attached to `computer` when its kind has files and exec and its provider mounts the
@@ -180,6 +180,14 @@ export async function runTools(workspace, computer, options) {
180
180
  kindTools,
181
181
  ...(run.computer ? { computer: run.computer } : {}),
182
182
  hostTools: (names, results) => bindTools(run, registry, names, results ? { results } : {}),
183
+ async settleProject() {
184
+ const before = await run.hands.processes?.list() ?? [];
185
+ await endBackground(run.hands);
186
+ if ((await run.hands.processes?.list() ?? []).some(process => process.running))
187
+ throw new Error("Project processes have not settled.");
188
+ await run.sweep();
189
+ return before.filter(process => process.argv[3] === "agentrun-background" && /^[1-9][0-9]*$/.test(process.argv[4] ?? "")).map(process => `background/${process.argv[4]}/output.log`);
190
+ },
183
191
  async end() {
184
192
  await endBackground(run.hands);
185
193
  await run.sweep();
@@ -39,7 +39,7 @@
39
39
  # here. Any other variable named like a key (a KEY, TOKEN, SECRET, PASSWORD, PASSWD, PASS, PAT, CREDENTIAL, CREDENTIALS or
40
40
  # DSN segment, or a last PWD after another) stays in the server's environment, as this list does not take it, and in no
41
41
  # run's: name it here to keep it from the server's too.
42
- SECRETS='AGENTRUN_TOKEN AGENTRUN_TOKENS AGENTRUN_API_KEY AGENTRUN_STORE_URL AGENT_MODEL_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY BROWSERBASE_API_KEY BROWSERBASE_PROJECT_ID KERNEL_API_KEY OPENROUTER_API_KEY PARTICLE_API_KEY TYPESAFE_API_KEY PARALLEL_API_KEY MONID_API_KEY CURSOR_API_KEY AGENTRUN_SEAL_KEY ARCHIL_API_KEY E2B_API_KEY ORGO_API_KEY PHONE_HARNESS_API_KEY AGENT37_API_KEY AGENT37_SSH_KEY DAYTONA_API_KEY BOXD_API_KEY MORPH_API_KEY SMOLCLOUD_API_KEY CLOUDFLARE_RELAY_TOKEN FLY_API_TOKEN MODAL_TOKEN_ID MODAL_TOKEN_SECRET ANTHROPIC_AUTH_TOKEN ANTHROPIC_OAUTH_TOKEN AI_GATEWAY_API_KEY ANT_LING_API_KEY AWS_ACCESS_KEY_ID AWS_BEARER_TOKEN_BEDROCK AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AZURE_OPENAI_API_KEY BASETEN_API_KEY CEREBRAS_API_KEY CLOUDFLARE_API_KEY COPILOT_GITHUB_TOKEN DEEPSEEK_API_KEY FIREWORKS_API_KEY GEMINI_API_KEY GOOGLE_CLOUD_API_KEY GROQ_API_KEY HF_TOKEN KIMI_API_KEY META_API_KEY MINIMAX_API_KEY MINIMAX_CN_API_KEY MISTRAL_API_KEY MOONSHOT_API_KEY NVIDIA_API_KEY OPENCODE_API_KEY QWEN_TOKEN_PLAN_API_KEY QWEN_TOKEN_PLAN_CN_API_KEY RADIUS_API_KEY TOGETHER_API_KEY XAI_API_KEY XIAOMI_API_KEY XIAOMI_TOKEN_PLAN_AMS_API_KEY XIAOMI_TOKEN_PLAN_CN_API_KEY XIAOMI_TOKEN_PLAN_SGP_API_KEY ZAI_API_KEY ZAI_CODING_CN_API_KEY'
42
+ SECRETS='AGENTRUN_TOKEN AGENTRUN_TOKENS AGENTRUN_API_KEY AGENTRUN_STORE_URL AGENT_MODEL_API_KEY OPENAI_API_KEY ANTHROPIC_API_KEY BROWSERBASE_API_KEY BROWSERBASE_PROJECT_ID KERNEL_API_KEY OPENROUTER_API_KEY PARTICLE_API_KEY TYPESAFE_API_KEY PARALLEL_API_KEY MONID_API_KEY CURSOR_API_KEY AGENTRUN_SEAL_KEY AGENTRUN_LAUNCH_HOOK_SECRET ARCHIL_API_KEY E2B_API_KEY ORGO_API_KEY PHONE_HARNESS_API_KEY AGENT37_API_KEY AGENT37_SSH_KEY DAYTONA_API_KEY BOXD_API_KEY MORPH_API_KEY SMOLCLOUD_API_KEY CLOUDFLARE_RELAY_TOKEN FLY_API_TOKEN MODAL_TOKEN_ID MODAL_TOKEN_SECRET ANTHROPIC_AUTH_TOKEN ANTHROPIC_OAUTH_TOKEN AI_GATEWAY_API_KEY ANT_LING_API_KEY AWS_ACCESS_KEY_ID AWS_BEARER_TOKEN_BEDROCK AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AZURE_OPENAI_API_KEY BASETEN_API_KEY CEREBRAS_API_KEY CLOUDFLARE_API_KEY COPILOT_GITHUB_TOKEN DEEPSEEK_API_KEY FIREWORKS_API_KEY GEMINI_API_KEY GOOGLE_CLOUD_API_KEY GROQ_API_KEY HF_TOKEN KIMI_API_KEY META_API_KEY MINIMAX_API_KEY MINIMAX_CN_API_KEY MISTRAL_API_KEY MOONSHOT_API_KEY NVIDIA_API_KEY OPENCODE_API_KEY QWEN_TOKEN_PLAN_API_KEY QWEN_TOKEN_PLAN_CN_API_KEY RADIUS_API_KEY TOGETHER_API_KEY XAI_API_KEY XIAOMI_API_KEY XIAOMI_TOKEN_PLAN_AMS_API_KEY XIAOMI_TOKEN_PLAN_CN_API_KEY XIAOMI_TOKEN_PLAN_SGP_API_KEY ZAI_API_KEY ZAI_CODING_CN_API_KEY'
43
43
  set -eu
44
44
  # Each secret out of the environment and into an unexported variable of this shell (agentrun_secret_<NAME>).
45
45
  for name in $SECRETS; do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-serve",
3
- "version": "0.1.0-beta.52",
3
+ "version": "0.1.0-beta.53",
4
4
  "description": "The AgentRun server: the /v2 API and console over one store, with runners that run your agents; the deployable process of the AgentRun platform.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -62,15 +62,15 @@
62
62
  "@earendil-works/pi-coding-agent": "1.5.2",
63
63
  "@modelcontextprotocol/client": "2.4.0",
64
64
  "@modelcontextprotocol/server": "2.4.0",
65
- "@parcha/agentrun-computer": "0.1.0-beta.52",
66
- "@parcha/agentrun-decisions": "0.1.0-beta.52",
67
- "@parcha/agentrun-dsl": "0.1.0-beta.52",
68
- "@parcha/agentrun-harness-acp": "0.1.0-beta.52",
69
- "@parcha/agentrun-harness-claude": "0.1.0-beta.52",
70
- "@parcha/agentrun-harness-codex": "0.1.0-beta.52",
71
- "@parcha/agentrun-jev": "0.1.0-beta.52",
72
- "@parcha/agentrun-kernel": "0.1.0-beta.52",
73
- "@parcha/pi-browser": "0.1.0-beta.52",
65
+ "@parcha/agentrun-computer": "0.1.0-beta.53",
66
+ "@parcha/agentrun-decisions": "0.1.0-beta.53",
67
+ "@parcha/agentrun-dsl": "0.1.0-beta.53",
68
+ "@parcha/agentrun-harness-acp": "0.1.0-beta.53",
69
+ "@parcha/agentrun-harness-claude": "0.1.0-beta.53",
70
+ "@parcha/agentrun-harness-codex": "0.1.0-beta.53",
71
+ "@parcha/agentrun-jev": "0.1.0-beta.53",
72
+ "@parcha/agentrun-kernel": "0.1.0-beta.53",
73
+ "@parcha/pi-browser": "0.1.0-beta.53",
74
74
  "@secretlint/core": "13.1.0",
75
75
  "@secretlint/profiler": "13.1.0",
76
76
  "@secretlint/secretlint-rule-preset-recommend": "13.1.0",
@@ -359,7 +359,8 @@ A refusal comes back as a tool error holding the server's `error`: `code`, `mess
359
359
  ## 4. Create an agent
360
360
 
361
361
  Look for one first with `agents_list` and inspect the server's templates through `GET /v2/templates` or the
362
- matching Node CLI's `template list`. Offer a suitable template or a custom agent; ask only for missing details
362
+ matching Node CLI's `template list`, then read the one you would apply whole (its instructions and every skill file)
363
+ with `GET /v2/templates/{id}` or `template get`. Offer a suitable template or a custom agent; ask only for missing details
363
364
  about the job, inputs, expected result and required tools. Before applying a template, explain its tool grants
364
365
  and triggers and confirm any permissions not already granted. Use the apply schema from this server's OpenAPI document.
365
366
 
@@ -2,7 +2,8 @@
2
2
 
3
3
  A template package is one folder that makes a working agent: its manifest, its instructions, its skills, its rules and
4
4
  its evals. The server ships the packages in this folder, checks each one whole at its start (a broken one stops the
5
- start), lists them at `GET /v2/templates` and applies one with `POST /v2/templates/{name}/apply`. Nothing in a package
5
+ start), lists them at `GET /v2/templates`, reads one whole (its instructions and every skill file) at
6
+ `GET /v2/templates/{name}` and applies one with `POST /v2/templates/{name}/apply`. Nothing in a package
6
7
  runs at apply: it is read, checked, and made into the same agent and trigger records `POST /v2/agents` and
7
8
  `POST /v2/triggers` make. `agentrun template validate DIR` runs the server's own check on a folder.
8
9
 
@@ -371,6 +372,7 @@ package}`, and a line in the markdown).
371
372
  | `mcp` | `[{source, toolkit, tools, required?, reason?, allow?, pin?}]`: the MCP tools the agent uses, by where they come from, never by the name a server saves them under. `source` is `composio` (a Composio toolkit, saved with the Composio preset), `github` (GitHub's MCP server on the GitHub App; its toolkit is `github`) or `url` (any other MCP server). `toolkit` names the tools' set (Composio's toolkit slug, `github`, or the name a `url` server's owner gives it in Settings → MCP servers), lowercase letters, digits and dashes, at most 32, each toolkit once. Inside the package its tools are `mcp:<toolkit>/<tool>`. `tools` are the ones the agent uses (each one tool by its name, `A-Z a-z 0-9 _ -`; never `*`; a Composio action by its slug, `SLACK_SEND_MESSAGE`), `reason` one line (at most 280 characters) on why, shown on the apply screen, and `allow` those of its tools the package asks the owner to grant (`GET /v2/templates` shows each tool with `asks: allow` or `ask`, for a consent screen). Apply maps each need to the saved MCP server whose recorded source and toolkit are the need's (each saved server records them when it is saved, from what made it: the Composio preset its toolkit, a server on the GitHub App (`auth: github_app`) `github`, any other `url` with the toolkit its owner sets; a server on GitHub's MCP address with a token of its own is `url`); where several are, the apply's `servers` (`{<toolkit>: <server>}`) says which, and an apply without it is `422` naming them: a server is never picked for the owner. When the server's name is not the toolkit, apply rewrites `mcp:<toolkit>/` to `mcp:<server>/` in the instructions, the skills and the tool settings. It grants `mcp:<server>/<tool>` only for each tool the apply's `grants` (the owner's answer) name, beside the other tools, with no permission written: each call follows this server's tool settings (under `approvals: ask` a write asks unless the owner allowed it in Settings → Tools, and a read runs unasked only where the server's Allow reads is on). Neither a package nor an apply sets a permission for a granted tool. A tool the owner leaves out is not the agent's at all, under `approvals: never` too, so no harness offers it and a call of it is refused; the owner can grant it later in the agent's tools. Where no saved server matches, the need is not set up here: apply skips it with a warning (`mcp.<toolkit>`, its `fix` saying how to add one: for Composio, the preset with the toolkit and actions), or, when `required` is true, refuses with `409 agent_not_runnable` and makes nothing. `pin`, optional: `{<tool>: {<argument>: <value>}}`, for tools of the entry, 1 to 8 top-level arguments each, every value a scalar (text, which may be or hold `${parameters.<name>}`, a number, `true`/`false`, or `null` for an argument that must be left out) or a list of 1 to 16 of them, the argument one of the list (`event: [null, COMMENT]`), kept with each value once, null first, then by its JSON text, or `{keys: [...]}`, 1 to 16 key names an object argument may hold, any values (`properties: {keys: ["${parameters.crm_score_property}"]}`; a key that is a list parameter's placeholder alone adds each of its items). Apply writes it, filled, as the tool's `pin` in the agent's `tool_settings` (text that is one placeholder alone takes the parameter's value and type), whatever the tool's permission, and the gate refuses any call not as pinned; a pin the server's own settings (Settings → Tools) set for the tool holds too. A pinned tool takes only the arguments its listing declares (and its pinned ones): any other is refused. A pin whose parameter apply is not given sets the tool to `deny` instead, granted or not, with a `pins.mcp:<server>/<tool>` warning. `GET /v2/templates` shows each need's `source`, `toolkit` and `reason`, and each tool's `pin`, unfilled. |
372
373
  | `tool_policy` | `{bash: read-only}`: a policy on the agent's bash, the one tool that takes one. Apply writes it as `policy` on bash in the agent's `tool_settings` (`definition.tool_settings.bash.policy`), whatever bash's permission, and the tool gate reads each shell call's command before it runs or anyone is asked. Under `read-only` it refuses, in words the model reads, any command that could write, run code or read outside the run's folder: a program outside the read list (git's read subcommands `diff`, `show`, `log`, `blame`, `grep`, `ls-files`, `ls-tree`, `rev-parse`, `cat-file`, `merge-base`, `status`, `shortlog`, `rev-list`, `diff-tree`, `name-rev`, `describe`; `grep`, `egrep`, `fgrep`, `rg`, `sed -n 'N,Mp'`, `cat`, `head`, `tail`, `wc`, `nl`, `ls`, `find` without `-exec` or `-delete`, `sort`, `uniq`, `cut`, `tr`, `diff`, `basename`, `dirname`, `echo`, `true`), a redirection other than `2>/dev/null` and `2>&1`, `$` and backticks, a subshell, `\|\|` or a lone `&`, a pipe into anything but a filter (`head`, `tail`, `sed -n`, `grep`, `wc`, `sort`, `uniq`, `cut`, `tr`, `nl`), an unquoted glob (a glob is quoted, and only in a grep pattern, an `--include=` value or a `find -name` value), a path outside the run's folder, or one on the never-open list (`.env*`, `.ssh/`, `id_rsa*`, `*.pem`, `*.key`, `.npmrc`, `.netrc`, `.git-credentials`, `credentials`), which refuses a command that names such a file but is no fence around the folder: a recursive search reads all it holds, the run's own files and never a key of the server's. `git -C <dir>` is allowed to a directory inside the folder. A line with a `cd` joins its commands with `&&` only. `bash_background` and `bash_input` are refused under it. The check reads the command, never the folder, so a symbolic link in the folder reaches what the computer lets it; and it holds bash alone, so a read-only agent's tools are `read` and `bash` (one that may write can change what git obeys). Approvals `never` lifts none of it. A package with `tools` grants `bash` among them. |
373
374
  | `computer` | `default` (or absent): the agent runs where this server puts a new one. Or a preference list, `[shell, none]`, read like `harness`: apply takes the first entry this server meets now and saves it as the agent's `computer`. `shell` is a computer that gives the agent a shell here: Archil's serverless exec on the runner when Archil is on (Settings → Workspace; `bash` alone, so `bash_background` and the other background tools are not granted), else the Docker sandbox where Docker answers. `none` is no shell, and is always met: the shell tools in `tools` (`bash` and the background tools) are not granted, and neither is `tool_policy`'s bash. A package with no `tools` is given the chosen shell's tools, as a new agent in a box is given the box's. A fallback, or a tool not granted, is said in a `computer` warning on the apply. A list with `shell` alone, where there is none, refuses the apply (`409`, nothing made). A list without `shell` grants no shell tool, so one in `tools` is refused, and so is an entry after `none`, which would never be picked. The choice is made at apply: a server that gains a shell later gives it to an agent applied again. `GET /v2/templates` shows the list as `computer`, and as `computer_here` what an apply here would pick now: the entry, the agent's `computer`, the shell in words, the tools it would not grant, and the warning or refusal. |
375
+ | `needs` | A list of 1 to 32 program names its agent's sandbox must have on its `PATH` (`[chrome, ffmpeg, ffprobe, hyperframes]` to render video), each once, a name a shell finds (letters, digits, `.`, `_`, `+`, `-`, no path), or a library the agent's code loads, by its pip or npm name (`[python-pptx, pptxgenjs]` to make decks; the [documents image](../README.md#the-boxs-image) has those). Read only beside `computer: [shell]`, so a template that needs them runs in a sandbox or not at all: never a fallback to no computer. It names no image: the image stays the server's, a Docker box's `AGENTRUN_DOCKER_IMAGE` (the [media image](../README.md#the-boxs-image) has those four). Apply writes them onto the sandbox it picks, as the agent's `computer.needs`, which each run checks in its box before its first model request: a box that lacks one ends the run failed, naming it and the image fix, with nothing spent. Where no sandbox answers (Archil's serverless exec is none, and in Mode 2 the Docker box can't mount Archil's workspaces, so none answers there; or no shell at all), apply refuses (`409`, nothing made) in words naming the programs and `AGENTRUN_DOCKER_IMAGE`. `GET /v2/templates` shows it as `needs`, and on `computer_here.computer`. A server older than the release that reads `needs` refuses a package that names it as an unknown field. |
374
376
  | `checkout` | `pull_request` only: apply sets the agent definition's `checkout`, and the server checks out the pull request each run's GitHub event names before its first turn, in `repo/` of the run's folder, detached at the head, with its base and their merge base (refs `pr/head`, `pr/base`, `pr/merge-base`: `git diff pr/merge-base pr/head` reads the change). The server fetches it with its GitHub App's token, narrowed to that one repository and `contents: read` and revoked after the fetch, or anonymously with no App; the agent never holds a token, and nothing of it is left in the folder or the checkout's git config. The run's system prompt says what was checked out, or why nothing was, so the package's instructions can fall back to the GitHub MCP. It is removed when the run's claim ends. With `tool_policy: {bash: read-only}` the agent reads it with git's read subcommands and never fetches itself. |
375
377
  | `parameters` | The setup an owner fills once, at apply. Written exactly as `inputs` are (the same keys, the same rule: required unless `required: false`, a `default` only on one that is not) and compiled by the same code; `GET /v2/templates` shows them as a JSON Schema like `input_schema`, and the console's Apply form is the run form. The one difference is where they are filled: apply takes them in `parameters` (a blank one takes its `default`; they are checked as a run's input is, with the same `422` words under `parameters.<name>`), and puts them where the package writes `${parameters.<name>}`: `display_name`, the body, a trigger's `target.input`, a schedule's `cron` and `timezone`, the `in` values of a github, webhook, composio or feed trigger's `accept` where conditions, a composio trigger's `config` values, a feed trigger's `urls`, a trigger's `enabled`, and an `mcp` entry's `pin` values, nowhere else. Text takes the value as text (a list as its items joined by `, `). A `target.input` value, a composio trigger's `config` value or a pin value that is one placeholder alone takes the value with its type (a list pinned is a one-of); in `target.input` one given no value is dropped, so the input schema sees the field absent. A trigger's `enabled` takes only one placeholder alone, naming a boolean parameter with a default: the trigger is made on or off by its value. A feed trigger's `urls` that are one placeholder alone take an array-of-strings parameter whole. A parameter a where, a composio `config` or a feed's `urls` take is required or has a default, so none fills empty; one a schedule uses has a default, which the package's own schedule is checked with, and apply checks every trigger with the values given before it makes anything (`422` under `triggers.<i>`). |
376
378
  | `inputs` | By name: each run's typed input, which apply compiles into the agent's `input_schema` (a closed JSON Schema object). Each is `{type: string \| number \| integer \| boolean \| array, required?, title?, description?, examples?, default?, enum?, pattern? and format? (strings), minLength?/maxLength? (strings), minimum?/maximum? (numbers), items? (an array's scalar, with that scalar's keys)}`, nothing else; an input is required unless it says `required: false`, and a `default` is for one that is not. `format` is `uri`, `email`, `hostname`, `date`, `date-time` or `uuid`, which the server checks, or `cron` or `timezone`, which a form reads. A default and each example are checked against their own input. `content` is the run's message: named, it is a string. Every path that starts a run (the API, the CLI, a trigger, the console) checks the input against it and refuses one that does not meet it with `422 input_invalid`, a path per field (`input.country`). The model is sent the input's `content`, then the other fields as one fenced `json` block under the line `Input:`, so the instructions read each field by its name. `GET /v2/templates` shows it as `input_schema`, and the console's run form is drawn from it. A trigger's `target.input` and an eval case's `input` are checked against it too. Absent: a run takes `{content}`, as before. |
@@ -401,7 +403,8 @@ The ref follows the last `@`, so a path with an `@` in it (`packages/@acme/kyb`)
401
403
  file, more than 8 MiB of files, or an archive over 128 MiB is refused (`422`), as is a package that does not check.
402
404
  3. A dry run answers the package whole (its instructions and every skill file) and stores nothing. Otherwise it is
403
405
  stored under its id, `github:<owner>/<repo>[/<path>]`, listed by `GET /v2/templates` with `bundled: false`, its
404
- `source`, `sha` and `publisher`, and applied as below with that id URL-encoded. Importing the id again replaces it;
406
+ `source`, `sha` and `publisher`, read whole by `GET /v2/templates/{id}` and applied as below, each with that id
407
+ URL-encoded. Importing the id again replaces it;
405
408
  `DELETE /v2/templates/{id}` removes it (a bundled package is `403`). Agents applied from it stay as they are, each with
406
409
  `template: {id, version, sha}`.
407
410