@exla/rudder 4.0.0-alpha.7 → 4.0.0

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 (239) hide show
  1. package/README.md +33 -69
  2. package/dist/agent-efficiency/backend-observer.d.ts +13 -0
  3. package/dist/agent-efficiency/backend-observer.js +77 -0
  4. package/dist/agent-efficiency/backend-observer.js.map +1 -0
  5. package/dist/agent-efficiency/handoff.d.ts +9 -0
  6. package/dist/agent-efficiency/handoff.js +42 -0
  7. package/dist/agent-efficiency/handoff.js.map +1 -0
  8. package/dist/agent-efficiency/index.d.ts +11 -0
  9. package/dist/agent-efficiency/index.js +7 -0
  10. package/dist/agent-efficiency/index.js.map +1 -0
  11. package/dist/agent-efficiency/lessons.d.ts +55 -0
  12. package/dist/agent-efficiency/lessons.js +107 -0
  13. package/dist/agent-efficiency/lessons.js.map +1 -0
  14. package/dist/agent-efficiency/privacy.d.ts +6 -0
  15. package/dist/agent-efficiency/privacy.js +28 -0
  16. package/dist/agent-efficiency/privacy.js.map +1 -0
  17. package/dist/agent-efficiency/production.d.ts +16 -0
  18. package/dist/agent-efficiency/production.js +120 -0
  19. package/dist/agent-efficiency/production.js.map +1 -0
  20. package/dist/agent-efficiency/storage.d.ts +3 -0
  21. package/dist/agent-efficiency/storage.js +28 -0
  22. package/dist/agent-efficiency/storage.js.map +1 -0
  23. package/dist/agent-efficiency/telemetry.d.ts +59 -0
  24. package/dist/agent-efficiency/telemetry.js +143 -0
  25. package/dist/agent-efficiency/telemetry.js.map +1 -0
  26. package/dist/agent-efficiency/trace-lessons.d.ts +21 -0
  27. package/dist/agent-efficiency/trace-lessons.js +36 -0
  28. package/dist/agent-efficiency/trace-lessons.js.map +1 -0
  29. package/dist/agent-efficiency/waits.d.ts +52 -0
  30. package/dist/agent-efficiency/waits.js +131 -0
  31. package/dist/agent-efficiency/waits.js.map +1 -0
  32. package/dist/backends.js +14 -8
  33. package/dist/backends.js.map +1 -1
  34. package/dist/board/authority.d.ts +48 -0
  35. package/dist/board/authority.js +125 -0
  36. package/dist/board/authority.js.map +1 -0
  37. package/dist/board/board.js +6 -2
  38. package/dist/board/daemon.d.ts +3 -6
  39. package/dist/board/daemon.js +242 -222
  40. package/dist/board/daemon.js.map +1 -1
  41. package/dist/board/host-access.d.ts +8 -0
  42. package/dist/board/host-access.js +222 -0
  43. package/dist/board/host-access.js.map +1 -0
  44. package/dist/board/project-files.d.ts +12 -0
  45. package/dist/board/project-files.js +78 -0
  46. package/dist/board/project-files.js.map +1 -0
  47. package/dist/brain.d.ts +2 -1
  48. package/dist/brain.js +15 -21
  49. package/dist/brain.js.map +1 -1
  50. package/dist/claude-sdk-protocol.js +10 -7
  51. package/dist/claude-sdk-protocol.js.map +1 -1
  52. package/dist/cloud-build-profile.d.ts +22 -0
  53. package/dist/cloud-build-profile.js +160 -0
  54. package/dist/cloud-build-profile.js.map +1 -0
  55. package/dist/cloud.js +23 -470
  56. package/dist/cloud.js.map +1 -1
  57. package/dist/codex-binary.d.ts +1 -0
  58. package/dist/codex-binary.js +8 -1
  59. package/dist/codex-binary.js.map +1 -1
  60. package/dist/daemon.d.ts +2 -0
  61. package/dist/daemon.js +14 -2
  62. package/dist/daemon.js.map +1 -1
  63. package/dist/effort.d.ts +8 -0
  64. package/dist/effort.js +15 -2
  65. package/dist/effort.js.map +1 -1
  66. package/dist/engine-authority.js +16 -0
  67. package/dist/engine-authority.js.map +1 -1
  68. package/dist/engine.d.ts +1 -1
  69. package/dist/engine.js +11 -2
  70. package/dist/engine.js.map +1 -1
  71. package/dist/fabric-fetch.d.ts +25 -0
  72. package/dist/fabric-fetch.js +402 -0
  73. package/dist/fabric-fetch.js.map +1 -0
  74. package/dist/fabric-local.d.ts +5 -2
  75. package/dist/fabric-local.js +36 -1
  76. package/dist/fabric-local.js.map +1 -1
  77. package/dist/fabric-remote.d.ts +76 -1
  78. package/dist/fabric-remote.js +333 -61
  79. package/dist/fabric-remote.js.map +1 -1
  80. package/dist/git.js +23 -0
  81. package/dist/git.js.map +1 -1
  82. package/dist/graph.js +9 -1
  83. package/dist/graph.js.map +1 -1
  84. package/dist/jj.d.ts +3 -1
  85. package/dist/jj.js +34 -2
  86. package/dist/jj.js.map +1 -1
  87. package/dist/main.js +102 -310
  88. package/dist/main.js.map +1 -1
  89. package/dist/migration.d.ts +2 -0
  90. package/dist/migration.js +3 -0
  91. package/dist/migration.js.map +1 -1
  92. package/dist/models.js +11 -6
  93. package/dist/models.js.map +1 -1
  94. package/dist/native/darwin-arm64/native-manifest.json +19 -0
  95. package/dist/native/darwin-arm64/rudder-jj +0 -0
  96. package/dist/native/darwin-arm64/rudder-native +0 -0
  97. package/dist/native/darwin-x64/native-manifest.json +19 -0
  98. package/dist/native/darwin-x64/rudder-jj +0 -0
  99. package/dist/native/darwin-x64/rudder-native +0 -0
  100. package/dist/native/linux-x64/native-manifest.json +19 -0
  101. package/dist/native/linux-x64/rudder-jj +0 -0
  102. package/dist/native/linux-x64/rudder-native +0 -0
  103. package/dist/native-agents.js +3 -7
  104. package/dist/native-agents.js.map +1 -1
  105. package/dist/native-binary.js +11 -1
  106. package/dist/native-binary.js.map +1 -1
  107. package/dist/operations/cli.d.ts +23 -0
  108. package/dist/operations/cli.js +110 -0
  109. package/dist/operations/cli.js.map +1 -0
  110. package/dist/operations/registry.d.ts +1076 -0
  111. package/dist/operations/registry.js +69 -0
  112. package/dist/operations/registry.js.map +1 -0
  113. package/dist/operations/registry.json +124 -0
  114. package/dist/operations/requests.d.ts +167 -0
  115. package/dist/operations/requests.js +223 -0
  116. package/dist/operations/requests.js.map +1 -0
  117. package/dist/planning-ownership/index.d.ts +134 -0
  118. package/dist/planning-ownership/index.js +291 -0
  119. package/dist/planning-ownership/index.js.map +1 -0
  120. package/dist/planning-ownership/ingress.d.ts +30 -0
  121. package/dist/planning-ownership/ingress.js +41 -0
  122. package/dist/planning-ownership/ingress.js.map +1 -0
  123. package/dist/planning-ownership/store.d.ts +19 -0
  124. package/dist/planning-ownership/store.js +30 -0
  125. package/dist/planning-ownership/store.js.map +1 -0
  126. package/dist/private-access/cli.d.ts +22 -0
  127. package/dist/private-access/cli.js +76 -0
  128. package/dist/private-access/cli.js.map +1 -0
  129. package/dist/private-access/engine.d.ts +20 -0
  130. package/dist/private-access/engine.js +47 -0
  131. package/dist/private-access/engine.js.map +1 -0
  132. package/dist/private-access/home.d.ts +21 -0
  133. package/dist/private-access/home.js +80 -0
  134. package/dist/private-access/home.js.map +1 -0
  135. package/dist/private-access/previews.d.ts +101 -0
  136. package/dist/private-access/previews.js +447 -0
  137. package/dist/private-access/previews.js.map +1 -0
  138. package/dist/project-files/cli.d.ts +7 -0
  139. package/dist/project-files/cli.js +22 -0
  140. package/dist/project-files/cli.js.map +1 -0
  141. package/dist/project-files/engine.d.ts +14 -0
  142. package/dist/project-files/engine.js +52 -0
  143. package/dist/project-files/engine.js.map +1 -0
  144. package/dist/project-files/home.d.ts +13 -0
  145. package/dist/project-files/home.js +46 -0
  146. package/dist/project-files/home.js.map +1 -0
  147. package/dist/project-files/http.d.ts +9 -0
  148. package/dist/project-files/http.js +54 -0
  149. package/dist/project-files/http.js.map +1 -0
  150. package/dist/project-files/open.d.ts +10 -0
  151. package/dist/project-files/open.js +37 -0
  152. package/dist/project-files/open.js.map +1 -0
  153. package/dist/project-files/references.d.ts +9 -0
  154. package/dist/project-files/references.js +29 -0
  155. package/dist/project-files/references.js.map +1 -0
  156. package/dist/project-files/service.d.ts +32 -0
  157. package/dist/project-files/service.js +236 -0
  158. package/dist/project-files/service.js.map +1 -0
  159. package/dist/project-files/types.d.ts +40 -0
  160. package/dist/project-files/types.js +2 -0
  161. package/dist/project-files/types.js.map +1 -0
  162. package/dist/run-manager.d.ts +2 -0
  163. package/dist/run-manager.js +183 -13
  164. package/dist/run-manager.js.map +1 -1
  165. package/dist/run-timeline.d.ts +29 -0
  166. package/dist/run-timeline.js +112 -0
  167. package/dist/run-timeline.js.map +1 -0
  168. package/dist/scheduler.js +72 -13
  169. package/dist/scheduler.js.map +1 -1
  170. package/dist/surfaces.js +3 -8
  171. package/dist/surfaces.js.map +1 -1
  172. package/dist/tailscale-preview.d.ts +6 -2
  173. package/dist/tailscale-preview.js +58 -13
  174. package/dist/tailscale-preview.js.map +1 -1
  175. package/dist/task-routing.d.ts +2 -0
  176. package/dist/task-routing.js +42 -25
  177. package/dist/task-routing.js.map +1 -1
  178. package/dist/terminal-screen.d.ts +6 -0
  179. package/dist/terminal-screen.js +23 -0
  180. package/dist/terminal-screen.js.map +1 -0
  181. package/dist/tool-cache.d.ts +23 -0
  182. package/dist/tool-cache.js +144 -0
  183. package/dist/tool-cache.js.map +1 -0
  184. package/dist/types.d.ts +0 -17
  185. package/dist/types.js.map +1 -1
  186. package/dist/util.d.ts +8 -0
  187. package/dist/util.js +38 -2
  188. package/dist/util.js.map +1 -1
  189. package/dist/v4-migration/capture.d.ts +53 -0
  190. package/dist/v4-migration/capture.js +197 -0
  191. package/dist/v4-migration/capture.js.map +1 -0
  192. package/dist/v4-migration/cli.d.ts +4 -0
  193. package/dist/v4-migration/cli.js +38 -0
  194. package/dist/v4-migration/cli.js.map +1 -0
  195. package/dist/v4-migration/recovery.d.ts +43 -0
  196. package/dist/v4-migration/recovery.js +180 -0
  197. package/dist/v4-migration/recovery.js.map +1 -0
  198. package/dist/version-check.d.ts +2 -0
  199. package/dist/version-check.js +23 -0
  200. package/dist/version-check.js.map +1 -1
  201. package/dist/warm-snapshot.d.ts +55 -0
  202. package/dist/warm-snapshot.js +381 -0
  203. package/dist/warm-snapshot.js.map +1 -0
  204. package/package.json +4 -3
  205. package/scripts/copy-native.mjs +35 -48
  206. package/scripts/native-artifacts.mjs +248 -0
  207. package/dist/improve/advisor.d.ts +0 -10
  208. package/dist/improve/advisor.js +0 -115
  209. package/dist/improve/advisor.js.map +0 -1
  210. package/dist/improve/collect.d.ts +0 -49
  211. package/dist/improve/collect.js +0 -274
  212. package/dist/improve/collect.js.map +0 -1
  213. package/dist/improve/gate.d.ts +0 -17
  214. package/dist/improve/gate.js +0 -60
  215. package/dist/improve/gate.js.map +0 -1
  216. package/dist/improve/index.d.ts +0 -9
  217. package/dist/improve/index.js +0 -376
  218. package/dist/improve/index.js.map +0 -1
  219. package/dist/improve/judge.d.ts +0 -32
  220. package/dist/improve/judge.js +0 -114
  221. package/dist/improve/judge.js.map +0 -1
  222. package/dist/improve/mine.d.ts +0 -31
  223. package/dist/improve/mine.js +0 -192
  224. package/dist/improve/mine.js.map +0 -1
  225. package/dist/improve/propose.d.ts +0 -51
  226. package/dist/improve/propose.js +0 -150
  227. package/dist/improve/propose.js.map +0 -1
  228. package/dist/improve/rank.d.ts +0 -16
  229. package/dist/improve/rank.js +0 -49
  230. package/dist/improve/rank.js.map +0 -1
  231. package/dist/improve/schedule.d.ts +0 -1
  232. package/dist/improve/schedule.js +0 -95
  233. package/dist/improve/schedule.js.map +0 -1
  234. package/dist/improve/ship.d.ts +0 -25
  235. package/dist/improve/ship.js +0 -82
  236. package/dist/improve/ship.js.map +0 -1
  237. package/dist/improve/state.d.ts +0 -157
  238. package/dist/improve/state.js +0 -264
  239. package/dist/improve/state.js.map +0 -1
@@ -0,0 +1,69 @@
1
+ import manifest from "./registry.json" with { type: "json" };
2
+ /** Surface metadata, not an authority grant or a replacement engine protocol. */
3
+ export const COMMAND_REGISTRY = manifest;
4
+ export const SURFACE_VERSION = 1;
5
+ export function operationDefinition(id) {
6
+ const operation = manifest.operations.find((entry) => entry.id === id);
7
+ if (!operation)
8
+ throw new Error(`Unknown operation: ${id}`);
9
+ return operation;
10
+ }
11
+ export function assertAliasCurrent(alias, now = new Date()) {
12
+ if (!Number.isFinite(now.getTime()) || now.getTime() >= Date.parse(`${alias.expires}T00:00:00Z`)) {
13
+ throw new Error(`${alias.name} expired on ${alias.expires}; use ${alias.replacement}`);
14
+ }
15
+ }
16
+ export function commandHelp(family) {
17
+ if (family && !manifest.families.some((entry) => entry.name === family))
18
+ throw new Error(`Unknown command: ${family}`);
19
+ const line = (usage, summary) => ` rudder ${usage.padEnd(24)} ${summary}`;
20
+ const families = family ? manifest.families.filter((entry) => entry.name === family) : manifest.families;
21
+ const subcommands = family
22
+ ? manifest.operations.filter((entry) => entry.cli[0] === family && entry.cli.length > 1).map((entry) => ` rudder ${entry.cli.join(" ")}`)
23
+ : [];
24
+ return [
25
+ "Usage:",
26
+ ...(family ? [] : [line("", "open the dashboard"), line('"task"', "start an agent")]),
27
+ ...families.map((entry) => line(entry.usage, entry.summary)),
28
+ ...subcommands,
29
+ ...(family ? [] : [line("--version", "print the version"), "",
30
+ "Task flags: --cloud runs it on your Cloud home, --backend claude|codex|opencode,",
31
+ "--continue hands this chat to the dashboard, --cwd <project> picks the project."]),
32
+ "",
33
+ ].join("\n");
34
+ }
35
+ /** Completion never advertises callbacks, developer commands or old spellings. */
36
+ export function commandCompletions(words = []) {
37
+ if (words.length === 0)
38
+ return manifest.families.map((entry) => entry.name);
39
+ if (!manifest.families.some((entry) => entry.name === words[0]))
40
+ return [];
41
+ return [...new Set(manifest.operations.filter((entry) => words.every((word, index) => entry.cli[index] === word))
42
+ .map((entry) => entry.cli[words.length]).filter((word) => Boolean(word)))];
43
+ }
44
+ /** Backend composers own their slash namespace, including /model and /help. */
45
+ export function classifyComposerInput(text, composer, now = new Date()) {
46
+ if (!text.trimStart().startsWith("/"))
47
+ return { kind: "text", text };
48
+ if (composer === "backend")
49
+ return { kind: "backend", text };
50
+ const command = text.trim().split(/\s+/, 1)[0];
51
+ if (command.slice(1).includes("/"))
52
+ return { kind: "text", text };
53
+ if (manifest.retired_slash.includes(command))
54
+ return { kind: "refused", reason: `${command} is retired; use ordinary task input or a selected agent action` };
55
+ if (manifest.slash.includes(command))
56
+ return { kind: "rudder", command, text };
57
+ const alias = manifest.slash_aliases.find((entry) => entry.name === command);
58
+ if (alias) {
59
+ try {
60
+ assertAliasCurrent(alias, now);
61
+ }
62
+ catch (error) {
63
+ return { kind: "refused", reason: error.message };
64
+ }
65
+ return { kind: "rudder", command, text };
66
+ }
67
+ return { kind: "refused", reason: `Unknown Rudder command ${command}; use the backend composer for backend slash commands` };
68
+ }
69
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/operations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE7D,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAU,CAAC;AAG1C,MAAM,UAAU,mBAAmB,CAAC,EAAU;IAC5C,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,IAAI,CAAC,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAC5D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAA6D,EAAE,GAAG,GAAG,IAAI,IAAI,EAAE;IAChH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,OAAO,YAAY,CAAC,EAAE,CAAC;QACjG,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,eAAe,KAAK,CAAC,OAAO,SAAS,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IACzF,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,K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
5
+ { "name": "attach", "usage": "attach <agent>", "summary": "watch or type into one agent" },
6
+ { "name": "logs", "usage": "logs <agent>", "summary": "saved output" },
7
+ { "name": "stop", "usage": "stop <agent> [--delete]", "summary": "stop an agent; --delete also removes it" },
8
+ { "name": "login", "usage": "login", "summary": "sign in to Rudder Cloud" },
9
+ { "name": "logout", "usage": "logout", "summary": "sign out of Rudder Cloud" },
10
+ { "name": "cloud", "usage": "cloud [move]", "summary": "Cloud home status; move this project there" },
11
+ { "name": "doctor", "usage": "doctor", "summary": "setup and diagnostics" },
12
+ { "name": "update", "usage": "update", "summary": "install the latest Rudder" }
13
+ ],
14
+ "slash": ["/model", "/main", "/resume", "/cloud", "/help"],
15
+ "operations": [
16
+ { "id": "surface.open.v1", "cli": ["open"], "adapter": "dashboard", "scope": "project", "capability": "observe", "arguments": {}, "receipt": "observation" },
17
+ { "id": "task.start.v1", "cli": ["run"], "adapter": "run", "scope": "execution", "capability": "task.start", "arguments": { "task": "text", "intent": "automatic|execute|discuss|plan_only" }, "receipt": "task", "summary": "Ordinary input; preserves planning intent" },
18
+ { "id": "agent.list.v1", "cli": ["ls"], "adapter": "runs", "scope": "project", "capability": "observe", "arguments": {}, "receipt": "observation" },
19
+ { "id": "agent.status.v1", "cli": ["agent", "status"], "adapter": "status", "scope": "project", "capability": "observe", "arguments": {}, "receipt": "observation" },
20
+ { "id": "agent.logs.v1", "cli": ["logs"], "adapter": "logs", "scope": "agent", "capability": "observe", "arguments": {}, "receipt": "observation" },
21
+ { "id": "agent.watch.v1", "cli": ["agent", "watch"], "adapter": "watch", "scope": "agent", "capability": "observe", "arguments": {}, "receipt": "observation" },
22
+ { "id": "agent.attach.v1", "cli": ["attach"], "adapter": "attach", "scope": "agent", "capability": "observe", "arguments": {}, "receipt": "observation" },
23
+ { "id": "agent.report.v1", "cli": ["agent", "report"], "adapter": "report", "scope": "project", "capability": "observe", "arguments": {}, "receipt": "observation" },
24
+ { "id": "agent.stop.v1", "cli": ["stop"], "adapter": "stop", "scope": "agent", "capability": "agent.stop", "arguments": { "reason": "text" }, "receipt": "command" },
25
+ { "id": "agent.delete.v1", "cli": ["stop", "--delete"], "adapter": "delete", "scope": "agent", "capability": "agent.delete", "arguments": { "force": "boolean" }, "receipt": "command" },
26
+ { "id": "agent.send.v1", "cli": ["agent", "send"], "adapter": null, "scope": "agent", "capability": "agent.send", "arguments": { "message": "text", "ttl_ms?": "positive_integer<=86400000" }, "receipt": "message", "tool": "agents_send" },
27
+ { "id": "agent.ask.v1", "cli": ["agent", "ask"], "adapter": null, "scope": "agent", "capability": "agent.ask", "arguments": { "message": "text", "ttl_ms?": "positive_integer<=86400000", "request_id": "text" }, "receipt": "message", "tool": "agents_ask" },
28
+ { "id": "agent.reply.v1", "cli": ["agent", "reply"], "adapter": null, "scope": "agent", "capability": "agent.reply", "arguments": { "message": "text", "ttl_ms?": "positive_integer<=86400000", "reply_to": "text" }, "receipt": "message", "tool": "agents_reply" },
29
+ { "id": "agent.inbox.v1", "cli": ["agent", "inbox"], "adapter": null, "scope": "agent", "capability": "agent.inbox", "arguments": { "limit?": "positive_integer<=64" }, "receipt": "command", "tool": "agents_inbox" },
30
+ { "id": "agent.ack.v1", "cli": ["agent", "ack"], "adapter": null, "scope": "agent", "capability": "agent.ack", "arguments": { "message_id": "text" }, "receipt": "command", "tool": "agents_ack" },
31
+ { "id": "agent.await.v1", "cli": ["agent", "await"], "adapter": null, "scope": "agent", "capability": "agent.await", "arguments": { "timeout_ms": "integer_0_to_30000", "command_id?": "text" }, "receipt": "command", "tool": "agents_await" },
32
+ { "id": "agent.steer.v1", "cli": ["agent", "steer"], "adapter": null, "scope": "agent", "capability": "agent.steer", "arguments": { "reason": "text", "instruction?": "text", "expected_thread_id": "text", "expected_turn_id": "text" }, "receipt": "command", "tool": "agents_steer" },
33
+ { "id": "agent.interrupt.v1", "cli": ["agent", "interrupt"], "adapter": null, "scope": "agent", "capability": "agent.interrupt", "arguments": { "reason": "text", "instruction?": "text", "expected_thread_id": "text", "expected_turn_id": "text" }, "receipt": "command", "tool": "agents_interrupt" },
34
+ { "id": "agent.resume.v1", "cli": ["agent", "resume"], "adapter": null, "scope": "agent", "capability": "agent.resume", "arguments": { "reason": "text", "instruction?": "text", "expected_thread_id": "text", "expected_turn_id": "text" }, "receipt": "command", "tool": "agents_resume" },
35
+ { "id": "agent.checkpoint.v1", "cli": ["agent", "checkpoint"], "adapter": null, "scope": "agent", "capability": "agent.checkpoint", "arguments": { "name": "text" }, "receipt": "command", "tool": null },
36
+ { "id": "agent.continue.v1", "cli": ["agent", "continue"], "adapter": "handoff", "scope": "conversation", "capability": "conversation.continue", "arguments": { "session_id": "text", "next_step": "text", "mode": "continue" }, "receipt": "conversation" },
37
+ { "id": "conversation.copy.v1", "cli": ["agent", "copy"], "adapter": null, "scope": "conversation", "capability": "conversation.copy", "arguments": { "session_id": "text", "next_step": "text", "mode": "copy" }, "receipt": "conversation" },
38
+ { "id": "conversation.move.v1", "cli": ["agent", "move"], "adapter": null, "scope": "conversation", "capability": "conversation.move", "arguments": { "session_id": "text", "next_step": "text", "mode": "move" }, "receipt": "conversation" },
39
+ { "id": "change.integrate.v1", "cli": ["change", "integrate"], "adapter": "merge", "scope": "change", "capability": "change.integrate", "arguments": { "change_ids": "text_array_1_to_64", "authorization": "integrate" }, "receipt": "command" },
40
+ { "id": "change.sync.v1", "cli": ["change", "sync"], "adapter": "sync", "scope": "change", "capability": "change.sync", "arguments": {}, "receipt": "command" },
41
+ { "id": "change.cleanup.v1", "cli": ["change", "cleanup"], "adapter": "cleanup", "scope": "change", "capability": "change.cleanup", "arguments": { "force": "boolean" }, "receipt": "command" },
42
+ { "id": "change.undo.v1", "cli": ["change", "undo"], "adapter": "undo", "scope": "change", "capability": "change.undo", "arguments": { "op_id?": "text" }, "receipt": "command" },
43
+ { "id": "change.review.v1", "cli": ["change", "review"], "adapter": null, "scope": "change", "capability": "change.review", "arguments": { "change_ids": "text_array_1_to_64", "authorization": "review" }, "receipt": "command" },
44
+ { "id": "change.check.v1", "cli": ["change", "check"], "adapter": null, "scope": "change", "capability": "change.check", "arguments": { "change_ids": "text_array_1_to_64", "authorization": "check" }, "receipt": "command" },
45
+ { "id": "project.cloud.v1", "cli": ["cloud"], "adapter": "cloud", "scope": "project", "capability": "project.cloud", "arguments": { "argv": "text_array_0_to_128" }, "receipt": "command" },
46
+ { "id": "project.board.v1", "cli": ["project", "board"], "adapter": "board", "scope": "project", "capability": "project.board", "arguments": { "argv": "text_array_0_to_128" }, "receipt": "command" },
47
+ { "id": "project.files.v1", "cli": ["project", "files"], "adapter": "project-files", "scope": "execution", "capability": "observe", "arguments": { "workspace_id?": "text", "path?": "text" }, "receipt": "observation" },
48
+ { "id": "project.serve.v1", "cli": ["project", "serve"], "adapter": "serve", "scope": "project", "capability": "project.serve", "arguments": { "argv": "text_array_0_to_128" }, "receipt": "command" },
49
+ { "id": "project.restart.v1", "cli": ["project", "restart"], "adapter": "restart", "scope": "project", "capability": "project.restart", "arguments": {}, "receipt": "command" },
50
+ { "id": "project.gc.v1", "cli": ["project", "gc"], "adapter": "gc", "scope": "project", "capability": "project.gc", "arguments": { "dry_run": "boolean" }, "receipt": "command" },
51
+ { "id": "project.settings.v1", "cli": ["project", "settings"], "adapter": "telemetry", "scope": "project", "capability": "project.settings", "arguments": { "setting": "model|effort|speed|notifications|sound|color|telemetry", "value": "text" }, "receipt": "command" },
52
+ { "id": "auth.login.v1", "cli": ["login"], "adapter": "login", "scope": "account", "capability": "auth.login", "arguments": {}, "receipt": "command" },
53
+ { "id": "diagnostic.check.v1", "cli": ["doctor"], "adapter": "doctor", "scope": "project", "capability": "observe", "arguments": {}, "receipt": "observation" },
54
+ { "id": "diagnostic.setup.v1", "cli": ["doctor", "setup"], "adapter": "onboard", "scope": "project", "capability": "diagnostic.setup", "arguments": {}, "receipt": "observation" },
55
+ { "id": "diagnostic.mouse.v1", "cli": ["doctor", "mouse"], "adapter": "mouse-test", "scope": "project", "capability": "diagnostic.mouse", "arguments": { "argv": "text_array_0_to_128" }, "receipt": "observation" },
56
+ { "id": "diagnostic.feedback.v1", "cli": ["doctor", "feedback"], "adapter": "feedback", "scope": "project", "capability": "diagnostic.feedback", "arguments": { "argv": "text_array_0_to_128" }, "receipt": "observation" },
57
+ { "id": "diagnostic.context.v1", "cli": ["doctor", "context"], "adapter": "context", "scope": "project", "capability": "diagnostic.context", "arguments": { "argv": "text_array_0_to_128" }, "receipt": "observation" },
58
+ { "id": "agent.find.v1", "cli": ["agent", "find"], "adapter": null, "scope": "agent", "capability": "agent.find", "arguments": {}, "receipt": "observation", "tool": "agents_find" },
59
+ { "id": "agent.receipt.v1", "cli": ["agent", "receipt"], "adapter": null, "scope": "agent", "capability": "agent.receipt", "arguments": { "command_id": "text" }, "receipt": "observation", "tool": "agents_status" },
60
+ { "id": "agent.topics.v1", "cli": ["agent", "topics"], "adapter": null, "scope": "agent", "capability": "agent.topics", "arguments": { "topics": "text_array" }, "receipt": "observation", "tool": "agents_topics" }
61
+ ],
62
+ "aliases": [
63
+ { "name": "run", "replacement": "rudder \"task\"", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01" },
64
+ { "name": "claude", "replacement": "rudder \"task\" --backend claude", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01", "backend": "claude" },
65
+ { "name": "codex", "replacement": "rudder \"task\" --backend codex", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01", "backend": "codex" },
66
+ { "name": "acpx", "replacement": "rudder \"task\" --backend acpx", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01", "backend": "acpx" },
67
+ { "name": "sail", "replacement": "rudder \"task\" --cloud", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01", "cloud": true },
68
+ { "name": "plan", "replacement": "rudder \"task\"", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01" },
69
+ { "name": "fanout", "replacement": "rudder \"task\"", "adapter": "run", "owner": "v4 command cut", "expires": "2027-02-01" },
70
+ { "name": "watch", "replacement": "rudder attach", "adapter": "attach", "owner": "v4 command cut", "expires": "2027-02-01" },
71
+ { "name": "status", "replacement": "rudder ls", "adapter": "runs", "owner": "v4 command cut", "expires": "2027-02-01" },
72
+ { "name": "runs", "replacement": "rudder ls", "adapter": "runs", "owner": "v4 command cut", "expires": "2027-02-01" },
73
+ { "name": "report", "replacement": "rudder ls", "adapter": "runs", "owner": "v4 command cut", "expires": "2027-02-01" },
74
+ { "name": "handoff", "replacement": "rudder --continue", "adapter": "handoff", "owner": "v4 command cut", "expires": "2027-02-01" },
75
+ { "name": "onboard", "replacement": "rudder doctor setup", "adapter": "onboard", "owner": "v4 command cut", "expires": "2027-02-01" },
76
+ { "name": "mouse-test", "replacement": "rudder doctor mouse", "adapter": "mouse-test", "owner": "v4 command cut", "expires": "2027-02-01" },
77
+ { "name": "feedback", "replacement": "rudder doctor feedback", "adapter": "feedback", "owner": "v4 command cut", "expires": "2027-02-01" },
78
+ { "name": "dashboard", "replacement": "rudder", "adapter": "dashboard", "owner": "v4 command cut", "expires": "2027-02-01" },
79
+ { "name": "open", "replacement": "rudder", "adapter": "dashboard", "owner": "v4 command cut", "expires": "2027-02-01" },
80
+ { "name": "delete", "replacement": "rudder stop <agent> --delete", "adapter": "delete", "owner": "v4 command cut", "expires": "2027-02-01" },
81
+ { "name": "auth", "replacement": "rudder login", "adapter": "login", "owner": "v4 command cut", "expires": "2027-02-01", "bare_only": true },
82
+ { "name": "agent list", "replacement": "rudder ls", "adapter": "runs", "owner": "v4 command cut", "expires": "2027-02-01" },
83
+ { "name": "agent status", "replacement": "rudder ls", "adapter": "runs", "owner": "v4 command cut", "expires": "2027-02-01" },
84
+ { "name": "agent report", "replacement": "rudder ls", "adapter": "runs", "owner": "v4 command cut", "expires": "2027-02-01" },
85
+ { "name": "agent logs", "replacement": "rudder logs", "adapter": "logs", "owner": "v4 command cut", "expires": "2027-02-01" },
86
+ { "name": "agent watch", "replacement": "rudder attach", "adapter": "attach", "owner": "v4 command cut", "expires": "2027-02-01" },
87
+ { "name": "agent attach", "replacement": "rudder attach", "adapter": "attach", "owner": "v4 command cut", "expires": "2027-02-01" },
88
+ { "name": "agent stop", "replacement": "rudder stop", "adapter": "stop", "owner": "v4 command cut", "expires": "2027-02-01" },
89
+ { "name": "agent delete", "replacement": "rudder stop <agent> --delete", "adapter": "delete", "owner": "v4 command cut", "expires": "2027-02-01" },
90
+ { "name": "agent continue", "replacement": "rudder --continue", "adapter": "handoff", "owner": "v4 command cut", "expires": "2027-02-01" },
91
+ { "name": "auth login", "replacement": "rudder login", "adapter": "login", "owner": "v4 command cut", "expires": "2027-02-01" },
92
+ { "name": "project cloud", "replacement": "rudder cloud", "adapter": "cloud", "owner": "v4 command cut", "expires": "2027-02-01" }
93
+ ],
94
+ "callbacks": ["__migrate-v4", "__open-project-files", "done", "remember", "share", "context", "engine", "__fabric-fetch", "__claude-sdk", "__worker", "__route-task", "__launch-node", "__graph-mirror", "__sync-checkout", "__pull-export", "__adopt-moved", "__models", "__refresh-models", "__event"],
95
+ "developer": ["board", "serve", "telemetry", "project-files", "restart", "merge", "sync", "cleanup", "gc", "undo"],
96
+ "retired": ["tmux", "tui", "shell", "interactive", "legacy-shell", "improve"],
97
+ "retired_slash": ["/ask", "/run", "/gam", "/nudge", "/tell"],
98
+ "slash_aliases": [
99
+ { "name": "/plan", "replacement": "ordinary task input", "owner": "n13 native surface", "expires": "2027-02-01" },
100
+ { "name": "/login", "replacement": "auth.login.v1", "owner": "n14 native surface", "expires": "2027-02-01" },
101
+ { "name": "/usage", "replacement": "project settings and usage", "owner": "n14 native surface", "expires": "2027-02-01" },
102
+ { "name": "/feedback", "replacement": "diagnostic.feedback.v1", "owner": "n14 native surface", "expires": "2027-02-01" },
103
+ { "name": "/m", "replacement": "task.start.v1 with checkout=main", "owner": "n13 native surface", "expires": "2027-02-01" },
104
+ { "name": "/restore", "replacement": "agent.continue.v1", "owner": "n13 native surface", "expires": "2027-02-01" },
105
+ { "name": "/handoff", "replacement": "conversation.move.v1", "owner": "n13 native surface", "expires": "2027-02-01" },
106
+ { "name": "/fast", "replacement": "model settings", "owner": "n13 native surface", "expires": "2027-02-01" },
107
+ { "name": "/swarm", "replacement": "explicit task experiment", "owner": "n13 native surface", "expires": "2027-02-01" },
108
+ { "name": "/review-all", "replacement": "change.review.v1 with selected group", "owner": "n13 native surface", "expires": "2027-02-01" },
109
+ { "name": "/merge-all", "replacement": "change.integrate.v1 with selected group", "owner": "n13 native surface", "expires": "2027-02-01" },
110
+ { "name": "/verify", "replacement": "change.check.v1", "owner": "n13 native surface", "expires": "2027-02-01" },
111
+ { "name": "/sync", "replacement": "project.cloud.v1 sync", "owner": "n13 native surface", "expires": "2027-02-01" },
112
+ { "name": "/notify", "replacement": "settings notifications", "owner": "n13 native surface", "expires": "2027-02-01" },
113
+ { "name": "/sound", "replacement": "settings sound", "owner": "n13 native surface", "expires": "2027-02-01" },
114
+ { "name": "/color", "replacement": "settings color", "owner": "n13 native surface", "expires": "2027-02-01" },
115
+ { "name": "/telemetry", "replacement": "settings telemetry", "owner": "n13 native surface", "expires": "2027-02-01" },
116
+ { "name": "/diff", "replacement": "change view", "owner": "n13 native surface", "expires": "2027-02-01" },
117
+ { "name": "/web", "replacement": "project.board.v1", "owner": "n13 native surface", "expires": "2027-02-01" },
118
+ { "name": "/ui", "replacement": "project.board.v1", "owner": "n13 native surface", "expires": "2027-02-01" },
119
+ { "name": "/board", "replacement": "project.board.v1", "owner": "n13 native surface", "expires": "2027-02-01" }
120
+ ],
121
+ "flag_aliases": [
122
+ { "name": "--worktree", "replacement": "--workspace", "owner": "n13 command migration", "expires": "2027-02-01" }
123
+ ]
124
+ }
@@ -0,0 +1,167 @@
1
+ export type ExecutionScope = {
2
+ project_id: string;
3
+ location: "local" | "cloud";
4
+ checkout: "main" | "isolated";
5
+ /** Bound by the owner, never inferred from the caller's current selection. */
6
+ owner_epoch: number;
7
+ agents: Array<{
8
+ run_id: string;
9
+ run_epoch: number;
10
+ }>;
11
+ selection: "project" | "agent" | "group" | "change" | "conversation" | "account";
12
+ home_id?: string;
13
+ /** Existing delegated mailbox/control scope. Distinct from project identity. */
14
+ communication_scope?: string;
15
+ };
16
+ type TaskArguments = {
17
+ task: string;
18
+ intent: "automatic" | "execute" | "discuss" | "plan_only";
19
+ };
20
+ type MessageArguments = {
21
+ message: string;
22
+ ttl_ms?: number;
23
+ };
24
+ type ControlArguments = {
25
+ reason: string;
26
+ instruction?: string;
27
+ expected_thread_id: string;
28
+ expected_turn_id: string;
29
+ };
30
+ type ConversationArguments = {
31
+ session_id: string;
32
+ next_step: string;
33
+ mode: "continue" | "copy" | "move";
34
+ };
35
+ type ChangeArguments = {
36
+ change_ids: string[];
37
+ authorization: "review" | "check" | "integrate";
38
+ };
39
+ export type OperationArguments = {
40
+ "surface.open.v1": Record<string, never>;
41
+ "agent.list.v1": Record<string, never>;
42
+ "agent.status.v1": Record<string, never>;
43
+ "agent.logs.v1": Record<string, never>;
44
+ "agent.watch.v1": Record<string, never>;
45
+ "agent.attach.v1": Record<string, never>;
46
+ "agent.report.v1": Record<string, never>;
47
+ "agent.find.v1": Record<string, never>;
48
+ "agent.receipt.v1": {
49
+ command_id: string;
50
+ };
51
+ "agent.topics.v1": {
52
+ topics: string[];
53
+ };
54
+ "task.start.v1": TaskArguments;
55
+ "agent.send.v1": MessageArguments;
56
+ "agent.ask.v1": MessageArguments & {
57
+ request_id: string;
58
+ };
59
+ "agent.reply.v1": MessageArguments & {
60
+ reply_to: string;
61
+ };
62
+ "agent.inbox.v1": {
63
+ limit?: number;
64
+ };
65
+ "agent.ack.v1": {
66
+ message_id: string;
67
+ };
68
+ "agent.await.v1": {
69
+ timeout_ms: number;
70
+ command_id?: string;
71
+ };
72
+ "agent.steer.v1": ControlArguments;
73
+ "agent.interrupt.v1": ControlArguments;
74
+ "agent.resume.v1": ControlArguments;
75
+ "agent.checkpoint.v1": {
76
+ name: string;
77
+ };
78
+ "agent.continue.v1": ConversationArguments;
79
+ "conversation.copy.v1": ConversationArguments;
80
+ "conversation.move.v1": ConversationArguments;
81
+ "agent.stop.v1": {
82
+ reason: string;
83
+ };
84
+ "agent.delete.v1": {
85
+ force: boolean;
86
+ };
87
+ "change.review.v1": ChangeArguments;
88
+ "change.check.v1": ChangeArguments;
89
+ "change.integrate.v1": ChangeArguments;
90
+ "change.sync.v1": Record<string, never>;
91
+ "change.cleanup.v1": {
92
+ force: boolean;
93
+ };
94
+ "change.undo.v1": {
95
+ op_id?: string;
96
+ };
97
+ "project.cloud.v1": {
98
+ argv: string[];
99
+ };
100
+ "project.board.v1": {
101
+ argv: string[];
102
+ };
103
+ "project.serve.v1": {
104
+ argv: string[];
105
+ };
106
+ "project.restart.v1": Record<string, never>;
107
+ "project.gc.v1": {
108
+ dry_run: boolean;
109
+ };
110
+ "auth.login.v1": Record<string, never>;
111
+ "diagnostic.check.v1": Record<string, never>;
112
+ "diagnostic.setup.v1": Record<string, never>;
113
+ "diagnostic.mouse.v1": {
114
+ argv: string[];
115
+ };
116
+ "diagnostic.feedback.v1": {
117
+ argv: string[];
118
+ };
119
+ "diagnostic.context.v1": {
120
+ argv: string[];
121
+ };
122
+ "project.settings.v1": {
123
+ setting: "model" | "effort" | "speed" | "notifications" | "sound" | "color" | "telemetry";
124
+ value: string;
125
+ };
126
+ "project.files.v1": {
127
+ workspace_id?: string;
128
+ path?: string;
129
+ };
130
+ };
131
+ export type OperationId = keyof OperationArguments;
132
+ export type OperationRequest<K extends OperationId = OperationId> = K extends OperationId ? {
133
+ format_version: 1;
134
+ operation: K;
135
+ idempotency_key: string;
136
+ scope: ExecutionScope;
137
+ arguments: OperationArguments[K];
138
+ } : never;
139
+ export declare function validateOperationRequest(input: unknown): OperationRequest;
140
+ export declare function operationDigest(request: OperationRequest): string;
141
+ export type OperationReceipt = {
142
+ format_version: 1;
143
+ operation: OperationId;
144
+ idempotency_key: string;
145
+ request_sha256: string;
146
+ kind: string;
147
+ state: "accepted" | "running" | "completed" | "rejected" | "effect_unknown";
148
+ result: unknown;
149
+ };
150
+ export declare function validateOperationReceipt(request: OperationRequest, input: unknown): OperationReceipt;
151
+ export type OperationAuthority = {
152
+ capabilities: readonly string[];
153
+ scope: ExecutionScope;
154
+ };
155
+ export type TransactionalOperationHandler = (request: OperationRequest) => Promise<OperationReceipt>;
156
+ /** The handler owns durable idempotency, epoch checks and reconciliation. This
157
+ * boundary never retries, converts an uncertain effect to success, or consults
158
+ * a model to choose the meaning of stop/resume/review/settings. */
159
+ export declare function dispatchOperation(input: unknown, authority: OperationAuthority, handler: TransactionalOperationHandler): Promise<OperationReceipt>;
160
+ /** Validation adds no permissions. The receiving engine must authenticate its
161
+ * caller and use its existing transactional command receipt and epoch checks.
162
+ * Ordinary send maps ONLY to agents_send, never resume or broadcast recovery. */
163
+ export declare function agentToolCalls(request: OperationRequest): Array<{
164
+ tool: string;
165
+ arguments: Record<string, unknown>;
166
+ }>;
167
+ export {};
@@ -0,0 +1,223 @@
1
+ import { createHash } from "node:crypto";
2
+ import { operationDefinition } from "./registry.js";
3
+ function requireCondition(value, message) {
4
+ if (!value)
5
+ throw new Error(message);
6
+ }
7
+ function record(value) {
8
+ requireCondition(value !== null && typeof value === "object" && !Array.isArray(value), "Expected an object");
9
+ return value;
10
+ }
11
+ function keys(value, allowed) {
12
+ requireCondition(Object.keys(value).every((key) => allowed.includes(key)), "Unknown operation field");
13
+ }
14
+ function text(value, max = 65536) {
15
+ requireCondition(typeof value === "string" && value.trim().length > 0 && Buffer.byteLength(value) <= max && !value.includes("\0"), "Invalid bounded text");
16
+ }
17
+ function epoch(value) { requireCondition(Number.isSafeInteger(value) && Number(value) > 0, "Invalid owner or run epoch"); }
18
+ export function validateOperationRequest(input) {
19
+ const request = record(input);
20
+ keys(request, ["format_version", "operation", "idempotency_key", "scope", "arguments"]);
21
+ requireCondition(request.format_version === 1, "Unsupported operation version");
22
+ text(request.operation, 128);
23
+ operationDefinition(request.operation);
24
+ text(request.idempotency_key, 128);
25
+ requireCondition(/^[A-Za-z0-9_.:-]+$/.test(request.idempotency_key), "Invalid idempotency key");
26
+ const scope = record(request.scope);
27
+ keys(scope, ["project_id", "location", "checkout", "owner_epoch", "agents", "selection", "home_id", "communication_scope"]);
28
+ text(scope.project_id, 256);
29
+ requireCondition(["local", "cloud"].includes(String(scope.location)) && ["main", "isolated"].includes(String(scope.checkout)), "Explicit location and checkout required");
30
+ epoch(scope.owner_epoch);
31
+ requireCondition(["project", "agent", "group", "change", "conversation", "account"].includes(String(scope.selection)), "Explicit selection required");
32
+ if (scope.location === "cloud")
33
+ text(scope.home_id, 256);
34
+ else
35
+ requireCondition(scope.home_id === undefined, "Local execution cannot select a Cloud home");
36
+ if (scope.communication_scope !== undefined)
37
+ text(scope.communication_scope, 256);
38
+ requireCondition(Array.isArray(scope.agents) && scope.agents.length <= 64, "Bounded selected agents required");
39
+ const ids = new Set();
40
+ for (const item of scope.agents) {
41
+ const agent = record(item);
42
+ keys(agent, ["run_id", "run_epoch"]);
43
+ text(agent.run_id, 256);
44
+ epoch(agent.run_epoch);
45
+ requireCondition(!ids.has(agent.run_id), "Duplicate selected agent");
46
+ ids.add(agent.run_id);
47
+ }
48
+ requireCondition(scope.selection !== "agent" || ids.size === 1, "Agent action requires exactly one selected agent");
49
+ requireCondition(scope.selection !== "group" || ids.size > 0, "Group action requires explicit selected agents");
50
+ const args = record(request.arguments);
51
+ const name = request.operation;
52
+ if (["agent.send.v1", "agent.ask.v1", "agent.reply.v1"].includes(name)) {
53
+ keys(args, ["message", "ttl_ms", ...(name === "agent.ask.v1" ? ["request_id"] : name === "agent.reply.v1" ? ["reply_to"] : [])]);
54
+ text(args.message);
55
+ if (args.ttl_ms !== undefined)
56
+ requireCondition(Number.isSafeInteger(args.ttl_ms) && Number(args.ttl_ms) > 0 && Number(args.ttl_ms) <= 86400000, "Invalid message TTL");
57
+ if (name === "agent.ask.v1")
58
+ text(args.request_id, 256);
59
+ if (name === "agent.reply.v1")
60
+ text(args.reply_to, 256);
61
+ requireCondition(["agent", "group"].includes(String(scope.selection)), "Messaging requires an addressed agent or explicit group");
62
+ if (name === "agent.reply.v1")
63
+ requireCondition(scope.selection === "agent", "Reply targets its original conversation");
64
+ else
65
+ text(scope.communication_scope, 256);
66
+ }
67
+ else if (["agent.steer.v1", "agent.interrupt.v1", "agent.resume.v1"].includes(name)) {
68
+ keys(args, ["reason", "instruction", "expected_thread_id", "expected_turn_id"]);
69
+ text(args.reason);
70
+ text(args.expected_thread_id, 256);
71
+ text(args.expected_turn_id, 256);
72
+ if (args.instruction !== undefined)
73
+ text(args.instruction);
74
+ requireCondition(scope.selection === "agent", "Live control requires one exact agent attempt");
75
+ text(scope.communication_scope, 256);
76
+ }
77
+ else if (name === "task.start.v1") {
78
+ keys(args, ["task", "intent"]);
79
+ text(args.task);
80
+ requireCondition(["automatic", "execute", "discuss", "plan_only"].includes(String(args.intent)), "Explicit task intent required");
81
+ requireCondition(scope.selection === "project" && ids.size === 0, "Task start requires project scope");
82
+ }
83
+ else if (["agent.continue.v1", "conversation.copy.v1", "conversation.move.v1"].includes(name)) {
84
+ keys(args, ["session_id", "next_step", "mode"]);
85
+ text(args.session_id, 256);
86
+ text(args.next_step);
87
+ const expected = name === "agent.continue.v1" ? "continue" : name === "conversation.copy.v1" ? "copy" : "move";
88
+ requireCondition(args.mode === expected && scope.selection === "conversation", "Conversation mode must be explicit");
89
+ }
90
+ else if (["change.review.v1", "change.check.v1", "change.integrate.v1"].includes(name)) {
91
+ keys(args, ["change_ids", "authorization"]);
92
+ requireCondition(Array.isArray(args.change_ids) && args.change_ids.length > 0 && args.change_ids.length <= 64, "Selected changes required");
93
+ for (const id of args.change_ids)
94
+ text(id, 256);
95
+ requireCondition(args.authorization === name.split(".")[1] && scope.selection === "change", "Change authorization differs");
96
+ }
97
+ else if (name === "project.settings.v1") {
98
+ keys(args, ["setting", "value"]);
99
+ text(args.value, 256);
100
+ requireCondition(["model", "effort", "speed", "notifications", "sound", "color", "telemetry"].includes(String(args.setting)) && scope.selection === "project", "Unknown project setting");
101
+ }
102
+ else if (name === "project.files.v1") {
103
+ keys(args, ["workspace_id", "path"]);
104
+ if (args.workspace_id !== undefined)
105
+ text(args.workspace_id, 256);
106
+ if (args.path !== undefined)
107
+ text(args.path, 4096);
108
+ requireCondition(scope.selection === "project", "Project files require project scope");
109
+ }
110
+ else {
111
+ const passthrough = ["project.cloud.v1", "project.board.v1", "project.serve.v1", "diagnostic.mouse.v1", "diagnostic.feedback.v1", "diagnostic.context.v1"];
112
+ const empty = ["surface.open.v1", "agent.list.v1", "agent.status.v1", "agent.logs.v1", "agent.watch.v1", "agent.attach.v1", "agent.report.v1", "agent.find.v1", "change.sync.v1", "project.restart.v1", "auth.login.v1", "diagnostic.check.v1", "diagnostic.setup.v1"];
113
+ if (passthrough.includes(name)) {
114
+ keys(args, ["argv"]);
115
+ requireCondition(Array.isArray(args.argv) && args.argv.length <= 128, "Bounded adapter arguments required");
116
+ for (const arg of args.argv)
117
+ text(arg, 65536);
118
+ }
119
+ else if (empty.includes(name))
120
+ keys(args, []);
121
+ else if (name === "project.gc.v1" || name === "change.cleanup.v1") {
122
+ const flag = name === "project.gc.v1" ? "dry_run" : "force";
123
+ keys(args, [flag]);
124
+ requireCondition(typeof args[flag] === "boolean", "Explicit effect flag required");
125
+ }
126
+ else if (name === "change.undo.v1") {
127
+ keys(args, ["op_id"]);
128
+ if (args.op_id !== undefined)
129
+ text(args.op_id, 256);
130
+ }
131
+ else if (name === "agent.receipt.v1") {
132
+ keys(args, ["command_id"]);
133
+ text(args.command_id, 256);
134
+ }
135
+ else if (name === "agent.topics.v1") {
136
+ keys(args, ["topics"]);
137
+ requireCondition(Array.isArray(args.topics) && args.topics.length <= 256, "Bounded topics required");
138
+ for (const topic of args.topics)
139
+ text(topic, 256);
140
+ }
141
+ else {
142
+ const fields = {
143
+ "agent.inbox.v1": ["limit"], "agent.ack.v1": ["message_id"], "agent.await.v1": ["timeout_ms", "command_id"],
144
+ "agent.checkpoint.v1": ["name"], "agent.stop.v1": ["reason"], "agent.delete.v1": ["force"],
145
+ };
146
+ requireCondition(fields[name], "Operation requires its existing adapter schema");
147
+ keys(args, fields[name]);
148
+ requireCondition(scope.selection === "agent", "Agent action requires one exact agent attempt");
149
+ if (name === "agent.ack.v1")
150
+ text(args.message_id, 256);
151
+ if (name === "agent.checkpoint.v1")
152
+ text(args.name, 256);
153
+ if (name === "agent.stop.v1")
154
+ text(args.reason);
155
+ if (name === "agent.delete.v1")
156
+ requireCondition(typeof args.force === "boolean", "Explicit force flag required");
157
+ if (args.limit !== undefined)
158
+ requireCondition(Number.isSafeInteger(args.limit) && Number(args.limit) > 0 && Number(args.limit) <= 64, "Invalid inbox limit");
159
+ if (name === "agent.await.v1") {
160
+ requireCondition(Number.isSafeInteger(args.timeout_ms) && Number(args.timeout_ms) >= 0 && Number(args.timeout_ms) <= 30000, "Wait must be bounded to 30000 ms");
161
+ if (args.command_id !== undefined)
162
+ text(args.command_id, 256);
163
+ }
164
+ }
165
+ const definition = operationDefinition(name);
166
+ requireCondition(scope.selection === definition.scope || definition.scope === "execution", "Selection differs from operation scope");
167
+ }
168
+ requireCondition(Buffer.byteLength(JSON.stringify(input)) <= 128 * 1024, "Operation request exceeds bound");
169
+ return input;
170
+ }
171
+ function canonical(value) {
172
+ if (Array.isArray(value))
173
+ return `[${value.map(canonical).join(",")}]`;
174
+ if (value && typeof value === "object")
175
+ return `{${Object.entries(value).filter(([, v]) => v !== undefined).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([k, v]) => `${JSON.stringify(k)}:${canonical(v)}`).join(",")}}`;
176
+ return JSON.stringify(value);
177
+ }
178
+ export function operationDigest(request) {
179
+ validateOperationRequest(request);
180
+ return createHash("sha256").update(canonical(request)).digest("hex");
181
+ }
182
+ export function validateOperationReceipt(request, input) {
183
+ const receipt = record(input);
184
+ keys(receipt, ["format_version", "operation", "idempotency_key", "request_sha256", "kind", "state", "result"]);
185
+ requireCondition(receipt.format_version === 1 && receipt.operation === request.operation && receipt.idempotency_key === request.idempotency_key
186
+ && receipt.request_sha256 === operationDigest(request) && receipt.kind === operationDefinition(request.operation).receipt, "Receipt differs from original operation and scope");
187
+ requireCondition(["accepted", "running", "completed", "rejected", "effect_unknown"].includes(String(receipt.state)) && receipt.result !== undefined, "Invalid operation receipt");
188
+ return input;
189
+ }
190
+ /** The handler owns durable idempotency, epoch checks and reconciliation. This
191
+ * boundary never retries, converts an uncertain effect to success, or consults
192
+ * a model to choose the meaning of stop/resume/review/settings. */
193
+ export async function dispatchOperation(input, authority, handler) {
194
+ const request = structuredClone(validateOperationRequest(input));
195
+ const definition = operationDefinition(request.operation);
196
+ requireCondition(authority.capabilities.includes(definition.capability), "Operation capability was not delegated");
197
+ requireCondition(canonical(authority.scope) === canonical(request.scope), "Operation differs from authenticated execution scope");
198
+ const original = structuredClone(request);
199
+ return validateOperationReceipt(original, await handler(request));
200
+ }
201
+ /** Validation adds no permissions. The receiving engine must authenticate its
202
+ * caller and use its existing transactional command receipt and epoch checks.
203
+ * Ordinary send maps ONLY to agents_send, never resume or broadcast recovery. */
204
+ export function agentToolCalls(request) {
205
+ validateOperationRequest(request);
206
+ const definition = operationDefinition(request.operation);
207
+ requireCondition("tool" in definition && definition.tool, "Operation has no agent tool adapter");
208
+ const tool = definition.tool;
209
+ const args = request.arguments;
210
+ return request.scope.agents.map((agent) => {
211
+ const key = request.scope.selection === "group" ? `${request.idempotency_key}:${agent.run_id}` : request.idempotency_key;
212
+ requireCondition(Buffer.byteLength(key) <= 128, "Per-agent idempotency key exceeds bound");
213
+ const scope = request.scope.communication_scope;
214
+ if (tool === "agents_send" || tool === "agents_ask")
215
+ return { tool, arguments: { ...args, idempotency_key: key, recipient_run: agent.run_id, recipient_epoch: agent.run_epoch, scope } };
216
+ if (["agents_steer", "agents_interrupt", "agents_resume"].includes(tool))
217
+ return { tool, arguments: { ...args, idempotency_key: key, target_run: agent.run_id, target_epoch: agent.run_epoch, scope } };
218
+ if (tool === "agents_reply")
219
+ return { tool, arguments: { ...args, idempotency_key: key } };
220
+ return { tool, arguments: { ...args } };
221
+ });
222
+ }
223
+ //# sourceMappingURL=requests.js.map