agentbox-sdk 0.1.503 → 0.1.508
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 +71 -0
- package/dist/agents/index.d.ts +15 -4
- package/dist/agents/index.js +8 -4
- package/dist/{chunk-TUBBWIOM.js → chunk-76AFK7XN.js} +1 -1
- package/dist/{chunk-34LDITII.js → chunk-BO4J4KSM.js} +803 -442
- package/dist/{chunk-AVXJMCBC.js → chunk-MTQ2S46C.js} +22 -0
- package/dist/events/index.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -4
- package/dist/sandboxes/index.js +2 -2
- package/dist/{types-3VRJIiW0.d.ts → types-BQ-_AUfY.d.ts} +57 -4
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -504,6 +504,77 @@ AGENTBOX_RUN_MATRIX_E2E=1 npm run test:e2e:matrix # provider matrix
|
|
|
504
504
|
|
|
505
505
|
Live test suites are opt-in because they provision real infrastructure.
|
|
506
506
|
|
|
507
|
+
## Host execution settings
|
|
508
|
+
|
|
509
|
+
Use `configuration: "native"` to run a host harness with its own configuration,
|
|
510
|
+
built-in prompt, credentials, and repository instructions. AgentBox does not
|
|
511
|
+
generate settings, skills, commands, subagents, hooks, plugins, or MCP definitions
|
|
512
|
+
in this mode. It cannot be combined with a sandbox or AgentBox-managed skills,
|
|
513
|
+
MCPs, commands, subagents, or RTK. Omit `systemPrompt` when starting a turn to keep
|
|
514
|
+
the harness's built-in instructions unchanged.
|
|
515
|
+
|
|
516
|
+
```ts
|
|
517
|
+
const agent = new Agent("codex", {
|
|
518
|
+
cwd: "/absolute/path/to/project",
|
|
519
|
+
configuration: "native",
|
|
520
|
+
approvalMode: "interactive",
|
|
521
|
+
});
|
|
522
|
+
await agent.setup();
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Start a turn with `agent.stream({ input })`, consume its async event iterator,
|
|
526
|
+
and answer permission requests with `run.respondToPermission()`. Await
|
|
527
|
+
`run.finished` for the result and call `agent.killServer()` to release the runtime.
|
|
528
|
+
|
|
529
|
+
The default `configuration: "managed"` retains AgentBox-generated configuration
|
|
530
|
+
for host and sandbox execution.
|
|
531
|
+
|
|
532
|
+
`stateDirectory` selects a private, persistent directory for generated agent
|
|
533
|
+
configuration and session state on the host. It must be an absolute path and
|
|
534
|
+
cannot be combined with `sandbox`. Use a different directory for each execution
|
|
535
|
+
environment to prevent unrelated local jobs from overwriting configuration.
|
|
536
|
+
This setting does not copy credentials from the user's account.
|
|
537
|
+
|
|
538
|
+
With native configuration, Codex uses the user's sandbox and approval settings.
|
|
539
|
+
Managed host execution defaults to read-only. An explicit
|
|
540
|
+
`provider: { sandboxMode: "workspace-write" }` enables a host write policy;
|
|
541
|
+
`writableRoots` adds allowed directories and `networkAccess` enables network
|
|
542
|
+
access for that policy (disabled by default). The shared
|
|
543
|
+
`approvalMode: "interactive"` routes permission requests to the caller; it does
|
|
544
|
+
not itself change the native harness's policy. Cloud sandbox defaults are unchanged.
|
|
545
|
+
|
|
546
|
+
Host Claude runs the Anthropic SDK with the SDK-matched CLI by default.
|
|
547
|
+
`provider.binary` explicitly selects another compatible CLI. Sign-in and session
|
|
548
|
+
storage remain CLI-owned. Managed configuration loads generated skills, commands,
|
|
549
|
+
and subagents as a private local plugin. Native configuration loads user, project,
|
|
550
|
+
and local settings instead. Neither mode copies the CLI's credentials.
|
|
551
|
+
|
|
552
|
+
Each host OpenCode Agent owns an authenticated loopback server on an ephemeral
|
|
553
|
+
port. Managed configuration uses an isolated configuration directory; native
|
|
554
|
+
configuration preserves the user's configuration paths. `killServer()` stops
|
|
555
|
+
only that Agent's process. It never discovers or kills another server by port number.
|
|
556
|
+
|
|
557
|
+
All three providers normalize interactive questions into `permission.requested`
|
|
558
|
+
events with `kind: "question"`. Respond with `decision: "allow"` and an `answers`
|
|
559
|
+
array containing each `questionId` and its selected or custom `values`, or use
|
|
560
|
+
`decision: "deny"` to skip. Invalid answers leave the request pending for correction.
|
|
561
|
+
Question answers cannot modify unrelated tool arguments. Ordinary tool requests
|
|
562
|
+
use the same API without `answers`.
|
|
563
|
+
|
|
564
|
+
Native runtimes own a POSIX process group by default. Termination is bounded and
|
|
565
|
+
escalates to SIGKILL if the process ignores SIGTERM. A supervisor that launches
|
|
566
|
+
each run in its own process group can set `processGroup: "inherited"`; that
|
|
567
|
+
supervisor is then responsible for stopping the complete group before reporting
|
|
568
|
+
that a run has stopped. This option is unavailable for cloud sandboxes.
|
|
569
|
+
|
|
570
|
+
## Packaging
|
|
571
|
+
|
|
572
|
+
`npm pack` builds the package from maintained TypeScript source before creating
|
|
573
|
+
the archive. Host execution includes the pinned Anthropic SDK and its Zod peer
|
|
574
|
+
as runtime dependencies; consumers do not need package-manager extensions.
|
|
575
|
+
Run `npm run check` before publishing. Provider integration tests use fake local
|
|
576
|
+
CLIs and SDK mocks; live tests remain opt-in.
|
|
577
|
+
|
|
507
578
|
## License
|
|
508
579
|
|
|
509
580
|
MIT
|
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,
|
|
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,
|
|
1
|
+
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, a7 as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, ae as SetupLayout, ak as UserContent } from '../types-BQ-_AUfY.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, C as ClaudeCodeAgentOptions, D as ClaudeCodeHookConfig, E as ClaudeCodeHookEvent, F as ClaudeCodeHookHandler, G as ClaudeCodeHookMatcherGroup, H as ClaudeCodeHooksConfig, I as ClaudeCodeProviderOptions, J as CodexAgentOptions, K as CodexCommandHook, L as CodexHookEvent, M as CodexHookMatcherGroup, N as CodexHooksConfig, O as CodexModelProviderConfig, P as CodexProviderOptions, Q as DataContent, R as EmbeddedSkillConfig, S as FilePart, T as ImagePart, $ as OpenCodeAgentOptions, a0 as OpenCodePluginConfig, a1 as OpenCodePluginEvent, a2 as OpenCodePluginHookConfig, a3 as OpenCodeProviderOptions, a4 as OpenRouterPlugin, a9 as RepoSkillConfig, ag as TextPart, al as UserContentPart } from '../types-BQ-_AUfY.js';
|
|
3
3
|
import { S as Sandbox } from '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
export { AgentProvider } from '../enums.js';
|
|
5
5
|
import 'e2b';
|
|
@@ -93,7 +93,7 @@ declare class Agent<P extends AgentProviderName = AgentProviderName> {
|
|
|
93
93
|
* - **Sandbox**: `/tmp/agentbox/<provider>` inside the sandbox.
|
|
94
94
|
* - **Local host**: `<os.tmpdir()>/agentbox-<provider>` on the host.
|
|
95
95
|
*/
|
|
96
|
-
declare function agentboxRoot(provider: AgentProviderName, hasSandbox?: boolean): string;
|
|
96
|
+
declare function agentboxRoot(provider: AgentProviderName, hasSandbox?: boolean, stateDirectory?: string): string;
|
|
97
97
|
/**
|
|
98
98
|
* Resolve the on-disk layout (config dirs per provider) for the given
|
|
99
99
|
* agentbox root. Public so external consumers (e.g. agentbox-driven
|
|
@@ -124,4 +124,15 @@ declare function getAgentLayout(rootDir: string): SetupLayout;
|
|
|
124
124
|
declare const AGENT_RESERVED_PORTS: Record<AgentProviderName, readonly number[]>;
|
|
125
125
|
declare function collectAllAgentReservedPorts(): number[];
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
type HarnessCommand = "plan" | "agent" | "goal";
|
|
128
|
+
interface HarnessCapabilities {
|
|
129
|
+
commands: HarnessCommand[];
|
|
130
|
+
planning: "explicit" | "agent-directed";
|
|
131
|
+
questions: boolean;
|
|
132
|
+
fullAccess: boolean;
|
|
133
|
+
}
|
|
134
|
+
/** Adapter capabilities. Runtime adapters additionally validate commands against the live harness. */
|
|
135
|
+
declare function harnessCapabilities(provider: AgentProviderName): HarnessCapabilities;
|
|
136
|
+
declare function resolveHarnessCommand(provider: AgentProviderName, input: UserContent): Pick<AgentRunConfig, "input" | "mode" | "goal">;
|
|
137
|
+
|
|
138
|
+
export { AGENT_RESERVED_PORTS, Agent, AgentAttachRequest, AgentOptions, AgentProviderName, AgentResult, AgentRun, AgentRunConfig, AttachedRun, type HarnessCapabilities, type HarnessCommand, SetupLayout, UserContent, agentboxRoot, collectAllAgentReservedPorts, getAgentLayout, harnessCapabilities, resolveHarnessCommand };
|
package/dist/agents/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Agent,
|
|
3
3
|
agentboxRoot,
|
|
4
|
-
getAgentLayout
|
|
5
|
-
|
|
4
|
+
getAgentLayout,
|
|
5
|
+
harnessCapabilities,
|
|
6
|
+
resolveHarnessCommand
|
|
7
|
+
} from "../chunk-BO4J4KSM.js";
|
|
6
8
|
import "../chunk-775FIGGL.js";
|
|
7
9
|
import {
|
|
8
10
|
AGENT_RESERVED_PORTS,
|
|
9
11
|
collectAllAgentReservedPorts
|
|
10
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-MTQ2S46C.js";
|
|
11
13
|
import "../chunk-NSJM57Z4.js";
|
|
12
14
|
import {
|
|
13
15
|
AgentProvider
|
|
@@ -18,5 +20,7 @@ export {
|
|
|
18
20
|
AgentProvider,
|
|
19
21
|
agentboxRoot,
|
|
20
22
|
collectAllAgentReservedPorts,
|
|
21
|
-
getAgentLayout
|
|
23
|
+
getAgentLayout,
|
|
24
|
+
harnessCapabilities,
|
|
25
|
+
resolveHarnessCommand
|
|
22
26
|
};
|