plures 1.13.0 → 1.14.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.
@@ -1,5 +1,5 @@
1
1
  // src/index.ts
2
- var VERSION = "1.13.0";
2
+ var VERSION = "1.14.0";
3
3
  var PluresError = class extends Error {
4
4
  constructor(message, status, type) {
5
5
  super(message);
package/dist/cli.cjs CHANGED
@@ -30,7 +30,7 @@ var import_node_path = require("path");
30
30
  var import_node_fs = require("fs");
31
31
 
32
32
  // src/index.ts
33
- var VERSION = "1.13.0";
33
+ var VERSION = "1.14.0";
34
34
  var PluresError = class extends Error {
35
35
  constructor(message, status, type) {
36
36
  super(message);
@@ -506,7 +506,8 @@ With plures-mcp connected, just ask: ${cyan("Map this app for Plures")}`);
506
506
  `);
507
507
  const prompt = `${guide}
508
508
 
509
- Write the map to ${FILE} in the current directory now. Read the code; don't run it or change anything else.`;
509
+ Write the map to ${FILE} in the current directory now, as JSON, with the Write tool. Read the code; don't run it or change anything else. Don't write a script to generate the map: you can't run scripts or other commands here, so write the JSON itself.`;
510
+ const nudge = `${FILE} doesn't exist yet. Write it now with the Write tool: the complete map as JSON, directly. You can't run scripts or commands here, so don't write one. Use what you've already read.`;
510
511
  const live = key ? client() : null;
511
512
  const session = (0, import_node_crypto.randomBytes)(12).toString("base64url");
512
513
  const source = process.env.GITHUB_ACTIONS ? "github" : "cli";
@@ -532,8 +533,8 @@ Write the map to ${FILE} in the current directory now. Read the code; don't run
532
533
  let result = "";
533
534
  const ticker = fancy ? liveLine() : null;
534
535
  ticker?.start();
535
- const code = await new Promise((resolve) => {
536
- const p = (0, import_node_child_process.spawn)("claude", ["-p", prompt, "--output-format", "stream-json", "--verbose", "--allowedTools", "Read,Grep,Glob,Write,Bash(git rev-parse:*),Bash(git remote:*)"], { stdio: ["ignore", "pipe", "inherit"], env: childEnv });
536
+ const runClaude = (args) => new Promise((resolve) => {
537
+ const p = (0, import_node_child_process.spawn)("claude", [...args, "--output-format", "stream-json", "--verbose", "--allowedTools", "Read,Grep,Glob,Write,Bash(git rev-parse:*),Bash(git remote:*)"], { stdio: ["ignore", "pipe", "inherit"], env: childEnv });
537
538
  let buf = "";
538
539
  p.stdout.on("data", (chunk) => {
539
540
  buf += chunk.toString();
@@ -569,18 +570,21 @@ Write the map to ${FILE} in the current directory now. Read the code; don't run
569
570
  p.on("close", (n) => resolve(n ?? 1));
570
571
  p.on("error", () => resolve(1));
571
572
  });
573
+ const wrote = () => (0, import_node_fs.existsSync)(FILE) && (0, import_node_fs.statSync)(FILE).mtimeMs !== before;
574
+ let code = await runClaude(["-p", prompt]);
575
+ if (!wrote()) code = await runClaude(["-p", nudge, "--continue"]);
572
576
  clearInterval(tick);
573
577
  ticker?.stop();
574
578
  if (result && !fancy) console.log(`
575
579
  ${result.trim()}
576
580
  `);
577
581
  if (fancy) console.log(` ${cyan("\u2713")} ${reads} ${reads === 1 ? "file" : "files"} read. ${dim("Sending the map to Plures. No source code is sent.")}`);
578
- const ok = code === 0 && (0, import_node_fs.existsSync)(FILE) && (0, import_node_fs.statSync)(FILE).mtimeMs !== before;
582
+ const ok = code === 0 && wrote();
579
583
  if (!ok) {
580
584
  phase = "failed";
581
585
  await flush();
582
586
  } else await flush();
583
- if (code !== 0 || !(0, import_node_fs.existsSync)(FILE) || (0, import_node_fs.statSync)(FILE).mtimeMs === before) die(`Claude Code didn't write ${FILE}. Ask it directly, then run npx plures map upload.`);
587
+ if (!ok) die(`Claude Code didn't write ${FILE}${process.env.CI ? ". This run costs nothing." : `. Ask it directly, then run npx plures map upload.`}`);
584
588
  await upload(FILE);
585
589
  }
586
590
  async function workflow() {
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Plures,
4
4
  PluresError,
5
5
  VERSION
6
- } from "./chunk-GIOZT6FB.js";
6
+ } from "./chunk-7OMKME5Z.js";
7
7
 
8
8
  // src/cli.ts
9
9
  import { spawnSync, spawn } from "child_process";
@@ -288,7 +288,8 @@ With plures-mcp connected, just ask: ${cyan("Map this app for Plures")}`);
288
288
  `);
289
289
  const prompt = `${guide}
290
290
 
291
- Write the map to ${FILE} in the current directory now. Read the code; don't run it or change anything else.`;
291
+ Write the map to ${FILE} in the current directory now, as JSON, with the Write tool. Read the code; don't run it or change anything else. Don't write a script to generate the map: you can't run scripts or other commands here, so write the JSON itself.`;
292
+ const nudge = `${FILE} doesn't exist yet. Write it now with the Write tool: the complete map as JSON, directly. You can't run scripts or commands here, so don't write one. Use what you've already read.`;
292
293
  const live = key ? client() : null;
293
294
  const session = randomBytes(12).toString("base64url");
294
295
  const source = process.env.GITHUB_ACTIONS ? "github" : "cli";
@@ -314,8 +315,8 @@ Write the map to ${FILE} in the current directory now. Read the code; don't run
314
315
  let result = "";
315
316
  const ticker = fancy ? liveLine() : null;
316
317
  ticker?.start();
317
- const code = await new Promise((resolve) => {
318
- const p = spawn("claude", ["-p", prompt, "--output-format", "stream-json", "--verbose", "--allowedTools", "Read,Grep,Glob,Write,Bash(git rev-parse:*),Bash(git remote:*)"], { stdio: ["ignore", "pipe", "inherit"], env: childEnv });
318
+ const runClaude = (args) => new Promise((resolve) => {
319
+ const p = spawn("claude", [...args, "--output-format", "stream-json", "--verbose", "--allowedTools", "Read,Grep,Glob,Write,Bash(git rev-parse:*),Bash(git remote:*)"], { stdio: ["ignore", "pipe", "inherit"], env: childEnv });
319
320
  let buf = "";
320
321
  p.stdout.on("data", (chunk) => {
321
322
  buf += chunk.toString();
@@ -351,18 +352,21 @@ Write the map to ${FILE} in the current directory now. Read the code; don't run
351
352
  p.on("close", (n) => resolve(n ?? 1));
352
353
  p.on("error", () => resolve(1));
353
354
  });
355
+ const wrote = () => existsSync(FILE) && statSync(FILE).mtimeMs !== before;
356
+ let code = await runClaude(["-p", prompt]);
357
+ if (!wrote()) code = await runClaude(["-p", nudge, "--continue"]);
354
358
  clearInterval(tick);
355
359
  ticker?.stop();
356
360
  if (result && !fancy) console.log(`
357
361
  ${result.trim()}
358
362
  `);
359
363
  if (fancy) console.log(` ${cyan("\u2713")} ${reads} ${reads === 1 ? "file" : "files"} read. ${dim("Sending the map to Plures. No source code is sent.")}`);
360
- const ok = code === 0 && existsSync(FILE) && statSync(FILE).mtimeMs !== before;
364
+ const ok = code === 0 && wrote();
361
365
  if (!ok) {
362
366
  phase = "failed";
363
367
  await flush();
364
368
  } else await flush();
365
- if (code !== 0 || !existsSync(FILE) || statSync(FILE).mtimeMs === before) die(`Claude Code didn't write ${FILE}. Ask it directly, then run npx plures map upload.`);
369
+ if (!ok) die(`Claude Code didn't write ${FILE}${process.env.CI ? ". This run costs nothing." : `. Ask it directly, then run npx plures map upload.`}`);
366
370
  await upload(FILE);
367
371
  }
368
372
  async function workflow() {
package/dist/index.cjs CHANGED
@@ -26,7 +26,7 @@ __export(index_exports, {
26
26
  default: () => index_default
27
27
  });
28
28
  module.exports = __toCommonJS(index_exports);
29
- var VERSION = "1.13.0";
29
+ var VERSION = "1.14.0";
30
30
  var PluresError = class extends Error {
31
31
  constructor(message, status, type) {
32
32
  super(message);
package/dist/index.d.cts CHANGED
@@ -350,7 +350,7 @@ type WebhookEvent = {
350
350
  created_at: string;
351
351
  data: Task;
352
352
  };
353
- declare const VERSION = "1.13.0";
353
+ declare const VERSION = "1.14.0";
354
354
  type GitHubLink = {
355
355
  object: "github_link";
356
356
  app: string;
package/dist/index.d.ts CHANGED
@@ -350,7 +350,7 @@ type WebhookEvent = {
350
350
  created_at: string;
351
351
  data: Task;
352
352
  };
353
- declare const VERSION = "1.13.0";
353
+ declare const VERSION = "1.14.0";
354
354
  type GitHubLink = {
355
355
  object: "github_link";
356
356
  app: string;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  PluresError,
4
4
  VERSION,
5
5
  index_default
6
- } from "./chunk-GIOZT6FB.js";
6
+ } from "./chunk-7OMKME5Z.js";
7
7
  export {
8
8
  Plures,
9
9
  PluresError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plures",
3
- "version": "1.13.0",
3
+ "version": "1.14.0",
4
4
  "description": "Human judgment as an API for AI agents. Send a decision to ID verified people and get their consensus back.",
5
5
  "keywords": [
6
6
  "human-in-the-loop",