leglas 1.2.0 → 1.3.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/README.md CHANGED
@@ -21,30 +21,36 @@
21
21
 
22
22
  <p align="center"><i>Every direction in the rail, the selected one running as your actual app. Arrow keys flip between them.</i></p>
23
23
 
24
- Code is becoming the source of truth. Features go from prompt to
25
- working code in minutes, and mockups/design files eventually lag behind the product and drift out of sync. The
26
- fastest teams already design in the medium they ship. Leglas is built
27
- for working that way: it lets you explore many design directions at
28
- once, live, in your own app.
29
-
30
- The goal is to help devs and designers try many variations of a component, feature, page or user-flow quickly and make coming up with ideas extremely easy.
31
-
32
- Ask your agent for a handful of directions for the landing page,
33
- or the checkout component, or the empty states, or your onboarding flow. Leglas runs them all as your
34
- actual app, side by side in one place, and holds your notes on each. Explore far and wide without losing focus: you see more ideas
35
- without losing your opinion of any of them.
36
-
37
- And because every variation is the real product, your judgment is real
24
+ Code is becoming the source of truth. Features go from prompt to working
25
+ code in minutes, while mockups and design files fall behind the product
26
+ they describe. The fastest teams already design in the medium they ship, and
27
+ Leglas is built for working that way: many design directions, explored at
28
+ once, live in your own app.
29
+
30
+ The goal is to help devs and designers try many variations of a component,
31
+ feature, page or user-flow quickly and make coming up with ideas extremely
32
+ easy.
33
+
34
+ Ask your agent for a handful of directions for the landing page, the
35
+ checkout, the empty states or your onboarding flow. Leglas runs every one
36
+ of them as your actual app, in one place, and keeps your notes on each.
37
+ Explore far and wide without losing focus: you see more ideas without
38
+ losing your opinion of any of them.
39
+
40
+ And because every direction is the real product, your judgment is real
38
41
  too. Everything behaves the way it will in production, motion and data
39
- included. Choosing between two directions is choosing between two
40
- things that already exist, and the winner never has to be rebuilt from
41
- a picture or design file.
42
+ included. Choosing between two directions is choosing between two things
43
+ that already exist, and the winner never has to be rebuilt from a picture.
42
44
 
43
- Your app doesn't change to make any of this work. Leglas proxies the same
44
- dev server in your project: one config file to delete when you're done
45
- and sessions that clean up after themselves.
45
+ Leglas asks nothing of your app: no package, no import, no build step. It
46
+ sits in front of the dev server you already run, and its config file is
47
+ optional. New directions go in `.leglas/`, a folder Leglas adds to your
48
+ `.gitignore`, and keeping a winner clears the rest away. Sessions clean up
49
+ after themselves too: stopping Leglas shuts down everything it started,
50
+ from dev servers and branch checkouts to the share tunnel and any agent
51
+ still at work.
46
52
 
47
- ## What it does
53
+ ## What Leglas does
48
54
 
49
55
  <p align="center">
50
56
  <img src="https://raw.githubusercontent.com/FredAmartey/leglas/main/.github/assets/screenshots/compare-artboards.jpg" width="900" alt="The Leglas interface: the rail on the left, and two directions running side by side as the real app, each labelled with its name and the width it is drawn at." />
@@ -53,11 +59,12 @@ and sessions that clean up after themselves.
53
59
  <p align="center"><i>Two directions for the same page, running side by side as the actual app.</i></p>
54
60
 
55
61
  - Put any two directions side by side when it gets hard to choose.
56
- - Name each direction, drag to reorder, set aside the ones that don't feel
57
- right. Your opinion of every idea survives a long exploration.
62
+ - Name each direction, drag to reorder and set aside the ones that don't
63
+ feel right. Your opinion of every idea survives a long exploration.
58
64
  - Share the rail with someone who has no repo: a client, a cofounder, a
59
65
  teammate on another machine. They get the real app, in your order, and
60
- cannot change anything. See [Sharing](https://github.com/FredAmartey/leglas/blob/main/docs/sharing.md).
66
+ cannot change anything. Share it from the interface, from a terminal with
67
+ `npx leglas share` or by asking your agent. See [Sharing](https://github.com/FredAmartey/leglas/blob/main/docs/sharing.md).
61
68
  - Compare things no design tool can hold: three git branches, a local build
62
69
  against production, yesterday's direction against today's.
63
70
  - Hand the workflow to your coding agent. `leglas init` teaches it, and
@@ -67,13 +74,14 @@ and sessions that clean up after themselves.
67
74
  - Ask for changes without leaving the comparison. Describe what you want on
68
75
  the direction you are looking at, or point at it, and Leglas turns that
69
76
  into a precise request for your agent, file path and screenshots
70
- included. The agents on your machine are one click away next to the send
71
- button. Your agent, your subscription, no keys.
72
- - A change makes a variant, not a rewrite. The result registers under the
77
+ included. Pick any agent on your machine from beside the send button.
78
+ Your agent, your subscription, no keys.
79
+ - A change makes a variant, not a rewrite. The result appears under the
73
80
  direction it came from, with the original still there to compare against.
74
81
  - Keep the winner with one command. Leglas moves it into your source tree,
75
- writes down what the exploration decided and clears the rest away.
76
- - No app yet? Plain HTML files compare the same way, no dev server needed.
82
+ writes down what the exploration decided and cleans up after itself.
83
+ - No app yet? Leglas compares plain HTML files the same way, with no dev
84
+ server.
77
85
 
78
86
  ## Get started
79
87
 
@@ -99,16 +107,18 @@ export default {
99
107
  };
100
108
  ```
101
109
 
102
- Each preview is a URL your dev server already answers. Every field, plain
103
- HTML files with no dev server, git branches side by side and how the proxy
104
- works are in [Setting up a project](https://github.com/FredAmartey/leglas/blob/main/docs/configuration.md).
110
+ Each preview is a URL your dev server already answers. [Setting up a
111
+ project](https://github.com/FredAmartey/leglas/blob/main/docs/configuration.md)
112
+ covers every field, plain HTML files with no dev server, git branches side
113
+ by side and how the proxy works.
105
114
 
106
115
  It works with whatever you are building in. Leglas never imports or
107
116
  executes your framework, so the target can be Next, Vite, Remix, SvelteKit,
108
- Astro or a folder of static files. It needs Node 24 or newer, and nothing
109
- else: `npx` fetches the CLI on first use and starts from the cache after
110
- that. To pin a version for a project, `npm install -D leglas`; to type
111
- `leglas` without the prefix, `npm install -g leglas`.
117
+ Astro or a folder of static files. It needs Node 24 or newer and nothing
118
+ else; `npx` fetches it the first time you run it. Leglas tells you when a
119
+ newer version is out and can update itself. To pin a version for a
120
+ project, `npm install -D leglas`; to type `leglas` without `npx`,
121
+ `npm install -g leglas`.
112
122
 
113
123
  ## With your agent
114
124
 
@@ -121,9 +131,9 @@ pricing page" as a Leglas exploration in any project, including ones that
121
131
  have never seen Leglas. In a project, `npx leglas init` writes the whole
122
132
  workflow into `AGENTS.md`, so Claude Code, Cursor, Codex or whatever you
123
133
  switch to next opens the project already knowing how to add design
124
- directions to it. The one rule that workflow centers on, the commands an
125
- agent runs, the MCP server and the Agent Plugin are in
126
- [Working with agents](https://github.com/FredAmartey/leglas/blob/main/docs/agents.md).
134
+ directions to it. [Working with agents](https://github.com/FredAmartey/leglas/blob/main/docs/agents.md)
135
+ has the one rule that workflow is built around, the commands an agent runs,
136
+ the MCP server and the Agent Plugin.
127
137
 
128
138
  ## Documentation
129
139
 
package/dist/args.d.ts CHANGED
@@ -76,12 +76,17 @@ export type ParseResult = {
76
76
  kind: "watch";
77
77
  run: string | undefined;
78
78
  port: number | undefined;
79
+ json: boolean;
79
80
  } | {
80
81
  kind: "explore";
81
82
  surface: string;
82
83
  count: number;
83
84
  basedOn: string | null;
84
85
  json: boolean;
86
+ /** Build the set with the configured agent instead of printing a brief for one. */
87
+ build: boolean;
88
+ brief: string | null;
89
+ port: number | null;
85
90
  } | {
86
91
  kind: "keep";
87
92
  title: string;
@@ -1,7 +1,9 @@
1
1
  import { createUpdateService } from "@leglas/server";
2
2
  import type { RunOptions } from "./args.js";
3
+ import { createHandoff } from "./restart.js";
3
4
  import { run } from "./run.js";
4
5
  import { installShutdown } from "./shutdown.js";
6
+ type HandoffDeps = Parameters<ReturnType<typeof createHandoff>["handOff"]>[2];
5
7
  /** Wire the long-running CLI instance to its updater and signal handlers. */
6
8
  export declare function startViewer(options: RunOptions & {
7
9
  cwd: string;
@@ -13,4 +15,7 @@ export declare function startViewer(options: RunOptions & {
13
15
  createUpdateService?: typeof createUpdateService;
14
16
  run?: typeof run;
15
17
  installShutdown?: typeof installShutdown;
18
+ /** Where a restart spawns and how either shutdown ends the process. */
19
+ handoff?: HandoffDeps;
16
20
  }): Promise<void>;
21
+ export {};