@1agh/maude 1.6.5 → 1.6.6

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.
@@ -1003,6 +1003,37 @@ export function cacheControlFor(absPath: string): { cacheControl: string; addEta
1003
1003
  return { cacheControl: 'no-cache', addEtag: true };
1004
1004
  }
1005
1005
 
1006
+ /**
1007
+ * The studio page, with its bundle and stylesheet URLs VERSIONED.
1008
+ *
1009
+ * `/_client/client.bundle.js` used to be a fixed URL answered `no-cache`. Behind
1010
+ * Cloudflare that header does not survive: the zone's default Browser Cache
1011
+ * TTL turns a `.js` into `max-age=14400`, so after a release a cloud user ran
1012
+ * the previous client for up to four hours, against a server that had moved on
1013
+ * (measured on alligators after v1.6.5: new server, old bundle, none of the
1014
+ * release's UI). A query that changes whenever the built file does makes every
1015
+ * cache, ours or anyone's in front of us, fetch it again. `serveFile` ignores
1016
+ * the query, so the old URL keeps working for anything that still asks for it.
1017
+ */
1018
+ export async function serveIndexHtml(): Promise<Response> {
1019
+ const index = Bun.file(join(CLIENT_DIR, 'index.html'));
1020
+ if (!(await index.exists())) return new Response('Not found', { status: 404 });
1021
+ let html = await index.text();
1022
+ for (const name of ['client.bundle.js', 'styles.css']) {
1023
+ const built = Bun.file(join(DIST_DIR, name));
1024
+ if (!(await built.exists())) continue;
1025
+ const v = `${built.size.toString(16)}-${Math.trunc(built.lastModified).toString(16)}`;
1026
+ html = html.replaceAll(`"/_client/${name}"`, `"/_client/${name}?v=${v}"`);
1027
+ }
1028
+ return new Response(html, {
1029
+ headers: {
1030
+ 'Content-Type': 'text/html; charset=utf-8',
1031
+ 'Cache-Control': 'no-cache',
1032
+ 'X-Content-Type-Options': 'nosniff',
1033
+ },
1034
+ });
1035
+ }
1036
+
1006
1037
  /** A weak validator from the file's own metadata — no read, no hash. */
1007
1038
  function etagFor(file: { size: number; lastModified: number }): string {
1008
1039
  return `W/"${file.size.toString(16)}-${Math.trunc(file.lastModified).toString(16)}"`;
@@ -5671,8 +5702,8 @@ export function createHttp(
5671
5702
  return new Response(null, { status: 204 });
5672
5703
  },
5673
5704
 
5674
- '/': () => serveFile(join(CLIENT_DIR, 'index.html')),
5675
- '/index.html': () => serveFile(join(CLIENT_DIR, 'index.html')),
5705
+ '/': () => serveIndexHtml(),
5706
+ '/index.html': () => serveIndexHtml(),
5676
5707
  } satisfies Record<string, (req: Request) => Response | Promise<Response>>;
5677
5708
 
5678
5709
  // Named `handleFallthrough`, not `fetch` — a same-named local function shadows
@@ -5954,7 +5985,18 @@ export function createHttp(
5954
5985
  }
5955
5986
 
5956
5987
  async function serveCanvasShell(applyCsp: boolean, capture = false): Promise<Response> {
5957
- const shellHtml = await Bun.file(join(TEMPLATES_DIR, '_shell.html')).text();
5988
+ // `comment-mount.js` is versioned for the same reason as the studio page's
5989
+ // bundle (see `serveIndexHtml`): a fixed URL outlives a release in any
5990
+ // cache in front of the canvas origin. Replaced BEFORE the CSP hashes are
5991
+ // taken over the inline scripts, so the policy matches what is served.
5992
+ const mount = Bun.file(join(DIST_DIR, 'comment-mount.js'));
5993
+ const mountV = (await mount.exists())
5994
+ ? `?v=${mount.size.toString(16)}-${Math.trunc(mount.lastModified).toString(16)}`
5995
+ : '';
5996
+ const shellHtml = (await Bun.file(join(TEMPLATES_DIR, '_shell.html')).text()).replace(
5997
+ "'/_client/comment-mount.js'",
5998
+ `'/_client/comment-mount.js${mountV}'`
5999
+ );
5958
6000
  // Inject inspector overlay — Cmd+Click selection + add-comment flow.
5959
6001
  const injected = inspect().injectInspector(shellHtml);
5960
6002
  const headers: Record<string, string> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1agh/maude",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "Marketplace of Claude Code plugins by Michal Dovrtěl: `design` (canvas-first design iteration) + `flow` (generic agentic workflow loop with .ai second brain). Ships the `maude` CLI (with `mdcc` legacy alias) to scaffold workspace, run the design dev server, and manage configs.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -58,13 +58,13 @@
58
58
  "test:e2e:desktop:parity:cloud": "pnpm --filter @maude/desktop-e2e e2e:parity:cloud"
59
59
  },
60
60
  "optionalDependencies": {
61
- "@1agh/maude-darwin-arm64": "1.6.5",
62
- "@1agh/maude-darwin-x64": "1.6.5",
63
- "@1agh/maude-linux-arm64": "1.6.5",
64
- "@1agh/maude-linux-arm64-musl": "1.6.5",
65
- "@1agh/maude-linux-x64": "1.6.5",
66
- "@1agh/maude-linux-x64-musl": "1.6.5",
67
- "@1agh/maude-win32-x64": "1.6.5"
61
+ "@1agh/maude-darwin-arm64": "1.6.6",
62
+ "@1agh/maude-darwin-x64": "1.6.6",
63
+ "@1agh/maude-linux-arm64": "1.6.6",
64
+ "@1agh/maude-linux-arm64-musl": "1.6.6",
65
+ "@1agh/maude-linux-x64": "1.6.6",
66
+ "@1agh/maude-linux-x64-musl": "1.6.6",
67
+ "@1agh/maude-win32-x64": "1.6.6"
68
68
  },
69
69
  "files": [
70
70
  "cli",