viewable-one 0.12.2 → 0.12.4
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/CHANGELOG.md +79 -0
- package/README.md +2 -2
- package/SPAWN.md +107 -53
- package/glytch.mjs +49 -12
- package/lib/acp.mjs +110 -148
- package/lib/admission.mjs +25 -5
- package/lib/agents.mjs +59 -16
- package/lib/answerTag.mjs +47 -0
- package/lib/atomic.mjs +1 -16
- package/lib/auth.mjs +25 -9
- package/lib/boardside.mjs +28 -12
- package/lib/child.mjs +89 -116
- package/lib/claudeModels.mjs +168 -0
- package/lib/codex-rpc.mjs +2 -2
- package/lib/codex.mjs +43 -63
- package/lib/codexApps.mjs +5 -3
- package/lib/codexToolInputs.mjs +98 -22
- package/lib/codingChecks.mjs +8 -4
- package/lib/conversationRules.mjs +46 -6
- package/lib/detect.mjs +14 -23
- package/lib/devserver.mjs +6 -6
- package/lib/doctor.mjs +4 -2
- package/lib/folderReads.mjs +96 -0
- package/lib/followUps.mjs +170 -0
- package/lib/hosted.mjs +13 -4
- package/lib/init-connect.mjs +29 -10
- package/lib/lateResume.mjs +135 -0
- package/lib/logindaemon.mjs +113 -33
- package/lib/mcpjson.mjs +35 -2
- package/lib/multiwatch.mjs +80 -45
- package/lib/pagePictures.mjs +14 -11
- package/lib/paths.mjs +0 -1
- package/lib/permissionAsk.mjs +341 -58
- package/lib/procs.mjs +73 -2
- package/lib/refusal.mjs +0 -2
- package/lib/restartPass.mjs +52 -11
- package/lib/rowsAnswers.mjs +18 -34
- package/lib/rowsEvents.mjs +20 -2
- package/lib/runner-health.mjs +26 -2
- package/lib/runner.mjs +106 -1363
- package/lib/runnerAdmission.mjs +33 -12
- package/lib/runnerApi.mjs +28 -12
- package/lib/runnerBeat.mjs +398 -0
- package/lib/runnerCompletion.mjs +5 -2
- package/lib/runnerExecute.mjs +227 -0
- package/lib/runnerGates.mjs +338 -0
- package/lib/runnerLaunch.mjs +351 -0
- package/lib/runnerLease.mjs +31 -9
- package/lib/runnerOps.mjs +226 -0
- package/lib/runnerPace.mjs +10 -6
- package/lib/runnerRecovery.mjs +457 -0
- package/lib/runnerRegister.mjs +29 -8
- package/lib/runnerSettlement.mjs +29 -9
- package/lib/selfUninstall.mjs +239 -0
- package/lib/spawn.mjs +0 -5
- package/lib/sync.mjs +26 -14
- package/lib/update.mjs +184 -0
- package/lib/viewableFolder.mjs +8 -2
- package/lib/worktree.mjs +66 -13
- package/lib/writePolicy.mjs +90 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,85 @@ package.
|
|
|
13
13
|
|
|
14
14
|
## [Unreleased]
|
|
15
15
|
|
|
16
|
+
## [0.12.4] - 2026-11-09
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- The computer app updates itself from the board's More menu (#4949). The
|
|
21
|
+
board's Update request reaches it on its heartbeat; it waits for running
|
|
22
|
+
runs, then installs. While an update waits or installs, no run starts,
|
|
23
|
+
including a recovered run in the restart pass (`runGate` in
|
|
24
|
+
`runnerAdmission.mjs`, used by `claimOne` and `restartPass`); the record
|
|
25
|
+
stays so a later pass or the restarted app carries it on.
|
|
26
|
+
- A take that failed with no answer may have won on the server, which
|
|
27
|
+
deletes the request. If the request is then gone, the update fails where
|
|
28
|
+
the user sees it ("Nothing was installed") instead of idling; Try again
|
|
29
|
+
files a new request. A failed read of update requests is reported in the
|
|
30
|
+
heartbeat (`updatesUnread`) and the computer keeps the request it holds
|
|
31
|
+
instead of reading the missing op as Cancel update.
|
|
32
|
+
- Remove uninstalls the computer app (#4951, #4978). It uninstalls only when
|
|
33
|
+
every key the computer holds reads removed for good, and never deletes the
|
|
34
|
+
Viewable folder. Removal evidence lives in `computer_removed_keys`, which
|
|
35
|
+
the OAuth cleanup does not delete, so a computer away past the 30-day
|
|
36
|
+
cleanup still hears it. A folder added again after an uninstall is not
|
|
37
|
+
uninstalled again.
|
|
38
|
+
- The uninstall request arrives within seconds: a database trigger sends an
|
|
39
|
+
`op` hint on the owner's live runner topics, and the bridge beats at once.
|
|
40
|
+
- On Linux and WSL the uninstall starts in its own `systemd-run --user
|
|
41
|
+
--collect` unit; on Windows it starts through WMI so Task Scheduler's end
|
|
42
|
+
of the job does not kill it. Both fall back to a plain detached child. The
|
|
43
|
+
launched script carries a curated environment with no tokens or keys.
|
|
44
|
+
- An online computer that does not take uninstall requests (older apps) keeps
|
|
45
|
+
the copy-a-prompt way, with the board-only Remove.
|
|
46
|
+
|
|
47
|
+
## [0.12.3] - 2026-11-09
|
|
48
|
+
|
|
49
|
+
### Fixed
|
|
50
|
+
|
|
51
|
+
- On Windows, signing in opens the browser with the whole link. It used to go
|
|
52
|
+
through `cmd`, which cut the link at the first `&` (so the sign-in page had
|
|
53
|
+
no client id) and could run text after it as commands. The link now goes to
|
|
54
|
+
the browser as one argument with no shell, and only `http` and `https` links
|
|
55
|
+
are opened.
|
|
56
|
+
- Pressing Ctrl-C on `viewable runner watch` stops it at once on a Mac whose
|
|
57
|
+
file-event service has stopped answering. It used to hang forever, waiting
|
|
58
|
+
for that service while closing its watch on the registry folder. The
|
|
59
|
+
registry file is now checked for changes about once a second instead.
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- A shell command's ask in the idea offers "Allow for this run": one tap
|
|
64
|
+
allows the command and every later command of the same run without asking.
|
|
65
|
+
Nothing is written to the folder's saved permissions, so the next run asks
|
|
66
|
+
again, and Stop and the wall clock still end the run. A task that drives a
|
|
67
|
+
Mac app step by step sent eleven slightly different commands, and "Always
|
|
68
|
+
allow" (that exact command only) never covered the next one (#4105, #4106).
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- `viewable init` and `viewable doctor` no longer tell a logged-out Claude
|
|
73
|
+
Code to "run `claude` once and log in", and init's Codex line no longer
|
|
74
|
+
says "from a terminal". They name the verb the pasting agent runs itself
|
|
75
|
+
(`claude auth login`, `codex mcp login viewable`), so a person connecting
|
|
76
|
+
through the setup prompt is never sent to a terminal to type a command
|
|
77
|
+
(#4205).
|
|
78
|
+
|
|
79
|
+
- A run is told to leave progress to its plan and session log, to treat its
|
|
80
|
+
closing message as the one reply, and to put the answer itself on anything
|
|
81
|
+
it adds to the board, never a note saying where it is. This is wording only:
|
|
82
|
+
nothing yet stops a run that ignores it from posting step messages (#4093).
|
|
83
|
+
- A shell command's ask is titled with the agent's own words ("Can I clear
|
|
84
|
+
Calculator with Escape, type 12 x 34, copy the result?"), never the command cut off
|
|
85
|
+
with "...", and its Always button says what it saves: "Always allow this
|
|
86
|
+
command in <folder>" for anything off the short safe list. Version 0.12.2
|
|
87
|
+
still showed "Can I run <command> in <folder>?" and "Always allow in
|
|
88
|
+
<folder>" (#3609, #3683, #3726, #4102, #4103).
|
|
89
|
+
- A Claude Code run for an agent that keeps an OpenRouter model id such as
|
|
90
|
+
`anthropic/claude-haiku-5.5` passes the model's short name (`haiku`) to
|
|
91
|
+
`--model`, because Claude Code refuses the OpenRouter id. Other ids pass
|
|
92
|
+
through unchanged (#3869). The fix reaches people with the next bridge
|
|
93
|
+
release.
|
|
94
|
+
|
|
16
95
|
## [0.12.2] - 2026-10-30
|
|
17
96
|
|
|
18
97
|
### Changed
|
package/README.md
CHANGED
|
@@ -259,7 +259,7 @@ open](#reading-the-board-with-no-app-open).
|
|
|
259
259
|
| --- | --- |
|
|
260
260
|
| `get_board(board_id?, tag?, group?, kind?, since_days?, match?, limit?, view?, geometry?, detail?)` | The board as a readable digest: ids, one line per idea, groups, edges, question state, open flags, ages. Slim by default. The filters narrow it, and the reply always says what it left out. `view:"full"` returns everything, `geometry:true` adds positions and sizes. |
|
|
261
261
|
| `get_node(id)` | One node in full from the graph mirror, with its incoming and outgoing edges. Images attached to the idea come back as image blocks to look at, each labelled with the node and field it came from. An image the mirror does not hold is named as unavailable rather than quietly left out. |
|
|
262
|
-
| `get_library()` | The component library a DRAWN idea is written against, generated from the same registry the app renders with: every tag, its attributes, which are required, a working example, and the rules a drawing must keep. Read it once before passing `snippet` on `addIdea
|
|
262
|
+
| `get_library()` | The component library a DRAWN idea is written against, generated from the same registry the app renders with: every tag, its attributes, which are required, a working example, and the rules a drawing must keep. Read it once before passing `snippet` on `addIdea`. About 2k tokens, so once per session, not once per drawing. |
|
|
263
263
|
| `propose(ops[], label?)` | Sends board change requests and returns its op id. Every create, edit and delete lands as a proposal you accept or reject. |
|
|
264
264
|
| `ask_user(question, why, options?, from_id?)` | Adds a question to an idea's conversation and returns at once; the answer comes back through `check_answer` or `collect_session`. `why` is required: it is shown under the question and is the context that travels with it. With no `from_id` the question goes on the idea the run belongs to. |
|
|
265
265
|
| `check_answer(question_id, wait_s?)` | Where an earlier question stands: answered with the decision, still open, dismissed, or not yet ingested. With `wait_s` (up to 50) it waits that long for the answer and returns as soon as it lands; an agent that cannot go on without the answer keeps calling it until it is answered or dismissed. |
|
|
@@ -621,7 +621,7 @@ Common failures, and what the row says:
|
|
|
621
621
|
| `daemon loaded not loaded` | The OS does not have `ai.glytch.runner`. Run `viewable init` from this project folder. |
|
|
622
622
|
| `daemon loaded no systemd here` | An older WSL with no `systemctl --user`. Run `PM_SPAWN_RUNNER=on viewable runner watch` instead. |
|
|
623
623
|
| `coding agents none` | "no coding agent on PATH - install Claude Code, opencode or Codex". |
|
|
624
|
-
| `Claude Code login logged out` | "run `claude`
|
|
624
|
+
| `Claude Code login logged out` | "run `claude auth login` to sign in, or sessions fail at spawn". |
|
|
625
625
|
| `git missing` (a warning) | "no git - sessions run unisolated in the linked folder, with no worktree of their own". On Windows the row adds that Claude Code's Bash tool needs Git for Windows. |
|
|
626
626
|
| `.mcp.json unreadable` | The file exists and is not JSON glytch can extend. It is your work, so nothing was written: add the `viewable` server by hand. |
|
|
627
627
|
| `version unknown` | npm did not answer. Being offline is not a broken install. |
|
package/SPAWN.md
CHANGED
|
@@ -109,7 +109,9 @@ to rows did not change.
|
|
|
109
109
|
the same way every other hosted call in this package resolves one, POST to
|
|
110
110
|
`supabase/functions/board-runner/`.
|
|
111
111
|
|
|
112
|
-
`bridge/lib/runner.mjs`
|
|
112
|
+
`bridge/lib/runner.mjs` (with the pieces it was split into in #4668:
|
|
113
|
+
`runnerGates.mjs`, `runnerExecute.mjs`, `runnerLaunch.mjs`, `runnerOps.mjs`,
|
|
114
|
+
`runnerBeat.mjs`) reads and writes rows, not files, for every request
|
|
113
115
|
kind, chat turns included. What replaces each piece that used to be a file
|
|
114
116
|
under `.glytch/inbox/spawn/`:
|
|
115
117
|
|
|
@@ -125,7 +127,7 @@ under `.glytch/inbox/spawn/`:
|
|
|
125
127
|
| the shared-preview request/receipt pair (`.glytch/inbox/preview/`) | a `run_ops` row of `kind:"preview"` - claimed once (`opTake`), its proofs read from the claimed run row (`runnerApi.runs`) and from `get_node` over `hosted.callTool`, never from `canvas/`; `opResult` ticks through starting/ready/offline/error on the SAME op row, since preview (unlike merge/delete/relaunch) is not one-shot - `bridge/lib/sharedPreview.mjs`'s `createSharedPreviewService` tracks it across beats |
|
|
126
128
|
| `<id>.reply-*.json` promoted to a new request | the `resume` op - one call, no file, no `createdBy:"runner"` request to write. Carries `images` (a late message's own, same shape a reply file's `images` array used) when the message had any - `runnerApi.mjs`'s own header says why the OP does not declare the field yet on its side |
|
|
127
129
|
| the `startSession`/`endSession` ops files, and the wait for their receipt | nothing - `claim` moving a row to `status:'running'` IS the start; there is no more window to guard |
|
|
128
|
-
| a chat-turn's request FILE, `<id>.stop`, its per-room lock (`activeChatTurnForRoom`, disk-scanned) | the same row contract as an ordinary session, plus `activeChatTurnForRoomRows` (`
|
|
130
|
+
| a chat-turn's request FILE, `<id>.stop`, its per-room lock (`activeChatTurnForRoom`, disk-scanned) | the same row contract as an ordinary session, plus `activeChatTurnForRoomRows` (`runnerGates.mjs`) in place of the per-idea lock - a chat turn has no idea behind it, so its lock is per `roomId` instead |
|
|
129
131
|
|
|
130
132
|
**Admission, leases and completion recovery (2026-09-26).** Admission refuses
|
|
131
133
|
unavailable concurrency or spending reads. Each claim carries an instance UUID
|
|
@@ -918,36 +920,65 @@ at all - a CLI request or a conversational session has nothing to collect, and
|
|
|
918
920
|
Wired only when the run has a bearer to send at all (`viewable login` or
|
|
919
921
|
`VIEWABLE_BOARD_TOKEN`); with neither, there is nothing on the hosted
|
|
920
922
|
endpoint for the child to have asked in the first place.
|
|
921
|
-
- **After the child exits**,
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
`
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
- **
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
923
|
+
- **After the child exits**, `promoteLateRows` sends the last delivery
|
|
924
|
+
acknowledgements. Messages stay undelivered until the finished run's
|
|
925
|
+
continuation is allowed or declined. The heartbeat's `resumeLateMessages`
|
|
926
|
+
asks the existing `runs` maintenance operation for app runs that ended
|
|
927
|
+
`done`, `error` or `stopped` (the statuses `resume` accepts) with
|
|
928
|
+
undelivered session messages. Active work on the same idea or chat room
|
|
929
|
+
takes priority. The server finds them from the sessions that hold an
|
|
930
|
+
uncollected message, not by reading every run of the folder. Reply events
|
|
931
|
+
for a run this process is not running, and reconnects, wake collection
|
|
932
|
+
at once; otherwise it checks once a minute while a message waits and once
|
|
933
|
+
every five minutes while none does (#5106).
|
|
934
|
+
- **Ask before continuing.** A late review decision (or another session
|
|
935
|
+
message) files the existing permission question on the idea: Allow,
|
|
936
|
+
Not this, Always allow in <folder>. No spend dialog or second confirmation.
|
|
937
|
+
The normal question UI records the answer; only the runner consumes a
|
|
938
|
+
permission answer, even after the original session finished. Chat turns
|
|
939
|
+
use the same board ask without a source idea; their continuation stays a
|
|
940
|
+
chat turn in the original room. (#5103) The app parks a row on that new
|
|
941
|
+
chat turn (`request.continues` names the turn it carries on), so its
|
|
942
|
+
reply shows in the chat or DM like any other; a carried-on turn that
|
|
943
|
+
ended over an hour before the app saw it stays in its log (#5106).
|
|
944
|
+
- **One question per message.** The ask carries the promotion id as
|
|
945
|
+
`ask_key`; `ask_user` returns the question already filed under that key
|
|
946
|
+
in that session, so an ask whose reply was lost, or whose saved receipt
|
|
947
|
+
failed to write, never files a second question. An Always allow given on
|
|
948
|
+
another ask releases a still-open one on the next beat; an answer given on
|
|
949
|
+
the ask itself wins (#5106).
|
|
950
|
+
- **Always allow** uses `permissionAsk.mjs`'s folder memory, with a separate
|
|
951
|
+
continuation key scoped to the account and project. It does not grant any
|
|
952
|
+
tool permission. Pending question ids and decisions survive watcher
|
|
953
|
+
restarts in `VIEWABLE_HOME/resume-asks`; unreadable receipts fail closed.
|
|
954
|
+
A declined or dismissed ask marks its message as not delivered (the run's
|
|
955
|
+
`sidecar.undelivered`, which the app shows with Try again) and then
|
|
956
|
+
acknowledges it without starting work.
|
|
957
|
+
- **Allow** uses `runnerApi.resume`, preserving the session, worktree and
|
|
958
|
+
message images. A message-id-derived `lateRowRequestId` travels as
|
|
959
|
+
`promotionId`; a retry returns the same child, including after an insert
|
|
960
|
+
acknowledgement was lost. Only then is the message acknowledged. An ask or
|
|
961
|
+
resume that could not reach the endpoint, or a resume refused while other
|
|
962
|
+
work on the idea runs, leaves it waiting. A failure on the server's side
|
|
963
|
+
(a crash, or a board write that lost a race) comes back marked as a fault,
|
|
964
|
+
not a refusal, so it waits too instead of declining the message. A stopped
|
|
965
|
+
run whose child was already filed returns that child (#5106).
|
|
966
|
+
- **Never left unread (#5101).** A message that cannot be continued is
|
|
967
|
+
declined the same visible way, with no question: a run whose Stop was asked
|
|
968
|
+
for, an unapproved run, a run with no conversation to resume, an ask the
|
|
969
|
+
endpoint refused, or a resume the server refused. The mark is written before
|
|
970
|
+
the acknowledgement, so a failed mark leaves the message for the next beat. Older messages without ids use their
|
|
971
|
+
content hash. The runner still requires `PM_SPAWN_RUNNER=on`, approval,
|
|
972
|
+
available concurrency and its normal wall clock. Tests use fake agents.
|
|
973
|
+
|
|
974
|
+
A session collects with `collect_session`, passing its own `since` watermark.
|
|
975
|
+
Live delivery remains unchanged. Finished app sessions continue only after
|
|
976
|
+
Allow or a previously saved Always allow choice; external sessions without
|
|
977
|
+
an app run are not started by this pass. A run the person stopped stays
|
|
978
|
+
stopped. The heartbeat's own calls under a finished run's key do not refresh
|
|
979
|
+
that session's `last_seen_at` (`rowStore.touchSession`), so a finished run
|
|
980
|
+
never looks alive to `list_sessions` or `send_message`.
|
|
981
|
+
Installed bridges must be released through the existing release workflow.
|
|
951
982
|
|
|
952
983
|
**Images travel the same doors.** A message's `images` travel into `resume`
|
|
953
984
|
alongside `message` when the poll has any (`rowsAnswers.mjs`'s
|
|
@@ -1127,7 +1158,7 @@ on its own.
|
|
|
1127
1158
|
## Signal files - stop, merge, delete, relaunch
|
|
1128
1159
|
|
|
1129
1160
|
`stop`, `merge`, `delete` and `relaunch` are all rows - `heartbeat`'s `stops`
|
|
1130
|
-
array and its `ops` + `opTake`/`opResult` (`bridge/lib/
|
|
1161
|
+
array and its `ops` + `opTake`/`opResult` (`bridge/lib/runnerOps.mjs`'s
|
|
1131
1162
|
`serviceRowOps`) - for every request kind, chat turns included. `relaunch`'s
|
|
1132
1163
|
record is the claimed run row's own `server` column (mirrored there by
|
|
1133
1164
|
`runnerCompletion.mjs` when the child exits), falling back to the op's
|
|
@@ -1179,7 +1210,7 @@ put. Then the copy and its branch are deleted. Nothing is pushed.
|
|
|
1179
1210
|
Added 2026-08-30. The ruling on `q-mtf2x89x`: "Only one session per idea,
|
|
1180
1211
|
unless the old session lost its worktree."
|
|
1181
1212
|
|
|
1182
|
-
`activeWorktreeForPromptRows` in `bridge/lib/
|
|
1213
|
+
`activeWorktreeForPromptRows` in `bridge/lib/runnerGates.mjs` reads this project's
|
|
1183
1214
|
run rows through `runnerApi.runs`, then checks whether a worktree for the
|
|
1184
1215
|
given idea still exists on disk AND its branch has not been merged into
|
|
1185
1216
|
main. Both halves matter: without the merged check, a finished session
|
|
@@ -1216,7 +1247,7 @@ talked to it.
|
|
|
1216
1247
|
earlier) shipped the ordinary session path over rows and refused a
|
|
1217
1248
|
chat-turn row outright, naming the per-room lock and the chat worktree mint
|
|
1218
1249
|
as file-shaped work not migrated in that pass. Both are rows now: the
|
|
1219
|
-
per-room lock is `activeChatTurnForRoomRows` (`bridge/lib/
|
|
1250
|
+
per-room lock is `activeChatTurnForRoomRows` (`bridge/lib/runnerGates.mjs`,
|
|
1220
1251
|
`runnerApi.runs({..., status:'running'})` filtered to `isChatTurn(request)`
|
|
1221
1252
|
and a matching `roomId`) in place of a disk scan for an unreceipted claim;
|
|
1222
1253
|
the chat worktree mint (`makeChatWorktree`/`resolveChatCwd`,
|
|
@@ -1224,7 +1255,7 @@ the chat worktree mint (`makeChatWorktree`/`resolveChatCwd`,
|
|
|
1224
1255
|
called from the file-based runner, and is called from the rows one now the
|
|
1225
1256
|
same way. Every difference below is unchanged in what it means; only the
|
|
1226
1257
|
DOOR each one reaches through moved (a run row and `runnerApi` calls, not a
|
|
1227
|
-
signal file) - marked `chat turn:` at each site in `
|
|
1258
|
+
signal file) - marked `chat turn:` at each site in `runnerGates.mjs` and `runnerExecute.mjs` exactly as
|
|
1228
1259
|
they are marked here.
|
|
1229
1260
|
|
|
1230
1261
|
**The request is the same shape, riding a row's `request` column, with one
|
|
@@ -1279,7 +1310,7 @@ new field.**
|
|
|
1279
1310
|
chat turn does not have. What a chat turn is told is the app's to compose:
|
|
1280
1311
|
persona, the room's context blocks, his message.
|
|
1281
1312
|
4. **A per-ROOM lock instead of the per-prompt one.** OVER ROWS (brief 30
|
|
1282
|
-
Move 2b): `activeChatTurnForRoomRows` (`lib/
|
|
1313
|
+
Move 2b): `activeChatTurnForRoomRows` (`lib/runnerGates.mjs`) asks
|
|
1283
1314
|
`runnerApi.runs({..., status:'running'})` and filters to
|
|
1284
1315
|
`isChatTurn(request)` with a matching `roomId`, so two runners sharing a
|
|
1285
1316
|
project share one answer the same way the file version's disk scan did.
|
|
@@ -1553,13 +1584,21 @@ pictures with `images` (up to 6, data URLs) and to choose between looks with
|
|
|
1553
1584
|
`ask_user` and `images`. It also tells the session not to file a closing reply
|
|
1554
1585
|
of its own, because the runner files one.
|
|
1555
1586
|
|
|
1587
|
+
The hosted board enforces it (#4153): a run's second reply in its idea's
|
|
1588
|
+
conversation, with no person's note after its first, is refused and names
|
|
1589
|
+
`editComment`, which changes that one reply in place. The closing reply is
|
|
1590
|
+
told apart by its `propose` label, `Session <key> outcome`
|
|
1591
|
+
(`commentOnAnchor`), so renaming that label breaks the rule. It is never
|
|
1592
|
+
refused; it folds into the run's earlier reply. Questions and ideas are not
|
|
1593
|
+
limited.
|
|
1594
|
+
|
|
1556
1595
|
**One reply at the end, for a session that finished.** When a session
|
|
1557
1596
|
finishes (the verdict is `finished`, or a Codex run exits 0),
|
|
1558
1597
|
`reportOutcomeOnBoard` posts exactly one `addComment` on the idea, with
|
|
1559
1598
|
`agentId`, `runId` (the session's own key), `summary` (first sentence of the
|
|
1560
1599
|
closing text, at most 200 characters), `images` (at most 6), and
|
|
1561
1600
|
`branch`, `files`, `preview`, `report` for the links. Its text is the closing
|
|
1562
|
-
text of the session (the
|
|
1601
|
+
text of the session (preserved in full; the hosted writer splits overflow into linked ideas), then a single figures
|
|
1563
1602
|
line led by "Finished": "Finished; 12 turns, 4m, branch x, 3 files". It
|
|
1564
1603
|
never carries a cost (#281). A stop, an error, a stall, a timeout and a binary that would not start
|
|
1565
1604
|
write NO comment from the bridge: the app writes those endings itself from the
|
|
@@ -1689,6 +1728,7 @@ unscoped, so the session may write any path the process can reach.
|
|
|
1689
1728
|
| --- | --- | --- |
|
|
1690
1729
|
| tools | anything not on `CLAUDE_TOOLS` | everything on it |
|
|
1691
1730
|
| interactive prompts | `EnterPlanMode`, `AskUserQuestion` | - |
|
|
1731
|
+
| clicking or typing in other apps (#4204) | Claude Code: `osascript`, `screencapture`, `cliclick` as a command's first word (`CLAUDE_CLICK_AND_SCREEN_TOOLS`); then on every Claude ask and Codex escalation, any command with one of them as a word, whatever "Allow for this run" or a saved rule says (`drivesAnotherApp`, permissionAsk.mjs); both agents are told in words | the same program started from `node -e` or a script, and a Codex command that runs without asking inside its sandbox |
|
|
1692
1732
|
| arbitrary code | - | `node -e`, `npx <anything>` |
|
|
1693
1733
|
| writes | the checkout you are looking at (the **worktree** does this, not the list) | any other path the process can reach |
|
|
1694
1734
|
| money | wall clock, no retry | - |
|
|
@@ -1723,18 +1763,30 @@ silently. `lib/permissionAsk.mjs` owns it; `child.mjs` answers Claude's
|
|
|
1723
1763
|
`control_request` and `codex.mjs` answers Codex's approval requests with it.
|
|
1724
1764
|
|
|
1725
1765
|
- One `ask_user` question on the run's idea: "Can I run pip install requests
|
|
1726
|
-
in my-app?", with Allow (recommended), Not this and Always allow
|
|
1727
|
-
|
|
1766
|
+
in my-app?", with Allow (recommended), Not this and Always allow, and a line
|
|
1767
|
+
on what it is for. Always covers a family only for a short safe list of
|
|
1768
|
+
read-only or test commands (`ls`, `cat`, `pwd`, `head`, `tail`, `wc`,
|
|
1769
|
+
`git status`, `git diff`, `git log`, `git show`, `npm test`,
|
|
1770
|
+
`npx vitest run`), and its button names the family ("Always allow git status
|
|
1771
|
+
in my-app"). Every other command, and a safe-list one with anything the list
|
|
1772
|
+
cannot vouch for (a redirect, a chain, a substitution, a quote or backslash, a
|
|
1773
|
+
glob, braces, a tilde, a hidden character, a NAME=value prefix, `=rm`, a
|
|
1774
|
+
flag on a test command, git's `--output`, `git diff --no-index`, and for a read
|
|
1775
|
+
command a word that starts with `/`, has a `..` step or leads out of the folder through a link, or a Codex working folder outside the folder, #3737 #3759), offers "Always allow this command
|
|
1776
|
+
in <folder>" and saves exactly that command line, byte for byte (#3726).
|
|
1728
1777
|
- The asker claims its question on the answer poll and reads the answer with
|
|
1729
1778
|
`check_answer` itself: an answer resolves the pending request, it is never
|
|
1730
1779
|
typed into the conversation.
|
|
1731
1780
|
- No answer means keep waiting. Stop and the wall clock still end the run;
|
|
1732
1781
|
the stall watchdog does not count time spent waiting for a person.
|
|
1733
1782
|
- Always allow is remembered per folder in
|
|
1734
|
-
`<glytch home>/permissions/<sha256 of the folder path>.json`: a
|
|
1735
|
-
command by its
|
|
1736
|
-
|
|
1737
|
-
|
|
1783
|
+
`<glytch home>/permissions/<sha256 of the folder path>.json`: a safe-list
|
|
1784
|
+
command by its family (`Bash(git status:*)`), any other shell command by the
|
|
1785
|
+
sha256 of the whole line as typed (`Bash(exact:...)`), anything else by its
|
|
1786
|
+
tool name. A remembered rule is answered without asking; a pipe between
|
|
1787
|
+
safe-list commands is covered when every part's family is saved. Word rules
|
|
1788
|
+
saved before #3726 for `ls`, `cat`, `pwd`, `head`, `tail` and `wc` still match
|
|
1789
|
+
their family; any other (`Bash(npm:*)`) matches nothing any more.
|
|
1738
1790
|
- A plan draft is read-only and is never given the asker.
|
|
1739
1791
|
|
|
1740
1792
|
## What a spawned session inherits
|
|
@@ -1848,7 +1900,8 @@ completes, both commits land in main).
|
|
|
1848
1900
|
## The ACP engine
|
|
1849
1901
|
|
|
1850
1902
|
Added 2026-09-02 (brief 15 decision 8, on the amendment written by the spike
|
|
1851
|
-
in `spikes/acp-2026-09-02
|
|
1903
|
+
in `spikes/acp-2026-09-02/`, removed 2026-11-02 and kept in Git history at
|
|
1904
|
+
`e39d057c5`). Checked against the code in this commit.
|
|
1852
1905
|
|
|
1853
1906
|
`acp-claude` is a third engine in `bridge/lib/agents.mjs`, labelled "Claude
|
|
1854
1907
|
Code via ACP". It runs `@agentclientprotocol/claude-agent-acp` 0.73.0 over
|
|
@@ -1950,14 +2003,15 @@ frame draws it.
|
|
|
1950
2003
|
local id alone - `tools.mjs`'s `readBoardById` prefixes it with the
|
|
1951
2004
|
token's own account before matching a row, falling back to the bare value
|
|
1952
2005
|
when that prefixed id is not this account's.
|
|
1953
|
-
- **Permissions.** `
|
|
1954
|
-
`
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2006
|
+
- **Permissions.** `CLAUDE_TOOLS` goes to the adapter's Claude Code as
|
|
2007
|
+
`allowedTools` (`_meta.claudeCode.options` at `session/new` and
|
|
2008
|
+
`session/load`), the same list `--allowedTools` gets, matched by Claude Code
|
|
2009
|
+
itself. A call off the list arrives as `session/request_permission` and goes
|
|
2010
|
+
to the runner's shared asker (`permissionAsk.mjs`), the one Claude and
|
|
2011
|
+
Codex use: it refuses a command that drives another app and otherwise asks
|
|
2012
|
+
the person in the idea (#4615). With no board to ask on the answer is
|
|
2013
|
+
`reject_once`. **Never `allow_always`**: "always" lives in the asker, per
|
|
2014
|
+
folder. Each decision is written into the log as a
|
|
1961
2015
|
`{"type":"system","subtype":"permission"}` line.
|
|
1962
2016
|
- **`CLAUDE_DISALLOWED_TOOLS` has no equivalent and needs none.** Plan mode is
|
|
1963
2017
|
a session *mode* on this engine, and `acp.mjs` selects `acceptEdits` and
|
package/glytch.mjs
CHANGED
|
@@ -49,8 +49,8 @@ import { watchRegistered } from "./lib/multiwatch.mjs";
|
|
|
49
49
|
import { readRegistry, registryPath, removeFolder, touchRegistry } from "./lib/registry.mjs";
|
|
50
50
|
import { settingsFromEnv, newRunnerId, registerAndFindProject } from "./lib/runner.mjs";
|
|
51
51
|
import { syncFolder, syncRegistry } from "./lib/sync.mjs";
|
|
52
|
-
import { waitForRunnerHealth, writeRunnerHealth } from "./lib/runner-health.mjs";
|
|
53
|
-
import { initServiceScript, packageVersion, runUpdate } from "./lib/update.mjs";
|
|
52
|
+
import { SETUP_HEALTH_SLOW_MS, SETUP_HEALTH_WAIT_MS, hasFreshBeat, waitForRunnerHealth, writeRunnerHealth } from "./lib/runner-health.mjs";
|
|
53
|
+
import { initServiceScript, packageVersion, runUpdate, UPDATE_RESTART_EXIT_CODE } from "./lib/update.mjs";
|
|
54
54
|
import { initOptions, chooseAgents, readAgentSelection, saveAgentSelection } from "./lib/agent-selection.mjs";
|
|
55
55
|
import { projectMcpServerKey } from "./lib/project-mcp.mjs";
|
|
56
56
|
import { AGENT_CONNECT_HINT, agentLoginStep, personalBoardToken, signInStep } from "./lib/init-connect.mjs";
|
|
@@ -186,6 +186,8 @@ async function init() {
|
|
|
186
186
|
const root = resolve(process.cwd());
|
|
187
187
|
const checkStartedAt = Date.now();
|
|
188
188
|
const disabled = noDaemonInstall(process.env);
|
|
189
|
+
// The copied prompt's attempt id. The app's card waits for it (#4206).
|
|
190
|
+
const setupId = process.env.VIEWABLE_SETUP_ID ?? process.env.GLYTCH_SETUP_ID ?? "manual";
|
|
189
191
|
// The service runs the script verification proved, not this process's own
|
|
190
192
|
// file, which may be a same-version copy about to be deleted (#600). No log:
|
|
191
193
|
// the PATH diagnostic is noise as init's first line.
|
|
@@ -215,8 +217,8 @@ async function init() {
|
|
|
215
217
|
say(`Board connections: ${selected.length ? selected.join(", ") : "none"}`);
|
|
216
218
|
if (selected.includes("claude") && agents.claude?.found && agents.claude.loggedIn === false) {
|
|
217
219
|
say("");
|
|
218
|
-
say("Claude Code is installed but not
|
|
219
|
-
say("or a session will fail the moment it spawns.");
|
|
220
|
+
say("Claude Code is installed but not signed in. Run `claude auth login` yourself,");
|
|
221
|
+
say("which opens a browser sign-in page, or a session will fail the moment it spawns.");
|
|
220
222
|
}
|
|
221
223
|
|
|
222
224
|
say("");
|
|
@@ -242,10 +244,17 @@ async function init() {
|
|
|
242
244
|
const token = await personalBoardToken({ env: process.env });
|
|
243
245
|
// Restore deliberately before publishing a new local registry entry. A
|
|
244
246
|
// watcher must not see the folder while the server still wants it removed.
|
|
247
|
+
// The attempt id rides this register too, so the card knows this computer
|
|
248
|
+
// answered before the last check ends (#4206).
|
|
249
|
+
const registerSetup = (extra = {}) => registerAndFindProject(root, {
|
|
250
|
+
...settingsFromEnv(), runnerId: newRunnerId(), markExtra: () => ({ version: packageVersion(), setupId, ...extra }),
|
|
251
|
+
}, { readd: true });
|
|
252
|
+
let setupRegistered = false;
|
|
253
|
+
let setupRunnerId = null;
|
|
245
254
|
if (machine?.status === "ok" || token) {
|
|
246
|
-
const registered = await
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
const registered = await registerSetup();
|
|
256
|
+
setupRegistered = registered.ok;
|
|
257
|
+
setupRunnerId = registered.runnerId ?? null;
|
|
249
258
|
if (!registered.ok) {
|
|
250
259
|
say(registered.error);
|
|
251
260
|
// Keep ordinary setup usable offline, as before. Only a known removal
|
|
@@ -315,16 +324,38 @@ async function init() {
|
|
|
315
324
|
// a watching runner, and neither is a computer the board cannot reach.
|
|
316
325
|
let healthy = false;
|
|
317
326
|
if (allOk && signedIn && !disabled) {
|
|
327
|
+
// THE PROOF BEFORE THE BEAT (#4206). The service puts this file's attempt
|
|
328
|
+
// id on its heartbeat, and the card turns Online on that. Written after
|
|
329
|
+
// the wait, it missed the beat init asked for and waited for the next
|
|
330
|
+
// one, 5 minutes away while push is joined. Written first, the beat that
|
|
331
|
+
// ends this wait carries it, and a computer slower than this wait still
|
|
332
|
+
// turns Online on its own first beat.
|
|
333
|
+
await writeRunnerHealth({ version: packageVersion(), setupId }, process.env, "cli");
|
|
318
334
|
// A daemon already watching this folder beats on a registry rewrite.
|
|
319
335
|
await touchRegistry().catch(() => {});
|
|
320
336
|
const result = await waitForRunnerHealth({
|
|
321
337
|
version: packageVersion(), after: checkStartedAt, root, requireStartedAfter: false,
|
|
338
|
+
timeoutMs: SETUP_HEALTH_WAIT_MS, slowMs: SETUP_HEALTH_SLOW_MS,
|
|
339
|
+
onSlow: () => say("Your computer is still starting. Waiting a little longer…"),
|
|
322
340
|
});
|
|
323
341
|
healthy = result.ok;
|
|
324
|
-
if (healthy)
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
342
|
+
if (healthy) say(RUNNER_WATCHING_LINE);
|
|
343
|
+
else say(result.error);
|
|
344
|
+
}
|
|
345
|
+
// A SETUP THAT REALLY FAILED SAYS SO ON THE CARD (#4206). The card cannot
|
|
346
|
+
// see this terminal, so after sign-in a failed end registers once more with
|
|
347
|
+
// the failure on it; a later good beat from the service replaces it.
|
|
348
|
+
// A fresh beat can settle a health-wait timeout only after setup checks
|
|
349
|
+
// passed (#5047). A running daemon cannot prove invalid config was fixed.
|
|
350
|
+
// The failure goes out as a plain register for this folder only, never the
|
|
351
|
+
// re-add one, so a folder the person removed in the meantime stays removed
|
|
352
|
+
// and the other folders' rows keep their agents.
|
|
353
|
+
if (setupRegistered && signedIn && !disabled && !(allOk && healthy) &&
|
|
354
|
+
!(allOk && hasFreshBeat({ version: packageVersion(), root, after: checkStartedAt }))) {
|
|
355
|
+
await registerAndFindProject(root, {
|
|
356
|
+
...settingsFromEnv(), runnerId: setupRunnerId ?? newRunnerId(),
|
|
357
|
+
markExtra: () => ({ version: packageVersion(), setupId, setupFailed: true }),
|
|
358
|
+
}, { onlyRoot: true }).catch(() => {});
|
|
328
359
|
}
|
|
329
360
|
// FIX 1B, THE FALLBACK SENTENCE: an agent step 4 could not connect over
|
|
330
361
|
// the hosted endpoint (no terminal, and 1a either did not apply to it or
|
|
@@ -444,7 +475,13 @@ async function runner(args) {
|
|
|
444
475
|
log("stopping. Any session already running keeps going; it is a separate process.");
|
|
445
476
|
controller.abort();
|
|
446
477
|
});
|
|
447
|
-
await watchRegistered({ settings, signal: controller.signal, log });
|
|
478
|
+
const watched = await watchRegistered({ settings, signal: controller.signal, log });
|
|
479
|
+
// The board's Update installed a new version (#4949): exit nonzero so
|
|
480
|
+
// launchd, systemd and Task Scheduler each start the new code.
|
|
481
|
+
if (watched?.restart) {
|
|
482
|
+
log(`restarting on the new version`);
|
|
483
|
+
return UPDATE_RESTART_EXIT_CODE;
|
|
484
|
+
}
|
|
448
485
|
return null;
|
|
449
486
|
}
|
|
450
487
|
|