@north-light/cli 0.3.707 → 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.
- package/dist/api/client.d.ts +1 -2
- package/dist/api/client.js +3 -3
- package/dist/api/contract.d.ts +1 -1
- package/dist/api/contract.js +1 -1
- package/dist/api/dto/human.d.ts +9 -6
- package/dist/api/dto/inbox.d.ts +2 -0
- package/dist/api/dto/review-comments.d.ts +12 -35
- package/dist/api/dto/reviews.d.ts +3 -10
- package/dist/api/routes.d.ts +0 -1
- package/dist/api/routes.js +1 -1
- package/dist/builtin-memory/05-kinds/review/companion/00-base.md +2 -2
- package/dist/builtin-memory/crouter-sdk/release-notes.md +6 -0
- package/dist/clients/attach/chrome/canvas-panels.d.ts +1 -1
- package/dist/clients/attach/chrome/canvas-panels.js +1 -1
- package/dist/clients/attach/chrome/roster.js +6 -6
- package/dist/clients/attach/chrome/status-line.js +1 -1
- package/dist/clients/attach/chrome/ticket-panel.js +1 -1
- package/dist/clients/attach/input/controller.d.ts +0 -1
- package/dist/clients/attach/input/controller.js +3 -3
- package/dist/clients/attach/input/overlay-owner.d.ts +0 -1
- package/dist/clients/attach/input/overlay-owner.js +1 -1
- package/dist/clients/attach/session/keys.d.ts +0 -2
- package/dist/clients/attach/session/keys.js +1 -1
- package/dist/clients/attach/session/surface-host.d.ts +0 -5
- package/dist/clients/attach/session/surface-host.js +1 -1
- package/dist/clients/attach/viewer.js +544 -559
- package/dist/clients/editor-roundtrip.js +3 -0
- package/dist/clients/inbox/controller.d.ts +1 -6
- package/dist/clients/inbox/controller.js +1 -1
- package/dist/clients/inbox/dto-adapt.js +1 -1
- package/dist/clients/inbox/tui/page-body.js +1 -1
- package/dist/clients/inbox/tui/render.js +2 -2
- package/dist/clients/open-browser.d.ts +2 -0
- package/dist/clients/open-browser.js +1 -0
- package/dist/clients/surfaces/host.d.ts +0 -6
- package/dist/commands/human/review.js +1 -1
- package/dist/commands/sys/context/admin/shell.js +1 -1
- package/dist/core/canvas/schema-pg/025-review-anchors.sql +19 -0
- package/dist/core/canvas/schema-version.d.ts +1 -1
- package/dist/core/canvas/schema-version.js +1 -1
- package/dist/core/human/page-markdown.js +10 -12
- package/dist/core/human/tickets.js +1 -1
- package/dist/core/human/types.d.ts +4 -6
- package/dist/core/keybindings/attach-control.d.ts +0 -3
- package/dist/core/keybindings/attach-control.js +1 -1
- package/dist/core/keybindings/catalog.d.ts +1 -1
- package/dist/core/keybindings/catalog.js +1 -1
- package/dist/core/review/anchors.d.ts +28 -0
- package/dist/core/review/anchors.js +6 -0
- package/dist/core/review/comments.d.ts +2 -2
- package/dist/core/review/comments.js +7 -8
- package/dist/core/review/companion.d.ts +2 -1
- package/dist/core/review/companion.js +1 -1
- package/dist/core/review/document.d.ts +4 -17
- package/dist/core/review/document.js +1 -2
- package/dist/core/review/fork.js +2 -4
- package/dist/core/review/project.d.ts +1 -1
- package/dist/core/review/project.js +2 -2
- package/dist/core/review/realize.js +1 -1
- package/dist/core/review/stage.d.ts +2 -9
- package/dist/core/review/stage.js +1 -1
- package/dist/core/review/types.d.ts +16 -12
- package/dist/core/review/types.js +1 -1
- package/dist/core/runtime/broker-cli.js +3 -3
- package/dist/core/runtime/broker-extension-render.js +1 -1
- package/dist/core/runtime/tmux-bindings.js +3 -3
- package/dist/daemon/api/canvas-host.js +1 -1
- package/dist/daemon/api/document-page.d.ts +12 -1
- package/dist/daemon/api/document-page.js +6 -6
- package/dist/daemon/api/handlers/inbox.js +1 -1
- package/dist/daemon/api/handlers/review-comments.js +1 -1
- package/dist/daemon/api/handlers/reviews.js +1 -1
- package/dist/daemon/api/map.js +2 -2
- package/dist/daemon/api/review-page.d.ts +3 -0
- package/dist/daemon/api/review-page.js +13 -0
- package/dist/daemon/broker-memory-cap.d.ts +9 -0
- package/dist/daemon/broker-memory-cap.js +2 -0
- package/dist/daemon/broker-signals/bus.d.ts +1 -1
- package/dist/daemon/broker-signals/bus.js +1 -1
- package/dist/daemon/crtrd.js +14 -14
- package/dist/daemon/machine-daemon.js +1 -1
- package/dist/daemon/review/comment-notify.js +2 -2
- package/dist/daemon/review/deliver.d.ts +2 -2
- package/dist/daemon/review/deliver.js +6 -2
- package/dist/daemon/review/finish.js +1 -1
- package/dist/doc-editor/Geist-Variable.woff2 +0 -0
- package/dist/doc-editor/GeistMono-Variable.woff2 +0 -0
- package/dist/doc-editor/editor.css +1 -1
- package/dist/doc-editor/review.css +2 -0
- package/dist/doc-editor/review.js +149 -0
- package/dist/pi-extensions/canvas-review-boundary.js +3 -3
- package/docs/sdk/release-notes.md +6 -0
- package/package.json +13 -4
- package/packages/crouter-api/dist/api/client.js +0 -3
- package/packages/crouter-api/dist/api/contract.js +1 -1
- package/packages/crouter-api/dist/api/routes.js +0 -1
- package/packages/crouter-api/dist/clients/attach/chrome/canvas-panels.js +3 -3
- package/packages/crouter-api/dist/clients/attach/chrome/roster.js +9 -20
- package/packages/crouter-api/dist/clients/attach/chrome/status-line.js +1 -6
- package/packages/crouter-api/dist/clients/attach/chrome/ticket-panel.js +1 -1
- package/packages/crouter-api/dist/clients/attach/input/controller.js +0 -3
- package/packages/crouter-api/dist/clients/attach/input/overlay-owner.js +0 -7
- package/packages/crouter-api/dist/clients/attach/session/keys.js +0 -1
- package/packages/crouter-api/dist/clients/attach/session/surface-host.js +0 -17
- package/packages/crouter-api/dist/clients/attach/viewer.js +0 -37
- package/packages/crouter-api/dist/clients/{inbox/review/roundtrip.js → editor-roundtrip.js} +1 -1
- package/packages/crouter-api/dist/clients/inbox/controller.js +12 -31
- package/packages/crouter-api/dist/clients/inbox/dto-adapt.js +1 -0
- package/packages/crouter-api/dist/clients/inbox/tui/page-body.js +0 -7
- package/packages/crouter-api/dist/clients/inbox/tui/render.js +0 -7
- package/packages/crouter-api/dist/clients/open-browser.js +6 -0
- package/packages/crouter-api/dist/commands/human/review.js +17 -18
- package/packages/crouter-api/dist/commands/sys/context/admin/shell.js +1 -1
- package/packages/crouter-api/dist/core/canvas/schema-version.js +1 -1
- package/packages/crouter-api/dist/core/human/page-markdown.js +2 -6
- package/packages/crouter-api/dist/core/human/tickets.js +2 -11
- package/packages/crouter-api/dist/core/keybindings/attach-control.js +0 -1
- package/packages/crouter-api/dist/core/keybindings/catalog.js +1 -3
- package/packages/crouter-api/dist/core/review/anchors.js +91 -0
- package/packages/crouter-api/dist/core/review/comments.js +27 -46
- package/packages/crouter-api/dist/core/review/companion.js +5 -9
- package/packages/crouter-api/dist/core/review/document.js +17 -89
- package/packages/crouter-api/dist/core/review/project.js +2 -1
- package/packages/crouter-api/dist/core/review/types.js +2 -2
- package/packages/crouter-api/dist/core/runtime/tmux-bindings.js +0 -5
- package/packages/crouter-api/dist/daemon/api/map.js +2 -6
- package/packages/crouter-api/dist/daemon/broker-signals/bus.js +1 -1
- package/packages/crouter-api/dist/daemon/review/deliver.js +4 -3
- package/packages/crouter-api/dist/daemon/review/finish.js +26 -47
- package/packages/crouter-api/package.json +1 -1
- package/packages/crouter-identity/package.json +1 -1
- package/packages/crouter-plugin/package.json +3 -3
- package/runtime.lock.json +1740 -505
- package/dist/clients/attach/overlays/file-review.d.ts +0 -10
- package/dist/clients/attach/overlays/file-review.js +0 -2
- package/dist/clients/inbox/review/anchors.d.ts +0 -41
- package/dist/clients/inbox/review/anchors.js +0 -1
- package/dist/clients/inbox/review/comments-client.d.ts +0 -74
- package/dist/clients/inbox/review/comments-client.js +0 -1
- package/dist/clients/inbox/review/companion-pane.d.ts +0 -47
- package/dist/clients/inbox/review/companion-pane.js +0 -1
- package/dist/clients/inbox/review/document-surface.d.ts +0 -212
- package/dist/clients/inbox/review/document-surface.js +0 -2
- package/dist/clients/inbox/review/frame.d.ts +0 -57
- package/dist/clients/inbox/review/frame.js +0 -1
- package/dist/clients/inbox/review/keys.d.ts +0 -69
- package/dist/clients/inbox/review/keys.js +0 -1
- package/dist/clients/inbox/review/launch.d.ts +0 -16
- package/dist/clients/inbox/review/launch.js +0 -1
- package/dist/clients/inbox/review/live-source.d.ts +0 -24
- package/dist/clients/inbox/review/live-source.js +0 -1
- package/dist/clients/inbox/review/nvim.d.ts +0 -15
- package/dist/clients/inbox/review/nvim.js +0 -1
- package/dist/clients/inbox/review/remap.d.ts +0 -51
- package/dist/clients/inbox/review/remap.js +0 -1
- package/dist/clients/inbox/review/review-client.d.ts +0 -43
- package/dist/clients/inbox/review/review-client.js +0 -1
- package/dist/clients/inbox/review/roundtrip.js +0 -3
- package/dist/clients/inbox/review/state.d.ts +0 -153
- package/dist/clients/inbox/review/state.js +0 -4
- package/dist/clients/inbox/review-adapter.d.ts +0 -17
- package/dist/clients/inbox/review-adapter.js +0 -1
- package/dist/core/review/remap.d.ts +0 -24
- package/dist/core/review/remap.js +0 -19
- package/dist/core/review/signal.d.ts +0 -5
- package/dist/core/review/signal.js +0 -1
- package/packages/crouter-api/dist/clients/attach/overlays/file-review.js +0 -146
- package/packages/crouter-api/dist/clients/inbox/review/anchors.js +0 -89
- package/packages/crouter-api/dist/clients/inbox/review/comments-client.js +0 -103
- package/packages/crouter-api/dist/clients/inbox/review/companion-pane.js +0 -109
- package/packages/crouter-api/dist/clients/inbox/review/document-surface.js +0 -1268
- package/packages/crouter-api/dist/clients/inbox/review/frame.js +0 -309
- package/packages/crouter-api/dist/clients/inbox/review/keys.js +0 -133
- package/packages/crouter-api/dist/clients/inbox/review/launch.js +0 -170
- package/packages/crouter-api/dist/clients/inbox/review/live-source.js +0 -160
- package/packages/crouter-api/dist/clients/inbox/review/nvim.js +0 -43
- package/packages/crouter-api/dist/clients/inbox/review/remap.js +0 -157
- package/packages/crouter-api/dist/clients/inbox/review/review-client.js +0 -125
- package/packages/crouter-api/dist/clients/inbox/review/state.js +0 -315
- package/packages/crouter-api/dist/clients/inbox/review-adapter.js +0 -43
- package/packages/crouter-api/dist/core/review/signal.js +0 -12
- package/packages/crouter-api/dist/core/termrender/code-doc.js +0 -92
- /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
|
|
2
|
-
`):[`Reviewed
|
|
3
|
-
`);e.sendMessage({customType:
|
|
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};
|
|
@@ -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.
|
|
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.
|
|
160
|
-
"@north-light/plugin": "0.3.
|
|
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.
|
|
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 + ` · ` + ` · ↵
|
|
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
|
-
|
|
232
|
-
line: ` ${pen} ${muted(`${summary} · ↵
|
|
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
|
|
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
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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 {
|
|
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 '../../
|
|
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 '
|
|
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 {
|
|
19
|
-
import {
|
|
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
|
|
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
|
-
|
|
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
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
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
|
-
|
|
457
|
-
|
|
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
|
|
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);
|
|
@@ -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
|
+
}
|
|
@@ -63,8 +63,8 @@ function commentPreview(comment) {
|
|
|
63
63
|
comment_id: comment.comment_id,
|
|
64
64
|
status: comment.status,
|
|
65
65
|
revision: comment.revision,
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
quote: comment.anchor.quote,
|
|
67
|
+
detached: comment.location === null,
|
|
68
68
|
author: comment.author,
|
|
69
69
|
updated_by: comment.updated_by,
|
|
70
70
|
created_at: comment.created_at,
|
|
@@ -79,7 +79,7 @@ const humanReviewNew = defineLeaf({
|
|
|
79
79
|
help: {
|
|
80
80
|
name: 'human review new',
|
|
81
81
|
summary: 'queue a live document review and return its ticket handle immediately',
|
|
82
|
-
guide: 'The person reviews the document in the
|
|
82
|
+
guide: 'The person reviews the document in the browser at the canvas host, with a companion agent that edits the document itself while they comment; there is no file or snapshot to review. Needs a cloud runtime with a canvas host, otherwise it fails with `no_canvas_host`. When the person approves, the approval, with the comments and their quotes, is pushed to your inbox.',
|
|
83
83
|
params: [
|
|
84
84
|
{ kind: 'positional', name: 'document', type: 'string', required: true, constraint: 'The document to review: a name, `<owner>/<name>` or id, `[[ ]]` optional. It must have one head; merge several heads first.' },
|
|
85
85
|
{ kind: 'flag', name: 'subtitle', type: 'string', required: true, constraint: 'One plain-English sentence stating the review needed and why it matters.' },
|
|
@@ -87,14 +87,12 @@ const humanReviewNew = defineLeaf({
|
|
|
87
87
|
output: [
|
|
88
88
|
{ name: 'review_id', type: 'string', required: true, constraint: 'Daemon-owned review id for the document, comments, and companion.' },
|
|
89
89
|
{ name: 'document', type: 'string', required: true, constraint: 'The reviewed document\'s `<owner>/<name>`.' },
|
|
90
|
-
{ name: 'review_dir', type: 'string', required: true, constraint: 'Directory containing the review\'s document.md snapshot and immutable result.json.' },
|
|
91
90
|
{ name: 'result_path', type: 'string', required: true, constraint: 'The immutable terminal result path: <review_dir>/result.json.' },
|
|
92
|
-
{ name: 'follow_up', type: 'string', required: true, constraint: 'The review remains live for the person and companion; approval is delivered to the origin inbox.' },
|
|
93
91
|
],
|
|
94
92
|
outputKind: 'object',
|
|
95
93
|
effects: [
|
|
96
|
-
'Records your read of the document and creates the durable review
|
|
97
|
-
'
|
|
94
|
+
'Records your read of the document as the review base and creates the durable review and the companion session fork.',
|
|
95
|
+
'This command does not submit an approval.',
|
|
98
96
|
],
|
|
99
97
|
},
|
|
100
98
|
run: async (input) => {
|
|
@@ -109,24 +107,23 @@ const humanReviewNew = defineLeaf({
|
|
|
109
107
|
return {
|
|
110
108
|
review_id: review.review_id,
|
|
111
109
|
document: review.document ?? null,
|
|
112
|
-
review_dir: review.review_dir,
|
|
113
110
|
result_path: `${review.review_dir}/result.json`,
|
|
114
|
-
follow_up: 'The review is live for the person in the attach viewer with its companion agent. Approval is pushed to the origin inbox when submitted.',
|
|
115
111
|
};
|
|
116
112
|
},
|
|
117
113
|
});
|
|
118
114
|
const humanReviewCommentCreate = defineLeaf({
|
|
119
115
|
name: 'create',
|
|
120
116
|
description: 'add an anchored review comment',
|
|
121
|
-
whenToUse: 'recording a new finding or instruction against
|
|
117
|
+
whenToUse: 'recording a new finding or instruction against a passage of the document.',
|
|
122
118
|
help: {
|
|
123
119
|
name: 'human review comment create',
|
|
124
|
-
summary: 'add a daemon-owned comment anchored to document
|
|
125
|
-
guide: 'Without --review, the daemon targets the calling companion node\'s open review. Comment text is supplied on stdin;
|
|
120
|
+
summary: 'add a daemon-owned comment anchored to quoted document text',
|
|
121
|
+
guide: 'Without --review, the daemon targets the calling companion node\'s open review. Comment text is supplied on stdin; the quote is matched against the document\'s rendered text, whitespace collapsed.',
|
|
126
122
|
params: [
|
|
127
123
|
{ kind: 'flag', name: 'review', type: 'string', required: false, constraint: 'Review id. Omit only to target the calling companion node\'s open review.' },
|
|
128
|
-
{ kind: 'flag', name: '
|
|
129
|
-
{ kind: 'flag', name: '
|
|
124
|
+
{ kind: 'flag', name: 'quote', type: 'string', required: true, constraint: 'Text to anchor to; it must occur in the current rendered document. When it occurs more than once, the error lists each occurrence with its context: pass --prefix or --suffix.' },
|
|
125
|
+
{ kind: 'flag', name: 'prefix', type: 'string', required: false, constraint: 'Up to 32 characters immediately before the quote.' },
|
|
126
|
+
{ kind: 'flag', name: 'suffix', type: 'string', required: false, constraint: 'Up to 32 characters immediately after the quote.' },
|
|
130
127
|
{ kind: 'flag', name: 'deliver', type: 'enum', choices: ['wake', 'quiet'], required: false, constraint: 'wake interrupts the companion now; quiet leaves a durable message for its next turn. Default: wake unless the caller is the companion.' },
|
|
131
128
|
{ kind: 'stdin', name: 'text', required: true, constraint: 'Non-empty comment text.' },
|
|
132
129
|
],
|
|
@@ -144,11 +141,13 @@ const humanReviewCommentCreate = defineLeaf({
|
|
|
144
141
|
},
|
|
145
142
|
run: async (input, context) => {
|
|
146
143
|
const reviewId = input['review'];
|
|
147
|
-
const line = input['line'];
|
|
148
|
-
const endLine = input['endLine'];
|
|
149
144
|
const result = await cliClient().createReviewComment(reviewId, {
|
|
150
145
|
text: requireCommentText(input['text'], 'create'),
|
|
151
|
-
anchor: {
|
|
146
|
+
anchor: {
|
|
147
|
+
quote: input['quote'],
|
|
148
|
+
...(typeof input['prefix'] === 'string' ? { prefix: input['prefix'] } : {}),
|
|
149
|
+
...(typeof input['suffix'] === 'string' ? { suffix: input['suffix'] } : {}),
|
|
150
|
+
},
|
|
152
151
|
actor_node_id: nodeActor(),
|
|
153
152
|
...(explicitDeliver(input, context) === undefined ? {} : { deliver: explicitDeliver(input, context) }),
|
|
154
153
|
});
|
|
@@ -231,7 +230,7 @@ function commentMutationLeaf(verb) {
|
|
|
231
230
|
{ name: 'comment_id', type: 'string', required: true, constraint: 'Daemon-owned comment id.' },
|
|
232
231
|
{ name: 'status', type: 'string', required: true, constraint: 'Current comment status: open, resolved, or deleted.' },
|
|
233
232
|
{ name: 'revision', type: 'integer', required: true, constraint: 'Current per-comment revision.' },
|
|
234
|
-
{ name: 'anchor', type: 'object', required: true, constraint: '
|
|
233
|
+
{ name: 'anchor', type: 'object', required: true, constraint: 'Quoted text anchor.' },
|
|
235
234
|
{ name: 'author', type: 'object', required: true, constraint: 'Daemon-derived human or node attribution.' },
|
|
236
235
|
{ name: 'text', type: 'string', required: true, constraint: 'Stored full comment text.' },
|
|
237
236
|
{ name: 'changed', type: 'boolean', required: true, constraint: 'Whether this invocation changed the comment.' },
|
|
@@ -7,7 +7,7 @@ import { formatGesture, matchesPiTuiInput, } from '../../../../core/keybindings/
|
|
|
7
7
|
import { writeClipboardTextEverywhere } from '../../../../core/clipboard-text.js';
|
|
8
8
|
import { runTuiPage } from '../../../../core/tui/page-host.js';
|
|
9
9
|
import { PAGE_CHROME_ROWS, columns, framed, pageFrame, theme, } from '../../../../core/tui/panel.js';
|
|
10
|
-
import { editBufferInEditor } from '../../../../clients/
|
|
10
|
+
import { editBufferInEditor } from '../../../../clients/editor-roundtrip.js';
|
|
11
11
|
import { PLANNED_EVENTS } from '../resolve.js';
|
|
12
12
|
import { moveDoc, readBody, readOnlyReason, toggleUnlisted, writeBody, writePreview, writeRules, } from './actions.js';
|
|
13
13
|
import { axesOf, cycleAxis, cycleFacet, facetsOf, payloadRowOf, railEnter, railRowKey, railRowsOf, renderRail, setTypedAxis, typedAxisValue, } from './rail-panel.js';
|