agentbox-sdk 0.1.523 → 0.1.600
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/dist/agents/index.d.ts +2 -2
- package/dist/agents/index.js +1 -1
- package/dist/{chunk-PFGHRDL4.js → chunk-RSURGSVM.js} +97 -87
- package/dist/events/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{types-DM6zUiv1.d.ts → types-ChkpU7Lf.d.ts} +3 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -746,6 +746,17 @@ each run in its own process group can set `processGroup: "inherited"`; that
|
|
|
746
746
|
supervisor is then responsible for stopping the complete group before reporting
|
|
747
747
|
that a run has stopped. This option is unavailable for cloud sandboxes.
|
|
748
748
|
|
|
749
|
+
On Windows, host CLIs start through cross-spawn without a shell: it resolves
|
|
750
|
+
`PATHEXT` and script shebangs, and escapes the arguments `cmd.exe` sees when the
|
|
751
|
+
binary is a batch shim. Windows has no process groups or signals, so stopping a
|
|
752
|
+
host CLI ends its whole process tree with `taskkill /T /F`; a supervisor using
|
|
753
|
+
`processGroup: "inherited"` there still owns everything the tree left behind
|
|
754
|
+
(for example through a Job Object).
|
|
755
|
+
|
|
756
|
+
`provider.args` passes native CLI flags for a run without touching the user's
|
|
757
|
+
configuration. Codex places them before its subcommand (`["-c", "key=value"]`);
|
|
758
|
+
Claude Code accepts `--name` and `--name=value` entries.
|
|
759
|
+
|
|
749
760
|
## Packaging
|
|
750
761
|
|
|
751
762
|
`npm pack` builds the package from maintained TypeScript source before creating
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, al as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, as as SetupLayout, ay as UserContent } from '../types-
|
|
2
|
-
export { a as AgentApprovalMode, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a6 as NativeParkBackgroundWork, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, an as RepoSkillConfig, au as TextPart, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective } from '../types-
|
|
1
|
+
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, al as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, as as SetupLayout, ay as UserContent } from '../types-ChkpU7Lf.js';
|
|
2
|
+
export { a as AgentApprovalMode, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a6 as NativeParkBackgroundWork, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, an as RepoSkillConfig, au as TextPart, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective } from '../types-ChkpU7Lf.js';
|
|
3
3
|
import { S as Sandbox } from '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
export { AgentProvider } from '../enums.js';
|
|
5
5
|
import 'e2b';
|
package/dist/agents/index.js
CHANGED
|
@@ -31,23 +31,30 @@ import {
|
|
|
31
31
|
|
|
32
32
|
// src/agents/Agent.ts
|
|
33
33
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
34
|
-
import
|
|
34
|
+
import path12 from "path";
|
|
35
35
|
|
|
36
36
|
// src/agents/providers/claude-code.ts
|
|
37
37
|
import { randomUUID } from "crypto";
|
|
38
38
|
|
|
39
39
|
// src/agents/transports/spawn.ts
|
|
40
|
-
import { spawn } from "child_process";
|
|
40
|
+
import { execFile, spawn } from "child_process";
|
|
41
|
+
import path from "path";
|
|
41
42
|
import { createInterface } from "readline";
|
|
43
|
+
import crossSpawn from "cross-spawn";
|
|
44
|
+
var windows = process.platform === "win32";
|
|
45
|
+
function killWindowsTree(pid) {
|
|
46
|
+
const taskkill = path.join(process.env.SystemRoot ?? "C:\\Windows", "System32", "taskkill.exe");
|
|
47
|
+
execFile(taskkill, ["/pid", String(pid), "/T", "/F"], { windowsHide: true }, () => void 0);
|
|
48
|
+
}
|
|
42
49
|
function spawnCommand(options) {
|
|
43
|
-
const
|
|
50
|
+
const spawnOptions = {
|
|
44
51
|
cwd: options.cwd,
|
|
45
52
|
env: options.env,
|
|
46
53
|
stdio: "pipe",
|
|
47
|
-
shell: process.platform === "win32",
|
|
48
54
|
windowsHide: true,
|
|
49
|
-
detached: options.processGroup === true &&
|
|
50
|
-
}
|
|
55
|
+
detached: options.processGroup === true && !windows
|
|
56
|
+
};
|
|
57
|
+
const child = (windows ? crossSpawn : spawn)(options.command, options.args ?? [], spawnOptions);
|
|
51
58
|
const exitPromise = new Promise((resolve, reject) => {
|
|
52
59
|
child.once("error", reject);
|
|
53
60
|
child.once("close", (code) => resolve(code ?? 0));
|
|
@@ -56,7 +63,8 @@ function spawnCommand(options) {
|
|
|
56
63
|
let killPromise;
|
|
57
64
|
const signalProcess = (signal) => {
|
|
58
65
|
try {
|
|
59
|
-
if (
|
|
66
|
+
if (windows && child.pid) killWindowsTree(child.pid);
|
|
67
|
+
else if (options.processGroup && child.pid) process.kill(-child.pid, signal);
|
|
60
68
|
else child.kill(signal);
|
|
61
69
|
} catch (error) {
|
|
62
70
|
if (error.code !== "ESRCH") throw error;
|
|
@@ -81,7 +89,7 @@ function spawnCommand(options) {
|
|
|
81
89
|
kill: (signal = "SIGTERM") => killPromise ??= (async () => {
|
|
82
90
|
signalProcess(signal);
|
|
83
91
|
if (await waitForExit(options.terminationTimeoutMs ?? 3e3)) {
|
|
84
|
-
if (options.processGroup &&
|
|
92
|
+
if (options.processGroup && !windows) signalProcess("SIGKILL");
|
|
85
93
|
return;
|
|
86
94
|
}
|
|
87
95
|
signalProcess("SIGKILL");
|
|
@@ -101,7 +109,7 @@ async function* linesFromNodeStream(stream) {
|
|
|
101
109
|
}
|
|
102
110
|
|
|
103
111
|
// src/agents/providers/claude-code.ts
|
|
104
|
-
import
|
|
112
|
+
import path9 from "path";
|
|
105
113
|
|
|
106
114
|
// src/agents/harness-commands.ts
|
|
107
115
|
var MAX_HARNESS_COMMANDS = 500;
|
|
@@ -454,7 +462,7 @@ function questionReply(provider, input, answers) {
|
|
|
454
462
|
|
|
455
463
|
// src/agents/input.ts
|
|
456
464
|
import { readFile } from "fs/promises";
|
|
457
|
-
import
|
|
465
|
+
import path2 from "path";
|
|
458
466
|
import { fileURLToPath } from "url";
|
|
459
467
|
var IMAGE_MEDIA_TYPE_BY_EXTENSION = {
|
|
460
468
|
".gif": "image/gif",
|
|
@@ -794,7 +802,7 @@ async function resolveUrlContent(url, options) {
|
|
|
794
802
|
const buffer = await readFile(filePath);
|
|
795
803
|
return {
|
|
796
804
|
mediaType: resolveMediaType(filePath, options),
|
|
797
|
-
filename: options.filename ??
|
|
805
|
+
filename: options.filename ?? path2.basename(filePath),
|
|
798
806
|
source: {
|
|
799
807
|
type: "base64",
|
|
800
808
|
data: buffer.toString("base64")
|
|
@@ -843,11 +851,11 @@ function resolveMediaType(pathname, options, parsedMediaType) {
|
|
|
843
851
|
);
|
|
844
852
|
}
|
|
845
853
|
function inferMediaType(pathname) {
|
|
846
|
-
const extension =
|
|
854
|
+
const extension = path2.extname(pathname).toLowerCase();
|
|
847
855
|
return FILE_MEDIA_TYPE_BY_EXTENSION[extension];
|
|
848
856
|
}
|
|
849
857
|
function inferFilename(pathname) {
|
|
850
|
-
const name =
|
|
858
|
+
const name = path2.basename(pathname);
|
|
851
859
|
return name && name !== "." ? name : void 0;
|
|
852
860
|
}
|
|
853
861
|
function parseStructuredUrl(value) {
|
|
@@ -890,7 +898,7 @@ function isClaudeTextLikeMediaType(mediaType) {
|
|
|
890
898
|
}
|
|
891
899
|
|
|
892
900
|
// src/agents/config/commands.ts
|
|
893
|
-
import
|
|
901
|
+
import path3 from "path";
|
|
894
902
|
function buildFrontmatter(values) {
|
|
895
903
|
const lines = Object.entries(values).filter(([, value]) => value !== void 0).map(([key, value]) => `${key}: ${JSON.stringify(value)}`);
|
|
896
904
|
return lines.length > 0 ? `---
|
|
@@ -901,7 +909,7 @@ ${lines.join("\n")}
|
|
|
901
909
|
}
|
|
902
910
|
function buildClaudeCommandArtifacts(commands, layout) {
|
|
903
911
|
return (commands ?? []).map((command) => ({
|
|
904
|
-
path:
|
|
912
|
+
path: path3.join(layout.claudeDir, "commands", `${command.name}.md`),
|
|
905
913
|
content: buildFrontmatter({
|
|
906
914
|
description: command.description
|
|
907
915
|
}) + command.template
|
|
@@ -936,7 +944,7 @@ function assertCommandsSupported(provider, commands) {
|
|
|
936
944
|
}
|
|
937
945
|
|
|
938
946
|
// src/agents/config/hooks.ts
|
|
939
|
-
import
|
|
947
|
+
import path4 from "path";
|
|
940
948
|
function hasHookEntries(hooks) {
|
|
941
949
|
if (!hooks || typeof hooks !== "object") {
|
|
942
950
|
return false;
|
|
@@ -1049,7 +1057,7 @@ function buildOpenCodePluginArtifacts(plugins, opencodeDir) {
|
|
|
1049
1057
|
}
|
|
1050
1058
|
seenFileNames.add(fileName);
|
|
1051
1059
|
return {
|
|
1052
|
-
path:
|
|
1060
|
+
path: path4.join(opencodeDir, "plugins", fileName),
|
|
1053
1061
|
content: buildOpenCodePluginSource(plugin)
|
|
1054
1062
|
};
|
|
1055
1063
|
});
|
|
@@ -1296,7 +1304,7 @@ function buildCodexConfigToml(opts = {}) {
|
|
|
1296
1304
|
// src/agents/config/setup.ts
|
|
1297
1305
|
import { mkdir, chmod, rm, writeFile } from "fs/promises";
|
|
1298
1306
|
import os from "os";
|
|
1299
|
-
import
|
|
1307
|
+
import path5 from "path";
|
|
1300
1308
|
function shortLabel(command) {
|
|
1301
1309
|
const oneLine = command.replace(/\s+/g, " ").trim();
|
|
1302
1310
|
return oneLine.length > 60 ? `${oneLine.slice(0, 60)}\u2026` : oneLine;
|
|
@@ -1304,21 +1312,21 @@ function shortLabel(command) {
|
|
|
1304
1312
|
function agentboxRoot(provider, hasSandbox = true, stateDirectory) {
|
|
1305
1313
|
if (stateDirectory !== void 0) {
|
|
1306
1314
|
if (hasSandbox) throw new Error("stateDirectory is only supported for host execution.");
|
|
1307
|
-
if (!
|
|
1308
|
-
return
|
|
1315
|
+
if (!path5.isAbsolute(stateDirectory)) throw new Error("stateDirectory must be an absolute path.");
|
|
1316
|
+
return path5.join(stateDirectory, provider);
|
|
1309
1317
|
}
|
|
1310
|
-
return hasSandbox ? `/tmp/agentbox/${provider}` :
|
|
1318
|
+
return hasSandbox ? `/tmp/agentbox/${provider}` : path5.join(os.tmpdir(), `agentbox-${provider}`);
|
|
1311
1319
|
}
|
|
1312
1320
|
function getAgentLayout(rootDir) {
|
|
1313
|
-
const xdgConfigHome =
|
|
1321
|
+
const xdgConfigHome = path5.join(rootDir, ".config");
|
|
1314
1322
|
return {
|
|
1315
1323
|
rootDir,
|
|
1316
1324
|
homeDir: rootDir,
|
|
1317
1325
|
xdgConfigHome,
|
|
1318
|
-
agentsDir:
|
|
1319
|
-
claudeDir:
|
|
1320
|
-
opencodeDir:
|
|
1321
|
-
codexDir:
|
|
1326
|
+
agentsDir: path5.join(rootDir, ".agents"),
|
|
1327
|
+
claudeDir: path5.join(rootDir, ".claude"),
|
|
1328
|
+
opencodeDir: path5.join(xdgConfigHome, "opencode"),
|
|
1329
|
+
codexDir: path5.join(rootDir, ".codex")
|
|
1322
1330
|
};
|
|
1323
1331
|
}
|
|
1324
1332
|
function buildLayoutEnv(provider, layout) {
|
|
@@ -1329,7 +1337,7 @@ function buildLayoutEnv(provider, layout) {
|
|
|
1329
1337
|
return { CODEX_HOME: layout.codexDir };
|
|
1330
1338
|
case "open-code":
|
|
1331
1339
|
return {
|
|
1332
|
-
OPENCODE_CONFIG:
|
|
1340
|
+
OPENCODE_CONFIG: path5.join(layout.opencodeDir, "agentbox.json"),
|
|
1333
1341
|
OPENCODE_CONFIG_DIR: layout.opencodeDir
|
|
1334
1342
|
};
|
|
1335
1343
|
}
|
|
@@ -1359,7 +1367,7 @@ var HostSetupTarget = class {
|
|
|
1359
1367
|
async () => {
|
|
1360
1368
|
await Promise.all(
|
|
1361
1369
|
files.map(async (entry) => {
|
|
1362
|
-
await mkdir(
|
|
1370
|
+
await mkdir(path5.dirname(entry.path), { recursive: true, mode: 448 });
|
|
1363
1371
|
const content = typeof entry.content === "string" ? entry.content : entry.content;
|
|
1364
1372
|
await writeFile(entry.path, content, { mode: entry.mode ?? 384 });
|
|
1365
1373
|
if (entry.mode && (entry.mode & 73) !== 0) {
|
|
@@ -1578,7 +1586,7 @@ async function activateRtk(target) {
|
|
|
1578
1586
|
|
|
1579
1587
|
// src/agents/config/setup-manifest.ts
|
|
1580
1588
|
import { createHash } from "crypto";
|
|
1581
|
-
import
|
|
1589
|
+
import path6 from "path";
|
|
1582
1590
|
var MANIFEST_FILENAME = "setup-manifest.json";
|
|
1583
1591
|
var TARGET_MANIFEST_FILENAME = "setup-target.json";
|
|
1584
1592
|
var INSTALL_SCRIPT_FILENAME = "install.sh";
|
|
@@ -1632,7 +1640,7 @@ async function preflightSetup(target, setupId, daemon) {
|
|
|
1632
1640
|
debugSetup,
|
|
1633
1641
|
`preflightSetup ${target.provider}`,
|
|
1634
1642
|
async () => {
|
|
1635
|
-
const setupIdFile =
|
|
1643
|
+
const setupIdFile = path6.posix.join(
|
|
1636
1644
|
target.layout.rootDir,
|
|
1637
1645
|
SETUP_ID_FILENAME
|
|
1638
1646
|
);
|
|
@@ -1660,7 +1668,7 @@ async function preflightSetup(target, setupId, daemon) {
|
|
|
1660
1668
|
}
|
|
1661
1669
|
async function markSetupComplete(target, setupId) {
|
|
1662
1670
|
await time(debugSetup, `markSetupComplete ${target.provider}`, async () => {
|
|
1663
|
-
const setupIdFile =
|
|
1671
|
+
const setupIdFile = path6.posix.join(
|
|
1664
1672
|
target.layout.rootDir,
|
|
1665
1673
|
SETUP_ID_FILENAME
|
|
1666
1674
|
);
|
|
@@ -1763,19 +1771,19 @@ async function applyDifferentialSetup(target, artifacts, installCommands) {
|
|
|
1763
1771
|
mode: artifact.executable ? 493 : 420
|
|
1764
1772
|
})),
|
|
1765
1773
|
{
|
|
1766
|
-
path:
|
|
1774
|
+
path: path6.posix.join(rootDir, TARGET_MANIFEST_FILENAME),
|
|
1767
1775
|
content: JSON.stringify(targetForSandbox),
|
|
1768
1776
|
mode: 420
|
|
1769
1777
|
},
|
|
1770
1778
|
{
|
|
1771
|
-
path:
|
|
1779
|
+
path: path6.posix.join(rootDir, INSTALL_SCRIPT_FILENAME),
|
|
1772
1780
|
content: buildInstallScript(rootDir, installCommandsByKey),
|
|
1773
1781
|
mode: 493
|
|
1774
1782
|
}
|
|
1775
1783
|
];
|
|
1776
1784
|
await target.uploadAndRun(
|
|
1777
1785
|
tarballEntries,
|
|
1778
|
-
`bash ${shellQuote(
|
|
1786
|
+
`bash ${shellQuote(path6.posix.join(rootDir, INSTALL_SCRIPT_FILENAME))}`
|
|
1779
1787
|
);
|
|
1780
1788
|
},
|
|
1781
1789
|
() => ({
|
|
@@ -1786,15 +1794,15 @@ async function applyDifferentialSetup(target, artifacts, installCommands) {
|
|
|
1786
1794
|
}
|
|
1787
1795
|
|
|
1788
1796
|
// src/agents/config/skills.ts
|
|
1789
|
-
import
|
|
1797
|
+
import path7 from "path";
|
|
1790
1798
|
function getSkillTargetDir(provider, layout, skillName) {
|
|
1791
1799
|
switch (provider) {
|
|
1792
1800
|
case AgentProvider.ClaudeCode:
|
|
1793
|
-
return
|
|
1801
|
+
return path7.join(layout.claudeDir, "skills", skillName);
|
|
1794
1802
|
case AgentProvider.OpenCode:
|
|
1795
|
-
return
|
|
1803
|
+
return path7.join(layout.opencodeDir, "skills", skillName);
|
|
1796
1804
|
case AgentProvider.Codex:
|
|
1797
|
-
return
|
|
1805
|
+
return path7.join(layout.codexDir, "skills", skillName);
|
|
1798
1806
|
}
|
|
1799
1807
|
}
|
|
1800
1808
|
function skillsCliAgentName(provider) {
|
|
@@ -1810,7 +1818,7 @@ async function prepareSkillArtifacts(provider, skills, layout) {
|
|
|
1810
1818
|
const preparedSkills = [];
|
|
1811
1819
|
for (const skill of skills ?? []) {
|
|
1812
1820
|
const targetDir = getSkillTargetDir(provider, layout, skill.name);
|
|
1813
|
-
const skillFilePath =
|
|
1821
|
+
const skillFilePath = path7.join(targetDir, "SKILL.md");
|
|
1814
1822
|
if (!("files" in skill)) {
|
|
1815
1823
|
installCommands.push(buildSkillsInstallerCommand(provider, skill));
|
|
1816
1824
|
preparedSkills.push({ name: skill.name, skillFilePath });
|
|
@@ -1818,7 +1826,7 @@ async function prepareSkillArtifacts(provider, skills, layout) {
|
|
|
1818
1826
|
}
|
|
1819
1827
|
for (const [relativePath, content] of Object.entries(skill.files)) {
|
|
1820
1828
|
artifacts.push({
|
|
1821
|
-
path:
|
|
1829
|
+
path: path7.join(targetDir, relativePath),
|
|
1822
1830
|
content,
|
|
1823
1831
|
executable: relativePath.startsWith("scripts/")
|
|
1824
1832
|
});
|
|
@@ -1833,7 +1841,7 @@ async function prepareSkillArtifacts(provider, skills, layout) {
|
|
|
1833
1841
|
}
|
|
1834
1842
|
|
|
1835
1843
|
// src/agents/config/subagents.ts
|
|
1836
|
-
import
|
|
1844
|
+
import path8 from "path";
|
|
1837
1845
|
function toToolsArray(tools) {
|
|
1838
1846
|
const filtered = tools?.map((tool) => tool.trim()).filter(Boolean);
|
|
1839
1847
|
return filtered && filtered.length > 0 ? filtered : void 0;
|
|
@@ -1863,7 +1871,7 @@ ${frontmatterLines.join("\n")}
|
|
|
1863
1871
|
${subAgent.instructions.trim()}
|
|
1864
1872
|
`;
|
|
1865
1873
|
return {
|
|
1866
|
-
path:
|
|
1874
|
+
path: path8.join(layout.claudeDir, "agents", `${subAgent.name}.md`),
|
|
1867
1875
|
content
|
|
1868
1876
|
};
|
|
1869
1877
|
});
|
|
@@ -1901,7 +1909,7 @@ function buildCodexSubagentArtifacts(subAgents, layout, defaultModel) {
|
|
|
1901
1909
|
const roleConfigRelativePath = `./agents/${subAgent.name}.toml`;
|
|
1902
1910
|
const roleConfigPromptPath = `../prompts/${subAgent.name}.md`;
|
|
1903
1911
|
artifacts.push({
|
|
1904
|
-
path:
|
|
1912
|
+
path: path8.join(layout.codexDir, "prompts", `${subAgent.name}.md`),
|
|
1905
1913
|
content: subAgent.instructions
|
|
1906
1914
|
});
|
|
1907
1915
|
const tomlLines = [
|
|
@@ -1919,7 +1927,7 @@ function buildCodexSubagentArtifacts(subAgents, layout, defaultModel) {
|
|
|
1919
1927
|
""
|
|
1920
1928
|
);
|
|
1921
1929
|
artifacts.push({
|
|
1922
|
-
path:
|
|
1930
|
+
path: path8.join(layout.codexDir, "agents", `${subAgent.name}.toml`),
|
|
1923
1931
|
content: tomlLines.join("\n")
|
|
1924
1932
|
});
|
|
1925
1933
|
agentSections.push(
|
|
@@ -2608,7 +2616,7 @@ var DAEMON_TOKEN_PATH = "/tmp/agentbox/claude-code/daemon-token";
|
|
|
2608
2616
|
var DAEMON_READY_TIMEOUT_MS = 3e4;
|
|
2609
2617
|
var DAEMON_READY_POLL_INTERVAL_MS = 250;
|
|
2610
2618
|
function claudeConfigDir(options) {
|
|
2611
|
-
return
|
|
2619
|
+
return path9.join(
|
|
2612
2620
|
agentboxRoot(
|
|
2613
2621
|
AgentProvider.ClaudeCode,
|
|
2614
2622
|
Boolean(options.sandbox),
|
|
@@ -2626,7 +2634,9 @@ function buildClaudeQueryOptions(params) {
|
|
|
2626
2634
|
for (const arg of provider?.args ?? []) {
|
|
2627
2635
|
if (typeof arg !== "string") continue;
|
|
2628
2636
|
if (arg.startsWith("--")) {
|
|
2629
|
-
|
|
2637
|
+
const separator = arg.indexOf("=");
|
|
2638
|
+
if (separator === -1) extraArgs[arg.slice(2)] = null;
|
|
2639
|
+
else extraArgs[arg.slice(2, separator)] = arg.slice(separator + 1);
|
|
2630
2640
|
}
|
|
2631
2641
|
}
|
|
2632
2642
|
if (run.systemPrompt) {
|
|
@@ -3418,7 +3428,7 @@ async function ensureClaudeCodeDaemonUncached(options, env) {
|
|
|
3418
3428
|
DAEMON_TOKEN_PATH,
|
|
3419
3429
|
true
|
|
3420
3430
|
);
|
|
3421
|
-
const daemonDir =
|
|
3431
|
+
const daemonDir = path9.posix.dirname(DAEMON_PATH);
|
|
3422
3432
|
const daemonNodeModules = `${daemonDir}/node_modules/@anthropic-ai`;
|
|
3423
3433
|
const launchCommand = [
|
|
3424
3434
|
`NPM_ROOT="$(npm root -g 2>/dev/null)"`,
|
|
@@ -3591,8 +3601,8 @@ var ClaudeCodeAgentAdapter = class {
|
|
|
3591
3601
|
const provider = request.provider;
|
|
3592
3602
|
const sandbox = options.sandbox;
|
|
3593
3603
|
const target = await createSetupTarget(provider, "shared-setup", options);
|
|
3594
|
-
const settingsPath =
|
|
3595
|
-
const mcpConfigPath =
|
|
3604
|
+
const settingsPath = path9.join(target.layout.claudeDir, "settings.json");
|
|
3605
|
+
const mcpConfigPath = path9.join(
|
|
3596
3606
|
target.layout.claudeDir,
|
|
3597
3607
|
"agentbox-mcp.json"
|
|
3598
3608
|
);
|
|
@@ -3616,7 +3626,7 @@ var ClaudeCodeAgentAdapter = class {
|
|
|
3616
3626
|
const artifacts = [
|
|
3617
3627
|
...!sandbox ? [
|
|
3618
3628
|
{
|
|
3619
|
-
path:
|
|
3629
|
+
path: path9.join(
|
|
3620
3630
|
target.layout.claudeDir,
|
|
3621
3631
|
".claude-plugin",
|
|
3622
3632
|
"plugin.json"
|
|
@@ -3673,8 +3683,8 @@ var ClaudeCodeAgentAdapter = class {
|
|
|
3673
3683
|
return;
|
|
3674
3684
|
}
|
|
3675
3685
|
const claudeDir = claudeConfigDir(request.options);
|
|
3676
|
-
const settingsPath =
|
|
3677
|
-
const mcpConfigPath =
|
|
3686
|
+
const settingsPath = path9.join(claudeDir, "settings.json");
|
|
3687
|
+
const mcpConfigPath = path9.join(claudeDir, "agentbox-mcp.json");
|
|
3678
3688
|
const env = {
|
|
3679
3689
|
...request.options.env ?? {},
|
|
3680
3690
|
CLAUDE_CONFIG_DIR: claudeDir,
|
|
@@ -4432,8 +4442,8 @@ async function executeNativeClaude(request, sink, wait = {}) {
|
|
|
4432
4442
|
const options = buildClaudeQueryOptions({
|
|
4433
4443
|
request,
|
|
4434
4444
|
...request.options.configuration === "native" ? {} : {
|
|
4435
|
-
settingsPath:
|
|
4436
|
-
mcpConfigPath:
|
|
4445
|
+
settingsPath: path9.join(claudeDir, "settings.json"),
|
|
4446
|
+
mcpConfigPath: path9.join(claudeDir, "agentbox-mcp.json")
|
|
4437
4447
|
},
|
|
4438
4448
|
// Auth is deliberately CLI-owned. Never copy the user's credential files
|
|
4439
4449
|
// into the generated configuration directory or a task artifact.
|
|
@@ -4630,7 +4640,7 @@ async function executeNativeClaude(request, sink, wait = {}) {
|
|
|
4630
4640
|
|
|
4631
4641
|
// src/agents/providers/codex.ts
|
|
4632
4642
|
import crypto2 from "crypto";
|
|
4633
|
-
import
|
|
4643
|
+
import path10 from "path";
|
|
4634
4644
|
|
|
4635
4645
|
// src/agents/transports/app-server.ts
|
|
4636
4646
|
import { createParser } from "eventsource-parser";
|
|
@@ -4849,7 +4859,7 @@ var JsonRpcLineClient = class {
|
|
|
4849
4859
|
|
|
4850
4860
|
// src/agents/providers/codex.ts
|
|
4851
4861
|
function codexConfigDir(options) {
|
|
4852
|
-
return
|
|
4862
|
+
return path10.join(
|
|
4853
4863
|
agentboxRoot(AgentProvider.Codex, Boolean(options.sandbox), options.stateDirectory),
|
|
4854
4864
|
".codex"
|
|
4855
4865
|
);
|
|
@@ -4858,7 +4868,7 @@ var REMOTE_CODEX_APP_SERVER_PORT = 43181;
|
|
|
4858
4868
|
var REMOTE_CODEX_APP_SERVER_ID = "shared-app-server";
|
|
4859
4869
|
var CODEX_APP_SERVER_TOKEN_FILENAME = "codex-app-server-token";
|
|
4860
4870
|
function defaultRemoteCodexTokenPath() {
|
|
4861
|
-
return
|
|
4871
|
+
return path10.posix.join(
|
|
4862
4872
|
agentboxRoot(AgentProvider.Codex, true),
|
|
4863
4873
|
CODEX_APP_SERVER_TOKEN_FILENAME
|
|
4864
4874
|
);
|
|
@@ -5089,12 +5099,15 @@ function shouldIgnoreCodexError(notification) {
|
|
|
5089
5099
|
return notification.params?.willRetry === true;
|
|
5090
5100
|
}
|
|
5091
5101
|
function buildCodexCommandArgs(binary, args, options) {
|
|
5102
|
+
return [...options?.configuration === "native" ? [] : ["-u", "XDG_CONFIG_HOME"], ...buildCodexCommand(binary, args, options)];
|
|
5103
|
+
}
|
|
5104
|
+
function buildCodexCommand(binary, args, options) {
|
|
5092
5105
|
const overrides = [];
|
|
5093
5106
|
if (options?.provider?.supportsWebsockets === false) {
|
|
5094
5107
|
overrides.push(["supports_websockets", "false"]);
|
|
5095
5108
|
}
|
|
5096
5109
|
const overrideArgs = overrides.flatMap(([k, v]) => ["-c", `${k}=${v}`]);
|
|
5097
|
-
return [...options?.
|
|
5110
|
+
return [binary, ...overrideArgs, ...options?.provider?.args ?? [], ...args];
|
|
5098
5111
|
}
|
|
5099
5112
|
function toNormalizedCodexEvents(runId, notification) {
|
|
5100
5113
|
const base = {
|
|
@@ -5317,7 +5330,7 @@ async function materializeCodexImage(options, part, index) {
|
|
|
5317
5330
|
throw new Error("Cannot attach an empty image to Codex.");
|
|
5318
5331
|
}
|
|
5319
5332
|
const root = agentboxRoot(AgentProvider.Codex, Boolean(options.sandbox), options.stateDirectory);
|
|
5320
|
-
const imagePath =
|
|
5333
|
+
const imagePath = path10.join(
|
|
5321
5334
|
root,
|
|
5322
5335
|
"inputs",
|
|
5323
5336
|
`codex-image-${index}-${crypto2.randomUUID()}${codexImageExtension(part.mediaType)}`
|
|
@@ -5336,7 +5349,7 @@ async function materializeCodexImage(options, part, index) {
|
|
|
5336
5349
|
return imagePath;
|
|
5337
5350
|
}
|
|
5338
5351
|
const fs = await import("fs/promises");
|
|
5339
|
-
await fs.mkdir(
|
|
5352
|
+
await fs.mkdir(path10.dirname(imagePath), { recursive: true });
|
|
5340
5353
|
await fs.writeFile(imagePath, data);
|
|
5341
5354
|
return imagePath;
|
|
5342
5355
|
}
|
|
@@ -5498,13 +5511,13 @@ async function setupCodex(request) {
|
|
|
5498
5511
|
const artifacts = [...subAgentArtifacts];
|
|
5499
5512
|
if (configToml) {
|
|
5500
5513
|
artifacts.push({
|
|
5501
|
-
path:
|
|
5514
|
+
path: path10.join(layoutTarget.layout.codexDir, "config.toml"),
|
|
5502
5515
|
content: configToml
|
|
5503
5516
|
});
|
|
5504
5517
|
}
|
|
5505
5518
|
if (hooksFile) {
|
|
5506
5519
|
artifacts.push({
|
|
5507
|
-
path:
|
|
5520
|
+
path: path10.join(layoutTarget.layout.codexDir, "hooks.json"),
|
|
5508
5521
|
content: JSON.stringify(hooksFile, null, 2)
|
|
5509
5522
|
});
|
|
5510
5523
|
}
|
|
@@ -5523,7 +5536,7 @@ async function setupCodex(request) {
|
|
|
5523
5536
|
...sharedTarget.env,
|
|
5524
5537
|
...options.provider?.env ?? {}
|
|
5525
5538
|
});
|
|
5526
|
-
const tokenFilePath =
|
|
5539
|
+
const tokenFilePath = path10.posix.join(
|
|
5527
5540
|
sharedTarget.layout.rootDir,
|
|
5528
5541
|
CODEX_APP_SERVER_TOKEN_FILENAME
|
|
5529
5542
|
);
|
|
@@ -5559,11 +5572,11 @@ async function setupCodex(request) {
|
|
|
5559
5572
|
);
|
|
5560
5573
|
await applyDifferentialSetup(sharedTarget, serverArtifacts, []);
|
|
5561
5574
|
const binary = options.provider?.binary ?? "codex";
|
|
5562
|
-
const pidFilePath =
|
|
5575
|
+
const pidFilePath = path10.posix.join(
|
|
5563
5576
|
sharedTarget.layout.rootDir,
|
|
5564
5577
|
"codex-app-server.pid"
|
|
5565
5578
|
);
|
|
5566
|
-
const logFilePath =
|
|
5579
|
+
const logFilePath = path10.posix.join(
|
|
5567
5580
|
sharedTarget.layout.rootDir,
|
|
5568
5581
|
"codex-app-server.log"
|
|
5569
5582
|
);
|
|
@@ -5664,7 +5677,7 @@ async function createRuntime(request, inputParts) {
|
|
|
5664
5677
|
...options.configuration === "native" ? {} : { CODEX_HOME: codexDir },
|
|
5665
5678
|
...options.provider?.env ?? {}
|
|
5666
5679
|
});
|
|
5667
|
-
const runtimeCwd = options.configuration === "native" ? options.cwd :
|
|
5680
|
+
const runtimeCwd = options.configuration === "native" ? options.cwd : path10.dirname(codexDir);
|
|
5668
5681
|
const inputItems = await buildCodexInputItems(options, inputParts);
|
|
5669
5682
|
const usesRemoteWebSocket = options.sandbox && options.sandbox.provider !== SandboxProvider.LocalDocker;
|
|
5670
5683
|
if (usesRemoteWebSocket && options.sandbox) {
|
|
@@ -5695,12 +5708,9 @@ async function createRuntime(request, inputParts) {
|
|
|
5695
5708
|
inputItems
|
|
5696
5709
|
};
|
|
5697
5710
|
}
|
|
5698
|
-
const
|
|
5699
|
-
options.provider?.binary ?? "codex",
|
|
5700
|
-
["app-server"],
|
|
5701
|
-
options
|
|
5702
|
-
);
|
|
5711
|
+
const binary = options.provider?.binary ?? "codex";
|
|
5703
5712
|
if (options.sandbox) {
|
|
5713
|
+
const codexArgs = buildCodexCommandArgs(binary, ["app-server"], options);
|
|
5704
5714
|
const handle = await options.sandbox.runAsync(["env", ...codexArgs], {
|
|
5705
5715
|
cwd: runtimeCwd,
|
|
5706
5716
|
env
|
|
@@ -5733,15 +5743,15 @@ async function createRuntime(request, inputParts) {
|
|
|
5733
5743
|
inputItems
|
|
5734
5744
|
};
|
|
5735
5745
|
}
|
|
5746
|
+
const [command, ...args] = buildCodexCommand(binary, ["app-server"], options);
|
|
5747
|
+
const hostEnv = { ...process.env, ...env };
|
|
5748
|
+
if (options.configuration !== "native") delete hostEnv.XDG_CONFIG_HOME;
|
|
5736
5749
|
const processHandle = spawnCommand({
|
|
5737
5750
|
processGroup: options.processGroup !== "inherited",
|
|
5738
|
-
command
|
|
5739
|
-
args
|
|
5751
|
+
command,
|
|
5752
|
+
args,
|
|
5740
5753
|
cwd: runtimeCwd,
|
|
5741
|
-
env:
|
|
5742
|
-
...process.env,
|
|
5743
|
-
...env
|
|
5744
|
-
}
|
|
5754
|
+
env: hostEnv
|
|
5745
5755
|
});
|
|
5746
5756
|
processHandle.child.stderr.resume();
|
|
5747
5757
|
return {
|
|
@@ -5779,7 +5789,7 @@ async function killCodexAppServer(request) {
|
|
|
5779
5789
|
REMOTE_CODEX_APP_SERVER_ID,
|
|
5780
5790
|
options
|
|
5781
5791
|
);
|
|
5782
|
-
const pidFilePath =
|
|
5792
|
+
const pidFilePath = path10.posix.join(
|
|
5783
5793
|
sharedTarget.layout.rootDir,
|
|
5784
5794
|
"codex-app-server.pid"
|
|
5785
5795
|
);
|
|
@@ -6337,14 +6347,14 @@ var CodexAgentAdapter = class {
|
|
|
6337
6347
|
// src/agents/providers/opencode.ts
|
|
6338
6348
|
import { createHash as createHash2, randomBytes, randomUUID as randomUUID2 } from "crypto";
|
|
6339
6349
|
import os2 from "os";
|
|
6340
|
-
import
|
|
6350
|
+
import path11 from "path";
|
|
6341
6351
|
var SANDBOX_OPENCODE_PORT = 4096;
|
|
6342
6352
|
var SANDBOX_OPENCODE_READY_TIMEOUT_MS = 9e4;
|
|
6343
6353
|
var LOCAL_OPENCODE_READY_TIMEOUT_MS = 2e4;
|
|
6344
6354
|
var SHARED_OPENCODE_TARGET_ID = "shared-opencode-server";
|
|
6345
6355
|
var OPENCODE_AUTH_USERNAME = "opencode";
|
|
6346
6356
|
function opencodeServerTokenPath() {
|
|
6347
|
-
return
|
|
6357
|
+
return path11.posix.join(
|
|
6348
6358
|
agentboxRoot(AgentProvider.OpenCode, true),
|
|
6349
6359
|
"opencode-auth-token"
|
|
6350
6360
|
);
|
|
@@ -6630,7 +6640,7 @@ async function ensureSandboxOpenCodeServer(request) {
|
|
|
6630
6640
|
plugins,
|
|
6631
6641
|
target.layout.opencodeDir
|
|
6632
6642
|
);
|
|
6633
|
-
const configPath =
|
|
6643
|
+
const configPath = path11.join(target.layout.opencodeDir, "agentbox.json");
|
|
6634
6644
|
const openCodeConfig = buildOpenCodeConfig(options, interactiveApproval);
|
|
6635
6645
|
const allArtifacts = [
|
|
6636
6646
|
...skillArtifacts,
|
|
@@ -6685,11 +6695,11 @@ async function ensureSandboxOpenCodeServer(request) {
|
|
|
6685
6695
|
await time(debugOpencode, "activateRtk", () => activateRtk(target));
|
|
6686
6696
|
}
|
|
6687
6697
|
const binary = options.provider?.binary ?? "opencode";
|
|
6688
|
-
const pidFilePath =
|
|
6698
|
+
const pidFilePath = path11.posix.join(
|
|
6689
6699
|
target.layout.rootDir,
|
|
6690
6700
|
"opencode-serve.pid"
|
|
6691
6701
|
);
|
|
6692
|
-
const logFilePath =
|
|
6702
|
+
const logFilePath = path11.posix.join(
|
|
6693
6703
|
target.layout.rootDir,
|
|
6694
6704
|
"opencode-serve.log"
|
|
6695
6705
|
);
|
|
@@ -6811,7 +6821,7 @@ async function startLocalOpenCodeServer(request) {
|
|
|
6811
6821
|
const originalOptions = request.options;
|
|
6812
6822
|
const options = {
|
|
6813
6823
|
...originalOptions,
|
|
6814
|
-
stateDirectory:
|
|
6824
|
+
stateDirectory: path11.join(originalOptions.stateDirectory ?? path11.join(os2.tmpdir(), "agentbox-native"), "instances", randomUUID2())
|
|
6815
6825
|
};
|
|
6816
6826
|
let generatedEnv = {};
|
|
6817
6827
|
if (options.configuration !== "native") {
|
|
@@ -6819,7 +6829,7 @@ async function startLocalOpenCodeServer(request) {
|
|
|
6819
6829
|
assertCommandsSupported(request.provider, options.commands);
|
|
6820
6830
|
const target = await createSetupTarget(request.provider, "shared-setup", options);
|
|
6821
6831
|
const { artifacts: skillArtifacts, installCommands } = await prepareSkillArtifacts(request.provider, options.skills, target.layout);
|
|
6822
|
-
const configPath =
|
|
6832
|
+
const configPath = path11.join(target.layout.opencodeDir, "agentbox.json");
|
|
6823
6833
|
const artifacts = [
|
|
6824
6834
|
...skillArtifacts,
|
|
6825
6835
|
...buildOpenCodePluginArtifacts(plugins, target.layout.opencodeDir),
|
|
@@ -6912,7 +6922,7 @@ async function killOpenCodeServer(request) {
|
|
|
6912
6922
|
SHARED_OPENCODE_TARGET_ID,
|
|
6913
6923
|
options
|
|
6914
6924
|
);
|
|
6915
|
-
const pidFilePath =
|
|
6925
|
+
const pidFilePath = path11.posix.join(
|
|
6916
6926
|
target.layout.rootDir,
|
|
6917
6927
|
"opencode-serve.pid"
|
|
6918
6928
|
);
|
|
@@ -7866,7 +7876,7 @@ function createAdapter(provider) {
|
|
|
7866
7876
|
function prepareAgentOptions(_provider, options) {
|
|
7867
7877
|
if (options.stateDirectory !== void 0) {
|
|
7868
7878
|
if (options.sandbox) throw new Error("stateDirectory is only supported for host execution.");
|
|
7869
|
-
if (!
|
|
7879
|
+
if (!path12.isAbsolute(options.stateDirectory)) throw new Error("stateDirectory must be an absolute path.");
|
|
7870
7880
|
}
|
|
7871
7881
|
if (options.sandbox && options.processGroup !== void 0) throw new Error("processGroup is only supported for host execution.");
|
|
7872
7882
|
resolveBackgroundTaskTimeoutMs(options.backgroundTaskTimeoutMs);
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKEvent, C as BackgroundTask, D as BackgroundTasksEvent, Z as HarnessCommandsEvent, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, at as TextDeltaEvent, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aJ as toAISDKEvent, aK as toAISDKStream } from '../types-
|
|
1
|
+
export { A as AISDKEvent, C as BackgroundTask, D as BackgroundTasksEvent, Z as HarnessCommandsEvent, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, at as TextDeltaEvent, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aJ as toAISDKEvent, aK as toAISDKStream } from '../types-ChkpU7Lf.js';
|
|
2
2
|
import { AgentProvider } from '../enums.js';
|
|
3
3
|
import '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
import 'e2b';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKEvent, a as AgentApprovalMode, b as AgentAttachRequest, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, h as AgentOptions, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, o as AgentProviderName, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, r as AgentResult, s as AgentRun, t as AgentRunConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, B as AttachedRun, C as BackgroundTask, D as BackgroundTasksEvent, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, Z as HarnessCommandsEvent, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a6 as NativeParkBackgroundWork, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, an as RepoSkillConfig, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, as as SetupLayout, at as TextDeltaEvent, au as TextPart, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, ay as UserContent, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective, aJ as toAISDKEvent, aK as toAISDKStream } from './types-
|
|
1
|
+
export { A as AISDKEvent, a as AgentApprovalMode, b as AgentAttachRequest, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, h as AgentOptions, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, o as AgentProviderName, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, r as AgentResult, s as AgentRun, t as AgentRunConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, B as AttachedRun, C as BackgroundTask, D as BackgroundTasksEvent, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, Z as HarnessCommandsEvent, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a6 as NativeParkBackgroundWork, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, an as RepoSkillConfig, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, as as SetupLayout, at as TextDeltaEvent, au as TextPart, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, ay as UserContent, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective, aJ as toAISDKEvent, aK as toAISDKStream } from './types-ChkpU7Lf.js';
|
|
2
2
|
export { AGENT_RESERVED_PORTS, Agent, HarnessCapabilities, HarnessCommand, agentboxRoot, collectAllAgentReservedPorts, getAgentLayout, harnessCapabilities, resolveHarnessCommand } from './agents/index.js';
|
|
3
3
|
export { A as AsyncCommandHandle, C as CommandEvent, a as CommandOptions, b as CommandResult, D as DaytonaProviderOptions, c as DaytonaSandboxOptions, E as E2bProviderOptions, d as E2bSandboxOptions, G as GitCloneOptions, L as LocalDockerProviderOptions, e as LocalDockerSandboxOptions, M as ModalProviderOptions, f as ModalSandboxOptions, S as Sandbox, g as SandboxDescriptor, h as SandboxListOptions, i as SandboxOptions, j as SandboxOptionsBase, k as SandboxOptionsMap, l as SandboxProviderName, m as SandboxRaw, n as SandboxRawMap, o as SandboxResourceSpec, T as TarballEntry, V as VercelGitSource, p as VercelProviderOptions, q as VercelSandboxOptions } from './Sandbox-DcKAU-E3.js';
|
|
4
4
|
export { SandboxAdapter, buildGitCloneCommand } from './sandboxes/index.js';
|
package/dist/index.js
CHANGED
|
@@ -665,6 +665,8 @@ interface CodexProviderOptions {
|
|
|
665
665
|
/** Network access for an explicit host workspace-write policy; defaults to false. */
|
|
666
666
|
networkAccess?: boolean;
|
|
667
667
|
binary?: string;
|
|
668
|
+
/** Global CLI arguments placed before the subcommand, e.g. `["-c", "key=value"]`. */
|
|
669
|
+
args?: string[];
|
|
668
670
|
env?: Record<string, string>;
|
|
669
671
|
brokerEndpoint?: string;
|
|
670
672
|
useBroker?: boolean;
|
|
@@ -751,6 +753,7 @@ interface ClaudeCodeProviderOptions {
|
|
|
751
753
|
/** Request fast mode explicitly; false overrides inherited fast settings. */
|
|
752
754
|
fastMode?: boolean;
|
|
753
755
|
binary?: string;
|
|
756
|
+
/** CLI flags as `--name` or `--name=value`; other entries are ignored. */
|
|
754
757
|
args?: string[];
|
|
755
758
|
hooks?: ClaudeCodeHooksConfig;
|
|
756
759
|
permissionMode?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentbox-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.600",
|
|
4
4
|
"description": "Swappable coding agents and sandbox providers for Bun and TypeScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"@daytonaio/sdk": "^0.171.0",
|
|
64
64
|
"@types/debug": "^4.1.13",
|
|
65
65
|
"@vercel/sandbox": "2.0.0-beta.13",
|
|
66
|
+
"cross-spawn": "^7.0.6",
|
|
66
67
|
"debug": "^4.4.3",
|
|
67
68
|
"dockerode": "^4.0.10",
|
|
68
69
|
"e2b": "^2.19.0",
|
|
@@ -74,6 +75,7 @@
|
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
76
77
|
"@eslint/js": "^10.0.1",
|
|
78
|
+
"@types/cross-spawn": "^6.0.6",
|
|
77
79
|
"@types/dockerode": "^3.3.42",
|
|
78
80
|
"@types/node": "^25.5.2",
|
|
79
81
|
"@types/tar-stream": "^3.1.4",
|