plures 1.12.0 → 1.13.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/README.md +1 -1
- package/dist/{chunk-GDI4KDAH.js → chunk-GIOZT6FB.js} +3 -1
- package/dist/cli.cjs +19 -2
- package/dist/cli.js +17 -2
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ if (event.type === "task.completed" && event.data.result?.agreement === 1) {
|
|
|
51
51
|
- `plures.maps.createKey(app, { label? })`, `.keys(app)`, `.revokeKey(app, id)`: map keys for CI, which can only read and upload that app's map. `.workflow(app, branch?)` returns the GitHub Action that maps on every push; `npx plures map workflow` writes it to `.github/workflows/plures-map.yml`. Or use **Map with GitHub** on the app's map page and Plures opens the pull request for you, then **Turn on mapping** merges it. `plures.maps.startRun(app)` and `.runs(app)`: in CI with no Claude key, `npx plures map` starts a run where Plures runs Claude (first map free, then Claude's cost plus 30%, at most $5).
|
|
52
52
|
- In your terminal, `npx plures map` opens your map page so you can watch it build (`--no-open` to skip), keeps one live line of what it's reading, and ends by drawing the map's flows with the checks Plures suggests. On GitHub and other CI it prints a plain log.
|
|
53
53
|
- `npx plures map` shows each file as Claude Code reads it and sends the file names (never their contents) to Plures, so the map page shows the reading live and the map builds itself when it lands. `plures.maps.progress(app, { session, phase, events })` is the call behind it.
|
|
54
|
-
- `plures.github.repos()`, `.connect(app, "owner/repo")`, `.turnOn(app)`, `.status(app)`, `.disconnect(app)`: Map with GitHub from code. Plures sets the repo's map key secret and opens a pull request adding the workflow; `turnOn` merges it. Installing the Plures GitHub App needs a browser once (`install_url`). From a terminal: `npx plures map github connect`, then `npx plures map github on
|
|
54
|
+
- `plures.github.repos()`, `.connect(app, "owner/repo")`, `.turnOn(app)`, `.run(app)` (map now), `.status(app)`, `.disconnect(app)`: Map with GitHub from code. Plures sets the repo's map key secret and opens a pull request adding the workflow; `turnOn` merges it. Installing the Plures GitHub App needs a browser once (`install_url`). From a terminal: `npx plures map github connect`, then `npx plures map github on`; `npx plures map github run` maps again now.
|
|
55
55
|
- `plures.quality.sample({ rubric, output, input? })`: send every output; a share is graded by people against the rubric, with personal details taken out first. `plures.quality.rubrics.create({ name, question, options, sample_rate })`, `.retrieve(name)` (score by day, this week against the four before, drift), `.list()`, `.update()`, `.del()`. `plures.quality.compare({ release, input, a, b })` and `plures.quality.release(name)` for blind release checks. `plures.quality.export(rubric)` returns graded samples for evals or fine tuning.
|
|
56
56
|
- `plures.testMix.set({ unanimous: 70, split: 20, tie: 5, expired: 5 })`, `.get()`, `.clear()`: with a test key, makes a share of test tasks split, tie or expire at random so you can test routing to your team without changing your agent. A task can override it with `metadata.test_mix`, and `metadata.test_outcome` beats both.
|
|
57
57
|
- `plures.routing.get()`, `plures.routing.set({ groups, rules, team })`: named teams of your own people and rules by category, like `{ groups: [{ name: "Finance", emails: ["ap@acme.com"] }], rules: [{ category: "refunds", route: "team", group: "Finance" }] }`. What you send replaces what's there; the rest stays.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
var VERSION = "1.
|
|
2
|
+
var VERSION = "1.13.0";
|
|
3
3
|
var PluresError = class extends Error {
|
|
4
4
|
constructor(message, status, type) {
|
|
5
5
|
super(message);
|
|
@@ -130,6 +130,8 @@ var Plures = class {
|
|
|
130
130
|
/** Connects a repo ("owner/name"): sets its map key secret and opens the pull request. */
|
|
131
131
|
connect: (app, repo) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app)}/github`, { repo }),
|
|
132
132
|
/** Turns mapping on by merging the pull request. The repo's own rules (reviews, checks) still apply. */
|
|
133
|
+
/** Map now: runs the app's map workflow on GitHub. { update: true } first updates an older workflow. Watch it on the map page. */
|
|
134
|
+
run: (app, opts = {}) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app)}/github/run`, opts),
|
|
133
135
|
turnOn: (app) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app)}/github/merge`, {}),
|
|
134
136
|
/** Revokes the repo's map key. Delete the workflow file in the repo to stop runs. */
|
|
135
137
|
disconnect: (app) => this.req("DELETE", `/api/v1/apps/${encodeURIComponent(app)}/github`)
|
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.13.0";
|
|
34
34
|
var PluresError = class extends Error {
|
|
35
35
|
constructor(message, status, type) {
|
|
36
36
|
super(message);
|
|
@@ -161,6 +161,8 @@ var Plures = class {
|
|
|
161
161
|
/** Connects a repo ("owner/name"): sets its map key secret and opens the pull request. */
|
|
162
162
|
connect: (app2, repo) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app2)}/github`, { repo }),
|
|
163
163
|
/** Turns mapping on by merging the pull request. The repo's own rules (reviews, checks) still apply. */
|
|
164
|
+
/** Map now: runs the app's map workflow on GitHub. { update: true } first updates an older workflow. Watch it on the map page. */
|
|
165
|
+
run: (app2, opts = {}) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app2)}/github/run`, opts),
|
|
164
166
|
turnOn: (app2) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app2)}/github/merge`, {}),
|
|
165
167
|
/** Revokes the repo's map key. Delete the workflow file in the repo to stop runs. */
|
|
166
168
|
disconnect: (app2) => this.req("DELETE", `/api/v1/apps/${encodeURIComponent(app2)}/github`)
|
|
@@ -617,6 +619,20 @@ Turn it on: ${cyan("npx plures map github on")}${app !== "default" ? ` --app ${a
|
|
|
617
619
|
};
|
|
618
620
|
try {
|
|
619
621
|
if (!action || action === "status") return show(await p.github.status(app));
|
|
622
|
+
if (action === "run") {
|
|
623
|
+
let r;
|
|
624
|
+
try {
|
|
625
|
+
r = await p.github.run(app);
|
|
626
|
+
} catch (e) {
|
|
627
|
+
if (!(e instanceof PluresError && e.type === "workflow_outdated")) throw e;
|
|
628
|
+
console.log(dim("This repo's map workflow is from before Map now. Updating it, which merges a small change to the workflow file."));
|
|
629
|
+
r = await p.github.run(app, { update: true });
|
|
630
|
+
}
|
|
631
|
+
const url = `${base}/dashboard/apps/${encodeURIComponent(app)}/map`;
|
|
632
|
+
console.log(`${bold("Mapping now on GitHub.")} Watch it build: ${cyan(url)}`);
|
|
633
|
+
if (fancy && !noOpen) await openBrowser(url);
|
|
634
|
+
return void r;
|
|
635
|
+
}
|
|
620
636
|
if (action === "on") {
|
|
621
637
|
const r = await p.github.turnOn(app);
|
|
622
638
|
console.log(r.already_merged ? "Mapping was already on." : `${bold("Mapping is on.")} The first run is starting on GitHub.`);
|
|
@@ -638,7 +654,7 @@ Turn it on: ${cyan("npx plures map github on")}${app !== "default" ? ` --app ${a
|
|
|
638
654
|
It adds one workflow file. Review it, then turn mapping on with ${cyan("npx plures map github on")}${app !== "default" ? ` --app ${app}` : ""}, or merge it on GitHub.`);
|
|
639
655
|
return;
|
|
640
656
|
}
|
|
641
|
-
die("npx plures map github [connect [owner/repo] | on | off]");
|
|
657
|
+
die("npx plures map github [connect [owner/repo] | on | run | off]");
|
|
642
658
|
} catch (e) {
|
|
643
659
|
if (e instanceof PluresError) die(e.message);
|
|
644
660
|
throw e;
|
|
@@ -655,6 +671,7 @@ async function main() {
|
|
|
655
671
|
npx plures map workflow add a GitHub Action that maps on every push
|
|
656
672
|
npx plures map github connect let Plures add that Action by pull request
|
|
657
673
|
npx plures map github on merge it, which turns mapping on
|
|
674
|
+
npx plures map github run map now on GitHub, and watch it build
|
|
658
675
|
|
|
659
676
|
Docs: https://plures.si/docs`);
|
|
660
677
|
return;
|
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-GIOZT6FB.js";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { spawnSync, spawn } from "child_process";
|
|
@@ -401,6 +401,20 @@ Turn it on: ${cyan("npx plures map github on")}${app !== "default" ? ` --app ${a
|
|
|
401
401
|
};
|
|
402
402
|
try {
|
|
403
403
|
if (!action || action === "status") return show(await p.github.status(app));
|
|
404
|
+
if (action === "run") {
|
|
405
|
+
let r;
|
|
406
|
+
try {
|
|
407
|
+
r = await p.github.run(app);
|
|
408
|
+
} catch (e) {
|
|
409
|
+
if (!(e instanceof PluresError && e.type === "workflow_outdated")) throw e;
|
|
410
|
+
console.log(dim("This repo's map workflow is from before Map now. Updating it, which merges a small change to the workflow file."));
|
|
411
|
+
r = await p.github.run(app, { update: true });
|
|
412
|
+
}
|
|
413
|
+
const url = `${base}/dashboard/apps/${encodeURIComponent(app)}/map`;
|
|
414
|
+
console.log(`${bold("Mapping now on GitHub.")} Watch it build: ${cyan(url)}`);
|
|
415
|
+
if (fancy && !noOpen) await openBrowser(url);
|
|
416
|
+
return void r;
|
|
417
|
+
}
|
|
404
418
|
if (action === "on") {
|
|
405
419
|
const r = await p.github.turnOn(app);
|
|
406
420
|
console.log(r.already_merged ? "Mapping was already on." : `${bold("Mapping is on.")} The first run is starting on GitHub.`);
|
|
@@ -422,7 +436,7 @@ Turn it on: ${cyan("npx plures map github on")}${app !== "default" ? ` --app ${a
|
|
|
422
436
|
It adds one workflow file. Review it, then turn mapping on with ${cyan("npx plures map github on")}${app !== "default" ? ` --app ${app}` : ""}, or merge it on GitHub.`);
|
|
423
437
|
return;
|
|
424
438
|
}
|
|
425
|
-
die("npx plures map github [connect [owner/repo] | on | off]");
|
|
439
|
+
die("npx plures map github [connect [owner/repo] | on | run | off]");
|
|
426
440
|
} catch (e) {
|
|
427
441
|
if (e instanceof PluresError) die(e.message);
|
|
428
442
|
throw e;
|
|
@@ -439,6 +453,7 @@ async function main() {
|
|
|
439
453
|
npx plures map workflow add a GitHub Action that maps on every push
|
|
440
454
|
npx plures map github connect let Plures add that Action by pull request
|
|
441
455
|
npx plures map github on merge it, which turns mapping on
|
|
456
|
+
npx plures map github run map now on GitHub, and watch it build
|
|
442
457
|
|
|
443
458
|
Docs: https://plures.si/docs`);
|
|
444
459
|
return;
|
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.13.0";
|
|
30
30
|
var PluresError = class extends Error {
|
|
31
31
|
constructor(message, status, type) {
|
|
32
32
|
super(message);
|
|
@@ -157,6 +157,8 @@ var Plures = class {
|
|
|
157
157
|
/** Connects a repo ("owner/name"): sets its map key secret and opens the pull request. */
|
|
158
158
|
connect: (app, repo) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app)}/github`, { repo }),
|
|
159
159
|
/** Turns mapping on by merging the pull request. The repo's own rules (reviews, checks) still apply. */
|
|
160
|
+
/** Map now: runs the app's map workflow on GitHub. { update: true } first updates an older workflow. Watch it on the map page. */
|
|
161
|
+
run: (app, opts = {}) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app)}/github/run`, opts),
|
|
160
162
|
turnOn: (app) => this.req("POST", `/api/v1/apps/${encodeURIComponent(app)}/github/merge`, {}),
|
|
161
163
|
/** Revokes the repo's map key. Delete the workflow file in the repo to stop runs. */
|
|
162
164
|
disconnect: (app) => this.req("DELETE", `/api/v1/apps/${encodeURIComponent(app)}/github`)
|
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.
|
|
353
|
+
declare const VERSION = "1.13.0";
|
|
354
354
|
type GitHubLink = {
|
|
355
355
|
object: "github_link";
|
|
356
356
|
app: string;
|
|
@@ -550,6 +550,15 @@ declare class Plures {
|
|
|
550
550
|
/** Connects a repo ("owner/name"): sets its map key secret and opens the pull request. */
|
|
551
551
|
connect: (app: string, repo: string) => Promise<GitHubLink>;
|
|
552
552
|
/** Turns mapping on by merging the pull request. The repo's own rules (reviews, checks) still apply. */
|
|
553
|
+
/** Map now: runs the app's map workflow on GitHub. { update: true } first updates an older workflow. Watch it on the map page. */
|
|
554
|
+
run: (app: string, opts?: {
|
|
555
|
+
update?: boolean;
|
|
556
|
+
}) => Promise<{
|
|
557
|
+
object: "map_run_request";
|
|
558
|
+
app: string;
|
|
559
|
+
started: true;
|
|
560
|
+
updated_workflow: boolean;
|
|
561
|
+
}>;
|
|
553
562
|
turnOn: (app: string) => Promise<{
|
|
554
563
|
object: "github_merge";
|
|
555
564
|
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.
|
|
353
|
+
declare const VERSION = "1.13.0";
|
|
354
354
|
type GitHubLink = {
|
|
355
355
|
object: "github_link";
|
|
356
356
|
app: string;
|
|
@@ -550,6 +550,15 @@ declare class Plures {
|
|
|
550
550
|
/** Connects a repo ("owner/name"): sets its map key secret and opens the pull request. */
|
|
551
551
|
connect: (app: string, repo: string) => Promise<GitHubLink>;
|
|
552
552
|
/** Turns mapping on by merging the pull request. The repo's own rules (reviews, checks) still apply. */
|
|
553
|
+
/** Map now: runs the app's map workflow on GitHub. { update: true } first updates an older workflow. Watch it on the map page. */
|
|
554
|
+
run: (app: string, opts?: {
|
|
555
|
+
update?: boolean;
|
|
556
|
+
}) => Promise<{
|
|
557
|
+
object: "map_run_request";
|
|
558
|
+
app: string;
|
|
559
|
+
started: true;
|
|
560
|
+
updated_workflow: boolean;
|
|
561
|
+
}>;
|
|
553
562
|
turnOn: (app: string) => Promise<{
|
|
554
563
|
object: "github_merge";
|
|
555
564
|
app: string;
|
package/dist/index.js
CHANGED