brass-runtime 1.13.8 → 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/agent/cli/main.cjs +43 -43
- package/dist/agent/cli/main.js +2 -2
- package/dist/agent/cli/main.mjs +2 -2
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/index.mjs +2 -2
- package/dist/chunk-4N2JEK4H.mjs +3897 -0
- package/dist/chunk-BKBFSOGT.cjs +3897 -0
- package/dist/{chunk-XNOTJSMZ.mjs → chunk-BMRF4FN6.js} +268 -8
- package/dist/chunk-JT7D6M5H.js +3897 -0
- package/dist/{chunk-3R7ZYRK2.mjs → chunk-MQF7HZ7Y.mjs} +1 -1
- package/dist/chunk-SKVY72E5.cjs +667 -0
- package/dist/{chunk-ATHSSDUF.js → chunk-UWMMYKVK.mjs} +268 -8
- package/dist/{chunk-INZBKOHY.js → chunk-WJESVBWN.js} +1 -1
- package/dist/{chunk-XDINDYNA.cjs → chunk-XTMZTVIT.cjs} +134 -134
- package/dist/{effect-ISvXPLgc.d.ts → effect-DM56H743.d.ts} +191 -21
- package/dist/http/index.cjs +808 -140
- package/dist/http/index.d.ts +181 -8
- package/dist/http/index.js +793 -125
- package/dist/http/index.mjs +793 -125
- package/dist/index.cjs +1785 -137
- package/dist/index.d.ts +979 -36
- package/dist/index.js +1675 -27
- package/dist/index.mjs +1675 -27
- package/dist/stream-Oqe6WeLE.d.ts +173 -0
- package/package.json +1 -1
- package/wasm/pkg/brass_runtime_wasm_engine.d.ts +95 -16
- package/wasm/pkg/brass_runtime_wasm_engine.js +715 -15
- package/wasm/pkg/brass_runtime_wasm_engine_bg.wasm +0 -0
- package/wasm/pkg/brass_runtime_wasm_engine_bg.wasm.d.ts +78 -7
- package/dist/chunk-2P4PD6D7.cjs +0 -2557
- package/dist/chunk-7F2R7A2V.mjs +0 -2557
- package/dist/chunk-L6KKKM66.js +0 -2557
- package/dist/chunk-ZTDK2DLG.cjs +0 -407
- package/dist/stream-BvukHxCv.d.ts +0 -66
package/dist/agent/cli/main.cjs
CHANGED
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkXTMZTVITcjs = require('../../chunk-XTMZTVIT.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkBKBFSOGTcjs = require('../../chunk-BKBFSOGT.cjs');
|
|
27
27
|
|
|
28
28
|
// src/agent/cli/approvals.ts
|
|
29
29
|
var dynamicImport = new Function("specifier", "return import(specifier)");
|
|
@@ -39,7 +39,7 @@ var answerToResponse = (answer, request) => {
|
|
|
39
39
|
return { type: "rejected", reason: `Unrecognized approval answer: ${answer}` };
|
|
40
40
|
};
|
|
41
41
|
var makeCliApprovalService = (options = {}) => ({
|
|
42
|
-
request: (request) =>
|
|
42
|
+
request: (request) => _chunkBKBFSOGTcjs.async.call(void 0, (_env, cb) => {
|
|
43
43
|
let closed = false;
|
|
44
44
|
let rl;
|
|
45
45
|
dynamicImport("node:readline/promises").then(({ createInterface }) => {
|
|
@@ -51,7 +51,7 @@ var makeCliApprovalService = (options = {}) => ({
|
|
|
51
51
|
_optionalChain([output, 'optionalAccess', _ => _.write, 'optionalCall', _2 => _2(`
|
|
52
52
|
Approval required (${request.risk})
|
|
53
53
|
`)]);
|
|
54
|
-
_optionalChain([output, 'optionalAccess', _3 => _3.write, 'optionalCall', _4 => _4(`Action: ${
|
|
54
|
+
_optionalChain([output, 'optionalAccess', _3 => _3.write, 'optionalCall', _4 => _4(`Action: ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, request.action)}
|
|
55
55
|
`)]);
|
|
56
56
|
_optionalChain([output, 'optionalAccess', _5 => _5.write, 'optionalCall', _6 => _6(`Reason: ${request.reason}
|
|
57
57
|
`)]);
|
|
@@ -60,14 +60,14 @@ Approval required (${request.risk})
|
|
|
60
60
|
if (answer === void 0 || closed) return;
|
|
61
61
|
closed = true;
|
|
62
62
|
_optionalChain([rl, 'optionalAccess', _7 => _7.close, 'optionalCall', _8 => _8()]);
|
|
63
|
-
cb(
|
|
63
|
+
cb(_chunkBKBFSOGTcjs.Exit.succeed(answerToResponse(answer, request)));
|
|
64
64
|
}).catch((cause) => {
|
|
65
65
|
if (closed) return;
|
|
66
66
|
closed = true;
|
|
67
67
|
_optionalChain([rl, 'optionalAccess', _9 => _9.close, 'optionalCall', _10 => _10()]);
|
|
68
68
|
cb(
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
_chunkBKBFSOGTcjs.Exit.failCause(
|
|
70
|
+
_chunkBKBFSOGTcjs.Cause.fail({
|
|
71
71
|
_tag: "AgentLoopError",
|
|
72
72
|
message: `Approval prompt failed: ${String(cause)}`
|
|
73
73
|
})
|
|
@@ -290,7 +290,7 @@ var newestVsix = (extensionDir) => {
|
|
|
290
290
|
var push = (checks, check) => {
|
|
291
291
|
checks.push(check);
|
|
292
292
|
};
|
|
293
|
-
var runAgentDoctor =
|
|
293
|
+
var runAgentDoctor = _chunkBKBFSOGTcjs.async.call(void 0, options) => {
|
|
294
294
|
const cwd = _path.resolve.call(void 0, options.cwd);
|
|
295
295
|
const checks = [];
|
|
296
296
|
const repoRoot = _nullishCoalesce(findPackageRoot(cwd, "brass-runtime"), () => ( findPackageRoot(process.cwd(), "brass-runtime")));
|
|
@@ -877,7 +877,7 @@ var nextStepsForProfile = (profile) => {
|
|
|
877
877
|
}
|
|
878
878
|
return steps;
|
|
879
879
|
};
|
|
880
|
-
var writeInitFile =
|
|
880
|
+
var writeInitFile = _chunkBKBFSOGTcjs.async.call(void 0, options) => {
|
|
881
881
|
const path = _path.resolve.call(void 0, options.cwd, options.relativePath);
|
|
882
882
|
const exists = _fs.existsSync.call(void 0, path);
|
|
883
883
|
const status = exists ? options.force ? "overwritten" : "skipped" : "created";
|
|
@@ -892,7 +892,7 @@ var writeInitFile = _chunk2P4PD6D7cjs.async.call(void 0, options) => {
|
|
|
892
892
|
bytes: Buffer.byteLength(options.content, "utf8")
|
|
893
893
|
};
|
|
894
894
|
};
|
|
895
|
-
var initializeAgentWorkspace =
|
|
895
|
+
var initializeAgentWorkspace = _chunkBKBFSOGTcjs.async.call(void 0, options) => {
|
|
896
896
|
const cwd = _path.resolve.call(void 0, options.cwd);
|
|
897
897
|
const profile = _nullishCoalesce(options.profile, () => ( "default"));
|
|
898
898
|
const force = _nullishCoalesce(options.force, () => ( false));
|
|
@@ -964,7 +964,7 @@ var printAgentInitResult = (result) => {
|
|
|
964
964
|
|
|
965
965
|
// src/agent/cli/main.ts
|
|
966
966
|
var dynamicImport2 = new Function("specifier", "return import(specifier)");
|
|
967
|
-
var readPatchFile =
|
|
967
|
+
var readPatchFile = _chunkBKBFSOGTcjs.async.call(void 0, cwd, patchFile) => {
|
|
968
968
|
const nodePath = await dynamicImport2("node:path");
|
|
969
969
|
const nodeFs = await dynamicImport2("node:fs/promises");
|
|
970
970
|
return nodeFs.readFile(nodePath.resolve(cwd, patchFile), "utf8");
|
|
@@ -1098,7 +1098,7 @@ var parseCliArgs = (argv) => {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
if (arg === "--preset" || arg.startsWith("--preset=")) {
|
|
1100
1100
|
const [value, nextIndex] = readFlagValue(argv, index, "--preset");
|
|
1101
|
-
if (!
|
|
1101
|
+
if (!_chunkXTMZTVITcjs.isAgentPreset.call(void 0, value)) {
|
|
1102
1102
|
throw new Error("--preset requires one of: fix-tests, inspect, typecheck, lint");
|
|
1103
1103
|
}
|
|
1104
1104
|
preset = value;
|
|
@@ -1274,7 +1274,7 @@ var parseBatchGoal = (value, path) => {
|
|
|
1274
1274
|
if (cwd !== void 0 && typeof cwd !== "string") throw new Error(`${path}.cwd must be a string.`);
|
|
1275
1275
|
if (patchFile !== void 0 && typeof patchFile !== "string") throw new Error(`${path}.patchFile must be a string.`);
|
|
1276
1276
|
if (saveRunDir !== void 0 && typeof saveRunDir !== "string") throw new Error(`${path}.saveRunDir must be a string.`);
|
|
1277
|
-
if (preset !== void 0 && (typeof preset !== "string" || !
|
|
1277
|
+
if (preset !== void 0 && (typeof preset !== "string" || !_chunkXTMZTVITcjs.isAgentPreset.call(void 0, preset))) {
|
|
1278
1278
|
throw new Error(`${path}.preset must be one of: fix-tests, inspect, typecheck, lint.`);
|
|
1279
1279
|
}
|
|
1280
1280
|
if (mode !== void 0 && (typeof mode !== "string" || !isAgentMode(mode))) {
|
|
@@ -1301,7 +1301,7 @@ var parseBatchGoalsJson = (value) => {
|
|
|
1301
1301
|
if (!rawGoals) throw new Error("Batch file must be a JSON array or an object with a goals array.");
|
|
1302
1302
|
return rawGoals.map((goal, index) => parseBatchGoal(goal, `goals[${index}]`));
|
|
1303
1303
|
};
|
|
1304
|
-
var readBatchFile =
|
|
1304
|
+
var readBatchFile = _chunkBKBFSOGTcjs.async.call(void 0, cwd, batchFile) => {
|
|
1305
1305
|
const nodePath = await dynamicImport2("node:path");
|
|
1306
1306
|
const nodeFs = await dynamicImport2("node:fs/promises");
|
|
1307
1307
|
const path = nodePath.isAbsolute(batchFile) ? batchFile : nodePath.resolve(cwd, batchFile);
|
|
@@ -1318,7 +1318,7 @@ var readBatchFile = _chunk2P4PD6D7cjs.async.call(void 0, cwd, batchFile) => {
|
|
|
1318
1318
|
var resolveBatchGoalText = (item, fallbackPatchFile) => {
|
|
1319
1319
|
if (typeof item === "string") return item;
|
|
1320
1320
|
if (item.goal) return item.goal;
|
|
1321
|
-
if (item.preset) return
|
|
1321
|
+
if (item.preset) return _chunkXTMZTVITcjs.goalForAgentPreset.call(void 0, item.preset);
|
|
1322
1322
|
if (_nullishCoalesce(item.patchFile, () => ( fallbackPatchFile))) return "apply supplied patch";
|
|
1323
1323
|
return "";
|
|
1324
1324
|
};
|
|
@@ -1344,8 +1344,8 @@ var resolveBatchRuns = (items, parsed, config) => items.map((item, index) => {
|
|
|
1344
1344
|
...saveRunDir ? { saveRunDir } : {}
|
|
1345
1345
|
};
|
|
1346
1346
|
});
|
|
1347
|
-
var resolveParsedConfig =
|
|
1348
|
-
const workspaceDiscovery =
|
|
1347
|
+
var resolveParsedConfig = _chunkBKBFSOGTcjs.async.call(void 0, parsed) => {
|
|
1348
|
+
const workspaceDiscovery = _chunkXTMZTVITcjs.discoverNodeWorkspaceRoot.call(void 0, parsed.cwd, {
|
|
1349
1349
|
enabled: parsed.discoverWorkspace
|
|
1350
1350
|
});
|
|
1351
1351
|
const cwdResolved = workspaceDiscovery.cwd;
|
|
@@ -1353,7 +1353,7 @@ var resolveParsedConfig = _chunk2P4PD6D7cjs.async.call(void 0, parsed) => {
|
|
|
1353
1353
|
...parsed,
|
|
1354
1354
|
cwd: cwdResolved
|
|
1355
1355
|
};
|
|
1356
|
-
const loaded = await
|
|
1356
|
+
const loaded = await _chunkXTMZTVITcjs.loadNodeAgentConfig.call(void 0, {
|
|
1357
1357
|
cwd: cwdResolved,
|
|
1358
1358
|
configPath: parsed.configPath,
|
|
1359
1359
|
noConfig: parsed.noConfig
|
|
@@ -1369,7 +1369,7 @@ var resolveParsedConfig = _chunk2P4PD6D7cjs.async.call(void 0, parsed) => {
|
|
|
1369
1369
|
const batchRuns = resolveBatchRuns(batchItems, parsedAtWorkspace, loaded.config);
|
|
1370
1370
|
return {
|
|
1371
1371
|
...parsedAtWorkspace,
|
|
1372
|
-
goalText: parsed.goalText || (parsed.preset ?
|
|
1372
|
+
goalText: parsed.goalText || (parsed.preset ? _chunkXTMZTVITcjs.goalForAgentPreset.call(void 0, parsed.preset) : parsed.patchFile ? "apply supplied patch" : parsed.goalText),
|
|
1373
1373
|
mode: parsed.modeSpecified ? parsed.mode : parsed.preset === "inspect" ? "read-only" : _nullishCoalesce(loaded.config.mode, () => ( parsed.mode)),
|
|
1374
1374
|
approval: parsed.approvalSpecified ? parsed.approval : _nullishCoalesce(loaded.config.approval, () => ( parsed.approval)),
|
|
1375
1375
|
config: loaded.config,
|
|
@@ -1493,7 +1493,7 @@ var envByName = (name) => name ? process.env[name] : void 0;
|
|
|
1493
1493
|
var makeGoogleLLMFromEnv = (config) => {
|
|
1494
1494
|
const apiKey = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(envByName(_optionalChain([config, 'optionalAccess', _39 => _39.apiKeyEnv])), () => ( process.env.BRASS_GOOGLE_API_KEY)), () => ( process.env.GOOGLE_API_KEY)), () => ( process.env.GEMINI_API_KEY));
|
|
1495
1495
|
if (!apiKey) return void 0;
|
|
1496
|
-
return
|
|
1496
|
+
return _chunkXTMZTVITcjs.makeGoogleGenerativeAILLM.call(void 0, {
|
|
1497
1497
|
apiKey,
|
|
1498
1498
|
model: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(process.env.BRASS_GOOGLE_MODEL, () => ( process.env.BRASS_LLM_MODEL)), () => ( _optionalChain([config, 'optionalAccess', _40 => _40.model]))), () => ( "gemini-2.5-flash")),
|
|
1499
1499
|
apiVersion: _nullishCoalesce(_nullishCoalesce(process.env.BRASS_GOOGLE_API_VERSION, () => ( _optionalChain([config, 'optionalAccess', _41 => _41.apiVersion]))), () => ( "v1beta")),
|
|
@@ -1511,12 +1511,12 @@ var makeOpenAICompatibleLLMFromEnv = (config) => {
|
|
|
1511
1511
|
const apiKey = _nullishCoalesce(envByName(_optionalChain([config, 'optionalAccess', _50 => _50.apiKeyEnv])), () => ( process.env.BRASS_LLM_API_KEY));
|
|
1512
1512
|
const model = _nullishCoalesce(_nullishCoalesce(process.env.BRASS_LLM_MODEL, () => ( _optionalChain([config, 'optionalAccess', _51 => _51.model]))), () => ( "gpt-4.1"));
|
|
1513
1513
|
if (!endpoint || !apiKey) return void 0;
|
|
1514
|
-
return
|
|
1514
|
+
return _chunkXTMZTVITcjs.makeOpenAICompatibleLLM.call(void 0, { endpoint, apiKey, model });
|
|
1515
1515
|
};
|
|
1516
1516
|
var makeLLMFromEnv = (config) => {
|
|
1517
1517
|
const provider = _optionalChain([(_nullishCoalesce(process.env.BRASS_LLM_PROVIDER, () => ( _optionalChain([config, 'optionalAccess', _52 => _52.provider])))), 'optionalAccess', _53 => _53.trim, 'call', _54 => _54(), 'access', _55 => _55.toLowerCase, 'call', _56 => _56()]);
|
|
1518
1518
|
const fakeResponse = _nullishCoalesce(process.env.BRASS_FAKE_LLM_RESPONSE, () => ( _optionalChain([config, 'optionalAccess', _57 => _57.fakeResponse])));
|
|
1519
|
-
if (provider === "fake") return
|
|
1519
|
+
if (provider === "fake") return _chunkXTMZTVITcjs.makeFakeLLM.call(void 0, { content: fakeResponse });
|
|
1520
1520
|
if (provider === "google" || provider === "gemini") {
|
|
1521
1521
|
const google = makeGoogleLLMFromEnv(config);
|
|
1522
1522
|
if (!google) {
|
|
@@ -1538,7 +1538,7 @@ var makeLLMFromEnv = (config) => {
|
|
|
1538
1538
|
if (provider) {
|
|
1539
1539
|
throw new Error(`Unsupported LLM provider: ${provider}`);
|
|
1540
1540
|
}
|
|
1541
|
-
return _nullishCoalesce(_nullishCoalesce(makeGoogleLLMFromEnv(config), () => ( makeOpenAICompatibleLLMFromEnv(config))), () => (
|
|
1541
|
+
return _nullishCoalesce(_nullishCoalesce(makeGoogleLLMFromEnv(config), () => ( makeOpenAICompatibleLLMFromEnv(config))), () => ( _chunkXTMZTVITcjs.makeFakeLLM.call(void 0, { content: fakeResponse })));
|
|
1542
1542
|
};
|
|
1543
1543
|
var parseApprovalModeFromEnv = () => {
|
|
1544
1544
|
const raw = _optionalChain([process, 'access', _58 => _58.env, 'access', _59 => _59.BRASS_AGENT_APPROVAL, 'optionalAccess', _60 => _60.trim, 'call', _61 => _61(), 'access', _62 => _62.toLowerCase, 'call', _63 => _63()]);
|
|
@@ -1561,9 +1561,9 @@ var makeApprovalServiceFromCli = (parsed) => {
|
|
|
1561
1561
|
const mode = resolveApprovalMode(parsed);
|
|
1562
1562
|
switch (mode) {
|
|
1563
1563
|
case "approve":
|
|
1564
|
-
return
|
|
1564
|
+
return _chunkXTMZTVITcjs.autoApproveApprovals;
|
|
1565
1565
|
case "deny":
|
|
1566
|
-
return
|
|
1566
|
+
return _chunkXTMZTVITcjs.makeAutoDenyApprovals.call(void 0, "Approval rejected because the CLI is running without interactive input. Use --yes to auto-approve.");
|
|
1567
1567
|
case "interactive":
|
|
1568
1568
|
return makeCliApprovalService();
|
|
1569
1569
|
}
|
|
@@ -1695,32 +1695,32 @@ var createHumanEventSink = (configPath) => ({
|
|
|
1695
1695
|
console.log("");
|
|
1696
1696
|
break;
|
|
1697
1697
|
case "agent.action.started":
|
|
1698
|
-
console.log(`\u2192 ${
|
|
1698
|
+
console.log(`\u2192 ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)}`);
|
|
1699
1699
|
break;
|
|
1700
1700
|
case "agent.action.completed": {
|
|
1701
|
-
const status =
|
|
1702
|
-
console.log(`${statusIcon2(status)} ${
|
|
1701
|
+
const status = _chunkXTMZTVITcjs.observationStatus.call(void 0, event.observation);
|
|
1702
|
+
console.log(`${statusIcon2(status)} ${_chunkXTMZTVITcjs.summarizeAgentObservation.call(void 0, event.observation)} ${formatDuration(event.durationMs)}`);
|
|
1703
1703
|
break;
|
|
1704
1704
|
}
|
|
1705
1705
|
case "agent.action.failed":
|
|
1706
1706
|
if (event.error._tag !== "ToolTimeout" && event.error._tag !== "PermissionDenied" && event.error._tag !== "ApprovalRejected") {
|
|
1707
|
-
console.log(`\u2717 ${
|
|
1707
|
+
console.log(`\u2717 ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)} failed with ${event.error._tag} ${formatDuration(event.durationMs)}`);
|
|
1708
1708
|
}
|
|
1709
1709
|
break;
|
|
1710
1710
|
case "agent.tool.timeout":
|
|
1711
|
-
console.log(`! ${
|
|
1711
|
+
console.log(`! ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)} timed out after ${event.timeoutMs}ms`);
|
|
1712
1712
|
break;
|
|
1713
1713
|
case "agent.permission.denied":
|
|
1714
|
-
console.log(`\u2717 ${
|
|
1714
|
+
console.log(`\u2717 ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)} denied: ${event.reason}`);
|
|
1715
1715
|
break;
|
|
1716
1716
|
case "agent.approval.requested":
|
|
1717
|
-
console.log(`? approval required for ${
|
|
1717
|
+
console.log(`? approval required for ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)} (${event.risk})`);
|
|
1718
1718
|
break;
|
|
1719
1719
|
case "agent.approval.resolved":
|
|
1720
1720
|
if (event.approved) {
|
|
1721
|
-
console.log(`\u2713 approval granted for ${
|
|
1721
|
+
console.log(`\u2713 approval granted for ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)}`);
|
|
1722
1722
|
} else {
|
|
1723
|
-
console.log(`\u2717 approval rejected for ${
|
|
1723
|
+
console.log(`\u2717 approval rejected for ${_chunkXTMZTVITcjs.summarizeAgentAction.call(void 0, event.action)}${event.reason ? `: ${event.reason}` : ""}`);
|
|
1724
1724
|
}
|
|
1725
1725
|
break;
|
|
1726
1726
|
case "agent.patch.applied":
|
|
@@ -1748,7 +1748,7 @@ var createProtocolEventSink = (options = {}) => ({
|
|
|
1748
1748
|
});
|
|
1749
1749
|
var safeFilePart = (value) => value.toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 80) || "run";
|
|
1750
1750
|
var markdownEscape = (value) => value.replace(/\\/g, "\\\\").replace(/`/g, "\\`");
|
|
1751
|
-
var writeRunArtifacts =
|
|
1751
|
+
var writeRunArtifacts = _chunkBKBFSOGTcjs.async.call(void 0, state, outputDir, options) => {
|
|
1752
1752
|
const nodePath = await dynamicImport2("node:path");
|
|
1753
1753
|
const nodeFs = await dynamicImport2("node:fs/promises");
|
|
1754
1754
|
const dir = nodePath.isAbsolute(outputDir) ? outputDir : nodePath.resolve(state.goal.cwd, outputDir);
|
|
@@ -1825,13 +1825,13 @@ var printHumanFinalSummary = (state) => {
|
|
|
1825
1825
|
};
|
|
1826
1826
|
var makeEventsSink = (parsed, compactOptions) => parsed.output === "human" ? createHumanEventSink(parsed.resolvedConfigPath) : parsed.output === "events-json" ? createJsonEventSink(compactOptions) : parsed.output === "protocol-json" ? createProtocolEventSink(compactOptions) : void 0;
|
|
1827
1827
|
var makeAgentEnv = (parsed, events) => {
|
|
1828
|
-
const shell =
|
|
1828
|
+
const shell = _chunkXTMZTVITcjs.NodeShell;
|
|
1829
1829
|
return {
|
|
1830
1830
|
shell,
|
|
1831
|
-
fs:
|
|
1832
|
-
patch:
|
|
1831
|
+
fs: _chunkXTMZTVITcjs.makeNodeFileSystem.call(void 0, shell),
|
|
1832
|
+
patch: _chunkXTMZTVITcjs.makeNodePatchService.call(void 0, shell),
|
|
1833
1833
|
llm: makeLLMFromEnv(parsed.config.llm),
|
|
1834
|
-
permissions:
|
|
1834
|
+
permissions: _chunkXTMZTVITcjs.makeConfiguredPermissions.call(void 0, parsed.config.permissions),
|
|
1835
1835
|
approvals: makeApprovalServiceFromCli(parsed),
|
|
1836
1836
|
...events ? { events } : {},
|
|
1837
1837
|
...parsed.config.tools ? { toolPolicies: parsed.config.tools } : {}
|
|
@@ -1846,12 +1846,12 @@ var singleRunFromParsed = (parsed) => ({
|
|
|
1846
1846
|
...parsed.patchFile ? { patchFile: parsed.patchFile } : {},
|
|
1847
1847
|
...parsed.saveRunDir ? { saveRunDir: parsed.saveRunDir } : {}
|
|
1848
1848
|
});
|
|
1849
|
-
var runCliAgent =
|
|
1849
|
+
var runCliAgent = _chunkBKBFSOGTcjs.async.call(void 0, parsed, run, compactOptions, events) => {
|
|
1850
1850
|
const env = makeAgentEnv(parsed, events);
|
|
1851
|
-
const runtime = new (0,
|
|
1851
|
+
const runtime = new (0, _chunkBKBFSOGTcjs.Runtime)({ env });
|
|
1852
1852
|
const initialPatch = run.patchFile ? await readPatchFile(run.cwd, run.patchFile) : void 0;
|
|
1853
1853
|
const state = await runtime.toPromise(
|
|
1854
|
-
|
|
1854
|
+
_chunkXTMZTVITcjs.runAgent.call(void 0, runtime, {
|
|
1855
1855
|
id: `agent-${Date.now()}-${run.index + 1}`,
|
|
1856
1856
|
cwd: run.cwd,
|
|
1857
1857
|
text: run.goalText,
|
|
@@ -1919,7 +1919,7 @@ var printWorkspaceWhere = (parsed) => {
|
|
|
1919
1919
|
if (result.configPath) console.log(`config: ${result.configPath}`);
|
|
1920
1920
|
if (result.envFiles.length > 0) console.log(`env: ${result.envFiles.join(", ")}`);
|
|
1921
1921
|
};
|
|
1922
|
-
var main =
|
|
1922
|
+
var main = _chunkBKBFSOGTcjs.async.call(void 0, ) => {
|
|
1923
1923
|
const parsed = await resolveParsedConfig(parseCliArgs(process.argv.slice(2)));
|
|
1924
1924
|
const isBatch = parsed.batchRuns.length > 0;
|
|
1925
1925
|
if (parsed.showHelp) {
|
package/dist/agent/cli/main.js
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
runAgent,
|
|
18
18
|
summarizeAgentAction,
|
|
19
19
|
summarizeAgentObservation
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-WJESVBWN.js";
|
|
21
21
|
import {
|
|
22
22
|
Cause,
|
|
23
23
|
Exit,
|
|
24
24
|
Runtime,
|
|
25
25
|
async
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-JT7D6M5H.js";
|
|
27
27
|
|
|
28
28
|
// src/agent/cli/approvals.ts
|
|
29
29
|
var dynamicImport = new Function("specifier", "return import(specifier)");
|
package/dist/agent/cli/main.mjs
CHANGED
|
@@ -17,13 +17,13 @@ import {
|
|
|
17
17
|
runAgent,
|
|
18
18
|
summarizeAgentAction,
|
|
19
19
|
summarizeAgentObservation
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-MQF7HZ7Y.mjs";
|
|
21
21
|
import {
|
|
22
22
|
Cause,
|
|
23
23
|
Exit,
|
|
24
24
|
Runtime,
|
|
25
25
|
async
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-4N2JEK4H.mjs";
|
|
27
27
|
|
|
28
28
|
// src/agent/cli/approvals.ts
|
|
29
29
|
var dynamicImport = new Function("specifier", "return import(specifier)");
|
package/dist/agent/index.cjs
CHANGED
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
|
|
76
|
-
var
|
|
77
|
-
require('../chunk-
|
|
76
|
+
var _chunkXTMZTVITcjs = require('../chunk-XTMZTVIT.cjs');
|
|
77
|
+
require('../chunk-BKBFSOGT.cjs');
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
|
|
@@ -150,4 +150,4 @@ require('../chunk-2P4PD6D7.cjs');
|
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
|
|
153
|
-
exports.AGENT_CONFIG_FILE_NAMES =
|
|
153
|
+
exports.AGENT_CONFIG_FILE_NAMES = _chunkXTMZTVITcjs.AGENT_CONFIG_FILE_NAMES; exports.NodeShell = _chunkXTMZTVITcjs.NodeShell; exports.PROJECT_LOCKFILE_PROBES = _chunkXTMZTVITcjs.PROJECT_LOCKFILE_PROBES; exports.PROJECT_PROFILE_PROBES = _chunkXTMZTVITcjs.PROJECT_PROFILE_PROBES; exports.autoApproveApprovals = _chunkXTMZTVITcjs.autoApproveApprovals; exports.canAutoRollback = _chunkXTMZTVITcjs.canAutoRollback; exports.canRequestPatchRepair = _chunkXTMZTVITcjs.canRequestPatchRepair; exports.commandForScript = _chunkXTMZTVITcjs.commandForScript; exports.decideNextAction = _chunkXTMZTVITcjs.decideNextAction; exports.defaultPermissions = _chunkXTMZTVITcjs.defaultPermissions; exports.deriveContextSearchQueries = _chunkXTMZTVITcjs.deriveContextSearchQueries; exports.describeCommandDiscovery = _chunkXTMZTVITcjs.describeCommandDiscovery; exports.describeContextDiscovery = _chunkXTMZTVITcjs.describeContextDiscovery; exports.describeLanguagePolicy = _chunkXTMZTVITcjs.describeLanguagePolicy; exports.describePatchQuality = _chunkXTMZTVITcjs.describePatchQuality; exports.describeProjectProfile = _chunkXTMZTVITcjs.describeProjectProfile; exports.describeRollbackSafety = _chunkXTMZTVITcjs.describeRollbackSafety; exports.discoverNodeWorkspaceRoot = _chunkXTMZTVITcjs.discoverNodeWorkspaceRoot; exports.discoverPackageManager = _chunkXTMZTVITcjs.discoverPackageManager; exports.discoverProjectProfile = _chunkXTMZTVITcjs.discoverProjectProfile; exports.discoverValidationCommands = _chunkXTMZTVITcjs.discoverValidationCommands; exports.emitAgentEvent = _chunkXTMZTVITcjs.emitAgentEvent; exports.emitAgentEvents = _chunkXTMZTVITcjs.emitAgentEvents; exports.errorEventFor = _chunkXTMZTVITcjs.errorEventFor; exports.extractLikelyFilePaths = _chunkXTMZTVITcjs.extractLikelyFilePaths; exports.extractPatchPaths = _chunkXTMZTVITcjs.extractPatchPaths; exports.extractUnifiedDiff = _chunkXTMZTVITcjs.extractUnifiedDiff; exports.goalForAgentPreset = _chunkXTMZTVITcjs.goalForAgentPreset; exports.inferUserLanguage = _chunkXTMZTVITcjs.inferUserLanguage; exports.initialAgentState = _chunkXTMZTVITcjs.initialAgentState; exports.invokeAction = _chunkXTMZTVITcjs.invokeAction; exports.isAgentConfigApprovalMode = _chunkXTMZTVITcjs.isAgentConfigApprovalMode; exports.isAgentConfigLLMProvider = _chunkXTMZTVITcjs.isAgentConfigLLMProvider; exports.isAgentConfigMode = _chunkXTMZTVITcjs.isAgentConfigMode; exports.isAgentPreset = _chunkXTMZTVITcjs.isAgentPreset; exports.isRedactionEnabled = _chunkXTMZTVITcjs.isRedactionEnabled; exports.isTerminal = _chunkXTMZTVITcjs.isTerminal; exports.latestUnappliedPatch = _chunkXTMZTVITcjs.latestUnappliedPatch; exports.loadNodeAgentConfig = _chunkXTMZTVITcjs.loadNodeAgentConfig; exports.makeAutoDenyApprovals = _chunkXTMZTVITcjs.makeAutoDenyApprovals; exports.makeConfiguredPermissions = _chunkXTMZTVITcjs.makeConfiguredPermissions; exports.makeFakeLLM = _chunkXTMZTVITcjs.makeFakeLLM; exports.makeGoogleGenerativeAILLM = _chunkXTMZTVITcjs.makeGoogleGenerativeAILLM; exports.makeNodeFileSystem = _chunkXTMZTVITcjs.makeNodeFileSystem; exports.makeNodePatchService = _chunkXTMZTVITcjs.makeNodePatchService; exports.makeOpenAICompatibleLLM = _chunkXTMZTVITcjs.makeOpenAICompatibleLLM; exports.nextContextDiscoveryAction = _chunkXTMZTVITcjs.nextContextDiscoveryAction; exports.nextProjectProbeAction = _chunkXTMZTVITcjs.nextProjectProbeAction; exports.nextUnrunValidationCommand = _chunkXTMZTVITcjs.nextUnrunValidationCommand; exports.nowMillis = _chunkXTMZTVITcjs.nowMillis; exports.observationEventFor = _chunkXTMZTVITcjs.observationEventFor; exports.observationStatus = _chunkXTMZTVITcjs.observationStatus; exports.parseProjectPackageJson = _chunkXTMZTVITcjs.parseProjectPackageJson; exports.patchQualitySummary = _chunkXTMZTVITcjs.patchQualitySummary; exports.patchRepairAttemptsUsed = _chunkXTMZTVITcjs.patchRepairAttemptsUsed; exports.patchValidationStatus = _chunkXTMZTVITcjs.patchValidationStatus; exports.projectProfileProbePending = _chunkXTMZTVITcjs.projectProfileProbePending; exports.redactText = _chunkXTMZTVITcjs.redactText; exports.reduceAgentState = _chunkXTMZTVITcjs.reduceAgentState; exports.responseLanguageName = _chunkXTMZTVITcjs.responseLanguageName; exports.retry = _chunkXTMZTVITcjs.retry; exports.rollbackSafetySummary = _chunkXTMZTVITcjs.rollbackSafetySummary; exports.runAgent = _chunkXTMZTVITcjs.runAgent; exports.runStatusFor = _chunkXTMZTVITcjs.runStatusFor; exports.shouldContinueRollbackStack = _chunkXTMZTVITcjs.shouldContinueRollbackStack; exports.sleep = _chunkXTMZTVITcjs.sleep; exports.spanishLike = _chunkXTMZTVITcjs.spanishLike; exports.splitCommand = _chunkXTMZTVITcjs.splitCommand; exports.summarizeAgentAction = _chunkXTMZTVITcjs.summarizeAgentAction; exports.summarizeAgentObservation = _chunkXTMZTVITcjs.summarizeAgentObservation; exports.summarizeContextDiscovery = _chunkXTMZTVITcjs.summarizeContextDiscovery; exports.timeout = _chunkXTMZTVITcjs.timeout; exports.unappliedPatchStack = _chunkXTMZTVITcjs.unappliedPatchStack; exports.workspaceValidationStatus = _chunkXTMZTVITcjs.workspaceValidationStatus;
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as Async,
|
|
1
|
+
import { A as Async, R as Runtime, S as Scope } from '../effect-DM56H743.js';
|
|
2
2
|
|
|
3
3
|
type AgentMode = "read-only" | "propose" | "write" | "autonomous";
|
|
4
4
|
type AgentPackageManager = "npm" | "pnpm" | "yarn" | "bun";
|
package/dist/agent/index.js
CHANGED
|
@@ -73,8 +73,8 @@ import {
|
|
|
73
73
|
timeout,
|
|
74
74
|
unappliedPatchStack,
|
|
75
75
|
workspaceValidationStatus
|
|
76
|
-
} from "../chunk-
|
|
77
|
-
import "../chunk-
|
|
76
|
+
} from "../chunk-WJESVBWN.js";
|
|
77
|
+
import "../chunk-JT7D6M5H.js";
|
|
78
78
|
export {
|
|
79
79
|
AGENT_CONFIG_FILE_NAMES,
|
|
80
80
|
NodeShell,
|
package/dist/agent/index.mjs
CHANGED
|
@@ -73,8 +73,8 @@ import {
|
|
|
73
73
|
timeout,
|
|
74
74
|
unappliedPatchStack,
|
|
75
75
|
workspaceValidationStatus
|
|
76
|
-
} from "../chunk-
|
|
77
|
-
import "../chunk-
|
|
76
|
+
} from "../chunk-MQF7HZ7Y.mjs";
|
|
77
|
+
import "../chunk-4N2JEK4H.mjs";
|
|
78
78
|
export {
|
|
79
79
|
AGENT_CONFIG_FILE_NAMES,
|
|
80
80
|
NodeShell,
|