privateer-agent 0.15.5 → 0.15.6
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 +11 -0
- package/bin/boot-bundle.d.mts +2 -0
- package/bin/boot-bundle.mjs +44 -0
- package/bin/privateer-launch.mjs +14 -2
- package/bin/privateer-verify.mjs +12 -0
- package/dist-boot/boot.mjs +3 -0
- package/dist-boot/c-27JKSMWL.mjs +1460 -0
- package/dist-boot/c-2BMRFV24.mjs +269 -0
- package/dist-boot/c-2CTF6JA3.mjs +166 -0
- package/dist-boot/c-2G3BBHRJ.mjs +84 -0
- package/dist-boot/c-2IDLKXX6.mjs +250 -0
- package/dist-boot/c-2NJD5VYM.mjs +8 -0
- package/dist-boot/c-2S5EEQPW.mjs +1602 -0
- package/dist-boot/c-2WRDCUVI.mjs +25 -0
- package/dist-boot/c-2YN3M256.mjs +14 -0
- package/dist-boot/c-37GM3GMU.mjs +187 -0
- package/dist-boot/c-3STKRSVO.mjs +2480 -0
- package/dist-boot/c-3TPV6TQQ.mjs +2320 -0
- package/dist-boot/c-3UVHLQDJ.mjs +225 -0
- package/dist-boot/c-42PUUZYC.mjs +697 -0
- package/dist-boot/c-4D5UMWVW.mjs +683 -0
- package/dist-boot/c-4ETZRMTA.mjs +46 -0
- package/dist-boot/c-4QT25BD5.mjs +1482 -0
- package/dist-boot/c-4WVR32AP.mjs +2579 -0
- package/dist-boot/c-5EMM567G.mjs +152 -0
- package/dist-boot/c-5FA4CV63.mjs +145 -0
- package/dist-boot/c-5GV3X3RB.mjs +14 -0
- package/dist-boot/c-5JCEPRIY.mjs +52 -0
- package/dist-boot/c-5NDKIIWT.mjs +16 -0
- package/dist-boot/c-5QL3AR26.mjs +4665 -0
- package/dist-boot/c-5XY6MFKN.mjs +5142 -0
- package/dist-boot/c-65UZIZC7.mjs +2897 -0
- package/dist-boot/c-6FUXKHOK.mjs +1969 -0
- package/dist-boot/c-6JHWQE4V.mjs +18242 -0
- package/dist-boot/c-6LOBR4I6.mjs +5280 -0
- package/dist-boot/c-6QHOZXKQ.mjs +14394 -0
- package/dist-boot/c-6ZO2SADQ.mjs +178 -0
- package/dist-boot/c-6ZORVVZP.mjs +1449 -0
- package/dist-boot/c-76QH4UCP.mjs +2441 -0
- package/dist-boot/c-77GO5L5Y.mjs +20982 -0
- package/dist-boot/c-7M23XFTN.mjs +5052 -0
- package/dist-boot/c-7TC367E2.mjs +32 -0
- package/dist-boot/c-7UOG7POX.mjs +1524 -0
- package/dist-boot/c-7VHP3FLN.mjs +376 -0
- package/dist-boot/c-A73JHZP2.mjs +13207 -0
- package/dist-boot/c-ABXULAFL.mjs +71 -0
- package/dist-boot/c-ANDD2AQO.mjs +74 -0
- package/dist-boot/c-AOY77AZL.mjs +1430 -0
- package/dist-boot/c-AXEPZ22I.mjs +108 -0
- package/dist-boot/c-B2Y7VNHU.mjs +427 -0
- package/dist-boot/c-B7VJUH73.mjs +77 -0
- package/dist-boot/c-BFW6CDVL.mjs +24 -0
- package/dist-boot/c-BHNIF2AR.mjs +188 -0
- package/dist-boot/c-BKF2O6BL.mjs +23 -0
- package/dist-boot/c-BOZXFTZN.mjs +8 -0
- package/dist-boot/c-BRNYJWZL.mjs +28 -0
- package/dist-boot/c-C3N4Z2HO.mjs +93 -0
- package/dist-boot/c-C4IV7ZFG.mjs +717 -0
- package/dist-boot/c-C5NK6UYV.mjs +793 -0
- package/dist-boot/c-C67644MB.mjs +1659 -0
- package/dist-boot/c-C6S2YB53.mjs +620 -0
- package/dist-boot/c-CDBEJSBF.mjs +37 -0
- package/dist-boot/c-CG47HBKU.mjs +435 -0
- package/dist-boot/c-CKCTWCT5.mjs +51 -0
- package/dist-boot/c-CN77DCGF.mjs +60 -0
- package/dist-boot/c-CRBXNKFO.mjs +1795 -0
- package/dist-boot/c-CRIHASQ6.mjs +973 -0
- package/dist-boot/c-CU4NGAUO.mjs +3786 -0
- package/dist-boot/c-CWRFLGQU.mjs +1883 -0
- package/dist-boot/c-CYQB2USO.mjs +32 -0
- package/dist-boot/c-DEE67DJO.mjs +379 -0
- package/dist-boot/c-DIFDBYOP.mjs +1258 -0
- package/dist-boot/c-DOSGVXDZ.mjs +34879 -0
- package/dist-boot/c-DR7XQI32.mjs +381 -0
- package/dist-boot/c-DTGPSB46.mjs +14666 -0
- package/dist-boot/c-DTHDNA4P.mjs +320 -0
- package/dist-boot/c-E4Z3Y5B5.mjs +3864 -0
- package/dist-boot/c-E66Z2TI7.mjs +203 -0
- package/dist-boot/c-EBU6RLRV.mjs +1527 -0
- package/dist-boot/c-EBZZNGSF.mjs +432 -0
- package/dist-boot/c-EC3LJ2KF.mjs +1032 -0
- package/dist-boot/c-EQBKXWNX.mjs +15829 -0
- package/dist-boot/c-EUEPIW4S.mjs +574 -0
- package/dist-boot/c-EX4YVWAT.mjs +378 -0
- package/dist-boot/c-EYZGSAJU.mjs +98 -0
- package/dist-boot/c-F75VRKY4.mjs +172 -0
- package/dist-boot/c-FH4NXKHV.mjs +177 -0
- package/dist-boot/c-FHNUCTEM.mjs +140 -0
- package/dist-boot/c-FJ5T42DS.mjs +5349 -0
- package/dist-boot/c-FPCNRL7G.mjs +1728 -0
- package/dist-boot/c-G4DLN7Q4.mjs +8 -0
- package/dist-boot/c-G56GYQFZ.mjs +2507 -0
- package/dist-boot/c-GLIOERDQ.mjs +1200 -0
- package/dist-boot/c-GMJ5HUBM.mjs +14 -0
- package/dist-boot/c-H3HSGMAQ.mjs +461 -0
- package/dist-boot/c-HIKTO6P7.mjs +275 -0
- package/dist-boot/c-I2MCJ34O.mjs +464 -0
- package/dist-boot/c-I3C6LBW4.mjs +765 -0
- package/dist-boot/c-I54OKQHW.mjs +387 -0
- package/dist-boot/c-IFSP3R4D.mjs +80 -0
- package/dist-boot/c-IZK77VB7.mjs +171 -0
- package/dist-boot/c-J3Y25UGE.mjs +54 -0
- package/dist-boot/c-J5IESS7W.mjs +27750 -0
- package/dist-boot/c-JJWZBY7L.mjs +254 -0
- package/dist-boot/c-JKTFXTGF.mjs +463 -0
- package/dist-boot/c-JN57AXQ4.mjs +77 -0
- package/dist-boot/c-KFIO6LUW.mjs +1096 -0
- package/dist-boot/c-KIEMEFWW.mjs +478 -0
- package/dist-boot/c-KIVXWBYD.mjs +28 -0
- package/dist-boot/c-KP6CRIP4.mjs +580 -0
- package/dist-boot/c-L26VOJX4.mjs +11558 -0
- package/dist-boot/c-L5GHWG5G.mjs +5988 -0
- package/dist-boot/c-M7NSQAKK.mjs +353 -0
- package/dist-boot/c-MCEWOPBW.mjs +56 -0
- package/dist-boot/c-MGPIEG7I.mjs +20 -0
- package/dist-boot/c-NREXJV3M.mjs +393 -0
- package/dist-boot/c-O5PP6CTX.mjs +162 -0
- package/dist-boot/c-OBQDHSXM.mjs +1774 -0
- package/dist-boot/c-OLQHHDD4.mjs +21 -0
- package/dist-boot/c-OXW4JQQH.mjs +319 -0
- package/dist-boot/c-P3D7ZUWN.mjs +1288 -0
- package/dist-boot/c-P4PQZVV5.mjs +948 -0
- package/dist-boot/c-P63T3XL2.mjs +26373 -0
- package/dist-boot/c-P6N5DQGZ.mjs +194 -0
- package/dist-boot/c-P7MLKQFC.mjs +58 -0
- package/dist-boot/c-PB3PZJL5.mjs +1276 -0
- package/dist-boot/c-PTN4S6G2.mjs +1259 -0
- package/dist-boot/c-PYCE5J7U.mjs +1083 -0
- package/dist-boot/c-Q4HYCRLB.mjs +19410 -0
- package/dist-boot/c-QUXMETGG.mjs +68 -0
- package/dist-boot/c-RDMJZCOX.mjs +356 -0
- package/dist-boot/c-ROGJK76M.mjs +17 -0
- package/dist-boot/c-RQJJ26T4.mjs +708 -0
- package/dist-boot/c-RSKCUPJF.mjs +7559 -0
- package/dist-boot/c-RVJU4O6P.mjs +37 -0
- package/dist-boot/c-S2RVHR3M.mjs +165 -0
- package/dist-boot/c-SKMK3PEE.mjs +91120 -0
- package/dist-boot/c-TI7SM4EG.mjs +20 -0
- package/dist-boot/c-TILJ6GXD.mjs +1235 -0
- package/dist-boot/c-TT6BCUJD.mjs +114 -0
- package/dist-boot/c-U4ITOXAN.mjs +2107 -0
- package/dist-boot/c-UGERXVO2.mjs +7120 -0
- package/dist-boot/c-UPBH5AXY.mjs +1363 -0
- package/dist-boot/c-US2PUNZL.mjs +597 -0
- package/dist-boot/c-UU4WZPPE.mjs +20 -0
- package/dist-boot/c-UWVIYPQS.mjs +39 -0
- package/dist-boot/c-V4RHQBPQ.mjs +17683 -0
- package/dist-boot/c-V5MRVK47.mjs +351 -0
- package/dist-boot/c-V6CL266R.mjs +1755 -0
- package/dist-boot/c-VJTMFKYE.mjs +14975 -0
- package/dist-boot/c-VJTRUKIB.mjs +773 -0
- package/dist-boot/c-W4IFSHPW.mjs +43 -0
- package/dist-boot/c-WETGB2CF.mjs +113 -0
- package/dist-boot/c-WO3QSZUU.mjs +1337 -0
- package/dist-boot/c-WQLH73TY.mjs +242 -0
- package/dist-boot/c-XL735JW5.mjs +500 -0
- package/dist-boot/c-Y7HADL5B.mjs +1107 -0
- package/dist-boot/c-YGQHSVSK.mjs +41 -0
- package/dist-boot/c-YMP2AMEB.mjs +10350 -0
- package/dist-boot/c-YRDO2WEF.mjs +12012 -0
- package/dist-boot/c-YUSTRATJ.mjs +8 -0
- package/dist-boot/c-Z2262R22.mjs +2697 -0
- package/dist-boot/c-Z4ALQMJC.mjs +709 -0
- package/dist-boot/c-Z5ZUQVUY.mjs +62 -0
- package/dist-boot/c-ZDZUKXF7.mjs +874 -0
- package/dist-boot/c-ZJYLGIC3.mjs +32 -0
- package/dist-boot/c-ZNA5CDMI.mjs +77 -0
- package/dist-boot/c-ZSO6DI3M.mjs +204 -0
- package/dist-boot/c-ZWUVHKMK.mjs +100 -0
- package/dist-boot/c-ZY4MESEW.mjs +832 -0
- package/dist-boot/c-ZZ5REI4L.mjs +329 -0
- package/dist-boot/cli.mjs +51 -0
- package/dist-boot/ext-anthropic-attribution.mjs +207 -0
- package/dist-boot/ext-pi-background-tasks.mjs +7234 -0
- package/dist-boot/ext-pi-subagents.mjs +37 -0
- package/dist-boot/ext-privateer-account.mjs +4426 -0
- package/dist-boot/ext-privateer-brand.mjs +5274 -0
- package/dist-boot/ext-privateer-codemode.mjs +37 -0
- package/dist-boot/ext-privateer-computer.mjs +626 -0
- package/dist-boot/ext-privateer-connect.mjs +1862 -0
- package/dist-boot/ext-privateer-context.mjs +323 -0
- package/dist-boot/ext-privateer-desktop.mjs +92 -0
- package/dist-boot/ext-privateer-final-audit.mjs +48 -0
- package/dist-boot/ext-privateer-fresh.mjs +81 -0
- package/dist-boot/ext-privateer-gate.mjs +5959 -0
- package/dist-boot/ext-privateer-hints.mjs +236 -0
- package/dist-boot/ext-privateer-media.mjs +2626 -0
- package/dist-boot/ext-privateer-models.mjs +3397 -0
- package/dist-boot/ext-privateer-posture.mjs +3006 -0
- package/dist-boot/ext-privateer-privacy.mjs +4578 -0
- package/dist-boot/ext-privateer-recovery.mjs +287 -0
- package/dist-boot/ext-privateer-speak.mjs +4754 -0
- package/dist-boot/ext-privateer-terminals.mjs +725 -0
- package/dist-boot/ext-privateer-tools.mjs +528 -0
- package/dist-boot/ext-privateer-truncation.mjs +74 -0
- package/dist-boot/ext-privateer-update.mjs +210 -0
- package/dist-boot/ext-privateer-vision.mjs +148 -0
- package/dist-boot/ext-privateer-web.mjs +543 -0
- package/dist-boot/ext-rpiv-ask-user-question.mjs +710 -0
- package/dist-boot/manifest.json +9 -0
- package/extensions/privateer-brand.ts +3 -1
- package/extensions/privateer-context.ts +4 -2
- package/extensions/privateer-final-audit.ts +17 -0
- package/extensions/privateer-gate.ts +41 -8
- package/extensions/privateer-web.ts +4 -4
- package/package.json +3 -1
- package/patches/@earendil-works+pi-coding-agent+1.3.0.patch +110 -2
- package/patches/pi-background-tasks+2.6.10.patch +91 -7
- package/src/config/moatManifest.json +1 -0
- package/src/config/whatsNew.json +2 -2
- package/src/context.ts +33 -5
- package/src/engine/finalAudit.ts +38 -0
- package/src/engine/stallWatchdog.ts +8 -1
- package/src/providers/account.ts +34 -3
package/README.md
CHANGED
|
@@ -505,6 +505,17 @@ privateer -p --approve-in-app --approval-timeout 300 "make a 6s intro clip"
|
|
|
505
505
|
`--max-spend` is checked before each call against the server's estimate for that call
|
|
506
506
|
(`media_capabilities` shows the same prices). A call that can't be priced is refused.
|
|
507
507
|
|
|
508
|
+
Piped input is waited for, however long the pipe stays silent
|
|
509
|
+
(`pytest | privateer -p "why did this fail?"`). If a program starts Privateer with stdin
|
|
510
|
+
open and never writes to it, a run that already has a prompt continues after 3 seconds.
|
|
511
|
+
Scripts with nothing to send can skip the wait with `< /dev/null`.
|
|
512
|
+
|
|
513
|
+
Before a one-shot run that used tools ends, Privateer asks the model to check its result
|
|
514
|
+
against what actually happened and to open its final message with anything it invented,
|
|
515
|
+
could not verify or lost. That is one extra model call; `PRIVATEER_FINAL_AUDIT=0` turns it
|
|
516
|
+
off. If the provider goes silent mid-run, the request is resent up to twice before the run
|
|
517
|
+
stops with an error.
|
|
518
|
+
|
|
508
519
|
## Hand off sensitive work
|
|
509
520
|
|
|
510
521
|
Your coding agent's context goes to its provider. When a task touches files that shouldn't
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Which Pi entry should this launch run: the compiled boot build, or the source tree?
|
|
2
|
+
// scripts/build-boot.mjs makes the build; docs/startup-performance.md explains why.
|
|
3
|
+
//
|
|
4
|
+
// The answer is the build only when it is certainly the same code as the source next
|
|
5
|
+
// to it. Every other case returns null and the launcher runs from source, which is
|
|
6
|
+
// slower and always correct, so nothing here is ever a reason a launch fails.
|
|
7
|
+
|
|
8
|
+
import fs from "node:fs";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
|
|
11
|
+
export const BOOT_DIR = "dist-boot";
|
|
12
|
+
|
|
13
|
+
function readJson(file) {
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(fs.readFileSync(file, "utf8"));
|
|
16
|
+
} catch {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Absolute path of the build's entry script, or null to run from source. */
|
|
22
|
+
export function bootCliPath(repo, env = process.env) {
|
|
23
|
+
if (env.PRIVATEER_NO_BOOT_BUNDLE === "1") return null;
|
|
24
|
+
|
|
25
|
+
// A checkout is where source gets edited, and the build wouldn't see those edits.
|
|
26
|
+
if (fs.existsSync(path.join(repo, ".git")) && env.PRIVATEER_BOOT_BUNDLE !== "1") return null;
|
|
27
|
+
|
|
28
|
+
const dir = path.join(repo, BOOT_DIR);
|
|
29
|
+
const manifest = readJson(path.join(dir, "manifest.json"));
|
|
30
|
+
if (!manifest) return null;
|
|
31
|
+
|
|
32
|
+
// A build left behind by an upgrade is older code wearing the new version's name.
|
|
33
|
+
const pkg = readJson(path.join(repo, "package.json"));
|
|
34
|
+
if (!pkg || manifest.version !== pkg.version) return null;
|
|
35
|
+
|
|
36
|
+
// The build maps each file back to its place under <repo>/node_modules. A hoisted
|
|
37
|
+
// install (npx, or a dependency of another project) has no such place.
|
|
38
|
+
if (!fs.existsSync(path.join(repo, "node_modules", "@earendil-works", "pi-coding-agent", "package.json"))) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const entry = path.join(dir, "boot.mjs");
|
|
43
|
+
return fs.existsSync(entry) && fs.existsSync(path.join(dir, "cli.mjs")) ? entry : null;
|
|
44
|
+
}
|
package/bin/privateer-launch.mjs
CHANGED
|
@@ -34,6 +34,7 @@ import { runToCompletion } from "./run-to-completion.mjs";
|
|
|
34
34
|
import { modelArgs } from "./model-args.mjs";
|
|
35
35
|
import { filterRespawnArgs, listTerminals, requestFresh, runSupervised } from "./fresh-supervisor.mjs";
|
|
36
36
|
import { configureCompileCache } from "./startup-cache.mjs";
|
|
37
|
+
import { bootCliPath } from "./boot-bundle.mjs";
|
|
37
38
|
import { sweepSessions } from "./session-seal.mjs";
|
|
38
39
|
|
|
39
40
|
const HERE = path.dirname(fileURLToPath(import.meta.url)); // bin/
|
|
@@ -133,7 +134,16 @@ const BUNDLED = fs.existsSync(bundledNode) && fs.existsSync(path.join(REPO, "BUN
|
|
|
133
134
|
// very node already running this script (a suitable >=22, since we booted under it).
|
|
134
135
|
const NODE_BIN = BUNDLED ? bundledNode : process.execPath;
|
|
135
136
|
// Make sure the chosen node's directory is on PATH for shebang-spawned grandchildren.
|
|
136
|
-
|
|
137
|
+
// The agent's own shells get that entry filtered back out (getShellEnv and the background
|
|
138
|
+
// task registry, both patched): seeing a `node` the machine does not really have, it wrote
|
|
139
|
+
// `#!/usr/bin/env node` tools that die the moment Privateer exits. PRIVATEER_NODE is how a
|
|
140
|
+
// shell reaches this runtime on purpose. A directory the user already had on PATH stays.
|
|
141
|
+
const runtimeDir = path.dirname(NODE_BIN);
|
|
142
|
+
if (!(process.env.PATH || "").split(path.delimiter).includes(runtimeDir)) {
|
|
143
|
+
process.env.PRIVATEER_PRIVATE_RUNTIME_DIR = runtimeDir;
|
|
144
|
+
}
|
|
145
|
+
process.env.PRIVATEER_NODE = NODE_BIN;
|
|
146
|
+
process.env.PATH = runtimeDir + path.delimiter + (process.env.PATH || "");
|
|
137
147
|
|
|
138
148
|
const args = process.argv.slice(2);
|
|
139
149
|
|
|
@@ -754,6 +764,8 @@ else {
|
|
|
754
764
|
);
|
|
755
765
|
process.exit(1);
|
|
756
766
|
}
|
|
767
|
+
// The compiled build when it is valid for this install, else the source tree.
|
|
768
|
+
const ENTRY = bootCliPath(REPO) ?? CLI;
|
|
757
769
|
process.env.PI_CODING_AGENT_DIR = AGENT_DIR;
|
|
758
770
|
// The binary pi-subagents spawns for each child, and the moat that child must load.
|
|
759
771
|
//
|
|
@@ -924,7 +936,7 @@ else {
|
|
|
924
936
|
// Supervised rather than runToCompletion: the launcher stays up so /fresh, a voice
|
|
925
937
|
// command, or `privateer fresh` from another terminal can swap this agent for a new
|
|
926
938
|
// process with the old tree reaped. Print/export/version runs have nothing to swap.
|
|
927
|
-
const tuiArgs = (launchArgs) => [...nodeArgs,
|
|
939
|
+
const tuiArgs = (launchArgs) => [...nodeArgs, ENTRY, ...modelArgsFor(launchArgs), ...extArgs, ...skillArgs, ...launchArgs];
|
|
928
940
|
// forwardSignals: a `kill` reaches only this launcher, and a -p run left behind keeps
|
|
929
941
|
// working (and spending) with nobody waiting for its answer.
|
|
930
942
|
if (isNonInteractive) runToCompletion(NODE_BIN, tuiArgs(args), { forwardSignals: true });
|
package/bin/privateer-verify.mjs
CHANGED
|
@@ -21,6 +21,7 @@ import path from "node:path";
|
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
22
|
|
|
23
23
|
import { findDepRoot } from "./apply-patches.mjs";
|
|
24
|
+
import { BOOT_DIR, bootCliPath } from "./boot-bundle.mjs";
|
|
24
25
|
|
|
25
26
|
const REGISTRY = process.env.npm_config_registry || "https://registry.npmjs.org";
|
|
26
27
|
const NET_TIMEOUT_MS = 8000;
|
|
@@ -228,6 +229,17 @@ export async function verify({ repo, offline = false } = {}) {
|
|
|
228
229
|
}
|
|
229
230
|
}
|
|
230
231
|
|
|
232
|
+
// Which code a launch actually runs: the compiled build, when valid, is the patched
|
|
233
|
+
// source above in one place, so "patched" is only half the answer without this.
|
|
234
|
+
heading("Boot build");
|
|
235
|
+
const bootBuild = readJson(path.join(repo, BOOT_DIR, "manifest.json"));
|
|
236
|
+
if (bootCliPath(repo)) {
|
|
237
|
+
pass("compiled entry in use", `${bootBuild.modules} modules · pi ${bootBuild.pi}`);
|
|
238
|
+
note("built from this release's source and patches; PRIVATEER_NO_BOOT_BUNDLE=1 runs the source tree");
|
|
239
|
+
} else {
|
|
240
|
+
note(bootBuild ? "present but not used here, so launches run from source" : "none, so launches run from source");
|
|
241
|
+
}
|
|
242
|
+
|
|
231
243
|
// --- 5. where config and credentials live -------------------------------
|
|
232
244
|
heading("Config");
|
|
233
245
|
const home = process.env.PRIVATEER_HOME || path.join(process.env.HOME || "", ".privateer");
|