@marver-design/marver 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -0
- package/README.md +13 -9
- package/dist/agent-BsieQGTD.mjs +99 -0
- package/dist/{bake-CvY8QR3L.mjs → bake-l6N12qgx.mjs} +1 -1
- package/dist/{board-status-CWGHIdo_.mjs → board-status-D_lHZZ09.mjs} +69 -610
- package/dist/{boards-BwKI0qWd.mjs → boards-CahYhF5B.mjs} +2 -1
- package/dist/boards-DbVJlbd5.mjs +612 -0
- package/dist/{build-B1kavcpc.mjs → build-CuRhHXcY.mjs} +10 -6
- package/dist/cli.mjs +20 -11
- package/dist/{comments-ClVgfQib.mjs → comments-0d3e274b.mjs} +71 -9
- package/dist/{config-DJxMRVD8.mjs → config-g-J8NrPn.mjs} +5 -97
- package/dist/{context-D4t59wDi.mjs → context-fAtQLHt2.mjs} +3 -2
- package/dist/{daemon-PmNqoOAk.mjs → daemon-DZ367fiM.mjs} +75 -17
- package/dist/{dev-Cf4wLGe2.mjs → dev-R6zvwbqX.mjs} +50 -10
- package/dist/{init-C_K-cjBQ.mjs → init-DAnBlt-V.mjs} +4 -3
- package/dist/{ledger-Bu0BjqIe.mjs → ledger-BNXW14Xw.mjs} +1 -6
- package/dist/link-CcfAfKY-.mjs +132 -0
- package/dist/{manifest-CcdWx7ud.mjs → manifest-BkjJ5OQk.mjs} +50 -5
- package/dist/{plugin-C5u07Yhv.mjs → plugin-C1avHL7g.mjs} +357 -31
- package/dist/{poster-BduzQBYz.mjs → poster-Bc4-3DlQ.mjs} +1 -1
- package/dist/{profile-BjAPAJSb.mjs → profile-CrZohD6g.mjs} +1 -1
- package/dist/{publish-bakes-b0jUwvM_.mjs → publish-bakes-DQWn14IY.mjs} +2 -2
- package/dist/{share--bdSc4G5.mjs → share-BD-wcDQq.mjs} +1 -1
- package/dist/{shot-BFEuYbaz.mjs → shot-C1YR_Sqx.mjs} +1 -1
- package/dist/{shot-BAR8hmU9.mjs → shot-CVOlQHUr.mjs} +2 -2
- package/dist/{sync-BZaCWqK-.mjs → sync-DoA1vf4u.mjs} +15 -1
- package/dist/{work-0YopuMt9.mjs → work-CJ8OIpBD.mjs} +9 -3
- package/dist/{work-CLrmY-vQ.mjs → work-CiUvBVa6.mjs} +72 -1
- package/docs/boards-and-folders.md +54 -6
- package/docs/context.md +10 -2
- package/docs/live-jam.md +11 -0
- package/package.json +1 -1
- package/src/client/content/diagram.tsx +7 -1
- package/src/client/content/img-lod.ts +12 -2
- package/src/client/content/index.tsx +69 -6
- package/src/client/frame-host/inspect.js +23 -0
- package/src/client/shell/App.tsx +19 -9
- package/src/client/shell/BoardList.tsx +21 -6
- package/src/client/shell/LockedApp.tsx +2 -2
- package/src/client/shell/Play.tsx +5 -1
- package/src/client/shell/StatusPicker.tsx +12 -5
- package/src/client/shell/Tip.tsx +25 -5
- package/src/client/shell/board-icons.tsx +15 -1
- package/src/client/shell/canvas/Canvas.tsx +42 -6
- package/src/client/shell/canvas/anchor.ts +41 -0
- package/src/client/shell/canvas/ctl.ts +6 -0
- package/src/client/shell/comments-store.ts +8 -5
- package/src/client/shell/goto.ts +52 -3
- package/src/client/shell/hash.ts +24 -3
- package/src/client/shell/store.ts +242 -28
- package/src/client/shell/styles.css +19 -2
- package/src/shared/board-types.ts +10 -6
- package/src/shared/status.ts +17 -8
- package/templates/AGENTS-embedded.md +43 -8
- package/templates/AGENTS-studio.md +43 -8
- package/templates/instructions/boards.md +13 -3
- package/templates/instructions/context.md +6 -2
- package/templates/instructions/iterate.md +29 -16
- package/templates/instructions/jam.md +9 -2
- package/templates/instructions/reference/deck-layouts.md +2 -1
- package/templates/instructions/reference/deck-story.md +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,90 @@
|
|
|
2
2
|
|
|
3
3
|
Notable changes to `@marver-design/marver`. Format follows [Keep a Changelog](https://keepachangelog.com); versions follow semver.
|
|
4
4
|
|
|
5
|
+
## 0.23.0 - 2026-10-06
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **A link that lands on the work.** `npx marver link <scene/frame | scene ...>` prints the canvas
|
|
10
|
+
link for those frames: the board they sit on, in canvas mode, with them selected and in view - not
|
|
11
|
+
the full-screen focus view. `npx marver work done` prints it for the frames it clears, and the
|
|
12
|
+
AGENTS contract has every reply that created or changed frames end with it, so on a board of fifty
|
|
13
|
+
frames you click once and you are looking at the change. Agents used to know only the bare board
|
|
14
|
+
link, or improvise a focus link that had no way back to the canvas; asked to change a form, Claude
|
|
15
|
+
Code and Codex now both end with the link to the frames they touched. Links read
|
|
16
|
+
`#/b/<board>?f=<scene/frame>` or `?s=<scene>` ([Boards and folders](docs/boards-and-folders.md#links-to-frames)).
|
|
17
|
+
- **Your agent leaves notes where it needs you.** `npx marver comments new <scene/frame> --body "..."`
|
|
18
|
+
pins a note on a frame, or on the element showing the words given with `--on`. The contract keeps
|
|
19
|
+
it for what needs you - a question or a decision about that frame, a judgment call it took, a change
|
|
20
|
+
you would not spot - never a changelog: asked to restyle a form, Claude Code left its one open
|
|
21
|
+
question as a note on the wireframe it had not touched. Notes post as Marver and raise the bottom-right pill with a ping; reply in one and it is
|
|
22
|
+
a Live Jam job, no tag needed ([Live Jam](docs/live-jam.md#notes-from-your-chat-agent)). Notes stay
|
|
23
|
+
on your machine for now, like Live Jam's replies.
|
|
24
|
+
- **Building - the stretch between design and shipped.** Feature and project boards gain a status
|
|
25
|
+
between In progress and Done: the design is agreed, the code is underway - the code glyph in
|
|
26
|
+
Marver's blue (yellow is being shaped, blue is being built, green is shipped). In progress could not
|
|
27
|
+
tell drawing the hi-fi from writing the code, the longest stretch of all. With `context/` it is
|
|
28
|
+
read from the open plan, `stage: build`: the agent writes it as it starts implementing, and the
|
|
29
|
+
sidebar's Change status picker writes it too (In progress takes it back off; no plan, and the
|
|
30
|
+
picker says Building needs one). Without `context/` it is set on the board like In progress. Done
|
|
31
|
+
still comes only from the shipped record ([Boards and folders](docs/boards-and-folders.md#status)).
|
|
32
|
+
- **The sidebar shows an agent at work.** While an agent works on a board's frames (`marver work
|
|
33
|
+
start`, or a Live Jam job), the board's icon turns blue with a highlight sweeping across
|
|
34
|
+
it - the frames' working shimmer in miniature - and so does a closed folder holding it, at either
|
|
35
|
+
level, so something cooking is never hidden. Nobody sets it: it lasts exactly as long as the work.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- **Boards open at their final size.** A content frame - a `Doc` of markdown, diagrams and images -
|
|
40
|
+
used to open at a guess, three quarters of its width, and grow as it loaded; every growth re-flowed
|
|
41
|
+
the rows below it, so a board of specs swam for seconds (on one 36-frame board, 44 layout changes
|
|
42
|
+
over the first 2.7 s). The height each Doc measures at its own width is now kept in
|
|
43
|
+
`design/boards/_sizes.json`, which `marver dev` writes and you commit with the rest of `design/`:
|
|
44
|
+
the board opens with every frame at its real size, the content fills in, and nothing moves.
|
|
45
|
+
`marver build` ships the heights of the published frames, so a published canvas opens still too.
|
|
46
|
+
See [Boards and folders](docs/boards-and-folders.md#sizes).
|
|
47
|
+
- **A Doc reports its height once it is done** - fonts, diagrams and images loaded - instead of first
|
|
48
|
+
half-loaded and again when complete. An image still loading off-screen may grow a frame, never
|
|
49
|
+
shrink it under the height it is known to have.
|
|
50
|
+
- **The frame you are looking at stays put.** When content does change the layout - an agent makes a
|
|
51
|
+
doc in the row above taller - the canvas moves around the selected frame, or the one in the middle
|
|
52
|
+
of the view, instead of moving it out from under you.
|
|
53
|
+
- **An agent's reply to your comment comes from Marver.** `comments reply` on a thread you started
|
|
54
|
+
now posts as Marver; it posted in your own name, so it read as if you had written it, and raised
|
|
55
|
+
nothing. The thread stays open: you review the change on the canvas and resolve it - a resolved
|
|
56
|
+
thread leaves the canvas, and the reply with it. A collaborator's thread keeps your voice, the one
|
|
57
|
+
that reaches them on the published canvas, and is resolved with `--addressed-in` as before.
|
|
58
|
+
- **Comments written outside the canvas appear at once** - an agent's note or reply, a sync from
|
|
59
|
+
the published canvas, a merge - instead of on the next 30-second poll.
|
|
60
|
+
- Marver's replies ping, as a person's do. Live Jam's opening "On it" line stays silent.
|
|
61
|
+
- A Live Jam job on a frame a chat agent has lit (`marver work start`) waits for it, so two agents
|
|
62
|
+
never edit one file at once.
|
|
63
|
+
- A focus link (`#/f/<frame>`) opened on your dev canvas keeps its way back to the canvas (the grid
|
|
64
|
+
button, or Esc). On a published canvas it is still a page of its own.
|
|
65
|
+
- **An agent keeps a board's status true while it works.** Lighting frames showed the work, but the
|
|
66
|
+
board could still read Backlog while an agent built on it. The AGENTS contract's "Show the work"
|
|
67
|
+
gains a step - the glow says someone is on it now, the status says where it stands when nobody is:
|
|
68
|
+
with `context/`, an open plan naming the capability (In progress), `stage: build` once the code
|
|
69
|
+
starts (Building) - and `npx marver work start` names any board it lights that still reads Backlog
|
|
70
|
+
or To do, with what makes it true. Asked to start designing a Backlog feature, Claude Code and
|
|
71
|
+
Codex both wrote its plan, and the board read In progress before they handed it back.
|
|
72
|
+
- **Status tooltips are the canvas's own.** Hovering a board's status opens the same tooltip as the
|
|
73
|
+
toolbar - the status in bold, each piece of evidence beneath - instead of the browser's.
|
|
74
|
+
- **A tab names its canvas.** A canvas tab reads "Start here - Acme Studio" - the board, then the
|
|
75
|
+
canvas, as the sidebar heads it - where every tab said "- Marver", so a row of canvas tabs now
|
|
76
|
+
says which project each one is. Published canvases too.
|
|
77
|
+
|
|
78
|
+
### Fixed
|
|
79
|
+
|
|
80
|
+
- Live Jam no longer turns an untagged reply you wrote before a thread reached Marver into a job once
|
|
81
|
+
Marver answers it - a follow-up is one written after Marver joined the conversation.
|
|
82
|
+
- `instructions/jam.md` named `comments list [<board>]`; the flag is `--board <board>`.
|
|
83
|
+
|
|
84
|
+
Upgrading: `npx marver init` refreshes the instructions your agent reads. `design/boards/_sizes.json`
|
|
85
|
+
appears the first time a board of Docs settles in `marver dev` - commit it with the rest of `design/`.
|
|
86
|
+
It is machine-written: a merge conflict in it is safe to resolve either way (until it is, `marver dev`
|
|
87
|
+
leaves the file alone and says so).
|
|
88
|
+
|
|
5
89
|
## 0.22.1 - 2026-10-06
|
|
6
90
|
|
|
7
91
|
### Changed
|
package/README.md
CHANGED
|
@@ -45,6 +45,7 @@ Frames appear on the canvas the moment the files land. That's the loop.
|
|
|
45
45
|
- **Prototype links.** `data-goto="scene/frame"` on any element links frames into a walkable prototype - across boards, too.
|
|
46
46
|
- **Five ways to view a board.** The canvas (frames on a plane), the board (the same, tidy), **present** (`p`: a full-screen clickable walkthrough - `data-goto` navigates, arrows step, `[` / `]` cycle variants, laser, comments, theme and device pickers in the toolbar), **focus** (one frame as a document - the reading preset for specs), and **slides** (a deck). A published board names its landing view; a frame deep link opens straight into it.
|
|
47
47
|
- **Content frames.** Specs, Mermaid diagrams, mood boards, and slides live on the same canvas as the screens - import `Doc`, `Md`, `Diagram`, `Img`, `Slide`, `Chart`, `Video` from `@marver-design/marver/content` and think a feature through before any pixels exist. Works in a repo with no app at all: idea first, design second.
|
|
48
|
+
- **Boards that hold still.** A content frame is as tall as its content, which only a render can tell - so the height each one settles at is kept in `design/boards/_sizes.json` (written by `marver dev`, committed with the rest of `design/`), and a board opens with every frame at its real size: the content fills in and nothing moves. When an agent does make a doc taller, the frame you are looking at stays put on screen while the rows re-flow around it.
|
|
48
49
|
- **Sticky notes.** A markdown file beside a frame (`cart.note.md`) or a scene (`_note.md`) becomes a yellow note left of the frame on the canvas - what it is for, how two variations differ, an open question. Markdown, `goto:` links to frames, hand-drawn Mermaid; readers comment on a note's text like on a frame's, fold it to its corner, hide them all with `n`. The layout makes room for it, beside the frame and below; published canvases carry them.
|
|
49
50
|
- **Hi-fi at rest.** A frame at rest is its own live document, asleep: animations paused and every `backdrop-filter` element painted with a certified texture of its filtered backdrop (compiled by the dev server's headless Chrome), so a board of 30 glass screens pans like 30 statics and wakes pixel-identical on interact. Glass inside glass, blend modes and frames whose paint depends on random data or the clock stay live; `?awake=1` keeps every frame live for comparison.
|
|
50
51
|
- **Charts and video in any frame.** `Chart` (Apache ECharts, SVG, still at rest) inherits the ink, typeface and accent of whatever frame it sits in - a Tailwind dashboard, a dark spec, a slide - sizes its type to the context and follows the layout on resize. `Video` is poster-first everywhere: click to play wherever the frame is live, `autoplay` for an ambient loop, `ratio` for vertical clips; omit the poster and marver renders one from the clip. A screen with a chart or a clip is still a screen.
|
|
@@ -53,12 +54,14 @@ Frames appear on the canvas the moment the files land. That's the loop.
|
|
|
53
54
|
## Context
|
|
54
55
|
|
|
55
56
|
Code says what is implemented; `context/` says the rest - what is available and to whom, how each
|
|
56
|
-
capability works, why, what is next - with evidence, in files any agent reads first.
|
|
57
|
-
`npx marver context init`
|
|
58
|
-
only in the shipped record, every claim with a level and a citation, a
|
|
59
|
-
behaviour change), and the canvas reads the same files: feature boards
|
|
60
|
-
progress, Done - never set by hand. Existing projects with scattered specs
|
|
61
|
-
reorganizes them on a branch and proves it with a blind eval.
|
|
57
|
+
capability works, why, what is next - with evidence, in files any agent reads first. Tell your agent
|
|
58
|
+
*"Set up our context"* - or run `npx marver context init` - and `npx marver context check` keeps it
|
|
59
|
+
true in ci (availability only in the shipped record, every claim with a level and a citation, a
|
|
60
|
+
contract change with every behaviour change), and the canvas reads the same files: feature boards
|
|
61
|
+
wear Backlog, To do, In progress, Building, Done - Done never set by hand. Existing projects with scattered specs
|
|
62
|
+
get a playbook that reorganizes them on a branch and proves it with a blind eval. Until a project
|
|
63
|
+
has `context/`, an agent that touches a feature board ends its reply offering to set it up. [The
|
|
64
|
+
context guide](docs/context.md).
|
|
62
65
|
|
|
63
66
|
## Slides
|
|
64
67
|
|
|
@@ -94,7 +97,7 @@ The trust boundary is hard: only comments written on the owner's machine trigger
|
|
|
94
97
|
|
|
95
98
|
## Working state
|
|
96
99
|
|
|
97
|
-
The same glow, driven from the terminal. When your agent takes a request, it creates the frame files first, pins them on a board, and runs `npx marver work start <scene/frame ...>` - you see the work land on the canvas in seconds, watch it shimmer while subagents build in parallel, and see it settle on `work done`. Marks self-expire, so a crashed agent never leaves a frame glowing. And `npx marver shot --scene <scene>` (or `<scene/frame ...>`, `--all`; `[--scale 4]`) renders frames headless to PNGs - a whole scene in one browser, several frames at a time - so the agent can look at what it built before it says it is done - the same picture you get from the canvas's copy-as-image.
|
|
100
|
+
The same glow, driven from the terminal. When your agent takes a request, it creates the frame files first, pins them on a board, and runs `npx marver work start <scene/frame ...>` - you see the work land on the canvas in seconds, watch it shimmer while subagents build in parallel, and see it settle on `work done`. Marks self-expire, so a crashed agent never leaves a frame glowing. Its reply ends with the canvas link `work done` prints - the board, opened on the frames it changed - and where it needs your eyes it pins a note on the frame as Marver (`npx marver comments new`), so you are pinged on the thing itself. And `npx marver shot --scene <scene>` (or `<scene/frame ...>`, `--all`; `[--scale 4]`) renders frames headless to PNGs - a whole scene in one browser, several frames at a time - so the agent can look at what it built before it says it is done - the same picture you get from the canvas's copy-as-image.
|
|
98
101
|
|
|
99
102
|
## Commands
|
|
100
103
|
|
|
@@ -105,8 +108,9 @@ The same glow, driven from the terminal. When your agent takes a request, it cre
|
|
|
105
108
|
| `npx marver build` | Static export → `design/.dist`; what ships comes from `design/publish.json` (default-closed) |
|
|
106
109
|
| `npx marver serve` | Serve the export; `MARVER_ID_ISSUER` or `MARVER_PASSWORD` gates it, `MARVER_DATA_DIR` persists comments + accounts |
|
|
107
110
|
| `npx marver share …` | The roster (owner): `add <who> [--role]` · `remove` · `block` / `unblock` · `general <mode>` · `list` · `requests` · `explain <who>` · `who` |
|
|
108
|
-
| `npx marver comments …` | The agent's queue: `connect <url>` · `sync` · `list` · `reply` · `resolve` · `invite <email>` · `revoke <email>` |
|
|
109
|
-
| `npx marver work …` | Working glow from the terminal: `start <scene/frame …>` · `done … \| --all` · `list` |
|
|
111
|
+
| `npx marver comments …` | The agent's queue: `connect <url>` · `sync` · `list` · `new <scene/frame>` · `reply` · `resolve` · `invite <email>` · `revoke <email>` |
|
|
112
|
+
| `npx marver work …` | Working glow from the terminal: `start <scene/frame …>` · `done … \| --all` (prints the canvas link) · `list` |
|
|
113
|
+
| `npx marver link <scene/frame \| scene ...>` | The canvas link that lands on those frames - their board, selected and in view (needs `dev` running) |
|
|
110
114
|
| `npx marver shot <frame ...> \| --scene <name> \| --all [--scale 1-4] [--json]` | Render frames headless and print the PNG paths (needs `dev` running); a scene is one browser, several frames at a time; 2x by default |
|
|
111
115
|
| `npx marver boards [--json]` | The sidebar as the files say it is: folders and sub-folders, boards in reading order with their title, type, status, `order` and description, the landing board |
|
|
112
116
|
| `npx marver boards new <name> [--folder f] [--type t]` | A board in its type's starting layout - a feature's spec, lo-fi and hi-fi bands, a start board rendering `context/` |
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { accessSync, constants, statSync } from "node:fs";
|
|
2
|
+
import { delimiter, isAbsolute, join } from "node:path";
|
|
3
|
+
//#region src/server/jam/agent.ts
|
|
4
|
+
/**
|
|
5
|
+
* Which coding agent drives this repo.
|
|
6
|
+
*
|
|
7
|
+
* Live Jam is ON by default, so this is the answer to "on by default with WHAT" - asked
|
|
8
|
+
* once by `init` (which writes the answer into design/config.ts, where it is visible and
|
|
9
|
+
* editable) and again at every dev boot, so a workspace that predates the block - or a
|
|
10
|
+
* human who switched tools - still jams without editing anything.
|
|
11
|
+
*
|
|
12
|
+
* The tool RUNNING us wins: `init` is usually run BY the agent, so its env markers are
|
|
13
|
+
* evidence rather than a guess. Whatever wins must still be on PATH - the daemon has to
|
|
14
|
+
* spawn it.
|
|
15
|
+
*/
|
|
16
|
+
/** Ordered by preference when a machine has several installed and none is running us. */
|
|
17
|
+
const AGENTS = [
|
|
18
|
+
"claude",
|
|
19
|
+
"codex",
|
|
20
|
+
"cursor",
|
|
21
|
+
"droid",
|
|
22
|
+
"opencode",
|
|
23
|
+
"grok",
|
|
24
|
+
"pi"
|
|
25
|
+
];
|
|
26
|
+
/** Env vars each CLI sets in the processes it spawns. Deliberately NOT CODEX_HOME or
|
|
27
|
+
* ANTHROPIC_API_KEY: those are configuration a human exports by hand, not evidence that
|
|
28
|
+
* the tool is running right now. (opencode's `AGENT=1` and pi's `AI_AGENT` are skipped
|
|
29
|
+
* for the same reason in reverse - too generic to prove WHICH tool is running.)
|
|
30
|
+
* droid and grok set no marker at all in the shells they spawn (verified against the
|
|
31
|
+
* grok-build source and droid 0.200.0), so they are found by PATH order only. */
|
|
32
|
+
const MARKERS = {
|
|
33
|
+
claude: ["CLAUDECODE", "CLAUDE_CODE_ENTRYPOINT"],
|
|
34
|
+
codex: ["CODEX_SANDBOX", "CODEX_THREAD_ID"],
|
|
35
|
+
cursor: ["CURSOR_AGENT"],
|
|
36
|
+
droid: [],
|
|
37
|
+
opencode: ["OPENCODE", "OPENCODE_PID"],
|
|
38
|
+
grok: [],
|
|
39
|
+
pi: ["PI_CODING_AGENT", "PI_SESSION_ID"]
|
|
40
|
+
};
|
|
41
|
+
/** The executable each agent name maps to. Only cursor differs: its CLI installs BOTH
|
|
42
|
+
* `cursor-agent` and a bare `agent` - and grok's installer symlinks `agent` too, so the
|
|
43
|
+
* short name is a coin flip on a machine with both. The long name is unambiguous. */
|
|
44
|
+
const AGENT_BIN = {
|
|
45
|
+
claude: "claude",
|
|
46
|
+
codex: "codex",
|
|
47
|
+
cursor: "cursor-agent",
|
|
48
|
+
droid: "droid",
|
|
49
|
+
opencode: "opencode",
|
|
50
|
+
grok: "grok",
|
|
51
|
+
pi: "pi"
|
|
52
|
+
};
|
|
53
|
+
/** The valid `jam.agent` values as an English list - one string, so every surface
|
|
54
|
+
* (config warning, init note, dev boot line) names the same set and none goes stale. */
|
|
55
|
+
const AGENT_NAMES = `${AGENTS.slice(0, -1).map((a) => `"${a}"`).join(", ")}, or "${AGENTS[AGENTS.length - 1]}"`;
|
|
56
|
+
/** Is `cmd` an executable FILE on PATH? A direct stat per PATH entry - no spawn, no shell,
|
|
57
|
+
* so this is safe to call on every dev boot. Two deliberate narrowings, both in service of
|
|
58
|
+
* "found means spawnable", because arming an agent that cannot run is worse than staying off:
|
|
59
|
+
*
|
|
60
|
+
* - `isFile`, because a directory carries the execute bit too (it means "traversable"), so an
|
|
61
|
+
* access check alone would call a folder named `claude` an agent.
|
|
62
|
+
* - the bare name only, no PATHEXT: the daemon spawns without a shell, and Node cannot run a
|
|
63
|
+
* Windows `.cmd`/`.bat` shim that way. Finding one would arm a job that fails on every run.
|
|
64
|
+
*
|
|
65
|
+
* Only ABSOLUTE PATH entries count. An empty entry means the current directory on POSIX, and
|
|
66
|
+
* a relative one (`.`, `bin`) resolves against it too - and the current directory is the repo
|
|
67
|
+
* that was just opened, so a `claude` binary shipped inside it is precisely what must never
|
|
68
|
+
* be found and spawned. */
|
|
69
|
+
function onPath(cmd, env = process.env) {
|
|
70
|
+
for (const dir of (env.PATH ?? "").split(delimiter)) {
|
|
71
|
+
if (!isAbsolute(dir)) continue;
|
|
72
|
+
try {
|
|
73
|
+
const file = join(dir, cmd);
|
|
74
|
+
if (statSync(file).isFile()) {
|
|
75
|
+
accessSync(file, constants.X_OK);
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
} catch {}
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
/** The agent to jam with, or undefined when this machine has none installed.
|
|
83
|
+
*
|
|
84
|
+
* One knowingly-imperfect case: agents nest, and env is inherited, so a codex run started
|
|
85
|
+
* FROM Claude Code carries both marker families and this picks claude. Env has no depth to
|
|
86
|
+
* read, and walking the process tree to find the nearest agent ancestor costs more than the
|
|
87
|
+
* case is worth - so the answer is made visible instead of clever: `init` prints the agent
|
|
88
|
+
* it chose and writes it into design/config.ts, and instructions/jam.md has the agent confirm
|
|
89
|
+
* that line names the tool it actually is. One word to correct, once per repo. */
|
|
90
|
+
/** The agent CLI this process runs under, by its env marker alone - provenance for what a CLI
|
|
91
|
+
* command writes (`comments new` / `reply`), so never a PATH guess. */
|
|
92
|
+
const runningAgent = (env = process.env) => AGENTS.find((a) => MARKERS[a].some((k) => env[k]));
|
|
93
|
+
function detectAgent(env = process.env) {
|
|
94
|
+
const running = AGENTS.find((a) => MARKERS[a].some((k) => env[k]));
|
|
95
|
+
if (running && onPath(AGENT_BIN[running], env)) return running;
|
|
96
|
+
return AGENTS.find((a) => onPath(AGENT_BIN[a], env));
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
export { runningAgent as a, onPath as i, AGENT_NAMES as n, detectAgent as r, AGENT_BIN as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-
|
|
1
|
+
import { AREA, SURFACE, pool, shotConcurrency, withBrowser } from "./shot-CVOlQHUr.mjs";
|
|
2
2
|
import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, utimesSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { join, sep } from "node:path";
|
|
4
4
|
import { createHash } from "node:crypto";
|