coding-agents-sdk 0.10.0 → 0.11.0
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 +8 -7
- package/dist/adapters/claude-code-cli/index.d.mts +1 -1
- package/dist/adapters/claude-code-cli-pty/index.d.mts +3 -0
- package/dist/adapters/claude-code-cli-pty/index.mjs +35 -0
- package/dist/adapters/claude-code-sdk/index.d.mts +1 -1
- package/dist/adapters/codex-cli/index.d.mts +1 -1
- package/dist/adapters/codex-sdk/index.d.mts +1 -1
- package/dist/adapters/cursor-cli/index.d.mts +1 -1
- package/dist/adapters/cursor-sdk/index.d.mts +1 -1
- package/dist/adapters/cursor-sdk/index.mjs +1 -1
- package/dist/adapters/gemini-cli/index.d.mts +1 -1
- package/dist/adapters/opencode-cli/index.d.mts +1 -1
- package/dist/adapters/pi-cli/index.d.mts +1 -1
- package/dist/container/index.d.mts +1 -1
- package/dist/{events-Dd9r9luo.d.mts → events-Bwfw__Q3.d.mts} +139 -0
- package/dist/index-B0x76PaA.d.mts +104 -0
- package/dist/{index-J7V9dJTb.d.mts → index-BQNj8DHq.d.mts} +46 -15
- package/dist/index-B_MIEnNS.d.mts +60 -0
- package/dist/index-BeejNCvc.d.mts +429 -0
- package/dist/index-C8wbKjj3.d.mts +188 -0
- package/dist/index-CEHYyi4k.d.mts +68 -0
- package/dist/{index-BNeL0BbU.d.mts → index-ClURbAqF.d.mts} +67 -1
- package/dist/index-CyxdNK5W.d.mts +58 -0
- package/dist/{index-DZDlHIep.d.mts → index-D5zrCo6s.d.mts} +43 -12
- package/dist/index-ILgtPW1P.d.mts +97 -0
- package/dist/index-dPV54_sZ.d.mts +69 -0
- package/dist/{index-B-rto_J2.d.mts → index-p8MJ49dZ.d.mts} +77 -1
- package/dist/index.d.mts +69 -19
- package/dist/index.mjs +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/schemas/index.d.mts +1 -1
- package/dist/types-Bk-YpdbX.d.mts +476 -0
- package/package.json +14 -14
- package/dist/adapters/claude-cli-pty/index.d.mts +0 -3
- package/dist/adapters/claude-cli-pty/index.mjs +0 -7
- package/dist/index-B4RAMnx_.d.mts +0 -46
- package/dist/index-BdDz7C4J.d.mts +0 -39
- package/dist/index-BiWkGgnz.d.mts +0 -46
- package/dist/index-BllemWbi.d.mts +0 -42
- package/dist/index-C7J_hmQs.d.mts +0 -67
- package/dist/index-CaUzD36R.d.mts +0 -42
- package/dist/index-D-8EmRnQ.d.mts +0 -85
- package/dist/index-lGZ1lQkG.d.mts +0 -246
- package/dist/types-D6kxBNzj.d.mts +0 -195
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { S as McpServerConfig } from "./events-Dd9r9luo.mjs";
|
|
2
|
-
import { f as EnsureDisjoint, l as BaseAgent, t as AgentEventHandler } from "./types-D6kxBNzj.mjs";
|
|
3
|
-
//#region src/adapters/claude-code-sdk/types.d.ts
|
|
4
|
-
type ClaudeCodeSdkPermissionMode = "acceptEdits" | "auto" | "bypassPermissions" | "default" | "dontAsk" | "plan";
|
|
5
|
-
type ClaudeCodeSdkExecutable = "bun" | "deno" | "node";
|
|
6
|
-
type ClaudeCodeSdkSettingSource = "local" | "project" | "user";
|
|
7
|
-
type ClaudeCodeSdkSettings = Record<string, unknown> | string;
|
|
8
|
-
interface ClaudeCodeSdkRunOptions {
|
|
9
|
-
allowedTools?: string[];
|
|
10
|
-
disallowedTools?: string[];
|
|
11
|
-
appendSystemPrompt?: string;
|
|
12
|
-
permissionMode?: ClaudeCodeSdkPermissionMode;
|
|
13
|
-
mcpServers?: Record<string, McpServerConfig>;
|
|
14
|
-
forkSession?: boolean;
|
|
15
|
-
maxTurns?: number;
|
|
16
|
-
}
|
|
17
|
-
interface ClaudeCodeSdkAgentOptions extends ClaudeCodeSdkRunOptions {
|
|
18
|
-
command?: string;
|
|
19
|
-
env?: Record<string, string | undefined>;
|
|
20
|
-
propagateEnv?: boolean;
|
|
21
|
-
executable?: ClaudeCodeSdkExecutable;
|
|
22
|
-
executableArgs?: string[];
|
|
23
|
-
settings?: ClaudeCodeSdkSettings;
|
|
24
|
-
settingSources?: ClaudeCodeSdkSettingSource[];
|
|
25
|
-
container?: never;
|
|
26
|
-
sandbox?: never;
|
|
27
|
-
cwd?: string;
|
|
28
|
-
sessionId?: string;
|
|
29
|
-
model?: string;
|
|
30
|
-
systemPrompt?: string;
|
|
31
|
-
onEvent?: AgentEventHandler;
|
|
32
|
-
}
|
|
33
|
-
interface ClaudeCodeSdkAgent extends BaseAgent<EnsureDisjoint<ClaudeCodeSdkRunOptions>> {
|
|
34
|
-
readonly type: "claude-code-sdk";
|
|
35
|
-
fork: () => ClaudeCodeSdkAgent;
|
|
36
|
-
}
|
|
37
|
-
interface ClaudeCodeSdkEvent {
|
|
38
|
-
type: string;
|
|
39
|
-
session_id?: string;
|
|
40
|
-
[key: string]: unknown;
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region src/adapters/claude-code-sdk/adapter.d.ts
|
|
44
|
-
declare const createClaudeCodeSdkAgent: (options?: ClaudeCodeSdkAgentOptions) => ClaudeCodeSdkAgent;
|
|
45
|
-
//#endregion
|
|
46
|
-
export { ClaudeCodeSdkExecutable as a, ClaudeCodeSdkSettingSource as c, ClaudeCodeSdkEvent as i, ClaudeCodeSdkSettings as l, ClaudeCodeSdkAgent as n, ClaudeCodeSdkPermissionMode as o, ClaudeCodeSdkAgentOptions as r, ClaudeCodeSdkRunOptions as s, createClaudeCodeSdkAgent as t };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { A as ProcessSpawner, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D6kxBNzj.mjs";
|
|
2
|
-
import { t as Container } from "./index-lGZ1lQkG.mjs";
|
|
3
|
-
import { c as Sandbox } from "./index-D-8EmRnQ.mjs";
|
|
4
|
-
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
|
-
//#region src/adapters/cursor-cli/events/schemas.d.ts
|
|
7
|
-
declare const cursorCliEventSchema: z.ZodObject<{
|
|
8
|
-
type: z.ZodString;
|
|
9
|
-
}, z.core.$loose>;
|
|
10
|
-
type CursorCliEvent = z.infer<typeof cursorCliEventSchema>;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/adapters/cursor-cli/types.d.ts
|
|
13
|
-
type CursorCliMode = "ask" | "plan";
|
|
14
|
-
type CursorCliSandboxMode = "disabled" | "enabled";
|
|
15
|
-
interface CursorCliRunOptions {
|
|
16
|
-
approveMcps?: boolean;
|
|
17
|
-
extraArgs?: string[];
|
|
18
|
-
force?: boolean;
|
|
19
|
-
mode?: CursorCliMode;
|
|
20
|
-
sandboxMode?: CursorCliSandboxMode;
|
|
21
|
-
trust?: boolean;
|
|
22
|
-
systemPrompt?: never;
|
|
23
|
-
}
|
|
24
|
-
type CursorCliAgentOptions = CursorCliRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
25
|
-
command?: string[] | string;
|
|
26
|
-
cwd?: string;
|
|
27
|
-
env?: Record<string, string>;
|
|
28
|
-
propagateEnv?: boolean;
|
|
29
|
-
sessionId?: string;
|
|
30
|
-
model?: string;
|
|
31
|
-
logPath?: string;
|
|
32
|
-
spawner?: ProcessSpawner;
|
|
33
|
-
onEvent?: AgentEventHandler;
|
|
34
|
-
};
|
|
35
|
-
interface CursorCliAgent extends BaseAgent<EnsureDisjoint<CursorCliRunOptions>> {
|
|
36
|
-
readonly type: "cursor-cli";
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/adapters/cursor-cli/adapter.d.ts
|
|
40
|
-
declare const createCursorCliAgent: (options?: CursorCliAgentOptions) => CursorCliAgent;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { CursorCliRunOptions as a, CursorCliMode as i, CursorCliAgent as n, CursorCliSandboxMode as o, CursorCliAgentOptions as r, CursorCliEvent as s, createCursorCliAgent as t };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { S as McpServerConfig } from "./events-Dd9r9luo.mjs";
|
|
2
|
-
import { f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D6kxBNzj.mjs";
|
|
3
|
-
import { t as Container } from "./index-lGZ1lQkG.mjs";
|
|
4
|
-
import { c as Sandbox } from "./index-D-8EmRnQ.mjs";
|
|
5
|
-
import { i as ClaudeCodeCliPermissionMode } from "./index-J7V9dJTb.mjs";
|
|
6
|
-
|
|
7
|
-
//#region src/adapters/claude-cli-pty/types.d.ts
|
|
8
|
-
type ClaudeCliPtyPermissionMode = ClaudeCodeCliPermissionMode;
|
|
9
|
-
interface ClaudeCliPtyExitEvent {
|
|
10
|
-
exitCode: number;
|
|
11
|
-
signal?: number | string;
|
|
12
|
-
}
|
|
13
|
-
interface ClaudeCliPtyProcess {
|
|
14
|
-
write: (data: string) => void;
|
|
15
|
-
kill: (signal?: string) => void;
|
|
16
|
-
onData: (handler: (data: string) => void) => {
|
|
17
|
-
dispose: () => void;
|
|
18
|
-
};
|
|
19
|
-
onExit: (handler: (event: ClaudeCliPtyExitEvent) => void) => {
|
|
20
|
-
dispose: () => void;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
interface ClaudeCliPtyModule {
|
|
24
|
-
spawn: (command: string, args: string[], options: {
|
|
25
|
-
cols?: number;
|
|
26
|
-
rows?: number;
|
|
27
|
-
cwd?: string;
|
|
28
|
-
env?: Record<string, string>;
|
|
29
|
-
initialInputBootstrapPath?: string;
|
|
30
|
-
initialInputPath?: string;
|
|
31
|
-
}) => ClaudeCliPtyProcess;
|
|
32
|
-
}
|
|
33
|
-
interface ClaudeCliPtyRunOptions {
|
|
34
|
-
allowedTools?: string[];
|
|
35
|
-
disallowedTools?: string[];
|
|
36
|
-
appendSystemPrompt?: string;
|
|
37
|
-
permissionMode?: ClaudeCliPtyPermissionMode;
|
|
38
|
-
mcpConfig?: string[] | string;
|
|
39
|
-
mcpServers?: Record<string, McpServerConfig>;
|
|
40
|
-
forkSession?: boolean;
|
|
41
|
-
extraArgs?: string[];
|
|
42
|
-
readinessTimeoutMs?: number;
|
|
43
|
-
stopHookTimeoutMs?: number;
|
|
44
|
-
}
|
|
45
|
-
type ClaudeCliPtyAgentOptions = ClaudeCliPtyRunOptions & ExclusiveExecutionTargetOptions<Container, Sandbox> & {
|
|
46
|
-
command?: string[] | string;
|
|
47
|
-
cwd?: string;
|
|
48
|
-
env?: Record<string, string>;
|
|
49
|
-
propagateEnv?: boolean;
|
|
50
|
-
sessionId?: string;
|
|
51
|
-
model?: string;
|
|
52
|
-
systemPrompt?: string;
|
|
53
|
-
logPath?: string;
|
|
54
|
-
ci?: boolean;
|
|
55
|
-
pty?: ClaudeCliPtyModule;
|
|
56
|
-
onEvent?: AgentEventHandler;
|
|
57
|
-
};
|
|
58
|
-
interface ClaudeCliPtyAgent extends BaseAgent<EnsureDisjoint<ClaudeCliPtyRunOptions>> {
|
|
59
|
-
readonly type: "claude-cli-pty";
|
|
60
|
-
fork: () => ClaudeCliPtyAgent;
|
|
61
|
-
dispose: () => Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/adapters/claude-cli-pty/adapter.d.ts
|
|
65
|
-
declare const createClaudeCliPtyAgent: (options?: ClaudeCliPtyAgentOptions) => ClaudeCliPtyAgent;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { ClaudeCliPtyPermissionMode as a, ClaudeCliPtyModule as i, ClaudeCliPtyAgent as n, ClaudeCliPtyProcess as o, ClaudeCliPtyAgentOptions as r, ClaudeCliPtyRunOptions as s, createClaudeCliPtyAgent as t };
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { A as ProcessSpawner, f as EnsureDisjoint, l as BaseAgent, p as ExclusiveExecutionTargetOptions, t as AgentEventHandler } from "./types-D6kxBNzj.mjs";
|
|
2
|
-
import { t as Container } from "./index-lGZ1lQkG.mjs";
|
|
3
|
-
import { c as Sandbox } from "./index-D-8EmRnQ.mjs";
|
|
4
|
-
import { z } from "zod/v4";
|
|
5
|
-
|
|
6
|
-
//#region src/adapters/opencode-cli/events/schemas.d.ts
|
|
7
|
-
declare const opencodeEventSchema: z.ZodObject<{
|
|
8
|
-
type: z.ZodString;
|
|
9
|
-
}, z.core.$loose>;
|
|
10
|
-
type OpencodeEvent = z.infer<typeof opencodeEventSchema>;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/adapters/opencode-cli/types.d.ts
|
|
13
|
-
interface OpencodeCliRunOptions {
|
|
14
|
-
agent?: string;
|
|
15
|
-
files?: string[];
|
|
16
|
-
forkSession?: boolean;
|
|
17
|
-
share?: boolean;
|
|
18
|
-
thinking?: boolean;
|
|
19
|
-
title?: string;
|
|
20
|
-
variant?: string;
|
|
21
|
-
extraArgs?: string[];
|
|
22
|
-
systemPrompt?: never;
|
|
23
|
-
}
|
|
24
|
-
type OpencodeCliAgentOptions = ExclusiveExecutionTargetOptions<Container, Sandbox> & OpencodeCliRunOptions & {
|
|
25
|
-
command?: string[] | string;
|
|
26
|
-
cwd?: string;
|
|
27
|
-
env?: Record<string, string>;
|
|
28
|
-
propagateEnv?: boolean;
|
|
29
|
-
sessionId?: string;
|
|
30
|
-
model?: string;
|
|
31
|
-
logPath?: string;
|
|
32
|
-
spawner?: ProcessSpawner;
|
|
33
|
-
onEvent?: AgentEventHandler;
|
|
34
|
-
};
|
|
35
|
-
interface OpencodeCliAgent extends BaseAgent<EnsureDisjoint<OpencodeCliRunOptions>> {
|
|
36
|
-
readonly type: "opencode-cli";
|
|
37
|
-
}
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/adapters/opencode-cli/adapter.d.ts
|
|
40
|
-
declare const createOpencodeCliAgent: (options?: OpencodeCliAgentOptions) => OpencodeCliAgent;
|
|
41
|
-
//#endregion
|
|
42
|
-
export { OpencodeEvent as a, OpencodeCliRunOptions as i, OpencodeCliAgent as n, OpencodeCliAgentOptions as r, createOpencodeCliAgent as t };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { A as ProcessSpawner } from "./types-D6kxBNzj.mjs";
|
|
2
|
-
import { X as VolumeMount } from "./index-lGZ1lQkG.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/sandbox/types.d.ts
|
|
5
|
-
type SandboxType = "bubblewrap" | "firejail" | "nsjail";
|
|
6
|
-
type SandboxStatus = "created" | "disposed" | "running" | "stopped";
|
|
7
|
-
interface SandboxConfigBase<TType extends SandboxType> {
|
|
8
|
-
type: TType;
|
|
9
|
-
workdir: string;
|
|
10
|
-
}
|
|
11
|
-
interface SandboxIdentity<TType extends SandboxType, TConfig extends SandboxConfigBase<TType>> {
|
|
12
|
-
readonly type: TType;
|
|
13
|
-
readonly config: TConfig;
|
|
14
|
-
readonly status: SandboxStatus;
|
|
15
|
-
readonly workdir: string;
|
|
16
|
-
}
|
|
17
|
-
interface SandboxLifecycle {
|
|
18
|
-
start: () => Promise<void>;
|
|
19
|
-
stop: () => Promise<void>;
|
|
20
|
-
dispose: () => Promise<void>;
|
|
21
|
-
[Symbol.asyncDispose]: () => Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
interface SandboxExecution {
|
|
24
|
-
readonly spawner: ProcessSpawner;
|
|
25
|
-
}
|
|
26
|
-
interface SandboxBase<TType extends SandboxType, TConfig extends SandboxConfigBase<TType>> extends SandboxExecution, SandboxIdentity<TType, TConfig>, SandboxLifecycle {}
|
|
27
|
-
interface BubblewrapSandboxConfig extends SandboxConfigBase<"bubblewrap"> {
|
|
28
|
-
binary?: string;
|
|
29
|
-
binds?: VolumeMount[];
|
|
30
|
-
clearEnv?: boolean;
|
|
31
|
-
setEnv?: Record<string, string>;
|
|
32
|
-
unsetEnv?: string[];
|
|
33
|
-
unshareAll?: boolean;
|
|
34
|
-
shareNetwork?: boolean;
|
|
35
|
-
hostname?: string;
|
|
36
|
-
uid?: number;
|
|
37
|
-
gid?: number;
|
|
38
|
-
tmpfs?: string[];
|
|
39
|
-
remountReadonly?: string[];
|
|
40
|
-
proc?: false | string;
|
|
41
|
-
dev?: false | string;
|
|
42
|
-
args?: string[];
|
|
43
|
-
}
|
|
44
|
-
interface BubblewrapSandbox extends SandboxBase<"bubblewrap", BubblewrapSandboxConfig> {}
|
|
45
|
-
interface FirejailSandboxConfig extends SandboxConfigBase<"firejail"> {
|
|
46
|
-
binary?: string;
|
|
47
|
-
clearEnv?: boolean;
|
|
48
|
-
setEnv?: Record<string, string>;
|
|
49
|
-
unsetEnv?: string[];
|
|
50
|
-
shareNetwork?: boolean;
|
|
51
|
-
whitelist?: string[];
|
|
52
|
-
blacklist?: string[];
|
|
53
|
-
readOnly?: string[];
|
|
54
|
-
readWrite?: string[];
|
|
55
|
-
privateTmp?: boolean;
|
|
56
|
-
args?: string[];
|
|
57
|
-
}
|
|
58
|
-
interface FirejailSandbox extends SandboxBase<"firejail", FirejailSandboxConfig> {}
|
|
59
|
-
interface NsjailSandboxConfig extends SandboxConfigBase<"nsjail"> {
|
|
60
|
-
binary?: string;
|
|
61
|
-
binds?: VolumeMount[];
|
|
62
|
-
readOnly?: string[];
|
|
63
|
-
clearEnv?: boolean;
|
|
64
|
-
setEnv?: Record<string, string>;
|
|
65
|
-
unsetEnv?: string[];
|
|
66
|
-
shareNetwork?: boolean;
|
|
67
|
-
uid?: number;
|
|
68
|
-
gid?: number;
|
|
69
|
-
hostname?: string;
|
|
70
|
-
tmpfs?: string[];
|
|
71
|
-
timeLimitSec?: number;
|
|
72
|
-
disableRlimits?: boolean;
|
|
73
|
-
seccompString?: string;
|
|
74
|
-
args?: string[];
|
|
75
|
-
}
|
|
76
|
-
interface NsjailSandbox extends SandboxBase<"nsjail", NsjailSandboxConfig> {}
|
|
77
|
-
type SandboxConfig = BubblewrapSandboxConfig | FirejailSandboxConfig | NsjailSandboxConfig;
|
|
78
|
-
type Sandbox = BubblewrapSandbox | FirejailSandbox | NsjailSandbox;
|
|
79
|
-
//#endregion
|
|
80
|
-
//#region src/sandbox/index.d.ts
|
|
81
|
-
declare function createSandbox(config: BubblewrapSandboxConfig): Promise<BubblewrapSandbox>;
|
|
82
|
-
declare function createSandbox(config: FirejailSandboxConfig): Promise<FirejailSandbox>;
|
|
83
|
-
declare function createSandbox(config: NsjailSandboxConfig): Promise<NsjailSandbox>;
|
|
84
|
-
//#endregion
|
|
85
|
-
export { FirejailSandboxConfig as a, Sandbox as c, SandboxConfigBase as d, SandboxExecution as f, SandboxType as g, SandboxStatus as h, FirejailSandbox as i, SandboxBase as l, SandboxLifecycle as m, BubblewrapSandbox as n, NsjailSandbox as o, SandboxIdentity as p, BubblewrapSandboxConfig as r, NsjailSandboxConfig as s, createSandbox as t, SandboxConfig as u };
|
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
import { A as ProcessSpawner } from "./types-D6kxBNzj.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/container/types.d.ts
|
|
4
|
-
type ContainerType = "docker" | "e2b" | "nerdctl" | "podman";
|
|
5
|
-
interface PortMapping {
|
|
6
|
-
container: number;
|
|
7
|
-
host?: number;
|
|
8
|
-
protocol?: "tcp" | "udp";
|
|
9
|
-
}
|
|
10
|
-
interface VolumeMount {
|
|
11
|
-
source: string;
|
|
12
|
-
target: string;
|
|
13
|
-
readonly?: boolean;
|
|
14
|
-
}
|
|
15
|
-
interface ContainerConfigBase<TType extends ContainerType> {
|
|
16
|
-
type: TType;
|
|
17
|
-
workdir: string;
|
|
18
|
-
name?: string;
|
|
19
|
-
env?: Record<string, string>;
|
|
20
|
-
}
|
|
21
|
-
interface ExecOptions {
|
|
22
|
-
cwd?: string;
|
|
23
|
-
env?: Record<string, string>;
|
|
24
|
-
timeoutMs?: number;
|
|
25
|
-
signal?: AbortSignal;
|
|
26
|
-
}
|
|
27
|
-
interface ExecResult {
|
|
28
|
-
exitCode: number;
|
|
29
|
-
stdout: string;
|
|
30
|
-
stderr: string;
|
|
31
|
-
}
|
|
32
|
-
type ContainerStatus = "created" | "disposed" | "running" | "stopped";
|
|
33
|
-
type WorkdirChangeKind = "added" | "deleted" | "modified" | "renamed";
|
|
34
|
-
interface WorkdirSnapshotOptions {
|
|
35
|
-
cwd?: string;
|
|
36
|
-
}
|
|
37
|
-
interface WorkdirSnapshot {
|
|
38
|
-
readonly cwd: string;
|
|
39
|
-
readonly createdAt: Date;
|
|
40
|
-
}
|
|
41
|
-
interface WorkdirFileChange {
|
|
42
|
-
readonly path: string;
|
|
43
|
-
readonly previousPath?: string;
|
|
44
|
-
readonly kind: WorkdirChangeKind;
|
|
45
|
-
readonly beforeHash?: string;
|
|
46
|
-
readonly afterHash?: string;
|
|
47
|
-
readonly beforeSize?: number;
|
|
48
|
-
readonly afterSize?: number;
|
|
49
|
-
}
|
|
50
|
-
interface WorkdirDiffStats {
|
|
51
|
-
readonly durationMs: number;
|
|
52
|
-
readonly filesCompared: number;
|
|
53
|
-
}
|
|
54
|
-
interface WorkdirDiff {
|
|
55
|
-
readonly cwd: string;
|
|
56
|
-
readonly changedFiles: readonly string[];
|
|
57
|
-
readonly fileChanges: readonly WorkdirFileChange[];
|
|
58
|
-
readonly stats: WorkdirDiffStats;
|
|
59
|
-
}
|
|
60
|
-
interface ContainerIdentity<TType extends ContainerType, TConfig extends ContainerConfigBase<TType>> {
|
|
61
|
-
readonly type: TType;
|
|
62
|
-
readonly id: string;
|
|
63
|
-
readonly name: string;
|
|
64
|
-
readonly config: TConfig;
|
|
65
|
-
readonly status: ContainerStatus;
|
|
66
|
-
readonly workdir: string;
|
|
67
|
-
}
|
|
68
|
-
interface ContainerLifecycle {
|
|
69
|
-
start: () => Promise<void>;
|
|
70
|
-
stop: () => Promise<void>;
|
|
71
|
-
dispose: () => Promise<void>;
|
|
72
|
-
[Symbol.asyncDispose]: () => Promise<void>;
|
|
73
|
-
}
|
|
74
|
-
interface ContainerExecution {
|
|
75
|
-
exec: (command: string, args: string[], options?: ExecOptions) => Promise<ExecResult>;
|
|
76
|
-
execShell: (script: string, options?: ExecOptions) => Promise<ExecResult>;
|
|
77
|
-
readonly spawner: ProcessSpawner;
|
|
78
|
-
}
|
|
79
|
-
interface ContainerFileSystem {
|
|
80
|
-
copyTo: (hostPath: string, containerPath: string) => Promise<void>;
|
|
81
|
-
copyFrom: (containerPath: string, hostPath: string) => Promise<void>;
|
|
82
|
-
writeFile: (path: string, content: Uint8Array | string) => Promise<void>;
|
|
83
|
-
readFile: (path: string) => Promise<string>;
|
|
84
|
-
fileExists: (path: string) => Promise<boolean>;
|
|
85
|
-
mkdir: (path: string) => Promise<void>;
|
|
86
|
-
}
|
|
87
|
-
interface ContainerObservability {
|
|
88
|
-
logs: (options?: {
|
|
89
|
-
tail?: number;
|
|
90
|
-
}) => Promise<string>;
|
|
91
|
-
syncStatus: () => Promise<ContainerStatus>;
|
|
92
|
-
snapshotWorkdir: (options?: WorkdirSnapshotOptions) => Promise<WorkdirSnapshot>;
|
|
93
|
-
diffWorkdir: (snapshot: WorkdirSnapshot) => Promise<WorkdirDiff>;
|
|
94
|
-
releaseWorkdirSnapshot: (snapshot: WorkdirSnapshot) => Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
interface ContainerBase<TType extends ContainerType, TConfig extends ContainerConfigBase<TType>> extends ContainerExecution, ContainerFileSystem, ContainerIdentity<TType, TConfig>, ContainerLifecycle, ContainerObservability {}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/container/oci.d.ts
|
|
99
|
-
interface OciBuildBase {
|
|
100
|
-
context?: string;
|
|
101
|
-
args?: Record<string, string>;
|
|
102
|
-
tag?: string;
|
|
103
|
-
}
|
|
104
|
-
type OciBuildConfig = OciBuildBase & ({
|
|
105
|
-
dockerfile: string;
|
|
106
|
-
content?: never;
|
|
107
|
-
} | {
|
|
108
|
-
dockerfile?: never;
|
|
109
|
-
content: string;
|
|
110
|
-
});
|
|
111
|
-
interface OciProviderBase {
|
|
112
|
-
ports?: PortMapping[];
|
|
113
|
-
mounts?: VolumeMount[];
|
|
114
|
-
mountCwd?: string;
|
|
115
|
-
user?: string;
|
|
116
|
-
binary?: string;
|
|
117
|
-
extraArgs?: string[];
|
|
118
|
-
network?: string;
|
|
119
|
-
platform?: string;
|
|
120
|
-
}
|
|
121
|
-
type OciProviderConfig = OciProviderBase & ({
|
|
122
|
-
image: string;
|
|
123
|
-
build?: never;
|
|
124
|
-
} | {
|
|
125
|
-
image?: never;
|
|
126
|
-
build: OciBuildConfig;
|
|
127
|
-
});
|
|
128
|
-
//#endregion
|
|
129
|
-
//#region src/container/docker/types.d.ts
|
|
130
|
-
type DockerBuildBase = OciBuildBase;
|
|
131
|
-
type DockerBuildConfig = OciBuildConfig;
|
|
132
|
-
type DockerContainerBase = OciProviderBase;
|
|
133
|
-
type DockerProviderConfig = OciProviderConfig;
|
|
134
|
-
type DockerContainerConfig = ContainerConfigBase<"docker"> & OciProviderConfig;
|
|
135
|
-
interface DockerContainer extends ContainerBase<"docker", DockerContainerConfig> {
|
|
136
|
-
getMappedPort: (containerPort: number) => number | undefined;
|
|
137
|
-
}
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region src/container/e2b/types.d.ts
|
|
140
|
-
interface E2BSandboxNetworkOptions {
|
|
141
|
-
allowOut?: string[];
|
|
142
|
-
denyOut?: string[];
|
|
143
|
-
allowPublicTraffic?: boolean;
|
|
144
|
-
maskRequestHost?: string;
|
|
145
|
-
}
|
|
146
|
-
interface E2BSandboxLifecycleOptions {
|
|
147
|
-
onTimeout: "kill" | "pause";
|
|
148
|
-
autoResume?: boolean;
|
|
149
|
-
}
|
|
150
|
-
interface E2BConnectionConfig {
|
|
151
|
-
apiKey?: string;
|
|
152
|
-
accessToken?: string;
|
|
153
|
-
domain?: string;
|
|
154
|
-
requestTimeoutMs?: number;
|
|
155
|
-
headers?: Record<string, string>;
|
|
156
|
-
}
|
|
157
|
-
interface E2BContainerBase extends E2BConnectionConfig {
|
|
158
|
-
user?: string;
|
|
159
|
-
timeoutMs?: number;
|
|
160
|
-
}
|
|
161
|
-
interface E2BCreateConfig extends E2BContainerBase {
|
|
162
|
-
sandboxId?: never;
|
|
163
|
-
template?: string;
|
|
164
|
-
metadata?: Record<string, string>;
|
|
165
|
-
secure?: boolean;
|
|
166
|
-
allowInternetAccess?: boolean;
|
|
167
|
-
network?: E2BSandboxNetworkOptions;
|
|
168
|
-
lifecycle?: E2BSandboxLifecycleOptions;
|
|
169
|
-
}
|
|
170
|
-
interface E2BConnectConfig extends E2BContainerBase {
|
|
171
|
-
sandboxId: string;
|
|
172
|
-
template?: never;
|
|
173
|
-
metadata?: never;
|
|
174
|
-
secure?: never;
|
|
175
|
-
allowInternetAccess?: never;
|
|
176
|
-
network?: never;
|
|
177
|
-
lifecycle?: never;
|
|
178
|
-
}
|
|
179
|
-
type E2BProviderConfig = E2BConnectConfig | E2BCreateConfig;
|
|
180
|
-
type E2BContainerConfig = ContainerConfigBase<"e2b"> & E2BProviderConfig;
|
|
181
|
-
interface E2BContainer extends ContainerBase<"e2b", E2BContainerConfig> {
|
|
182
|
-
getHost: (port: number) => string;
|
|
183
|
-
}
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region src/container/nerdctl/types.d.ts
|
|
186
|
-
type NerdctlBuildBase = OciBuildBase;
|
|
187
|
-
type NerdctlBuildConfig = OciBuildConfig;
|
|
188
|
-
type NerdctlContainerBase = NerdctlProviderBase;
|
|
189
|
-
interface NerdctlProviderBase extends OciProviderBase {
|
|
190
|
-
namespace?: string;
|
|
191
|
-
address?: string;
|
|
192
|
-
buildkitHost?: string;
|
|
193
|
-
snapshotter?: string;
|
|
194
|
-
args?: string[];
|
|
195
|
-
}
|
|
196
|
-
type NerdctlProviderConfig = NerdctlProviderBase & OciProviderConfig;
|
|
197
|
-
type NerdctlContainerConfig = ContainerConfigBase<"nerdctl"> & NerdctlProviderConfig;
|
|
198
|
-
interface NerdctlContainer extends ContainerBase<"nerdctl", NerdctlContainerConfig> {
|
|
199
|
-
getMappedPort: (containerPort: number) => number | undefined;
|
|
200
|
-
}
|
|
201
|
-
//#endregion
|
|
202
|
-
//#region src/container/podman/types.d.ts
|
|
203
|
-
type PodmanBuildBase = OciBuildBase;
|
|
204
|
-
type PodmanBuildConfig = OciBuildConfig;
|
|
205
|
-
type PodmanContainerBase = OciProviderBase;
|
|
206
|
-
type PodmanProviderConfig = OciProviderConfig;
|
|
207
|
-
type PodmanContainerConfig = ContainerConfigBase<"podman"> & OciProviderConfig;
|
|
208
|
-
interface PodmanContainer extends ContainerBase<"podman", PodmanContainerConfig> {
|
|
209
|
-
getMappedPort: (containerPort: number) => number | undefined;
|
|
210
|
-
}
|
|
211
|
-
//#endregion
|
|
212
|
-
//#region src/container/errors.d.ts
|
|
213
|
-
declare class ContainerError extends Error {
|
|
214
|
-
constructor(message: string);
|
|
215
|
-
}
|
|
216
|
-
declare class ContainerCreateError extends ContainerError {
|
|
217
|
-
constructor(message: string);
|
|
218
|
-
}
|
|
219
|
-
declare class MountValidationError extends ContainerError {
|
|
220
|
-
constructor(message: string);
|
|
221
|
-
}
|
|
222
|
-
declare class ContainerStartError extends ContainerError {
|
|
223
|
-
constructor(message: string);
|
|
224
|
-
}
|
|
225
|
-
declare class ContainerExecError extends ContainerError {
|
|
226
|
-
constructor(message: string);
|
|
227
|
-
}
|
|
228
|
-
declare class ContainerNotRunningError extends ContainerError {
|
|
229
|
-
constructor(message?: string);
|
|
230
|
-
}
|
|
231
|
-
declare class ContainerDisposedError extends ContainerError {
|
|
232
|
-
constructor(message?: string);
|
|
233
|
-
}
|
|
234
|
-
declare class ContainerDiffError extends ContainerError {
|
|
235
|
-
constructor(message: string);
|
|
236
|
-
}
|
|
237
|
-
//#endregion
|
|
238
|
-
//#region src/container/index.d.ts
|
|
239
|
-
type ContainerConfig = DockerContainerConfig | E2BContainerConfig | NerdctlContainerConfig | PodmanContainerConfig;
|
|
240
|
-
type Container = DockerContainer | E2BContainer | NerdctlContainer | PodmanContainer;
|
|
241
|
-
declare function createContainer(config: DockerContainerConfig): Promise<DockerContainer>;
|
|
242
|
-
declare function createContainer(config: E2BContainerConfig): Promise<E2BContainer>;
|
|
243
|
-
declare function createContainer(config: NerdctlContainerConfig): Promise<NerdctlContainer>;
|
|
244
|
-
declare function createContainer(config: PodmanContainerConfig): Promise<PodmanContainer>;
|
|
245
|
-
//#endregion
|
|
246
|
-
export { WorkdirDiffStats as $, E2BCreateConfig as A, ContainerExecution as B, NerdctlProviderBase as C, E2BContainer as D, E2BConnectionConfig as E, DockerContainerBase as F, ContainerStatus as G, ContainerIdentity as H, DockerContainerConfig as I, ExecResult as J, ContainerType as K, DockerProviderConfig as L, DockerBuildBase as M, DockerBuildConfig as N, E2BContainerBase as O, DockerContainer as P, WorkdirDiff as Q, ContainerBase as R, NerdctlContainerConfig as S, E2BConnectConfig as T, ContainerLifecycle as U, ContainerFileSystem as V, ContainerObservability as W, VolumeMount as X, PortMapping as Y, WorkdirChangeKind as Z, PodmanProviderConfig as _, ContainerDiffError as a, NerdctlContainer as b, ContainerExecError as c, MountValidationError as d, WorkdirFileChange as et, PodmanBuildBase as f, PodmanContainerConfig as g, PodmanContainerBase as h, ContainerCreateError as i, E2BProviderConfig as j, E2BContainerConfig as k, ContainerNotRunningError as l, PodmanContainer as m, ContainerConfig as n, WorkdirSnapshotOptions as nt, ContainerDisposedError as o, PodmanBuildConfig as p, ExecOptions as q, createContainer as r, ContainerError as s, Container as t, WorkdirSnapshot as tt, ContainerStartError as u, NerdctlBuildBase as v, NerdctlProviderConfig as w, NerdctlContainerBase as x, NerdctlBuildConfig as y, ContainerConfigBase as z };
|