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.
- package/dist/{chunk-GIOZT6FB.js → chunk-7OMKME5Z.js} +1 -1
- package/dist/cli.cjs +10 -6
- package/dist/cli.js +10 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
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.
|
|
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
|
|
536
|
-
const p = (0, import_node_child_process.spawn)("claude", [
|
|
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 && (
|
|
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 (
|
|
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-
|
|
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
|
|
318
|
-
const p = spawn("claude", [
|
|
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 &&
|
|
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 (
|
|
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.
|
|
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
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED