@maiaos/protocol 0.1.0-canary.44938d4.manual.1

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 (246) hide show
  1. package/README.md +239 -0
  2. package/dist/aggregate/revision-effect-schema.d.ts +3 -0
  3. package/dist/aggregate/revision-effect-schema.d.ts.map +1 -0
  4. package/dist/aggregate/revision-effect-schema.js +4 -0
  5. package/dist/aggregate/revision-effect-schema.js.map +1 -0
  6. package/dist/capability.d.ts +12 -0
  7. package/dist/capability.d.ts.map +1 -0
  8. package/dist/capability.js +27 -0
  9. package/dist/capability.js.map +1 -0
  10. package/dist/command-receipt/contract.d.ts +85 -0
  11. package/dist/command-receipt/contract.d.ts.map +1 -0
  12. package/dist/command-receipt/contract.js +12 -0
  13. package/dist/command-receipt/contract.js.map +1 -0
  14. package/dist/command-receipt/effect-schema.d.ts +78 -0
  15. package/dist/command-receipt/effect-schema.d.ts.map +1 -0
  16. package/dist/command-receipt/effect-schema.js +72 -0
  17. package/dist/command-receipt/effect-schema.js.map +1 -0
  18. package/dist/command-receipt/policy.d.ts +16 -0
  19. package/dist/command-receipt/policy.d.ts.map +1 -0
  20. package/dist/command-receipt/policy.js +76 -0
  21. package/dist/command-receipt/policy.js.map +1 -0
  22. package/dist/command-receipt/version.d.ts +2 -0
  23. package/dist/command-receipt/version.d.ts.map +1 -0
  24. package/dist/command-receipt/version.js +2 -0
  25. package/dist/command-receipt/version.js.map +1 -0
  26. package/dist/configuration.d.ts +63 -0
  27. package/dist/configuration.d.ts.map +1 -0
  28. package/dist/configuration.js +93 -0
  29. package/dist/configuration.js.map +1 -0
  30. package/dist/envelope-effect-schema.d.ts +49 -0
  31. package/dist/envelope-effect-schema.d.ts.map +1 -0
  32. package/dist/envelope-effect-schema.js +50 -0
  33. package/dist/envelope-effect-schema.js.map +1 -0
  34. package/dist/envelope-policy.d.ts +4 -0
  35. package/dist/envelope-policy.d.ts.map +1 -0
  36. package/dist/envelope-policy.js +4 -0
  37. package/dist/envelope-policy.js.map +1 -0
  38. package/dist/envelope.d.ts +52 -0
  39. package/dist/envelope.d.ts.map +1 -0
  40. package/dist/envelope.js +41 -0
  41. package/dist/envelope.js.map +1 -0
  42. package/dist/execution/contract.d.ts +230 -0
  43. package/dist/execution/contract.d.ts.map +1 -0
  44. package/dist/execution/contract.js +16 -0
  45. package/dist/execution/contract.js.map +1 -0
  46. package/dist/execution/effect-schema.d.ts +370 -0
  47. package/dist/execution/effect-schema.d.ts.map +1 -0
  48. package/dist/execution/effect-schema.js +148 -0
  49. package/dist/execution/effect-schema.js.map +1 -0
  50. package/dist/execution/version.d.ts +5 -0
  51. package/dist/execution/version.d.ts.map +1 -0
  52. package/dist/execution/version.js +5 -0
  53. package/dist/execution/version.js.map +1 -0
  54. package/dist/harness/installed/contract.d.ts +144 -0
  55. package/dist/harness/installed/contract.d.ts.map +1 -0
  56. package/dist/harness/installed/contract.js +6 -0
  57. package/dist/harness/installed/contract.js.map +1 -0
  58. package/dist/harness/installed/effect-schema.d.ts +261 -0
  59. package/dist/harness/installed/effect-schema.d.ts.map +1 -0
  60. package/dist/harness/installed/effect-schema.js +63 -0
  61. package/dist/harness/installed/effect-schema.js.map +1 -0
  62. package/dist/harness/installed/version.d.ts +2 -0
  63. package/dist/harness/installed/version.d.ts.map +1 -0
  64. package/dist/harness/installed/version.js +2 -0
  65. package/dist/harness/installed/version.js.map +1 -0
  66. package/dist/index.d.ts +18 -0
  67. package/dist/index.d.ts.map +1 -0
  68. package/dist/index.js +18 -0
  69. package/dist/index.js.map +1 -0
  70. package/dist/integration-authorization/contract.d.ts +3495 -0
  71. package/dist/integration-authorization/contract.d.ts.map +1 -0
  72. package/dist/integration-authorization/contract.js +25 -0
  73. package/dist/integration-authorization/contract.js.map +1 -0
  74. package/dist/integration-authorization/effect-schema.d.ts +4495 -0
  75. package/dist/integration-authorization/effect-schema.d.ts.map +1 -0
  76. package/dist/integration-authorization/effect-schema.js +293 -0
  77. package/dist/integration-authorization/effect-schema.js.map +1 -0
  78. package/dist/integration-authorization/policy.d.ts +5 -0
  79. package/dist/integration-authorization/policy.d.ts.map +1 -0
  80. package/dist/integration-authorization/policy.js +5 -0
  81. package/dist/integration-authorization/policy.js.map +1 -0
  82. package/dist/integration-authorization/version.d.ts +2 -0
  83. package/dist/integration-authorization/version.d.ts.map +1 -0
  84. package/dist/integration-authorization/version.js +2 -0
  85. package/dist/integration-authorization/version.js.map +1 -0
  86. package/dist/invocation-context/contract.d.ts +38 -0
  87. package/dist/invocation-context/contract.d.ts.map +1 -0
  88. package/dist/invocation-context/contract.js +7 -0
  89. package/dist/invocation-context/contract.js.map +1 -0
  90. package/dist/invocation-context/effect-schema.d.ts +63 -0
  91. package/dist/invocation-context/effect-schema.d.ts.map +1 -0
  92. package/dist/invocation-context/effect-schema.js +52 -0
  93. package/dist/invocation-context/effect-schema.js.map +1 -0
  94. package/dist/invocation-context/policy.d.ts +8 -0
  95. package/dist/invocation-context/policy.d.ts.map +1 -0
  96. package/dist/invocation-context/policy.js +8 -0
  97. package/dist/invocation-context/policy.js.map +1 -0
  98. package/dist/invocation-context/version.d.ts +2 -0
  99. package/dist/invocation-context/version.d.ts.map +1 -0
  100. package/dist/invocation-context/version.js +2 -0
  101. package/dist/invocation-context/version.js.map +1 -0
  102. package/dist/local-node/contract.d.ts +233 -0
  103. package/dist/local-node/contract.d.ts.map +1 -0
  104. package/dist/local-node/contract.js +43 -0
  105. package/dist/local-node/contract.js.map +1 -0
  106. package/dist/local-node/effect-schema.d.ts +58786 -0
  107. package/dist/local-node/effect-schema.d.ts.map +1 -0
  108. package/dist/local-node/effect-schema.js +279 -0
  109. package/dist/local-node/effect-schema.js.map +1 -0
  110. package/dist/local-node/methods.d.ts +4 -0
  111. package/dist/local-node/methods.d.ts.map +1 -0
  112. package/dist/local-node/methods.js +73 -0
  113. package/dist/local-node/methods.js.map +1 -0
  114. package/dist/local-node/policy.d.ts +11 -0
  115. package/dist/local-node/policy.d.ts.map +1 -0
  116. package/dist/local-node/policy.js +11 -0
  117. package/dist/local-node/policy.js.map +1 -0
  118. package/dist/local-node.d.ts +2 -0
  119. package/dist/local-node.d.ts.map +1 -0
  120. package/dist/local-node.js +2 -0
  121. package/dist/local-node.js.map +1 -0
  122. package/dist/orchestration/canonical.d.ts +12 -0
  123. package/dist/orchestration/canonical.d.ts.map +1 -0
  124. package/dist/orchestration/canonical.js +50 -0
  125. package/dist/orchestration/canonical.js.map +1 -0
  126. package/dist/orchestration/contract.d.ts +2867 -0
  127. package/dist/orchestration/contract.d.ts.map +1 -0
  128. package/dist/orchestration/contract.js +45 -0
  129. package/dist/orchestration/contract.js.map +1 -0
  130. package/dist/orchestration/effect-schema.d.ts +4933 -0
  131. package/dist/orchestration/effect-schema.d.ts.map +1 -0
  132. package/dist/orchestration/effect-schema.js +610 -0
  133. package/dist/orchestration/effect-schema.js.map +1 -0
  134. package/dist/orchestration/policy.d.ts +28 -0
  135. package/dist/orchestration/policy.d.ts.map +1 -0
  136. package/dist/orchestration/policy.js +28 -0
  137. package/dist/orchestration/policy.js.map +1 -0
  138. package/dist/orchestration/topology.d.ts +13 -0
  139. package/dist/orchestration/topology.d.ts.map +1 -0
  140. package/dist/orchestration/topology.js +109 -0
  141. package/dist/orchestration/topology.js.map +1 -0
  142. package/dist/orchestration/version.d.ts +3 -0
  143. package/dist/orchestration/version.d.ts.map +1 -0
  144. package/dist/orchestration/version.js +3 -0
  145. package/dist/orchestration/version.js.map +1 -0
  146. package/dist/project-workspace/contract.d.ts +346 -0
  147. package/dist/project-workspace/contract.d.ts.map +1 -0
  148. package/dist/project-workspace/contract.js +20 -0
  149. package/dist/project-workspace/contract.js.map +1 -0
  150. package/dist/project-workspace/effect-schema.d.ts +602 -0
  151. package/dist/project-workspace/effect-schema.d.ts.map +1 -0
  152. package/dist/project-workspace/effect-schema.js +185 -0
  153. package/dist/project-workspace/effect-schema.js.map +1 -0
  154. package/dist/project-workspace/version.d.ts +5 -0
  155. package/dist/project-workspace/version.d.ts.map +1 -0
  156. package/dist/project-workspace/version.js +5 -0
  157. package/dist/project-workspace/version.js.map +1 -0
  158. package/dist/runtime/contract.d.ts +172 -0
  159. package/dist/runtime/contract.d.ts.map +1 -0
  160. package/dist/runtime/contract.js +6 -0
  161. package/dist/runtime/contract.js.map +1 -0
  162. package/dist/runtime/effect-schema.d.ts +211 -0
  163. package/dist/runtime/effect-schema.d.ts.map +1 -0
  164. package/dist/runtime/effect-schema.js +137 -0
  165. package/dist/runtime/effect-schema.js.map +1 -0
  166. package/dist/runtime/version.d.ts +2 -0
  167. package/dist/runtime/version.d.ts.map +1 -0
  168. package/dist/runtime/version.js +2 -0
  169. package/dist/runtime/version.js.map +1 -0
  170. package/dist/runtime-schema-effect.d.ts +4 -0
  171. package/dist/runtime-schema-effect.d.ts.map +1 -0
  172. package/dist/runtime-schema-effect.js +25 -0
  173. package/dist/runtime-schema-effect.js.map +1 -0
  174. package/dist/runtime-schema.d.ts +23 -0
  175. package/dist/runtime-schema.d.ts.map +1 -0
  176. package/dist/runtime-schema.js +12 -0
  177. package/dist/runtime-schema.js.map +1 -0
  178. package/dist/session/contract.d.ts +666 -0
  179. package/dist/session/contract.d.ts.map +1 -0
  180. package/dist/session/contract.js +16 -0
  181. package/dist/session/contract.js.map +1 -0
  182. package/dist/session/effect-schema.d.ts +1176 -0
  183. package/dist/session/effect-schema.d.ts.map +1 -0
  184. package/dist/session/effect-schema.js +195 -0
  185. package/dist/session/effect-schema.js.map +1 -0
  186. package/dist/session/version.d.ts +4 -0
  187. package/dist/session/version.d.ts.map +1 -0
  188. package/dist/session/version.js +4 -0
  189. package/dist/session/version.js.map +1 -0
  190. package/dist/temporal/recorded-at.d.ts +3 -0
  191. package/dist/temporal/recorded-at.d.ts.map +1 -0
  192. package/dist/temporal/recorded-at.js +13 -0
  193. package/dist/temporal/recorded-at.js.map +1 -0
  194. package/dist/terminal/contract.d.ts +3502 -0
  195. package/dist/terminal/contract.d.ts.map +1 -0
  196. package/dist/terminal/contract.js +31 -0
  197. package/dist/terminal/contract.js.map +1 -0
  198. package/dist/terminal/effect-schema.d.ts +15745 -0
  199. package/dist/terminal/effect-schema.d.ts.map +1 -0
  200. package/dist/terminal/effect-schema.js +193 -0
  201. package/dist/terminal/effect-schema.js.map +1 -0
  202. package/dist/terminal/live-contract.d.ts +87 -0
  203. package/dist/terminal/live-contract.d.ts.map +1 -0
  204. package/dist/terminal/live-contract.js +52 -0
  205. package/dist/terminal/live-contract.js.map +1 -0
  206. package/dist/terminal/live-effect-schema.d.ts +24770 -0
  207. package/dist/terminal/live-effect-schema.d.ts.map +1 -0
  208. package/dist/terminal/live-effect-schema.js +987 -0
  209. package/dist/terminal/live-effect-schema.js.map +1 -0
  210. package/dist/terminal/live-policy.d.ts +79 -0
  211. package/dist/terminal/live-policy.d.ts.map +1 -0
  212. package/dist/terminal/live-policy.js +91 -0
  213. package/dist/terminal/live-policy.js.map +1 -0
  214. package/dist/terminal/live-types.d.ts +584 -0
  215. package/dist/terminal/live-types.d.ts.map +1 -0
  216. package/dist/terminal/live-types.js +2 -0
  217. package/dist/terminal/live-types.js.map +1 -0
  218. package/dist/terminal/live-version.d.ts +4 -0
  219. package/dist/terminal/live-version.d.ts.map +1 -0
  220. package/dist/terminal/live-version.js +4 -0
  221. package/dist/terminal/live-version.js.map +1 -0
  222. package/dist/terminal/policy.d.ts +5 -0
  223. package/dist/terminal/policy.d.ts.map +1 -0
  224. package/dist/terminal/policy.js +5 -0
  225. package/dist/terminal/policy.js.map +1 -0
  226. package/dist/terminal/version.d.ts +4 -0
  227. package/dist/terminal/version.d.ts.map +1 -0
  228. package/dist/terminal/version.js +4 -0
  229. package/dist/terminal/version.js.map +1 -0
  230. package/dist/turn/contract.d.ts +493 -0
  231. package/dist/turn/contract.d.ts.map +1 -0
  232. package/dist/turn/contract.js +14 -0
  233. package/dist/turn/contract.js.map +1 -0
  234. package/dist/turn/effect-schema.d.ts +1063 -0
  235. package/dist/turn/effect-schema.d.ts.map +1 -0
  236. package/dist/turn/effect-schema.js +215 -0
  237. package/dist/turn/effect-schema.js.map +1 -0
  238. package/dist/turn/policy.d.ts +3 -0
  239. package/dist/turn/policy.d.ts.map +1 -0
  240. package/dist/turn/policy.js +3 -0
  241. package/dist/turn/policy.js.map +1 -0
  242. package/dist/turn/version.d.ts +2 -0
  243. package/dist/turn/version.d.ts.map +1 -0
  244. package/dist/turn/version.js +2 -0
  245. package/dist/turn/version.js.map +1 -0
  246. package/package.json +40 -0
package/README.md ADDED
@@ -0,0 +1,239 @@
1
+ # `@maiaos/protocol`
2
+
3
+ > **Publication status:** Source-implemented candidate, canary-only. npm
4
+ > canaries use the
5
+ > `canary` dist-tag for installation evidence and remain
6
+ > `releaseQualified: false`. No stable version or `latest` dist-tag is
7
+ > released.
8
+
9
+ Runtime-validated foundations for Maia protocol messages.
10
+
11
+ `@maiaos/protocol` is the framework-neutral schema source of truth, not the
12
+ application client facade. Desktop, web, mobile, and CLI code consume these
13
+ contracts through `@maiaos/sdk`; they do not implement independent node
14
+ transports.
15
+
16
+ The implemented surface is intentionally small: the alpha protocol version,
17
+ generic request/response/event envelope metadata, structured response errors,
18
+ a bounded list of versioned capability descriptors, the versioned file-first
19
+ configuration document schema, and the private desktop-local lifecycle
20
+ messages. It exports validated configuration identifiers, includes, runtime
21
+ preferences, capability requests, opaque secret references, readiness,
22
+ authentication, `node.status`, `node.shutdown`, lifecycle, response, and
23
+ framing limits. `node.status` includes a compact bounded process-resource
24
+ projection: active/tracked/watcher counts, immediate non-queued admission,
25
+ fenced/cleanup-unknown counts, capability and pressure enums, and one bounded
26
+ next-step code. It also carries one bounded latest-target observation summary
27
+ for CPU, RSS/peak RSS, process count, file descriptors, and read/write I/O,
28
+ including partial/unavailable coverage and per-tree-limit warning counts where
29
+ a budget exists. Ordinary Darwin-arm64 composition now projects the `macos_cooperative` variant
30
+ after verifying the embedded sibling helper during layer acquisition. The
31
+ variant explicitly says sampled, cooperative, no hard limits, no
32
+ observed-pressure auto-termination, `sourceCandidate: true`, and
33
+ `releaseQualified: false`; it does not imply that a process consumer is
34
+ admitted. It also owns the versioned project, repository, workspace,
35
+ check-out, mutation receipt, keyed `receipt.get` recovery, and bounded
36
+ `receipt.list` contracts used by the first durable CLI/node slice.
37
+ `receipt.list` is an ordinary read: default page 8, maximum 32, maximum
38
+ encoded page 64 KiB, optional `actor`, `afterCursor`, `method`, and inclusive
39
+ `since`/`until`. Items project `commandId`, `createdAt`, `method`,
40
+ `receiptId`, `state`, and `target.{id,type}` and omit `result`. `receipt.get`
41
+ is unchanged and still carries `result`. Classified help may mark the CLI
42
+ surface `implemented`; the public v1 line remains a source-implemented
43
+ candidate and is not release-qualified. It also owns strict versioned session create, start,
44
+ list, show, and event-page contracts with explicit global and session-local
45
+ cursors. Session events expose start request, runtime start/resume/failure, and
46
+ recovery-request outcomes; native runtime identifiers stay private to the node.
47
+ The source also owns schema-v6 `turn.send`/`turn.show`/`turn.interrupt`, bounded
48
+ turn lifecycle, content projection, token-usage, and session-turn event
49
+ contracts. They are source-implemented public contract candidates, not
50
+ release-qualified or enabled product behavior. `turn.interrupt` is a
51
+ runtime-discriminated release-disabled wire candidate: ordinary node/SDK/CLI
52
+ routing is callable for an exact active Pi conversation authorization, while
53
+ Codex remains limited to its internal test authority. Steer,
54
+ `session.interrupt`, approvals, and structured Session attachments remain
55
+ unimplemented. Schema v7 introduced the terminal availability aggregate; schema v9
56
+ extends it with the macOS live-terminal source candidate. Schema v10 is the
57
+ node's index-only receipt-list storage migration and does not rewrite this
58
+ terminal contract; see the [node README](../../services/node/README.md).
59
+ Its exact 13 active
60
+ public methods are `terminal.create`, `terminal.list`, `terminal.show`,
61
+ `terminal.events.list`, `terminal.read`, `terminal.controller.request`,
62
+ `terminal.controller.request.show`, `terminal.controller.acquire`,
63
+ `terminal.controller.release`, `terminal.input.write`,
64
+ `terminal.session.resize`, `terminal.session.signal`, and
65
+ `terminal.session.close`. Observer
66
+ attach/check/detach/resync, controller renew, restart, delete, and mutation
67
+ reconcile schemas exist only for the wider contract and remain unavailable or
68
+ inert at the node boundary. The active source candidate is real-boundary
69
+ proven but not release-qualified product behavior. Approvals, structured
70
+ Session attachment, and remote transport schemas remain planned.
71
+
72
+ It also owns the versioned ordinary-read `harness.installed.list` contract:
73
+ exact empty parameters and a schema-v1 four-item catalog projection for
74
+ Codex, Grok, Mistral Vibe, and Pi. Detection, selection, and authorization
75
+ remain independent facts; `selected` and `authorized` are literal `false`,
76
+ and paths, versions, identities, credentials, and launch state stay off the
77
+ wire. The method joins the ordinary local-node request and success unions. It
78
+ is a source-implemented protocol candidate. The authenticated node handler,
79
+ `@maiaos/sdk` `listInstalledHarnesses`, and `maia runtime list` now project that
80
+ same ordinary read as a blocked, release-disabled candidate. The protocol
81
+ module still owns only the wire contract; it is not a mutation or
82
+ release-qualified product behavior.
83
+
84
+ The source now owns the release-disabled Pi RPC protocol candidates
85
+ `integration.plan.pi-rpc`, `integration.apply.pi-rpc`,
86
+ `integration.status.pi-rpc`, `integration.remove.pi-rpc`, and the `pi-rpc`
87
+ variant of `runtime.probe`. Plan/status preserve the exact Node interpreter, Pi
88
+ entry, and bounded package closure/manifest identity required by ADR-009;
89
+ requests accept no path or identity authority. Plan/status expose the exact
90
+ owner set `pi-rpc-probe`, `pi-rpc-session` and
91
+ `conversationPolicyRevision`. The probe result remains fixed to one
92
+ request-scoped probe, exact disable-automatic-work/`get_state` operations,
93
+ `modelTurn: false`, and `releaseQualified: false`.
94
+
95
+ Session protocol v3 adds exact correlated `runtime`/`profile` fields for
96
+ `codex`/`codex` and `pi`/`pi-rpc`; legacy Codex v2 events remain decodable.
97
+ The shared Session and Turn methods cover Pi create/start/list/show/events and
98
+ send/show/interrupt without a parallel Pi command family. Turn content remains
99
+ bounded and assistant completion is represented durably, but the protocol
100
+ grants no executable, native-file, workspace path, tool, approval, credential,
101
+ provider, or release authority. These are release-disabled wire candidates;
102
+ node policy and authorization remain the enforcement boundary.
103
+
104
+ The source now also owns `maia.integration-authorization/v1` and the four
105
+ strict local-node methods `integration.plan.codex`, `integration.apply.codex`,
106
+ `integration.status.codex`, and `integration.remove.codex`. Request schemas
107
+ accept only the fixed `codex` identity, plan ID, and stable command ID where
108
+ needed; executable paths, digests, owner allowlists, adapters, and policy
109
+ revisions are rejected as caller authority. Plans are bounded to 8 KiB, status
110
+ is exactly one item and at most 2 KiB, authorization states preserve
111
+ `revoking` and `cleanup_unknown`, and every result fixes
112
+ `releaseQualified: false`. Apply/remove carry durable receipt projections;
113
+ remove preserves both definite `revoked` and uncertain `cleanup_unknown`
114
+ outcomes. The wire path is source-qualified through the exact built lifecycle
115
+ at revision `80631fb5c9adeb38ab58b12a7db80647161d5871`. These remain
116
+ release-disabled candidates, not Codex product enablement or release
117
+ qualification.
118
+
119
+ The source also owns the strict `maia.orchestration/v1` candidate and twelve
120
+ local-node methods for bounded Run creation/list/show, Run-scoped compact Task
121
+ list, Run-scoped Task show, Run-scoped Dispatch show, Run/Dispatch inbox check/individual acknowledgement, coordinator
122
+ Question open/reply/cancel, and unavailable-Terminal Dispatch settlement.
123
+ `run.list` is a workspace-scoped page of compact Run records with an opaque
124
+ sequence cursor. `run.task.list` is a Run-scoped, oldest-first page of
125
+ objective-free Task summaries with the same cursor family. `run.task.show` is
126
+ the keyed list sibling that returns one full `OrchestrationTask`, including
127
+ its objective, without the Run aggregate. `run.dispatch.show` is the keyed
128
+ Run-scoped sibling that returns the one existing `OrchestrationDispatch`
129
+ without the Run aggregate, worker assignment, or preamble. The family's
130
+ canonical validator enforces
131
+ per-field plus aggregate UTF-8/encoded bounds and the longest path through a
132
+ converging DAG before transport or storage. Public local-node request/result
133
+ facades are compile-time checked in both directions against private Effect
134
+ Schema inference, and runtime excess-property tests prevent a caller-supplied
135
+ Question sender. Worker/lease, Gate, watch/wait, execution, automation, and
136
+ remote-principal contracts are not present; orchestration gains no direct
137
+ terminal-control authority from the separate live-terminal candidate.
138
+
139
+ The source also owns the bounded `maia.execution/v1alpha1` W0a candidate and
140
+ three local-node methods: `execution.catalog.get`,
141
+ `workspace.execution.show`, and the receipt-backed
142
+ `workspace.execution.configure`. The catalog is an exact one-provider,
143
+ one-profile, one-policy tuple: the built-in `local-host` provider is
144
+ `trusted_host`, agentless, unbound, and not release-qualified. Result schemas
145
+ relate workspace and binding identity/revision, selected source/profile, and
146
+ receipt actor/method/target/aggregate revision. No result can represent a ready
147
+ provider: resolution is always `unavailable` with
148
+ `local_provider_unbound`. Provider calls, process launch, execution instances,
149
+ session placement, and remote execution remain absent.
150
+
151
+ The source also owns the Client-only `context.show` Invocation-context
152
+ candidate: exact empty parameters, a 16 KiB display-safe projection, at most
153
+ 32 unique allowed-action codes, `attachmentUsed: false`, and
154
+ `node_context_unavailable` / `context_override_forbidden` error codes.
155
+ `nodeId` is optional on `maia.invocation-context/v1` and is omitted from IC0
156
+ Client projections until ADR-014 NodeBootstrap allocates an authoritative
157
+ value. Session/Run/Dispatch principals, related IDs, device IDs, and
158
+ issue/expiry timestamps are absent from this slice, not inferred. Credential
159
+ bytes, protected-handle locators, filesystem paths, provider handles, and
160
+ caller-selected identity claims are not wire fields. Issue/renew/revoke remain
161
+ node-internal fail-closed refusals and are not public protocol methods. This
162
+ is a source-implemented candidate, not release-qualified product behavior.
163
+
164
+ For that contract, `ready` means the supported App Server version completed
165
+ initialize/initialized and a read-only account protocol acknowledgement. It is
166
+ not a login, model-availability, or turn-readiness claim. Windows uses the
167
+ structured `platform_unsupported` incompatible reason until the node qualifies
168
+ lifetime process-tree ownership there.
169
+
170
+ Public TypeScript types are inferred from the runtime schemas in their owning
171
+ protocol module. The package does not maintain a parallel shared-types file.
172
+ Effect Schema is the private validation implementation; callers see the
173
+ Maia-owned synchronous `RuntimeParser<T>`/`RuntimeSchema<T>` facade rather than
174
+ Effect AST or service types. Service-only filesystem, SQLite, Effect runtime,
175
+ and XState models are intentionally excluded.
176
+
177
+ The package has no direct Zod dependency. This is an accepted pre-1 API
178
+ migration: named exports, parsed values, strict wire behavior, `parse`,
179
+ `safeParse`, and parse-only factory inputs are preserved, while Zod-specific
180
+ schema methods, classes, and error formatting are not. See
181
+ [ADR-008](../../services/README.md#adr-008).
182
+
183
+ Effect's isolated production closure is larger and includes optional native
184
+ and lifecycle-capable transitives; this repository's denied-build policy is
185
+ not inherited by downstream package managers. Exact archive, unpacked-file,
186
+ and install-closure observations live in the
187
+ [benchmark ledger](../../services/README.md#benchmarks) rather than this packaged README,
188
+ whose own bytes would otherwise invalidate its measurement. Downstream install
189
+ size and authority must be measured separately for each release. SDK/node
190
+ consumers already install Effect and avoid carrying a second validator.
191
+
192
+ New command-receipt, project/workspace, session, terminal, orchestration,
193
+ integration-authorization, local-node, and runtime-probe source is organized in
194
+ owned concept folders. The pre-existing
195
+ envelope, capability, configuration, and runtime-schema root modules retain
196
+ semantic names but are explicitly registered
197
+ for folder migration in
198
+ [SOURCE_ORGANIZATION.md](../README.md#source-organization); they are not the
199
+ target shape for new behavior. Compatibility versions live in the concept that
200
+ owns them and are shared by that concept's private Effect schema and public
201
+ facade; `index.ts` only curates the package API. Equal primitive values are not
202
+ merged unless they represent one compatibility rule that must change atomically.
203
+
204
+ The N1 process framing is four-byte big-endian length plus strict UTF-8 JSON,
205
+ one request and response per connection, a 1 MiB payload cap, at most 4096 data
206
+ events per frame, an 8 KiB startup record cap, eight concurrent connections,
207
+ and a five-second incomplete-frame deadline. The bearer credential is never
208
+ part of readiness or a response.
209
+
210
+ The planned worker/sandbox protocol and CloudEvents export are generated from
211
+ this registry when a real local consumer exists. MCP, ACP, and A2A remain
212
+ separate compatibility boundaries rather than aliases for Maia commands. See
213
+ [the execution specification](../../services/README.md#execution).
214
+
215
+ ADR-015 accepts a later generated Public operation catalog owned by this
216
+ package. It will enumerate every operation in one exact built public node
217
+ protocol with a stable ID, lifecycle/status metadata, bounded input/output
218
+ schema references, idempotency/revision requirements, Capability/Approval
219
+ metadata, cursor/stream behavior, and documentation route. `@maiaos/sdk`, `maia
220
+ api`, classified `maia help --json` index and family pages, and the eligible injected Notebook bridge will derive
221
+ from one digest-bound registry and fail their build/conformance gate on drift.
222
+
223
+ The registry will not include roadmap-only methods, CLI presentation,
224
+ NodeBootstrap, database access, Worker administration, provider internals, or
225
+ private service protocols. Descriptors are public metadata rather than grants
226
+ or availability decisions; resource authorization still occurs per invocation.
227
+ No catalog or Notebook schema is exported today. See the [accepted Notebook
228
+ contract](../../services/README.md#execution--portable-notebooks) and
229
+ [ADR-015](../../services/README.md#adr-015).
230
+
231
+ The node-mediated device-capability endpoint, grant, invocation, and receipt
232
+ schemas remain planned and absent. They are distinct from both protocol
233
+ capability descriptors and execution-instance capabilities; see
234
+ [Device capabilities](../../services/README.md#device-capabilities).
235
+
236
+ The `maia.protocol/v1alpha1` identifier marks this bootstrap schema. It does not
237
+ define a compatibility window; that requires the planned protocol-versioning
238
+ ADR. Capability names and versions declare support only; they do not grant
239
+ permission.
@@ -0,0 +1,3 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const aggregateRevisionEffectSchema: Schema.String;
3
+ //# sourceMappingURL=revision-effect-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision-effect-schema.d.ts","sourceRoot":"","sources":["../../src/aggregate/revision-effect-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,6BAA6B,eASzC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import * as Schema from "effect/Schema";
2
+ export const aggregateRevisionEffectSchema = Schema.String.check(Schema.isLengthBetween(1, 19), Schema.isPattern(/^(?:0|[1-9]\d*)$/u), Schema.makeFilter((value) => /^(?:0|[1-9]\d*)$/u.test(value) &&
3
+ BigInt(value) <= 9223372036854775807n, { expected: "a signed 64-bit non-negative revision" }));
4
+ //# sourceMappingURL=revision-effect-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revision-effect-schema.js","sourceRoot":"","sources":["../../src/aggregate/revision-effect-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAC9D,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,EAAE,CAAC,EAC7B,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,EACrC,MAAM,CAAC,UAAU,CACf,CAAC,KAAK,EAAE,EAAE,CACR,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/B,MAAM,CAAC,KAAK,CAAC,IAAI,oBAA0B,EAC7C,EAAE,QAAQ,EAAE,uCAAuC,EAAE,CACtD,CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { InferRuntimeSchema } from "./runtime-schema.js";
2
+ export declare const capabilityNameSchema: import("./runtime-schema.js").RuntimeSchema<string>;
3
+ export declare const capabilityDescriptorSchema: import("./runtime-schema.js").RuntimeSchema<{
4
+ readonly name: string;
5
+ readonly version: number;
6
+ }>;
7
+ export type CapabilityDescriptor = InferRuntimeSchema<typeof capabilityDescriptorSchema>;
8
+ export declare const capabilityListSchema: import("./runtime-schema.js").RuntimeSchema<readonly {
9
+ readonly name: string;
10
+ readonly version: number;
11
+ }[]>;
12
+ //# sourceMappingURL=capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAU9D,eAAO,MAAM,oBAAoB,qDAEhC,CAAC;AAUF,eAAO,MAAM,0BAA0B;;;EAEtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CACnD,OAAO,0BAA0B,CAClC,CAAC;AAuBF,eAAO,MAAM,oBAAoB;;;IAEhC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { makeEffectRuntimeSchema } from "./runtime-schema-effect.js";
3
+ const MAX_CAPABILITY_COUNT = 256;
4
+ const capabilityNameEffectSchema = Schema.String.check(Schema.isLengthBetween(1, 128), Schema.isPattern(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u));
5
+ export const capabilityNameSchema = makeEffectRuntimeSchema(capabilityNameEffectSchema);
6
+ const capabilityDescriptorEffectSchema = Schema.Struct({
7
+ name: capabilityNameEffectSchema,
8
+ version: Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(65_535)),
9
+ });
10
+ export const capabilityDescriptorSchema = makeEffectRuntimeSchema(capabilityDescriptorEffectSchema);
11
+ const capabilityListEffectSchema = Schema.Array(capabilityDescriptorEffectSchema).check(Schema.isMaxLength(MAX_CAPABILITY_COUNT), Schema.makeFilter((capabilities) => {
12
+ const seenNames = new Set();
13
+ return capabilities.flatMap((capability, index) => {
14
+ if (seenNames.has(capability.name)) {
15
+ return [
16
+ {
17
+ issue: `Duplicate capability name: ${capability.name}`,
18
+ path: [index, "name"],
19
+ },
20
+ ];
21
+ }
22
+ seenNames.add(capability.name);
23
+ return [];
24
+ });
25
+ }));
26
+ export const capabilityListSchema = makeEffectRuntimeSchema(capabilityListEffectSchema);
27
+ //# sourceMappingURL=capability.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability.js","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAErE,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAEjC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CACpD,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC,EAC9B,MAAM,CAAC,SAAS,CAAC,sCAAsC,CAAC,CACzD,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CACzD,0BAA0B,CAC3B,CAAC;AAEF,MAAM,gCAAgC,GAAG,MAAM,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CACvB,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,EACvB,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,CACnC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAC/D,gCAAgC,CACjC,CAAC;AAMF,MAAM,0BAA0B,GAAG,MAAM,CAAC,KAAK,CAC7C,gCAAgC,CACjC,CAAC,KAAK,CACL,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC,EACxC,MAAM,CAAC,UAAU,CAAC,CAAC,YAAY,EAAE,EAAE;IACjC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAC;IACpC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAwB,EAAE;QACtE,IAAI,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,OAAO;gBACL;oBACE,KAAK,EAAE,8BAA8B,UAAU,CAAC,IAAI,EAAE;oBACtD,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;iBACtB;aACF,CAAC;QACJ,CAAC;QACD,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CACzD,0BAA0B,CAC3B,CAAC"}
@@ -0,0 +1,85 @@
1
+ import type { InferRuntimeSchema } from "../runtime-schema.js";
2
+ export declare const commandReceiptSchema: import("../runtime-schema.js").RuntimeSchema<{
3
+ readonly actorId: string;
4
+ readonly aggregateRevision: string;
5
+ readonly commandId: string;
6
+ readonly createdAt: string;
7
+ readonly eventCursor: string;
8
+ readonly method: string;
9
+ readonly receiptId: string;
10
+ readonly schemaVersion: 1;
11
+ readonly state: "succeeded";
12
+ readonly target: {
13
+ readonly id: string;
14
+ readonly type: string;
15
+ };
16
+ readonly updatedAt: string;
17
+ }>;
18
+ export type CommandReceipt = InferRuntimeSchema<typeof commandReceiptSchema>;
19
+ export declare const receiptGetParametersSchema: import("../runtime-schema.js").RuntimeSchema<{
20
+ readonly commandId: string;
21
+ }>;
22
+ export type ReceiptGetParameters = InferRuntimeSchema<typeof receiptGetParametersSchema>;
23
+ export declare const receiptGetResultSchema: import("../runtime-schema.js").RuntimeSchema<{
24
+ readonly method: "receipt.get";
25
+ readonly receipt: {
26
+ readonly actorId: string;
27
+ readonly aggregateRevision: string;
28
+ readonly commandId: string;
29
+ readonly createdAt: string;
30
+ readonly eventCursor: string;
31
+ readonly method: string;
32
+ readonly receiptId: string;
33
+ readonly schemaVersion: 1;
34
+ readonly state: "succeeded";
35
+ readonly target: {
36
+ readonly id: string;
37
+ readonly type: string;
38
+ };
39
+ readonly updatedAt: string;
40
+ };
41
+ readonly result: unknown;
42
+ }>;
43
+ export type ReceiptGetResult = InferRuntimeSchema<typeof receiptGetResultSchema>;
44
+ export declare const receiptListCursorSchema: import("../runtime-schema.js").RuntimeSchema<string>;
45
+ export type ReceiptListCursor = InferRuntimeSchema<typeof receiptListCursorSchema>;
46
+ export declare const receiptListParametersSchema: import("../runtime-schema.js").RuntimeSchema<{
47
+ readonly limit: number;
48
+ readonly method?: "integration.apply.codex" | "integration.apply.pi-rpc" | "integration.remove.codex" | "integration.remove.pi-rpc" | "project.register" | "run.create" | "run.dispatch.settle-terminal" | "run.inbox.ack" | "run.question.cancel" | "run.question.open" | "run.question.reply" | "session.create" | "session.start" | "terminal.controller.acquire" | "terminal.controller.release" | "terminal.controller.renew" | "terminal.controller.request" | "terminal.create" | "terminal.input.write" | "terminal.mutation.reconcile" | "terminal.observer.attach" | "terminal.observer.detach" | "terminal.session.close" | "terminal.session.delete" | "terminal.session.resize" | "terminal.session.restart" | "terminal.session.signal" | "turn.interrupt" | "turn.send" | "workspace.execution.configure" | "workspace.repository.attach" | undefined;
49
+ readonly actor?: string | undefined;
50
+ readonly afterCursor?: string | undefined;
51
+ readonly since?: string | undefined;
52
+ readonly until?: string | undefined;
53
+ }>;
54
+ export type ReceiptListParameters = InferRuntimeSchema<typeof receiptListParametersSchema>;
55
+ export declare const receiptListItemSchema: import("../runtime-schema.js").RuntimeSchema<{
56
+ readonly commandId: string;
57
+ readonly createdAt: string;
58
+ readonly method: string;
59
+ readonly receiptId: string;
60
+ readonly state: "succeeded";
61
+ readonly target: {
62
+ readonly id: string;
63
+ readonly type: string;
64
+ };
65
+ }>;
66
+ export type ReceiptListItem = InferRuntimeSchema<typeof receiptListItemSchema>;
67
+ export declare const receiptListResultSchema: import("../runtime-schema.js").RuntimeSchema<{
68
+ readonly method: "receipt.list";
69
+ readonly items: readonly {
70
+ readonly commandId: string;
71
+ readonly createdAt: string;
72
+ readonly method: string;
73
+ readonly receiptId: string;
74
+ readonly state: "succeeded";
75
+ readonly target: {
76
+ readonly id: string;
77
+ readonly type: string;
78
+ };
79
+ }[];
80
+ readonly nextCursor?: string | undefined;
81
+ }>;
82
+ export type ReceiptListResult = InferRuntimeSchema<typeof receiptListResultSchema>;
83
+ export { DEFAULT_RECEIPT_LIST_PAGE_SIZE, MAX_RECEIPT_LIST_PAGE_SIZE, MAX_RECEIPT_LIST_RESULT_BYTES, } from "./policy.js";
84
+ export { COMMAND_RECEIPT_SCHEMA_VERSION } from "./version.js";
85
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/command-receipt/contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAa/D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAEhC,CAAC;AACF,MAAM,MAAM,cAAc,GAAG,kBAAkB,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE7E,eAAO,MAAM,0BAA0B;;EAEtC,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CACnD,OAAO,0BAA0B,CAClC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;EAElC,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,CAC/C,OAAO,sBAAsB,CAC9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,sDAEnC,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAChD,OAAO,uBAAuB,CAC/B,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;EAEvC,CAAC;AACF,MAAM,MAAM,qBAAqB,GAAG,kBAAkB,CACpD,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;EAEjC,CAAC;AACF,MAAM,MAAM,eAAe,GAAG,kBAAkB,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE/E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;EAEnC,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAChD,OAAO,uBAAuB,CAC/B,CAAC;AAEF,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { makeEffectRuntimeSchema } from "../runtime-schema-effect.js";
2
+ import { commandReceiptEffectSchema, receiptGetParametersEffectSchema, receiptGetResultEffectSchema, receiptListCursorEffectSchema, receiptListItemEffectSchema, receiptListParametersEffectSchema, receiptListResultEffectSchema, } from "./effect-schema.js";
3
+ export const commandReceiptSchema = makeEffectRuntimeSchema(commandReceiptEffectSchema);
4
+ export const receiptGetParametersSchema = makeEffectRuntimeSchema(receiptGetParametersEffectSchema);
5
+ export const receiptGetResultSchema = makeEffectRuntimeSchema(receiptGetResultEffectSchema);
6
+ export const receiptListCursorSchema = makeEffectRuntimeSchema(receiptListCursorEffectSchema);
7
+ export const receiptListParametersSchema = makeEffectRuntimeSchema(receiptListParametersEffectSchema);
8
+ export const receiptListItemSchema = makeEffectRuntimeSchema(receiptListItemEffectSchema);
9
+ export const receiptListResultSchema = makeEffectRuntimeSchema(receiptListResultEffectSchema);
10
+ export { DEFAULT_RECEIPT_LIST_PAGE_SIZE, MAX_RECEIPT_LIST_PAGE_SIZE, MAX_RECEIPT_LIST_RESULT_BYTES, } from "./policy.js";
11
+ export { COMMAND_RECEIPT_SCHEMA_VERSION } from "./version.js";
12
+ //# sourceMappingURL=contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.js","sourceRoot":"","sources":["../../src/command-receipt/contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,4BAA4B,EAC5B,6BAA6B,EAC7B,2BAA2B,EAC3B,iCAAiC,EACjC,6BAA6B,GAC9B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CACzD,0BAA0B,CAC3B,CAAC;AAGF,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAC/D,gCAAgC,CACjC,CAAC;AAKF,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAC3D,4BAA4B,CAC7B,CAAC;AAKF,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAC5D,6BAA6B,CAC9B,CAAC;AAKF,MAAM,CAAC,MAAM,2BAA2B,GAAG,uBAAuB,CAChE,iCAAiC,CAClC,CAAC;AAKF,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAC1D,2BAA2B,CAC5B,CAAC;AAGF,MAAM,CAAC,MAAM,uBAAuB,GAAG,uBAAuB,CAC5D,6BAA6B,CAC9B,CAAC;AAKF,OAAO,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,78 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const commandReceiptEffectSchema: Schema.Struct<{
3
+ readonly actorId: Schema.String;
4
+ readonly aggregateRevision: Schema.String;
5
+ readonly commandId: Schema.String;
6
+ readonly createdAt: Schema.String;
7
+ readonly eventCursor: Schema.String;
8
+ readonly method: Schema.String;
9
+ readonly receiptId: Schema.String;
10
+ readonly schemaVersion: Schema.Literal<1>;
11
+ readonly state: Schema.Literal<"succeeded">;
12
+ readonly target: Schema.Struct<{
13
+ readonly id: Schema.String;
14
+ readonly type: Schema.String;
15
+ }>;
16
+ readonly updatedAt: Schema.String;
17
+ }>;
18
+ export declare const receiptGetParametersEffectSchema: Schema.Struct<{
19
+ readonly commandId: Schema.String;
20
+ }>;
21
+ export declare const receiptGetResultEffectSchema: Schema.Struct<{
22
+ readonly method: Schema.Literal<"receipt.get">;
23
+ readonly receipt: Schema.Struct<{
24
+ readonly actorId: Schema.String;
25
+ readonly aggregateRevision: Schema.String;
26
+ readonly commandId: Schema.String;
27
+ readonly createdAt: Schema.String;
28
+ readonly eventCursor: Schema.String;
29
+ readonly method: Schema.String;
30
+ readonly receiptId: Schema.String;
31
+ readonly schemaVersion: Schema.Literal<1>;
32
+ readonly state: Schema.Literal<"succeeded">;
33
+ readonly target: Schema.Struct<{
34
+ readonly id: Schema.String;
35
+ readonly type: Schema.String;
36
+ }>;
37
+ readonly updatedAt: Schema.String;
38
+ }>;
39
+ readonly result: Schema.Unknown;
40
+ }>;
41
+ export declare const receiptListCursorEffectSchema: Schema.String;
42
+ export declare const receiptListMethodFilterEffectSchema: Schema.Literals<readonly ["integration.apply.codex", "integration.apply.pi-rpc", "integration.remove.codex", "integration.remove.pi-rpc", "project.register", "run.create", "run.dispatch.settle-terminal", "run.inbox.ack", "run.question.cancel", "run.question.open", "run.question.reply", "session.create", "session.start", "terminal.controller.acquire", "terminal.controller.release", "terminal.controller.renew", "terminal.controller.request", "terminal.create", "terminal.input.write", "terminal.mutation.reconcile", "terminal.observer.attach", "terminal.observer.detach", "terminal.session.close", "terminal.session.delete", "terminal.session.resize", "terminal.session.restart", "terminal.session.signal", "turn.interrupt", "turn.send", "workspace.execution.configure", "workspace.repository.attach"]>;
43
+ export declare const receiptListItemMethodEffectSchema: Schema.String;
44
+ export declare const receiptListParametersEffectSchema: Schema.Struct<{
45
+ readonly actor: Schema.optional<Schema.String>;
46
+ readonly afterCursor: Schema.optional<Schema.String>;
47
+ readonly limit: Schema.Int;
48
+ readonly method: Schema.optional<Schema.Literals<readonly ["integration.apply.codex", "integration.apply.pi-rpc", "integration.remove.codex", "integration.remove.pi-rpc", "project.register", "run.create", "run.dispatch.settle-terminal", "run.inbox.ack", "run.question.cancel", "run.question.open", "run.question.reply", "session.create", "session.start", "terminal.controller.acquire", "terminal.controller.release", "terminal.controller.renew", "terminal.controller.request", "terminal.create", "terminal.input.write", "terminal.mutation.reconcile", "terminal.observer.attach", "terminal.observer.detach", "terminal.session.close", "terminal.session.delete", "terminal.session.resize", "terminal.session.restart", "terminal.session.signal", "turn.interrupt", "turn.send", "workspace.execution.configure", "workspace.repository.attach"]>>;
49
+ readonly since: Schema.optional<Schema.String>;
50
+ readonly until: Schema.optional<Schema.String>;
51
+ }>;
52
+ export declare const receiptListItemEffectSchema: Schema.Struct<{
53
+ readonly commandId: Schema.String;
54
+ readonly createdAt: Schema.String;
55
+ readonly method: Schema.String;
56
+ readonly receiptId: Schema.String;
57
+ readonly state: Schema.Literal<"succeeded">;
58
+ readonly target: Schema.Struct<{
59
+ readonly id: Schema.String;
60
+ readonly type: Schema.String;
61
+ }>;
62
+ }>;
63
+ export declare const receiptListResultEffectSchema: Schema.Struct<{
64
+ readonly items: Schema.$Array<Schema.Struct<{
65
+ readonly commandId: Schema.String;
66
+ readonly createdAt: Schema.String;
67
+ readonly method: Schema.String;
68
+ readonly receiptId: Schema.String;
69
+ readonly state: Schema.Literal<"succeeded">;
70
+ readonly target: Schema.Struct<{
71
+ readonly id: Schema.String;
72
+ readonly type: Schema.String;
73
+ }>;
74
+ }>>;
75
+ readonly method: Schema.Literal<"receipt.list">;
76
+ readonly nextCursor: Schema.optional<Schema.String>;
77
+ }>;
78
+ //# sourceMappingURL=effect-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-schema.d.ts","sourceRoot":"","sources":["../../src/command-receipt/effect-schema.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAYxC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAerC,CAAC;AAEH,eAAO,MAAM,gCAAgC;;EAE3C,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;EAIvC,CAAC;AAEH,eAAO,MAAM,6BAA6B,eAAiC,CAAC;AAE5E,eAAO,MAAM,mCAAmC,syBAE/C,CAAC;AAEF,eAAO,MAAM,iCAAiC,eAAiC,CAAC;AA4BhF,eAAO,MAAM,iCAAiC;;;;;;;EAK3C,CAAC;AAEJ,eAAO,MAAM,2BAA2B;;;;;;;;;;EAUtC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;EAMxC,CAAC"}
@@ -0,0 +1,72 @@
1
+ import * as DateTime from "effect/DateTime";
2
+ import * as Option from "effect/Option";
3
+ import * as Schema from "effect/Schema";
4
+ import { aggregateRevisionEffectSchema } from "../aggregate/revision-effect-schema.js";
5
+ import { protocolIdentifierEffectSchema } from "../envelope-effect-schema.js";
6
+ import { recordedAtEffectSchema } from "../temporal/recorded-at.js";
7
+ import { MAX_RECEIPT_LIST_PAGE_SIZE, RECEIPT_LIST_FILTER_METHODS, } from "./policy.js";
8
+ import { COMMAND_RECEIPT_SCHEMA_VERSION } from "./version.js";
9
+ export const commandReceiptEffectSchema = Schema.Struct({
10
+ actorId: protocolIdentifierEffectSchema,
11
+ aggregateRevision: aggregateRevisionEffectSchema,
12
+ commandId: protocolIdentifierEffectSchema,
13
+ createdAt: recordedAtEffectSchema,
14
+ eventCursor: aggregateRevisionEffectSchema,
15
+ method: protocolIdentifierEffectSchema,
16
+ receiptId: protocolIdentifierEffectSchema,
17
+ schemaVersion: Schema.Literal(COMMAND_RECEIPT_SCHEMA_VERSION),
18
+ state: Schema.Literal("succeeded"),
19
+ target: Schema.Struct({
20
+ id: protocolIdentifierEffectSchema,
21
+ type: protocolIdentifierEffectSchema,
22
+ }),
23
+ updatedAt: recordedAtEffectSchema,
24
+ });
25
+ export const receiptGetParametersEffectSchema = Schema.Struct({
26
+ commandId: protocolIdentifierEffectSchema,
27
+ });
28
+ export const receiptGetResultEffectSchema = Schema.Struct({
29
+ method: Schema.Literal("receipt.get"),
30
+ receipt: commandReceiptEffectSchema,
31
+ result: Schema.Unknown,
32
+ });
33
+ export const receiptListCursorEffectSchema = protocolIdentifierEffectSchema;
34
+ export const receiptListMethodFilterEffectSchema = Schema.Literals(RECEIPT_LIST_FILTER_METHODS);
35
+ export const receiptListItemMethodEffectSchema = protocolIdentifierEffectSchema;
36
+ const receiptListWindowIsInclusive = (input) => {
37
+ if (input.since === undefined || input.until === undefined)
38
+ return true;
39
+ const since = DateTime.make(input.since);
40
+ const until = DateTime.make(input.until);
41
+ return (Option.isSome(since) &&
42
+ Option.isSome(until) &&
43
+ DateTime.toEpochMillis(since.value) <= DateTime.toEpochMillis(until.value));
44
+ };
45
+ const receiptListParametersStructEffectSchema = Schema.Struct({
46
+ actor: Schema.optional(protocolIdentifierEffectSchema),
47
+ afterCursor: Schema.optional(receiptListCursorEffectSchema),
48
+ limit: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1), Schema.isLessThanOrEqualTo(MAX_RECEIPT_LIST_PAGE_SIZE)),
49
+ method: Schema.optional(receiptListMethodFilterEffectSchema),
50
+ since: Schema.optional(recordedAtEffectSchema),
51
+ until: Schema.optional(recordedAtEffectSchema),
52
+ });
53
+ export const receiptListParametersEffectSchema = receiptListParametersStructEffectSchema.check(Schema.makeFilter(receiptListWindowIsInclusive, {
54
+ expected: "an inclusive since/until recorded-at range",
55
+ }));
56
+ export const receiptListItemEffectSchema = Schema.Struct({
57
+ commandId: protocolIdentifierEffectSchema,
58
+ createdAt: recordedAtEffectSchema,
59
+ method: receiptListItemMethodEffectSchema,
60
+ receiptId: protocolIdentifierEffectSchema,
61
+ state: Schema.Literal("succeeded"),
62
+ target: Schema.Struct({
63
+ id: protocolIdentifierEffectSchema,
64
+ type: protocolIdentifierEffectSchema,
65
+ }),
66
+ });
67
+ export const receiptListResultEffectSchema = Schema.Struct({
68
+ items: Schema.Array(receiptListItemEffectSchema).check(Schema.isMaxLength(MAX_RECEIPT_LIST_PAGE_SIZE)),
69
+ method: Schema.Literal("receipt.list"),
70
+ nextCursor: Schema.optional(receiptListCursorEffectSchema),
71
+ });
72
+ //# sourceMappingURL=effect-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"effect-schema.js","sourceRoot":"","sources":["../../src/command-receipt/effect-schema.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,16 @@
1
+ import type { LocalNodeRequestMethod } from "../local-node/methods.js";
2
+ export declare const DEFAULT_RECEIPT_LIST_PAGE_SIZE = 8;
3
+ export declare const MAX_RECEIPT_LIST_PAGE_SIZE = 32;
4
+ export declare const MAX_RECEIPT_LIST_RESULT_BYTES: number;
5
+ export declare const RECEIPT_LIST_FILTER_METHODS: readonly ["integration.apply.codex", "integration.apply.pi-rpc", "integration.remove.codex", "integration.remove.pi-rpc", "project.register", "run.create", "run.dispatch.settle-terminal", "run.inbox.ack", "run.question.cancel", "run.question.open", "run.question.reply", "session.create", "session.start", "terminal.controller.acquire", "terminal.controller.release", "terminal.controller.renew", "terminal.controller.request", "terminal.create", "terminal.input.write", "terminal.mutation.reconcile", "terminal.observer.attach", "terminal.observer.detach", "terminal.session.close", "terminal.session.delete", "terminal.session.resize", "terminal.session.restart", "terminal.session.signal", "turn.interrupt", "turn.send", "workspace.execution.configure", "workspace.repository.attach"];
6
+ export declare const RECEIPT_LIST_NON_FILTER_METHODS: readonly ["context.show", "execution.catalog.get", "harness.installed.list", "integration.plan.codex", "integration.plan.pi-rpc", "integration.status.codex", "integration.status.pi-rpc", "monitor.bootstrap.create", "node.shutdown", "node.status", "project.list", "project.show", "receipt.get", "receipt.list", "run.dispatch.show", "run.inbox.check", "run.list", "run.show", "run.task.list", "run.task.show", "runtime.probe", "session.events.list", "session.list", "session.show", "terminal.controller.request.show", "terminal.events.list", "terminal.list", "terminal.observer.check", "terminal.observer.resync", "terminal.read", "terminal.show", "turn.show", "workspace.list", "workspace.execution.show", "workspace.show"];
7
+ type ReceiptListFilterMethod = (typeof RECEIPT_LIST_FILTER_METHODS)[number];
8
+ type ReceiptListNonFilterMethod = (typeof RECEIPT_LIST_NON_FILTER_METHODS)[number];
9
+ type ReceiptListMethodPartition = ReceiptListFilterMethod | ReceiptListNonFilterMethod;
10
+ type AssertExact<TLeft, TRight> = [TLeft] extends [TRight] ? [TRight] extends [TLeft] ? true : never : never;
11
+ export declare const receiptListMethodCatalogIsPartitioned: AssertExact<LocalNodeRequestMethod, ReceiptListMethodPartition>;
12
+ export declare const receiptListFilterIsDisjoint: [
13
+ Extract<ReceiptListFilterMethod, ReceiptListNonFilterMethod>
14
+ ] extends [never] ? true : never;
15
+ export {};
16
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/command-receipt/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAChD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAC7C,eAAO,MAAM,6BAA6B,QAAY,CAAC;AAEvD,eAAO,MAAM,2BAA2B,qxBAgCc,CAAC;AAEvD,eAAO,MAAM,+BAA+B,otBAoCU,CAAC;AAEvD,KAAK,uBAAuB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC;AAC5E,KAAK,0BAA0B,GAC7B,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,KAAK,0BAA0B,GAC7B,uBAAuB,GAAG,0BAA0B,CAAC;AAEvD,KAAK,WAAW,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GACtD,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,GACtB,IAAI,GACJ,KAAK,GACP,KAAK,CAAC;AAEV,eAAO,MAAM,qCAAqC,EAAE,WAAW,CAC7D,sBAAsB,EACtB,0BAA0B,CACpB,CAAC;AACT,eAAO,MAAM,2BAA2B,EAAE;IACxC,OAAO,CAAC,uBAAuB,EAAE,0BAA0B,CAAC;CAC7D,SAAS,CAAC,KAAK,CAAC,GACb,IAAI,GACJ,KAAY,CAAC"}