agentbox-sdk 0.1.307 → 0.1.309
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/{Sandbox-K6VNqKeo.d.ts → Sandbox-DcKAU-E3.d.ts} +8 -0
- package/dist/agents/index.d.ts +26 -4
- package/dist/agents/index.js +7 -3
- package/dist/{chunk-QNNAAVJV.js → chunk-HYHLKO3L.js} +64 -2
- package/dist/{chunk-7GOUX3OB.js → chunk-VBMMNUB7.js} +19 -5
- package/dist/events/index.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -3
- package/dist/sandboxes/index.d.ts +18 -2
- package/dist/sandboxes/index.js +1 -1
- package/dist/{types-CZdyLzA4.d.ts → types-DmkbgYmn.d.ts} +11 -2
- package/package.json +1 -1
|
@@ -258,6 +258,14 @@ declare class Sandbox<P extends SandboxProviderName = SandboxProviderName> {
|
|
|
258
258
|
* cached internally).
|
|
259
259
|
*/
|
|
260
260
|
findOrProvision(): Promise<this>;
|
|
261
|
+
/**
|
|
262
|
+
* Attach to an existing sandbox by id, skipping the
|
|
263
|
+
* `findMatchingSandbox` lookup. Useful when the caller just created the
|
|
264
|
+
* sandbox (e.g. via a provider-native fork API) and knows its id.
|
|
265
|
+
* Repeated calls are cheap. Currently only the Daytona adapter
|
|
266
|
+
* implements this; other providers throw.
|
|
267
|
+
*/
|
|
268
|
+
attachById(id: string): Promise<this>;
|
|
261
269
|
openPort(port: number): Promise<this>;
|
|
262
270
|
setSecret(name: string, value: string): this;
|
|
263
271
|
setSecrets(values: Record<string, string>): this;
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, a2 as RawAgentEvent, b as AgentAttachRequest, y as AttachedRun } 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, C as ClaudeCodeAgentOptions, z as ClaudeCodeHookConfig, B as ClaudeCodeHookEvent, D as ClaudeCodeHookHandler, E as ClaudeCodeHookMatcherGroup, F as ClaudeCodeHooksConfig, G as ClaudeCodeProviderOptions, H as CodexAgentOptions, I as CodexCommandHook, J as CodexHookEvent, K as CodexHookMatcherGroup, L as CodexHooksConfig, M as CodexProviderOptions, N as DataContent, O as EmbeddedSkillConfig, P as FilePart, Q as ImagePart, X as OpenCodeAgentOptions, Y as OpenCodePluginConfig, Z as OpenCodePluginEvent, _ as OpenCodePluginHookConfig, $ as OpenCodeProviderOptions, a4 as RepoSkillConfig,
|
|
3
|
-
import { S as Sandbox } from '../Sandbox-
|
|
1
|
+
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, a2 as RawAgentEvent, b as AgentAttachRequest, y as AttachedRun, a9 as SetupLayout } from '../types-DmkbgYmn.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, C as ClaudeCodeAgentOptions, z as ClaudeCodeHookConfig, B as ClaudeCodeHookEvent, D as ClaudeCodeHookHandler, E as ClaudeCodeHookMatcherGroup, F as ClaudeCodeHooksConfig, G as ClaudeCodeProviderOptions, H as CodexAgentOptions, I as CodexCommandHook, J as CodexHookEvent, K as CodexHookMatcherGroup, L as CodexHooksConfig, M as CodexProviderOptions, N as DataContent, O as EmbeddedSkillConfig, P as FilePart, Q as ImagePart, X as OpenCodeAgentOptions, Y as OpenCodePluginConfig, Z as OpenCodePluginEvent, _ as OpenCodePluginHookConfig, $ as OpenCodeProviderOptions, a4 as RepoSkillConfig, ab as TextPart, af as UserContent, ag as UserContentPart } from '../types-DmkbgYmn.js';
|
|
3
|
+
import { S as Sandbox } from '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
export { AgentProvider } from '../enums.js';
|
|
5
5
|
import 'e2b';
|
|
6
6
|
import '@vercel/sandbox';
|
|
@@ -67,6 +67,28 @@ declare class Agent<P extends AgentProviderName = AgentProviderName> {
|
|
|
67
67
|
static attach<P extends AgentProviderName>(request: AgentAttachRequest<P>): Promise<AttachedRun>;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/**
|
|
71
|
+
* The on-disk root for every artifact agentbox writes for a given
|
|
72
|
+
* provider. Deterministic — same inputs, same path — so `setup()` and
|
|
73
|
+
* `execute()` agree on file locations without any data channel between
|
|
74
|
+
* them.
|
|
75
|
+
*
|
|
76
|
+
* - **Sandbox**: `/tmp/agentbox/<provider>` inside the sandbox.
|
|
77
|
+
* - **Local host**: `<os.tmpdir()>/agentbox-<provider>` on the host.
|
|
78
|
+
*/
|
|
79
|
+
declare function agentboxRoot(provider: AgentProviderName, hasSandbox?: boolean): string;
|
|
80
|
+
/**
|
|
81
|
+
* Resolve the on-disk layout (config dirs per provider) for the given
|
|
82
|
+
* agentbox root. Public so external consumers (e.g. agentbox-driven
|
|
83
|
+
* orchestrators) can locate where each CLI writes its files without
|
|
84
|
+
* having to hardcode the layout shape.
|
|
85
|
+
*
|
|
86
|
+
* Pair with {@link agentboxRoot} to get the root for `(provider,
|
|
87
|
+
* hasSandbox)` first, then call this to expand it into the per-provider
|
|
88
|
+
* dirs (`claudeDir`, `codexDir`, `opencodeDir`, …).
|
|
89
|
+
*/
|
|
90
|
+
declare function getAgentLayout(rootDir: string): SetupLayout;
|
|
91
|
+
|
|
70
92
|
/**
|
|
71
93
|
* Ports each agent harness needs exposed on its sandbox in order to reach
|
|
72
94
|
* its app-server (or equivalent local server). These are used to:
|
|
@@ -85,4 +107,4 @@ declare class Agent<P extends AgentProviderName = AgentProviderName> {
|
|
|
85
107
|
declare const AGENT_RESERVED_PORTS: Record<AgentProviderName, readonly number[]>;
|
|
86
108
|
declare function collectAllAgentReservedPorts(): number[];
|
|
87
109
|
|
|
88
|
-
export { AGENT_RESERVED_PORTS, Agent, AgentAttachRequest, AgentOptions, AgentProviderName, AgentResult, AgentRun, AgentRunConfig, AttachedRun, collectAllAgentReservedPorts };
|
|
110
|
+
export { AGENT_RESERVED_PORTS, Agent, AgentAttachRequest, AgentOptions, AgentProviderName, AgentResult, AgentRun, AgentRunConfig, AttachedRun, SetupLayout, agentboxRoot, collectAllAgentReservedPorts, getAgentLayout };
|
package/dist/agents/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Agent
|
|
3
|
-
|
|
2
|
+
Agent,
|
|
3
|
+
agentboxRoot,
|
|
4
|
+
getAgentLayout
|
|
5
|
+
} from "../chunk-VBMMNUB7.js";
|
|
4
6
|
import "../chunk-ZDSHOGJ4.js";
|
|
5
7
|
import {
|
|
6
8
|
AGENT_RESERVED_PORTS,
|
|
@@ -14,5 +16,7 @@ export {
|
|
|
14
16
|
AGENT_RESERVED_PORTS,
|
|
15
17
|
Agent,
|
|
16
18
|
AgentProvider,
|
|
17
|
-
|
|
19
|
+
agentboxRoot,
|
|
20
|
+
collectAllAgentReservedPorts,
|
|
21
|
+
getAgentLayout
|
|
18
22
|
};
|
|
@@ -144,6 +144,44 @@ var SandboxAdapter = class {
|
|
|
144
144
|
}
|
|
145
145
|
await this.provisioning;
|
|
146
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Attach to an already-existing sandbox by id. Skips the
|
|
149
|
+
* `findMatchingSandbox` lookup that `findOrProvision` does — useful when
|
|
150
|
+
* the caller just created the sandbox (e.g. via a fork API) and knows
|
|
151
|
+
* its id directly. Idempotent: a second call is a no-op once attached.
|
|
152
|
+
*
|
|
153
|
+
* Default implementation throws — providers opt in by overriding
|
|
154
|
+
* `attachExisting`. Currently implemented by the Daytona adapter.
|
|
155
|
+
*/
|
|
156
|
+
async attachById(id) {
|
|
157
|
+
if (this.provisioned) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
if (!this.provisioning) {
|
|
161
|
+
this.provisioning = time(
|
|
162
|
+
debugSandbox,
|
|
163
|
+
`attachById [${this.provider}] ${id}`,
|
|
164
|
+
async () => {
|
|
165
|
+
await this.attachExisting(id);
|
|
166
|
+
this.provisioned = true;
|
|
167
|
+
}
|
|
168
|
+
).finally(() => {
|
|
169
|
+
this.provisioning = void 0;
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
await this.provisioning;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Provider hook for `attachById`. Adopt the sandbox with the given id
|
|
176
|
+
* (e.g. fetch via the provider client, mark `isWarmFlag`, start if
|
|
177
|
+
* paused). Throw if the provider doesn't support direct attach.
|
|
178
|
+
*/
|
|
179
|
+
async attachExisting(id) {
|
|
180
|
+
void id;
|
|
181
|
+
throw new Error(
|
|
182
|
+
`attachById is not supported by the ${this.provider} provider.`
|
|
183
|
+
);
|
|
184
|
+
}
|
|
147
185
|
/**
|
|
148
186
|
* Throw a consistent error when a method that needs a provisioned
|
|
149
187
|
* sandbox is called before `findOrProvision()`. Provider adapters call
|
|
@@ -238,6 +276,19 @@ var DaytonaSandboxAdapter = class extends SandboxAdapter {
|
|
|
238
276
|
get id() {
|
|
239
277
|
return this.sandbox?.id;
|
|
240
278
|
}
|
|
279
|
+
async attachExisting(id) {
|
|
280
|
+
const existing = await this.client.get(id);
|
|
281
|
+
if (!existing) {
|
|
282
|
+
throw new Error(`Daytona sandbox ${id} not found`);
|
|
283
|
+
}
|
|
284
|
+
this.sandbox = existing;
|
|
285
|
+
const state = existing.state ?? "unknown";
|
|
286
|
+
const isWarm = state === "started";
|
|
287
|
+
if (!isWarm) {
|
|
288
|
+
await existing.start();
|
|
289
|
+
}
|
|
290
|
+
this.isWarmFlag = isWarm;
|
|
291
|
+
}
|
|
241
292
|
async provision() {
|
|
242
293
|
const existing = await this.findMatchingSandbox();
|
|
243
294
|
if (existing) {
|
|
@@ -284,9 +335,9 @@ var DaytonaSandboxAdapter = class extends SandboxAdapter {
|
|
|
284
335
|
this.requireProvisioned();
|
|
285
336
|
const sandbox = this.requireSandbox();
|
|
286
337
|
const result = await sandbox.process.executeCommand(
|
|
287
|
-
|
|
338
|
+
this.buildSessionCommand(command, options),
|
|
288
339
|
options?.cwd ?? this.workingDir,
|
|
289
|
-
|
|
340
|
+
void 0,
|
|
290
341
|
options?.timeoutMs ? Math.ceil(options.timeoutMs / 1e3) : void 0
|
|
291
342
|
);
|
|
292
343
|
const output = result.result ?? "";
|
|
@@ -2120,6 +2171,17 @@ var Sandbox = class {
|
|
|
2120
2171
|
);
|
|
2121
2172
|
return this;
|
|
2122
2173
|
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Attach to an existing sandbox by id, skipping the
|
|
2176
|
+
* `findMatchingSandbox` lookup. Useful when the caller just created the
|
|
2177
|
+
* sandbox (e.g. via a provider-native fork API) and knows its id.
|
|
2178
|
+
* Repeated calls are cheap. Currently only the Daytona adapter
|
|
2179
|
+
* implements this; other providers throw.
|
|
2180
|
+
*/
|
|
2181
|
+
async attachById(id) {
|
|
2182
|
+
await this.adapter.attachById(id);
|
|
2183
|
+
return this;
|
|
2184
|
+
}
|
|
2123
2185
|
async openPort(port) {
|
|
2124
2186
|
await time(
|
|
2125
2187
|
debugSandbox,
|
|
@@ -893,10 +893,10 @@ function shortLabel(command) {
|
|
|
893
893
|
const oneLine = command.replace(/\s+/g, " ").trim();
|
|
894
894
|
return oneLine.length > 60 ? `${oneLine.slice(0, 60)}\u2026` : oneLine;
|
|
895
895
|
}
|
|
896
|
-
function agentboxRoot(provider, hasSandbox) {
|
|
896
|
+
function agentboxRoot(provider, hasSandbox = true) {
|
|
897
897
|
return hasSandbox ? `/tmp/agentbox/${provider}` : path4.join(os.tmpdir(), `agentbox-${provider}`);
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function getAgentLayout(rootDir) {
|
|
900
900
|
const xdgConfigHome = path4.join(rootDir, ".config");
|
|
901
901
|
return {
|
|
902
902
|
rootDir,
|
|
@@ -1108,7 +1108,7 @@ ${output}` : "";
|
|
|
1108
1108
|
async function createSetupTarget(provider, setupId, options) {
|
|
1109
1109
|
return time(debugRuntime, `createSetupTarget ${provider}`, async () => {
|
|
1110
1110
|
void setupId;
|
|
1111
|
-
const layout =
|
|
1111
|
+
const layout = getAgentLayout(
|
|
1112
1112
|
agentboxRoot(provider, Boolean(options.sandbox))
|
|
1113
1113
|
);
|
|
1114
1114
|
if (options.sandbox) {
|
|
@@ -1152,7 +1152,14 @@ async function activateRtk(target) {
|
|
|
1152
1152
|
const env = rtkRedirectEnv(target);
|
|
1153
1153
|
const dirsToEnsure = [target.layout.claudeDir, target.layout.codexDir].map((d) => `'${d}'`).join(" ");
|
|
1154
1154
|
const cmd = `mkdir -p ${dirsToEnsure} && rtk init -g ${args}`.trim();
|
|
1155
|
-
|
|
1155
|
+
try {
|
|
1156
|
+
await target.runCommand(cmd, env);
|
|
1157
|
+
} catch (error) {
|
|
1158
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1159
|
+
console.warn(
|
|
1160
|
+
`[rtk] activation failed for ${target.provider}; agent will run without the token-saving proxy: ${message}`
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1156
1163
|
}
|
|
1157
1164
|
|
|
1158
1165
|
// src/agents/config/setup-manifest.ts
|
|
@@ -3857,12 +3864,17 @@ function buildOpenCodeConfig(options, interactiveApproval) {
|
|
|
3857
3864
|
])
|
|
3858
3865
|
);
|
|
3859
3866
|
const googleBaseUrl = options.env?.GOOGLE_BASE_URL;
|
|
3867
|
+
const openRouterBaseUrl = options.env?.OPENROUTER_BASE_URL;
|
|
3860
3868
|
return {
|
|
3861
3869
|
$schema: "https://opencode.ai/config.json",
|
|
3862
3870
|
...mcpConfig ? { mcp: mcpConfig } : {},
|
|
3863
3871
|
...commandsConfig ? { command: commandsConfig } : {},
|
|
3864
3872
|
provider: {
|
|
3865
|
-
openrouter: {
|
|
3873
|
+
openrouter: {
|
|
3874
|
+
options: {
|
|
3875
|
+
baseURL: openRouterBaseUrl || "https://openrouter.ai/api/v1"
|
|
3876
|
+
}
|
|
3877
|
+
},
|
|
3866
3878
|
...googleBaseUrl ? { google: { options: { baseURL: googleBaseUrl } } } : {}
|
|
3867
3879
|
},
|
|
3868
3880
|
agent: {
|
|
@@ -5149,5 +5161,7 @@ var Agent = class {
|
|
|
5149
5161
|
};
|
|
5150
5162
|
|
|
5151
5163
|
export {
|
|
5164
|
+
agentboxRoot,
|
|
5165
|
+
getAgentLayout,
|
|
5152
5166
|
Agent
|
|
5153
5167
|
};
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AISDKEvent, R as MessageCompletedEvent, S as MessageInjectedEvent, T as MessageStartedEvent, U as NormalizedAgentEvent, V as NormalizedAgentEventBase, W as NormalizedAgentEventType, a0 as PermissionRequestedEvent, a1 as PermissionResolvedEvent, a2 as RawAgentEvent, a3 as ReasoningDeltaEvent, a5 as RunCancelledEvent, a6 as RunCompletedEvent, a7 as RunErrorEvent, a8 as RunStartedEvent,
|
|
1
|
+
export { A as AISDKEvent, R as MessageCompletedEvent, S as MessageInjectedEvent, T as MessageStartedEvent, U as NormalizedAgentEvent, V as NormalizedAgentEventBase, W as NormalizedAgentEventType, a0 as PermissionRequestedEvent, a1 as PermissionResolvedEvent, a2 as RawAgentEvent, a3 as ReasoningDeltaEvent, a5 as RunCancelledEvent, a6 as RunCompletedEvent, a7 as RunErrorEvent, a8 as RunStartedEvent, aa as TextDeltaEvent, ac as ToolCallCompletedEvent, ad as ToolCallDeltaEvent, ae as ToolCallStartedEvent, ah as createNormalizedEvent, ai as normalizeRawAgentEvent, aj as toAISDKEvent, ak as toAISDKStream } from '../types-DmkbgYmn.js';
|
|
2
2
|
import { AgentProvider } from '../enums.js';
|
|
3
|
-
import '../Sandbox-
|
|
3
|
+
import '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
import 'e2b';
|
|
5
5
|
import '@vercel/sandbox';
|
|
6
6
|
import '@daytonaio/sdk';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 AttachedRun, C as ClaudeCodeAgentOptions, z as ClaudeCodeHookConfig, B as ClaudeCodeHookEvent, D as ClaudeCodeHookHandler, E as ClaudeCodeHookMatcherGroup, F as ClaudeCodeHooksConfig, G as ClaudeCodeProviderOptions, H as CodexAgentOptions, I as CodexCommandHook, J as CodexHookEvent, K as CodexHookMatcherGroup, L as CodexHooksConfig, M as CodexProviderOptions, N as DataContent, O as EmbeddedSkillConfig, P as FilePart, Q as ImagePart, R as MessageCompletedEvent, S as MessageInjectedEvent, T as MessageStartedEvent, U as NormalizedAgentEvent, V as NormalizedAgentEventBase, W as NormalizedAgentEventType, X as OpenCodeAgentOptions, Y as OpenCodePluginConfig, Z as OpenCodePluginEvent, _ as OpenCodePluginHookConfig, $ as OpenCodeProviderOptions, a0 as PermissionRequestedEvent, a1 as PermissionResolvedEvent, a2 as RawAgentEvent, a3 as ReasoningDeltaEvent, a4 as RepoSkillConfig, a5 as RunCancelledEvent, a6 as RunCompletedEvent, a7 as RunErrorEvent, a8 as RunStartedEvent, a9 as
|
|
2
|
-
export { AGENT_RESERVED_PORTS, Agent, collectAllAgentReservedPorts } from './agents/index.js';
|
|
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-
|
|
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 AttachedRun, C as ClaudeCodeAgentOptions, z as ClaudeCodeHookConfig, B as ClaudeCodeHookEvent, D as ClaudeCodeHookHandler, E as ClaudeCodeHookMatcherGroup, F as ClaudeCodeHooksConfig, G as ClaudeCodeProviderOptions, H as CodexAgentOptions, I as CodexCommandHook, J as CodexHookEvent, K as CodexHookMatcherGroup, L as CodexHooksConfig, M as CodexProviderOptions, N as DataContent, O as EmbeddedSkillConfig, P as FilePart, Q as ImagePart, R as MessageCompletedEvent, S as MessageInjectedEvent, T as MessageStartedEvent, U as NormalizedAgentEvent, V as NormalizedAgentEventBase, W as NormalizedAgentEventType, X as OpenCodeAgentOptions, Y as OpenCodePluginConfig, Z as OpenCodePluginEvent, _ as OpenCodePluginHookConfig, $ as OpenCodeProviderOptions, a0 as PermissionRequestedEvent, a1 as PermissionResolvedEvent, a2 as RawAgentEvent, a3 as ReasoningDeltaEvent, a4 as RepoSkillConfig, a5 as RunCancelledEvent, a6 as RunCompletedEvent, a7 as RunErrorEvent, a8 as RunStartedEvent, a9 as SetupLayout, aa as TextDeltaEvent, ab as TextPart, ac as ToolCallCompletedEvent, ad as ToolCallDeltaEvent, ae as ToolCallStartedEvent, af as UserContent, ag as UserContentPart, ah as createNormalizedEvent, ai as normalizeRawAgentEvent, aj as toAISDKEvent, ak as toAISDKStream } from './types-DmkbgYmn.js';
|
|
2
|
+
export { AGENT_RESERVED_PORTS, Agent, agentboxRoot, collectAllAgentReservedPorts, getAgentLayout } from './agents/index.js';
|
|
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';
|
|
5
5
|
export { ProviderLogAssembler } from './events/index.js';
|
|
6
6
|
export { AgentProvider, SandboxProvider } from './enums.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Agent
|
|
3
|
-
|
|
2
|
+
Agent,
|
|
3
|
+
agentboxRoot,
|
|
4
|
+
getAgentLayout
|
|
5
|
+
} from "./chunk-VBMMNUB7.js";
|
|
4
6
|
import {
|
|
5
7
|
ProviderLogAssembler,
|
|
6
8
|
createNormalizedEvent,
|
|
@@ -12,7 +14,7 @@ import {
|
|
|
12
14
|
Sandbox,
|
|
13
15
|
SandboxAdapter,
|
|
14
16
|
buildGitCloneCommand
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-HYHLKO3L.js";
|
|
16
18
|
import {
|
|
17
19
|
AGENT_RESERVED_PORTS,
|
|
18
20
|
collectAllAgentReservedPorts
|
|
@@ -30,9 +32,11 @@ export {
|
|
|
30
32
|
Sandbox,
|
|
31
33
|
SandboxAdapter,
|
|
32
34
|
SandboxProvider,
|
|
35
|
+
agentboxRoot,
|
|
33
36
|
buildGitCloneCommand,
|
|
34
37
|
collectAllAgentReservedPorts,
|
|
35
38
|
createNormalizedEvent,
|
|
39
|
+
getAgentLayout,
|
|
36
40
|
normalizeRawAgentEvent,
|
|
37
41
|
toAISDKEvent,
|
|
38
42
|
toAISDKStream
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as SandboxProviderName, i as SandboxOptions, a as CommandOptions, b as CommandResult, A as AsyncCommandHandle, h as SandboxListOptions, g as SandboxDescriptor, T as TarballEntry, G as GitCloneOptions } from '../Sandbox-
|
|
2
|
-
export { C as CommandEvent, D as DaytonaProviderOptions, c as DaytonaSandboxOptions, E as E2bProviderOptions, d as E2bSandboxOptions, L as LocalDockerProviderOptions, e as LocalDockerSandboxOptions, M as ModalProviderOptions, f as ModalSandboxOptions, S as Sandbox, j as SandboxOptionsBase, k as SandboxOptionsMap, m as SandboxRaw, n as SandboxRawMap, o as SandboxResourceSpec, V as VercelGitSource, p as VercelProviderOptions, q as VercelSandboxOptions } from '../Sandbox-
|
|
1
|
+
import { l as SandboxProviderName, i as SandboxOptions, a as CommandOptions, b as CommandResult, A as AsyncCommandHandle, h as SandboxListOptions, g as SandboxDescriptor, T as TarballEntry, G as GitCloneOptions } from '../Sandbox-DcKAU-E3.js';
|
|
2
|
+
export { C as CommandEvent, D as DaytonaProviderOptions, c as DaytonaSandboxOptions, E as E2bProviderOptions, d as E2bSandboxOptions, L as LocalDockerProviderOptions, e as LocalDockerSandboxOptions, M as ModalProviderOptions, f as ModalSandboxOptions, S as Sandbox, j as SandboxOptionsBase, k as SandboxOptionsMap, m as SandboxRaw, n as SandboxRawMap, o as SandboxResourceSpec, V as VercelGitSource, p as VercelProviderOptions, q as VercelSandboxOptions } from '../Sandbox-DcKAU-E3.js';
|
|
3
3
|
export { SandboxProvider } from '../enums.js';
|
|
4
4
|
import 'e2b';
|
|
5
5
|
import '@vercel/sandbox';
|
|
@@ -60,6 +60,22 @@ declare abstract class SandboxAdapter<TProvider extends SandboxProviderName = Sa
|
|
|
60
60
|
* (potentially slow) sandbox attach / create happens.
|
|
61
61
|
*/
|
|
62
62
|
findOrProvision(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Attach to an already-existing sandbox by id. Skips the
|
|
65
|
+
* `findMatchingSandbox` lookup that `findOrProvision` does — useful when
|
|
66
|
+
* the caller just created the sandbox (e.g. via a fork API) and knows
|
|
67
|
+
* its id directly. Idempotent: a second call is a no-op once attached.
|
|
68
|
+
*
|
|
69
|
+
* Default implementation throws — providers opt in by overriding
|
|
70
|
+
* `attachExisting`. Currently implemented by the Daytona adapter.
|
|
71
|
+
*/
|
|
72
|
+
attachById(id: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Provider hook for `attachById`. Adopt the sandbox with the given id
|
|
75
|
+
* (e.g. fetch via the provider client, mark `isWarmFlag`, start if
|
|
76
|
+
* paused). Throw if the provider doesn't support direct attach.
|
|
77
|
+
*/
|
|
78
|
+
protected attachExisting(id: string): Promise<void>;
|
|
63
79
|
/**
|
|
64
80
|
* Throw a consistent error when a method that needs a provisioned
|
|
65
81
|
* sandbox is called before `findOrProvision()`. Provider adapters call
|
package/dist/sandboxes/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AgentProvider } from './enums.js';
|
|
2
|
-
import { S as Sandbox } from './Sandbox-
|
|
2
|
+
import { S as Sandbox } from './Sandbox-DcKAU-E3.js';
|
|
3
3
|
|
|
4
4
|
interface RawAgentEvent<TPayload = unknown> {
|
|
5
5
|
provider: string;
|
|
@@ -284,6 +284,15 @@ interface AgentCommandConfig {
|
|
|
284
284
|
model?: string;
|
|
285
285
|
subtask?: boolean;
|
|
286
286
|
}
|
|
287
|
+
interface SetupLayout {
|
|
288
|
+
rootDir: string;
|
|
289
|
+
homeDir: string;
|
|
290
|
+
xdgConfigHome: string;
|
|
291
|
+
agentsDir: string;
|
|
292
|
+
claudeDir: string;
|
|
293
|
+
opencodeDir: string;
|
|
294
|
+
codexDir: string;
|
|
295
|
+
}
|
|
287
296
|
|
|
288
297
|
type AgentProviderName = AgentProvider;
|
|
289
298
|
type DataContent = string | URL | Uint8Array | ArrayBuffer | Buffer;
|
|
@@ -581,4 +590,4 @@ interface AgentProviderAdapter<P extends AgentProviderName = AgentProviderName>
|
|
|
581
590
|
attachSendMessage(request: AgentAttachRequest<P>, content: UserContent): Promise<void>;
|
|
582
591
|
}
|
|
583
592
|
|
|
584
|
-
export { type OpenCodeProviderOptions as $, type AISDKEvent as A, type ClaudeCodeHookEvent as B, type ClaudeCodeAgentOptions as C, type ClaudeCodeHookHandler as D, type ClaudeCodeHookMatcherGroup as E, type ClaudeCodeHooksConfig as F, type ClaudeCodeProviderOptions as G, type CodexAgentOptions as H, type CodexCommandHook as I, type CodexHookEvent as J, type CodexHookMatcherGroup as K, type CodexHooksConfig as L, type CodexProviderOptions as M, type DataContent as N, type EmbeddedSkillConfig as O, type FilePart as P, type ImagePart as Q, type MessageCompletedEvent as R, type MessageInjectedEvent as S, type MessageStartedEvent as T, type NormalizedAgentEvent as U, type NormalizedAgentEventBase as V, type NormalizedAgentEventType as W, type OpenCodeAgentOptions as X, type OpenCodePluginConfig as Y, type OpenCodePluginEvent as Z, type OpenCodePluginHookConfig as _, type AgentApprovalMode as a, type PermissionRequestedEvent as a0, type PermissionResolvedEvent as a1, type RawAgentEvent as a2, type ReasoningDeltaEvent as a3, type RepoSkillConfig as a4, type RunCancelledEvent as a5, type RunCompletedEvent as a6, type RunErrorEvent as a7, type RunStartedEvent as a8, type
|
|
593
|
+
export { type OpenCodeProviderOptions as $, type AISDKEvent as A, type ClaudeCodeHookEvent as B, type ClaudeCodeAgentOptions as C, type ClaudeCodeHookHandler as D, type ClaudeCodeHookMatcherGroup as E, type ClaudeCodeHooksConfig as F, type ClaudeCodeProviderOptions as G, type CodexAgentOptions as H, type CodexCommandHook as I, type CodexHookEvent as J, type CodexHookMatcherGroup as K, type CodexHooksConfig as L, type CodexProviderOptions as M, type DataContent as N, type EmbeddedSkillConfig as O, type FilePart as P, type ImagePart as Q, type MessageCompletedEvent as R, type MessageInjectedEvent as S, type MessageStartedEvent as T, type NormalizedAgentEvent as U, type NormalizedAgentEventBase as V, type NormalizedAgentEventType as W, type OpenCodeAgentOptions as X, type OpenCodePluginConfig as Y, type OpenCodePluginEvent as Z, type OpenCodePluginHookConfig as _, type AgentApprovalMode as a, type PermissionRequestedEvent as a0, type PermissionResolvedEvent as a1, type RawAgentEvent as a2, type ReasoningDeltaEvent as a3, type RepoSkillConfig as a4, type RunCancelledEvent as a5, type RunCompletedEvent as a6, type RunErrorEvent as a7, type RunStartedEvent as a8, type SetupLayout as a9, type TextDeltaEvent as aa, type TextPart as ab, type ToolCallCompletedEvent as ac, type ToolCallDeltaEvent as ad, type ToolCallStartedEvent as ae, type UserContent as af, type UserContentPart as ag, createNormalizedEvent as ah, normalizeRawAgentEvent as ai, toAISDKEvent as aj, toAISDKStream as ak, type AgentAttachRequest as b, type AgentCommandConfig as c, type AgentCostData as d, type AgentExecutionRequest as e, type AgentLocalMcpConfig as f, type AgentMcpConfig as g, type AgentOptions as h, type AgentOptionsBase as i, type AgentOptionsMap as j, type AgentPermissionDecision as k, type AgentPermissionKind as l, type AgentPermissionResponse as m, type AgentProviderAdapter as n, type AgentProviderName as o, type AgentReasoningEffort as p, type AgentRemoteMcpConfig as q, type AgentResult as r, type AgentRun as s, type AgentRunConfig as t, type AgentRunSink as u, type AgentSetupRequest as v, type AgentSkillConfig as w, type AgentSubAgentConfig as x, type AttachedRun as y, type ClaudeCodeHookConfig as z };
|