lavish-axi 0.1.12 → 0.1.14
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 +11 -9
- package/dist/cli.mjs +34 -5
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -96,6 +96,7 @@ pnpm link
|
|
|
96
96
|
|
|
97
97
|
- **File-path identity** - Sessions are keyed by the canonical HTML file path, so agents do not need opaque IDs.
|
|
98
98
|
- **Portable artifacts** - The artifact runs in an iframe while Lavish injects a small SDK for annotations, snapshots, and feedback controls. Lavish does not inject any design system, so the saved HTML file renders identically whether you open it through `lavish-axi` or directly in a browser. Run `lavish-axi design` for a copy-pasteable CDN snippet to opt in to Tailwind CSS v4 + DaisyUI v5, or use any other design system (or none).
|
|
99
|
+
- **Local assets** - Copy local images, CSS, fonts, and scripts next to the HTML artifact and reference them with relative paths from that directory; root-prefixed paths such as `/assets/logo.png` will not resolve through Lavish's artifact route.
|
|
99
100
|
- **Live reload** - Lavish watches the HTML artifact file by default. To also reload on sibling asset changes, add `data-lavish-live-reload-root` to the root element or `<meta name="lavish-live-reload" content="root">`.
|
|
100
101
|
- **Feedback controls** - Mark buttons, choices, and other interactive elements with `data-lavish-action` so Lavish does not annotate them, then call `window.lavish.queuePrompt()` or `window.lavish.sendQueuedPrompts()` from the control handler.
|
|
101
102
|
- **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.
|
|
@@ -104,15 +105,16 @@ pnpm link
|
|
|
104
105
|
|
|
105
106
|
## CLI Reference
|
|
106
107
|
|
|
107
|
-
| Command | Description
|
|
108
|
-
| ----------------------------- |
|
|
109
|
-
| `lavish-axi` | Show current sessions and usage guidance.
|
|
110
|
-
| `lavish-axi <html-file>` | Open or resume a Lavish Editor session.
|
|
111
|
-
| `lavish-axi poll <html-file>` | Long-poll until the user sends feedback or ends the session.
|
|
112
|
-
| `lavish-axi end <html-file>` | End a session.
|
|
113
|
-
| `lavish-axi playbook [id]` | List focused artifact guidance or show one playbook.
|
|
114
|
-
| `lavish-axi design` | Show CDN snippet + DaisyUI component reference (opt-in).
|
|
115
|
-
| `lavish-axi
|
|
108
|
+
| Command | Description |
|
|
109
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
110
|
+
| `lavish-axi` | Show current sessions and usage guidance. |
|
|
111
|
+
| `lavish-axi <html-file>` | Open or resume a Lavish Editor session. |
|
|
112
|
+
| `lavish-axi poll <html-file>` | Long-poll until the user sends feedback or ends the session. |
|
|
113
|
+
| `lavish-axi end <html-file>` | End a session. |
|
|
114
|
+
| `lavish-axi playbook [id]` | List focused artifact guidance or show one playbook. |
|
|
115
|
+
| `lavish-axi design` | Show CDN snippet + DaisyUI component reference (opt-in). |
|
|
116
|
+
| `lavish-axi setup hooks` | Install or repair optional SessionStart hooks for Claude Code, Codex, and OpenCode; restart the agent session afterward. |
|
|
117
|
+
| `lavish-axi server` | Run the local Lavish Editor server. |
|
|
116
118
|
|
|
117
119
|
Known playbook IDs: `diagram`, `table`, `comparison`, `plan`, `diff`, `input`, `slides`.
|
|
118
120
|
|
package/dist/cli.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { access } from "node:fs/promises";
|
|
|
7
7
|
import os2 from "node:os";
|
|
8
8
|
import path4 from "node:path";
|
|
9
9
|
import { fileURLToPath } from "node:url";
|
|
10
|
-
import { AxiError, runAxiCli } from "axi-sdk-js";
|
|
10
|
+
import { AxiError, installSessionStartHooks, runAxiCli } from "axi-sdk-js";
|
|
11
11
|
|
|
12
12
|
// src/design-reference.js
|
|
13
13
|
var TAILWIND_BROWSER_VERSION = "4.2.4";
|
|
@@ -1389,7 +1389,7 @@ async function serve({ port, stateFile: stateFile2, version = "", debug = false,
|
|
|
1389
1389
|
res.status(403).send("Forbidden");
|
|
1390
1390
|
return;
|
|
1391
1391
|
}
|
|
1392
|
-
res.sendFile(file);
|
|
1392
|
+
res.sendFile(file, { dotfiles: "allow" });
|
|
1393
1393
|
} catch (error) {
|
|
1394
1394
|
next(error);
|
|
1395
1395
|
}
|
|
@@ -1820,9 +1820,9 @@ function normalizePagePath(path5) {
|
|
|
1820
1820
|
}
|
|
1821
1821
|
|
|
1822
1822
|
// src/cli.js
|
|
1823
|
-
var COMMANDS = /* @__PURE__ */ new Set(["open", "poll", "end", "server", "playbook", "design"]);
|
|
1823
|
+
var COMMANDS = /* @__PURE__ */ new Set(["open", "poll", "end", "server", "playbook", "design", "setup"]);
|
|
1824
1824
|
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`.";
|
|
1825
|
-
var VERSION = "0.1.
|
|
1825
|
+
var VERSION = "0.1.14";
|
|
1826
1826
|
async function run(argv) {
|
|
1827
1827
|
await ensureStateDir();
|
|
1828
1828
|
const normalizedArgv = normalizeArgv(argv);
|
|
@@ -1841,7 +1841,6 @@ async function run(argv) {
|
|
|
1841
1841
|
version: VERSION,
|
|
1842
1842
|
argv: isTopLevelHelp ? [] : normalizedArgv,
|
|
1843
1843
|
topLevelHelp: TOP_LEVEL_HELP,
|
|
1844
|
-
hooks: { binaryNames: ["lavish-axi"] },
|
|
1845
1844
|
home: async () => createHomeOutput({
|
|
1846
1845
|
bin: process.argv[1] || "lavish-axi",
|
|
1847
1846
|
sessions: isTopLevelHelp ? [] : await visibleSessions(),
|
|
@@ -1853,6 +1852,7 @@ async function run(argv) {
|
|
|
1853
1852
|
end: endCommand,
|
|
1854
1853
|
playbook: playbookCommand,
|
|
1855
1854
|
design: designCommand,
|
|
1855
|
+
setup: setupCommand,
|
|
1856
1856
|
server: serverCommand
|
|
1857
1857
|
},
|
|
1858
1858
|
getCommandHelp
|
|
@@ -1912,6 +1912,7 @@ function createHomeOutput({ bin, sessions, includeSessions = true }) {
|
|
|
1912
1912
|
help: [
|
|
1913
1913
|
"Run `lavish-axi <html-file>` to open or resume a Lavish Editor session",
|
|
1914
1914
|
"Unless the user specifies another location, create HTML artifacts in the current working directory under `.lavish/`",
|
|
1915
|
+
"Lavish serves the html file through a local express.js server. If your html needs to reference other filesystem assets such as images, CSS, fonts, and local scripts, copy them into the same directory as the HTML file, then reference them with relative paths from that directory. Never prepend `/` to those asset paths - root paths won't work",
|
|
1915
1916
|
"Run `lavish-axi poll <html-file>` to wait for user feedback",
|
|
1916
1917
|
"Run `lavish-axi end <html-file>` to end a session",
|
|
1917
1918
|
"Run `lavish-axi playbook <playbook_id>` for focused artifact guidance",
|
|
@@ -2021,6 +2022,29 @@ async function playbookCommand(args) {
|
|
|
2021
2022
|
async function designCommand() {
|
|
2022
2023
|
return createDesignOutput();
|
|
2023
2024
|
}
|
|
2025
|
+
async function setupCommand(args) {
|
|
2026
|
+
if (args.length !== 1 || args[0] !== "hooks") {
|
|
2027
|
+
throw new AxiError("Unknown setup action", "VALIDATION_ERROR", ["Run `lavish-axi setup hooks`"]);
|
|
2028
|
+
}
|
|
2029
|
+
const errors = [];
|
|
2030
|
+
installSessionStartHooks({
|
|
2031
|
+
marker: "lavish-axi",
|
|
2032
|
+
binaryNames: ["lavish-axi"],
|
|
2033
|
+
distEntrypoints: ["dist/cli.mjs", "bin/lavish-axi.js"],
|
|
2034
|
+
homeDir: resolveHookHomeDir(),
|
|
2035
|
+
onError: (message) => errors.push(message)
|
|
2036
|
+
});
|
|
2037
|
+
if (errors.length > 0) {
|
|
2038
|
+
throw new AxiError("Failed to install lavish-axi agent hooks", "SERVER_ERROR", errors);
|
|
2039
|
+
}
|
|
2040
|
+
return {
|
|
2041
|
+
hooks: { status: "installed", integrations: "Claude Code, Codex, OpenCode" },
|
|
2042
|
+
help: ["Restart your agent session to receive lavish-axi ambient context"]
|
|
2043
|
+
};
|
|
2044
|
+
}
|
|
2045
|
+
function resolveHookHomeDir(env = process.env, fallback = os2.homedir()) {
|
|
2046
|
+
return env.HOME || fallback;
|
|
2047
|
+
}
|
|
2024
2048
|
async function serverCommand(args) {
|
|
2025
2049
|
const port = Number(flagValue(args, "--port") || defaultPort());
|
|
2026
2050
|
const debug = args.includes("--verbose") || process.env.LAVISH_AXI_DEBUG === "1";
|
|
@@ -2238,6 +2262,7 @@ Usage:
|
|
|
2238
2262
|
lavish-axi end <html-file>
|
|
2239
2263
|
lavish-axi playbook [playbook_id]
|
|
2240
2264
|
lavish-axi design
|
|
2265
|
+
lavish-axi setup hooks
|
|
2241
2266
|
|
|
2242
2267
|
${DESIGN_SYSTEM_HINT}
|
|
2243
2268
|
|
|
@@ -2269,6 +2294,10 @@ Examples:
|
|
|
2269
2294
|
design: `Usage: lavish-axi design
|
|
2270
2295
|
|
|
2271
2296
|
Show a copy-pasteable CDN snippet for Tailwind CSS browser runtime v4 + DaisyUI v5 + themes, plus technical reference for DaisyUI components. Lavish artifacts stay portable HTML. Prefer the CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user. If the user asks for another design system or plain HTML, follow that request.
|
|
2297
|
+
`,
|
|
2298
|
+
setup: `Usage: lavish-axi setup hooks
|
|
2299
|
+
|
|
2300
|
+
Install or repair agent SessionStart hooks for lavish-axi ambient context in Claude Code, Codex, and OpenCode. Restart your agent session afterward to receive the context.
|
|
2272
2301
|
`,
|
|
2273
2302
|
server: `Usage: lavish-axi server [--port 4387] [--verbose]
|
|
2274
2303
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lavish-axi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@tailwindcss/browser": "4.2.4",
|
|
29
|
-
"axi-sdk-js": "^0.1.
|
|
29
|
+
"axi-sdk-js": "^0.1.7",
|
|
30
30
|
"chokidar": "^4.0.3",
|
|
31
31
|
"daisyui": "^5.5.19",
|
|
32
32
|
"express": "^5.2.1",
|