usepilot 0.21.0 → 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/GUIDE.md +23 -8
- package/README.md +1 -0
- package/cli/{chunk-3S3IFMRI.js → chunk-MKYAH7CZ.js} +183 -84
- package/cli/index.js +3 -3
- package/cli/next.js +1 -1
- package/cli/vite.js +1 -1
- package/dist/{mount-OPdYocjn.js → mount-BGG4C6zS.js} +7400 -5585
- package/dist/pilot-auto.js +1 -1
- package/dist/pilot.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +8 -0
package/GUIDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pilot guide
|
|
2
2
|
|
|
3
|
-
How to use Pilot, task by task. This guide is for **usepilot 0.
|
|
3
|
+
How to use Pilot, task by task. This guide is for **usepilot 0.23.0**: it ships with Pilot, so the copy in your project (`node_modules/usepilot/GUIDE.md`, or `npx usepilot guide`) always matches the version you have.
|
|
4
4
|
|
|
5
5
|
**Agents:** when someone asks how to do something with Pilot, answer from this file. If it isn't here, Pilot doesn't do it yet: say so rather than guessing.
|
|
6
6
|
|
|
@@ -14,6 +14,7 @@ How to use Pilot, task by task. This guide is for **usepilot 0.21.0**: it ships
|
|
|
14
14
|
- [Variables and tokens](#variables-and-tokens)
|
|
15
15
|
- [Screen widths (breakpoints)](#screen-widths-breakpoints)
|
|
16
16
|
- [Hover, focus, dark mode and other states](#hover-focus-dark-mode-and-other-states)
|
|
17
|
+
- [Editing an image](#editing-an-image)
|
|
17
18
|
- [Editing text](#editing-text)
|
|
18
19
|
- [Undo, discard and reloads](#undo-discard-and-reloads)
|
|
19
20
|
- [Sending changes to your agent](#sending-changes-to-your-agent)
|
|
@@ -81,20 +82,23 @@ Drag the toolbar by the strip along its top edge; it stays where you put it.
|
|
|
81
82
|
|
|
82
83
|
Select an element and its **property dialog** opens beside it.
|
|
83
84
|
|
|
84
|
-
- **With nothing typed**, it lists every property the element sets, grouped (Content, for a `::before` or `::after`; Layout, Position, Appearance, Effects, Transform, Transition, Typography, Interactivity, SVG, Visibility).
|
|
85
|
+
- **With nothing typed**, it lists every property the element sets, grouped (Image, for an image; Content, for a `::before` or `::after`; Layout, Position, Appearance, Effects, Transform, Transition, Typography, Interactivity, SVG, Visibility).
|
|
85
86
|
- **Search** by CSS name or Tailwind class: `p`, `pt`, `px`, `w`, `min-w`, `gap`, `display`, `items`, `aspect`, `bg`, `font`, `text`, `rounded`, `shadow`… Abbreviations work too (`mxw` is max-width). The search finds properties only: type values in the editor (`pt-4` in the search isn't a value).
|
|
86
87
|
- **Tab** or **Enter** goes into the editor, **Enter** applies and goes back to the search for the next property: `pt` Tab `24` Enter.
|
|
87
88
|
- **Values:** type a number (`12` is 12px), any CSS unit, a keyword (`auto`), math (`100% - 20px`), or a [variable](#variables-and-tokens). **↑/↓** step by 1, **Shift** by 10; the scroll wheel does the same on a field being edited. Some fields have a **drag handle** to scrub the value.
|
|
89
|
+
- **Colors** show as hex in capitals, without the `#` (`0F172A`); type them with or without it. One digit is repeated: `f` is white (`FFFFFF`), `0` black. Click the swatch for the color picker.
|
|
88
90
|
- **Linked sides** work like Tailwind: `p` sets all four sides, `px` left and right, `py` top and bottom. The button beside padding, margin, inset, gap and radius switches between one value and each side.
|
|
89
91
|
- **Several selected:** each change goes to all of them. A field whose value differs between them says **Mixed**; typing a value sets it on all. If they'd take it at different screen widths (one card has a rule for large screens, the other doesn't), each follows its own, and the footer says so: "Widths differ: from 1024px on 1, Base on 1".
|
|
90
92
|
- **Clearing a field** (empty it and press Enter) means "this element doesn't set this property": Pilot takes the property off that element, not set to 0.
|
|
91
|
-
- **Rich properties** (box shadow, filter, backdrop filter, mask image) show their values as chips: click one to edit it in a panel beside the dialog, **+** to add one.
|
|
93
|
+
- **Rich properties** (background image, box shadow, filter, backdrop filter, mask image) show their values as chips: click one to edit it in a panel beside the dialog, **+** to add one.
|
|
94
|
+
- **Background image** (`bg-image`): **+** adds an image. In its panel, pick the type (an image, a linear or radial gradient, custom CSS, or none). An image takes its url: type it, or hover the field and click the button on its right for the images on the page and in the project's `public` folder (it shows the first 20: type to search them all). A gradient has its **interpolation**, the color space it blends in (sRGB, HSL, OKLab, OKLCH; empty, the browser's), and for HSL and OKLCH which way round the **hue** goes (shorter, longer, increasing, decreasing; longer sweeps through the rainbow); then a row per color stop: its position (empty, the browser spreads them; the field shows where; type a percentage, or step it with the arrows and leave the field, and the stop moves to its place in the list), then its color: click it to pick one (and its opacity), or hover it and click the variables button for one of the page's color variables; **×** takes the stop off (a gradient keeps at least two, so there's no × at two). **+** under the stops adds one. Each layer's panel ends with its own **size**, **position** and **repeat** (search `bg-cover`, `bg-center` or `bg-no-repeat` to find them).
|
|
95
|
+
- **Background clip** (`bg-clip`): how far the background reaches: the border, the padding, the content, or the text (`text` shows the background through the letters).
|
|
92
96
|
- **Transform:** one row for everything that moves, turns, sizes or slants the element, its chip saying what's set (× takes it all off). Click it and pick its **type**: **default** has translate, rotate, scale and skew (each one value, or each axis on its own with the button at the right of its row; scale takes a factor, `1.5`, or a percentage), **custom** takes it all as CSS functions in one value (`translate(-50%, -50%) rotate(5deg)`), **none** turns them all off.
|
|
93
97
|
- **3D:** turning an element around X or Y, or moving it along Z, only looks 3D with a perspective on its parent; without one, the footer says "Add perspective to the parent". Select the parent and set its perspective.
|
|
94
98
|
- **Transition:** each transition is a chip (`opacity 300ms`); click it to pick what animates (or **custom** for any property, **none** for no transition) and its own duration, easing and delay. **+** adds one. The **duration**, **easing** and **delay** rows under the chips apply to every transition at once, over the chips' own (like Tailwind's `duration-300 ease-out`); a chip's footer says when they do. A bare number is milliseconds. **Easing** shows its curve: drag its two handles to make your own (**Shift** snaps a handle to the top or bottom line), or pick **spring** and set its bounce (the duration is how long it feels; the footer says when it really settles), or **custom** for anything else, your project's easing variables included.
|
|
95
99
|
- **Copy and paste:** right-click a property's name for **Copy CSS**, **Copy properties** and **Paste properties** (onto the selected elements).
|
|
96
100
|
- **Fields show what your CSS declares**, not computed values; hover a field to see what math or a variable comes to.
|
|
97
|
-
- The dialog stays where it opened while you edit; drag it by the strip along its top edge.
|
|
101
|
+
- The dialog stays where it opened while you edit; drag it by the strip along its top edge. Drag its bottom edge to make it shorter (its properties scroll); it stays that height for the next elements you select.
|
|
98
102
|
|
|
99
103
|
## Variables and tokens
|
|
100
104
|
|
|
@@ -149,6 +153,10 @@ For a condition no modifier lists, type `/` and describe it right there: "the pa
|
|
|
149
153
|
- The `/` menu also lists the conditions your code already has on the element (`group-hover/hero`, `.card:hover &`, `motion-reduce`), even when they don't hold right now. Pick one to see and edit its values.
|
|
150
154
|
- Backspace at the start of the search removes it, like the other modifiers.
|
|
151
155
|
|
|
156
|
+
## Editing an image
|
|
157
|
+
|
|
158
|
+
Select an image and its dialog starts with an **Image** section: **src**, the image it shows, and **alt**, what a screen reader says for it (search `src` or `alt` to jump there). Type a new address in **src**, or hover it and click the button on its right for the images on the page and in your project's `public` folder (type to narrow the list); the new image shows on the page at once. Type a short description in **alt**, or empty it to mark the image decorative (`alt=""`: screen readers skip it; the field then says *decorative*; type `""` for an image with no alt yet). Emptying **src** changes nothing: press Cmd/Ctrl+Z to take a new image back. Both are for every screen width and state, and are sent, undone and checked like any other change; your agent sets them where the image comes from in your code.
|
|
159
|
+
|
|
152
160
|
## Editing text
|
|
153
161
|
|
|
154
162
|
With **Select** on, **double-click** a text to edit it in place. **Enter** is done, **Esc** cancels. In an element with other elements inside, you edit the run of text under the pointer. Text edits are sent and undone like any other change.
|
|
@@ -166,6 +174,7 @@ With **Select** on, **double-click** a text to edit it in place. **Enter** is do
|
|
|
166
174
|
- A new change or comment on an element with a job on it **waits** ("Queued") and goes once that job is done, so two jobs never edit the same element at once.
|
|
167
175
|
- **Pilot checks the page** when the agent is done. What landed stops being previewed. What didn't goes back to the agent once; after that, Pilot accepts what the code gives. To insist on a value, edit it again and Send.
|
|
168
176
|
- The agent writes your changes in the project's own way (Tailwind classes, CSS modules, tokens…), never as inline styles.
|
|
177
|
+
- **Sounds**, if you want them: ask your agent to turn Pilot's sounds on, or add `sounds: true` where your app loads Pilot yourself ([options](#commands-and-options)). Pilot then plays a short sound when changes are sent or discarded, when a job is done, when the agent replies or asks you something, when something's stuck, and when you mark a comment as solved. Dragging a field's wheel clicks softly as it turns; dragged slowly, it clicks on every value. An angle's dial taps once as you start turning it. After a reload, they play once you've clicked or typed on the page.
|
|
169
178
|
|
|
170
179
|
## Comments
|
|
171
180
|
|
|
@@ -173,8 +182,9 @@ With **Select** on, **double-click** a text to edit it in place. **Enter** is do
|
|
|
173
182
|
- **Attach** images, text files or PDFs with the attach button, or drop them on the box.
|
|
174
183
|
- **Unsent edits go along:** edits you made on those elements show as a chip ("2 changes") and go with the comment; remove the chip to keep them for Send. Where the comment and an edit disagree, the comment wins. With a skill or `pilot-make-responsive` picked, the edits go first, then the skill works on the result: both chips show, the edits' first.
|
|
175
184
|
- Each element has a **thread**: the agent replies in it, and you can reply to follow up ("a bit more"): the agent remembers the thread.
|
|
176
|
-
- A thread with a reply to read shows a **comment icon** on its element and counts on the Comment button.
|
|
177
|
-
- **Edit manually**, under a reply that changed the element's look, switches to Select with those elements selected, to fine-tune what the agent chose. A reply with **Copy instructions** doesn't have it: allow what was refused and ask again first.
|
|
185
|
+
- A thread with a reply to read shows a **comment icon** on its element and counts on the Comment button. Click the icon to open the thread; on the selected element, it opens and closes it. When a reply or a question arrives, the comment icon on its element wiggles to catch your eye.
|
|
186
|
+
- **Edit manually**, under a reply that changed the element's look, switches to Select with those elements selected, to fine-tune what the agent chose. If you answered **All of them** to the agent's question, every look-alike on the page is selected with it, so your tweak goes to all of them. A reply with **Copy instructions** doesn't have it: allow what was refused and ask again first.
|
|
187
|
+
- **Show in DOM**, under a reply whose job added elements to the page, selects what was added and opens the DOM tree on it, with the comment box on it (switch to Select to edit it), even when it doesn't show on the page (empty, or only in a state, like a closed menu's items). The agent says in its reply what makes it show.
|
|
178
188
|
- **Mark as solved** (or Option+Enter) closes the thread.
|
|
179
189
|
- **Stop** (beside send) cancels the job while the agent works.
|
|
180
190
|
|
|
@@ -186,7 +196,7 @@ Type `/` at the start of a word in the comment box:
|
|
|
186
196
|
- **Props**, on a component's instance: lists the props that change how it looks. Reply with a line like `tone: dark` to change one.
|
|
187
197
|
- **pilot-make-responsive** (`/responsive` finds it too): makes the element work at every screen width. Pilot checks the result at a phone width, each breakpoint and a wide desktop, and sends problems back to the agent once.
|
|
188
198
|
- **pilot-break-and-fix**: makes the element hold up with real-world content. Pilot first puts odd content into a copy of the page (very long text, long words like URLs, many more items, images that fail to load or come in odd shapes) and measures what breaks at each width; the agent fixes exactly that, without changing how it looks with its usual content; Pilot tests again after.
|
|
189
|
-
- **pilot-make-accessible**: fixes what Pilot's audit finds: text contrast (in light and dark mode), names for icon buttons
|
|
199
|
+
- **pilot-make-accessible**: fixes what Pilot's audit finds: text contrast (in light and dark mode), names for icon buttons and fields, an `alt` for every image that has none (a short description, or empty for a decorative one; its reply lists each one so you can check the wording; an image you gave an alt in Pilot is left as you wrote it), a visible focus style, tap targets on phones, and animations for people who prefer reduced motion. The agent also reviews the code for what can't be measured, and changes nothing of your layout: Pilot checks every element's size and position at every width before and after. Its reply lists what it changed.
|
|
190
200
|
|
|
191
201
|
Pilot's three always end their reply with what Pilot measured itself ("**Pilot checked it:** 4 problems before, 0 now"), and send what's left back to the agent once.
|
|
192
202
|
|
|
@@ -214,7 +224,7 @@ With an element selected, **hold Alt (Option)** and move the pointer: Pilot show
|
|
|
214
224
|
|
|
215
225
|
## The DOM tree
|
|
216
226
|
|
|
217
|
-
**Alt+D** (or Show in DOM) opens a tree of the page's elements, starting at `<html>` and `<body>`, to select what's hard to click: overlapping, zero-size or hidden elements, or the page itself (its background, colors and fonts). Click a row to select it, **↑/↓** to move, **→/←** to open and close. Cmd/Ctrl+click adds a row, Shift+click selects a range. In a React or Vue app, **Components** at the top switches to the tree of component instances. `::before` and `::after` are listed too
|
|
227
|
+
**Alt+D** (or Show in DOM) opens a tree of the page's elements, starting at `<html>` and `<body>`, to select what's hard to click: overlapping, zero-size or hidden elements, or the page itself (its background, colors and fonts). Click a row to select it, **↑/↓** to move, **→/←** to open and close. Cmd/Ctrl+click adds a row, Shift+click selects a range. In a React or Vue app, **Components** at the top switches to the tree of component instances. `::before` and `::after` are listed too: hover one to see its box on the page, click it to edit it (its element is selected with the `before:` or `after:` modifier on). Clicking the element's own row takes that modifier off.
|
|
218
228
|
|
|
219
229
|
## Keyboard shortcuts
|
|
220
230
|
|
|
@@ -283,5 +293,10 @@ mountPilot({
|
|
|
283
293
|
launch: false, // true: open on load
|
|
284
294
|
nameAttributes: ["data-block"], // attributes your project names elements with
|
|
285
295
|
project: "my-app", // your package.json's name: npx usepilot runs for its own project's pages
|
|
296
|
+
sounds: true, // sounds for sent, discarded, done, replies, stuck, solved, and dragging values. Default false
|
|
286
297
|
});
|
|
287
298
|
```
|
|
299
|
+
|
|
300
|
+
To change one, ask your agent ("turn Pilot's sounds on", "open Pilot on load"), or edit it yourself and reload the page.
|
|
301
|
+
|
|
302
|
+
**Agents**, to set an option: search the app's code for `usepilot` to find where it loads Pilot, a `mountPilot({ project: … })` call (in `import("usepilot").then(…)`, or a `<script type="module">` importing `…/node_modules/usepilot/dist/pilot.js`), and add the option beside `project`, keeping the development-only check around it. An import of `usepilot/auto` takes no options: replace it with `import("usepilot").then((p) => p.mountPilot({ project: "<the package.json name>", … }))`, under the same check. `usepilot/vite` and `usepilot/next`, in the build config, don't take these options. The page picks the change up on reload.
|
package/README.md
CHANGED
|
@@ -75,6 +75,7 @@ mountPilot({
|
|
|
75
75
|
launch: false, // true: open on load
|
|
76
76
|
nameAttributes: ["data-block"], // attributes your project names elements with
|
|
77
77
|
project: "my-app", // your package.json's name: npx usepilot runs for its own project's pages
|
|
78
|
+
sounds: true, // sounds for sent, discarded, done, replies, stuck, solved, and dragging values. Default false
|
|
78
79
|
});
|
|
79
80
|
```
|
|
80
81
|
|