wiki-viewer 2.12.0 → 2.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 (405) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +14 -1
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +1 -1
  6. package/.next/standalone/.next/routes-manifest.json +81 -3
  7. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/agent/admin/registrations/[regId]/approve/route.js +1 -1
  17. package/.next/standalone/.next/server/app/api/agent/admin/registrations/[regId]/deny/route.js +1 -1
  18. package/.next/standalone/.next/server/app/api/agent/admin/registrations/route.js +1 -1
  19. package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js +7 -7
  21. package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +7 -7
  23. package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js +1 -1
  25. package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +1 -1
  27. package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +1 -1
  29. package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/agent/live/attach/route/app-paths-manifest.json +3 -0
  31. package/.next/standalone/.next/server/app/api/agent/{internal/span → live/attach}/route.js +11 -11
  32. package/.next/standalone/.next/server/app/api/agent/live/attach/route.js.nft.json +1 -0
  33. package/.next/standalone/.next/server/app/api/agent/live/attach/route_client-reference-manifest.js +3 -0
  34. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route/app-paths-manifest.json +3 -0
  35. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route/build-manifest.json +9 -0
  36. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route/server-reference-manifest.json +4 -0
  37. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route.js +17 -0
  38. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route.js.map +5 -0
  39. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route.js.nft.json +1 -0
  40. package/.next/standalone/.next/server/app/api/agent/live/md-preview/route_client-reference-manifest.js +3 -0
  41. package/.next/standalone/.next/server/app/api/agent/live/poll/route/app-paths-manifest.json +3 -0
  42. package/.next/standalone/.next/server/app/api/agent/live/poll/route/build-manifest.json +9 -0
  43. package/.next/standalone/.next/server/app/api/agent/live/poll/route/server-reference-manifest.json +4 -0
  44. package/.next/standalone/.next/server/app/api/agent/live/poll/route.js +17 -0
  45. package/.next/standalone/.next/server/app/api/agent/live/poll/route.js.map +5 -0
  46. package/.next/standalone/.next/server/app/api/agent/live/poll/route.js.nft.json +1 -0
  47. package/.next/standalone/.next/server/app/api/agent/live/poll/route_client-reference-manifest.js +3 -0
  48. package/.next/standalone/.next/server/app/api/agent/live/reply/route/app-paths-manifest.json +3 -0
  49. package/.next/standalone/.next/server/app/api/agent/live/reply/route/build-manifest.json +9 -0
  50. package/.next/standalone/.next/server/app/api/agent/live/reply/route/server-reference-manifest.json +4 -0
  51. package/.next/standalone/.next/server/app/api/agent/live/reply/route.js +17 -0
  52. package/.next/standalone/.next/server/app/api/agent/live/reply/route.js.map +5 -0
  53. package/.next/standalone/.next/server/app/api/agent/{internal/span → live/reply}/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/agent/live/reply/route_client-reference-manifest.js +3 -0
  55. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route/app-paths-manifest.json +3 -0
  56. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route/build-manifest.json +9 -0
  57. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route/server-reference-manifest.json +4 -0
  58. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route.js +18 -0
  59. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route.js.map +5 -0
  60. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route.js.nft.json +1 -0
  61. package/.next/standalone/.next/server/app/api/agent/live/web-preview/route_client-reference-manifest.js +3 -0
  62. package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js +9 -9
  64. package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/pdf/save/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/share/[token]/asset/route.js +1 -1
  69. package/.next/standalone/.next/server/app/api/share/[token]/asset/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/share/[token]/route.js +1 -1
  71. package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/share/route.js +1 -1
  73. package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
  76. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/branch/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js +1 -1
  84. package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/wiki/content/route.js +1 -1
  86. package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
  90. package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
  92. package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route/app-paths-manifest.json +3 -0
  96. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route/build-manifest.json +9 -0
  97. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route/server-reference-manifest.json +4 -0
  98. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route.js +18 -0
  99. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route.js.map +5 -0
  100. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route.js.nft.json +1 -0
  101. package/.next/standalone/.next/server/app/api/wiki/live/md-request/route_client-reference-manifest.js +3 -0
  102. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route/app-paths-manifest.json +3 -0
  103. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route/build-manifest.json +9 -0
  104. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route/server-reference-manifest.json +4 -0
  105. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route.js +18 -0
  106. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route.js.map +5 -0
  107. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route.js.nft.json +1 -0
  108. package/.next/standalone/.next/server/app/api/wiki/live/md-resolve/route_client-reference-manifest.js +3 -0
  109. package/.next/standalone/.next/server/app/api/wiki/live/md-status/route/app-paths-manifest.json +3 -0
  110. package/.next/standalone/.next/server/app/api/wiki/live/md-status/route/build-manifest.json +9 -0
  111. package/.next/standalone/.next/server/app/api/wiki/live/md-status/route/server-reference-manifest.json +4 -0
  112. package/.next/standalone/.next/server/app/api/wiki/live/md-status/route.js +16 -0
  113. package/.next/standalone/.next/server/app/api/wiki/live/md-status/route.js.map +5 -0
  114. package/.next/standalone/.next/server/app/api/wiki/live/md-status/route.js.nft.json +1 -0
  115. package/.next/standalone/.next/server/app/api/{agent/internal/span → wiki/live/md-status}/route_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/api/wiki/live/request/route/app-paths-manifest.json +3 -0
  117. package/.next/standalone/.next/server/app/api/wiki/live/request/route/build-manifest.json +9 -0
  118. package/.next/standalone/.next/server/app/api/wiki/live/request/route/server-reference-manifest.json +4 -0
  119. package/.next/standalone/.next/server/app/api/wiki/live/request/route.js +16 -0
  120. package/.next/standalone/.next/server/app/api/wiki/live/request/route.js.map +5 -0
  121. package/.next/standalone/.next/server/app/api/wiki/live/request/route.js.nft.json +1 -0
  122. package/.next/standalone/.next/server/app/api/wiki/live/request/route_client-reference-manifest.js +3 -0
  123. package/.next/standalone/.next/server/app/api/wiki/live/status/route/app-paths-manifest.json +3 -0
  124. package/.next/standalone/.next/server/app/api/wiki/live/status/route/build-manifest.json +9 -0
  125. package/.next/standalone/.next/server/app/api/wiki/live/status/route/server-reference-manifest.json +4 -0
  126. package/.next/standalone/.next/server/app/api/wiki/live/status/route.js +17 -0
  127. package/.next/standalone/.next/server/app/api/wiki/live/status/route.js.map +5 -0
  128. package/.next/standalone/.next/server/app/api/wiki/live/status/route.js.nft.json +1 -0
  129. package/.next/standalone/.next/server/app/api/wiki/live/status/route_client-reference-manifest.js +3 -0
  130. package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
  131. package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
  132. package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
  133. package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
  134. package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
  135. package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
  136. package/.next/standalone/.next/server/app/api/wiki/scratch/route.js.nft.json +1 -1
  137. package/.next/standalone/.next/server/app/api/wiki/search/route.js +1 -1
  138. package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
  139. package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
  141. package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route/app-paths-manifest.json +3 -0
  143. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route/build-manifest.json +9 -0
  144. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route/server-reference-manifest.json +4 -0
  145. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route.js +7 -0
  146. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route.js.map +5 -0
  147. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route.js.nft.json +1 -0
  148. package/.next/standalone/.next/server/app/api/wiki/web-tweak/picker.js/route_client-reference-manifest.js +3 -0
  149. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route/app-paths-manifest.json +3 -0
  150. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route/build-manifest.json +9 -0
  151. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route/server-reference-manifest.json +4 -0
  152. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route.js +16 -0
  153. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route.js.map +5 -0
  154. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route.js.nft.json +1 -0
  155. package/.next/standalone/.next/server/app/api/wiki/web-tweak/request/route_client-reference-manifest.js +3 -0
  156. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route/app-paths-manifest.json +3 -0
  157. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route/build-manifest.json +9 -0
  158. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route/server-reference-manifest.json +4 -0
  159. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route.js +17 -0
  160. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route.js.map +5 -0
  161. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route.js.nft.json +1 -0
  162. package/.next/standalone/.next/server/app/api/wiki/web-tweak/resolve/route_client-reference-manifest.js +3 -0
  163. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route/app-paths-manifest.json +3 -0
  164. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route/build-manifest.json +9 -0
  165. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route/server-reference-manifest.json +4 -0
  166. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route.js +16 -0
  167. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route.js.map +5 -0
  168. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route.js.nft.json +1 -0
  169. package/.next/standalone/.next/server/app/api/wiki/web-tweak/status/route_client-reference-manifest.js +3 -0
  170. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  171. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  172. package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  173. package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
  174. package/.next/standalone/.next/server/app-paths-manifest.json +14 -1
  175. package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_031ecpl.js +274 -0
  176. package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0afqvqi.js +3 -0
  177. package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0ofi5.l.js +3 -0
  178. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__07wa2lq._.js → [root-of-the-server]__0-l8919._.js} +2 -2
  179. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0e~2gkf._.js → [root-of-the-server]__0-vsohg._.js} +2 -2
  180. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.xk8gi._.js +1 -1
  181. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0002pqj._.js +1 -1
  182. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01v1udu._.js +16 -0
  183. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01y-312._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/[root-of-the-server]__020sc-x._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02373p-._.js +1 -1
  186. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0n2r6u9._.js → [root-of-the-server]__03c8~ck._.js} +2 -2
  187. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03qy0.z._.js +55 -0
  188. package/.next/standalone/.next/server/chunks/[root-of-the-server]__056pu9b._.js +1 -1
  189. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06kspyc._.js +3 -0
  190. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07bxa4u._.js +90 -0
  191. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08xiuca._.js +1 -1
  192. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0936qml._.js +43 -0
  193. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09g2xhj._.js +3 -0
  194. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0badnl7._.js +43 -0
  195. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bqhp4b._.js +1 -1
  196. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dk42.p._.js +90 -0
  197. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e_irm6._.js +1 -1
  198. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iksibp._.js +3 -0
  199. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jlrhzi._.js +55 -0
  200. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kamtmx._.js +50 -0
  201. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kpcc70._.js +3 -0
  202. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0laknd~._.js +3 -0
  203. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0m.o598._.js +3 -0
  204. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mgvfb5._.js +1 -1
  205. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n7uto3._.js +1 -1
  206. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0oxzq2p._.js +8 -0
  207. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r-3u3v._.js +8 -0
  208. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t8r97l._.js +50 -0
  209. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vuw0yp._.js +50 -0
  210. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0xoz8e8._.js → [root-of-the-server]__0wtrbmm._.js} +2 -2
  211. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y4lx2l._.js +50 -0
  212. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z5xk6f._.js +1 -1
  213. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zrcu6l._.js +20 -0
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10-ona2._.js +20 -0
  215. package/.next/standalone/.next/server/chunks/[root-of-the-server]__130a-u1._.js +50 -0
  216. package/.next/standalone/.next/server/chunks/_079xuln._.js +1 -1
  217. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_live_attach_route_actions_0cy5eae.js +3 -0
  218. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_live_md-preview_route_actions_07po~tm.js +3 -0
  219. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_live_poll_route_actions_0tef7r~.js +3 -0
  220. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_live_reply_route_actions_0modpib.js +3 -0
  221. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_live_web-preview_route_actions_0qjm1cw.js +3 -0
  222. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_live_md-request_route_actions_0z5ad2q.js +3 -0
  223. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_live_md-resolve_route_actions_0_8g88b.js +3 -0
  224. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_live_md-status_route_actions_02ykgzf.js +3 -0
  225. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_live_request_route_actions_00m8pc2.js +3 -0
  226. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_live_status_route_actions_0v.pypx.js +3 -0
  227. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_web-tweak_picker_js_route_actions_118~f~j.js +3 -0
  228. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_web-tweak_request_route_actions_0wlzrco.js +3 -0
  229. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_web-tweak_resolve_route_actions_0wq6pw5.js +3 -0
  230. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_web-tweak_status_route_actions_0vr4h6u.js +3 -0
  231. package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_0-fyxoz._.js → 0~w0_katex_dist_katex_mjs_0okh~tf._.js} +1 -1
  232. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_blockDiagram-GPEHLZMM_mjs_0v204vn._.js +1 -1
  233. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_c4Diagram-AAUBKEIU_mjs_0.iwqva._.js +1 -1
  234. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-3OPIFGDE_mjs_09p1amp._.js +1 -1
  235. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-5ZQYHXKU_mjs_0z1.978._.js +1 -1
  236. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-727SXJPM_mjs_115~dsb._.js +1 -1
  237. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-AQP2D5EJ_mjs_0euza.d._.js +1 -1
  238. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-CSCIHK7Q_mjs_01i7moi._.js +2 -2
  239. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-KSCS5N6A_mjs_0v4oeem._.js +1 -1
  240. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_chunk-O5CBEL6O_mjs_11437bo._.js +1 -1
  241. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_dagre-BM42HDAG_mjs_05ekknz._.js +1 -1
  242. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_diagram-OG6HWLK6_mjs_0t5sus6._.js +1 -1
  243. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_erDiagram-TEJ5UH35_mjs_0v6rnqy._.js +1 -1
  244. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_flowDiagram-I6XJVG4X_mjs_13pu1pv._.js +1 -1
  245. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_gitGraphDiagram-PVQCEYII_mjs_0jp8i-h._.js +1 -1
  246. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_ishikawaDiagram-YF4QCWOH_mjs_0tcayi4._.js +1 -1
  247. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_journeyDiagram-JHISSGLW_mjs_0-ln2o9._.js +1 -1
  248. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_kanban-definition-UN3LZRKU_mjs_0_sdvmq._.js +1 -1
  249. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_mindmap-definition-RKZ34NQL_mjs_002sdr9._.js +1 -1
  250. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_quadrantDiagram-W4KKPZXB_mjs_0re1qsf._.js +1 -1
  251. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_requirementDiagram-4Y6WPE33_mjs_067p6fg._.js +1 -1
  252. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_sankeyDiagram-5OEKKPKP_mjs_11ifrnu._.js +1 -1
  253. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_sequenceDiagram-3UESZ5HK_mjs_015n5fb._.js +1 -1
  254. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_stateDiagram-AJRCARHV_mjs_0q8ykwx._.js +1 -1
  255. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_timeline-definition-PNZ67QCA_mjs_0ie6b6s._.js +1 -1
  256. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_vennDiagram-CIIHVFJN_mjs_0hds9fe._.js +1 -1
  257. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_wardleyDiagram-YWT4CUSO_mjs_0s.dkn9._.js +1 -1
  258. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_xychartDiagram-2RQKCTM6_mjs_0v-eh5w._.js +1 -1
  259. package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_mermaid_core_mjs_0hj_n-~._.js +1 -1
  260. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~4py6h._.js → [root-of-the-server]__0t5fses._.js} +2 -2
  261. package/.next/standalone/.next/server/chunks/ssr/_0d9d~c~._.js +1 -1
  262. package/.next/standalone/.next/server/chunks/ssr/_0kkaybx._.js +1 -1
  263. package/.next/standalone/.next/server/chunks/ssr/_0oq8kwv._.js +284 -12
  264. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0f0qocb._.js → node_modules__pnpm_0-l23--._.js} +2 -2
  265. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0_g0a7t._.js → node_modules__pnpm_00d-n5v._.js} +2 -2
  266. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0v7wopg._.js → node_modules__pnpm_014r.0e._.js} +2 -2
  267. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0zdl7-7._.js → node_modules__pnpm_03j578g._.js} +2 -2
  268. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_04rulr6._.js +1 -1
  269. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09y5c~i._.js → node_modules__pnpm_05qsb2c._.js} +2 -2
  270. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0sdy2lv._.js → node_modules__pnpm_08i5ti8._.js} +2 -2
  271. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0b6_242._.js → node_modules__pnpm_09t82cx._.js} +2 -2
  272. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0f6r-u~._.js → node_modules__pnpm_09~hu70._.js} +3 -3
  273. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0pggrwu._.js → node_modules__pnpm_0cfriah._.js} +2 -2
  274. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_02qa21p._.js → node_modules__pnpm_0ct341~._.js} +2 -2
  275. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0d4-t2b._.js → node_modules__pnpm_0eps_u_._.js} +2 -2
  276. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0fb6~r_._.js +1 -1
  277. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0q9s5k5._.js → node_modules__pnpm_0k47joo._.js} +2 -2
  278. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0l9eomm._.js +1 -1
  279. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0q_v1_2._.js → node_modules__pnpm_0nsy85b._.js} +1 -1
  280. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0vahm7l._.js → node_modules__pnpm_0n~wbom._.js} +2 -2
  281. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0.xieh4._.js → node_modules__pnpm_0o1._vw._.js} +2 -2
  282. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0kib6pw._.js → node_modules__pnpm_0t21hj7._.js} +2 -2
  283. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~wqhb9._.js → node_modules__pnpm_0tl8mi0._.js} +2 -2
  284. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0f9artj._.js → node_modules__pnpm_0tqv.ym._.js} +2 -2
  285. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_05c~go7._.js → node_modules__pnpm_0v9mhna._.js} +3 -3
  286. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_07hg43b._.js → node_modules__pnpm_0w8.hpb._.js} +1 -1
  287. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0_zd0nt._.js → node_modules__pnpm_0wrxa~f._.js} +2 -2
  288. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0g_tlt-._.js → node_modules__pnpm_0xrjcxa._.js} +2 -2
  289. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ghm84g._.js → node_modules__pnpm_0xrusyy._.js} +3 -3
  290. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0c6q9~6._.js → node_modules__pnpm_0y.wb-7._.js} +1 -1
  291. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0tvmv0e._.js → node_modules__pnpm_0yu-3eu._.js} +2 -2
  292. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0k6yfdh._.js → node_modules__pnpm_11q1n~-._.js} +2 -2
  293. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_01~03ak._.js → node_modules__pnpm_1323nh~._.js} +2 -2
  294. package/.next/standalone/.next/server/functions-config-manifest.json +15 -2
  295. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  296. package/.next/standalone/.next/server/pages/500.html +1 -1
  297. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  298. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  299. package/.next/standalone/.next/static/chunks/0k~5ok-cacnor.js +417 -0
  300. package/.next/standalone/.next/static/chunks/{04um2f1eeqcss.js → 0noq2zqrh0z_0.js} +1 -1
  301. package/.next/standalone/.next/static/chunks/{04f8lhbw6m9ee.js → 0tn7wdt213lbb.js} +1 -1
  302. package/.next/standalone/.next/static/chunks/{138ap~9f.rqkh.css → 12-umagms5yro.css} +1 -1
  303. package/.next/standalone/.next/static/chunks/17446l.6t9j17.css +1 -0
  304. package/.next/standalone/.test-floor +1 -1
  305. package/.next/standalone/_status.md +19 -0
  306. package/.next/standalone/meta/contract.md +67 -0
  307. package/.next/standalone/meta/overview.md +10 -0
  308. package/.next/standalone/package.json +1 -1
  309. package/.next/standalone/queries/lint-2026-08-15.md +28 -0
  310. package/.next/standalone/server.js +1 -1
  311. package/.next/standalone/specs/changes/block-preconditions/proposal.md +90 -0
  312. package/.next/standalone/specs/changes/blockref-frontmatter-misalign/proposal.md +81 -0
  313. package/.next/standalone/specs/changes/collective-agent-review/design.md +183 -0
  314. package/.next/standalone/specs/changes/collective-agent-review/proposal.md +138 -0
  315. package/.next/standalone/specs/changes/collective-agent-review/requirements.md +100 -0
  316. package/.next/standalone/specs/changes/collective-agent-review/tasks.md +62 -0
  317. package/.next/standalone/specs/changes/live-collab/design.md +141 -0
  318. package/.next/standalone/specs/changes/live-collab/proposal.md +133 -0
  319. package/.next/standalone/specs/changes/live-collab/requirements.md +91 -0
  320. package/.next/standalone/specs/changes/live-collab/tasks.md +39 -0
  321. package/.next/standalone/specs/changes/live-collab-web/findings-termdeck.md +120 -0
  322. package/.next/standalone/specs/changes/live-collab-web/proposal.md +184 -0
  323. package/.next/standalone/specs/changes/live-unified/design.md +49 -0
  324. package/.next/standalone/specs/changes/live-unified/proposal.md +54 -0
  325. package/.next/standalone/specs/changes/web-tweak-variants/proposal.md +65 -0
  326. package/.next/standalone/wp-test-6mm5qr/burst-0.txt +1 -0
  327. package/.next/standalone/wp-test-6mm5qr/burst-1.txt +1 -0
  328. package/.next/standalone/wp-test-6mm5qr/burst-10.txt +1 -0
  329. package/.next/standalone/wp-test-6mm5qr/burst-11.txt +1 -0
  330. package/.next/standalone/wp-test-6mm5qr/burst-12.txt +1 -0
  331. package/.next/standalone/wp-test-6mm5qr/burst-13.txt +1 -0
  332. package/.next/standalone/wp-test-6mm5qr/burst-14.txt +1 -0
  333. package/.next/standalone/wp-test-6mm5qr/burst-15.txt +1 -0
  334. package/.next/standalone/wp-test-6mm5qr/burst-16.txt +1 -0
  335. package/.next/standalone/wp-test-6mm5qr/burst-17.txt +1 -0
  336. package/.next/standalone/wp-test-6mm5qr/burst-18.txt +1 -0
  337. package/.next/standalone/wp-test-6mm5qr/burst-19.txt +1 -0
  338. package/.next/standalone/wp-test-6mm5qr/burst-2.txt +1 -0
  339. package/.next/standalone/wp-test-6mm5qr/burst-20.txt +1 -0
  340. package/.next/standalone/wp-test-6mm5qr/burst-21.txt +1 -0
  341. package/.next/standalone/wp-test-6mm5qr/burst-22.txt +1 -0
  342. package/.next/standalone/wp-test-6mm5qr/burst-23.txt +1 -0
  343. package/.next/standalone/wp-test-6mm5qr/burst-24.txt +1 -0
  344. package/.next/standalone/wp-test-6mm5qr/burst-25.txt +1 -0
  345. package/.next/standalone/wp-test-6mm5qr/burst-26.txt +1 -0
  346. package/.next/standalone/wp-test-6mm5qr/burst-27.txt +1 -0
  347. package/.next/standalone/wp-test-6mm5qr/burst-28.txt +1 -0
  348. package/.next/standalone/wp-test-6mm5qr/burst-29.txt +1 -0
  349. package/.next/standalone/wp-test-6mm5qr/burst-3.txt +1 -0
  350. package/.next/standalone/wp-test-6mm5qr/burst-30.txt +1 -0
  351. package/.next/standalone/wp-test-6mm5qr/burst-31.txt +1 -0
  352. package/.next/standalone/wp-test-6mm5qr/burst-32.txt +1 -0
  353. package/.next/standalone/wp-test-6mm5qr/burst-33.txt +1 -0
  354. package/.next/standalone/wp-test-6mm5qr/burst-34.txt +1 -0
  355. package/.next/standalone/wp-test-6mm5qr/burst-35.txt +1 -0
  356. package/.next/standalone/wp-test-6mm5qr/burst-36.txt +1 -0
  357. package/.next/standalone/wp-test-6mm5qr/burst-37.txt +1 -0
  358. package/.next/standalone/wp-test-6mm5qr/burst-38.txt +1 -0
  359. package/.next/standalone/wp-test-6mm5qr/burst-39.txt +1 -0
  360. package/.next/standalone/wp-test-6mm5qr/burst-4.txt +1 -0
  361. package/.next/standalone/wp-test-6mm5qr/burst-40.txt +1 -0
  362. package/.next/standalone/wp-test-6mm5qr/burst-41.txt +1 -0
  363. package/.next/standalone/wp-test-6mm5qr/burst-42.txt +1 -0
  364. package/.next/standalone/wp-test-6mm5qr/burst-43.txt +1 -0
  365. package/.next/standalone/wp-test-6mm5qr/burst-44.txt +1 -0
  366. package/.next/standalone/wp-test-6mm5qr/burst-45.txt +1 -0
  367. package/.next/standalone/wp-test-6mm5qr/burst-46.txt +1 -0
  368. package/.next/standalone/wp-test-6mm5qr/burst-47.txt +1 -0
  369. package/.next/standalone/wp-test-6mm5qr/burst-48.txt +1 -0
  370. package/.next/standalone/wp-test-6mm5qr/burst-49.txt +1 -0
  371. package/.next/standalone/wp-test-6mm5qr/burst-5.txt +1 -0
  372. package/.next/standalone/wp-test-6mm5qr/burst-6.txt +1 -0
  373. package/.next/standalone/wp-test-6mm5qr/burst-7.txt +1 -0
  374. package/.next/standalone/wp-test-6mm5qr/burst-8.txt +1 -0
  375. package/.next/standalone/wp-test-6mm5qr/burst-9.txt +1 -0
  376. package/.next/standalone/wp-test-SiMBLk/child/nested.txt +1 -0
  377. package/.next/standalone/wp-test-SiMBLk/rootfile.txt +1 -0
  378. package/.next/standalone/wp-test-bFyuuZ/child/nested.txt +1 -0
  379. package/.next/standalone/wp-test-bFyuuZ/rootfile.txt +1 -0
  380. package/.next/standalone/wp-test-dn9shN/after-reset.txt +1 -0
  381. package/.next/standalone/wp-test-gL64l2/shared.txt +1 -0
  382. package/.next/standalone/wp-test-mlyQ7q/test.txt +1 -0
  383. package/.next/standalone/wp-test-o3g2XI/shared.txt +1 -0
  384. package/.next/standalone/wp-test-oHeYCM/subA/a.txt +1 -0
  385. package/.next/standalone/wp-test-oHeYCM/subB/b.txt +1 -0
  386. package/package.json +1 -1
  387. package/.next/standalone/.next/server/app/api/agent/internal/span/route/app-paths-manifest.json +0 -3
  388. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04vo55d._.js +0 -3
  389. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_g-.kr._.js +0 -20
  390. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bpv09n._.js +0 -20
  391. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e1kbl7._.js +0 -3
  392. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0omny3u._.js +0 -3
  393. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q~ky91._.js +0 -16
  394. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r--676._.js +0 -3
  395. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0x.030x._.js +0 -3
  396. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xlo2r_._.js +0 -3
  397. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_internal_span_route_actions_121if52.js +0 -3
  398. package/.next/standalone/.next/static/chunks/0gogvjz6oxo51.css +0 -1
  399. package/.next/standalone/.next/static/chunks/11ehczv8yax~_.js +0 -145
  400. /package/.next/standalone/.next/server/app/api/agent/{internal/span → live/attach}/route/build-manifest.json +0 -0
  401. /package/.next/standalone/.next/server/app/api/agent/{internal/span → live/attach}/route/server-reference-manifest.json +0 -0
  402. /package/.next/standalone/.next/server/app/api/agent/{internal/span → live/attach}/route.js.map +0 -0
  403. /package/.next/standalone/.next/static/{AsrmwC0YfrYEMAXj2s0Wx → BXRSlvxAOCUzi4h8wCLQi}/_buildManifest.js +0 -0
  404. /package/.next/standalone/.next/static/{AsrmwC0YfrYEMAXj2s0Wx → BXRSlvxAOCUzi4h8wCLQi}/_clientMiddlewareManifest.js +0 -0
  405. /package/.next/standalone/.next/static/{AsrmwC0YfrYEMAXj2s0Wx → BXRSlvxAOCUzi4h8wCLQi}/_ssgManifest.js +0 -0
@@ -0,0 +1,183 @@
1
+ # Design: collective agent review
2
+
3
+ ## Overview
4
+
5
+ Turn the fire-and-forget, one-target agent call into **collect → send batch → review batch**,
6
+ sharing one workflow across Markdown and web, while keeping the two write engines separate.
7
+
8
+ Two annotation kinds share the existing anchoring machinery:
9
+
10
+ - **comment** — human discussion (existing behavior).
11
+ - **instruction** — an agent work order; accumulates into a per-file queue; dispatched as one
12
+ **run**.
13
+
14
+ ## Data model
15
+
16
+ ### Markdown annotations (sidecar)
17
+
18
+ Reuse the existing `Comment` model and its anchoring/reanchor/stale machinery. Add annotation
19
+ kind + queue/run linkage as **additive, nullable** fields (Gap-1 precedent).
20
+
21
+ `src/lib/proof/types.ts`:
22
+
23
+ ```
24
+ export type AnnotationKind = "comment" | "instruction";
25
+
26
+ export interface Comment { // existing; extended
27
+ id: string;
28
+ ref?: string;
29
+ lineAnchor?: LineAnchor;
30
+ resolved: boolean;
31
+ createdAt: string;
32
+ turns: CommentTurn[];
33
+ stale?: boolean;
34
+ // NEW (all optional; absent => "comment" for legacy rows)
35
+ kind?: AnnotationKind; // "instruction" marks a work order
36
+ instructionState?: "draft" | "queued" | "sent" | "answered"; // instruction lifecycle
37
+ runId?: string; // the send run this instruction went out in
38
+ fromCommentId?: string; // backlink when escalated from a comment
39
+ }
40
+ ```
41
+
42
+ Rationale: one store, one anchoring path (no duplicate subsystem), but `kind` is a required
43
+ *semantic type* to the user (two create actions), not a soft toggle. Legacy rows with no
44
+ `kind` render as comments.
45
+
46
+ ### Web annotations
47
+
48
+ The web surface has no sidecar comment machinery. Web instructions live in the web-tweak
49
+ preview/live store as a small per-file instruction list keyed by workspace+path (new, small;
50
+ does not touch the Markdown sidecar). Same lifecycle fields (`draft/queued/sent/answered`,
51
+ `runId`).
52
+
53
+ ### Run (the batch dispatch)
54
+
55
+ A **run** is one agent dispatch carrying N instruction items. Represent it on the existing
56
+ live request:
57
+
58
+ `src/lib/proof/live/store.ts`:
59
+
60
+ - Add request kind `generate.batch` (Markdown) and reuse `web.tweak` batching for web, OR
61
+ keep `kind: "generate"` and add an `items` payload. Chosen: **add `items` to the request**
62
+ so one row = one run.
63
+
64
+ ```
65
+ export interface LiveInstructionItem {
66
+ instructionId: string; // annotation id
67
+ blockRef: string | null; // markdown block or web selector target
68
+ baseRevision: number | null;
69
+ instruction: string;
70
+ selectionText?: string | null;
71
+ }
72
+
73
+ export interface LiveRequest { // extended
74
+ ...
75
+ items: LiveInstructionItem[] | null; // NEW: batch payload; null for legacy single requests
76
+ runId: string | null; // NEW: correlation id returned on results
77
+ }
78
+ ```
79
+
80
+ The single-instruction fields (`instruction`, `blockRef`, `baseRevision`) stay for backward
81
+ compatibility and for control kinds; batch runs populate `items` + `runId`.
82
+
83
+ The **one-outstanding-request-per-session** invariant is unchanged: a run is still one
84
+ request row.
85
+
86
+ ## Correlation (run id → changes)
87
+
88
+ - On send, generate `runId` (e.g. `run:<8hex>`) and stamp it on the request and on each
89
+ queued instruction (`instruction.runId`).
90
+ - Markdown: the agent's tier-2 ops already carry `inResponseTo`. Extend the request's
91
+ idempotency/correlation so activity-log provenance produced for this run carry the `runId` (via the
92
+ existing `ActivityAttrs` provenance). The editor groups activity-log provenance by `runId` to offer
93
+ "Accept run / Discard run".
94
+ - Web: the preview transaction already binds a `previewId`; associate `previewId` with
95
+ `runId` so the overlay reviews the whole run.
96
+
97
+ ## Write paths (unchanged engines)
98
+
99
+ - **Markdown**: agent applies ops through existing `POST /api/agent/files` → `applyOps`
100
+ (`ops-applier.ts:457`). Each op keeps baseRevision preflight and STALE_REVISION semantics.
101
+ Batch accept = accept all activity-log provenance tagged with `runId`; batch discard = revert them.
102
+ All-or-nothing is enforced at the review layer (accept each tagged span; if any fails,
103
+ surface and stop — v1 keeps the simple path).
104
+ - **Web**: agent replies via existing `web-preview` route with the candidate patch bound to
105
+ the run's `previewId`; accept commits through existing `commitCandidate` (single-file v1);
106
+ discard invalidates.
107
+
108
+ No new write engine. Line-review gate: nothing writes document bytes or provenance outside
109
+ these two paths.
110
+
111
+ ## API surface
112
+
113
+ ### Human-facing
114
+
115
+ - `POST /api/wiki/live/request` — extend to accept `items[]` + return `runId` for a batch
116
+ `generate` dispatch. Rejects with 409 if a run is already outstanding. Existing
117
+ single-instruction body still accepted (legacy/compat).
118
+ - `GET /api/wiki/live/status` — already returns attached + last request; add `runId` and item
119
+ count so the queue/review UI can render.
120
+ - Web already has `POST /api/wiki/web-tweak/request` and `/resolve`; extend request to carry
121
+ `items[]` + `runId`; resolve stays per-run (accept/discard).
122
+
123
+ The instruction *queue itself* (draft instructions not yet sent) is client-side state backed
124
+ by the sidecar (Markdown) or the web instruction list; only **send** hits the live channel.
125
+
126
+ ### Agent-facing
127
+
128
+ - `GET /api/agent/live/poll` returns the request including `items[]` + `runId`.
129
+ - Agent handler processes items together, applies tier-2 ops for Markdown (or submits web
130
+ preview), then `reply done`. Correlation/idempotency derived from `runId`/`requestId` at
131
+ commit time (existing one-engine rule).
132
+
133
+ ## UI
134
+
135
+ ### Markdown editor
136
+
137
+ - Bubble menu / view-mode affordance: replace single "Ask agent" with **Comment** and
138
+ **Instruct** actions.
139
+ - `openCommentForSelection` (existing) stays for comments.
140
+ - New `openInstructForSelection` creates a `kind:"instruction"` annotation (draft), no
141
+ dispatch. Retire `AskAgentPopover`'s immediate-send; reuse a lighter instruction editor
142
+ that writes a draft instruction.
143
+ - Comment card gains a **"Turn into an instruction"** action (creates instruction with
144
+ `fromCommentId`).
145
+ - A file-level **queue bar**: "N instructions ready · Send to agent" → enumerated confirm
146
+ dialog → dispatch run.
147
+ - After a run returns, activity-log provenance tagged with `runId` are grouped with **Accept run /
148
+ Discard run** controls, alongside existing per-span activity tracking.
149
+
150
+ ### Web tweak overlay
151
+
152
+ - Element picker pins an **instruction** to an element (draft), no dispatch.
153
+ - Same file-level queue bar + enumerated Send.
154
+ - Review the returned preview run with Accept run / Discard run (existing preview overlay,
155
+ relabeled).
156
+
157
+ ## Backward compatibility
158
+
159
+ - `kind` absent ⇒ comment. Legacy sidecars unchanged.
160
+ - `items`/`runId` null ⇒ legacy single request path still works.
161
+ - Frozen async `recover` path untouched; event schema additions are ignorable by old
162
+ consumers.
163
+
164
+ ## Testing
165
+
166
+ - Sidecar: instruction kind persists; legacy comment loads as comment; escalation creates
167
+ linked instruction without mutating the comment.
168
+ - Live store: batch request stores `items[]` + `runId`; one-outstanding invariant holds;
169
+ poll returns items; reply correlates by runId.
170
+ - Review: accept run accepts all tagged spans; discard reverts all; failure leaves no partial
171
+ state.
172
+ - Web: instruction queue → single send → preview run → accept commits single-file candidate;
173
+ discard invalidates.
174
+ - Rename: no "Ask agent" string in user-facing surfaces; verb is Instruct / Send to agent.
175
+ - Floor holds; add the above as new tests.
176
+
177
+ ## Rejected alternatives
178
+
179
+ - **Audience toggle on one note** (model C-as-toggle): makes accidental execution too easy;
180
+ rejected. Kind is a real type set at creation, escalation is explicit one-way.
181
+ - **Separate second annotation subsystem** (model B-as-duplicate-store): duplicates anchoring
182
+ machinery on Markdown for one bit of meaning; rejected in favor of one store + `kind`.
183
+ - **Per-item partial accept**: reintroduces multi-file atomicity; deferred.
@@ -0,0 +1,138 @@
1
+ # Proposal: collective agent review (instruct → send batch → review batch)
2
+
3
+ ## Problem
4
+
5
+ Both agent surfaces share the same disease: **scattered, fire-and-forget, one-at-a-time
6
+ agent calls**, and the way "Comment" and "Ask agent" coexist is confusing.
7
+
8
+ - **Markdown "Ask agent"** (`ask-agent-popover.tsx`): select a block, type an instruction,
9
+ hit Send, popover auto-closes in ~900ms. The result later materializes as a `activity record`
10
+ with no visible tie back to what you asked. Only one request may be outstanding per session.
11
+ No way to annotate several blocks and dispatch them together.
12
+ - **Web "Tweak"** (`web-tweak-overlay.tsx`): each element tweak is its own immediate request.
13
+ Same serialization and scatter, and the agent never sees the whole page at once, so
14
+ multi-element changes drift out of sync.
15
+ - **Comment vs Ask agent is muddled.** A comment is a passive note to humans; Ask agent is an
16
+ invisible fire-and-forget command. They look similar but behave completely differently, and
17
+ nothing tells the user which one will change their file.
18
+
19
+ ## The model (in UX terms)
20
+
21
+ **Two things you can pin to a target (a Markdown block or an HTML element):**
22
+
23
+ - **Comment** — a note to humans. It sits there. It never changes the file.
24
+ - **Instruction** — a work order for the agent. Something you intend to get done.
25
+
26
+ They share the same pin gesture and anchoring, but read as clearly different objects
27
+ (distinct icon + color). A user must never wonder "will this one change my file?"
28
+
29
+ **No audience toggle.** We do not put a "for humans / for agent" switch on one note. A toggle
30
+ turns every comment into "might this secretly be a command?" and invites accidental
31
+ execution. Instead there are two things you deliberately create.
32
+
33
+ **Explicit escalation.** A comment has one action, **"Turn into an instruction"** — one
34
+ direction, deliberate, with a backlink to the original comment. The comment is never silently
35
+ reinterpreted.
36
+
37
+ **Collect, then send once.** You leave instructions across the document; nothing fires. When
38
+ ready, one file-level button:
39
+
40
+ > **3 instructions ready · Send to agent**
41
+
42
+ Before sending, a dialog enumerates exactly which instructions on which blocks are going. You
43
+ confirm. The agent processes them together with whole-file context and returns **one coherent
44
+ change set tied to that send** (a "run"), so each returned change is visibly correlated to the
45
+ instruction it answers.
46
+
47
+ **Review as a batch.** Accept the whole run or discard it (all-or-nothing in v1). New
48
+ instructions start the next run.
49
+
50
+ **Retire the verb "Ask agent."** "Ask" implies an immediate conversational reply; this is a
51
+ queued work order reviewed later. The action is **Instruct** / **Send to agent** (mirrors
52
+ Cursor's Ask-vs-Agent split).
53
+
54
+ ## Desired outcome
55
+
56
+ One rhythm on both surfaces: **pin your intent → send when ready → review as a batch.**
57
+
58
+ The only thing that differs between surfaces is how a result *looks while you review it*
59
+ (clean markdown suggestion in Markdown vs a staged preview on the HTML page). That is
60
+ the medium, not the workflow.
61
+
62
+ ## Scope (this change — step 1)
63
+
64
+ - **Two annotation kinds** on the shared anchoring machinery: `comment` (human) and
65
+ `instruction` (agent work order). Instruction is a first-class kind, not a flag on a
66
+ comment.
67
+ - **Comment → instruction escalation** as an explicit one-way action with a backlink.
68
+ - **A per-file instruction queue** with an enumerated **"Send N to agent"** dispatch. Nothing
69
+ dispatches on creation.
70
+ - **One run per send**: the batch of instructions goes as a single agent dispatch carrying
71
+ whole-file context; returned changes correlate to that run and to each instruction.
72
+ - **Batch review, all-or-nothing** for v1: Accept applies the whole run, Discard drops it.
73
+ - Markdown: changes land as `activity record`s (existing tier-2 path), reviewed inline, tagged
74
+ with the run id.
75
+ - Web: agent returns a staged preview set bound to one previewId, reviewed in the overlay.
76
+ - **Rename the user-facing verb** from "Ask agent"/"Tweak" to Instruct / Send to agent, with
77
+ matching review vocabulary across both surfaces.
78
+
79
+ ## Non-goals (this change)
80
+
81
+ - **Generate variants** (N alternatives for one target, switch-and-accept). High value,
82
+ documented as **step 2**, built after this lands. Out of scope here.
83
+ - **Per-item / partial batch accept.** v1 is all-or-nothing. Per-item accept reintroduces
84
+ multi-file atomicity / partial-commit rollback that were deliberately deferred.
85
+ - **Merging the two write engines.** Markdown keeps write-first-then-review (tier-2
86
+ activity/audit provenance); web keeps write-on-accept (tier-1 candidate patch). This change unifies the
87
+ *surface language and workflow*, not the engines. Line reviewers must enforce that no code
88
+ path writes disk/provenance outside the two canonical commit paths.
89
+ - Multi-file candidate writes for web (still single-file per v1 web-tweak constraint).
90
+ - Real LLM handler wiring (separate track); the passthrough/dev runner remains the reference.
91
+ - Comment *replies/resolve* threading changes beyond what already exists.
92
+
93
+ ## Risks
94
+
95
+ - **Annotation chrome.** Two similar pin types can clutter the document. Mitigate with one
96
+ unified annotation presentation, restrained visual distinction, and filters, not two
97
+ separate-looking subsystems.
98
+ - **Instruction-as-comment by habit.** Users type a work order into a comment. Mitigate with
99
+ the explicit "Turn into an instruction" action and clear iconography.
100
+ - **Scope creep toward a unified Accept abstraction.** Rejected earlier. Keep two review
101
+ mechanisms; unify only wording/affordances.
102
+ - **Correlation UX.** Users must see which returned change answers which instruction. Needs a
103
+ run id threaded from send → each resulting activity/audit provenance / preview item.
104
+ - **Outstanding-request invariant.** Today one request is outstanding per session. Collective
105
+ send is still one dispatch, so the invariant holds; the request now carries N instruction
106
+ items instead of one.
107
+
108
+ ## Acceptance criteria
109
+
110
+ 1. A user can create a **comment** (human, never mutates the file) and an **instruction**
111
+ (agent work order) on a Markdown block, visually distinct.
112
+ 2. A user can create instructions on 2+ blocks with **no agent request firing**, then trigger
113
+ a single file-level **"Send N to agent"** that dispatches them in one run.
114
+ 3. The **send dialog enumerates** exactly which instructions/targets are going.
115
+ 4. A **comment can be escalated** to an instruction via an explicit one-way action; the
116
+ original comment is not silently changed.
117
+ 5. The same collect → send → batch-review rhythm works in **web tweak** (instructions on
118
+ elements, one Send, one preview run).
119
+ 6. The agent receives whole-file context plus the instruction set in one dispatch.
120
+ 7. The batched response is reviewable as a set; **Accept applies the whole run, Discard drops
121
+ it** (all-or-nothing), with no partial writes on failure.
122
+ 8. Each returned change is **visibly correlated** to the instruction it answers (run id +
123
+ per-item linkage).
124
+ 9. **No new write path**: Markdown via tier-2 `applyOps`; web via existing candidate-patch
125
+ accept. Verified by test + review.
126
+ 10. The user-facing verb is **Instruct / Send to agent** (no "Ask agent"), with matching
127
+ review controls/wording on both surfaces.
128
+ 11. Test floor holds; new tests cover: two kinds, escalation, collective dispatch, batch
129
+ review, all-or-nothing failure.
130
+
131
+ ## Sequencing
132
+
133
+ 1. **This change** — two kinds (comment/instruction) + escalation + per-file instruction
134
+ queue + single Send + all-or-nothing batch review, on both surfaces, sharing vocabulary.
135
+ Also the moment the weak Markdown "Ask agent" fire-and-forget UX is replaced by the
136
+ collect/send/review loop.
137
+ 2. **Step 2 (separate proposal): generate variants** — single target, N staged candidates,
138
+ in-frame/inline switcher, Accept the selected one. The impeccable-native differentiator.
@@ -0,0 +1,100 @@
1
+ # Requirements: collective agent review
2
+
3
+ Each requirement is observable behavior. Scenarios use GIVEN / WHEN / THEN.
4
+
5
+ ## R1 — Two annotation kinds on a Markdown block
6
+
7
+ A block-anchored annotation is either a **comment** (human) or an **instruction** (agent work
8
+ order). They are visually distinct and behave differently.
9
+
10
+ - GIVEN a selected Markdown block
11
+ - WHEN the user opens the annotation affordance
12
+ - THEN they can create a **Comment** (human discussion) or an **Instruction** (agent work
13
+ order), each with distinct icon/label
14
+ - AND creating either one does **not** dispatch any agent request
15
+
16
+ ## R2 — Comment never mutates the file
17
+
18
+ - GIVEN a comment exists on a block
19
+ - WHEN the user sends instructions to the agent (R5)
20
+ - THEN the comment is **not** included and never causes a file edit
21
+
22
+ ## R3 — Explicit comment → instruction escalation
23
+
24
+ - GIVEN an existing comment
25
+ - WHEN the user chooses "Turn into an instruction"
26
+ - THEN a new instruction is created for the same block, carrying the comment's text, with a
27
+ backlink to the original comment
28
+ - AND the original comment is left unchanged (not silently retyped or deleted)
29
+ - AND there is no persistent audience toggle that flips a note between kinds
30
+
31
+ ## R4 — Instructions accumulate without firing
32
+
33
+ - GIVEN the user creates instructions on 2+ different blocks
34
+ - WHEN each instruction is created
35
+ - THEN no agent request is dispatched
36
+ - AND a per-file indicator shows the count, e.g. "3 instructions ready"
37
+
38
+ ## R5 — Single enumerated batch send
39
+
40
+ - GIVEN 1+ unsent instructions exist for the current file
41
+ - WHEN the user clicks "Send N to agent"
42
+ - THEN a confirmation lists exactly which instructions (text + target block) will be sent
43
+ - AND on confirm, all listed instructions are dispatched as **one run** (single live request
44
+ carrying N instruction items) with whole-file context
45
+ - AND while a run is outstanding, a second send is refused with a clear message (one
46
+ outstanding run per session)
47
+
48
+ ## R6 — Batch response correlates to instructions
49
+
50
+ - GIVEN a run was sent with N instructions
51
+ - WHEN the agent responds
52
+ - THEN the returned changes are associated with that run id
53
+ - AND each returned change is linked to the instruction it answers (so the UI can show
54
+ "this change answers instruction X")
55
+
56
+ ## R7 — All-or-nothing batch review (Markdown)
57
+
58
+ - GIVEN an agent run produced M activity/audit provenance changes for the current file
59
+ - WHEN the user Accepts the run
60
+ - THEN all M changes are accepted together
61
+ - WHEN the user Discards the run
62
+ - THEN all M changes are reverted together
63
+ - AND if applying any change fails, no partial state is committed (existing tier-2
64
+ baseRevision / STALE_REVISION semantics still hold per change)
65
+
66
+ ## R8 — Same rhythm on web tweak
67
+
68
+ - GIVEN a static-HTML page in Tweak mode
69
+ - WHEN the user pins instructions to 2+ elements
70
+ - THEN no request fires per element
71
+ - WHEN the user clicks "Send N to agent"
72
+ - THEN the instructions dispatch as one run
73
+ - AND the agent returns a staged preview set (write-on-accept, source clean) reviewed as a
74
+ batch: Accept commits the run, Discard drops it
75
+
76
+ ## R9 — Verb rename
77
+
78
+ - GIVEN either surface
79
+ - THEN the user-facing action is **Instruct** / **Send to agent** (no "Ask agent" wording)
80
+ - AND Markdown and web use matching review vocabulary (e.g. "Accept run" / "Discard run")
81
+
82
+ ## R10 — No new write path
83
+
84
+ - THEN Markdown changes are written only through the existing tier-2 `applyOps`
85
+ - AND web changes are written only through the existing web-tweak candidate-patch accept
86
+ - AND no code path writes document bytes or provenance outside those two commit paths
87
+
88
+ ## R11 — Backward compatibility
89
+
90
+ - GIVEN existing files with only legacy comments (no instructions)
91
+ - THEN they load and render unchanged
92
+ - AND the additive annotation-kind field is nullable/defaulted so old sidecars and old event
93
+ consumers are unaffected
94
+ - AND the frozen async `recover` path is untouched
95
+
96
+ ## R12 — Non-goals stay out
97
+
98
+ - THEN there is no variant generation (N alternatives per target) in this change
99
+ - AND there is no per-item partial accept of a run
100
+ - AND the two persistence engines are not merged
@@ -0,0 +1,62 @@
1
+ # Tasks: collective agent review
2
+
3
+ Ordered, checkable. Mark complete only after verification.
4
+
5
+ ## Phase 1 — Data model (Markdown)
6
+
7
+ - [ ] T1. Add `AnnotationKind` + optional `kind`, `instructionState`, `runId`, `fromCommentId`
8
+ to `Comment` in `src/lib/proof/types.ts`.
9
+ - [ ] T2. Sidecar read/write: persist and load new fields; legacy rows (no `kind`) load as
10
+ comments. Add test.
11
+
12
+ ## Phase 2 — Live store run model
13
+
14
+ - [ ] T3. Extend `LiveRequest` with `items: LiveInstructionItem[] | null` and
15
+ `runId: string | null`; add columns (nullable) + migration-safe CREATE.
16
+ - [ ] T4. `enqueueRequest` accepts `items[]` + `runId`; keep single-instruction path. Preserve
17
+ one-outstanding invariant (BEGIN IMMEDIATE). Add test.
18
+ - [ ] T5. Poll response + `toRequest` include `items` + `runId`.
19
+
20
+ ## Phase 3 — Human API
21
+
22
+ - [ ] T6. `POST /api/wiki/live/request`: accept `items[]`, generate/echo `runId`, 409 on
23
+ outstanding run. Legacy body still works.
24
+ - [ ] T7. `GET /api/wiki/live/status`: include `runId` + item count.
25
+
26
+ ## Phase 4 — Markdown UI
27
+
28
+ - [ ] T8. Bubble menu + view-mode: split into **Comment** and **Instruct** actions; add
29
+ `openInstructForSelection` that creates a draft instruction (no dispatch).
30
+ - [ ] T9. Replace `AskAgentPopover` immediate-send with a draft-instruction editor.
31
+ - [ ] T10. Comment card: **"Turn into an instruction"** action (sets `fromCommentId`).
32
+ - [ ] T11. File-level queue bar: "N instructions ready · Send to agent" + enumerated confirm
33
+ dialog → POST run.
34
+ - [ ] T12. Group activity-log provenance by `runId`; add **Accept run / Discard run** controls (all-or-
35
+ nothing) alongside existing per-span controls.
36
+
37
+ ## Phase 5 — Web tweak parity
38
+
39
+ - [ ] T13. Per-file web instruction list (draft) keyed by workspace+path.
40
+ - [ ] T14. Picker pins an instruction to an element (no dispatch); same queue bar + Send.
41
+ - [ ] T15. Associate `previewId` with `runId`; overlay reviews the run (Accept run / Discard
42
+ run), relabeled.
43
+
44
+ ## Phase 6 — Rename + correlation
45
+
46
+ - [ ] T16. Retire "Ask agent"/"Tweak" verbs in user-facing UI → **Instruct / Send to agent**;
47
+ matching review vocabulary both surfaces.
48
+ - [ ] T17. Thread `runId` into activity/audit provenance provenance (ActivityAttrs) so results correlate to the
49
+ run and to each instruction item.
50
+
51
+ ## Phase 7 — Agent runtime
52
+
53
+ - [ ] T18. `wiki-viewer-mcp` LiveClient/runLiveLoop: handle `items[]` batch requests; apply
54
+ tier-2 ops per item; correlation/idempotency derived from `runId`/`requestId`.
55
+ - [ ] T19. Passthrough reference handler processes batch items.
56
+
57
+ ## Phase 8 — Verify
58
+
59
+ - [ ] T20. Tests: kinds persist, escalation, batch enqueue, poll items, run correlation,
60
+ accept/discard run all-or-nothing, web parity, no "Ask agent" string.
61
+ - [ ] T21. `pnpm typecheck`, `pnpm lint`, `pnpm test` (floor holds), mcp `npm test`.
62
+ - [ ] T22. reviewer pass on the diff (security, backward compat, no new write path).
@@ -0,0 +1,141 @@
1
+ # Design: Live agent collaboration
2
+
3
+ ## Key realization from code exploration
4
+
5
+ The existing tier-2 commit path (`applyOps` in `src/lib/proof/ops-applier.ts:457`) already
6
+ IS the `exact` preflight policy for the parts that matter:
7
+
8
+ - It compares `baseRevision` to `sidecar.revision` and returns `409 STALE_REVISION` on mismatch
9
+ (`ops-applier.ts:509-523`).
10
+ - It resolves the target `blockRef` via `resolveRef`; a vanished ref fails the op.
11
+ - AI writers (`by: "ai:<id>"`) already get `activity record` wrapping (`cleanMarkdownCommit`,
12
+ `ops-applier.ts:94-160`) with a `ActivityAttrs` that already carries `inResponseTo`.
13
+ - The HTTP route `POST /api/agent/files/[...path]` already enforces `Idempotency-Key`
14
+ (route.ts:96-132): same key + same payload returns the cached response; same key + different
15
+ payload returns `409 IDEMPOTENCY_KEY_REUSED`.
16
+
17
+ Therefore the live channel adds **no new write path and no schema change to the commit
18
+ engine**. It is a control plane that:
19
+
20
+ 1. carries a human's intent (selected block + instruction) to an attached agent, and
21
+ 2. tracks the session/request lifecycle,
22
+
23
+ while the agent performs the edit through the existing `POST /api/agent/files/[...path]` with:
24
+
25
+ - `Idempotency-Key: live:<requestId>` (deterministic replay safety), and
26
+ - op `inResponseTo: "live:<requestId>"` (provenance correlation into `ActivityAttrs.inResponseTo`).
27
+
28
+ The editor already reloads snapshot+sidecar via the browser SSE filesystem watch
29
+ (`use-document-watch.ts:55-77`) when `applyOps` writes the `.md`, so the live channel does
30
+ **not** push edits to the client. It only carries intent to the agent and lifecycle to both.
31
+
32
+ This keeps us strictly in "stance 1": one commit engine, live path is exact-fail-closed by
33
+ reusing `applyOps` as-is. The `recover` machinery stays for async/MCP and is untouched.
34
+
35
+ ## Components
36
+
37
+ ### 1. Live store — `src/lib/proof/live/store.ts`
38
+
39
+ SQLite, following `src/lib/shared-docs/db.ts` (lazy singleton, WAL, inline
40
+ `CREATE TABLE IF NOT EXISTS`). New db file `~/.wiki-viewer/live.db`.
41
+
42
+ ```
43
+ live_session(
44
+ id TEXT PRIMARY KEY, -- session id
45
+ workspace_id TEXT NOT NULL,
46
+ agent_id TEXT, -- attached agent, null until attach
47
+ state TEXT NOT NULL, -- 'open' | 'closed'
48
+ created_at INTEGER NOT NULL,
49
+ agent_last_seen INTEGER -- updated each long-poll; presence/lease
50
+ )
51
+
52
+ live_request(
53
+ id TEXT PRIMARY KEY, -- request id -> Idempotency-Key live:<id>
54
+ session_id TEXT NOT NULL,
55
+ workspace_id TEXT NOT NULL,
56
+ path TEXT NOT NULL, -- relative md path
57
+ block_ref TEXT, -- selected block (null for steer/accept/discard)
58
+ base_revision INTEGER, -- revision at selection time
59
+ kind TEXT NOT NULL, -- 'generate' | 'steer' | 'accept' | 'discard' | 'exit'
60
+ instruction TEXT, -- freeform prompt (generate/steer)
61
+ state TEXT NOT NULL, -- 'pending' | 'delivered' | 'working' | 'resolved' | 'stale' | 'error'
62
+ outcome TEXT, -- 'accepted' | 'reverted' | null
63
+ seq INTEGER NOT NULL, -- monotonic per workspace for ordered delivery
64
+ created_at INTEGER NOT NULL,
65
+ delivered_at INTEGER,
66
+ resolved_at INTEGER
67
+ )
68
+ ```
69
+
70
+ Store API (sync, better-sqlite3-style wrapper `src/lib/sqlite.ts`):
71
+ `openOrGetSession`, `attachAgent`, `touchAgent`, `closeSession`, `enqueueRequest`,
72
+ `nextPendingRequest(workspaceId, afterSeq)`, `markDelivered`, `markState`, `getSession`,
73
+ `getRequest`, `latestOpenSessionForWorkspace`.
74
+
75
+ Presence rule: an agent is "attached" if a session has `agent_id` set and
76
+ `agent_last_seen` within a lease TTL (e.g. 45s). No separate heartbeat; the held long-poll
77
+ updates `agent_last_seen`.
78
+
79
+ ### 2. Agent-facing transport — `src/app/api/agent/live/`
80
+
81
+ All routes: `checkAuth(req)` -> `resolveWorkspaceForAgent(req)` -> `enforceScope(...)`.
82
+
83
+ - `POST /api/agent/live/attach` — body `{ sessionId? }`. Creates/attaches a session for the
84
+ agent+workspace, returns `{ sessionId }`. Idempotent per agent+workspace (reuses latest open
85
+ session).
86
+ - `GET /api/agent/live/poll?sessionId=&afterSeq=` — **long-poll**. Held open up to ~25s using
87
+ a `ReadableStream`-free promise+interval loop (mirrors the heartbeat pattern of
88
+ `/api/wiki/watch/route.ts:274`). On each tick, `touchAgent` and check
89
+ `nextPendingRequest`; when found, `markDelivered` and return the event JSON `{ type, request }`;
90
+ on timeout return `{ type: "timeout" }`. This held request IS presence.
91
+ - `POST /api/agent/live/reply` — body `{ requestId, status }` where status is
92
+ `working | done | error`. Updates `live_request.state`. `done` on a generate/steer means the
93
+ agent finished committing (the actual edit already landed via tier-2).
94
+
95
+ The agent commits the edit itself via existing `POST /api/agent/files/[...path]` with the
96
+ deterministic idempotency key and `inResponseTo`. The live channel never writes files.
97
+
98
+ ### 3. Human-facing dispatch — `src/app/api/wiki/live/`
99
+
100
+ Session-authed (Better Auth), CSRF-checked like other `/api/wiki/*` mutations.
101
+
102
+ - `POST /api/wiki/live/request` — body `{ path, blockRef?, baseRevision?, kind, instruction? }`.
103
+ Resolves the workspace for the user, finds/creates the open session, enqueues a
104
+ `live_request`. Returns `{ requestId, seq }`.
105
+ - `GET /api/wiki/live/status?path=` — returns `{ attached: boolean, session, lastRequest }`
106
+ so the editor can show whether an agent is on the line and the current turn state.
107
+
108
+ Accept/revert are dispatched here too (`kind: 'accept' | 'discard'`) purely as notifications
109
+ to the session; the actual activity tracking of the activity/audit provenance happens through the existing editor
110
+ suggestion/proof UI and its normal API.
111
+
112
+ ### 4. Editor UI — `src/components/editor/`
113
+
114
+ - Add `onAskAgent` to `EditorBubbleMenu` (bubble-menu.tsx) beside `onSuggestEdit`/`onComment`.
115
+ - In `editor.tsx`, implement `openAskAgentForSelection()` using existing `resolveSelectionBlock()`
116
+ (editor.tsx:236) to get `{ blockRef, markdown }`, plus `currentPath` and current snapshot
117
+ `revision`. Open a small popover to type the instruction, then
118
+ `POST /api/wiki/live/request { kind: 'generate', path, blockRef, baseRevision, instruction }`.
119
+ - A minimal "Live" status indicator (attached / waiting / working) driven by
120
+ `GET /api/wiki/live/status`. Steer = same popover again while a turn is open.
121
+ - Proof-span appears through the existing SSE-watch reload; activity tracking use existing UI.
122
+
123
+ ## Correctness
124
+
125
+ - **Stale intent:** the request stores `base_revision` at selection time. The agent must POST
126
+ with that `baseRevision`. If the human edited meanwhile, `applyOps` returns `STALE_REVISION`;
127
+ the agent replies `error`, the request is marked `stale`, UI asks for a fresh selection. No
128
+ silent re-interpretation.
129
+ - **Replay:** `Idempotency-Key = live:<requestId>` makes a re-POST after agent crash return the
130
+ cached result; no duplicate edit. The request id is stable in `live_request`, so recovery
131
+ reuses it.
132
+ - **One outstanding request per session:** `enqueueRequest` rejects a new `generate` while the
133
+ session has a non-terminal request. Reviewer-approved v1 constraint.
134
+ - **Presence ambiguity:** `agent_last_seen` + TTL. Timeout => not attached. Reconnect resumes
135
+ from `afterSeq` (last delivered seq).
136
+
137
+ ## What we deliberately do NOT build
138
+
139
+ Restated from proposal non-goals; enforced in review: no helper server, no injected JS, no HMR,
140
+ no variants, no second write path / `applyLiveEdit`, no async-machinery deletion, no fuzzy
141
+ recovery on the live path.