@north-light/cli 0.3.706 → 0.3.708

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 (187) hide show
  1. package/dist/api/client.d.ts +1 -2
  2. package/dist/api/client.js +3 -3
  3. package/dist/api/contract.d.ts +1 -1
  4. package/dist/api/contract.js +1 -1
  5. package/dist/api/dto/human.d.ts +9 -6
  6. package/dist/api/dto/inbox.d.ts +2 -0
  7. package/dist/api/dto/review-comments.d.ts +12 -35
  8. package/dist/api/dto/reviews.d.ts +3 -10
  9. package/dist/api/routes.d.ts +0 -1
  10. package/dist/api/routes.js +1 -1
  11. package/dist/builtin-memory/05-kinds/review/companion/00-base.md +2 -2
  12. package/dist/builtin-memory/crouter-sdk/release-notes.md +6 -0
  13. package/dist/clients/attach/chrome/canvas-panels.d.ts +1 -1
  14. package/dist/clients/attach/chrome/canvas-panels.js +1 -1
  15. package/dist/clients/attach/chrome/roster.js +6 -6
  16. package/dist/clients/attach/chrome/status-line.js +1 -1
  17. package/dist/clients/attach/chrome/ticket-panel.js +1 -1
  18. package/dist/clients/attach/input/controller.d.ts +0 -1
  19. package/dist/clients/attach/input/controller.js +3 -3
  20. package/dist/clients/attach/input/overlay-owner.d.ts +0 -1
  21. package/dist/clients/attach/input/overlay-owner.js +1 -1
  22. package/dist/clients/attach/session/keys.d.ts +0 -2
  23. package/dist/clients/attach/session/keys.js +1 -1
  24. package/dist/clients/attach/session/surface-host.d.ts +0 -5
  25. package/dist/clients/attach/session/surface-host.js +1 -1
  26. package/dist/clients/attach/viewer.js +545 -560
  27. package/dist/clients/editor-roundtrip.js +3 -0
  28. package/dist/clients/inbox/controller.d.ts +1 -6
  29. package/dist/clients/inbox/controller.js +1 -1
  30. package/dist/clients/inbox/dto-adapt.js +1 -1
  31. package/dist/clients/inbox/tui/page-body.js +1 -1
  32. package/dist/clients/inbox/tui/render.js +2 -2
  33. package/dist/clients/open-browser.d.ts +2 -0
  34. package/dist/clients/open-browser.js +1 -0
  35. package/dist/clients/surfaces/host.d.ts +0 -6
  36. package/dist/commands/human/review.js +1 -1
  37. package/dist/commands/sys/context/admin/shell.js +1 -1
  38. package/dist/core/canvas/schema-pg/025-review-anchors.sql +19 -0
  39. package/dist/core/canvas/schema-version.d.ts +1 -1
  40. package/dist/core/canvas/schema-version.js +1 -1
  41. package/dist/core/human/page-markdown.js +10 -12
  42. package/dist/core/human/tickets.js +1 -1
  43. package/dist/core/human/types.d.ts +4 -6
  44. package/dist/core/keybindings/attach-control.d.ts +0 -3
  45. package/dist/core/keybindings/attach-control.js +1 -1
  46. package/dist/core/keybindings/catalog.d.ts +1 -1
  47. package/dist/core/keybindings/catalog.js +1 -1
  48. package/dist/core/review/anchors.d.ts +28 -0
  49. package/dist/core/review/anchors.js +6 -0
  50. package/dist/core/review/comments.d.ts +2 -2
  51. package/dist/core/review/comments.js +7 -8
  52. package/dist/core/review/companion.d.ts +2 -1
  53. package/dist/core/review/companion.js +1 -1
  54. package/dist/core/review/document.d.ts +4 -17
  55. package/dist/core/review/document.js +1 -2
  56. package/dist/core/review/fork.js +2 -4
  57. package/dist/core/review/project.d.ts +1 -1
  58. package/dist/core/review/project.js +2 -2
  59. package/dist/core/review/realize.js +1 -1
  60. package/dist/core/review/stage.d.ts +2 -9
  61. package/dist/core/review/stage.js +1 -1
  62. package/dist/core/review/types.d.ts +16 -12
  63. package/dist/core/review/types.js +1 -1
  64. package/dist/core/runtime/broker/turn-replies.d.ts +1 -3
  65. package/dist/core/runtime/broker-cli.js +3 -3
  66. package/dist/core/runtime/broker-extension-render.js +1 -1
  67. package/dist/core/runtime/tmux-bindings.js +3 -3
  68. package/dist/daemon/api/canvas-host.js +1 -1
  69. package/dist/daemon/api/document-page.d.ts +12 -1
  70. package/dist/daemon/api/document-page.js +6 -6
  71. package/dist/daemon/api/handlers/inbox.js +1 -1
  72. package/dist/daemon/api/handlers/review-comments.js +1 -1
  73. package/dist/daemon/api/handlers/reviews.js +1 -1
  74. package/dist/daemon/api/map.js +2 -2
  75. package/dist/daemon/api/review-page.d.ts +3 -0
  76. package/dist/daemon/api/review-page.js +13 -0
  77. package/dist/daemon/broker-memory-cap.d.ts +9 -0
  78. package/dist/daemon/broker-memory-cap.js +2 -0
  79. package/dist/daemon/broker-signals/bus.d.ts +1 -1
  80. package/dist/daemon/broker-signals/bus.js +1 -1
  81. package/dist/daemon/crtrd.js +14 -14
  82. package/dist/daemon/machine-daemon.js +1 -1
  83. package/dist/daemon/review/comment-notify.js +2 -2
  84. package/dist/daemon/review/deliver.d.ts +2 -2
  85. package/dist/daemon/review/deliver.js +6 -2
  86. package/dist/daemon/review/finish.js +1 -1
  87. package/dist/doc-editor/Geist-Variable.woff2 +0 -0
  88. package/dist/doc-editor/GeistMono-Variable.woff2 +0 -0
  89. package/dist/doc-editor/editor.css +1 -1
  90. package/dist/doc-editor/review.css +2 -0
  91. package/dist/doc-editor/review.js +149 -0
  92. package/dist/pi-extensions/canvas-review-boundary.js +3 -3
  93. package/dist/shared/turn-replies.d.ts +3 -3
  94. package/dist/shared/turn-replies.js +3 -3
  95. package/docs/sdk/release-notes.md +6 -0
  96. package/package.json +13 -4
  97. package/packages/crouter-api/dist/api/client.js +0 -3
  98. package/packages/crouter-api/dist/api/contract.js +1 -1
  99. package/packages/crouter-api/dist/api/routes.js +0 -1
  100. package/packages/crouter-api/dist/clients/attach/chrome/canvas-panels.js +3 -3
  101. package/packages/crouter-api/dist/clients/attach/chrome/roster.js +9 -20
  102. package/packages/crouter-api/dist/clients/attach/chrome/status-line.js +1 -6
  103. package/packages/crouter-api/dist/clients/attach/chrome/ticket-panel.js +1 -1
  104. package/packages/crouter-api/dist/clients/attach/input/controller.js +0 -3
  105. package/packages/crouter-api/dist/clients/attach/input/overlay-owner.js +0 -7
  106. package/packages/crouter-api/dist/clients/attach/session/keys.js +0 -1
  107. package/packages/crouter-api/dist/clients/attach/session/surface-host.js +0 -17
  108. package/packages/crouter-api/dist/clients/attach/viewer.js +0 -37
  109. package/packages/crouter-api/dist/clients/{inbox/review/roundtrip.js → editor-roundtrip.js} +1 -1
  110. package/packages/crouter-api/dist/clients/inbox/controller.js +12 -31
  111. package/packages/crouter-api/dist/clients/inbox/dto-adapt.js +1 -0
  112. package/packages/crouter-api/dist/clients/inbox/tui/page-body.js +0 -7
  113. package/packages/crouter-api/dist/clients/inbox/tui/render.js +0 -7
  114. package/packages/crouter-api/dist/clients/open-browser.js +6 -0
  115. package/packages/crouter-api/dist/commands/human/review.js +17 -18
  116. package/packages/crouter-api/dist/commands/sys/context/admin/shell.js +1 -1
  117. package/packages/crouter-api/dist/core/canvas/schema-version.js +1 -1
  118. package/packages/crouter-api/dist/core/human/page-markdown.js +2 -6
  119. package/packages/crouter-api/dist/core/human/tickets.js +2 -11
  120. package/packages/crouter-api/dist/core/keybindings/attach-control.js +0 -1
  121. package/packages/crouter-api/dist/core/keybindings/catalog.js +1 -3
  122. package/packages/crouter-api/dist/core/review/anchors.js +91 -0
  123. package/packages/crouter-api/dist/core/review/comments.js +27 -46
  124. package/packages/crouter-api/dist/core/review/companion.js +5 -9
  125. package/packages/crouter-api/dist/core/review/document.js +17 -89
  126. package/packages/crouter-api/dist/core/review/project.js +2 -1
  127. package/packages/crouter-api/dist/core/review/types.js +2 -2
  128. package/packages/crouter-api/dist/core/runtime/tmux-bindings.js +0 -5
  129. package/packages/crouter-api/dist/daemon/api/map.js +2 -6
  130. package/packages/crouter-api/dist/daemon/broker-signals/bus.js +1 -1
  131. package/packages/crouter-api/dist/daemon/review/deliver.js +4 -3
  132. package/packages/crouter-api/dist/daemon/review/finish.js +26 -47
  133. package/packages/crouter-api/dist/shared/turn-replies.js +9 -14
  134. package/packages/crouter-api/package.json +1 -1
  135. package/packages/crouter-identity/package.json +1 -1
  136. package/packages/crouter-plugin/package.json +3 -3
  137. package/runtime.lock.json +1740 -505
  138. package/dist/clients/attach/overlays/file-review.d.ts +0 -10
  139. package/dist/clients/attach/overlays/file-review.js +0 -2
  140. package/dist/clients/inbox/review/anchors.d.ts +0 -41
  141. package/dist/clients/inbox/review/anchors.js +0 -1
  142. package/dist/clients/inbox/review/comments-client.d.ts +0 -74
  143. package/dist/clients/inbox/review/comments-client.js +0 -1
  144. package/dist/clients/inbox/review/companion-pane.d.ts +0 -47
  145. package/dist/clients/inbox/review/companion-pane.js +0 -1
  146. package/dist/clients/inbox/review/document-surface.d.ts +0 -212
  147. package/dist/clients/inbox/review/document-surface.js +0 -2
  148. package/dist/clients/inbox/review/frame.d.ts +0 -57
  149. package/dist/clients/inbox/review/frame.js +0 -1
  150. package/dist/clients/inbox/review/keys.d.ts +0 -69
  151. package/dist/clients/inbox/review/keys.js +0 -1
  152. package/dist/clients/inbox/review/launch.d.ts +0 -16
  153. package/dist/clients/inbox/review/launch.js +0 -1
  154. package/dist/clients/inbox/review/live-source.d.ts +0 -24
  155. package/dist/clients/inbox/review/live-source.js +0 -1
  156. package/dist/clients/inbox/review/nvim.d.ts +0 -15
  157. package/dist/clients/inbox/review/nvim.js +0 -1
  158. package/dist/clients/inbox/review/remap.d.ts +0 -51
  159. package/dist/clients/inbox/review/remap.js +0 -1
  160. package/dist/clients/inbox/review/review-client.d.ts +0 -43
  161. package/dist/clients/inbox/review/review-client.js +0 -1
  162. package/dist/clients/inbox/review/roundtrip.js +0 -3
  163. package/dist/clients/inbox/review/state.d.ts +0 -153
  164. package/dist/clients/inbox/review/state.js +0 -4
  165. package/dist/clients/inbox/review-adapter.d.ts +0 -17
  166. package/dist/clients/inbox/review-adapter.js +0 -1
  167. package/dist/core/review/remap.d.ts +0 -24
  168. package/dist/core/review/remap.js +0 -19
  169. package/dist/core/review/signal.d.ts +0 -5
  170. package/dist/core/review/signal.js +0 -1
  171. package/packages/crouter-api/dist/clients/attach/overlays/file-review.js +0 -146
  172. package/packages/crouter-api/dist/clients/inbox/review/anchors.js +0 -89
  173. package/packages/crouter-api/dist/clients/inbox/review/comments-client.js +0 -103
  174. package/packages/crouter-api/dist/clients/inbox/review/companion-pane.js +0 -109
  175. package/packages/crouter-api/dist/clients/inbox/review/document-surface.js +0 -1268
  176. package/packages/crouter-api/dist/clients/inbox/review/frame.js +0 -309
  177. package/packages/crouter-api/dist/clients/inbox/review/keys.js +0 -133
  178. package/packages/crouter-api/dist/clients/inbox/review/launch.js +0 -170
  179. package/packages/crouter-api/dist/clients/inbox/review/live-source.js +0 -160
  180. package/packages/crouter-api/dist/clients/inbox/review/nvim.js +0 -43
  181. package/packages/crouter-api/dist/clients/inbox/review/remap.js +0 -157
  182. package/packages/crouter-api/dist/clients/inbox/review/review-client.js +0 -125
  183. package/packages/crouter-api/dist/clients/inbox/review/state.js +0 -315
  184. package/packages/crouter-api/dist/clients/inbox/review-adapter.js +0 -43
  185. package/packages/crouter-api/dist/core/review/signal.js +0 -12
  186. package/packages/crouter-api/dist/core/termrender/code-doc.js +0 -92
  187. /package/dist/clients/{inbox/review/roundtrip.d.ts → editor-roundtrip.d.ts} +0 -0
@@ -1,3 +1,3 @@
1
- var h=Object.defineProperty;var d=(e,i)=>h(e,"name",{value:i,configurable:!0});import{envNodeId as f}from"../shared/env.js";import{bootExtensionState as m}from"../core/runtime/broker/boot-state.js";import{isReviewBoundary as w,REVIEW_BOUNDARY_CUSTOM_TYPE as _}from"../core/runtime/session-visibility.js";import{formatCard as b}from"../shared/generated-context.js";function l(e,i=m){e.on("session_start",async(p,v)=>{const r=f();if(!r||r.trim()==="")return;let n;try{n=(await i(r)).node}catch{return}if(n.review_binding==null||v.sessionManager.getBranch().some(g=>w(g,n.review_binding?.review_id)))return;const t=n.review_binding,{review_id:o,origin_node_id:s,target_file:a}=t,c=t.kind==="page_feedback"?[`This conversation began from feedback on page ${o}.`,`Page source: ${a}`,`Origin node: ${s}`,"","The person's visible transcript starts here. Everything above this marker is the origin node's work \u2014 inherited context they have not seen."].join(`
2
- `):[`Reviewed file: ${a}`,`Review ID: ${o}`,`Origin node: ${s}`,"","The person's visible transcript starts here. Everything above this marker is inherited context they have not seen."].join(`
3
- `);e.sendMessage({customType:_,content:b("review-boundary",{},c),display:!0,details:{reviewId:o,originNodeId:s,targetFile:a,kind:t.kind??"review"}})})}d(l,"registerCanvasReviewBoundary");var T=l;export{T as default,l as registerCanvasReviewBoundary};
1
+ var h=Object.defineProperty;var d=(e,i)=>h(e,"name",{value:i,configurable:!0});import{envNodeId as m}from"../shared/env.js";import{bootExtensionState as f}from"../core/runtime/broker/boot-state.js";import{isReviewBoundary as u,REVIEW_BOUNDARY_CUSTOM_TYPE as w}from"../core/runtime/session-visibility.js";import{formatCard as _}from"../shared/generated-context.js";function b(e,i=f){e.on("session_start",async(p,v)=>{const r=m();if(!r||r.trim()==="")return;let n;try{n=(await i(r)).node}catch{return}if(n.review_binding==null||v.sessionManager.getBranch().some(g=>u(g,n.review_binding?.review_id)))return;const t=n.review_binding,{review_id:o,origin_node_id:s,target_file:a}=t,c=t.kind==="page_feedback"?[`This conversation began from feedback on page ${o}.`,`Page source: ${a}`,`Origin node: ${s}`,"","The person's visible transcript starts here. Everything above this marker is the origin node's work \u2014 inherited context they have not seen."].join(`
2
+ `):[`Reviewed document: ${a}`,`Review ID: ${o}`,`Origin node: ${s}`,"","The person's visible transcript starts here. Everything above this marker is inherited context they have not seen."].join(`
3
+ `);e.sendMessage({customType:w,content:_("review-boundary",{},c),display:!0,details:{reviewId:o,originNodeId:s,targetFile:a,kind:t.kind??"review"}})})}d(b,"registerCanvasReviewBoundary");var T=b;export{T as default,b as registerCanvasReviewBoundary};
@@ -21,7 +21,7 @@ export interface TurnProse {
21
21
  text: string;
22
22
  }
23
23
  /** The text a viewer shows as a turn's reply. One prose message is the reply
24
- * verbatim. Otherwise the latest rewrite whose sources are all still in the turn,
25
- * followed by any later prose it does not cover, verbatim. A missing or stale
26
- * rewrite degrades to concatenation, never to a lost answer. */
24
+ * verbatim. Otherwise the latest rewrite, when it covers any prose the viewer
25
+ * holds, followed by the later prose verbatim; earlier sources may be outside the
26
+ * viewer's last messages. Without such a rewrite, the prose is concatenated. */
27
27
  export declare function turnReplyText(prose: readonly TurnProse[], reply: TurnReply | undefined): string;
@@ -1,5 +1,5 @@
1
- var f=Object.defineProperty;var o=(t,e)=>f(t,"name",{value:e,configurable:!0});const a="start",p=4e4,x=200;function l(t){if(typeof t!="object"||t===null||Array.isArray(t))return null;const e=t;return e.version!==1||typeof e.text!="string"||!Array.isArray(e.sources)||e.text.trim()===""||e.sources.length===0||!e.sources.every(r=>typeof r=="string"&&r!=="")?null:{version:1,sources:e.sources.slice(0,200),text:e.text.slice(0,4e4)}}o(l,"normalizeTurnReply");function d(t){if(typeof t!="object"||t===null||Array.isArray(t))return{};const e={};for(const[r,n]of Object.entries(t)){if(r.trim()==="")continue;const i=l(n);i!==null&&(e[r]=i)}return e}o(d,"normalizeTurnReplyRecord");function R(t){if(typeof t!="object"||t===null)return;const e=t.timestamp;return typeof e=="number"&&Number.isFinite(e)?String(e):void 0}o(R,"messageKey");function A(t){return t.role==="assistant"&&t.stopReason!=="aborted"&&t.stopReason!=="error"}o(A,"isSettledAssistant");function _(t,e){if(t.length===0)return"";if(t.length===1)return t[0].text;const r=new Set(t.map(n=>n.key));if(e!==void 0&&e.sources.every(n=>r.has(n))){const n=new Set(e.sources);let i=-1;t.forEach((s,c)=>{n.has(s.key)&&(i=c)});const u=t.slice(i+1).map(s=>s.text);return[e.text,...u].join(`
1
+ var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});const l="start",y=4e4,p=200;function c(t){if(typeof t!="object"||t===null||Array.isArray(t))return null;const e=t;return e.version!==1||typeof e.text!="string"||!Array.isArray(e.sources)||e.text.trim()===""||e.sources.length===0||!e.sources.every(n=>typeof n=="string"&&n!=="")?null:{version:1,sources:e.sources.slice(0,200),text:e.text.slice(0,4e4)}}o(c,"normalizeTurnReply");function a(t){if(typeof t!="object"||t===null||Array.isArray(t))return{};const e={};for(const[n,i]of Object.entries(t)){if(n.trim()==="")continue;const r=c(i);r!==null&&(e[n]=r)}return e}o(a,"normalizeTurnReplyRecord");function x(t){if(typeof t!="object"||t===null)return;const e=t.timestamp;return typeof e=="number"&&Number.isFinite(e)?String(e):void 0}o(x,"messageKey");function R(t){return t.role==="assistant"&&t.stopReason!=="aborted"&&t.stopReason!=="error"}o(R,"isSettledAssistant");function d(t,e){if(t.length===0)return"";if(t.length===1)return t[0].text;const n=new Set(e?.sources);let i=-1;return t.forEach((r,s)=>{n.has(r.key)&&(i=s)}),i>=0?[e.text,...t.slice(i+1).map(r=>r.text)].join(`
2
2
 
3
- `)}return t.map(n=>n.text).join(`
3
+ `):t.map(r=>r.text).join(`
4
4
 
5
- `)}o(_,"turnReplyText");export{a as START_TURN_KEY,A as isSettledAssistant,R as messageKey,l as normalizeTurnReply,d as normalizeTurnReplyRecord,_ as turnReplyText};
5
+ `)}o(d,"turnReplyText");export{l as START_TURN_KEY,R as isSettledAssistant,x as messageKey,c as normalizeTurnReply,a as normalizeTurnReplyRecord,d as turnReplyText};
@@ -7,6 +7,12 @@ description: Behavior changes in @north-light/sdk that an app must act on, newes
7
7
 
8
8
  Changes to `@north-light/sdk` that can change what an existing app sees. Newest first.
9
9
 
10
+ ## 0.3.708
11
+
12
+ ### Review comments anchor to quoted text (breaking)
13
+
14
+ Review comments carry `anchor: { quote, prefix?, suffix?, offset? }` instead of line numbers, and the `comment-ranges` route is removed. Reviews opened under the old shape are canceled at cutover. Reviews are read and approved in the browser at `/review/<id>` on the canvas host.
15
+
10
16
  ## 0.3.694
11
17
 
12
18
  ### The owner's daemon routes are no longer wrapped (breaking for code that calls them)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@north-light/cli",
3
- "version": "0.3.706",
3
+ "version": "0.3.708",
4
4
  "description": "crtr — agent runtime with memory, plugins, and marketplaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -144,7 +144,8 @@
144
144
  "@earendil-works/pi-tui": "1.5.2",
145
145
  "@earendil-works/chord": {
146
146
  "ws": "$ws",
147
- "esbuild": "$esbuild"
147
+ "esbuild": "$esbuild",
148
+ "react": "$react"
148
149
  }
149
150
  },
150
151
  "repository": {
@@ -156,8 +157,8 @@
156
157
  },
157
158
  "license": "UNLICENSED",
158
159
  "dependencies": {
159
- "@north-light/identity": "0.3.706",
160
- "@north-light/plugin": "0.3.706",
160
+ "@north-light/identity": "0.3.708",
161
+ "@north-light/plugin": "0.3.708",
161
162
  "@earendil-works/chord": "1.5.2",
162
163
  "@earendil-works/pi-agent-core": "1.5.2",
163
164
  "@earendil-works/pi-ai": "1.5.2",
@@ -190,11 +191,19 @@
190
191
  "zod": "^4.3.6"
191
192
  },
192
193
  "devDependencies": {
194
+ "@northlight-systems/cloud-ui": "^0.29.0",
195
+ "@tailwindcss/node": "4.3",
196
+ "@tailwindcss/oxide": "4.3",
193
197
  "@types/node": "^24.0.0",
194
198
  "@types/pg": "^8.23.1",
195
199
  "@types/proper-lockfile": "^4.1.4",
200
+ "@types/react": "^19.3.0",
201
+ "@types/react-dom": "^19.3.0",
196
202
  "@types/ws": "^8.18.1",
197
203
  "mermaid": "11.17.2",
204
+ "react": "19.3",
205
+ "react-dom": "19.3",
206
+ "tailwindcss": "4.3",
198
207
  "tsx": "^4.0.0"
199
208
  }
200
209
  }
@@ -801,9 +801,6 @@ export class CrtrClient {
801
801
  readReviewCommentEvents(reviewId, query) {
802
802
  return this.request('GET', withQuery(routes.humanReviewCommentEvents(this.reviewPath(reviewId)), query));
803
803
  }
804
- updateReviewCommentRanges(reviewId, req) {
805
- return this.request('POST', routes.humanReviewCommentRanges(this.reviewPath(reviewId)), req);
806
- }
807
804
  getReviewComment(commentId) {
808
805
  return this.request('GET', routes.humanComment(this.commentPath(commentId)));
809
806
  }
@@ -12,7 +12,7 @@
12
12
  //
13
13
  // PURITY (spec §3.1): Node built-ins + `src/api/*` only.
14
14
  /** The contract level this build serves and requires. Written by `scripts/contract.mjs release`; never edit by hand. */
15
- export const CONTRACT_LEVEL = '1.66';
15
+ export const CONTRACT_LEVEL = '1.67';
16
16
  /** Request header naming the one contract level the caller needs, e.g. `1.3`. Optional: absent means no check. */
17
17
  export const REQUIRED_CONTRACT_HEADER = 'Crouter-Required-Contract';
18
18
  /** Response header listing the contract levels the server serves, comma-separated, one per major, e.g. `1.3`. */
@@ -154,7 +154,6 @@ export const routes = {
154
154
  humanReviewDocument: (reviewId) => `${V}/human/reviews/${reviewId}/document`,
155
155
  humanReviewComments: (reviewId) => `${V}/human/reviews/${reviewId}/comments`,
156
156
  humanReviewCommentEvents: (reviewId) => `${V}/human/reviews/${reviewId}/comment-events`,
157
- humanReviewCommentRanges: (reviewId) => `${V}/human/reviews/${reviewId}/comment-ranges`,
158
157
  humanComment: (commentId) => `${V}/human/comments/${commentId}`,
159
158
  humanCommentEdit: (commentId) => `${V}/human/comments/${commentId}/edit`,
160
159
  humanCommentResolve: (commentId) => `${V}/human/comments/${commentId}/resolve`,
@@ -18,7 +18,7 @@ const BASH_ROW_CHROME = 34;
18
18
  * ` ◇ ` + kind + ` · ` + elapsed + ` · ` + ` · ↵ details`. */
19
19
  const OBJECT_WAIT_ROW_CHROME = 30;
20
20
  /** Columns the review row spends on everything except the file name:
21
- * ` ✎ ` + the longest state prefix + ` · ` + ` · ↵ companion`. */
21
+ * ` ✎ ` + the longest state prefix + ` · ` + ` · ↵ open`. */
22
22
  const REVIEW_ROW_CHROME = 40;
23
23
  import { RemoteCanvasSource } from '../../../core/canvas/remote-canvas-source.js';
24
24
  import { cronWaitSummary } from './cron-wait.js';
@@ -228,8 +228,8 @@ export async function buildCanvasPanelLines(nodeId, asks, palette, source, crons
228
228
  items.push({
229
229
  key: `review:${review.review_id}`,
230
230
  kind: 'review',
231
- companionNodeId: review.companion_node_id,
232
- line: ` ${pen} ${muted(`${summary} · ↵ companion`)}${RESET}`,
231
+ reviewId: review.review_id,
232
+ line: ` ${pen} ${muted(`${summary} · ↵ open`)}${RESET}`,
233
233
  });
234
234
  }
235
235
  // Bash wait row: attention (human) -> active-now (running background work) ->
@@ -6,7 +6,7 @@
6
6
  // Enter opens the row (SWAPS this pane in place onto a node, or opens the wait
7
7
  // detail surface for a cron/bash/review/object row: a cron row the Inspector's
8
8
  // schedule section, a bash row the Inspector's jobs section, a review row the
9
- // review's companion viewer, an object-wait row the watched object's
9
+ // review's browser page, an object-wait row the watched object's
10
10
  // `crtr canvas read` in a popup),
11
11
  // Esc / any typed key returns to the editor. Disabled entirely for a REMOTE
12
12
  // attach: a remote graph id has no local pane to swap into and no local
@@ -26,8 +26,8 @@
26
26
  import { execFile } from 'node:child_process';
27
27
  import { Text, decodeKittyPrintable, matchesKey } from '@earendil-works/pi-tui';
28
28
  import { cliClient } from '../../../commands/api-client.js';
29
- import { focusNode } from '../../../core/runtime/focus-viewer.js';
30
29
  import { daemonErrorMessage } from '../../inbox/resolve.js';
30
+ import { openBrowser } from '../../open-browser.js';
31
31
  import { toBashJobStatus } from './bash-jobs.js';
32
32
  import { fillBar, fillWidth, stripSgr, REVERSE } from '../../../core/canvas/nav-render.js';
33
33
  import { buildCanvasPanelLines } from './canvas-panels.js';
@@ -173,26 +173,15 @@ export function createRoster(s, hooks) {
173
173
  return;
174
174
  }
175
175
  if (item.kind === 'review') {
176
- if (role !== 'controller') {
177
- hooks.setNotice('Read-only observer attach — cannot open the review companion');
178
- return;
179
- }
180
176
  exit();
181
- // Beside this pane, never in place: the person is asking to watch the
182
- // companion, not to give up the view they are asking from.
183
- // Runs the shared focus decision in-process (no cold `crtr` boot).
184
- const companionPane = process.env['TMUX_PANE'];
185
- if (companionPane === undefined || companionPane === '') {
186
- hooks.setNotice('Could not open the companion: no tmux pane');
187
- return;
188
- }
189
177
  void (async () => {
190
- const client = cliClient();
191
- const companion = await client.getNode(item.companionNodeId);
192
- const res = await focusNode(client, companion, { pane: companionPane });
193
- if (!res.focused)
194
- hooks.setNotice('Could not open the companion');
195
- })().catch((err) => hooks.setNotice(`Could not open the companion: ${daemonErrorMessage(err).split('\n')[0]}`));
178
+ const ticket = (await cliClient().listHumanInbox()).tickets.find((t) => t.kind === 'review' && t.request_id === item.reviewId);
179
+ if (ticket?.kind !== 'review' || ticket.url === undefined) {
180
+ hooks.setNotice('Reviews open on canvas.northlight.ai; this runtime has no canvas host');
181
+ return;
182
+ }
183
+ openBrowser(ticket.url);
184
+ })().catch((err) => hooks.setNotice(`Could not open the review: ${daemonErrorMessage(err).split('\n')[0]}`));
196
185
  return;
197
186
  }
198
187
  if (item.kind === 'bash') {
@@ -19,8 +19,7 @@
19
19
  // That timer is why this module has a `dispose`.
20
20
  import { Text, truncateToWidth } from '@earendil-works/pi-tui';
21
21
  import { visibleWidth } from '../../../core/canvas/nav-render.js';
22
- import { inTmux } from '../../../core/runtime/placement-tmux.js';
23
- import { formatBinding, inboxOpenHint } from '../../../core/keybindings/index.js';
22
+ import { inboxOpenHint } from '../../../core/keybindings/index.js';
24
23
  import { viewerKeyHint } from './key-hint.js';
25
24
  const NOTICE_CLEAR_MS = 3_000;
26
25
  const formatTokens = (n) => n >= 1000 ? `${(n / 1000).toFixed(n >= 10000 ? 0 : 1)}k` : `${n}`;
@@ -79,10 +78,6 @@ export function createStatusLine(s, hooks) {
79
78
  if (!hooks.mouseEnabled()) {
80
79
  segs.push(pal.muted('mouse off'));
81
80
  }
82
- // The file-review affordance, tmux-only like the surface it opens.
83
- if (inTmux() && bindings.gestures('crtr.attach.file-review').length > 0) {
84
- segs.push(pal.muted(`${formatBinding(bindings, 'crtr.attach.file-review')} review file`));
85
- }
86
81
  // Persistent, dim, lowest priority (appended last, so a narrow pane drops it
87
82
  // first): how to reach the action menu and inbox. The menu is a tmux menu, so
88
83
  // the hint only appears for a local in-tmux attach. When the pending-inbox
@@ -29,7 +29,7 @@ import { pageViewFromDTO, settledStatusOf } from '../../inbox/dto-adapt.js';
29
29
  import { PageAdapter } from '../../inbox/page-adapter.js';
30
30
  import { decodeInboxKey } from '../../inbox/tui/keys.js';
31
31
  import { daemonErrorMessage, resolveFailureKind, resolveTicketPage } from '../../inbox/resolve.js';
32
- import { editBufferInEditor } from '../../inbox/review/roundtrip.js';
32
+ import { editBufferInEditor } from '../../editor-roundtrip.js';
33
33
  export function createTicketPanel(s, hooks) {
34
34
  const { tui, pal } = s;
35
35
  let session;
@@ -66,9 +66,6 @@ export class InputController {
66
66
  setState(state) {
67
67
  this.state = state;
68
68
  }
69
- openFileReviewPicker(candidates, cwd, onChoose) {
70
- this.overlays.openFileReviewPicker(candidates, cwd, onChoose);
71
- }
72
69
  /** Retained as a narrow delegate for auth affordances wired by the session. */
73
70
  openAuthPicker(prepare) {
74
71
  return this.overlays.openAuthPicker(prepare);
@@ -1,7 +1,6 @@
1
1
  import { isBlockingDialog, renderDialog } from '../overlays/dialogs.js';
2
2
  import { buildForkPicker, buildModelPicker, buildScopedModelsPicker, buildSessionPicker, buildSettingsPicker, buildTreePicker, } from '../overlays/pickers.js';
3
3
  import { buildMcpPicker, readMcpServers, startMcpServerAction, MCP_EMPTY_STATE_HINT } from '../overlays/mcp.js';
4
- import { buildFileReviewPicker } from '../overlays/file-review.js';
5
4
  const PICKER_OVERLAY_OPTIONS = { anchor: 'center', width: '80%', maxHeight: '85%' };
6
5
  /** Owns transient dialog and picker lifetime. Editor submission remains with
7
6
  * InputController; this collaborator owns mount, replacement, dismissal, and
@@ -89,12 +88,6 @@ export class InputOverlayOwner {
89
88
  }
90
89
  this.showPicker((controls) => buildMcpPicker(rows, this.hooks.send, controls.close, this.hooks.notify));
91
90
  }
92
- openFileReviewPicker(candidates, cwd, onChoose) {
93
- this.showPicker((controls) => buildFileReviewPicker(candidates, cwd, (file) => {
94
- controls.close();
95
- onChoose(file);
96
- }, controls.close, this.hooks.notify));
97
- }
98
91
  async openAuthPicker(prepare) {
99
92
  const seq = ++this.openSeq;
100
93
  let build;
@@ -38,7 +38,6 @@ export function installGlobalKeys(ctx, hooks) {
38
38
  'crtr.attach.model-ladder.next': () => hooks.cycleModelLadder('forward'),
39
39
  'crtr.attach.model-ladder.previous': () => hooks.cycleModelLadder('backward'),
40
40
  'crtr.attach.command.inspect': hooks.inspectLoadedCommand,
41
- 'crtr.attach.file-review': hooks.openFileReview,
42
41
  'crtr.attach.profile-files': hooks.openProfileFiles,
43
42
  'crtr.attach.search': hooks.openSearch,
44
43
  'crtr.attach.whip': hooks.whip,
@@ -2,7 +2,6 @@ import { truncateToWidth, } from '@earendil-works/pi-tui';
2
2
  import { cliClient } from '../../../commands/api-client.js';
3
3
  import { focusViewer } from '../../../core/runtime/focus-viewer.js';
4
4
  import { daemonErrorMessage } from '../../inbox/resolve.js';
5
- import { buildFileReviewPicker } from '../overlays/file-review.js';
6
5
  import { reportInvariant as report } from './invariant.js';
7
6
  import { SurfaceFrame } from './surface-frame.js';
8
7
  const SURFACE_OVERLAY_OPTIONS = {
@@ -120,22 +119,6 @@ export class ViewerSurfaceHost {
120
119
  return false;
121
120
  }
122
121
  }
123
- pickReviewFile(spec) {
124
- return new Promise((resolve) => {
125
- let handle;
126
- let settled = false;
127
- const settle = (value) => {
128
- if (settled)
129
- return;
130
- settled = true;
131
- resolve(value);
132
- handle.close();
133
- };
134
- const picker = buildFileReviewPicker(spec.candidates, spec.cwd, (file) => settle(file), () => settle(null), (message) => this.notice(message));
135
- handle = this.mount(titled(picker.component, spec.title), { focus: picker.focus });
136
- handle.onClose(() => settle(null));
137
- });
138
- }
139
122
  /** Offer wheel input to the topmost surface only. */
140
123
  handleWheel(direction, lines) {
141
124
  return this.stack[this.stack.length - 1]?.component.handleWheel?.(direction, lines) ?? false;
@@ -49,8 +49,6 @@ import { FOCUS_REPORTING_ON } from './session/focus-events.js';
49
49
  import { GraphOverlay } from './overlays/graph.js';
50
50
  import { HelpOverlay } from './overlays/help.js';
51
51
  import { applyTheme, attachPalette, createKeybindingsManager, mirrorKeybindingsToEditor, mirrorKittyProtocolToEditor, resolveFdPath, } from './config.js';
52
- import { launchFileReview } from './overlays/file-review.js';
53
- import { openReviewSurfaceById, takeStartupReviewId } from '../inbox/review/launch.js';
54
52
  import { ViewerSurfaceHost } from './session/surface-host.js';
55
53
  import { createInboxSurface } from '../inbox/surface.js';
56
54
  import { loadProfileManifest } from '../../core/profiles/manifest.js';
@@ -183,7 +181,6 @@ onConnected) {
183
181
  const userConfig = readConfig('user');
184
182
  const initialWhip = held?.initialWhip ?? process.env['CRTR_ATTACH_INITIAL_WHIP'] === '1';
185
183
  delete process.env['CRTR_ATTACH_INITIAL_WHIP'];
186
- const startupReviewId = takeStartupReviewId();
187
184
  const startupTicketId = process.env['CRTR_ATTACH_OPEN_TICKET'];
188
185
  if (startupTicketId !== undefined)
189
186
  delete process.env['CRTR_ATTACH_OPEN_TICKET'];
@@ -515,37 +512,6 @@ onConnected) {
515
512
  onAccessError: (err) => setNotice(`Document links are unavailable: ${err instanceof Error ? err.message : String(err)}`),
516
513
  refresh: () => chatView.refreshMarkdown(),
517
514
  });
518
- const openFileReview = () => {
519
- if (ticketPanel.active()) {
520
- setNotice('Close the open request first (Esc)');
521
- return;
522
- }
523
- // Documents referenced as `[[…]]` sit beside file paths; the picker and
524
- // launcher tell them apart by their brackets.
525
- const candidates = [
526
- ...chatView.getTranscriptDocRefsNewestFirst().map((ref) => `[[${ref}]]`),
527
- ...chatView.getTranscriptFilePathsNewestFirst(),
528
- ];
529
- const review = (file) => {
530
- void launchFileReview(surfaceHost, file, {
531
- originNodeId: nodeId,
532
- onNotice: setNotice,
533
- });
534
- };
535
- // The cockpit's picker slot lives in the base frame, which a full-pane
536
- // surface covers while owning input — so mount the picker on the host's
537
- // own stack before opening the selected review in its window.
538
- if (surfaceHost.hasFullPaneSurface()) {
539
- void surfaceHost
540
- .pickReviewFile({ candidates, cwd: meta.cwd, title: 'Review a file or document named in this transcript' })
541
- .then((file) => {
542
- if (file !== null)
543
- review(file);
544
- });
545
- return;
546
- }
547
- input.openFileReviewPicker(candidates, meta.cwd, review);
548
- };
549
515
  const openProfileFiles = () => {
550
516
  if (remote) {
551
517
  setNotice('Profile file search is unavailable on remote canvases');
@@ -864,7 +830,6 @@ onConnected) {
864
830
  // mutating frame and must ride the same capability gate as every other one.
865
831
  cycleModelLadder: (direction) => input.cycleLadder(direction),
866
832
  inspectLoadedCommand: inventory.inspectLoadedCommand,
867
- openFileReview,
868
833
  openProfileFiles,
869
834
  openSearch: () => {
870
835
  if (surfaceHost.hasFullPaneSurface() || ticketPanel.active()) {
@@ -947,8 +912,6 @@ onConnected) {
947
912
  };
948
913
  void dialBroker();
949
914
  chromeRefresh.start();
950
- if (startupReviewId !== undefined)
951
- void openReviewSurfaceById(surfaceHost, startupReviewId);
952
915
  if (startupTicketId !== undefined && startupTicketId !== '' && !remote) {
953
916
  // The dashboard opened this conversation for its oldest pending ask: show the ask first.
954
917
  // Resolve it from the same two reads the inbox strip makes (listed tickets, plus pending unlisted pages).
@@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { tmpdir } from 'node:os';
5
5
  import { join } from 'node:path';
6
- import { announceFallbackEditor, NO_EDITOR_MESSAGE, resolveEditor } from '../../../core/editor-resolver.js';
6
+ import { announceFallbackEditor, NO_EDITOR_MESSAGE, resolveEditor } from '../core/editor-resolver.js';
7
7
  /** Run $EDITOR against a temporary buffer. Terminal ownership stays with the host. */
8
8
  export function editBufferInEditor(buffer) {
9
9
  const tmpFile = join(tmpdir(), `crtr-input-${randomUUID()}.txt`);
@@ -15,9 +15,8 @@ import { pageBodyLines } from './tui/page-body.js';
15
15
  import { docLinksRevision } from '../attach/render/doc-links.js';
16
16
  import { byNewestFirst, inboxRowFromDTO, pageViewFromDTO, settledStatusOf } from './dto-adapt.js';
17
17
  import { PageAdapter } from './page-adapter.js';
18
- import { ReviewAdapter } from './review-adapter.js';
19
- import { createReviewClient } from './review/review-client.js';
20
- import { editBufferInEditor } from './review/roundtrip.js';
18
+ import { editBufferInEditor } from '../editor-roundtrip.js';
19
+ import { openBrowser } from '../open-browser.js';
21
20
  import { daemonErrorMessage, dismissTicketViaDaemon, resolveFailureKind, resolveTicketPage, } from './resolve.js';
22
21
  /** Host-agnostic model for scanning, stable selection, and rendering. */
23
22
  export class InboxController {
@@ -39,7 +38,6 @@ export class InboxController {
39
38
  selectedIndex = 0;
40
39
  screen = 'list';
41
40
  adapter;
42
- reviewAdapter;
43
41
  focusingSource = false;
44
42
  /** The ticket open on the detail screen. */
45
43
  open;
@@ -364,7 +362,7 @@ export class InboxController {
364
362
  this.submittingDir = item.dir;
365
363
  try {
366
364
  if (item.kind === 'review')
367
- await createReviewClient().cancel(item.id, 'Canceled from the inbox.');
365
+ await cliClient().cancelReview(item.id, { reason: 'Canceled from the inbox.' });
368
366
  else
369
367
  await dismissTicketViaDaemon(item.id, { reason: 'Canceled from the inbox.', actor: 'human' });
370
368
  this.status = 'canceled';
@@ -383,7 +381,7 @@ export class InboxController {
383
381
  if (item === undefined)
384
382
  return;
385
383
  if (item.kind === 'review') {
386
- await this.activateReview(item);
384
+ this.activateReview(item);
387
385
  return;
388
386
  }
389
387
  const request = await this.requestOrNull(item.id);
@@ -436,31 +434,15 @@ export class InboxController {
436
434
  this.watchSelected(item.dir);
437
435
  this.markDirty();
438
436
  }
439
- /** A review opens in its own tmux window, which tmux selects at once, so
440
- * the inbox left behind in this pane has nothing more to do: it closes,
441
- * and returning to this window lands on the conversation beneath it. The
442
- * inbox stays up only when the window could not be opened, so its notice
443
- * is read where the person is looking. */
444
- async activateReview(item) {
445
- this.reviewAdapter = new ReviewAdapter({
446
- reviewId: item.id,
447
- host: this.host,
448
- });
449
- let opened = false;
450
- try {
451
- opened = await this.reviewAdapter.start();
452
- }
453
- catch (error) {
454
- this.status = daemonErrorMessage(error);
437
+ /** A review opens in the browser at its canvas page; a runtime with no canvas host has none. */
438
+ activateReview(item) {
439
+ if (item.url === undefined) {
440
+ this.status = 'Reviews open on canvas.northlight.ai; this runtime has no canvas host';
455
441
  }
456
- finally {
457
- this.reviewAdapter = undefined;
442
+ else {
443
+ openBrowser(item.url);
444
+ this.status = 'opened the review in your browser';
458
445
  }
459
- if (opened) {
460
- this.close();
461
- return;
462
- }
463
- await this.rescan();
464
446
  this.markDirty();
465
447
  }
466
448
  /** Seat the selection on a ticket dir, when present in the current list. */
@@ -509,7 +491,6 @@ export class InboxController {
509
491
  return;
510
492
  this.closed = true;
511
493
  this.started = false;
512
- void this.reviewAdapter?.stop();
513
494
  this.leaveDetail();
514
495
  for (const watcher of this.watchers)
515
496
  watcher.close();
@@ -611,7 +592,7 @@ export class InboxController {
611
592
  : '';
612
593
  const footer = selected.kind === 'page'
613
594
  ? [` ${DIM}Enter${RESET} opens the full page ${DIM}↑↓/jk${RESET} select${sendHint} ${DIM}x${RESET} cancel`, ` ${DIM}Page:${RESET} c comment u/d scroll${focusHint} ${DIM}q${RESET} close`]
614
- : [` ${DIM}Enter${RESET} opens the full review ${DIM}↑↓/jk${RESET} select ${DIM}x${RESET} cancel`, ` ${focusHint} ${DIM}q${RESET} close`];
595
+ : [` ${DIM}Enter${RESET} opens the review in your browser ${DIM}↑↓/jk${RESET} select ${DIM}x${RESET} cancel`, ` ${focusHint} ${DIM}q${RESET} close`];
615
596
  // The hints hold the bottom of the pane rather than trailing the preview,
616
597
  // so they stay in one place as the preview grows and shrinks.
617
598
  const room = Math.max(0, rows - footer.length);
@@ -53,6 +53,7 @@ function reviewRowFromDTO(dto) {
53
53
  subtitle: dto.subtitle,
54
54
  blockedSince: dto.blocked_since,
55
55
  source: dto.source,
56
+ ...(dto.url === undefined ? {} : { url: dto.url }),
56
57
  };
57
58
  }
58
59
  export function inboxRowFromDTO(dto) {
@@ -18,14 +18,7 @@ export function pageBodyLines(manifest, displayMarkdown, maxW, paneW) {
18
18
  if (manifest.dialect === 'html')
19
19
  return displayMarkdown === '' ? [`${DIM}HTML page — open in Northlight to read this${RESET}`] : md(displayMarkdown);
20
20
  const lines = displayMarkdown === '' ? [] : md(displayMarkdown);
21
- let priorStep = -1;
22
21
  for (const slot of manifest.slots) {
23
- if (manifest.steps > 1 && slot.step !== priorStep) {
24
- if (lines.length > 0)
25
- lines.push('');
26
- lines.push(`${BOLD}Step ${slot.step + 1}/${manifest.steps}${RESET}`);
27
- priorStep = slot.step;
28
- }
29
22
  if (lines.length > 0)
30
23
  lines.push('');
31
24
  for (const line of wrap(singleLine(describeSlot(slot)), maxW))
@@ -49,16 +49,9 @@ export function renderOverview(state, cols, rows) {
49
49
  if (hasBody)
50
50
  lines.push(` ${DIM}${hline(maxW)}${RESET}`, '');
51
51
  const answer = pageAnswer(state);
52
- let priorStep = -1;
53
52
  let cursorLine;
54
53
  for (let i = 0; i < state.slots.length; i++) {
55
54
  const slot = state.slots[i];
56
- if (state.manifest.steps > 1 && slot.step !== priorStep) {
57
- if (priorStep !== -1)
58
- lines.push('');
59
- lines.push(` ${BOLD}Step ${slot.step + 1}/${state.manifest.steps}${RESET}`);
60
- priorStep = slot.step;
61
- }
62
55
  const response = slot.id === undefined ? undefined : state.responses.get(slot.id);
63
56
  const icon = isResponseBearingSlot(slot) ? (slotAnswered(state, slot) ? `${GREEN}✓${RESET}` : `${DIM}○${RESET}`) : `${DIM}·${RESET}`;
64
57
  const cursor = i === state.currentIndex ? `${CYAN}▸${RESET} ` : ' ';
@@ -0,0 +1,6 @@
1
+ import { execFile } from 'node:child_process';
2
+ /** Open a URL in the person's browser (best-effort, fire-and-forget). */
3
+ export function openBrowser(url) {
4
+ const cmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
5
+ execFile(cmd, [url], { timeout: 5_000 }, () => { });
6
+ }