lavish-axi 0.1.86 → 0.1.87

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
@@ -250,7 +250,7 @@ pnpm link
250
250
  Each library carries its author's terms (AWS Architecture Icons, for example, are covered by AWS's own usage terms), so check them before using one.
251
251
  - **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.
252
252
  Set `LAVISH_AXI_IDLE_TIMEOUT_MS=0` or `off` to disable idle self-shutdown.
253
- - **Server upgrades** - One background server serves every session, so upgrading `lavish-axi` while reviews are open makes the next `lavish-axi <html-file>` replace that server. Only the review page for the artifact being opened reloads itself once the replacement answers - and not even that one while you have unsent annotation text open, which gets the same banner instead so the reload is yours to make. Every other open review page keeps working and shows a banner reading "Lavish was updated. This page is running the previous version.", with a Check and reload button and a Dismiss button, so no page you are reading reloads on its own. After `lavish-axi stop` those pages say Lavish was stopped and to reload after you start it again, and a restart that only picks up a local build says that rather than claiming an update. An open review page whose server simply goes away - idle self-shutdown, a crash, a machine that slept - shows that same banner once reconnecting has failed for a few seconds, rather than retrying a dead server silently while looking fine; it clears itself if the server comes back, and dismissing it keeps it dismissed until then.
253
+ - **Server upgrades** - One background server serves every session, so upgrading `lavish-axi` while reviews are open makes the next `lavish-axi <html-file>` replace that server. Only a newer CLI replaces an older server: a CLI older than the running server uses it as is, so two installed versions on one machine do not restart each other's server. Releases up to and including 0.1.86 still replace a server of a different version, so this turn-by-turn restart stops only when both installed versions contain this fix. Only the review page for the artifact being opened reloads itself once the replacement answers - and not even that one while you have unsent annotation text open, which gets the same banner instead so the reload is yours to make. Every other open review page keeps working and shows a banner reading "Lavish was updated. This page is running the previous version.", with a Check and reload button and a Dismiss button, so no page you are reading reloads on its own. After `lavish-axi stop` those pages say Lavish was stopped and to reload after you start it again, and a restart that only picks up a local build says that rather than claiming an update. An open review page whose server simply goes away - idle self-shutdown, a crash, a machine that slept - shows that same banner once reconnecting has failed for a few seconds, rather than retrying a dead server silently while looking fine; it clears itself if the server comes back, and dismissing it keeps it dismissed until then.
254
254
  A page still using the legacy event stream reloads once when it reconnects to the replacement server, moving itself onto the current transport without retaining an HTTP connection. If unsent annotation text is open, it shows the neutral server-restarted banner instead and waits for you to reload.
255
255
  Every **Check and reload** control asks the server whether it is running before it navigates; while nothing answers, the page stays where it is and says so, and a check that gets no answer at all says that instead of guessing.
256
256
  In-flight `lavish-axi poll` commands end with an interrupted-poll error and are safe to re-run; queued feedback is never lost, and annotation text you have typed but not queued yet survives the reload as described under **Live reload**.
package/dist/cli.mjs CHANGED
@@ -12774,7 +12774,7 @@ var AGENT_REPLY_INPUT_LIMIT_BYTES = AGENT_REPLY_JSON_LIMIT_BYTES - AGENT_REPLY_J
12774
12774
  var AGENT_REPLY_LIMIT_LABEL = "2 MB JSON request limit";
12775
12775
  var POLL_STATE_HEADER = "lavish-poll-state";
12776
12776
  var CODEX_POLL_WAKE_PATH_GUIDANCE = "Codex detected: completed background tasks may not resume Codex automatically, so keep the poll attached to the active turn.";
12777
- var VERSION = "0.1.86";
12777
+ var VERSION = "0.1.87";
12778
12778
  function detectInvokingAgent(env = process.env) {
12779
12779
  return ["CODEX_SANDBOX", "CODEX_THREAD_ID"].some((key) => Object.hasOwn(env, key)) ? "codex" : "generic";
12780
12780
  }
@@ -14189,7 +14189,7 @@ async function ensureServer({ forceRestart = false, reloadKey = "" } = {}) {
14189
14189
  }
14190
14190
  }
14191
14191
  await startServer(port, { alsoListen });
14192
- const replacedForNetwork = Boolean(existing) && existing.app === "lavish-axi" && existing.network_stale === true && !forceRestart && typeof existing.version === "string" && existing.version === VERSION;
14192
+ const replacedForNetwork = Boolean(existing) && existing.app === "lavish-axi" && existing.network_stale === true && !forceRestart && typeof existing.version === "string" && !isServerOlderThanCli(VERSION, existing.version);
14193
14193
  let networkRestarted = replacedForNetwork;
14194
14194
  let raceRestarted = false;
14195
14195
  let deadline = Date.now() + 5e3;
@@ -14252,12 +14252,26 @@ function shouldRestartServer(currentVersion, healthBody, forceRestart = false) {
14252
14252
  if (forceRestart && healthBody.app === "lavish-axi") return true;
14253
14253
  if (healthBody.network_stale === true && healthBody.app === "lavish-axi") return true;
14254
14254
  if (typeof healthBody.version !== "string" || healthBody.version === "") return true;
14255
- return healthBody.version !== currentVersion;
14255
+ return isServerOlderThanCli(currentVersion, healthBody.version);
14256
+ }
14257
+ function isServerOlderThanCli(currentVersion, runningVersion) {
14258
+ if (runningVersion === currentVersion) return false;
14259
+ const current = parseReleaseVersion(currentVersion);
14260
+ const running = parseReleaseVersion(runningVersion);
14261
+ if (!current || !running) return true;
14262
+ for (let index = 0; index < 3; index += 1) {
14263
+ if (running[index] !== current[index]) return running[index] < current[index];
14264
+ }
14265
+ return false;
14266
+ }
14267
+ function parseReleaseVersion(version) {
14268
+ const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(String(version));
14269
+ return match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;
14256
14270
  }
14257
14271
  function serverReplacementReason(currentVersion, healthBody, forceRestart = false) {
14258
14272
  if (!shouldRestartServer(currentVersion, healthBody, forceRestart)) return "";
14259
14273
  const runningVersion = healthBody.version;
14260
- if (typeof runningVersion !== "string" || runningVersion === "" || runningVersion !== currentVersion) {
14274
+ if (typeof runningVersion !== "string" || runningVersion === "" || isServerOlderThanCli(currentVersion, runningVersion)) {
14261
14275
  return "upgrade";
14262
14276
  }
14263
14277
  return forceRestart ? "local-build" : "";
@@ -14273,7 +14287,7 @@ function shouldKillProcessOnPort(currentVersion, healthBody) {
14273
14287
  if (!healthBody || typeof healthBody !== "object") return false;
14274
14288
  if (typeof healthBody.version !== "string" || healthBody.version === "") return true;
14275
14289
  if (healthBody.app !== "lavish-axi") return false;
14276
- return healthBody.version !== currentVersion;
14290
+ return isServerOlderThanCli(currentVersion, healthBody.version);
14277
14291
  }
14278
14292
  async function canControlServerOnPort(baseUrl, healthBody, processMatchesLavish) {
14279
14293
  if (!healthBody || typeof healthBody !== "object") return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavish-axi",
3
- "version": "0.1.86",
3
+ "version": "0.1.87",
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",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "lavish-axi",
4
- "version": "0.1.86",
4
+ "version": "0.1.87",
5
5
  "description": "HTML is the new markdown. Lavish is the new editor for your HTML artifacts.",
6
6
  "author": {
7
7
  "name": "Kun Chen",