lavish-axi 0.1.22 → 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,75 +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
- Just tell your agent:
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
- Use `npx lavish-axi` to write a product or technical plan for what we discussed.
51
+ npx skills add kunchenguid/lavish-axi --skill lavish
52
52
  ```
53
53
 
54
- That works with zero setup - Lavish is an AXI, so any capable agent can run the CLI directly.
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
- To make your agent reach for Lavish on its own (without you naming it every time), install the agent hooks as instructed below.
57
+ Then, in agents that expose skills as slash commands (Claude Code, for example), invoke it directly:
57
58
 
58
- ## Install
59
+ ```
60
+ /lavish let's discuss our plan here
61
+ ```
59
62
 
60
- **npm**
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
- ```sh
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
- **From source**
67
+ ## Other Ways to Use Lavish
67
68
 
68
- ```sh
69
- git clone https://github.com/kunchenguid/lavish-axi.git
70
- cd lavish-axi
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
- ## Teach Your Agent About Lavish (recommended)
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
- Lavish does not wire itself into your agent automatically, so in a fresh session your agent would not know to use it.
79
- There are two ways to fix that - **you only need one.**
80
- We recommend the hook.
76
+ ```
77
+ Use `npx lavish-axi` to write a product or technical plan for what we discussed.
78
+ ```
81
79
 
82
- ### Option A: Session hook (recommended)
80
+ ### Session hook
83
81
 
84
- Run this once to opt in:
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 feeds Lavish's ambient context (open sessions, visualization playbooks, and usage guidance) into your agent at the start of each session.
91
- With the hook installed, your agent learns to turn complex responses into rich, reviewable HTML artifacts proactively - no need to mention `lavish-axi` by name.
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
- ### Option B: Install as a skill
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
- npx skills add kunchenguid/lavish-axi --skill lavish-axi
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-axi` 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
- It does not surface your live open sessions - run `lavish-axi setup hooks` if you want that ambient context too.
107
-
108
- ### No setup at all
109
-
110
- Lavish also works fully as a plain CLI - just tell your agent to `npx lavish-axi <file.html>` as shown in the Quick Start.
111
-
112
104
  ## How It Works
113
105
 
114
106
  ```
@@ -141,6 +133,8 @@ Lavish also works fully as a plain CLI - just tell your agent to `npx lavish-axi
141
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.
142
134
  Mark only custom (non-native) clickable elements with `data-lavish-action` so Lavish does not annotate them.
143
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.
144
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.
145
139
  - **Precise targets** - Text annotations include selected text plus range anchors, so agents are not limited to whole-element selectors.
146
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.
@@ -162,6 +156,7 @@ Lavish also works fully as a plain CLI - just tell your agent to `npx lavish-axi
162
156
  | `lavish-axi server` | Run the local Lavish Editor server. |
163
157
 
164
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.
165
160
 
166
161
  ### Flags
167
162
 
@@ -178,7 +173,7 @@ Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `diff`, `input`, `
178
173
  ```sh
179
174
  pnpm run check # Run all verification commands
180
175
  pnpm run build # Bundle the publishable CLI, chrome, and design assets
181
- pnpm run build:skill # Regenerate the installable lavish-axi skill
176
+ pnpm run build:skill # Regenerate the installable lavish skill
182
177
  pnpm test # Run node:test tests
183
178
  pnpm run lint # Run ESLint
184
179
  pnpm run format:check # Check Prettier formatting
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 &lt;" + c.tag + "&gt;";
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 &middot; ' + (/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.22";
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: ["Run `lavish-axi playbook <playbook_id>` for focused artifact guidance"]
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavish-axi",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "packageManager": "pnpm@11.1.1",
5
5
  "description": "HTML is the new markdown. Lavish is the new editor for your HTML artifacts.",
6
6
  "type": "module",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "dist",
12
- "skills/lavish-axi",
12
+ "skills/lavish",
13
13
  "lavish-editor-marketing/renders/lavish-editor-marketing.gif",
14
14
  "LICENSE",
15
15
  "README.md"
@@ -1,6 +1,7 @@
1
1
  ---
2
- name: lavish-axi
2
+ name: lavish
3
3
  description: Turn complex or visual agent responses into rich, reviewable HTML artifacts the user can annotate and send feedback on, using the lavish-axi CLI. Use when about to give a plan, comparison, diagram, table, code diff, report, or anything easier to grasp visually than as prose.
4
+ argument-hint: <what the artifact should show>
4
5
  ---
5
6
 
6
7
  # Lavish Editor
@@ -10,6 +11,13 @@ Lavish Editor helps agents turn rich HTML artifacts into collaborative human rev
10
11
  You do not need lavish-axi installed globally - invoke it with `npx -y lavish-axi <html-file>`.
11
12
  If lavish-axi output shows a follow-up command starting with `lavish-axi`, run it as `npx -y lavish-axi ...` instead.
12
13
 
14
+ ## Request
15
+
16
+ $ARGUMENTS
17
+
18
+ If the request above is non-empty, the user invoked `/lavish` explicitly - build an HTML artifact for that request now, following the workflow below.
19
+ If it is empty, infer what to visualize from the conversation.
20
+
13
21
  ## When to use
14
22
 
15
23
  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
@@ -31,7 +39,8 @@ Use lavish-axi when the user asks for a visual artifact, HTML explainer, interac
31
39
 
32
40
  ## Playbooks
33
41
 
34
- 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:
35
44
 
36
45
  - `diagram` - Map relationships, flows, state, and architecture
37
46
  - `table` - Turn dense records into scan-friendly review surfaces
@@ -49,6 +58,6 @@ Run `npx -y lavish-axi playbook <id>` for focused, detailed guidance on any of t
49
58
  - Run `npx -y lavish-axi poll <html-file>` to wait for user feedback
50
59
  - Run `npx -y lavish-axi end <html-file>` to end a session
51
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)
52
- - 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
53
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.
54
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