@qodeca/xezar 0.13.1 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/README.md +45 -15
  2. package/dist/agent-config/account-identity.d.ts +2 -8
  3. package/dist/agent-config/account-identity.js +54 -10
  4. package/dist/agent-config/account-identity.js.map +1 -1
  5. package/dist/agent-config/catalog.d.ts +49 -7
  6. package/dist/agent-config/catalog.js +107 -0
  7. package/dist/agent-config/catalog.js.map +1 -1
  8. package/dist/agent-config/model-settings/pi.d.ts +12 -6
  9. package/dist/agent-config/model-settings/pi.js +12 -6
  10. package/dist/agent-config/model-settings/pi.js.map +1 -1
  11. package/dist/agent-config/seed.js +10 -0
  12. package/dist/agent-config/seed.js.map +1 -1
  13. package/dist/contract/github.d.ts +15 -0
  14. package/dist/contract/index.d.ts +9 -0
  15. package/dist/contract/index.js +1527 -895
  16. package/dist/contract/mcp-api-reference.d.ts +174 -0
  17. package/dist/contract/mcp-audit.d.ts +103 -0
  18. package/dist/contract/mcp-discovery.d.ts +257 -0
  19. package/dist/contract/mcp-event-catalog.d.ts +121 -0
  20. package/dist/contract/mcp-event-catalog.test.d.ts +1 -0
  21. package/dist/contract/mcp-idempotency.d.ts +200 -0
  22. package/dist/contract/mcp-journal.d.ts +268 -0
  23. package/dist/contract/mcp-leader.d.ts +88 -0
  24. package/dist/contract/mcp-ownership.d.ts +78 -0
  25. package/dist/contract/mcp-versioning.d.ts +139 -0
  26. package/dist/contract/runs.d.ts +81 -0
  27. package/dist/core/agent-profiles.d.ts +15 -4
  28. package/dist/core/agent-profiles.js +22 -8
  29. package/dist/core/agent-profiles.js.map +1 -1
  30. package/dist/core/opencode-server-runner.js +71 -11
  31. package/dist/core/opencode-server-runner.js.map +1 -1
  32. package/dist/core/secret-redaction.d.ts +7 -1
  33. package/dist/core/secret-redaction.js +44 -10
  34. package/dist/core/secret-redaction.js.map +1 -1
  35. package/dist/index.js +138 -27
  36. package/dist/index.js.map +1 -1
  37. package/dist/machine-identity.d.ts +66 -0
  38. package/dist/machine-identity.js +96 -0
  39. package/dist/machine-identity.js.map +1 -0
  40. package/dist/mcp/adapters/claude-code.d.ts +41 -0
  41. package/dist/mcp/adapters/claude-code.js +40 -0
  42. package/dist/mcp/adapters/claude-code.js.map +1 -0
  43. package/dist/mcp/adapters/codex.d.ts +140 -0
  44. package/dist/mcp/adapters/codex.js +323 -0
  45. package/dist/mcp/adapters/codex.js.map +1 -0
  46. package/dist/mcp/adapters/opencode.d.ts +148 -0
  47. package/dist/mcp/adapters/opencode.js +528 -0
  48. package/dist/mcp/adapters/opencode.js.map +1 -0
  49. package/dist/mcp/adapters/pi-link.d.ts +102 -0
  50. package/dist/mcp/adapters/pi-link.js +235 -0
  51. package/dist/mcp/adapters/pi-link.js.map +1 -0
  52. package/dist/mcp/adapters/pi.d.ts +188 -0
  53. package/dist/mcp/adapters/pi.js +418 -0
  54. package/dist/mcp/adapters/pi.js.map +1 -0
  55. package/dist/mcp/api-reference.d.ts +26 -0
  56. package/dist/mcp/api-reference.js +133 -0
  57. package/dist/mcp/api-reference.js.map +1 -0
  58. package/dist/mcp/audit-trail.d.ts +162 -0
  59. package/dist/mcp/audit-trail.js +306 -0
  60. package/dist/mcp/audit-trail.js.map +1 -0
  61. package/dist/mcp/bridge.d.ts +81 -0
  62. package/dist/mcp/bridge.js +407 -0
  63. package/dist/mcp/bridge.js.map +1 -0
  64. package/dist/mcp/connection-file.d.ts +49 -0
  65. package/dist/mcp/connection-file.js +63 -0
  66. package/dist/mcp/connection-file.js.map +1 -0
  67. package/dist/mcp/echo-guard.d.ts +94 -0
  68. package/dist/mcp/echo-guard.js +160 -0
  69. package/dist/mcp/echo-guard.js.map +1 -0
  70. package/dist/mcp/event-catalog.d.ts +120 -0
  71. package/dist/mcp/event-catalog.js +306 -0
  72. package/dist/mcp/event-catalog.js.map +1 -0
  73. package/dist/mcp/event-controller.d.ts +230 -0
  74. package/dist/mcp/event-controller.js +596 -0
  75. package/dist/mcp/event-controller.js.map +1 -0
  76. package/dist/mcp/event-journal.d.ts +57 -0
  77. package/dist/mcp/event-journal.js +423 -0
  78. package/dist/mcp/event-journal.js.map +1 -0
  79. package/dist/mcp/index.d.ts +63 -0
  80. package/dist/mcp/index.js +386 -0
  81. package/dist/mcp/index.js.map +1 -0
  82. package/dist/mcp/ipc.d.ts +202 -0
  83. package/dist/mcp/ipc.js +206 -0
  84. package/dist/mcp/ipc.js.map +1 -0
  85. package/dist/mcp/leader-delivery.d.ts +119 -0
  86. package/dist/mcp/leader-delivery.js +450 -0
  87. package/dist/mcp/leader-delivery.js.map +1 -0
  88. package/dist/mcp/operation-receipts.d.ts +210 -0
  89. package/dist/mcp/operation-receipts.js +723 -0
  90. package/dist/mcp/operation-receipts.js.map +1 -0
  91. package/dist/mcp/project-catalogs.d.ts +23 -0
  92. package/dist/mcp/project-catalogs.js +25 -0
  93. package/dist/mcp/project-catalogs.js.map +1 -0
  94. package/dist/mcp/project-leaders.d.ts +26 -0
  95. package/dist/mcp/project-leaders.js +17 -0
  96. package/dist/mcp/project-leaders.js.map +1 -0
  97. package/dist/mcp/protocol.d.ts +50 -0
  98. package/dist/mcp/protocol.js +47 -0
  99. package/dist/mcp/protocol.js.map +1 -0
  100. package/dist/mcp/reconnect.d.ts +297 -0
  101. package/dist/mcp/reconnect.js +465 -0
  102. package/dist/mcp/reconnect.js.map +1 -0
  103. package/dist/mcp/resource-ownership.d.ts +228 -0
  104. package/dist/mcp/resource-ownership.js +390 -0
  105. package/dist/mcp/resource-ownership.js.map +1 -0
  106. package/dist/mcp/service-adapter.d.ts +16488 -0
  107. package/dist/mcp/service-adapter.js +148 -0
  108. package/dist/mcp/service-adapter.js.map +1 -0
  109. package/dist/mcp/service.d.ts +83 -0
  110. package/dist/mcp/service.js +233 -0
  111. package/dist/mcp/service.js.map +1 -0
  112. package/dist/mcp/session-binding.d.ts +105 -0
  113. package/dist/mcp/session-binding.js +163 -0
  114. package/dist/mcp/session-binding.js.map +1 -0
  115. package/dist/mcp/stale-write.d.ts +145 -0
  116. package/dist/mcp/stale-write.js +219 -0
  117. package/dist/mcp/stale-write.js.map +1 -0
  118. package/dist/mcp/tool.d.ts +48 -0
  119. package/dist/mcp/tool.js +24 -0
  120. package/dist/mcp/tool.js.map +1 -0
  121. package/dist/mcp/tools/discovery.d.ts +40 -0
  122. package/dist/mcp/tools/discovery.js +232 -0
  123. package/dist/mcp/tools/discovery.js.map +1 -0
  124. package/dist/mcp/tools/execution-control.d.ts +171 -0
  125. package/dist/mcp/tools/execution-control.js +513 -0
  126. package/dist/mcp/tools/execution-control.js.map +1 -0
  127. package/dist/mcp/tools/handoff-git.d.ts +26 -0
  128. package/dist/mcp/tools/handoff-git.js +544 -0
  129. package/dist/mcp/tools/handoff-git.js.map +1 -0
  130. package/dist/mcp/tools/index.d.ts +2 -0
  131. package/dist/mcp/tools/index.js +23 -0
  132. package/dist/mcp/tools/index.js.map +1 -0
  133. package/dist/mcp/tools/leader-events.d.ts +46 -0
  134. package/dist/mcp/tools/leader-events.js +126 -0
  135. package/dist/mcp/tools/leader-events.js.map +1 -0
  136. package/dist/mcp/tools/local-handoff.d.ts +102 -0
  137. package/dist/mcp/tools/local-handoff.js +306 -0
  138. package/dist/mcp/tools/local-handoff.js.map +1 -0
  139. package/dist/mcp/tools/project-config.d.ts +340 -0
  140. package/dist/mcp/tools/project-config.js +1075 -0
  141. package/dist/mcp/tools/project-config.js.map +1 -0
  142. package/dist/mcp/tools/results-evidence.d.ts +112 -0
  143. package/dist/mcp/tools/results-evidence.js +1045 -0
  144. package/dist/mcp/tools/results-evidence.js.map +1 -0
  145. package/dist/mcp/tools/task-create.d.ts +70 -0
  146. package/dist/mcp/tools/task-create.js +473 -0
  147. package/dist/mcp/tools/task-create.js.map +1 -0
  148. package/dist/mcp/tools/task-reads.d.ts +102 -0
  149. package/dist/mcp/tools/task-reads.js +689 -0
  150. package/dist/mcp/tools/task-reads.js.map +1 -0
  151. package/dist/mcp/tools/work-organisation.d.ts +2 -0
  152. package/dist/mcp/tools/work-organisation.js +502 -0
  153. package/dist/mcp/tools/work-organisation.js.map +1 -0
  154. package/dist/paths.d.ts +17 -7
  155. package/dist/paths.js +18 -8
  156. package/dist/paths.js.map +1 -1
  157. package/dist/runs/project-writer.js +76 -11
  158. package/dist/runs/project-writer.js.map +1 -1
  159. package/dist/runs/retention.d.ts +24 -1
  160. package/dist/runs/retention.js +62 -1
  161. package/dist/runs/retention.js.map +1 -1
  162. package/dist/server/forge/github.js +44 -0
  163. package/dist/server/forge/github.js.map +1 -1
  164. package/dist/server/forge/types.d.ts +16 -0
  165. package/dist/server/project-context.d.ts +81 -8
  166. package/dist/server/project-context.js +143 -35
  167. package/dist/server/project-context.js.map +1 -1
  168. package/dist/server/server.d.ts +1050 -53
  169. package/dist/server/server.js +326 -120
  170. package/dist/server/server.js.map +1 -1
  171. package/dist/server/validators.d.ts +26 -6
  172. package/dist/server/validators.js +17 -0
  173. package/dist/server/validators.js.map +1 -1
  174. package/dist/skills-remote.js +64 -6
  175. package/dist/skills-remote.js.map +1 -1
  176. package/dist/workflows/run.d.ts +277 -12
  177. package/dist/workflows/run.js +554 -59
  178. package/dist/workflows/run.js.map +1 -1
  179. package/dist/workspace/agent-profiles.d.ts +30 -3
  180. package/dist/workspace/agent-profiles.js +39 -4
  181. package/dist/workspace/agent-profiles.js.map +1 -1
  182. package/dist/workspace/config.js +25 -4
  183. package/dist/workspace/config.js.map +1 -1
  184. package/dist/workspace/project-owner.d.ts +210 -0
  185. package/dist/workspace/project-owner.js +518 -0
  186. package/dist/workspace/project-owner.js.map +1 -0
  187. package/package.json +5 -3
  188. package/scripts/pi-leader-extension.ts +420 -0
  189. package/scripts/sync-readme.mjs +83 -2
  190. package/web/dist/assets/{alert-dialog-BVsVcbFy.js → alert-dialog-D6rP6d39.js} +1 -1
  191. package/web/dist/assets/arrow-down-DMOfFIzW.js +1 -0
  192. package/web/dist/assets/arrow-left-C4Ec2BUg.js +1 -0
  193. package/web/dist/assets/{centered-state-Djgly6Ni.js → centered-state-B0ZqrPaa.js} +12 -12
  194. package/web/dist/assets/chevron-right-mHJ-crvn.js +1 -0
  195. package/web/dist/assets/{collapsible-DZ4D-DHG.js → collapsible-DchEHgUM.js} +1 -1
  196. package/web/dist/assets/{commit-list-B-z1JL9G.js → commit-list-BpMim1Rv.js} +1 -1
  197. package/web/dist/assets/{compare-variants-D62m4j3B.js → compare-variants-D5ItQbAq.js} +1 -1
  198. package/web/dist/assets/{diff-BKew9rQX.js → diff-HqqZ_WDR.js} +2 -2
  199. package/web/dist/assets/{diff-stat-D0mc5V6Z.js → diff-stat-NsU-3ecr.js} +1 -1
  200. package/web/dist/assets/{diff-view-xpIcuLIC.js → diff-view-B7c11Xux.js} +1 -1
  201. package/web/dist/assets/{dropdown-menu-CEQziH7X.js → dropdown-menu-CtTpnyod.js} +1 -1
  202. package/web/dist/assets/{editable-title-BCX3T2BY.js → editable-title-BXtuGQry.js} +1 -1
  203. package/web/dist/assets/{ellipsis-vertical-ByVdDc4z.js → ellipsis-vertical-MHtGZSH6.js} +1 -1
  204. package/web/dist/assets/{file-xBSB5hXO.js → file-DKLw5SOb.js} +1 -1
  205. package/web/dist/assets/{folder-CldgbZ5A.js → folder-Drw6-ufH.js} +1 -1
  206. package/web/dist/assets/{git-toolbar-DJANqg7Y.js → git-toolbar-BQH8bORV.js} +1 -1
  207. package/web/dist/assets/github-ynnpKFCJ.js +1 -0
  208. package/web/dist/assets/{image-preview-Cv5mZr0n.js → image-preview-DLhMN_R9.js} +1 -1
  209. package/web/dist/assets/index-BEsrNdXt.js +29 -0
  210. package/web/dist/assets/index-Da8DOBau.css +2 -0
  211. package/web/dist/assets/{markdown-CgEEE2ND.js → markdown-q365eN6Y.js} +1 -1
  212. package/web/dist/assets/{new-task-form-1r2bgsdD.js → new-task-form-CW-hNIWQ.js} +1 -1
  213. package/web/dist/assets/{pill-q-x22_ej.js → pill-B_TFulXa.js} +1 -1
  214. package/web/dist/assets/{project-router-VDN4jQM8.js → project-router-CLPc-ImZ.js} +1 -1
  215. package/web/dist/assets/{prompt-templates-BmZtCe-L.js → prompt-templates-CLc4RxyO.js} +1 -1
  216. package/web/dist/assets/{repo-git-btG0sdbO.js → repo-git-Is7R6-Tj.js} +1 -1
  217. package/web/dist/assets/{run-diff-vguEMJzh.js → run-diff-DHMvDlVo.js} +2 -2
  218. package/web/dist/assets/run-header-DvZJbQ8I.js +1 -0
  219. package/web/dist/assets/{search-x-QmhaAbg5.js → search-x-Ce2MMetu.js} +1 -1
  220. package/web/dist/assets/{skill-empty-hint-BrzUwByZ.js → skill-empty-hint-C_xCSvzB.js} +1 -1
  221. package/web/dist/assets/skills-CivqD4si.js +1 -0
  222. package/web/dist/assets/{sparkles-CP8QDOgX.js → sparkles-BCqPoj5g.js} +1 -1
  223. package/web/dist/assets/{square-terminal-CGypshSD.js → square-terminal-ikj5g-oK.js} +1 -1
  224. package/web/dist/assets/{tab-link-D4lFzzI1.js → tab-link-VsEjFV1Y.js} +1 -1
  225. package/web/dist/assets/{task-changes-BtZId14z.js → task-changes-CH-E81-_.js} +1 -1
  226. package/web/dist/assets/{task-commits-BoeyJXrv.js → task-commits-DqfkMFxp.js} +1 -1
  227. package/web/dist/assets/{task-files-DIy2oUnj.js → task-files-D_nkHZ_a.js} +2 -2
  228. package/web/dist/assets/task-thread-bxQompxJ.js +9 -0
  229. package/web/dist/assets/{textarea-CyBCyKIk.js → textarea-xajuW1L_.js} +1 -1
  230. package/web/dist/assets/{thread-loading-Cuq2jchC.js → thread-loading-C3JQZbIE.js} +1 -1
  231. package/web/dist/assets/{trash-2-B6Dp3ZNs.js → trash-2-hJrBhpUD.js} +1 -1
  232. package/web/dist/assets/{triangle-alert-xBya8FUp.js → triangle-alert-D1u82y1a.js} +1 -1
  233. package/web/dist/assets/{upload-D6MXEB9p.js → upload-Bn6FBZ59.js} +1 -1
  234. package/web/dist/assets/{use-desktop-CPBwzQ7M.js → use-desktop-DOIMfHfY.js} +1 -1
  235. package/web/dist/assets/{use-submit-shortcut-JTpNzU-u.js → use-submit-shortcut-Dj4DHTdE.js} +1 -1
  236. package/web/dist/assets/utils-YwBpOoRN.js +64 -0
  237. package/web/dist/assets/{workflows-DG115scU.js → workflows-CTaAKz2m.js} +3 -3
  238. package/web/dist/assets/{zoomable-image-GTYwLtkS.js → zoomable-image-C1-6P3tg.js} +1 -1
  239. package/web/dist/index.html +23 -23
  240. package/web/dist/assets/arrow-down-CYgAlZtW.js +0 -1
  241. package/web/dist/assets/arrow-left-BOqE0a3k.js +0 -1
  242. package/web/dist/assets/chevron-right-Cc9BWnbN.js +0 -1
  243. package/web/dist/assets/github-D6vK0jFn.js +0 -1
  244. package/web/dist/assets/index-CkmR6h7s.css +0 -2
  245. package/web/dist/assets/index-DVDqF4bM.js +0 -9
  246. package/web/dist/assets/refresh-cw-DcNCj2nu.js +0 -1
  247. package/web/dist/assets/run-header-DM7MiKj9.js +0 -1
  248. package/web/dist/assets/skills-DMfxQtrD.js +0 -1
  249. package/web/dist/assets/task-thread-CbMPmrWq.js +0 -9
  250. package/web/dist/assets/utils--z9hRtl3.js +0 -64
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-receipts.js","sourceRoot":"","sources":["../../src/mcp/operation-receipts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACpH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,wBAAwB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nB,CAAC;AACH,CAAC;AAED,2GAA2G;AAC3G,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IAChC,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACtB,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,2CAA2C;IAC7C,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { EventCatalog } from './event-catalog.ts';
2
+ /**
3
+ * The per-project lookup the cockpit's write routes use to report an E-05 change (#252). A
4
+ * configuration, workflow or agent-config write has no in-process signal the catalog could listen
5
+ * to, so its route reports it — and a route knows only its project, while a catalog lives inside
6
+ * the MCP composition (`startMcpService`). This map joins the two, keyed by registry project id.
7
+ *
8
+ * Degrades silently by construction: a project with no catalog (its MCP composition never started,
9
+ * or could not open a journal) reports nothing, and a report that throws is swallowed. A write
10
+ * route never fails, never slows and never changes its answer because of the leader's feed.
11
+ *
12
+ * Type-only import on purpose: `server.ts` imports this module statically, and the MCP module
13
+ * otherwise stays a lazy import so a broken MCP part can never stop the cockpit booting (N-07).
14
+ */
15
+ /** The writer-reported half of the catalog — exactly the three E-05 hooks. */
16
+ export type ProjectChangeReporter = Pick<EventCatalog, 'configChanged' | 'workflowChanged' | 'agentConfigChanged'>;
17
+ /**
18
+ * Make `reporter` the project's catalog until the returned release runs. The release removes only
19
+ * this registration, so a late release from an older composition never evicts a newer one.
20
+ */
21
+ export declare function registerProjectCatalog(projectId: string, reporter: ProjectChangeReporter): () => void;
22
+ /** Report one change to the project's catalog, if it has one. Never throws. */
23
+ export declare function reportProjectChange(projectId: string, report: (reporter: ProjectChangeReporter) => unknown): void;
@@ -0,0 +1,25 @@
1
+ const reporters = new Map();
2
+ /**
3
+ * Make `reporter` the project's catalog until the returned release runs. The release removes only
4
+ * this registration, so a late release from an older composition never evicts a newer one.
5
+ */
6
+ export function registerProjectCatalog(projectId, reporter) {
7
+ reporters.set(projectId, reporter);
8
+ return () => {
9
+ if (reporters.get(projectId) === reporter)
10
+ reporters.delete(projectId);
11
+ };
12
+ }
13
+ /** Report one change to the project's catalog, if it has one. Never throws. */
14
+ export function reportProjectChange(projectId, report) {
15
+ const reporter = reporters.get(projectId);
16
+ if (!reporter)
17
+ return;
18
+ try {
19
+ report(reporter);
20
+ }
21
+ catch {
22
+ // The catalog guards its own writes; this only keeps a future reporter bug off the route.
23
+ }
24
+ }
25
+ //# sourceMappingURL=project-catalogs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-catalogs.js","sourceRoot":"","sources":["../../src/mcp/project-catalogs.ts"],"names":[],"mappings":"AAmBA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAiC,CAAC;AAE3D;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAiB,EAAE,QAA+B;IACvF,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnC,OAAO,GAAG,EAAE;QACV,IAAI,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,QAAQ;YAAE,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACzE,CAAC,CAAC;AACJ,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,mBAAmB,CAAC,SAAiB,EAAE,MAAoD;IACzG,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1C,IAAI,CAAC,QAAQ;QAAE,OAAO;IACtB,IAAI,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC;IAAC,MAAM,CAAC;QACP,0FAA0F;IAC5F,CAAC;AACH,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { McpLeaderActionInput, McpLeaderStatus } from '../contract/index.js';
2
+ /**
3
+ * The per-project lookup `GET/POST /api/v1/mcp/leader` uses to reach the push-delivery path (#309).
4
+ * A route knows only its project, while the delivery path lives inside the MCP composition
5
+ * (`startMcpService`); this map joins the two, keyed by registry project id — the same shape as
6
+ * `project-catalogs.ts`, and for the same reason it imports types only: `server.ts` imports it
7
+ * statically, and the MCP module otherwise stays a lazy import (N-07).
8
+ */
9
+ export type LeaderActResult = {
10
+ ok: true;
11
+ status: McpLeaderStatus;
12
+ } | {
13
+ ok: false;
14
+ error: string;
15
+ };
16
+ export interface ProjectLeaderPort {
17
+ status(): McpLeaderStatus;
18
+ act(input: McpLeaderActionInput): Promise<LeaderActResult>;
19
+ }
20
+ /**
21
+ * Make `port` the project's delivery path until the returned release runs. The release removes only
22
+ * this registration, so a late release from an older composition never evicts a newer one.
23
+ */
24
+ export declare function registerProjectLeader(projectId: string, port: ProjectLeaderPort): () => void;
25
+ /** The project's delivery path, when its MCP service is running. */
26
+ export declare function projectLeader(projectId: string): ProjectLeaderPort | undefined;
@@ -0,0 +1,17 @@
1
+ const leaders = new Map();
2
+ /**
3
+ * Make `port` the project's delivery path until the returned release runs. The release removes only
4
+ * this registration, so a late release from an older composition never evicts a newer one.
5
+ */
6
+ export function registerProjectLeader(projectId, port) {
7
+ leaders.set(projectId, port);
8
+ return () => {
9
+ if (leaders.get(projectId) === port)
10
+ leaders.delete(projectId);
11
+ };
12
+ }
13
+ /** The project's delivery path, when its MCP service is running. */
14
+ export function projectLeader(projectId) {
15
+ return leaders.get(projectId);
16
+ }
17
+ //# sourceMappingURL=project-leaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-leaders.js","sourceRoot":"","sources":["../../src/mcp/project-leaders.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB,EAAE,IAAuB;IAC9E,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC7B,OAAO,GAAG,EAAE;QACV,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,IAAI;YAAE,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC,CAAC;AACJ,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The client-facing half of MCP that the bridge speaks: JSON-RPC 2.0, newline-framed
4
+ * on stdio. Hand-rolled on purpose — D-09 (qodeca/xezar#206) measured the official
5
+ * SDK at 94 installed packages and rejected it for version one, and the server
6
+ * runtime dependency budget in CODE_REVIEW.md is exhaustive. The surface is small:
7
+ * `initialize`, `ping`, `tools/list`, `tools/call`; everything else is -32601.
8
+ */
9
+ /**
10
+ * Newest first. D-01 § 1.6: the bridge must support at least these two, because the
11
+ * three required clients disagree today — Claude Code and OpenCode offer
12
+ * `2025-11-25`, Codex offers `2025-06-18` (D-01 E1–E3).
13
+ */
14
+ export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly ['2025-11-25', '2025-06-18'];
15
+ /**
16
+ * D-01 § 1.6: echo the client's requested revision when it is supported; otherwise
17
+ * answer with the newest the bridge supports and let the client decide.
18
+ */
19
+ export declare function negotiateProtocolVersion(requested: unknown): string;
20
+ /**
21
+ * Tools only. The list is fixed for the life of the process, so `listChanged` is
22
+ * false. Resources, prompts and logging are not advertised (D-05 depends on
23
+ * `tools` alone).
24
+ */
25
+ export declare const SERVER_CAPABILITIES: {
26
+ readonly tools: {
27
+ readonly listChanged: false;
28
+ };
29
+ };
30
+ export declare const JSONRPC_ERRORS: {
31
+ readonly parseError: -32700;
32
+ readonly invalidRequest: -32600;
33
+ readonly methodNotFound: -32601;
34
+ readonly invalidParams: -32602;
35
+ readonly internalError: -32603;
36
+ };
37
+ /** MCP forbids a `null` id on requests; an id is a string or an integer. */
38
+ declare const requestIdSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
39
+ export type RequestId = z.infer<typeof requestIdSchema>;
40
+ /** Anything the client may send: a request, a notification, or a response to us. */
41
+ export declare const incomingMessageSchema: z.ZodObject<{
42
+ jsonrpc: z.ZodLiteral<"2.0">;
43
+ id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
44
+ method: z.ZodOptional<z.ZodString>;
45
+ params: z.ZodOptional<z.ZodUnknown>;
46
+ }, z.core.$strip>;
47
+ export declare const initializeParamsSchema: z.ZodObject<{
48
+ protocolVersion: z.ZodString;
49
+ }, z.core.$strip>;
50
+ export {};
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The client-facing half of MCP that the bridge speaks: JSON-RPC 2.0, newline-framed
4
+ * on stdio. Hand-rolled on purpose — D-09 (qodeca/xezar#206) measured the official
5
+ * SDK at 94 installed packages and rejected it for version one, and the server
6
+ * runtime dependency budget in CODE_REVIEW.md is exhaustive. The surface is small:
7
+ * `initialize`, `ping`, `tools/list`, `tools/call`; everything else is -32601.
8
+ */
9
+ /**
10
+ * Newest first. D-01 § 1.6: the bridge must support at least these two, because the
11
+ * three required clients disagree today — Claude Code and OpenCode offer
12
+ * `2025-11-25`, Codex offers `2025-06-18` (D-01 E1–E3).
13
+ */
14
+ export const SUPPORTED_PROTOCOL_VERSIONS = ['2025-11-25', '2025-06-18'];
15
+ /**
16
+ * D-01 § 1.6: echo the client's requested revision when it is supported; otherwise
17
+ * answer with the newest the bridge supports and let the client decide.
18
+ */
19
+ export function negotiateProtocolVersion(requested) {
20
+ return SUPPORTED_PROTOCOL_VERSIONS.find((v) => v === requested) ?? SUPPORTED_PROTOCOL_VERSIONS[0];
21
+ }
22
+ /**
23
+ * Tools only. The list is fixed for the life of the process, so `listChanged` is
24
+ * false. Resources, prompts and logging are not advertised (D-05 depends on
25
+ * `tools` alone).
26
+ */
27
+ export const SERVER_CAPABILITIES = { tools: { listChanged: false } };
28
+ export const JSONRPC_ERRORS = {
29
+ parseError: -32700,
30
+ invalidRequest: -32600,
31
+ methodNotFound: -32601,
32
+ invalidParams: -32602,
33
+ internalError: -32603,
34
+ };
35
+ /** MCP forbids a `null` id on requests; an id is a string or an integer. */
36
+ const requestIdSchema = z.union([z.string().max(256), z.number().int()]);
37
+ /** Anything the client may send: a request, a notification, or a response to us. */
38
+ export const incomingMessageSchema = z.object({
39
+ jsonrpc: z.literal('2.0'),
40
+ id: requestIdSchema.optional(),
41
+ method: z.string().min(1).max(256).optional(),
42
+ params: z.unknown().optional(),
43
+ });
44
+ export const initializeParamsSchema = z.object({
45
+ protocolVersion: z.string().max(64),
46
+ });
47
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/mcp/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,YAAY,EAAE,YAAY,CAAU,CAAC;AAEjF;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAkB;IACzD,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAAC;AACpG,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,EAAW,CAAC;AAE9E,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,CAAC,KAAK;IAClB,cAAc,EAAE,CAAC,KAAK;IACtB,cAAc,EAAE,CAAC,KAAK;IACtB,aAAa,EAAE,CAAC,KAAK;IACrB,aAAa,EAAE,CAAC,KAAK;CACb,CAAC;AAEX,4EAA4E;AAC5E,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAGzE,oFAAoF;AACpF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,EAAE,EAAE,eAAe,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC7C,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;CACpC,CAAC,CAAC"}
@@ -0,0 +1,297 @@
1
+ import { type McpJournalCursorTooOld, type McpJournalRow, type RunStatus } from '../contract/index.js';
2
+ import type { RunStore } from '../runs/store.ts';
3
+ import type { LeaderRecord } from './event-controller.ts';
4
+ import type { EventJournal } from './event-journal.ts';
5
+ /**
6
+ * Reconnect for the MCP project leader (#105): on reconnection the leader receives its OUTSTANDING
7
+ * significant events plus the CURRENT AUTHORITATIVE STATE; duplicates and out-of-order delivery
8
+ * cause no repeated effect; a gap is stated, never skipped. Built over #103's journal
9
+ * (`event-journal.ts`) and #101's operation receipts (`operation-receipts.ts`). Every rule below was
10
+ * decided by D-05 (`docs/features/mcp-server/mcp-d05-async-event-contract-decision.md`) and every
11
+ * number by D-09 (`mcp-d09-limits-retention-packaging-decision.md`); nothing here picks its own.
12
+ *
13
+ * THE NUMBERS, as given (none is new, none is a knob, no `XEZ_*` variable):
14
+ * - retention: 10 000 rows per project, and a row younger than 14 days is never evicted (D-05 N1,
15
+ * D-09 B-19) — enforced by the journal; a cursor behind it gets the explicit `cursor_too_old`;
16
+ * - replay page: 100 rows (D-05 N2, D-09 B-02/B-20) and 40 000 bytes (B-01), whichever first;
17
+ * - the current-state snapshot: at most 100 tasks, the same B-02 page bound;
18
+ * - coalescing window: none (D-05 N3) — every new row is its own delivery;
19
+ * - the delivered cursor is persisted per delivery, not batched across deliveries (D-05 N4).
20
+ *
21
+ * THE FIVE GUARANTEES, and where each lives:
22
+ *
23
+ * 1. A disconnect never stops, cancels or loses a started task (F-21, N-05 — mandatory). Client
24
+ * occupancy is separate from executor lifetime BY CONSTRUCTION: nothing in this module holds
25
+ * the run manager, and `LeaderFeed.disconnect` only drops the journal subscription. The journal
26
+ * keeps recording while no client is connected, because its writer lives with the project, not
27
+ * with a leader connection; a reconnect then reads what was written meanwhile.
28
+ * 2. Outstanding events plus current state (F-21). `reconnect` replays strictly after the leader's
29
+ * acknowledged cursor, in `journalSeq` order, THEN reads the current state — D-05 § 6.5's order,
30
+ * the same one `GET /api/v1/runs/:id/events` uses (replay, dedupe with `>`, then snapshot), and
31
+ * the same shape as the cockpit's `reconcile()` in `packages/web/src/api/global-events.tsx`:
32
+ * after a reconnect the local picture is a guess, so the authoritative state is re-read.
33
+ * 3. At-least-once delivery, no repeated effect (D-05 § 6.6, N-10). The server may deliver a row
34
+ * again — after a lost acknowledgement or a restart. The consumer's `LeaderInbox` drops a row
35
+ * it has already delivered (identity is the `eventId`, D-05 § 6.1) and releases rows only in
36
+ * `journalSeq` order, so a duplicate or a reordered row is never a second decision point. A
37
+ * reaction that MUTATES carries `reactionOperationId`, so a second delivery that does reach
38
+ * the leader (a restart lost the inbox) is answered from the #101 receipt — replayed, no second
39
+ * effect. There is no second deduplication store here; the receipts are that store.
40
+ * 4. Explicit gaps (A-21). A cursor whose rows retention has evicted, or one from a journal that
41
+ * was recreated, gets the journal's own `cursor_too_old` answer — oldest retained seq, a resume
42
+ * cursor and the current-state recovery — with the state snapshot beside it. Nothing is
43
+ * replayed partially, because a partial replay reads as "nothing happened in between".
44
+ * 5. No polling, no heartbeat (F-20, N-06). `LeaderFeed` wakes the leader only from the journal's
45
+ * own append signal. It starts no timer and no interval; with no significant event, it never
46
+ * wakes anyone. A leader that is told `hasMore` reads the next page because it was told to —
47
+ * that is bounded recovery, not a status poll.
48
+ *
49
+ * COMPLETION AFTER A HUMAN CANCELLATION OR CHANGE — the documented resolution (the case the
50
+ * compatibility report names). Order is the journal's, never arrival order: `LeaderInbox` holds a
51
+ * row that arrives ahead of a missing one, so a late completion is released in its own place.
52
+ * Authority is the CURRENT state, never the event: every row carries `subject.version` (D-05
53
+ * § 6.3), and a row whose version is no longer the subject's current version is delivered with
54
+ * `standing: 'superseded'`. It is history the leader may read, not a fact to act on. The human's
55
+ * action stands: a leader mutation built on the superseded row carries the stale version and is
56
+ * refused by #100's stale-write check (`stale-write.ts`), with nothing applied. The engine itself
57
+ * keeps cancellation final — a step that finishes after cancellation is recorded `cancelled`
58
+ * (`workflows/run.ts`, the `state.cancelled` branch after a step ends; read from source) — and
59
+ * nothing here resurrects, re-completes or resumes a task because of a late event.
60
+ *
61
+ * WHAT THIS IS NOT. It emits no significant event: deriving E-01–E-06 from status transitions and
62
+ * human actions is #104. It is not a tool (no entry in `tools/index.ts`), opens no socket and adds
63
+ * no channel: the transport is D-01's, and the cockpit keeps its one SSE stream and one WebSocket.
64
+ * It adds no run queue and no process controller: `RunManager`, `RunStore` and the semaphore keep
65
+ * task lifecycle.
66
+ *
67
+ * Retention: D-05's table marks `ackedSeq` as the cursor that drives retention. D-09 adopted
68
+ * retention as B-19's count-and-age bound, which the journal enforces whatever has been acked; a
69
+ * leader that is offline longer than that gets `cursor_too_old`, never a silent skip. The ack is
70
+ * persisted here so a leader resumes where it stopped across reconnects and restarts.
71
+ */
72
+ /** The leader's cursors, beside the journal in `<dataDir>/mcp/` (inside `.local/`, blanket-ignored). */
73
+ export declare const LEADER_CURSORS_FILE = "leader-cursors.json";
74
+ /** D-09 B-02: the current-state snapshot is bounded like every other MCP list. */
75
+ export declare const RECONNECT_STATE_MAX_TASKS = 100;
76
+ /** The three positions D-05 § 6.6 keeps apart. `reactedSeq` behind `deliveredSeq` is normal. */
77
+ export interface LeaderPosition {
78
+ deliveredSeq: number;
79
+ ackedSeq: number;
80
+ reactedSeq: number;
81
+ }
82
+ export type AckResult = {
83
+ status: 'acked';
84
+ ackedSeq: number;
85
+ }
86
+ /** At or below the current ack, or for rows retention already evicted: success, no rewind. */
87
+ | {
88
+ status: 'no-op';
89
+ ackedSeq: number;
90
+ };
91
+ export interface LeaderCursorsOptions {
92
+ dataDir: string;
93
+ /** From the trusted binding, never a tool argument. */
94
+ projectId: string;
95
+ journal: EventJournal;
96
+ warn?: (message: string) => void;
97
+ }
98
+ /**
99
+ * The leader's delivered / acked / reacted positions for one project, persisted (tmp+rename,
100
+ * `0600`). Written, never required: a missing file is a leader that has never connected, and it
101
+ * starts at the journal head — recorded as where rows begin to be owed, and reported as nothing
102
+ * delivered, acknowledged or reacted, because none of that happened. A corrupt one does the same with ONE warning, set aside as `.corrupt`,
103
+ * and the reconnect answer says `fresh: true` so a start from "now" is stated rather than implied.
104
+ * An unwritable directory keeps the positions in memory with one warning; nothing throws.
105
+ */
106
+ export declare class LeaderCursors implements LeaderRecord {
107
+ #private;
108
+ readonly path: string;
109
+ private constructor();
110
+ static open(opts: LeaderCursorsOptions): LeaderCursors;
111
+ /** True when no stored position existed, so the leader started at the journal head. */
112
+ get fresh(): boolean;
113
+ /** The cursor a reconnect replays after — a cursor the journal minted, never one built here. */
114
+ get ackedCursor(): string;
115
+ /** Positions in the CURRENT journal. A position from a recreated journal counts as 0 here. */
116
+ position(): LeaderPosition;
117
+ /**
118
+ * Where rows start being OWED to the leader — its last acknowledgement, or where its record began —
119
+ * for push delivery (`LeaderRecord`, #332). A record from a recreated journal owes the new one from
120
+ * its start: `sameEpoch` false, and the reader states the gap.
121
+ */
122
+ owedAfter(): {
123
+ seq: number;
124
+ sameEpoch: boolean;
125
+ };
126
+ /** The last row the leader acknowledged through the tool; 0 when it never has (`LeaderRecord`). */
127
+ acknowledged(): number;
128
+ /** Non-model: the transport handed rows through `seq` to the client (D-05 § 6.6). Monotonic. */
129
+ markDelivered(seq: number): void;
130
+ /** Non-model: a model turn carrying rows through `seq` was actually started (D-05 § 6.6). */
131
+ markReacted(seq: number): void;
132
+ /**
133
+ * The leader has durably taken every row up to `cursor` into account — the `nextCursor` of a
134
+ * page, or the `resumeCursor` of a gap. Monotonic and idempotent: a cursor at or below the
135
+ * current ack is a successful no-op, never a rewind and never an error (D-05 § 6.6). Replaying
136
+ * from an earlier position is a different request — `reconnect` with an explicit cursor — and it
137
+ * never moves the ack. A malformed or foreign cursor throws `McpJournalCursorError`.
138
+ */
139
+ ack(cursor: string): AckResult;
140
+ }
141
+ /** One task as it is NOW. `status: null` means it no longer exists (deleted or pruned). */
142
+ export interface TaskState {
143
+ id: string;
144
+ status: RunStatus | null;
145
+ /** The #100 version token a mutation of this task must carry, or `null` when it is gone. */
146
+ version: string | null;
147
+ }
148
+ export interface CurrentState {
149
+ /** The journal head when the state was read: rows up to here are reflected in it. */
150
+ latestSeq: number;
151
+ /** The tasks named by the delivered rows, then every task still in flight, newest first. */
152
+ tasks: TaskState[];
153
+ /** False when the B-02 bound cut the list — the task read tool pages the rest. */
154
+ complete: boolean;
155
+ }
156
+ /** Reads the current state of the project. Synchronous: the stores it wraps are, and so the state
157
+ * and the journal head it reports are read in one stretch that no append can interleave with. */
158
+ export type StateReader = (subjects: readonly McpJournalRow['subject'][]) => CurrentState;
159
+ /**
160
+ * The default state reader over the project's own `RunStore` — the store the cockpit reads (N-02).
161
+ * A projection only — id, status and version — so no title, prompt, transcript or account detail
162
+ * reaches a model (F-15, N-01); the task read tool (#91) is where a leader reads more.
163
+ */
164
+ export declare function runStateReader(store: RunStore, journal: Pick<EventJournal, 'latestSeq'>): StateReader;
165
+ /**
166
+ * How a delivered row stands against the current state:
167
+ * - `current` — its subject is still at the version the row names;
168
+ * - `superseded` — the subject changed since (or is gone): history to read, not a fact to act on;
169
+ * - `unjudged` — the snapshot does not cover this subject (not a task, or the row has no version).
170
+ */
171
+ export type RowStanding = 'current' | 'superseded' | 'unjudged';
172
+ export interface DeliveredRow {
173
+ row: McpJournalRow;
174
+ standing: RowStanding;
175
+ }
176
+ export type ReconnectAnswer = {
177
+ status: 'ok';
178
+ /** Outstanding rows, strictly after the cursor, in `journalSeq` order. */
179
+ events: DeliveredRow[];
180
+ /** Acknowledge this once the page is taken into account; read after it for more. */
181
+ nextCursor: string;
182
+ /** More rows are already retained past `nextCursor` — read again, do not wait for an event. */
183
+ hasMore: boolean;
184
+ state: CurrentState;
185
+ position: LeaderPosition;
186
+ /** No stored position existed: the leader starts from the journal head. Stated, not implied. */
187
+ fresh: boolean;
188
+ /** An event's identity across journal recreations is (journalEpoch, eventId). Not a cursor. */
189
+ journalEpoch: string;
190
+ } | {
191
+ status: 'cursor_too_old';
192
+ /** The journal's own gap answer: oldest retained seq, resume cursor, required recovery. */
193
+ gap: McpJournalCursorTooOld;
194
+ state: CurrentState;
195
+ position: LeaderPosition;
196
+ fresh: boolean;
197
+ journalEpoch: string;
198
+ };
199
+ export interface ReconnectOptions {
200
+ journal: EventJournal;
201
+ cursors: LeaderCursors;
202
+ readState: StateReader;
203
+ /** Replay from here instead of the acknowledged position — a rewind request. Never moves the ack. */
204
+ cursor?: string;
205
+ /** Rows per page, at most B-02's 100. */
206
+ limit?: number;
207
+ }
208
+ /**
209
+ * Everything a reconnecting leader needs in one answer: the outstanding rows after its
210
+ * acknowledged position (or after `cursor`), then the current state — or, when the rows it needs
211
+ * are gone, the explicit gap plus the current state. A malformed or foreign cursor throws
212
+ * `McpJournalCursorError`: it is never read as "start from zero" (D-05 § 6.5).
213
+ */
214
+ export declare function reconnect(opts: ReconnectOptions): ReconnectAnswer;
215
+ /** Stand each row against the current state — see the module comment's completion-after-cancel rule. */
216
+ export declare function judge(rows: readonly McpJournalRow[], state: CurrentState): DeliveredRow[];
217
+ export interface LeaderDelivery {
218
+ events: DeliveredRow[];
219
+ nextCursor: string;
220
+ hasMore: boolean;
221
+ state: CurrentState;
222
+ journalEpoch: string;
223
+ }
224
+ export interface LeaderFeedOptions {
225
+ journal: EventJournal;
226
+ cursors: LeaderCursors;
227
+ readState: StateReader;
228
+ /**
229
+ * Starts a decision point — the adapter's hook (Phase 6). Called ONLY because a significant row
230
+ * was appended; never on a timer. Its return value is ignored, and a throw never undoes delivery.
231
+ */
232
+ wake: (delivery: LeaderDelivery) => void;
233
+ /**
234
+ * The F-13 echo guard (D-05 § 6.3): true for an operation this leader has outstanding. A row
235
+ * whose `origin` is `leader` AND whose `causedBy` is one of those is delivered — the cursor moves
236
+ * past it — but it does not wake the leader. A row is never dropped merely for naming a known run.
237
+ */
238
+ isOwnOperation?: (operationId: string) => boolean;
239
+ }
240
+ /**
241
+ * The connection-scoped half: one live subscription to the journal while a leader is connected.
242
+ * No timer, no interval, no heartbeat — liveness of the CLIENT is the transport's ping (D-09 B-17),
243
+ * never a model turn and never this class. `disconnect` touches nothing but the subscription.
244
+ */
245
+ export declare class LeaderFeed {
246
+ #private;
247
+ constructor(opts: LeaderFeedOptions);
248
+ get connected(): boolean;
249
+ /**
250
+ * Connect (or reconnect): subscribe to live appends, then answer with the outstanding rows and
251
+ * the current state. The subscription goes first, so no row appended during the answer can fall
252
+ * between the replay and the live half; the live half reads strictly after the answer's cursor,
253
+ * so no row can arrive twice either. The answer goes back to the caller — the leader asked for
254
+ * it — and does not itself wake anyone.
255
+ */
256
+ connect(cursor?: string): ReconnectAnswer;
257
+ /** Client occupancy ends here and ONLY here. No task is touched: executor lifetime is not ours. */
258
+ disconnect(): void;
259
+ }
260
+ export interface InboxAccept {
261
+ /** Rows released now, in `journalSeq` order, each exactly once. Empty = no decision point. */
262
+ deliver: McpJournalRow[];
263
+ /** Rows dropped because they were already delivered or already held. */
264
+ duplicates: number;
265
+ /** The first missing range while later rows are held; `null` when nothing is missing. */
266
+ missing: {
267
+ fromSeq: number;
268
+ toSeq: number;
269
+ } | null;
270
+ }
271
+ /**
272
+ * The consumer's half of at-least-once delivery (D-05 § 6.6: "the leader deduplicates on
273
+ * `eventId`"). Deduplication is on the `eventId` alone, and within one project a gapless
274
+ * `journalSeq` is that identity's order: a row at or below the delivered position is a duplicate,
275
+ * a row ahead of a missing one is held until the gap fills, and the gap is reported. Start it at
276
+ * the acknowledged position; after a restart it may therefore release a row again — the reaction's
277
+ * `reactionOperationId` is what keeps that second look from becoming a second effect.
278
+ */
279
+ export declare class LeaderInbox {
280
+ #private;
281
+ readonly projectId: string;
282
+ constructor(opts: {
283
+ projectId: string;
284
+ afterSeq: number;
285
+ });
286
+ get deliveredSeq(): number;
287
+ accept(rows: readonly McpJournalRow[]): InboxAccept;
288
+ }
289
+ /**
290
+ * The operation id of the leader's reaction to one event (N-10, D-06 § 5.2). Deterministic, so a
291
+ * second delivery of the same row produces the same id and #101's receipt store answers it as a
292
+ * replay with no second effect. The journal epoch is part of it because `journalSeq` restarts at 1
293
+ * in a recreated journal: without it a genuinely new event would replay an old event's result.
294
+ * `label` separates different reactions to one event (`start-review`, `cancel`); deliberately new
295
+ * identical work takes a new id, as N-10 requires, and never this one.
296
+ */
297
+ export declare function reactionOperationId(journalEpoch: string, row: Pick<McpJournalRow, 'journalSeq'>, label: string): string;