agent-canvas 0.1.24 → 0.1.25

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.
@@ -54,14 +54,14 @@ export async function handlePush(args: string[]) {
54
54
 
55
55
  let result = await response.json() as any;
56
56
 
57
- // Bun.build() can corrupt internal state in long-running daemons,
58
- // throwing opaque errors like "Bundle failed" or "Unknown Error".
59
- // Restart and retry once — but not for clear syntax errors (which
60
- // now have precise line/col info from the transpiler pre-check).
61
- const isBundlerCrash = !result.ok && result.error === "Canvas compilation failed"
62
- && result.errors && Object.values(result.errors).some((e: any) =>
63
- typeof e === "string" && (e === "Bundle failed" || e.includes("Unknown Error")));
64
- if (isBundlerCrash) {
57
+ // Bun.build() / Bun.Transpiler can fail in long-running daemons due to
58
+ // internal state corruption, CWD unlinking, etc. Restart and retry once.
59
+ // Skip restart only for clear user errors (syntax errors with line/col,
60
+ // runtime validation errors) — those won't be fixed by a restart.
61
+ const isUserError = !result.ok && result.errors && Object.values(result.errors).every((e: any) =>
62
+ typeof e === "string" && (/\(line \d+, col \d+\)/.test(e) || e.startsWith("Runtime error:")));
63
+ const shouldRestart = !result.ok && result.error === "Canvas compilation failed" && !isUserError;
64
+ if (shouldRestart) {
65
65
  console.error("Compilation failed, restarting daemon and retrying...");
66
66
  stopDaemon();
67
67
  await startDaemon();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-canvas",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "Interactive visual canvas for Claude Code — rich annotatable documents in the browser",
5
5
  "bin": {
6
6
  "agent-canvas": "bin/agent-canvas.js"