@maiaos/protocol 0.1.0-canary.2 → 0.1.0-canary.20

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 (316) hide show
  1. package/README.md +25 -135
  2. package/dist/agent/definition.d.ts +2 -2
  3. package/dist/agent/worker-operation.d.ts +1 -0
  4. package/dist/agent/worker-operation.d.ts.map +1 -1
  5. package/dist/agents/contract.d.ts +341 -0
  6. package/dist/agents/contract.d.ts.map +1 -0
  7. package/dist/agents/contract.js +18 -0
  8. package/dist/agents/contract.js.map +1 -0
  9. package/dist/agents/effect-schema.d.ts +604 -0
  10. package/dist/agents/effect-schema.d.ts.map +1 -0
  11. package/dist/agents/effect-schema.js +164 -0
  12. package/dist/agents/effect-schema.js.map +1 -0
  13. package/dist/agents/feature.d.ts +113 -0
  14. package/dist/agents/feature.d.ts.map +1 -0
  15. package/dist/agents/feature.js +111 -0
  16. package/dist/agents/feature.js.map +1 -0
  17. package/dist/agents/index.d.ts +3 -0
  18. package/dist/agents/index.d.ts.map +1 -0
  19. package/dist/agents/index.js +3 -0
  20. package/dist/agents/index.js.map +1 -0
  21. package/dist/connection/access-effect-schema.d.ts +502 -0
  22. package/dist/connection/access-effect-schema.d.ts.map +1 -0
  23. package/dist/connection/access-effect-schema.js +196 -0
  24. package/dist/connection/access-effect-schema.js.map +1 -0
  25. package/dist/connection/contract.d.ts +402 -1
  26. package/dist/connection/contract.d.ts.map +1 -1
  27. package/dist/connection/contract.js +24 -1
  28. package/dist/connection/contract.js.map +1 -1
  29. package/dist/connection/effect-schema.d.ts +342 -0
  30. package/dist/connection/effect-schema.d.ts.map +1 -1
  31. package/dist/connection/effect-schema.js +3 -0
  32. package/dist/connection/effect-schema.js.map +1 -1
  33. package/dist/connection/feature.d.ts +225 -0
  34. package/dist/connection/feature.d.ts.map +1 -1
  35. package/dist/connection/feature.js +149 -0
  36. package/dist/connection/feature.js.map +1 -1
  37. package/dist/connection/index.d.ts +1 -1
  38. package/dist/connection/index.d.ts.map +1 -1
  39. package/dist/connection/index.js +1 -1
  40. package/dist/connection/index.js.map +1 -1
  41. package/dist/connection/system-effect-schema.d.ts +261 -1
  42. package/dist/connection/system-effect-schema.d.ts.map +1 -1
  43. package/dist/connection/system-effect-schema.js +101 -1
  44. package/dist/connection/system-effect-schema.js.map +1 -1
  45. package/dist/coordinator-tool/registry.d.ts +3 -1
  46. package/dist/coordinator-tool/registry.d.ts.map +1 -1
  47. package/dist/coordinator-tool/registry.js +78 -10
  48. package/dist/coordinator-tool/registry.js.map +1 -1
  49. package/dist/discovery/contract.d.ts +1 -0
  50. package/dist/discovery/contract.d.ts.map +1 -1
  51. package/dist/discovery/effect-schema.d.ts +2 -0
  52. package/dist/discovery/effect-schema.d.ts.map +1 -1
  53. package/dist/event/contract.d.ts +82 -0
  54. package/dist/event/contract.d.ts.map +1 -0
  55. package/dist/event/contract.js +13 -0
  56. package/dist/event/contract.js.map +1 -0
  57. package/dist/event/effect-schema.d.ts +3 -0
  58. package/dist/event/effect-schema.d.ts.map +1 -0
  59. package/dist/event/effect-schema.js +3 -0
  60. package/dist/event/effect-schema.js.map +1 -0
  61. package/dist/event/envelope-effect-schema.d.ts +37 -0
  62. package/dist/event/envelope-effect-schema.d.ts.map +1 -0
  63. package/dist/event/envelope-effect-schema.js +113 -0
  64. package/dist/event/envelope-effect-schema.js.map +1 -0
  65. package/dist/event/feature.d.ts +30 -0
  66. package/dist/event/feature.d.ts.map +1 -0
  67. package/dist/event/feature.js +34 -0
  68. package/dist/event/feature.js.map +1 -0
  69. package/dist/event/format.d.ts +14 -0
  70. package/dist/event/format.d.ts.map +1 -0
  71. package/dist/event/format.js +14 -0
  72. package/dist/event/format.js.map +1 -0
  73. package/dist/event/index.d.ts +5 -0
  74. package/dist/event/index.d.ts.map +1 -0
  75. package/dist/event/index.js +5 -0
  76. package/dist/event/index.js.map +1 -0
  77. package/dist/event/read-effect-schema.d.ts +105 -0
  78. package/dist/event/read-effect-schema.d.ts.map +1 -0
  79. package/dist/event/read-effect-schema.js +64 -0
  80. package/dist/event/read-effect-schema.js.map +1 -0
  81. package/dist/event/registry.d.ts +17 -0
  82. package/dist/event/registry.d.ts.map +1 -0
  83. package/dist/event/registry.js +190 -0
  84. package/dist/event/registry.js.map +1 -0
  85. package/dist/event-stream/contract.d.ts +120 -0
  86. package/dist/event-stream/contract.d.ts.map +1 -0
  87. package/dist/event-stream/contract.js +5 -0
  88. package/dist/event-stream/contract.js.map +1 -0
  89. package/dist/event-stream/effect-schema.d.ts +117 -0
  90. package/dist/event-stream/effect-schema.d.ts.map +1 -0
  91. package/dist/event-stream/effect-schema.js +90 -0
  92. package/dist/event-stream/effect-schema.js.map +1 -0
  93. package/dist/event-stream/index.d.ts +2 -0
  94. package/dist/event-stream/index.d.ts.map +1 -0
  95. package/dist/event-stream/index.js +2 -0
  96. package/dist/event-stream/index.js.map +1 -0
  97. package/dist/execution/worktree/effect-schema.d.ts.map +1 -1
  98. package/dist/execution/worktree/effect-schema.js +10 -2
  99. package/dist/execution/worktree/effect-schema.js.map +1 -1
  100. package/dist/feature/registry.d.ts +9 -1
  101. package/dist/feature/registry.d.ts.map +1 -1
  102. package/dist/feature/registry.js +8 -0
  103. package/dist/feature/registry.js.map +1 -1
  104. package/dist/index.d.ts +13 -5
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.js +13 -5
  107. package/dist/index.js.map +1 -1
  108. package/dist/invocation-context/contract.d.ts +11 -1
  109. package/dist/invocation-context/contract.d.ts.map +1 -1
  110. package/dist/invocation-context/effect-schema.d.ts +24 -2
  111. package/dist/invocation-context/effect-schema.d.ts.map +1 -1
  112. package/dist/invocation-context/effect-schema.js +19 -1
  113. package/dist/invocation-context/effect-schema.js.map +1 -1
  114. package/dist/local-node/contract.d.ts +18 -9
  115. package/dist/local-node/contract.d.ts.map +1 -1
  116. package/dist/local-node/contract.js.map +1 -1
  117. package/dist/local-node/effect-schema.d.ts +754 -9
  118. package/dist/local-node/effect-schema.d.ts.map +1 -1
  119. package/dist/local-node/effect-schema.js +36 -0
  120. package/dist/local-node/effect-schema.js.map +1 -1
  121. package/dist/local-node/node-api/methods.d.ts +35 -4
  122. package/dist/local-node/node-api/methods.d.ts.map +1 -1
  123. package/dist/local-node/node-api/methods.js +63 -0
  124. package/dist/local-node/node-api/methods.js.map +1 -1
  125. package/dist/local-node/receipt-list.d.ts +1 -1
  126. package/dist/local-node/receipt-list.d.ts.map +1 -1
  127. package/dist/local-node/receipt-list.js +12 -0
  128. package/dist/local-node/receipt-list.js.map +1 -1
  129. package/dist/machine-lease/contract.d.ts +90 -0
  130. package/dist/machine-lease/contract.d.ts.map +1 -0
  131. package/dist/machine-lease/contract.js +8 -0
  132. package/dist/machine-lease/contract.js.map +1 -0
  133. package/dist/machine-lease/effect-schema.d.ts +85 -0
  134. package/dist/machine-lease/effect-schema.d.ts.map +1 -0
  135. package/dist/machine-lease/effect-schema.js +78 -0
  136. package/dist/machine-lease/effect-schema.js.map +1 -0
  137. package/dist/machine-lease/index.d.ts +3 -0
  138. package/dist/machine-lease/index.d.ts.map +1 -0
  139. package/dist/machine-lease/index.js +3 -0
  140. package/dist/machine-lease/index.js.map +1 -0
  141. package/dist/machine-lease/policy.d.ts +12 -0
  142. package/dist/machine-lease/policy.d.ts.map +1 -0
  143. package/dist/machine-lease/policy.js +12 -0
  144. package/dist/machine-lease/policy.js.map +1 -0
  145. package/dist/machine-principal/contract.d.ts +14 -0
  146. package/dist/machine-principal/contract.d.ts.map +1 -0
  147. package/dist/machine-principal/contract.js +5 -0
  148. package/dist/machine-principal/contract.js.map +1 -0
  149. package/dist/machine-principal/effect-schema.d.ts +12 -0
  150. package/dist/machine-principal/effect-schema.d.ts.map +1 -0
  151. package/dist/machine-principal/effect-schema.js +25 -0
  152. package/dist/machine-principal/effect-schema.js.map +1 -0
  153. package/dist/machine-principal/index.d.ts +2 -0
  154. package/dist/machine-principal/index.d.ts.map +1 -0
  155. package/dist/machine-principal/index.js +2 -0
  156. package/dist/machine-principal/index.js.map +1 -0
  157. package/dist/machine-principal/policy.d.ts +5 -0
  158. package/dist/machine-principal/policy.d.ts.map +1 -0
  159. package/dist/machine-principal/policy.js +5 -0
  160. package/dist/machine-principal/policy.js.map +1 -0
  161. package/dist/presentation/contract.d.ts +1 -0
  162. package/dist/presentation/contract.d.ts.map +1 -1
  163. package/dist/presentation/effect-schema.d.ts +1 -0
  164. package/dist/presentation/effect-schema.d.ts.map +1 -1
  165. package/dist/presentation/session-list-effect-schema.d.ts +1 -0
  166. package/dist/presentation/session-list-effect-schema.d.ts.map +1 -1
  167. package/dist/release/contract.d.ts +2 -0
  168. package/dist/release/contract.d.ts.map +1 -0
  169. package/dist/release/contract.js +4 -0
  170. package/dist/release/contract.js.map +1 -0
  171. package/dist/release/effect-schema.d.ts +3 -0
  172. package/dist/release/effect-schema.d.ts.map +1 -0
  173. package/dist/release/effect-schema.js +4 -0
  174. package/dist/release/effect-schema.js.map +1 -0
  175. package/dist/release/index.d.ts +3 -0
  176. package/dist/release/index.d.ts.map +1 -0
  177. package/dist/release/index.js +3 -0
  178. package/dist/release/index.js.map +1 -0
  179. package/dist/release/version.d.ts +29 -0
  180. package/dist/release/version.d.ts.map +1 -0
  181. package/dist/release/version.js +77 -0
  182. package/dist/release/version.js.map +1 -0
  183. package/dist/remote-node/bridge-effect-schema.d.ts +72 -2
  184. package/dist/remote-node/bridge-effect-schema.d.ts.map +1 -1
  185. package/dist/remote-node/bridge-effect-schema.js +64 -3
  186. package/dist/remote-node/bridge-effect-schema.js.map +1 -1
  187. package/dist/remote-node/contract.d.ts +163 -10
  188. package/dist/remote-node/contract.d.ts.map +1 -1
  189. package/dist/remote-node/contract.js +22 -3
  190. package/dist/remote-node/contract.js.map +1 -1
  191. package/dist/remote-node/index.d.ts +1 -1
  192. package/dist/remote-node/index.d.ts.map +1 -1
  193. package/dist/remote-node/index.js +1 -1
  194. package/dist/remote-node/index.js.map +1 -1
  195. package/dist/remote-node/request-effect-schema.d.ts +42 -0
  196. package/dist/remote-node/request-effect-schema.d.ts.map +1 -1
  197. package/dist/remote-node/request-effect-schema.js +25 -0
  198. package/dist/remote-node/request-effect-schema.js.map +1 -1
  199. package/dist/remote-node/result-effect-schema.d.ts +196 -21
  200. package/dist/remote-node/result-effect-schema.d.ts.map +1 -1
  201. package/dist/remote-node/result-effect-schema.js +42 -8
  202. package/dist/remote-node/result-effect-schema.js.map +1 -1
  203. package/dist/routine/contract.d.ts +470 -0
  204. package/dist/routine/contract.d.ts.map +1 -0
  205. package/dist/routine/contract.js +27 -0
  206. package/dist/routine/contract.js.map +1 -0
  207. package/dist/routine/effect-schema.d.ts +923 -0
  208. package/dist/routine/effect-schema.d.ts.map +1 -0
  209. package/dist/routine/effect-schema.js +268 -0
  210. package/dist/routine/effect-schema.js.map +1 -0
  211. package/dist/routine/feature.d.ts +263 -0
  212. package/dist/routine/feature.d.ts.map +1 -0
  213. package/dist/routine/feature.js +249 -0
  214. package/dist/routine/feature.js.map +1 -0
  215. package/dist/routine/index.d.ts +3 -0
  216. package/dist/routine/index.d.ts.map +1 -0
  217. package/dist/routine/index.js +3 -0
  218. package/dist/routine/index.js.map +1 -0
  219. package/dist/routine/policy.d.ts +15 -0
  220. package/dist/routine/policy.d.ts.map +1 -0
  221. package/dist/routine/policy.js +31 -0
  222. package/dist/routine/policy.js.map +1 -0
  223. package/dist/session/agent-permission-contract.d.ts +5 -5
  224. package/dist/session/agent-permission-effect-schema.d.ts +9 -9
  225. package/dist/session/contract.d.ts +64 -1
  226. package/dist/session/contract.d.ts.map +1 -1
  227. package/dist/session/contract.js +3 -1
  228. package/dist/session/contract.js.map +1 -1
  229. package/dist/session/effect-schema.d.ts +148 -5
  230. package/dist/session/effect-schema.d.ts.map +1 -1
  231. package/dist/session/effect-schema.js +57 -14
  232. package/dist/session/effect-schema.js.map +1 -1
  233. package/dist/session/feature.d.ts +83 -0
  234. package/dist/session/feature.d.ts.map +1 -1
  235. package/dist/session/feature.js +77 -0
  236. package/dist/session/feature.js.map +1 -1
  237. package/dist/session/index.d.ts +2 -2
  238. package/dist/session/index.d.ts.map +1 -1
  239. package/dist/session/index.js +2 -2
  240. package/dist/session/index.js.map +1 -1
  241. package/dist/session/policy.d.ts +33 -0
  242. package/dist/session/policy.d.ts.map +1 -1
  243. package/dist/session/policy.js +33 -0
  244. package/dist/session/policy.js.map +1 -1
  245. package/dist/session/stop-resume-contract.d.ts +2 -0
  246. package/dist/session/stop-resume-contract.d.ts.map +1 -1
  247. package/dist/session/worktree-effect-schema.d.ts +7 -0
  248. package/dist/session/worktree-effect-schema.d.ts.map +1 -1
  249. package/dist/session/worktree-effect-schema.js +14 -1
  250. package/dist/session/worktree-effect-schema.js.map +1 -1
  251. package/dist/session-guard/contract.d.ts +7 -2
  252. package/dist/session-guard/contract.d.ts.map +1 -1
  253. package/dist/session-guard/contract.js +18 -2
  254. package/dist/session-guard/contract.js.map +1 -1
  255. package/dist/team-workspace/contract.d.ts +77 -0
  256. package/dist/team-workspace/contract.d.ts.map +1 -0
  257. package/dist/team-workspace/contract.js +8 -0
  258. package/dist/team-workspace/contract.js.map +1 -0
  259. package/dist/team-workspace/effect-schema.d.ts +142 -0
  260. package/dist/team-workspace/effect-schema.d.ts.map +1 -0
  261. package/dist/team-workspace/effect-schema.js +102 -0
  262. package/dist/team-workspace/effect-schema.js.map +1 -0
  263. package/dist/team-workspace/feature.d.ts +54 -0
  264. package/dist/team-workspace/feature.d.ts.map +1 -0
  265. package/dist/team-workspace/feature.js +59 -0
  266. package/dist/team-workspace/feature.js.map +1 -0
  267. package/dist/team-workspace/index.d.ts +3 -0
  268. package/dist/team-workspace/index.d.ts.map +1 -0
  269. package/dist/team-workspace/index.js +3 -0
  270. package/dist/team-workspace/index.js.map +1 -0
  271. package/dist/team-workspace/policy.d.ts +9 -0
  272. package/dist/team-workspace/policy.d.ts.map +1 -0
  273. package/dist/team-workspace/policy.js +19 -0
  274. package/dist/team-workspace/policy.js.map +1 -0
  275. package/dist/terminal/contract.d.ts +65 -56
  276. package/dist/terminal/contract.d.ts.map +1 -1
  277. package/dist/terminal/effect-schema.d.ts +400 -382
  278. package/dist/terminal/effect-schema.d.ts.map +1 -1
  279. package/dist/terminal/effect-schema.js +12 -0
  280. package/dist/terminal/effect-schema.js.map +1 -1
  281. package/dist/terminal/index.d.ts +1 -1
  282. package/dist/terminal/index.d.ts.map +1 -1
  283. package/dist/terminal/index.js +1 -1
  284. package/dist/terminal/index.js.map +1 -1
  285. package/dist/terminal/live-effect-schema.d.ts +630 -621
  286. package/dist/terminal/live-effect-schema.d.ts.map +1 -1
  287. package/dist/terminal/live-effect-schema.js +15 -2
  288. package/dist/terminal/live-effect-schema.js.map +1 -1
  289. package/dist/terminal/live-policy.d.ts +9 -0
  290. package/dist/terminal/live-policy.d.ts.map +1 -1
  291. package/dist/terminal/live-policy.js +9 -0
  292. package/dist/terminal/live-policy.js.map +1 -1
  293. package/dist/terminal/live-types.d.ts +7 -1
  294. package/dist/terminal/live-types.d.ts.map +1 -1
  295. package/dist/turn/contract.d.ts +166 -1
  296. package/dist/turn/contract.d.ts.map +1 -1
  297. package/dist/turn/contract.js +10 -1
  298. package/dist/turn/contract.js.map +1 -1
  299. package/dist/turn/effect-schema.d.ts +325 -0
  300. package/dist/turn/effect-schema.d.ts.map +1 -1
  301. package/dist/turn/effect-schema.js +50 -2
  302. package/dist/turn/effect-schema.js.map +1 -1
  303. package/dist/turn/index.d.ts +2 -2
  304. package/dist/turn/index.d.ts.map +1 -1
  305. package/dist/turn/index.js +2 -2
  306. package/dist/turn/index.js.map +1 -1
  307. package/dist/turn/policy.d.ts +7 -0
  308. package/dist/turn/policy.d.ts.map +1 -1
  309. package/dist/turn/policy.js +7 -0
  310. package/dist/turn/policy.js.map +1 -1
  311. package/dist/voice/contract.d.ts +4 -4
  312. package/dist/voice/effect-schema.d.ts +6 -6
  313. package/dist/voice/effect-schema.d.ts.map +1 -1
  314. package/dist/voice/effect-schema.js +2 -0
  315. package/dist/voice/effect-schema.js.map +1 -1
  316. package/package.json +9 -9
@@ -1,4 +1,5 @@
1
1
  import * as Schema from "effect/Schema";
2
+ import { SESSION_EFFORT_LEVELS } from "./policy.js";
2
3
  /**
3
4
  * A person-readable Session name: one line of 1 to 80 characters without
4
5
  * surrounding spaces. Titles need not be unique; a reference to one fails
@@ -7,6 +8,11 @@ import * as Schema from "effect/Schema";
7
8
  export declare const sessionTitleEffectSchema: Schema.String;
8
9
  /** 1 to 100 items. */
9
10
  export declare const pageSizeEffectSchema: Schema.Int;
11
+ export declare const sessionExecutorKindEffectSchema: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
12
+ /** The Node issues an Agent's identifier when a person previews its creation. */
13
+ export declare const agentIdentifierEffectSchema: Schema.String;
14
+ export declare const sessionEffortEffectSchema: Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>;
15
+ export declare const supportsEffort: (kind: keyof typeof SESSION_EFFORT_LEVELS, effort: string) => boolean;
10
16
  export declare const sessionEffectSchema: Schema.Struct<{
11
17
  readonly createdAt: Schema.String;
12
18
  readonly id: Schema.String;
@@ -23,6 +29,7 @@ export declare const sessionEffectSchema: Schema.Struct<{
23
29
  }>>;
24
30
  readonly executor: Schema.optional<Schema.Struct<{
25
31
  readonly connectionId: Schema.String;
32
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
26
33
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
27
34
  readonly model: Schema.optional<Schema.String>;
28
35
  }>>;
@@ -65,6 +72,7 @@ export declare const sessionEventEffectSchema: Schema.Union<readonly [Schema.Str
65
72
  /** The account the Session binds to, named or picked by the Node. */
66
73
  readonly executor: Schema.optional<Schema.Struct<{
67
74
  readonly connectionId: Schema.String;
75
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
68
76
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
69
77
  readonly model: Schema.optional<Schema.String>;
70
78
  }>>;
@@ -265,22 +273,27 @@ export declare const sessionEventEffectSchema: Schema.Union<readonly [Schema.Str
265
273
  * A Session runs on a named account (`connectionId`), on the account the Node
266
274
  * picks for an executor kind (`executor`), or as a Maia agent, optionally from
267
275
  * an Agent definition. A gateway Connection serves any executor, so it takes
268
- * both `connectionId` and `executor`, and optionally the `model`. `role`
269
- * (default `worker`) bounds what the Session's own credential reaches.
270
- * A vendor executor Session with `worktree` is a coding Session: it gets its
271
- * own worktree from the base ref of the Workspace's repository and may write
272
- * inside it.
276
+ * both `connectionId` and `executor`, and optionally the `model`. An Agent
277
+ * (`agentId`) supplies the harness, Connection, model and effort itself, so it
278
+ * excludes every one of them. `role` (default `worker`) bounds what the
279
+ * Session's own credential reaches. A vendor executor Session with `worktree`
280
+ * is a coding Session: it gets its own worktree from the base ref of the
281
+ * Workspace's repository and may write inside it.
273
282
  */
274
283
  export declare const sessionCreateParametersEffectSchema: Schema.Struct<{
275
284
  readonly commandId: Schema.String;
276
285
  readonly expectedRevision: Schema.Literal<"0">;
277
286
  readonly workspaceId: Schema.String;
287
+ readonly agentId: Schema.optional<Schema.String>;
278
288
  readonly connectionId: Schema.optional<Schema.String>;
289
+ /** Where the Session starts; the Node checks it against the Workspace root. */
290
+ readonly cwd: Schema.optional<Schema.String>;
279
291
  readonly definitionRef: Schema.optional<Schema.Struct<{
280
292
  readonly contentDigest: Schema.String;
281
293
  readonly key: Schema.String;
282
294
  readonly version: Schema.String;
283
295
  }>>;
296
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
284
297
  readonly executor: Schema.optional<Schema.Literals<readonly ["claude-code", "codex-cli"]>>;
285
298
  readonly model: Schema.optional<Schema.String>;
286
299
  readonly role: Schema.optional<Schema.Literals<readonly ["orchestrator", "worker"]>>;
@@ -318,6 +331,12 @@ export declare const sessionListParametersEffectSchema: Schema.Struct<{
318
331
  export declare const sessionShowParametersEffectSchema: Schema.Struct<{
319
332
  readonly sessionId: Schema.String;
320
333
  }>;
334
+ export declare const sessionWaitParametersEffectSchema: Schema.Struct<{
335
+ readonly sessionId: Schema.String;
336
+ /** The wait ends when the Session is in any of these states. */
337
+ readonly states: Schema.$Array<Schema.Literals<readonly ["idle", "starting", "running", "waiting-approval", "interrupted", "recovering", "stopping", "stopped", "failed"]>>;
338
+ readonly waitMilliseconds: Schema.Int;
339
+ }>;
321
340
  export declare const sessionEventsListParametersEffectSchema: Schema.Struct<{
322
341
  readonly afterSessionCursor: Schema.String;
323
342
  readonly limit: Schema.Int;
@@ -426,6 +445,7 @@ export declare const sessionDeliveryEffectSchema: Schema.Union<readonly [Schema.
426
445
  readonly state: Schema.Literal<"acknowledged">;
427
446
  }>]>;
428
447
  export declare const sessionInboxCheckResultEffectSchema: Schema.Struct<{
448
+ readonly content: Schema.Literal<"untrusted_peer">;
429
449
  readonly deliveries: Schema.$Array<Schema.Struct<{
430
450
  readonly attemptCount: Schema.Int;
431
451
  readonly createdAt: Schema.String;
@@ -574,6 +594,7 @@ export declare const sessionCreateResultEffectSchema: Schema.Struct<{
574
594
  }>>;
575
595
  readonly executor: Schema.optional<Schema.Struct<{
576
596
  readonly connectionId: Schema.String;
597
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
577
598
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
578
599
  readonly model: Schema.optional<Schema.String>;
579
600
  }>>;
@@ -636,6 +657,7 @@ export declare const sessionSpawnResultEffectSchema: Schema.Struct<{
636
657
  }>>;
637
658
  readonly executor: Schema.optional<Schema.Struct<{
638
659
  readonly connectionId: Schema.String;
660
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
639
661
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
640
662
  readonly model: Schema.optional<Schema.String>;
641
663
  }>>;
@@ -682,6 +704,7 @@ export declare const sessionListResultEffectSchema: Schema.Struct<{
682
704
  }>>;
683
705
  readonly executor: Schema.optional<Schema.Struct<{
684
706
  readonly connectionId: Schema.String;
707
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
685
708
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
686
709
  readonly model: Schema.optional<Schema.String>;
687
710
  }>>;
@@ -727,6 +750,53 @@ export declare const sessionShowResultEffectSchema: Schema.Struct<{
727
750
  }>>;
728
751
  readonly executor: Schema.optional<Schema.Struct<{
729
752
  readonly connectionId: Schema.String;
753
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
754
+ readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
755
+ readonly model: Schema.optional<Schema.String>;
756
+ }>>;
757
+ /** Why the runtime of a failed Session failed, when Maia knows. */
758
+ readonly failure: Schema.optional<Schema.Struct<{
759
+ readonly code: Schema.String;
760
+ readonly message: Schema.String;
761
+ }>>;
762
+ readonly schemaVersion: Schema.Literal<4>;
763
+ /** Set at creation or by a rename; otherwise the first line of the first turn. */
764
+ readonly title: Schema.optional<Schema.String>;
765
+ /** A coding Session's own worktree; a reading Session has none. */
766
+ readonly worktree: Schema.optional<Schema.Struct<{
767
+ readonly baseRef: Schema.String;
768
+ readonly baseRevision: Schema.String;
769
+ readonly branch: Schema.String;
770
+ readonly setup: Schema.Literals<readonly ["none", "pending", "succeeded", "failed"]>;
771
+ readonly skills: Schema.optional<Schema.$Array<Schema.Struct<{
772
+ readonly digest: Schema.String;
773
+ readonly name: Schema.String;
774
+ }>>>;
775
+ readonly state: Schema.Literals<readonly ["active", "archived", "removed"]>;
776
+ }>>;
777
+ }>;
778
+ }>;
779
+ /** `satisfied` is false when the bounded wait ended first; `session` is then its last read. */
780
+ export declare const sessionWaitResultEffectSchema: Schema.Struct<{
781
+ readonly method: Schema.Literal<"session.wait">;
782
+ readonly satisfied: Schema.Boolean;
783
+ readonly session: Schema.Struct<{
784
+ readonly createdAt: Schema.String;
785
+ readonly id: Schema.String;
786
+ readonly projectId: Schema.String;
787
+ readonly revision: Schema.String;
788
+ readonly state: Schema.Literals<readonly ["idle", "starting", "running", "waiting-approval", "interrupted", "recovering", "stopping", "stopped", "failed"]>;
789
+ readonly updatedAt: Schema.String;
790
+ readonly workspaceId: Schema.String;
791
+ readonly workspaceRevision: Schema.String;
792
+ readonly agentDefinitionRef: Schema.optional<Schema.Struct<{
793
+ readonly contentDigest: Schema.String;
794
+ readonly key: Schema.String;
795
+ readonly version: Schema.String;
796
+ }>>;
797
+ readonly executor: Schema.optional<Schema.Struct<{
798
+ readonly connectionId: Schema.String;
799
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
730
800
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
731
801
  readonly model: Schema.optional<Schema.String>;
732
802
  }>>;
@@ -772,6 +842,7 @@ export declare const sessionEventsListResultEffectSchema: Schema.Struct<{
772
842
  /** The account the Session binds to, named or picked by the Node. */
773
843
  readonly executor: Schema.optional<Schema.Struct<{
774
844
  readonly connectionId: Schema.String;
845
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
775
846
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
776
847
  readonly model: Schema.optional<Schema.String>;
777
848
  }>>;
@@ -1007,6 +1078,7 @@ export declare const sessionStartResultEffectSchema: Schema.Struct<{
1007
1078
  }>>;
1008
1079
  readonly executor: Schema.optional<Schema.Struct<{
1009
1080
  readonly connectionId: Schema.String;
1081
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1010
1082
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1011
1083
  readonly model: Schema.optional<Schema.String>;
1012
1084
  }>>;
@@ -1067,6 +1139,7 @@ export declare const sessionStopResultEffectSchema: Schema.Struct<{
1067
1139
  }>>;
1068
1140
  readonly executor: Schema.optional<Schema.Struct<{
1069
1141
  readonly connectionId: Schema.String;
1142
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1070
1143
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1071
1144
  readonly model: Schema.optional<Schema.String>;
1072
1145
  }>>;
@@ -1127,6 +1200,7 @@ export declare const sessionResumeResultEffectSchema: Schema.Struct<{
1127
1200
  }>>;
1128
1201
  readonly executor: Schema.optional<Schema.Struct<{
1129
1202
  readonly connectionId: Schema.String;
1203
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1130
1204
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1131
1205
  readonly model: Schema.optional<Schema.String>;
1132
1206
  }>>;
@@ -1187,6 +1261,7 @@ export declare const sessionRenameResultEffectSchema: Schema.Struct<{
1187
1261
  }>>;
1188
1262
  readonly executor: Schema.optional<Schema.Struct<{
1189
1263
  readonly connectionId: Schema.String;
1264
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1190
1265
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1191
1266
  readonly model: Schema.optional<Schema.String>;
1192
1267
  }>>;
@@ -1258,6 +1333,7 @@ export declare const sessionArchiveResultEffectSchema: Schema.Struct<{
1258
1333
  }>>;
1259
1334
  readonly executor: Schema.optional<Schema.Struct<{
1260
1335
  readonly connectionId: Schema.String;
1336
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1261
1337
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1262
1338
  readonly model: Schema.optional<Schema.String>;
1263
1339
  }>>;
@@ -1289,12 +1365,16 @@ export declare const sessionRequestPayloadEffectSchema: Schema.Union<readonly [S
1289
1365
  readonly commandId: Schema.String;
1290
1366
  readonly expectedRevision: Schema.Literal<"0">;
1291
1367
  readonly workspaceId: Schema.String;
1368
+ readonly agentId: Schema.optional<Schema.String>;
1292
1369
  readonly connectionId: Schema.optional<Schema.String>;
1370
+ /** Where the Session starts; the Node checks it against the Workspace root. */
1371
+ readonly cwd: Schema.optional<Schema.String>;
1293
1372
  readonly definitionRef: Schema.optional<Schema.Struct<{
1294
1373
  readonly contentDigest: Schema.String;
1295
1374
  readonly key: Schema.String;
1296
1375
  readonly version: Schema.String;
1297
1376
  }>>;
1377
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1298
1378
  readonly executor: Schema.optional<Schema.Literals<readonly ["claude-code", "codex-cli"]>>;
1299
1379
  readonly model: Schema.optional<Schema.String>;
1300
1380
  readonly role: Schema.optional<Schema.Literals<readonly ["orchestrator", "worker"]>>;
@@ -1317,6 +1397,14 @@ export declare const sessionRequestPayloadEffectSchema: Schema.Union<readonly [S
1317
1397
  readonly parameters: Schema.Struct<{
1318
1398
  readonly sessionId: Schema.String;
1319
1399
  }>;
1400
+ }>, Schema.Struct<{
1401
+ readonly method: Schema.Literal<"session.wait">;
1402
+ readonly parameters: Schema.Struct<{
1403
+ readonly sessionId: Schema.String;
1404
+ /** The wait ends when the Session is in any of these states. */
1405
+ readonly states: Schema.$Array<Schema.Literals<readonly ["idle", "starting", "running", "waiting-approval", "interrupted", "recovering", "stopping", "stopped", "failed"]>>;
1406
+ readonly waitMilliseconds: Schema.Int;
1407
+ }>;
1320
1408
  }>, Schema.Struct<{
1321
1409
  readonly method: Schema.Literal<"session.spawn">;
1322
1410
  readonly parameters: Schema.Struct<{
@@ -1442,6 +1530,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
1442
1530
  }>>;
1443
1531
  readonly executor: Schema.optional<Schema.Struct<{
1444
1532
  readonly connectionId: Schema.String;
1533
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1445
1534
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1446
1535
  readonly model: Schema.optional<Schema.String>;
1447
1536
  }>>;
@@ -1511,6 +1600,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
1511
1600
  readonly updatedAt: Schema.String;
1512
1601
  }>;
1513
1602
  }>, Schema.Struct<{
1603
+ readonly content: Schema.Literal<"untrusted_peer">;
1514
1604
  readonly deliveries: Schema.$Array<Schema.Struct<{
1515
1605
  readonly attemptCount: Schema.Int;
1516
1606
  readonly createdAt: Schema.String;
@@ -1565,6 +1655,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
1565
1655
  }>>;
1566
1656
  readonly executor: Schema.optional<Schema.Struct<{
1567
1657
  readonly connectionId: Schema.String;
1658
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1568
1659
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1569
1660
  readonly model: Schema.optional<Schema.String>;
1570
1661
  }>>;
@@ -1675,6 +1766,51 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
1675
1766
  }>>;
1676
1767
  readonly executor: Schema.optional<Schema.Struct<{
1677
1768
  readonly connectionId: Schema.String;
1769
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1770
+ readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1771
+ readonly model: Schema.optional<Schema.String>;
1772
+ }>>;
1773
+ /** Why the runtime of a failed Session failed, when Maia knows. */
1774
+ readonly failure: Schema.optional<Schema.Struct<{
1775
+ readonly code: Schema.String;
1776
+ readonly message: Schema.String;
1777
+ }>>;
1778
+ readonly schemaVersion: Schema.Literal<4>;
1779
+ /** Set at creation or by a rename; otherwise the first line of the first turn. */
1780
+ readonly title: Schema.optional<Schema.String>;
1781
+ /** A coding Session's own worktree; a reading Session has none. */
1782
+ readonly worktree: Schema.optional<Schema.Struct<{
1783
+ readonly baseRef: Schema.String;
1784
+ readonly baseRevision: Schema.String;
1785
+ readonly branch: Schema.String;
1786
+ readonly setup: Schema.Literals<readonly ["none", "pending", "succeeded", "failed"]>;
1787
+ readonly skills: Schema.optional<Schema.$Array<Schema.Struct<{
1788
+ readonly digest: Schema.String;
1789
+ readonly name: Schema.String;
1790
+ }>>>;
1791
+ readonly state: Schema.Literals<readonly ["active", "archived", "removed"]>;
1792
+ }>>;
1793
+ }>;
1794
+ }>, Schema.Struct<{
1795
+ readonly method: Schema.Literal<"session.wait">;
1796
+ readonly satisfied: Schema.Boolean;
1797
+ readonly session: Schema.Struct<{
1798
+ readonly createdAt: Schema.String;
1799
+ readonly id: Schema.String;
1800
+ readonly projectId: Schema.String;
1801
+ readonly revision: Schema.String;
1802
+ readonly state: Schema.Literals<readonly ["idle", "starting", "running", "waiting-approval", "interrupted", "recovering", "stopping", "stopped", "failed"]>;
1803
+ readonly updatedAt: Schema.String;
1804
+ readonly workspaceId: Schema.String;
1805
+ readonly workspaceRevision: Schema.String;
1806
+ readonly agentDefinitionRef: Schema.optional<Schema.Struct<{
1807
+ readonly contentDigest: Schema.String;
1808
+ readonly key: Schema.String;
1809
+ readonly version: Schema.String;
1810
+ }>>;
1811
+ readonly executor: Schema.optional<Schema.Struct<{
1812
+ readonly connectionId: Schema.String;
1813
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1678
1814
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1679
1815
  readonly model: Schema.optional<Schema.String>;
1680
1816
  }>>;
@@ -1736,6 +1872,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
1736
1872
  }>>;
1737
1873
  readonly executor: Schema.optional<Schema.Struct<{
1738
1874
  readonly connectionId: Schema.String;
1875
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1739
1876
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1740
1877
  readonly model: Schema.optional<Schema.String>;
1741
1878
  }>>;
@@ -1780,6 +1917,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
1780
1917
  /** The account the Session binds to, named or picked by the Node. */
1781
1918
  readonly executor: Schema.optional<Schema.Struct<{
1782
1919
  readonly connectionId: Schema.String;
1920
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
1783
1921
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
1784
1922
  readonly model: Schema.optional<Schema.String>;
1785
1923
  }>>;
@@ -2014,6 +2152,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
2014
2152
  }>>;
2015
2153
  readonly executor: Schema.optional<Schema.Struct<{
2016
2154
  readonly connectionId: Schema.String;
2155
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
2017
2156
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
2018
2157
  readonly model: Schema.optional<Schema.String>;
2019
2158
  }>>;
@@ -2073,6 +2212,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
2073
2212
  }>>;
2074
2213
  readonly executor: Schema.optional<Schema.Struct<{
2075
2214
  readonly connectionId: Schema.String;
2215
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
2076
2216
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
2077
2217
  readonly model: Schema.optional<Schema.String>;
2078
2218
  }>>;
@@ -2132,6 +2272,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
2132
2272
  }>>;
2133
2273
  readonly executor: Schema.optional<Schema.Struct<{
2134
2274
  readonly connectionId: Schema.String;
2275
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
2135
2276
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
2136
2277
  readonly model: Schema.optional<Schema.String>;
2137
2278
  }>>;
@@ -2214,6 +2355,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
2214
2355
  }>>;
2215
2356
  readonly executor: Schema.optional<Schema.Struct<{
2216
2357
  readonly connectionId: Schema.String;
2358
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
2217
2359
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
2218
2360
  readonly model: Schema.optional<Schema.String>;
2219
2361
  }>>;
@@ -2273,6 +2415,7 @@ export declare const sessionSuccessResultEffectSchema: Schema.Union<readonly [Sc
2273
2415
  }>>;
2274
2416
  readonly executor: Schema.optional<Schema.Struct<{
2275
2417
  readonly connectionId: Schema.String;
2418
+ readonly effort: Schema.optional<Schema.Literals<readonly ["low", "medium", "high", "xhigh", "max", "ultra"]>>;
2276
2419
  readonly kind: Schema.Literals<readonly ["claude-code", "codex-cli"]>;
2277
2420
  readonly model: Schema.optional<Schema.String>;
2278
2421
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"effect-schema.d.ts","sourceRoot":"","sources":["../../src/session/effect-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAkExC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,eASpC,CAAC;AAEF,sBAAsB;AACtB,eAAO,MAAM,oBAAoB,YAGhC,CAAC;AAwCF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;IAI9B,mEAAmE;;;;;;IAGnE,kFAAkF;;IAElF,mEAAmE;;;;;;;;;;;;EAcpE,CAAC;AAyHF,eAAO,MAAM,wBAAwB;;;;;QApHnC,2EAA2E;;;;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AC"}
@@ -7,10 +7,10 @@ import { hasControlCharacter } from "../envelope/index.js";
7
7
  import { holdIdentifierEffectSchema } from "../hold/effect-schema.js";
8
8
  import { sessionRoleEffectSchema } from "../session-guard/effect-schema.js";
9
9
  import { sessionObserveParametersEffectSchema, sessionObserveResultEffectSchema, } from "./observation-effect-schema.js";
10
- import { MAX_SESSION_INBOX_CHECK_LIMIT, MAX_SESSION_MESSAGE_BODY_BYTES, MAX_SESSION_MESSAGE_SUBJECT_BYTES, MAX_SESSION_TITLE_LENGTH, SESSION_ATTENTION_VALUES, } from "./policy.js";
10
+ import { MAX_SESSION_INBOX_CHECK_LIMIT, MAX_SESSION_MESSAGE_BODY_BYTES, MAX_SESSION_MESSAGE_SUBJECT_BYTES, MAX_SESSION_TITLE_LENGTH, MAX_SESSION_WAIT_MILLISECONDS, MAX_SESSION_WAIT_STATES, SESSION_ATTENTION_VALUES, SESSION_EFFORT_LEVELS, } from "./policy.js";
11
11
  import { sessionTurnEventEffectSchema } from "./turn-event-effect-schema.js";
12
12
  import { SESSION_EVENT_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, } from "./version.js";
13
- import { sessionArchiveEffectSchema, sessionArchiveParametersEffectSchema, sessionDiffParametersEffectSchema, sessionDiffResultEffectSchema, sessionWorktreeCreatedEffectSchema, sessionWorktreeEffectSchema, sessionWorktreeRemovedEffectSchema, sessionWorktreeRequestEffectSchema, } from "./worktree-effect-schema.js";
13
+ import { sessionArchiveEffectSchema, sessionArchiveParametersEffectSchema, sessionDiffParametersEffectSchema, sessionDiffResultEffectSchema, sessionStartDirectoryEffectSchema, sessionWorktreeCreatedEffectSchema, sessionWorktreeEffectSchema, sessionWorktreeRemovedEffectSchema, sessionWorktreeRequestEffectSchema, } from "./worktree-effect-schema.js";
14
14
  const MAX_PAGE_SIZE = 100;
15
15
  const MAX_EVENT_PAGE_SIZE = 32;
16
16
  const utf8 = new TextEncoder();
@@ -51,19 +51,25 @@ const sessionBaseFields = {
51
51
  workspaceId: protocolIdentifierEffectSchema,
52
52
  workspaceRevision: revisionEffectSchema,
53
53
  };
54
- const sessionExecutorKindEffectSchema = Schema.Literals([
54
+ export const sessionExecutorKindEffectSchema = Schema.Literals([
55
55
  "claude-code",
56
56
  "codex-cli",
57
57
  ]);
58
+ /** The Node issues an Agent's identifier when a person previews its creation. */
59
+ export const agentIdentifierEffectSchema = protocolIdentifierEffectSchema.check(Schema.isPattern(/^agent_[a-f0-9]{32}$/u));
60
+ export const sessionEffortEffectSchema = Schema.Literals(SESSION_EFFORT_LEVELS["codex-cli"]);
61
+ export const supportsEffort = (kind, effort) => SESSION_EFFORT_LEVELS[kind].includes(effort);
58
62
  /**
59
63
  * Creation binds a vendor executor Session to one named account, once. A
60
- * Session on a gateway Connection may also fix the model the gateway serves.
64
+ * Session on a gateway Connection may also fix the model the gateway serves,
65
+ * and any executor Session may fix the effort its vendor CLI documents.
61
66
  */
62
67
  const sessionExecutorEffectSchema = Schema.Struct({
63
68
  connectionId: protocolIdentifierEffectSchema,
69
+ effort: Schema.optional(sessionEffortEffectSchema),
64
70
  kind: sessionExecutorKindEffectSchema,
65
71
  model: Schema.optional(connectionModelIdEffectSchema),
66
- });
72
+ }).check(Schema.makeFilter((value) => value.effort === undefined || supportsEffort(value.kind, value.effort), { expected: "an effort level the executor kind supports" }));
67
73
  export const sessionEffectSchema = Schema.Struct({
68
74
  ...sessionBaseFields,
69
75
  agentDefinitionRef: Schema.optional(agentDefinitionReferenceEffectSchema),
@@ -159,28 +165,47 @@ const sessionCreateBaseFields = {
159
165
  * A Session runs on a named account (`connectionId`), on the account the Node
160
166
  * picks for an executor kind (`executor`), or as a Maia agent, optionally from
161
167
  * an Agent definition. A gateway Connection serves any executor, so it takes
162
- * both `connectionId` and `executor`, and optionally the `model`. `role`
163
- * (default `worker`) bounds what the Session's own credential reaches.
164
- * A vendor executor Session with `worktree` is a coding Session: it gets its
165
- * own worktree from the base ref of the Workspace's repository and may write
166
- * inside it.
168
+ * both `connectionId` and `executor`, and optionally the `model`. An Agent
169
+ * (`agentId`) supplies the harness, Connection, model and effort itself, so it
170
+ * excludes every one of them. `role` (default `worker`) bounds what the
171
+ * Session's own credential reaches. A vendor executor Session with `worktree`
172
+ * is a coding Session: it gets its own worktree from the base ref of the
173
+ * Workspace's repository and may write inside it.
167
174
  */
168
175
  export const sessionCreateParametersEffectSchema = Schema.Struct({
169
176
  ...sessionCreateBaseFields,
177
+ agentId: Schema.optional(agentIdentifierEffectSchema),
170
178
  connectionId: Schema.optional(protocolIdentifierEffectSchema),
179
+ /** Where the Session starts; the Node checks it against the Workspace root. */
180
+ cwd: Schema.optional(sessionStartDirectoryEffectSchema),
171
181
  definitionRef: Schema.optional(agentDefinitionReferenceEffectSchema),
182
+ effort: Schema.optional(sessionEffortEffectSchema),
172
183
  executor: Schema.optional(sessionExecutorKindEffectSchema),
173
184
  model: Schema.optional(connectionModelIdEffectSchema),
174
185
  role: Schema.optional(sessionRoleEffectSchema),
175
186
  title: Schema.optional(sessionTitleEffectSchema),
176
187
  worktree: Schema.optional(sessionWorktreeRequestEffectSchema),
177
- }).check(Schema.makeFilter((value) => (value.definitionRef === undefined ||
178
- (value.connectionId === undefined && value.executor === undefined)) &&
188
+ }).check(Schema.makeFilter((value) => (value.agentId === undefined ||
189
+ (value.connectionId === undefined &&
190
+ value.definitionRef === undefined &&
191
+ value.effort === undefined &&
192
+ value.executor === undefined &&
193
+ value.model === undefined)) &&
194
+ (value.definitionRef === undefined ||
195
+ (value.connectionId === undefined && value.executor === undefined)) &&
179
196
  (value.model === undefined || value.connectionId !== undefined) &&
197
+ (value.effort === undefined ||
198
+ ((value.connectionId !== undefined || value.executor !== undefined) &&
199
+ (value.executor === undefined ||
200
+ supportsEffort(value.executor, value.effort)))) &&
180
201
  (value.worktree === undefined ||
202
+ value.agentId !== undefined ||
181
203
  value.connectionId !== undefined ||
182
- value.executor !== undefined), {
183
- expected: "an Agent definition alone, or an executor connection or kind; a model only with a connection; a worktree only for an executor Session",
204
+ value.executor !== undefined) &&
205
+ (value.cwd === undefined ||
206
+ ((value.connectionId !== undefined || value.executor !== undefined) &&
207
+ (value.worktree === undefined || !value.cwd.startsWith("/")))), {
208
+ expected: "an Agent alone, an Agent definition alone, or an executor connection or kind; a model only with a connection; an effort only for an executor Session, at a level its kind supports; a worktree only for an executor Session or an Agent; a start directory only for an executor Session, relative to the worktree when there is one",
184
209
  }));
185
210
  const sessionSpawnHarnessEffectSchema = Schema.Literals(["maia-agent", "pi"]);
186
211
  export const sessionSpawnParametersEffectSchema = Schema.Struct({
@@ -206,6 +231,12 @@ export const sessionListParametersEffectSchema = Schema.Struct({
206
231
  export const sessionShowParametersEffectSchema = Schema.Struct({
207
232
  sessionId: protocolIdentifierEffectSchema,
208
233
  });
234
+ export const sessionWaitParametersEffectSchema = Schema.Struct({
235
+ sessionId: protocolIdentifierEffectSchema,
236
+ /** The wait ends when the Session is in any of these states. */
237
+ states: Schema.Array(sessionStateEffectSchema).check(Schema.isMinLength(1), Schema.isMaxLength(MAX_SESSION_WAIT_STATES)),
238
+ waitMilliseconds: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(MAX_SESSION_WAIT_MILLISECONDS)),
239
+ });
209
240
  export const sessionEventsListParametersEffectSchema = Schema.Struct({
210
241
  afterSessionCursor: revisionEffectSchema,
211
242
  limit: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(MAX_EVENT_PAGE_SIZE)),
@@ -296,6 +327,7 @@ const deliveryMatchesMailbox = (delivery, mailbox) => delivery.mailboxId === mai
296
327
  delivery.message.recipientSessionId === mailbox.sessionId &&
297
328
  delivery.message.workspaceId === mailbox.workspaceId;
298
329
  export const sessionInboxCheckResultEffectSchema = Schema.Struct({
330
+ content: Schema.Literal("untrusted_peer"),
299
331
  deliveries: Schema.Array(pendingSessionDeliveryEffectSchema).check(Schema.isMaxLength(MAX_SESSION_INBOX_CHECK_LIMIT)),
300
332
  mailbox: sessionMailboxEffectSchema,
301
333
  method: Schema.Literal("session.inbox.check"),
@@ -366,6 +398,12 @@ export const sessionShowResultEffectSchema = Schema.Struct({
366
398
  method: Schema.Literal("session.show"),
367
399
  session: sessionEffectSchema,
368
400
  });
401
+ /** `satisfied` is false when the bounded wait ended first; `session` is then its last read. */
402
+ export const sessionWaitResultEffectSchema = Schema.Struct({
403
+ method: Schema.Literal("session.wait"),
404
+ satisfied: Schema.Boolean,
405
+ session: sessionEffectSchema,
406
+ });
369
407
  export const sessionEventsListResultEffectSchema = Schema.Struct({
370
408
  headSessionCursor: revisionEffectSchema,
371
409
  items: Schema.Array(sessionEventEffectSchema).check(Schema.isMaxLength(MAX_EVENT_PAGE_SIZE)),
@@ -433,6 +471,10 @@ export const sessionRequestPayloadEffectSchema = Schema.Union([
433
471
  method: Schema.Literal("session.show"),
434
472
  parameters: sessionShowParametersEffectSchema,
435
473
  }),
474
+ Schema.Struct({
475
+ method: Schema.Literal("session.wait"),
476
+ parameters: sessionWaitParametersEffectSchema,
477
+ }),
436
478
  Schema.Struct({
437
479
  method: Schema.Literal("session.spawn"),
438
480
  parameters: sessionSpawnParametersEffectSchema,
@@ -490,6 +532,7 @@ export const sessionSuccessResultEffectSchema = Schema.Union([
490
532
  sessionMessageSendResultEffectSchema,
491
533
  sessionObserveResultEffectSchema,
492
534
  sessionShowResultEffectSchema,
535
+ sessionWaitResultEffectSchema,
493
536
  sessionSpawnResultEffectSchema,
494
537
  sessionEventsListResultEffectSchema,
495
538
  sessionStartResultEffectSchema,