@mccaskie-labs/workbench-ai 0.4.0 → 0.4.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @mccaskie-labs/workbench-ai
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - `REPLY_SCRIPT` now defines its own `__name`, so Copy and Write it again work when the app is bundled by Wrangler (esbuild's keepNames wrapped its functions in `__name(...)`, which the browser doesn't have).
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  ### Minor Changes
@@ -32,5 +32,12 @@ export interface CopyDeps {
32
32
  export declare function copyReply(text: string, deps: CopyDeps): Promise<"copied" | "selected">;
33
33
  /** Runs on the page: wires every box's Copy button. Stringified into REPLY_SCRIPT, so it uses nothing from outside. */
34
34
  export declare function mountReplyBoxes(copy: typeof copyReply): void;
35
- /** The box's script: put it in the page under its nonce, after the boxes. */
35
+ /**
36
+ * The box's script: put it in the page under its nonce, after the boxes.
37
+ *
38
+ * It is the functions' own source, so whatever bundles the app's Worker shapes
39
+ * it. Wrangler's esbuild keeps function names by wrapping them in `__name(…)`,
40
+ * a helper that exists only in the bundle, so the script brings a stand-in of
41
+ * its own: without it the box's buttons do nothing.
42
+ */
36
43
  export declare const REPLY_SCRIPT: string;
package/dist/reply-ui.js CHANGED
@@ -142,5 +142,12 @@ export function mountReplyBoxes(copy) {
142
142
  });
143
143
  }
144
144
  }
145
- /** The box's script: put it in the page under its nonce, after the boxes. */
146
- export const REPLY_SCRIPT = `(${mountReplyBoxes.toString()})(${copyReply.toString()});`;
145
+ /**
146
+ * The box's script: put it in the page under its nonce, after the boxes.
147
+ *
148
+ * It is the functions' own source, so whatever bundles the app's Worker shapes
149
+ * it. Wrangler's esbuild keeps function names by wrapping them in `__name(…)`,
150
+ * a helper that exists only in the bundle, so the script brings a stand-in of
151
+ * its own: without it the box's buttons do nothing.
152
+ */
153
+ export const REPLY_SCRIPT = `(function(){var __name=function(f){return f};(${mountReplyBoxes.toString()})(${copyReply.toString()});})();`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mccaskie-labs/workbench-ai",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Claude through the Workbench Gateway: text, structured output, streaming, budget status and reply drafts whose facts are checked by code, with no Anthropic key in the app. Refusals and truncations throw; createFakeAi for tests.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -55,6 +55,7 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "24.19.2",
58
+ "esbuild": "0.28.2",
58
59
  "vitest": "^5.1.0",
59
60
  "zod": "4.6.7"
60
61
  }