agentbox-sdk 0.1.501 → 0.1.503
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/agents/index.d.ts +2 -2
- package/dist/agents/index.js +1 -1
- package/dist/{chunk-2FCUUUXG.js → chunk-34LDITII.js} +23 -37
- package/dist/events/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{types-1seasIwq.d.ts → types-3VRJIiW0.d.ts} +1 -2
- package/package.json +1 -1
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, a4 as RawAgentEvent, b as AgentAttachRequest, y as AttachedRun, ab as SetupLayout } 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 CodexModelProviderConfig, N as CodexProviderOptions, O as DataContent, P as EmbeddedSkillConfig, Q as FilePart, R as ImagePart, Y as OpenCodeAgentOptions, Z as OpenCodePluginConfig, _ as OpenCodePluginEvent, $ as OpenCodePluginHookConfig, a0 as OpenCodeProviderOptions, a1 as OpenRouterPlugin, a6 as RepoSkillConfig, ad as TextPart, ah as UserContent, ai as UserContentPart } from '../types-
|
|
1
|
+
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, a4 as RawAgentEvent, b as AgentAttachRequest, y as AttachedRun, ab as SetupLayout } from '../types-3VRJIiW0.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 CodexModelProviderConfig, N as CodexProviderOptions, O as DataContent, P as EmbeddedSkillConfig, Q as FilePart, R as ImagePart, Y as OpenCodeAgentOptions, Z as OpenCodePluginConfig, _ as OpenCodePluginEvent, $ as OpenCodePluginHookConfig, a0 as OpenCodeProviderOptions, a1 as OpenRouterPlugin, a6 as RepoSkillConfig, ad as TextPart, ah as UserContent, ai as UserContentPart } from '../types-3VRJIiW0.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
|
@@ -3120,17 +3120,24 @@ function buildResumeParams(cwd, options, request) {
|
|
|
3120
3120
|
model: request.run.model ?? null,
|
|
3121
3121
|
approvalPolicy: isInteractiveApproval(options) ? "untrusted" : "never",
|
|
3122
3122
|
sandbox: buildCodexSandboxMode(options),
|
|
3123
|
-
developerInstructions: request.run.systemPrompt ?? null
|
|
3123
|
+
developerInstructions: request.run.systemPrompt ?? null,
|
|
3124
|
+
// We only need the thread id back; we never read `thread.turns`.
|
|
3125
|
+
// Without this Codex hydrates the full history into the response and
|
|
3126
|
+
// emits a `deprecationNotice` ("Full-history hydration is deprecated
|
|
3127
|
+
// for paginated threads").
|
|
3128
|
+
excludeTurns: true
|
|
3124
3129
|
};
|
|
3125
3130
|
}
|
|
3126
3131
|
function buildForkParams(cwd, options, request) {
|
|
3127
3132
|
return {
|
|
3128
3133
|
threadId: request.run.forkSessionId,
|
|
3134
|
+
lastTurnId: request.run.forkAtMessageId ?? null,
|
|
3129
3135
|
cwd,
|
|
3130
3136
|
model: request.run.model ?? null,
|
|
3131
3137
|
approvalPolicy: isInteractiveApproval(options) ? "untrusted" : "never",
|
|
3132
3138
|
sandbox: buildCodexSandboxMode(options),
|
|
3133
|
-
developerInstructions: request.run.systemPrompt ?? null
|
|
3139
|
+
developerInstructions: request.run.systemPrompt ?? null,
|
|
3140
|
+
excludeTurns: true
|
|
3134
3141
|
};
|
|
3135
3142
|
}
|
|
3136
3143
|
function buildTurnSandboxPolicy(options) {
|
|
@@ -3360,28 +3367,32 @@ async function materializeCodexImage(options, part, index) {
|
|
|
3360
3367
|
if (part.source.type === "url") {
|
|
3361
3368
|
return part.source.url;
|
|
3362
3369
|
}
|
|
3370
|
+
const data = Buffer.from(part.source.data, "base64");
|
|
3371
|
+
if (data.length === 0) {
|
|
3372
|
+
throw new Error("Cannot attach an empty image to Codex.");
|
|
3373
|
+
}
|
|
3363
3374
|
const root = agentboxRoot(AgentProvider.Codex, Boolean(options.sandbox));
|
|
3364
3375
|
const imagePath = path9.join(
|
|
3365
3376
|
root,
|
|
3366
3377
|
"inputs",
|
|
3367
|
-
`codex-image-${index}${codexImageExtension(part.mediaType)}`
|
|
3378
|
+
`codex-image-${index}-${crypto2.randomUUID()}${codexImageExtension(part.mediaType)}`
|
|
3368
3379
|
);
|
|
3369
3380
|
if (options.sandbox) {
|
|
3370
|
-
const
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
[
|
|
3374
|
-
`mkdir -p ${shellQuote(path9.posix.dirname(imagePath))}`,
|
|
3375
|
-
`(base64 --decode < ${shellQuote(encodedPath)} > ${shellQuote(imagePath)} || base64 -D < ${shellQuote(encodedPath)} > ${shellQuote(imagePath)})`,
|
|
3376
|
-
`rm -f ${shellQuote(encodedPath)}`
|
|
3377
|
-
].join(" && "),
|
|
3381
|
+
const result = await options.sandbox.uploadAndRun(
|
|
3382
|
+
[{ path: imagePath, content: data }],
|
|
3383
|
+
`test "$(wc -c < ${shellQuote(imagePath)})" -eq ${data.length}`,
|
|
3378
3384
|
{ cwd: options.cwd, env: options.env }
|
|
3379
3385
|
);
|
|
3386
|
+
if (result.exitCode !== 0) {
|
|
3387
|
+
throw new Error(
|
|
3388
|
+
`Failed to upload image attachment to Codex (exit ${result.exitCode}): the file could not be written or its size did not match.`
|
|
3389
|
+
);
|
|
3390
|
+
}
|
|
3380
3391
|
return imagePath;
|
|
3381
3392
|
}
|
|
3382
3393
|
const fs = await import("fs/promises");
|
|
3383
3394
|
await fs.mkdir(path9.dirname(imagePath), { recursive: true });
|
|
3384
|
-
await fs.writeFile(imagePath,
|
|
3395
|
+
await fs.writeFile(imagePath, data);
|
|
3385
3396
|
return imagePath;
|
|
3386
3397
|
}
|
|
3387
3398
|
function resolveCodexOpenAiBaseUrlFromOptions(options) {
|
|
@@ -4038,31 +4049,6 @@ var CodexAgentAdapter = class {
|
|
|
4038
4049
|
sink.emitRaw(
|
|
4039
4050
|
toRawEvent2(request.runId, threadResponse, threadResultEventName)
|
|
4040
4051
|
);
|
|
4041
|
-
if (request.run.forkSessionId) {
|
|
4042
|
-
const targetTurnId = request.run.forkAtMessageId;
|
|
4043
|
-
const turns = threadResponse.thread.turns ?? [];
|
|
4044
|
-
const targetIndex = turns.findIndex((turn) => turn.id === targetTurnId);
|
|
4045
|
-
if (targetIndex < 0) {
|
|
4046
|
-
throw new Error(
|
|
4047
|
-
`Codex fork: turn id ${String(targetTurnId)} not found in source thread ${request.run.forkSessionId}.`
|
|
4048
|
-
);
|
|
4049
|
-
}
|
|
4050
|
-
const numTurns = turns.length - 1 - targetIndex;
|
|
4051
|
-
if (numTurns > 0) {
|
|
4052
|
-
const rollbackResponse = await client.request(
|
|
4053
|
-
"thread/rollback",
|
|
4054
|
-
{ threadId: rootThreadId, numTurns }
|
|
4055
|
-
);
|
|
4056
|
-
rawPayloads.push(rollbackResponse);
|
|
4057
|
-
sink.emitRaw(
|
|
4058
|
-
toRawEvent2(
|
|
4059
|
-
request.runId,
|
|
4060
|
-
rollbackResponse,
|
|
4061
|
-
"thread/rollback:result"
|
|
4062
|
-
)
|
|
4063
|
-
);
|
|
4064
|
-
}
|
|
4065
|
-
}
|
|
4066
4052
|
await client.request(
|
|
4067
4053
|
"turn/start",
|
|
4068
4054
|
buildCodexTurnStartParams({
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKEvent, S as MessageCompletedEvent, T as MessageInjectedEvent, U as MessageStartedEvent, V as NormalizedAgentEvent, W as NormalizedAgentEventBase, X as NormalizedAgentEventType, a2 as PermissionRequestedEvent, a3 as PermissionResolvedEvent, a4 as RawAgentEvent, a5 as ReasoningDeltaEvent, a7 as RunCancelledEvent, a8 as RunCompletedEvent, a9 as RunErrorEvent, aa as RunStartedEvent, ac as TextDeltaEvent, ae as ToolCallCompletedEvent, af as ToolCallDeltaEvent, ag as ToolCallStartedEvent, aj as createNormalizedEvent, ak as normalizeRawAgentEvent, al as toAISDKEvent, am as toAISDKStream } from '../types-
|
|
1
|
+
export { A as AISDKEvent, S as MessageCompletedEvent, T as MessageInjectedEvent, U as MessageStartedEvent, V as NormalizedAgentEvent, W as NormalizedAgentEventBase, X as NormalizedAgentEventType, a2 as PermissionRequestedEvent, a3 as PermissionResolvedEvent, a4 as RawAgentEvent, a5 as ReasoningDeltaEvent, a7 as RunCancelledEvent, a8 as RunCompletedEvent, a9 as RunErrorEvent, aa as RunStartedEvent, ac as TextDeltaEvent, ae as ToolCallCompletedEvent, af as ToolCallDeltaEvent, ag as ToolCallStartedEvent, aj as createNormalizedEvent, ak as normalizeRawAgentEvent, al as toAISDKEvent, am as toAISDKStream } from '../types-3VRJIiW0.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 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 CodexModelProviderConfig, N as CodexProviderOptions, O as DataContent, P as EmbeddedSkillConfig, Q as FilePart, R as ImagePart, S as MessageCompletedEvent, T as MessageInjectedEvent, U as MessageStartedEvent, V as NormalizedAgentEvent, W as NormalizedAgentEventBase, X as NormalizedAgentEventType, Y as OpenCodeAgentOptions, Z as OpenCodePluginConfig, _ as OpenCodePluginEvent, $ as OpenCodePluginHookConfig, a0 as OpenCodeProviderOptions, a1 as OpenRouterPlugin, a2 as PermissionRequestedEvent, a3 as PermissionResolvedEvent, a4 as RawAgentEvent, a5 as ReasoningDeltaEvent, a6 as RepoSkillConfig, a7 as RunCancelledEvent, a8 as RunCompletedEvent, a9 as RunErrorEvent, aa as RunStartedEvent, ab as SetupLayout, ac as TextDeltaEvent, ad as TextPart, ae as ToolCallCompletedEvent, af as ToolCallDeltaEvent, ag as ToolCallStartedEvent, ah as UserContent, ai as UserContentPart, aj as createNormalizedEvent, ak as normalizeRawAgentEvent, al as toAISDKEvent, am 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 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 CodexModelProviderConfig, N as CodexProviderOptions, O as DataContent, P as EmbeddedSkillConfig, Q as FilePart, R as ImagePart, S as MessageCompletedEvent, T as MessageInjectedEvent, U as MessageStartedEvent, V as NormalizedAgentEvent, W as NormalizedAgentEventBase, X as NormalizedAgentEventType, Y as OpenCodeAgentOptions, Z as OpenCodePluginConfig, _ as OpenCodePluginEvent, $ as OpenCodePluginHookConfig, a0 as OpenCodeProviderOptions, a1 as OpenRouterPlugin, a2 as PermissionRequestedEvent, a3 as PermissionResolvedEvent, a4 as RawAgentEvent, a5 as ReasoningDeltaEvent, a6 as RepoSkillConfig, a7 as RunCancelledEvent, a8 as RunCompletedEvent, a9 as RunErrorEvent, aa as RunStartedEvent, ab as SetupLayout, ac as TextDeltaEvent, ad as TextPart, ae as ToolCallCompletedEvent, af as ToolCallDeltaEvent, ag as ToolCallStartedEvent, ah as UserContent, ai as UserContentPart, aj as createNormalizedEvent, ak as normalizeRawAgentEvent, al as toAISDKEvent, am as toAISDKStream } from './types-3VRJIiW0.js';
|
|
2
2
|
export { AGENT_RESERVED_PORTS, Agent, agentboxRoot, collectAllAgentReservedPorts, getAgentLayout } 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
|
@@ -371,8 +371,7 @@ interface AgentRunConfig {
|
|
|
371
371
|
* Provider mapping:
|
|
372
372
|
* - claude-code: `query({ resume, resumeSessionAt, forkSession: true })`
|
|
373
373
|
* - opencode: `POST /session/:forkSessionId/fork { messageID }`
|
|
374
|
-
* - codex:
|
|
375
|
-
* message-level fork in the codex app-server)
|
|
374
|
+
* - codex: `thread/fork { threadId, lastTurnId: forkAtMessageId }`
|
|
376
375
|
*/
|
|
377
376
|
forkSessionId?: string;
|
|
378
377
|
/**
|