agentbox-sdk 0.1.304 → 0.1.305

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.
@@ -1,5 +1,5 @@
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-Ozo1rHKs.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, aa as TextPart, ae as UserContent, af as UserContentPart } from '../types-Ozo1rHKs.js';
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-DiZSjZma.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, aa as TextPart, ae as UserContent, af as UserContentPart } from '../types-DiZSjZma.js';
3
3
  import { S as Sandbox } from '../Sandbox-K6VNqKeo.js';
4
4
  export { AgentProvider } from '../enums.js';
5
5
  import 'e2b';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Agent
3
- } from "../chunk-T7C77LCW.js";
4
- import "../chunk-EK6GC6YA.js";
3
+ } from "../chunk-KRSY52XS.js";
4
+ import "../chunk-ZDSHOGJ4.js";
5
5
  import {
6
6
  AGENT_RESERVED_PORTS,
7
7
  collectAllAgentReservedPorts
@@ -2,7 +2,7 @@ import {
2
2
  createNormalizedEvent,
3
3
  normalizeRawAgentEvent,
4
4
  toAISDKStream
5
- } from "./chunk-EK6GC6YA.js";
5
+ } from "./chunk-ZDSHOGJ4.js";
6
6
  import {
7
7
  AgentBoxError,
8
8
  AsyncQueue,
@@ -3724,19 +3724,13 @@ var OPEN_CODE_REASONING_LEVELS = ["low", "medium", "high", "xhigh"];
3724
3724
  function openCodeAgentSlug(reasoning) {
3725
3725
  return reasoning ? `agentbox-${reasoning}` : "agentbox";
3726
3726
  }
3727
+ var FALLBACK_OPEN_CODE_AGENT_PROMPT = "You are an AI coding assistant. Follow the user's instructions.";
3727
3728
  function buildOpenCodeConfig(options, interactiveApproval) {
3728
3729
  const mcpConfig = buildOpenCodeMcpConfig(options.mcps);
3729
3730
  const commandsConfig = buildOpenCodeCommandsConfig(options.commands);
3730
3731
  const baseAgent = {
3731
3732
  mode: "primary",
3732
- // Suppress opencode's default provider system prompt (e.g.
3733
- // PROMPT_ANTHROPIC's "You are OpenCode...") so request.run.systemPrompt
3734
- // is the dominant identity statement the model sees. opencode's
3735
- // session/llm.ts uses agent.prompt instead of SystemPrompt.provider(model)
3736
- // when this field is truthy — codex already takes that branch via a
3737
- // separate options.instructions channel, so this brings anthropic et al.
3738
- // in line. Constant value, so setupId stays stable.
3739
- prompt: "You are an AI coding assistant. Follow the user's instructions.",
3733
+ prompt: options.systemPrompt || FALLBACK_OPEN_CODE_AGENT_PROMPT,
3740
3734
  permission: buildOpenCodePermissionConfig(interactiveApproval),
3741
3735
  tools: {
3742
3736
  write: true,
@@ -4320,10 +4314,17 @@ var OpenCodeAgentAdapter = class {
4320
4314
  const dispatchPrompt = async (parts) => {
4321
4315
  const body = JSON.stringify({
4322
4316
  ...request.run.model ? { model: toOpenCodeModel(request.run.model) } : {},
4323
- // Per-message system prompt keeps systemPrompt out of
4324
- // the on-disk agent config so changing it doesn't
4325
- // invalidate setupId. Sent on every dispatch (the field
4326
- // is per-message, not session-sticky).
4317
+ // Per-message system prompt override. opencode appends this
4318
+ // *after* `agent.prompt` and the runtime appendix
4319
+ // (env/AGENTS.md/skills) when composing the final system
4320
+ // string see `buildOpenCodeConfig` for the full ordering.
4321
+ // For Anthropic models specifically, this trailing-position
4322
+ // content tends to be ignored; callers that need the prompt
4323
+ // to actually steer Sonnet/Opus should pass it via
4324
+ // `OpenCodeAgentOptions.systemPrompt` so it's baked into
4325
+ // `agent.prompt` (the leading position) at setup time
4326
+ // instead. This per-message field stays as a per-run
4327
+ // override path that's effective for codex/GPT/Gemini.
4327
4328
  ...request.run.systemPrompt ? { system: request.run.systemPrompt } : {},
4328
4329
  agent: agentSlug,
4329
4330
  parts
@@ -1,4 +1,4 @@
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, a9 as TextDeltaEvent, ab as ToolCallCompletedEvent, ac as ToolCallDeltaEvent, ad as ToolCallStartedEvent, ag as createNormalizedEvent, ah as normalizeRawAgentEvent, ai as toAISDKEvent, aj as toAISDKStream } from '../types-Ozo1rHKs.js';
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, a9 as TextDeltaEvent, ab as ToolCallCompletedEvent, ac as ToolCallDeltaEvent, ad as ToolCallStartedEvent, ag as createNormalizedEvent, ah as normalizeRawAgentEvent, ai as toAISDKEvent, aj as toAISDKStream } from '../types-DiZSjZma.js';
2
2
  import { AgentProvider } from '../enums.js';
3
3
  import '../Sandbox-K6VNqKeo.js';
4
4
  import 'e2b';
@@ -4,7 +4,7 @@ import {
4
4
  normalizeRawAgentEvent,
5
5
  toAISDKEvent,
6
6
  toAISDKStream
7
- } from "../chunk-EK6GC6YA.js";
7
+ } from "../chunk-ZDSHOGJ4.js";
8
8
  import "../chunk-GOFJNFAD.js";
9
9
  export {
10
10
  ProviderLogAssembler,
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 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 TextDeltaEvent, aa as TextPart, ab as ToolCallCompletedEvent, ac as ToolCallDeltaEvent, ad as ToolCallStartedEvent, ae as UserContent, af as UserContentPart, ag as createNormalizedEvent, ah as normalizeRawAgentEvent, ai as toAISDKEvent, aj as toAISDKStream } from './types-Ozo1rHKs.js';
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 TextDeltaEvent, aa as TextPart, ab as ToolCallCompletedEvent, ac as ToolCallDeltaEvent, ad as ToolCallStartedEvent, ae as UserContent, af as UserContentPart, ag as createNormalizedEvent, ah as normalizeRawAgentEvent, ai as toAISDKEvent, aj as toAISDKStream } from './types-DiZSjZma.js';
2
2
  export { AGENT_RESERVED_PORTS, Agent, collectAllAgentReservedPorts } 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-K6VNqKeo.js';
4
4
  export { SandboxAdapter, buildGitCloneCommand } from './sandboxes/index.js';
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Agent
3
- } from "./chunk-T7C77LCW.js";
3
+ } from "./chunk-KRSY52XS.js";
4
4
  import {
5
5
  ProviderLogAssembler,
6
6
  createNormalizedEvent,
7
7
  normalizeRawAgentEvent,
8
8
  toAISDKEvent,
9
9
  toAISDKStream
10
- } from "./chunk-EK6GC6YA.js";
10
+ } from "./chunk-ZDSHOGJ4.js";
11
11
  import {
12
12
  Sandbox,
13
13
  SandboxAdapter,
@@ -385,6 +385,29 @@ interface CodexAgentOptions extends AgentOptionsBase {
385
385
  }
386
386
  interface OpenCodeAgentOptions extends AgentOptionsBase {
387
387
  provider?: OpenCodeProviderOptions;
388
+ /**
389
+ * Setup-time system prompt baked into the opencode agent's `prompt` field.
390
+ *
391
+ * When set, this REPLACES opencode's built-in provider prompt
392
+ * (`anthropic.txt` / `codex.txt` / `gemini.txt` / etc.) and is the most
393
+ * prominent system message the model sees. Use this when you need the
394
+ * prompt to actually steer Anthropic models — opencode appends
395
+ * {@link AgentRunConfig.systemPrompt} *after* its long provider prompt,
396
+ * which Sonnet/Opus tend to ignore in favor of the leading content.
397
+ *
398
+ * Trade-off: replacing the provider prompt drops opencode's hand-tuned
399
+ * Anthropic tool-usage hints. Models still receive tool definitions and
400
+ * the runtime appendix (MCPs/skills/sub-agents/commands) via the
401
+ * per-message `system` field, so tools remain functional — just less
402
+ * prominently announced.
403
+ *
404
+ * Setup-time field: changing it between runs invalidates the
405
+ * setup-manifest cache and triggers a re-upload of the agent config on
406
+ * the next `setup()` call. {@link AgentRunConfig.systemPrompt} continues
407
+ * to work as a per-message override (appended after `agent.prompt`),
408
+ * which is fine for codex/GPT models but weak for Anthropic.
409
+ */
410
+ systemPrompt?: string;
388
411
  }
389
412
  interface ClaudeCodeAgentOptions extends AgentOptionsBase {
390
413
  provider?: ClaudeCodeProviderOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentbox-sdk",
3
- "version": "0.1.304",
3
+ "version": "0.1.305",
4
4
  "description": "Swappable coding agents and sandbox providers for Bun and TypeScript.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -466,8 +466,8 @@ var ClaudeCodeLogAssembler = class {
466
466
  const text = this.textByMessageId.get(messageId) ?? "";
467
467
  const thinking = this.thinkingByMessageId.get(messageId) ?? "";
468
468
  const content = [];
469
- if (text) content.push({ type: "text", text });
470
469
  if (thinking) content.push({ type: "thinking", thinking });
470
+ if (text) content.push({ type: "text", text });
471
471
  for (const block of extraBlocks) content.push(clone(block));
472
472
  const next = {
473
473
  type: "message.updated",