@sandagent/runner-cli 0.9.16 → 0.9.18
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/bundle.mjs +38 -2
- package/package.json +3 -3
package/dist/bundle.mjs
CHANGED
|
@@ -1209,7 +1209,7 @@ function createOpenCodeRunner(options = {}) {
|
|
|
1209
1209
|
import { appendFileSync as appendFileSync2, existsSync as existsSync4, unlinkSync as unlinkSync3 } from "node:fs";
|
|
1210
1210
|
import { join as join5 } from "node:path";
|
|
1211
1211
|
import { getModel } from "@mariozechner/pi-ai";
|
|
1212
|
-
import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@mariozechner/pi-coding-agent";
|
|
1212
|
+
import { AuthStorage, createAgentSession, createBashTool, ModelRegistry, SessionManager } from "@mariozechner/pi-coding-agent";
|
|
1213
1213
|
|
|
1214
1214
|
// ../../packages/runner-pi/dist/sandagent-resource-loader.js
|
|
1215
1215
|
import { existsSync as existsSync3 } from "node:fs";
|
|
@@ -1297,6 +1297,40 @@ var SandagentResourceLoader = class {
|
|
|
1297
1297
|
};
|
|
1298
1298
|
|
|
1299
1299
|
// ../../packages/runner-pi/dist/pi-runner.js
|
|
1300
|
+
function redactSecrets(text, secrets) {
|
|
1301
|
+
if (Object.keys(secrets).length === 0)
|
|
1302
|
+
return text;
|
|
1303
|
+
let result = text;
|
|
1304
|
+
for (const [k, v] of Object.entries(secrets)) {
|
|
1305
|
+
const keyPattern = new RegExp(`${k}\\s*=\\s*\\S*`, "g");
|
|
1306
|
+
result = result.replace(keyPattern, "");
|
|
1307
|
+
if (v.length > 0)
|
|
1308
|
+
result = result.split(v).join("");
|
|
1309
|
+
}
|
|
1310
|
+
return result;
|
|
1311
|
+
}
|
|
1312
|
+
function buildEnvInjectedBashTool(cwd, extraEnv) {
|
|
1313
|
+
const bashAgentTool = createBashTool(cwd, {
|
|
1314
|
+
spawnHook: (ctx) => ({
|
|
1315
|
+
...ctx,
|
|
1316
|
+
env: { ...ctx.env, ...extraEnv }
|
|
1317
|
+
})
|
|
1318
|
+
});
|
|
1319
|
+
return {
|
|
1320
|
+
name: bashAgentTool.name,
|
|
1321
|
+
label: bashAgentTool.label ?? "bash",
|
|
1322
|
+
description: bashAgentTool.description,
|
|
1323
|
+
// biome-ignore lint/suspicious/noExplicitAny: TypeBox schema from pi internals
|
|
1324
|
+
parameters: bashAgentTool.parameters,
|
|
1325
|
+
async execute(toolCallId, params, signal, onUpdate) {
|
|
1326
|
+
const result = await bashAgentTool.execute(toolCallId, params, signal, onUpdate);
|
|
1327
|
+
if (result?.content && Array.isArray(result.content)) {
|
|
1328
|
+
result.content = result.content.map((c) => c.type === "text" && typeof c.text === "string" ? { ...c, text: redactSecrets(c.text, extraEnv) } : c);
|
|
1329
|
+
}
|
|
1330
|
+
return result;
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1300
1334
|
var LOG_PREFIX2 = "[sandagent:pi]";
|
|
1301
1335
|
function parseModelSpec(model) {
|
|
1302
1336
|
const trimmed = model.trim();
|
|
@@ -1467,12 +1501,14 @@ function createPiRunner(options = {}) {
|
|
|
1467
1501
|
if (resourceLoader) {
|
|
1468
1502
|
await resourceLoader.reload();
|
|
1469
1503
|
}
|
|
1504
|
+
const customTools = options.env && Object.keys(options.env).length > 0 ? [buildEnvInjectedBashTool(cwd, options.env)] : [];
|
|
1470
1505
|
const { session } = await createAgentSession({
|
|
1471
1506
|
cwd,
|
|
1472
1507
|
model,
|
|
1473
1508
|
sessionManager,
|
|
1474
1509
|
modelRegistry,
|
|
1475
|
-
resourceLoader
|
|
1510
|
+
resourceLoader,
|
|
1511
|
+
customTools
|
|
1476
1512
|
});
|
|
1477
1513
|
if (options.systemPrompt != null && options.systemPrompt !== "") {
|
|
1478
1514
|
const existing = session.agent.state.systemPrompt ?? "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandagent/runner-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.18",
|
|
4
4
|
"description": "SandAgent Runner CLI - Like gemini-cli or claude-code, runs in your local terminal with AI SDK UI streaming",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"typescript": "^5.3.0",
|
|
55
55
|
"vitest": "^1.6.1",
|
|
56
56
|
"@sandagent/runner-core": "0.1.1-beta.0",
|
|
57
|
-
"@sandagent/runner-codex": "0.6.2",
|
|
58
57
|
"@sandagent/runner-claude": "0.6.2",
|
|
59
58
|
"@sandagent/runner-gemini": "0.6.2",
|
|
60
59
|
"@sandagent/runner-opencode": "0.6.2",
|
|
61
|
-
"@sandagent/runner-pi": "0.6.4-beta.0"
|
|
60
|
+
"@sandagent/runner-pi": "0.6.4-beta.0",
|
|
61
|
+
"@sandagent/runner-codex": "0.6.2"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "tsc && pnpm bundle",
|