ponzu 1.58.0 → 1.59.0

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/dist/index.js CHANGED
@@ -33134,24 +33134,29 @@ var converseTools = [
33134
33134
  resolve: boolean2().optional()
33135
33135
  },
33136
33136
  async handler(args, ctx) {
33137
- const { design } = await resolveFile(ctx, args.file, [args.thread]);
33137
+ const { key, design } = await resolveFile(ctx, args.file, [args.thread]);
33138
33138
  const t = design.doc.threads.find((x) => x.id === args.thread);
33139
33139
  if (!t)
33140
33140
  throw new ToolError(`No thread ${args.thread}.`);
33141
+ const resolve = args.resolve && !ctx.ws.writing?.(key, t.id);
33141
33142
  const message = {
33142
33143
  id: newId("m"),
33143
33144
  author: ctx.caller.author,
33144
33145
  text: args.text,
33145
33146
  createdAt: Date.now()
33146
33147
  };
33147
- apply(design, args.resolve ? {
33148
+ apply(design, resolve ? {
33148
33149
  op: "batch",
33149
33150
  ops: [
33150
33151
  { op: "thread.message", id: t.id, message },
33151
33152
  { op: "thread.update", id: t.id, status: "resolved" }
33152
33153
  ]
33153
33154
  } : { op: "thread.message", id: t.id, message }, ctx);
33154
- return { text: `Replied${args.resolve ? " and resolved" : ""}.` };
33155
+ if (args.resolve && !resolve)
33156
+ return {
33157
+ text: "Replied, and left it open: the person is writing a reply in this thread. Their reply comes through wait_for_activity."
33158
+ };
33159
+ return { text: `Replied${resolve ? " and resolved" : ""}.` };
33155
33160
  }
33156
33161
  }),
33157
33162
  tool({
@@ -33161,9 +33166,11 @@ var converseTools = [
33161
33166
  description: "Resolve or reopen a thread without replying. Resolve a comment once you've done what it asked; that hides its pin from the canvas, and the change speaks for itself.",
33162
33167
  input: { file: fileArg, thread: string2(), status: _enum(["open", "resolved"]) },
33163
33168
  async handler(args, ctx) {
33164
- const { design } = await resolveFile(ctx, args.file, [args.thread]);
33169
+ const { key, design } = await resolveFile(ctx, args.file, [args.thread]);
33165
33170
  if (!design.doc.threads.some((t) => t.id === args.thread))
33166
33171
  throw new ToolError(`No thread ${args.thread}.`);
33172
+ if (args.status === "resolved" && ctx.ws.writing?.(key, args.thread))
33173
+ throw new ToolError(`The person is writing a reply in thread ${args.thread}, so it stays open. Their reply comes through wait_for_activity; resolve it once you've done what it asks.`, "person_writing");
33167
33174
  apply(design, { op: "thread.update", id: args.thread, status: args.status }, ctx);
33168
33175
  return { text: `Thread ${args.thread} is ${args.status}.` };
33169
33176
  }
@@ -33312,7 +33319,7 @@ Watching doesn't cut you off from chat. A message the person types reaches you a
33312
33319
  Batch comments that touch the same artboard.
33313
33320
  3. say what you're doing: set_status with a few words ("adding the autumn drop") and the artboards you're about to touch. The person sees a yuzu ring round the artboard and rain in its header, and your status when they hover the rain.
33314
33321
  4. do + check: edit, screenshot, fix lint. Variations go next to the original, never over it.
33315
- 5. close: for a change you made, set_comment_status resolved. That hides the pin; the canvas already shows the change, so don't reply.
33322
+ 5. close: for a change you made, set_comment_status resolved. That hides the pin; the canvas already shows the change, so don't reply. While the person is writing a reply in a thread it can't be resolved: leave it, and their reply comes in on a later wait.
33316
33323
  6. Go back to 1 with the new cursor. Waiting again clears your working indicator. Keep watching until the person says stop or you're interrupted.
33317
33324
 
33318
33325
  Reply only when the person needs to read something:
@@ -43549,6 +43556,7 @@ class LocalWorkspace {
43549
43556
  assetOrigin;
43550
43557
  opensIn;
43551
43558
  mac;
43559
+ writers = new Map;
43552
43560
  entries = new Map;
43553
43561
  opening = new Map;
43554
43562
  focusListeners = new Set;
@@ -43569,6 +43577,18 @@ class LocalWorkspace {
43569
43577
  get(key) {
43570
43578
  return this.entries.get(key)?.design;
43571
43579
  }
43580
+ setWriting(canvas, key, threads) {
43581
+ if (threads.length)
43582
+ this.writers.set(canvas, { key, threads: new Set(threads) });
43583
+ else
43584
+ this.writers.delete(canvas);
43585
+ }
43586
+ writing(key, thread) {
43587
+ for (const w of this.writers.values())
43588
+ if (w.key === key && w.threads.has(thread))
43589
+ return true;
43590
+ return false;
43591
+ }
43572
43592
  focus(key, artboard) {
43573
43593
  for (const l of this.focusListeners)
43574
43594
  l(key, artboard);
@@ -46464,6 +46484,7 @@ function serve(ws, opts = {}) {
46464
46484
  return;
46465
46485
  }
46466
46486
  sockets.delete(s);
46487
+ ws.setWriting(s, s.data.key, []);
46467
46488
  s.data.relay?.upstream?.close();
46468
46489
  },
46469
46490
  message(s, raw) {
@@ -46509,6 +46530,8 @@ function serve(ws, opts = {}) {
46509
46530
  send(s, { t: "ack", req: msg.req });
46510
46531
  } else if (msg.t === "theme" && (msg.theme === "light" || msg.theme === "dark")) {
46511
46532
  ws.theme = msg.theme;
46533
+ } else if (msg.t === "writing" && Array.isArray(msg.threads)) {
46534
+ ws.setWriting(s, s.data.key, msg.threads.filter((t) => typeof t === "string"));
46512
46535
  }
46513
46536
  } catch (err) {
46514
46537
  const req = "req" in msg ? msg.req : undefined;
@@ -46837,7 +46860,7 @@ function remoteUpdater(endpoint, token) {
46837
46860
  // apps/cli/package.json
46838
46861
  var package_default = {
46839
46862
  name: "ponzu",
46840
- version: "1.58.0",
46863
+ version: "1.59.0",
46841
46864
  description: "An open-source design canvas your coding agent drives with HTML and CSS.",
46842
46865
  type: "module",
46843
46866
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ponzu",
3
- "version": "1.58.0",
3
+ "version": "1.59.0",
4
4
  "description": "An open-source design canvas your coding agent drives with HTML and CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",