privateer-agent 0.15.4 → 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/fresh-supervisor.d.mts +5 -1
- package/bin/fresh-supervisor.mjs +47 -10
- package/bin/privateer-launch.mjs +27 -3
- package/bin/privateer-subagent.mjs +5 -2
- package/bin/privateer-verify.mjs +12 -0
- package/bin/session-recovery.d.mts +53 -0
- package/bin/session-recovery.mjs +240 -0
- package/bin/session-seal-preload.mjs +17 -0
- package/bin/session-seal.d.mts +25 -0
- package/bin/session-seal.mjs +242 -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 +55 -9
- package/extensions/privateer-recovery.ts +175 -0
- package/extensions/privateer-web.ts +4 -4
- package/package.json +3 -1
- package/patches/@earendil-works+pi-coding-agent+1.3.0.patch +199 -2
- package/patches/pi-background-tasks+2.6.10.patch +91 -7
- package/src/cli/chat.ts +7 -1
- package/src/config/moatManifest.json +2 -0
- package/src/config/whatsNew.json +4 -4
- 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/src/remote/attentionPush.ts +40 -0
- package/src/remote/liveTaskSession.ts +7 -1
- package/src/remote/relayClient.ts +38 -4
- package/src/remote/remoteBridge.ts +17 -0
- package/src/remote/transcriptSnapshot.ts +104 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import{createRequire as __pvCR}from"node:module";import{fileURLToPath as __pvF}from"node:url";import{dirname as __pvD}from"node:path";const require=__pvCR(import.meta.url);const __pvUrl=(r)=>new URL(r,import.meta.url).href;const __pvFile=(r)=>__pvF(new URL(r,import.meta.url));
|
|
2
|
+
import {
|
|
3
|
+
OpenAI
|
|
4
|
+
} from "./c-Q4HYCRLB.mjs";
|
|
5
|
+
import {
|
|
6
|
+
formatProviderError,
|
|
7
|
+
normalizeProviderError
|
|
8
|
+
} from "./c-ZWUVHKMK.mjs";
|
|
9
|
+
import {
|
|
10
|
+
sanitizeSurrogates
|
|
11
|
+
} from "./c-5GV3X3RB.mjs";
|
|
12
|
+
import {
|
|
13
|
+
retryProviderRequest
|
|
14
|
+
} from "./c-EYZGSAJU.mjs";
|
|
15
|
+
import {
|
|
16
|
+
headersToRecord,
|
|
17
|
+
providerHeadersToRecord
|
|
18
|
+
} from "./c-ZJYLGIC3.mjs";
|
|
19
|
+
import {
|
|
20
|
+
__name
|
|
21
|
+
} from "./c-CN77DCGF.mjs";
|
|
22
|
+
|
|
23
|
+
// node_modules/@earendil-works/pi-ai/dist/api/openrouter-images.js
|
|
24
|
+
var generateImages = /* @__PURE__ */ __name(async (model, context, options) => {
|
|
25
|
+
const output = {
|
|
26
|
+
api: model.api,
|
|
27
|
+
provider: model.provider,
|
|
28
|
+
model: model.id,
|
|
29
|
+
output: [],
|
|
30
|
+
stopReason: "stop",
|
|
31
|
+
timestamp: Date.now()
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
const apiKey = options?.apiKey;
|
|
35
|
+
if (!apiKey) {
|
|
36
|
+
throw new Error(`No API key for provider: ${model.provider}`);
|
|
37
|
+
}
|
|
38
|
+
const client = createClient(model, apiKey, options?.headers, options?.fetch);
|
|
39
|
+
let params = buildParams(model, context);
|
|
40
|
+
const nextParams = await options?.onPayload?.(params, model);
|
|
41
|
+
if (nextParams !== void 0) {
|
|
42
|
+
params = nextParams;
|
|
43
|
+
}
|
|
44
|
+
const requestOptions = {
|
|
45
|
+
...options?.signal ? { signal: options.signal } : {},
|
|
46
|
+
...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
|
|
47
|
+
maxRetries: 0
|
|
48
|
+
};
|
|
49
|
+
const { data: response, response: rawResponse } = await retryProviderRequest(() => client.chat.completions.create(params, requestOptions).withResponse(), {
|
|
50
|
+
maxRetries: options?.maxRetries,
|
|
51
|
+
maxRetryDelayMs: options?.maxRetryDelayMs,
|
|
52
|
+
signal: options?.signal
|
|
53
|
+
});
|
|
54
|
+
await options?.onResponse?.({ status: rawResponse.status, headers: headersToRecord(rawResponse.headers) }, model);
|
|
55
|
+
const imageResponse = response;
|
|
56
|
+
output.responseId = imageResponse.id;
|
|
57
|
+
if (imageResponse.usage) {
|
|
58
|
+
output.usage = parseUsage(imageResponse.usage, model);
|
|
59
|
+
}
|
|
60
|
+
const choice = imageResponse.choices[0];
|
|
61
|
+
if (choice) {
|
|
62
|
+
const content = choice.message.content;
|
|
63
|
+
if (typeof content === "string" && content.length > 0) {
|
|
64
|
+
output.output.push({ type: "text", text: content });
|
|
65
|
+
}
|
|
66
|
+
for (const image of choice.message.images ?? []) {
|
|
67
|
+
const imageUrl = typeof image.image_url === "string" ? image.image_url : image.image_url?.url;
|
|
68
|
+
if (!imageUrl?.startsWith("data:"))
|
|
69
|
+
continue;
|
|
70
|
+
const matches = imageUrl.match(/^data:([^;]+);base64,(.+)$/);
|
|
71
|
+
if (!matches)
|
|
72
|
+
continue;
|
|
73
|
+
output.output.push({
|
|
74
|
+
type: "image",
|
|
75
|
+
mimeType: matches[1],
|
|
76
|
+
data: matches[2]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return output;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
83
|
+
output.errorMessage = formatProviderError(normalizeProviderError(error));
|
|
84
|
+
return output;
|
|
85
|
+
}
|
|
86
|
+
}, "generateImages");
|
|
87
|
+
function createClient(model, apiKey, optionsHeaders, fetch) {
|
|
88
|
+
return new OpenAI({
|
|
89
|
+
apiKey,
|
|
90
|
+
baseURL: model.baseUrl,
|
|
91
|
+
dangerouslyAllowBrowser: true,
|
|
92
|
+
fetch,
|
|
93
|
+
defaultHeaders: providerHeadersToRecord({ ...model.headers, ...optionsHeaders })
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
__name(createClient, "createClient");
|
|
97
|
+
function buildParams(model, context) {
|
|
98
|
+
const content = context.input.map((item) => {
|
|
99
|
+
if (item.type === "text") {
|
|
100
|
+
return {
|
|
101
|
+
type: "text",
|
|
102
|
+
text: sanitizeSurrogates(item.text)
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
type: "image_url",
|
|
107
|
+
image_url: {
|
|
108
|
+
url: `data:${item.mimeType};base64,${item.data}`
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
model: model.id,
|
|
114
|
+
messages: [
|
|
115
|
+
{
|
|
116
|
+
role: "user",
|
|
117
|
+
content
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
stream: false,
|
|
121
|
+
modalities: model.output.includes("text") ? ["image", "text"] : ["image"]
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
__name(buildParams, "buildParams");
|
|
125
|
+
function parseUsage(rawUsage, model) {
|
|
126
|
+
const promptTokens = rawUsage.prompt_tokens || 0;
|
|
127
|
+
const reportedCachedTokens = rawUsage.prompt_tokens_details?.cached_tokens || 0;
|
|
128
|
+
const cacheWriteTokens = rawUsage.prompt_tokens_details?.cache_write_tokens || 0;
|
|
129
|
+
const cacheReadTokens = cacheWriteTokens > 0 ? Math.max(0, reportedCachedTokens - cacheWriteTokens) : reportedCachedTokens;
|
|
130
|
+
const input = Math.max(0, promptTokens - cacheReadTokens - cacheWriteTokens);
|
|
131
|
+
const output = rawUsage.completion_tokens || 0;
|
|
132
|
+
const usage = {
|
|
133
|
+
input,
|
|
134
|
+
output,
|
|
135
|
+
cacheRead: cacheReadTokens,
|
|
136
|
+
cacheWrite: cacheWriteTokens,
|
|
137
|
+
totalTokens: input + output + cacheReadTokens + cacheWriteTokens,
|
|
138
|
+
cost: {
|
|
139
|
+
input: model.cost.input / 1e6 * input,
|
|
140
|
+
output: model.cost.output / 1e6 * output,
|
|
141
|
+
cacheRead: model.cost.cacheRead / 1e6 * cacheReadTokens,
|
|
142
|
+
cacheWrite: model.cost.cacheWrite / 1e6 * cacheWriteTokens,
|
|
143
|
+
total: 0
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;
|
|
147
|
+
return usage;
|
|
148
|
+
}
|
|
149
|
+
__name(parseUsage, "parseUsage");
|
|
150
|
+
export {
|
|
151
|
+
generateImages
|
|
152
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import{createRequire as __pvCR}from"node:module";import{fileURLToPath as __pvF}from"node:url";import{dirname as __pvD}from"node:path";const require=__pvCR(import.meta.url);const __pvUrl=(r)=>new URL(r,import.meta.url).href;const __pvFile=(r)=>__pvF(new URL(r,import.meta.url));
|
|
2
|
+
|
|
3
|
+
// node_modules/pi-subagents/package.json?ext=pi-subagents
|
|
4
|
+
var package_default = {
|
|
5
|
+
type: "module",
|
|
6
|
+
name: "pi-subagents",
|
|
7
|
+
version: "0.78.0",
|
|
8
|
+
description: "Pi extension for single-agent delegation and scripted multi-agent workflows",
|
|
9
|
+
author: "Nico Bailon",
|
|
10
|
+
license: "MIT",
|
|
11
|
+
repository: {
|
|
12
|
+
type: "git",
|
|
13
|
+
url: "git+https://github.com/nicobailon/pi-subagents.git"
|
|
14
|
+
},
|
|
15
|
+
homepage: "https://github.com/nicobailon/pi-subagents#readme",
|
|
16
|
+
bugs: {
|
|
17
|
+
url: "https://github.com/nicobailon/pi-subagents/issues"
|
|
18
|
+
},
|
|
19
|
+
bin: {
|
|
20
|
+
"pi-subagents": "install.mjs"
|
|
21
|
+
},
|
|
22
|
+
dependencies: {
|
|
23
|
+
"@js-temporal/polyfill": "0.5.1",
|
|
24
|
+
acorn: "8.18.0",
|
|
25
|
+
jiti: "2.7.0",
|
|
26
|
+
undici: "8.10.2",
|
|
27
|
+
yaml: "2.8.3"
|
|
28
|
+
},
|
|
29
|
+
peerDependencies: {
|
|
30
|
+
"@earendil-works/pi-agent-core": "*",
|
|
31
|
+
"@earendil-works/pi-ai": ">=0.86.1",
|
|
32
|
+
"@earendil-works/pi-coding-agent": "*",
|
|
33
|
+
"@earendil-works/pi-tui": "*",
|
|
34
|
+
typebox: "*"
|
|
35
|
+
},
|
|
36
|
+
peerDependenciesMeta: {
|
|
37
|
+
"@earendil-works/pi-agent-core": {
|
|
38
|
+
optional: true
|
|
39
|
+
},
|
|
40
|
+
"@earendil-works/pi-ai": {
|
|
41
|
+
optional: true
|
|
42
|
+
},
|
|
43
|
+
"@earendil-works/pi-coding-agent": {
|
|
44
|
+
optional: true
|
|
45
|
+
},
|
|
46
|
+
"@earendil-works/pi-tui": {
|
|
47
|
+
optional: true
|
|
48
|
+
},
|
|
49
|
+
typebox: {
|
|
50
|
+
optional: true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
keywords: [
|
|
54
|
+
"pi-package",
|
|
55
|
+
"pi",
|
|
56
|
+
"pi-coding-agent",
|
|
57
|
+
"extension",
|
|
58
|
+
"subagents",
|
|
59
|
+
"ai",
|
|
60
|
+
"agents",
|
|
61
|
+
"cli"
|
|
62
|
+
],
|
|
63
|
+
types: "./index.d.ts",
|
|
64
|
+
exports: {
|
|
65
|
+
".": {
|
|
66
|
+
types: "./index.d.ts",
|
|
67
|
+
default: "./index.js"
|
|
68
|
+
},
|
|
69
|
+
"./background-work": {
|
|
70
|
+
types: "./src/api/background-work.d.ts",
|
|
71
|
+
default: "./src/api/background-work.js"
|
|
72
|
+
},
|
|
73
|
+
"./external-job-provider": {
|
|
74
|
+
types: "./src/api/external-job-provider.d.ts",
|
|
75
|
+
default: "./src/api/external-job-provider.js"
|
|
76
|
+
},
|
|
77
|
+
"./external-runs": {
|
|
78
|
+
types: "./src/api/external-runs.d.ts",
|
|
79
|
+
default: "./src/api/external-runs.js"
|
|
80
|
+
},
|
|
81
|
+
"./agents": {
|
|
82
|
+
types: "./src/api/agents.d.ts",
|
|
83
|
+
default: "./src/api/agents.js"
|
|
84
|
+
},
|
|
85
|
+
"./inspectors": {
|
|
86
|
+
types: "./src/api/inspectors.d.ts",
|
|
87
|
+
default: "./src/api/inspectors.js"
|
|
88
|
+
},
|
|
89
|
+
"./delegation": {
|
|
90
|
+
types: "./src/api/delegation.d.ts",
|
|
91
|
+
default: "./src/api/delegation.js"
|
|
92
|
+
},
|
|
93
|
+
"./capability-ceiling": {
|
|
94
|
+
types: "./src/api/capability-ceiling.d.ts",
|
|
95
|
+
default: "./src/api/capability-ceiling.js"
|
|
96
|
+
},
|
|
97
|
+
"./workflow-resources": {
|
|
98
|
+
types: "./src/api/workflow-resources.d.ts",
|
|
99
|
+
default: "./src/api/workflow-resources.js"
|
|
100
|
+
},
|
|
101
|
+
"./required-child-extensions": {
|
|
102
|
+
types: "./src/api/required-child-extensions.d.ts",
|
|
103
|
+
default: "./src/api/required-child-extensions.js"
|
|
104
|
+
},
|
|
105
|
+
"./preflight": {
|
|
106
|
+
types: "./src/api/preflight.d.ts",
|
|
107
|
+
default: "./src/api/preflight.js"
|
|
108
|
+
},
|
|
109
|
+
"./control-channel": {
|
|
110
|
+
types: "./src/api/control-channel.d.ts",
|
|
111
|
+
default: "./src/api/control-channel.js"
|
|
112
|
+
},
|
|
113
|
+
"./intercom-bridge": {
|
|
114
|
+
types: "./src/api/intercom-bridge.d.ts",
|
|
115
|
+
default: "./src/api/intercom-bridge.js"
|
|
116
|
+
},
|
|
117
|
+
"./child-tool-plan": {
|
|
118
|
+
types: "./src/api/child-tool-plan.d.ts",
|
|
119
|
+
default: "./src/api/child-tool-plan.js"
|
|
120
|
+
},
|
|
121
|
+
"./shared-types": {
|
|
122
|
+
types: "./src/api/shared-types.d.ts",
|
|
123
|
+
default: "./src/api/shared-types.js"
|
|
124
|
+
},
|
|
125
|
+
"./project-panes": {
|
|
126
|
+
types: "./src/api/project-panes.d.ts",
|
|
127
|
+
default: "./src/api/project-panes.js"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
pi: {
|
|
131
|
+
extensions: [
|
|
132
|
+
"./index.js"
|
|
133
|
+
],
|
|
134
|
+
skills: [
|
|
135
|
+
"./skills"
|
|
136
|
+
],
|
|
137
|
+
prompts: [
|
|
138
|
+
"./prompts"
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
package_default
|
|
145
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{createRequire as __pvCR}from"node:module";import{fileURLToPath as __pvF}from"node:url";import{dirname as __pvD}from"node:path";const require=__pvCR(import.meta.url);const __pvUrl=(r)=>new URL(r,import.meta.url).href;const __pvFile=(r)=>__pvF(new URL(r,import.meta.url));
|
|
2
|
+
import {
|
|
3
|
+
__name
|
|
4
|
+
} from "./c-CN77DCGF.mjs";
|
|
5
|
+
|
|
6
|
+
// node_modules/@earendil-works/pi-ai/dist/utils/sanitize-unicode.js
|
|
7
|
+
function sanitizeSurrogates(text) {
|
|
8
|
+
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
9
|
+
}
|
|
10
|
+
__name(sanitizeSurrogates, "sanitizeSurrogates");
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
sanitizeSurrogates
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import{createRequire as __pvCR}from"node:module";import{fileURLToPath as __pvF}from"node:url";import{dirname as __pvD}from"node:path";const require=__pvCR(import.meta.url);const __pvUrl=(r)=>new URL(r,import.meta.url).href;const __pvFile=(r)=>__pvF(new URL(r,import.meta.url));
|
|
2
|
+
import {
|
|
3
|
+
writeFileAtomic
|
|
4
|
+
} from "./c-RVJU4O6P.mjs";
|
|
5
|
+
import {
|
|
6
|
+
configPath
|
|
7
|
+
} from "./c-YGQHSVSK.mjs";
|
|
8
|
+
import {
|
|
9
|
+
__name
|
|
10
|
+
} from "./c-CN77DCGF.mjs";
|
|
11
|
+
|
|
12
|
+
// src/config/mediaModels.ts?ext=privateer-gate
|
|
13
|
+
import { readFileSync, mkdirSync } from "node:fs";
|
|
14
|
+
import { dirname } from "node:path";
|
|
15
|
+
var KEY = { image: "imageModel", video: "videoModel" };
|
|
16
|
+
function readConfig() {
|
|
17
|
+
try {
|
|
18
|
+
const cfg = JSON.parse(readFileSync(configPath(), "utf8"));
|
|
19
|
+
return cfg && typeof cfg === "object" && !Array.isArray(cfg) ? cfg : {};
|
|
20
|
+
} catch {
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
__name(readConfig, "readConfig");
|
|
25
|
+
function mediaModelPref(kind) {
|
|
26
|
+
const media = readConfig().media;
|
|
27
|
+
const v = media?.[KEY[kind]];
|
|
28
|
+
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
29
|
+
}
|
|
30
|
+
__name(mediaModelPref, "mediaModelPref");
|
|
31
|
+
function setMediaModelPref(kind, id) {
|
|
32
|
+
const cfg = readConfig();
|
|
33
|
+
const media = { ...cfg.media ?? {} };
|
|
34
|
+
const clean = id?.trim();
|
|
35
|
+
if (clean) media[KEY[kind]] = clean;
|
|
36
|
+
else delete media[KEY[kind]];
|
|
37
|
+
const next = { ...cfg, media };
|
|
38
|
+
if (Object.keys(media).length === 0) delete next.media;
|
|
39
|
+
mkdirSync(dirname(configPath()), { recursive: true });
|
|
40
|
+
writeFileAtomic(configPath(), JSON.stringify(next, null, 2) + "\n");
|
|
41
|
+
}
|
|
42
|
+
__name(setMediaModelPref, "setMediaModelPref");
|
|
43
|
+
function effectiveMediaModel(kind, requested) {
|
|
44
|
+
return typeof requested === "string" && requested.trim() ? requested.trim() : mediaModelPref(kind);
|
|
45
|
+
}
|
|
46
|
+
__name(effectiveMediaModel, "effectiveMediaModel");
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
mediaModelPref,
|
|
50
|
+
setMediaModelPref,
|
|
51
|
+
effectiveMediaModel
|
|
52
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{createRequire as __pvCR}from"node:module";import{fileURLToPath as __pvF}from"node:url";import{dirname as __pvD}from"node:path";const require=__pvCR(import.meta.url);const __pvUrl=(r)=>new URL(r,import.meta.url).href;const __pvFile=(r)=>__pvF(new URL(r,import.meta.url));
|
|
2
|
+
import {
|
|
3
|
+
Code,
|
|
4
|
+
Compile,
|
|
5
|
+
Validator,
|
|
6
|
+
compile_default
|
|
7
|
+
} from "./c-P6N5DQGZ.mjs";
|
|
8
|
+
import "./c-6LOBR4I6.mjs";
|
|
9
|
+
import "./c-L5GHWG5G.mjs";
|
|
10
|
+
import "./c-CN77DCGF.mjs";
|
|
11
|
+
export {
|
|
12
|
+
Code,
|
|
13
|
+
Compile,
|
|
14
|
+
Validator,
|
|
15
|
+
compile_default as default
|
|
16
|
+
};
|