plotcoder-board 0.1.39 → 0.1.40

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
@@ -107,4 +107,4 @@ next round into a test of `claim_account` instead of the door it meant to test.
107
107
 
108
108
  ## Status
109
109
 
110
- Version 0.1.39. A project of boards; sign in with your email and a password from the PlotCoder mark and your projects follow you to every device, share one with another writer by email and write it together live, or stay signed out and work on this device as before. Pages sit beside the wall: a scene's text lives on its card, measures it, paginates to the industry's rules, prints, goes out and comes in as Fountain or Final Draft, and goes out as Markdown or plain text for a collaborator in Google Docs. It installs as a progressive web app and opens offline; plotcoder.com serves over HTTPS. The wall, beats, card length, groups, arrows, pan and zoom, save and open, and the agent surface are in use.
110
+ Version 0.1.40. A project of boards; sign in with your email and a password from the PlotCoder mark and your projects follow you to every device, share one with another writer by email and write it together live, or stay signed out and work on this device as before. Pages sit beside the wall: a scene's text lives on its card, measures it, paginates to the industry's rules, prints, goes out and comes in as Fountain or Final Draft, and goes out as Markdown or plain text for a collaborator in Google Docs. It installs as a progressive web app and opens offline; plotcoder.com serves over HTTPS. The wall, beats, card length, groups, arrows, pan and zoom, save and open, and the agent surface are in use.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotcoder-board",
3
- "version": "0.1.39",
3
+ "version": "0.1.40",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -4062,7 +4062,14 @@ async function questionsDoor() {
4062
4062
  const key = process.env.SUPABASE_SERVICE_ROLE_KEY || process.env.PLOTCODER_SERVICE_ROLE_KEY;
4063
4063
  if (!key) return null;
4064
4064
  const { createClient } = await import("@supabase/supabase-js");
4065
- return createClient(process.env.SUPABASE_URL || SUPABASE_URL, key, { auth: { persistSession: false } });
4065
+ // Node 20 has no native WebSocket; the realtime client wants one even when unused, as the account door knows.
4066
+ let transport;
4067
+ try {
4068
+ transport = (await import("ws")).default;
4069
+ } catch {
4070
+ transport = undefined;
4071
+ }
4072
+ return createClient(process.env.SUPABASE_URL || SUPABASE_URL, key, { auth: { persistSession: false }, ...(transport ? { realtime: { transport } } : {}) });
4066
4073
  }
4067
4074
  const NO_QUESTIONS_DOOR = "The questions are the app's, not a project's: set SUPABASE_SERVICE_ROLE_KEY in the server's environment — the maintainer's key, never in the repo — and call again. A writer asks from the Help sheet; the answer goes into public/writers.html and back to them through answer_question.";
4068
4075
 
@@ -4100,8 +4107,11 @@ server.registerTool(
4100
4107
  async (args) => {
4101
4108
  const db = await questionsDoor();
4102
4109
  if (!db) return ok(NO_QUESTIONS_DOOR);
4103
- const { data: found, error: findError } = await db.from("questions").select("id, question, answered_at").ilike("id", `${args.id}%`);
4110
+ // A uuid takes no pattern match in Postgres; the prefix is matched here, as list_questions prints it.
4111
+ const { data: rows, error: findError } = await db.from("questions").select("id, question, answered_at");
4104
4112
  if (findError) return ok(`Could not read the questions: ${findError.message}`);
4113
+ const wantedId = args.id.trim().toLowerCase();
4114
+ const found = (rows ?? []).filter((row) => String(row.id).toLowerCase().startsWith(wantedId));
4105
4115
  if (!found?.length) return ok(`No question whose id starts "${args.id}". list_questions shows them.`);
4106
4116
  if (found.length > 1) return ok(`${found.length} questions start "${args.id}": say more of the id.`);
4107
4117
  const row = found[0];