lavish-axi 0.1.23 → 0.1.24
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
|
@@ -40,76 +40,67 @@ Lavish Editor opens agent-generated HTML files in a local browser, lets you pinp
|
|
|
40
40
|
Lavish Editor is an [AXI](https://axi.md), which means -
|
|
41
41
|
|
|
42
42
|
- It's just a CLI any capable agent can run without setup.
|
|
43
|
-
- No skills required. Agents learn to use AXIs by using them.
|
|
44
43
|
- It's optimized for agent ergonomics. TOON output, long polling, and contextual disclosure making it highly token efficient.
|
|
44
|
+
- The skill and hooks below only handle discovery; agents learn to use the AXI by using it.
|
|
45
45
|
|
|
46
46
|
## Quick Start
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Install the Lavish skill in the [Agent Skills](https://agentskills.io) format with [`npx skills`](https://github.com/vercel-labs/skills):
|
|
49
49
|
|
|
50
50
|
```sh
|
|
51
|
-
|
|
51
|
+
npx skills add kunchenguid/lavish-axi --skill lavish
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
That
|
|
54
|
+
That is the entire setup - no npm install needed.
|
|
55
|
+
The skill teaches your agent to run Lavish through `npx -y lavish-axi`, so the CLI comes along on demand.
|
|
55
56
|
|
|
56
|
-
|
|
57
|
+
Then, in agents that expose skills as slash commands (Claude Code, for example), invoke it directly:
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
```
|
|
60
|
+
/lavish let's discuss our plan here
|
|
61
|
+
```
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
Or just ask for anything that is easier to grasp visually - a plan, comparison, diagram, table, diff, or report - and the agent loads the skill on its own when it recognizes the task.
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
npm install -g lavish-axi
|
|
64
|
-
```
|
|
65
|
+
By default the skill lands in the current project's skills directory (`.claude/skills/`, for example); add `-g` to install it for all projects (`~/.claude/skills/`).
|
|
65
66
|
|
|
66
|
-
|
|
67
|
+
## Other Ways to Use Lavish
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
pnpm install --frozen-lockfile
|
|
72
|
-
pnpm run build
|
|
73
|
-
pnpm link
|
|
74
|
-
```
|
|
69
|
+
The skill is the recommended path, but it is not the only one.
|
|
70
|
+
|
|
71
|
+
### Zero setup
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
Lavish is an AXI, so any capable agent can run the CLI directly with nothing installed at all.
|
|
74
|
+
Just tell your agent:
|
|
77
75
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
```
|
|
77
|
+
Use `npx lavish-axi` to write a product or technical plan for what we discussed.
|
|
78
|
+
```
|
|
81
79
|
|
|
82
|
-
###
|
|
80
|
+
### Session hook
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
Want Lavish's ambient context - including your live open sessions - fed into every agent session instead of loading on demand?
|
|
83
|
+
Install the CLI globally and opt into the hook:
|
|
85
84
|
|
|
86
85
|
```sh
|
|
86
|
+
npm install -g lavish-axi
|
|
87
87
|
lavish-axi setup hooks
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
This installs a `SessionStart` hook for **Claude Code**, **Codex**, and **OpenCode** that
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
This installs a `SessionStart` hook for **Claude Code**, **Codex**, and **OpenCode** that surfaces open sessions, visualization playbooks, and usage guidance at the start of each session.
|
|
91
|
+
Unlike the skill, the hook also shows your live open sessions, so a fresh agent session can resume an in-flight review.
|
|
93
92
|
**Restart your agent session after running this** so the new hook takes effect.
|
|
94
93
|
|
|
95
|
-
###
|
|
96
|
-
|
|
97
|
-
Prefer the [Agent Skills](https://agentskills.io) format, or use an agent that supports it?
|
|
98
|
-
Install Lavish as a skill with [`npx skills`](https://github.com/vercel-labs/skills):
|
|
94
|
+
### From source
|
|
99
95
|
|
|
100
96
|
```sh
|
|
101
|
-
|
|
97
|
+
git clone https://github.com/kunchenguid/lavish-axi.git
|
|
98
|
+
cd lavish-axi
|
|
99
|
+
pnpm install --frozen-lockfile
|
|
100
|
+
pnpm run build
|
|
101
|
+
pnpm link
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
This drops a `lavish` skill into your agent's skills directory (`.claude/skills/` for example; add `-g` for `~/.claude/skills/`).
|
|
105
|
-
The skill carries the same guidance the hook delivers, but it loads on demand when the agent recognizes a task that calls for a visual artifact, rather than every session.
|
|
106
|
-
In agents that expose skills as slash commands (Claude Code, for example), you can also invoke it explicitly with `/lavish <what the artifact should show>`.
|
|
107
|
-
It does not surface your live open sessions - run `lavish-axi setup hooks` if you want that ambient context too.
|
|
108
|
-
|
|
109
|
-
### No setup at all
|
|
110
|
-
|
|
111
|
-
Lavish also works fully as a plain CLI - just tell your agent to `npx lavish-axi <file.html>` as shown in the Quick Start.
|
|
112
|
-
|
|
113
104
|
## How It Works
|
|
114
105
|
|
|
115
106
|
```
|
|
@@ -142,6 +133,8 @@ Lavish also works fully as a plain CLI - just tell your agent to `npx lavish-axi
|
|
|
142
133
|
- **Feedback controls** - Native form controls (radios, checkboxes, inputs, selects, buttons, labels, contenteditable) are interactive automatically, so they do not need `data-lavish-action`; wire their handlers to `window.lavish.queuePrompt()` or `window.lavish.sendQueuedPrompts()` to send feedback.
|
|
143
134
|
Mark only custom (non-native) clickable elements with `data-lavish-action` so Lavish does not annotate them.
|
|
144
135
|
The browser chrome keeps editing actions in the overflow menu (copy path, reload artifact, copy DOM snapshot, end session) and can submit queued prompts with **Send & end session**, which delivers the prompts before ending the session.
|
|
136
|
+
- **Keyboard shortcuts** - In the chrome composer, Enter sends queued prompts and Shift+Enter inserts a newline.
|
|
137
|
+
In the annotation card, Enter queues the annotation, Shift+Enter inserts a newline, and Ctrl+Enter (Cmd+Enter on macOS) queues it and sends all queued prompts immediately.
|
|
145
138
|
- **Agent presence** - The browser shows when no agent is listening, keeps queued feedback for the next successful `lavish-axi poll` send even across reloads, and only blocks sending while the agent is working on delivered feedback.
|
|
146
139
|
- **Precise targets** - Text annotations include selected text plus range anchors, so agents are not limited to whole-element selectors.
|
|
147
140
|
- **Server cleanup** - The detached server stops after the last session ends when nothing is connected, or after `LAVISH_AXI_IDLE_TIMEOUT_MS` (default 30 minutes) with no browser or poll connections.
|
|
@@ -163,6 +156,7 @@ Lavish also works fully as a plain CLI - just tell your agent to `npx lavish-axi
|
|
|
163
156
|
| `lavish-axi server` | Run the local Lavish Editor server. |
|
|
164
157
|
|
|
165
158
|
Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `diff`, `input`, `slides`.
|
|
159
|
+
One artifact often combines several playbooks, such as a plan that includes a comparison and a diagram, so read every playbook relevant to the artifact for the best quality.
|
|
166
160
|
|
|
167
161
|
### Flags
|
|
168
162
|
|
package/dist/cli.mjs
CHANGED
|
@@ -889,7 +889,7 @@ function createArtifactSdk() {
|
|
|
889
889
|
document.documentElement.appendChild(host);
|
|
890
890
|
shadow = host.attachShadow({ mode: "open" });
|
|
891
891
|
const style = document.createElement("style");
|
|
892
|
-
style.textContent = `:host{all:initial;position:fixed;z-index:2147483647;left:0;top:0;color-scheme:dark;--ink-900:#0f1115;--ink-800:#11141a;--ink-700:#171a21;--ink-600:#1c212b;--steel-700:#2a2f3a;--steel-600:#303745;--steel-500:#3c4557;--steel-400:#8c96aa;--steel-300:#aeb6c6;--steel-200:#b9c0cf;--steel-100:#d8deea;--cream-50:#fffbf3;--cream-100:#f7f3ea;--cream-200:#e8e1cf;--brass-500:#f4c95d;--brass-400:#ffd877;--brass-ink:#17130a;--bg:var(--ink-900);--bg-panel:var(--ink-800);--bg-elevated:var(--ink-600);--fg:var(--cream-100);--fg-faint:var(--steel-300);--border:var(--steel-600);--accent:#f4c95d;--accent-hover:#ffd877;--font-sans:Geist,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;--font-mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;--radius-md:10px;--radius-xl:14px;--shadow-floating:0 20px 70px rgba(0,0,0,.35);font-family:var(--font-sans)}*{box-sizing:border-box}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.lavish-text-highlight{position:fixed;pointer-events:none;background:rgba(244,201,93,.28);border-radius:2px;box-shadow:0 0 0 1px rgba(244,201,93,.45)}.lavish-annotation-card{position:fixed;width:min(320px,calc(100vw - 24px));padding:12px;border-radius:var(--radius-xl);background:var(--bg-panel);color:var(--fg);border:1px solid var(--accent);box-shadow:var(--shadow-floating);font:14px/1.4 var(--font-sans)}.lavish-heading{font-weight:700;margin-bottom:6px}.lavish-annotation-card textarea{width:100%;min-height:86px;resize:vertical;border-radius:var(--radius-md);border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:9px;font:inherit;font-family:var(--font-sans)}.lavish-annotation-card textarea::placeholder{color:var(--fg-faint)}.lavish-annotation-card .lavish-row{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}.lavish-annotation-card button{border:0;border-radius:var(--radius-md);padding:8px 10px;font-family:var(--font-sans);font-size:13px;font-weight:700;cursor:pointer}.lavish-annotation-card button:active{opacity:.85}.lavish-annotation-card .lavish-send{background:var(--accent);color:var(--brass-ink)}.lavish-annotation-card .lavish-send:hover{background:var(--accent-hover)}.lavish-annotation-card .lavish-cancel{background:var(--steel-700);color:var(--fg)}`;
|
|
892
|
+
style.textContent = `:host{all:initial;position:fixed;z-index:2147483647;left:0;top:0;color-scheme:dark;--ink-900:#0f1115;--ink-800:#11141a;--ink-700:#171a21;--ink-600:#1c212b;--steel-700:#2a2f3a;--steel-600:#303745;--steel-500:#3c4557;--steel-400:#8c96aa;--steel-300:#aeb6c6;--steel-200:#b9c0cf;--steel-100:#d8deea;--cream-50:#fffbf3;--cream-100:#f7f3ea;--cream-200:#e8e1cf;--brass-500:#f4c95d;--brass-400:#ffd877;--brass-ink:#17130a;--bg:var(--ink-900);--bg-panel:var(--ink-800);--bg-elevated:var(--ink-600);--fg:var(--cream-100);--fg-faint:var(--steel-300);--border:var(--steel-600);--accent:#f4c95d;--accent-hover:#ffd877;--font-sans:Geist,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;--font-mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;--radius-md:10px;--radius-xl:14px;--shadow-floating:0 20px 70px rgba(0,0,0,.35);font-family:var(--font-sans)}*{box-sizing:border-box}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.lavish-text-highlight{position:fixed;pointer-events:none;background:rgba(244,201,93,.28);border-radius:2px;box-shadow:0 0 0 1px rgba(244,201,93,.45)}.lavish-annotation-card{position:fixed;width:min(320px,calc(100vw - 24px));padding:12px;border-radius:var(--radius-xl);background:var(--bg-panel);color:var(--fg);border:1px solid var(--accent);box-shadow:var(--shadow-floating);font:14px/1.4 var(--font-sans)}.lavish-heading{font-weight:700;margin-bottom:6px}.lavish-annotation-card textarea{width:100%;min-height:86px;resize:vertical;border-radius:var(--radius-md);border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:9px;font:inherit;font-family:var(--font-sans)}.lavish-annotation-card textarea::placeholder{color:var(--fg-faint)}.lavish-annotation-card .lavish-hint{margin-top:6px;font-size:11px;color:var(--fg-faint)}.lavish-annotation-card .lavish-row{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}.lavish-annotation-card button{border:0;border-radius:var(--radius-md);padding:8px 10px;font-family:var(--font-sans);font-size:13px;font-weight:700;cursor:pointer}.lavish-annotation-card button:active{opacity:.85}.lavish-annotation-card .lavish-send{background:var(--accent);color:var(--brass-ink)}.lavish-annotation-card .lavish-send:hover{background:var(--accent-hover)}.lavish-annotation-card .lavish-cancel{background:var(--steel-700);color:var(--fg)}`;
|
|
893
893
|
shadow.appendChild(style);
|
|
894
894
|
return shadow;
|
|
895
895
|
}
|
|
@@ -918,7 +918,7 @@ function createArtifactSdk() {
|
|
|
918
918
|
card.className = "lavish-annotation-card";
|
|
919
919
|
const heading = c.tag === "text" ? "Annotate text" : "Annotate <" + c.tag + ">";
|
|
920
920
|
const placeholder = c.tag === "text" ? "Tell the agent what to change about this text..." : "Tell the agent what to change about this element...";
|
|
921
|
-
card.innerHTML = '<div class="lavish-heading">' + heading + '</div><textarea placeholder="' + placeholder + '"></textarea><div class="lavish-row"><button class="lavish-cancel" type="button">Cancel</button><button class="lavish-send" type="button">Queue</button></div>';
|
|
921
|
+
card.innerHTML = '<div class="lavish-heading">' + heading + '</div><textarea placeholder="' + placeholder + '"></textarea><div class="lavish-hint">Enter to queue · ' + (/Mac|iP(hone|ad|od)/.test(navigator.platform) ? "\u2318" : "Ctrl") + '+Enter to send now</div><div class="lavish-row"><button class="lavish-cancel" type="button">Cancel</button><button class="lavish-send" type="button">Queue</button></div>';
|
|
922
922
|
root.appendChild(card);
|
|
923
923
|
const left = Math.min(Math.max(12, rect.left), window.innerWidth - card.offsetWidth - 12);
|
|
924
924
|
const top = Math.min(Math.max(12, rect.bottom + 8), window.innerHeight - card.offsetHeight - 12);
|
|
@@ -946,7 +946,9 @@ function createArtifactSdk() {
|
|
|
946
946
|
textarea.addEventListener("keydown", (event) => {
|
|
947
947
|
if (event.key === "Enter" && !event.shiftKey && !event.isComposing) {
|
|
948
948
|
event.preventDefault();
|
|
949
|
+
const sendNow = (event.ctrlKey || event.metaKey) && !!textarea.value.trim();
|
|
949
950
|
sendButton.click();
|
|
951
|
+
if (sendNow) sendQueuedPrompts();
|
|
950
952
|
}
|
|
951
953
|
});
|
|
952
954
|
setTimeout(() => textarea.focus(), 0);
|
|
@@ -1944,7 +1946,7 @@ function normalizePagePath(path5) {
|
|
|
1944
1946
|
// src/cli.js
|
|
1945
1947
|
var COMMANDS = /* @__PURE__ */ new Set(["open", "poll", "end", "stop", "server", "playbook", "design", "setup"]);
|
|
1946
1948
|
var DESCRIPTION = "Lavish Editor helps agents turn rich HTML artifacts into collaborative human review surfaces. Whenever you are about to give user a complex response that will be easier to understand via a rich / interactive page, consider using Lavish Editor. First generate an interactive HTML artifact according to user request, then run `lavish-axi <html-file>` so the user can visually review it, annotate elements or selected text, queue prompts, and send feedback back through `lavish-axi poll`.";
|
|
1947
|
-
var VERSION = "0.1.
|
|
1949
|
+
var VERSION = "0.1.24";
|
|
1948
1950
|
async function run(argv) {
|
|
1949
1951
|
await ensureStateDir();
|
|
1950
1952
|
const normalizedArgv = normalizeArgv(argv);
|
|
@@ -2039,7 +2041,7 @@ function createHomeOutput({ bin, sessions, includeSessions = true }) {
|
|
|
2039
2041
|
"Run `lavish-axi poll <html-file>` to wait for user feedback",
|
|
2040
2042
|
"Run `lavish-axi end <html-file>` to end a session",
|
|
2041
2043
|
"Run `lavish-axi stop` to shut down the background server (it also self-stops when idle or after the last session ends with nothing connected)",
|
|
2042
|
-
"Run `lavish-axi playbook <playbook_id>` for focused artifact guidance",
|
|
2044
|
+
"Run `lavish-axi playbook <playbook_id>` for focused artifact guidance. One artifact often combines several playbooks (for example a plan that includes a comparison and a diagram), so read every playbook relevant to the artifact, not just one, for the best quality",
|
|
2043
2045
|
DESIGN_SYSTEM_HINT,
|
|
2044
2046
|
"Use lavish-axi when the user asks for a visual artifact, HTML explainer, interactive prototype, review surface, product or technical plan, comparison, report, or browser-based feedback loop"
|
|
2045
2047
|
]
|
|
@@ -2050,7 +2052,10 @@ function createPlaybookOutput(args) {
|
|
|
2050
2052
|
if (!id) {
|
|
2051
2053
|
return {
|
|
2052
2054
|
playbooks: listPlaybooks(),
|
|
2053
|
-
help: [
|
|
2055
|
+
help: [
|
|
2056
|
+
"Run `lavish-axi playbook <playbook_id>` for focused artifact guidance",
|
|
2057
|
+
"One artifact often combines several playbooks (for example a plan that includes a comparison and a diagram), so read every playbook relevant to the artifact, not just one, for the best quality"
|
|
2058
|
+
]
|
|
2054
2059
|
};
|
|
2055
2060
|
}
|
|
2056
2061
|
const playbook = findPlaybook(id);
|
|
@@ -2472,6 +2477,8 @@ Shut down the background Lavish Editor server. The server also stops itself when
|
|
|
2472
2477
|
|
|
2473
2478
|
List focused artifact guidance playbooks, or show one playbook by ID. Known IDs: diagram, table, comparison, plan, diff, input, slides.
|
|
2474
2479
|
|
|
2480
|
+
One artifact often combines several playbooks (for example a plan that includes a comparison and a diagram), so read every playbook relevant to the artifact, not just one, for the best quality.
|
|
2481
|
+
|
|
2475
2482
|
Examples:
|
|
2476
2483
|
lavish-axi playbook
|
|
2477
2484
|
lavish-axi playbook diagram
|
|
Binary file
|
package/package.json
CHANGED
package/skills/lavish/SKILL.md
CHANGED
|
@@ -39,7 +39,8 @@ Use lavish-axi when the user asks for a visual artifact, HTML explainer, interac
|
|
|
39
39
|
|
|
40
40
|
## Playbooks
|
|
41
41
|
|
|
42
|
-
Run `npx -y lavish-axi playbook <id>` for focused, detailed guidance on any of these
|
|
42
|
+
Run `npx -y lavish-axi playbook <id>` for focused, detailed guidance on any of these.
|
|
43
|
+
One artifact often combines several playbooks (for example a plan that includes a comparison and a diagram), so read every playbook relevant to your artifact, not just one, for the best quality:
|
|
43
44
|
|
|
44
45
|
- `diagram` - Map relationships, flows, state, and architecture
|
|
45
46
|
- `table` - Turn dense records into scan-friendly review surfaces
|
|
@@ -57,6 +58,6 @@ Run `npx -y lavish-axi playbook <id>` for focused, detailed guidance on any of t
|
|
|
57
58
|
- Run `npx -y lavish-axi poll <html-file>` to wait for user feedback
|
|
58
59
|
- Run `npx -y lavish-axi end <html-file>` to end a session
|
|
59
60
|
- Run `npx -y lavish-axi stop` to shut down the background server (it also self-stops when idle or after the last session ends with nothing connected)
|
|
60
|
-
- Run `npx -y lavish-axi playbook <playbook_id>` for focused artifact guidance
|
|
61
|
+
- Run `npx -y lavish-axi playbook <playbook_id>` for focused artifact guidance. One artifact often combines several playbooks (for example a plan that includes a comparison and a diagram), so read every playbook relevant to the artifact, not just one, for the best quality
|
|
61
62
|
- Lavish does not auto-inject any design system - artifacts stay portable so they render identically when opened directly without lavish-axi running. Choose a design system in this priority order: (1) if the user asked for a specific look or named design system, follow that; (2) otherwise, if the current project already has a design system or style conventions, match those so the artifact fits in; (3) otherwise, prefer the Lavish-recommended Tailwind CSS browser runtime v4 + DaisyUI v5, available via CDN - run `npx -y lavish-axi design` for a copy-pasteable CDN snippet plus component reference. Prefer that CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user.
|
|
62
63
|
- Use lavish-axi when the user asks for a visual artifact, HTML explainer, interactive prototype, review surface, product or technical plan, comparison, report, or browser-based feedback loop
|