lavish-axi 0.1.14 → 0.1.16
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 +2 -2
- package/dist/chrome-client.js +9 -1
- package/dist/cli.mjs +20 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,9 +95,9 @@ pnpm link
|
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
- **File-path identity** - Sessions are keyed by the canonical HTML file path, so agents do not need opaque IDs.
|
|
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.
|
|
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. Choose a design system in priority order: follow a user-requested look first, match the current project's design system or conventions next, and otherwise run `lavish-axi design` for a copy-pasteable Tailwind CSS v4 + DaisyUI v5 CDN fallback.
|
|
99
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.
|
|
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
|
+
- **Live reload** - Lavish watches the HTML artifact file by default and preserves the artifact iframe scroll position across reloads. 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">`.
|
|
101
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.
|
|
102
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.
|
|
103
103
|
- **Precise targets** - Text annotations include selected text plus range anchors, so agents are not limited to whole-element selectors.
|
package/dist/chrome-client.js
CHANGED
|
@@ -24,6 +24,7 @@ let pendingSnapshot = "";
|
|
|
24
24
|
let workingBubble = null;
|
|
25
25
|
let submitQueuedPromise = null;
|
|
26
26
|
let submitQueuedAgain = false;
|
|
27
|
+
let lastScroll = { x: 0, y: 0 };
|
|
27
28
|
|
|
28
29
|
function escapeHtml(value) {
|
|
29
30
|
return String(value).replace(
|
|
@@ -244,6 +245,9 @@ window.addEventListener("message", (event) => {
|
|
|
244
245
|
pendingSnapshot = msg.snapshot || "";
|
|
245
246
|
submitQueued();
|
|
246
247
|
}
|
|
248
|
+
if (msg.type === "lavish:scroll") {
|
|
249
|
+
lastScroll = { x: Number(msg.x) || 0, y: Number(msg.y) || 0 };
|
|
250
|
+
}
|
|
247
251
|
if (msg.type === "lavish:sendQueuedPrompts") sendQueued();
|
|
248
252
|
if (msg.type === "lavish:endSession") endSession();
|
|
249
253
|
});
|
|
@@ -258,7 +262,11 @@ annotationButton.onclick = () => {
|
|
|
258
262
|
sendButton.onclick = sendQueued;
|
|
259
263
|
copyPathButton.onclick = copyFilePath;
|
|
260
264
|
endButton.onclick = endSession;
|
|
261
|
-
frame.addEventListener("load", () =>
|
|
265
|
+
frame.addEventListener("load", () => {
|
|
266
|
+
postToFrame({ type: "lavish:setAnnotationMode", enabled: annotation });
|
|
267
|
+
// Replay the pre-reload scroll position so hot reloads don't jump the artifact to the top.
|
|
268
|
+
postToFrame({ type: "lavish:restoreScroll", x: lastScroll.x, y: lastScroll.y });
|
|
269
|
+
});
|
|
262
270
|
|
|
263
271
|
const events = new EventSource("/events/" + key);
|
|
264
272
|
events.addEventListener("reload", () => {
|
package/dist/cli.mjs
CHANGED
|
@@ -20,7 +20,7 @@ var DESIGN_CDN_URLS = {
|
|
|
20
20
|
var DESIGN_CDN_SNIPPET = `<link rel="stylesheet" href="${DESIGN_CDN_URLS.daisyui}">
|
|
21
21
|
<link rel="stylesheet" href="${DESIGN_CDN_URLS.daisyuiThemes}">
|
|
22
22
|
<script src="${DESIGN_CDN_URLS.tailwind}"></script>`;
|
|
23
|
-
var DESIGN_SYSTEM_HINT = "Lavish does not auto-inject any design system - artifacts stay portable so they render identically when opened directly without lavish-axi running. Tailwind CSS browser runtime v4
|
|
23
|
+
var DESIGN_SYSTEM_HINT = "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 `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.";
|
|
24
24
|
var DAISYUI_THEMES = [
|
|
25
25
|
"light",
|
|
26
26
|
"dark",
|
|
@@ -61,7 +61,7 @@ var DAISYUI_THEMES = [
|
|
|
61
61
|
function createDesignOutput() {
|
|
62
62
|
return {
|
|
63
63
|
design: {
|
|
64
|
-
summary: "Lavish does not auto-inject any design system. Artifacts stay portable HTML.
|
|
64
|
+
summary: "Lavish does not auto-inject any design system. Artifacts stay portable HTML. 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 ships a design system or style conventions, match those; (3) otherwise, prefer the Lavish-recommended Tailwind CSS browser runtime v4 + DaisyUI v5 + themes - paste the CDN snippet below into your `<head>`. Prefer this CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user.",
|
|
65
65
|
cdn_snippet: DESIGN_CDN_SNIPPET,
|
|
66
66
|
cdn_urls: DESIGN_CDN_URLS,
|
|
67
67
|
versions: { tailwind: TAILWIND_BROWSER_VERSION, daisyui: DAISYUI_VERSION },
|
|
@@ -955,7 +955,22 @@ function createArtifactSdk() {
|
|
|
955
955
|
if (msg.type === "lavish:requestSnapshot") {
|
|
956
956
|
parent.postMessage({ type: "lavish:snapshot", snapshot: snapshot() }, "*");
|
|
957
957
|
}
|
|
958
|
+
if (msg.type === "lavish:restoreScroll") {
|
|
959
|
+
window.scrollTo(Number(msg.x) || 0, Number(msg.y) || 0);
|
|
960
|
+
}
|
|
958
961
|
});
|
|
962
|
+
let scrollFrame = 0;
|
|
963
|
+
window.addEventListener(
|
|
964
|
+
"scroll",
|
|
965
|
+
() => {
|
|
966
|
+
if (scrollFrame) return;
|
|
967
|
+
scrollFrame = window.requestAnimationFrame(() => {
|
|
968
|
+
scrollFrame = 0;
|
|
969
|
+
parent.postMessage({ type: "lavish:scroll", x: window.scrollX, y: window.scrollY }, "*");
|
|
970
|
+
});
|
|
971
|
+
},
|
|
972
|
+
{ passive: true }
|
|
973
|
+
);
|
|
959
974
|
document.addEventListener(
|
|
960
975
|
"mouseover",
|
|
961
976
|
(event) => {
|
|
@@ -1747,7 +1762,7 @@ var HttpTelemetryClient = class {
|
|
|
1747
1762
|
await Promise.race([
|
|
1748
1763
|
drained,
|
|
1749
1764
|
new Promise((resolve) => {
|
|
1750
|
-
setTimeout(resolve, timeoutMs)
|
|
1765
|
+
setTimeout(resolve, timeoutMs);
|
|
1751
1766
|
})
|
|
1752
1767
|
]);
|
|
1753
1768
|
}
|
|
@@ -1822,7 +1837,7 @@ function normalizePagePath(path5) {
|
|
|
1822
1837
|
// src/cli.js
|
|
1823
1838
|
var COMMANDS = /* @__PURE__ */ new Set(["open", "poll", "end", "server", "playbook", "design", "setup"]);
|
|
1824
1839
|
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.
|
|
1840
|
+
var VERSION = "0.1.16";
|
|
1826
1841
|
async function run(argv) {
|
|
1827
1842
|
await ensureStateDir();
|
|
1828
1843
|
const normalizedArgv = normalizeArgv(argv);
|
|
@@ -2293,7 +2308,7 @@ Examples:
|
|
|
2293
2308
|
`,
|
|
2294
2309
|
design: `Usage: lavish-axi design
|
|
2295
2310
|
|
|
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.
|
|
2311
|
+
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. 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; (3) otherwise, prefer the Lavish-recommended Tailwind + DaisyUI CDN snippet over hand-writing styles unless explicitly instructed otherwise by the user.
|
|
2297
2312
|
`,
|
|
2298
2313
|
setup: `Usage: lavish-axi setup hooks
|
|
2299
2314
|
|