@downcity/agent 1.1.113 → 1.1.119
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/bin/agent/local/Agent.d.ts +39 -0
- package/bin/agent/local/Agent.d.ts.map +1 -1
- package/bin/agent/local/Agent.js +53 -0
- package/bin/agent/local/Agent.js.map +1 -1
- package/bin/agent/local/services/AgentAssemblyService.d.ts +4 -0
- package/bin/agent/local/services/AgentAssemblyService.d.ts.map +1 -1
- package/bin/agent/local/services/AgentAssemblyService.js +18 -2
- package/bin/agent/local/services/AgentAssemblyService.js.map +1 -1
- package/bin/agent/local/services/AgentLifecycleService.d.ts +6 -0
- package/bin/agent/local/services/AgentLifecycleService.d.ts.map +1 -1
- package/bin/agent/local/services/AgentLifecycleService.js +4 -0
- package/bin/agent/local/services/AgentLifecycleService.js.map +1 -1
- package/bin/agent/remote/RemoteAgent.d.ts +35 -1
- package/bin/agent/remote/RemoteAgent.d.ts.map +1 -1
- package/bin/agent/remote/RemoteAgent.js +37 -1
- package/bin/agent/remote/RemoteAgent.js.map +1 -1
- package/bin/agent/remote/RemoteTransport.d.ts +22 -0
- package/bin/agent/remote/RemoteTransport.d.ts.map +1 -1
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.d.ts +17 -0
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.d.ts.map +1 -1
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.js +63 -0
- package/bin/agent/remote/transports/HttpRemoteAgentTransport.js.map +1 -1
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.d.ts +16 -0
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.d.ts.map +1 -1
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.js +18 -0
- package/bin/agent/remote/transports/RpcRemoteAgentTransport.js.map +1 -1
- package/bin/executor/Executor.d.ts.map +1 -1
- package/bin/executor/Executor.js +7 -1
- package/bin/executor/Executor.js.map +1 -1
- package/bin/index.d.ts +0 -1
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +0 -1
- package/bin/index.js.map +1 -1
- package/bin/rpc/Client.d.ts +28 -0
- package/bin/rpc/Client.d.ts.map +1 -1
- package/bin/rpc/Client.js +63 -0
- package/bin/rpc/Client.js.map +1 -1
- package/bin/rpc/server/InternalHandlers.d.ts.map +1 -1
- package/bin/rpc/server/InternalHandlers.js +54 -0
- package/bin/rpc/server/InternalHandlers.js.map +1 -1
- package/bin/rpc/server/ServerTypes.d.ts +5 -0
- package/bin/rpc/server/ServerTypes.d.ts.map +1 -1
- package/bin/types/agent/AgentOptions.d.ts +9 -0
- package/bin/types/agent/AgentOptions.d.ts.map +1 -1
- package/bin/types/config/DowncityConfig.d.ts +2 -2
- package/bin/types/config/DowncityConfig.d.ts.map +1 -1
- package/bin/types/rpc/RpcProtocol.d.ts +53 -0
- package/bin/types/rpc/RpcProtocol.d.ts.map +1 -1
- package/package.json +4 -3
- package/scripts/linux-bubblewrap-sandbox.test.mjs +1 -1
- package/scripts/shell-sandbox-preflight.test.mjs +1 -1
- package/src/agent/local/Agent.ts +68 -0
- package/src/agent/local/services/AgentAssemblyService.ts +23 -2
- package/src/agent/local/services/AgentLifecycleService.ts +11 -0
- package/src/agent/remote/RemoteAgent.ts +54 -1
- package/src/agent/remote/RemoteTransport.ts +23 -0
- package/src/agent/remote/transports/HttpRemoteAgentTransport.ts +101 -0
- package/src/agent/remote/transports/RpcRemoteAgentTransport.ts +35 -0
- package/src/executor/Executor.ts +12 -2
- package/src/index.ts +0 -1
- package/src/rpc/Client.ts +80 -0
- package/src/rpc/server/InternalHandlers.ts +55 -0
- package/src/rpc/server/ServerTypes.ts +5 -0
- package/src/types/agent/AgentOptions.ts +10 -0
- package/src/types/config/DowncityConfig.ts +2 -2
- package/src/types/rpc/RpcProtocol.ts +59 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/executor/tools/shell/ShellToolBridge.d.ts +0 -79
- package/bin/executor/tools/shell/ShellToolBridge.d.ts.map +0 -1
- package/bin/executor/tools/shell/ShellToolBridge.js +0 -320
- package/bin/executor/tools/shell/ShellToolBridge.js.map +0 -1
- package/bin/executor/tools/shell/ShellToolDefinition.d.ts +0 -116
- package/bin/executor/tools/shell/ShellToolDefinition.d.ts.map +0 -1
- package/bin/executor/tools/shell/ShellToolDefinition.js +0 -369
- package/bin/executor/tools/shell/ShellToolDefinition.js.map +0 -1
- package/bin/executor/tools/shell/ShellToolFormatting.d.ts +0 -17
- package/bin/executor/tools/shell/ShellToolFormatting.d.ts.map +0 -1
- package/bin/executor/tools/shell/ShellToolFormatting.js +0 -36
- package/bin/executor/tools/shell/ShellToolFormatting.js.map +0 -1
- package/bin/executor/tools/shell/ShellToolSchemas.d.ts +0 -61
- package/bin/executor/tools/shell/ShellToolSchemas.d.ts.map +0 -1
- package/bin/executor/tools/shell/ShellToolSchemas.js +0 -130
- package/bin/executor/tools/shell/ShellToolSchemas.js.map +0 -1
- package/bin/executor/tools/shell/types/Shell.d.ts +0 -115
- package/bin/executor/tools/shell/types/Shell.d.ts.map +0 -1
- package/bin/executor/tools/shell/types/Shell.js +0 -9
- package/bin/executor/tools/shell/types/Shell.js.map +0 -1
- package/bin/executor/tools/shell/types/ShellPlugin.d.ts +0 -258
- package/bin/executor/tools/shell/types/ShellPlugin.d.ts.map +0 -1
- package/bin/executor/tools/shell/types/ShellPlugin.js +0 -9
- package/bin/executor/tools/shell/types/ShellPlugin.js.map +0 -1
- package/bin/sandbox/LinuxBubblewrapSandbox.d.ts +0 -19
- package/bin/sandbox/LinuxBubblewrapSandbox.d.ts.map +0 -1
- package/bin/sandbox/LinuxBubblewrapSandbox.js +0 -186
- package/bin/sandbox/LinuxBubblewrapSandbox.js.map +0 -1
- package/bin/sandbox/MacOsSeatbeltSandbox.d.ts +0 -16
- package/bin/sandbox/MacOsSeatbeltSandbox.d.ts.map +0 -1
- package/bin/sandbox/MacOsSeatbeltSandbox.js +0 -154
- package/bin/sandbox/MacOsSeatbeltSandbox.js.map +0 -1
- package/bin/sandbox/SandboxConfigResolver.d.ts +0 -37
- package/bin/sandbox/SandboxConfigResolver.d.ts.map +0 -1
- package/bin/sandbox/SandboxConfigResolver.js +0 -130
- package/bin/sandbox/SandboxConfigResolver.js.map +0 -1
- package/bin/sandbox/SandboxPreflight.d.ts +0 -73
- package/bin/sandbox/SandboxPreflight.d.ts.map +0 -1
- package/bin/sandbox/SandboxPreflight.js +0 -122
- package/bin/sandbox/SandboxPreflight.js.map +0 -1
- package/bin/sandbox/SandboxRunner.d.ts +0 -61
- package/bin/sandbox/SandboxRunner.d.ts.map +0 -1
- package/bin/sandbox/SandboxRunner.js +0 -107
- package/bin/sandbox/SandboxRunner.js.map +0 -1
- package/bin/sandbox/UnrestrictedSandbox.d.ts +0 -16
- package/bin/sandbox/UnrestrictedSandbox.d.ts.map +0 -1
- package/bin/sandbox/UnrestrictedSandbox.js +0 -39
- package/bin/sandbox/UnrestrictedSandbox.js.map +0 -1
- package/bin/sandbox/types/Sandbox.d.ts +0 -130
- package/bin/sandbox/types/Sandbox.d.ts.map +0 -1
- package/bin/sandbox/types/Sandbox.js +0 -10
- package/bin/sandbox/types/Sandbox.js.map +0 -1
- package/bin/sandbox/types/SandboxRuntime.d.ts +0 -370
- package/bin/sandbox/types/SandboxRuntime.d.ts.map +0 -1
- package/bin/sandbox/types/SandboxRuntime.js +0 -10
- package/bin/sandbox/types/SandboxRuntime.js.map +0 -1
- package/src/executor/tools/shell/ShellToolBridge.ts +0 -412
- package/src/executor/tools/shell/ShellToolDefinition.ts +0 -524
- package/src/executor/tools/shell/ShellToolFormatting.ts +0 -34
- package/src/executor/tools/shell/ShellToolSchemas.ts +0 -139
- package/src/executor/tools/shell/types/Shell.ts +0 -123
- package/src/executor/tools/shell/types/ShellPlugin.ts +0 -278
- package/src/sandbox/LinuxBubblewrapSandbox.ts +0 -222
- package/src/sandbox/MacOsSeatbeltSandbox.ts +0 -191
- package/src/sandbox/SandboxConfigResolver.ts +0 -152
- package/src/sandbox/SandboxPreflight.ts +0 -205
- package/src/sandbox/SandboxRunner.ts +0 -151
- package/src/sandbox/UnrestrictedSandbox.ts +0 -53
- package/src/sandbox/types/Sandbox.ts +0 -144
- package/src/sandbox/types/SandboxRuntime.ts +0 -440
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* macOS Seatbelt sandbox backend。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 当前最小实现直接基于系统自带 `sandbox-exec`。
|
|
6
|
-
* - 目标不是抽象完整 provider 体系,而是先把 shell 命令从“宿主机直跑”收敛成“带边界执行”。
|
|
7
|
-
* - 边界只保留四类:路径、环境变量、网络、agent 级共享 HOME/TMPDIR/cache。
|
|
8
|
-
*/
|
|
9
|
-
import { spawn } from "node:child_process";
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
import fs from "fs-extra";
|
|
12
|
-
const DEFAULT_PATH_VALUE = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin";
|
|
13
|
-
function escapeSeatbeltString(value) {
|
|
14
|
-
return String(value || "").replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
15
|
-
}
|
|
16
|
-
function dedupePaths(values) {
|
|
17
|
-
const seen = new Set();
|
|
18
|
-
const result = [];
|
|
19
|
-
for (const value of values) {
|
|
20
|
-
const normalized = path.resolve(String(value || "").trim());
|
|
21
|
-
if (!normalized || seen.has(normalized))
|
|
22
|
-
continue;
|
|
23
|
-
seen.add(normalized);
|
|
24
|
-
result.push(normalized);
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
function buildReadablePaths(params) {
|
|
29
|
-
return dedupePaths([
|
|
30
|
-
"/bin",
|
|
31
|
-
"/usr",
|
|
32
|
-
"/System",
|
|
33
|
-
"/etc",
|
|
34
|
-
"/dev",
|
|
35
|
-
"/Library",
|
|
36
|
-
"/opt/homebrew",
|
|
37
|
-
"/usr/local",
|
|
38
|
-
params.rootPath,
|
|
39
|
-
params.sandboxDir,
|
|
40
|
-
params.tmpDir,
|
|
41
|
-
params.cacheDir,
|
|
42
|
-
path.dirname(params.shellPath),
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
45
|
-
function buildWritablePaths(params) {
|
|
46
|
-
return dedupePaths([
|
|
47
|
-
...params.config.writablePaths,
|
|
48
|
-
params.executionDir,
|
|
49
|
-
params.config.sandboxDir,
|
|
50
|
-
params.config.tmpDir,
|
|
51
|
-
params.config.cacheDir,
|
|
52
|
-
]);
|
|
53
|
-
}
|
|
54
|
-
function buildNetworkRules(networkMode) {
|
|
55
|
-
if (networkMode === "restricted" || networkMode === "full") {
|
|
56
|
-
return ["(allow network-outbound)", "(allow network-inbound)"];
|
|
57
|
-
}
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
function buildSeatbeltProfile(params) {
|
|
61
|
-
const readablePaths = buildReadablePaths({
|
|
62
|
-
rootPath: params.config.rootPath,
|
|
63
|
-
shellPath: params.shellPath,
|
|
64
|
-
sandboxDir: params.config.sandboxDir,
|
|
65
|
-
tmpDir: params.config.tmpDir,
|
|
66
|
-
cacheDir: params.config.cacheDir,
|
|
67
|
-
});
|
|
68
|
-
const writablePaths = buildWritablePaths(params);
|
|
69
|
-
const lines = [
|
|
70
|
-
"(version 1)",
|
|
71
|
-
"(deny default)",
|
|
72
|
-
'(import "system.sb")',
|
|
73
|
-
"(allow process*)",
|
|
74
|
-
"(allow sysctl-read)",
|
|
75
|
-
"(allow file-read-metadata)",
|
|
76
|
-
...readablePaths.map((value) => `(allow file-read* (subpath "${escapeSeatbeltString(value)}"))`),
|
|
77
|
-
...writablePaths.map((value) => `(allow file-write* (subpath "${escapeSeatbeltString(value)}"))`),
|
|
78
|
-
...buildNetworkRules(params.config.networkMode),
|
|
79
|
-
];
|
|
80
|
-
// 关键点(中文)
|
|
81
|
-
// - `cwd` 需要显式出现在读集合里,否则很多命令刚启动时就会因为工作目录不可见而失败。
|
|
82
|
-
// - 这里单独追加,避免未来 rootPath 与 cwd 的关系变化时被遗漏。
|
|
83
|
-
if (!readablePaths.includes(params.actualCwd)) {
|
|
84
|
-
lines.push(`(allow file-read* (subpath "${escapeSeatbeltString(params.actualCwd)}"))`);
|
|
85
|
-
}
|
|
86
|
-
return `${lines.join("\n")}\n`;
|
|
87
|
-
}
|
|
88
|
-
function buildSandboxEnv(params) {
|
|
89
|
-
const env = {};
|
|
90
|
-
for (const key of params.config.envAllowlist) {
|
|
91
|
-
const value = params.baseEnv[key];
|
|
92
|
-
if (typeof value !== "string" || !value.trim())
|
|
93
|
-
continue;
|
|
94
|
-
env[key] = value;
|
|
95
|
-
}
|
|
96
|
-
for (const [key, value] of Object.entries(params.baseEnv)) {
|
|
97
|
-
if (!key.startsWith("DC_"))
|
|
98
|
-
continue;
|
|
99
|
-
if (typeof value !== "string" || !value.trim())
|
|
100
|
-
continue;
|
|
101
|
-
env[key] = value;
|
|
102
|
-
}
|
|
103
|
-
env.PATH = String(env.PATH || params.baseEnv.PATH || DEFAULT_PATH_VALUE);
|
|
104
|
-
env.HOME = params.config.homeDir;
|
|
105
|
-
env.ZDOTDIR = params.config.homeDir;
|
|
106
|
-
env.TMPDIR = params.config.tmpDir;
|
|
107
|
-
env.XDG_CACHE_HOME = params.config.cacheDir;
|
|
108
|
-
env.DC_SANDBOX = "1";
|
|
109
|
-
env.DC_SANDBOX_DIR = params.config.sandboxDir;
|
|
110
|
-
env.DC_SANDBOX_HOME = params.config.homeDir;
|
|
111
|
-
env.DC_SANDBOX_CACHE = params.config.cacheDir;
|
|
112
|
-
env.SHELL = params.shellPath;
|
|
113
|
-
return env;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* 在 macOS seatbelt sandbox 中启动 shell 子进程。
|
|
117
|
-
*/
|
|
118
|
-
export async function spawnMacOsSeatbeltSandbox(params) {
|
|
119
|
-
const profilePath = path.join(params.executionDir, "sandbox-profile.sb");
|
|
120
|
-
await fs.ensureDir(params.config.sandboxDir);
|
|
121
|
-
await fs.ensureDir(params.config.tmpDir);
|
|
122
|
-
await fs.ensureDir(params.config.cacheDir);
|
|
123
|
-
await fs.ensureDir(params.executionDir);
|
|
124
|
-
const profile = buildSeatbeltProfile({
|
|
125
|
-
...params,
|
|
126
|
-
});
|
|
127
|
-
await fs.writeFile(profilePath, profile, "utf-8");
|
|
128
|
-
const child = spawn("sandbox-exec", [
|
|
129
|
-
"-f",
|
|
130
|
-
profilePath,
|
|
131
|
-
params.shellPath,
|
|
132
|
-
params.login ? "-lc" : "-c",
|
|
133
|
-
params.cmd,
|
|
134
|
-
], {
|
|
135
|
-
cwd: params.actualCwd,
|
|
136
|
-
stdio: "pipe",
|
|
137
|
-
env: buildSandboxEnv(params),
|
|
138
|
-
});
|
|
139
|
-
child.stdout.setEncoding("utf8");
|
|
140
|
-
child.stderr.setEncoding("utf8");
|
|
141
|
-
return {
|
|
142
|
-
child,
|
|
143
|
-
cwd: params.actualCwd,
|
|
144
|
-
sandboxed: true,
|
|
145
|
-
sandboxMode: "safe",
|
|
146
|
-
backend: "macos-seatbelt",
|
|
147
|
-
networkMode: params.config.networkMode,
|
|
148
|
-
sandboxDir: params.config.sandboxDir,
|
|
149
|
-
homeDir: params.config.homeDir,
|
|
150
|
-
tmpDir: params.config.tmpDir,
|
|
151
|
-
cacheDir: params.config.cacheDir,
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
//# sourceMappingURL=MacOsSeatbeltSandbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MacOsSeatbeltSandbox.js","sourceRoot":"","sources":["../../src/sandbox/MacOsSeatbeltSandbox.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,UAAU,CAAC;AAM1B,MAAM,kBAAkB,GACtB,gEAAgE,CAAC;AA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,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEjC,OAAO;QACL,KAAK;QACL,GAAG,EAAE,MAAM,CAAC,SAAS;QACrB,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE,gBAAgB;QACzB,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW;QACtC,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU;QACpC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO;QAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;QAC5B,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ;KACjC,CAAC;AACJ,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sandbox 配置解析器。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 这里负责把 `downcity.json` 中面向用户的最小配置,收敛成运行时可直接执行的绝对路径配置。
|
|
6
|
-
* - sandbox 是 agent 项目级能力,持久目录固定为 `<project>/.downcity/sandbox`。
|
|
7
|
-
* - 当前版本只服务 shell / CLI 这条命令执行链,不引入审批、profile 绑定或用户权限系统。
|
|
8
|
-
* - 解析结果只回答一个问题:这次命令执行的 sandbox 边界是什么。
|
|
9
|
-
*/
|
|
10
|
-
import type { AgentContext } from "../types/runtime/agent/AgentContext.js";
|
|
11
|
-
import type { SandboxBackend } from "../sandbox/types/SandboxRuntime.js";
|
|
12
|
-
import type { ResolvedSandboxConfig } from "../sandbox/types/SandboxRuntime.js";
|
|
13
|
-
/**
|
|
14
|
-
* 判断目标路径是否位于根目录内,或与根目录本身相同。
|
|
15
|
-
*/
|
|
16
|
-
export declare function isPathInsideRoot(rootPath: string, targetPath: string): boolean;
|
|
17
|
-
/**
|
|
18
|
-
* 根据宿主平台解析当前 sandbox backend。
|
|
19
|
-
*/
|
|
20
|
-
export declare function resolveSandboxBackend(): SandboxBackend;
|
|
21
|
-
/**
|
|
22
|
-
* 解析当前请求最终使用的 sandbox 配置。
|
|
23
|
-
*/
|
|
24
|
-
export declare function resolveSandboxConfig(context: AgentContext): ResolvedSandboxConfig;
|
|
25
|
-
/**
|
|
26
|
-
* 归一化 sandbox 内实际使用的工作目录。
|
|
27
|
-
*
|
|
28
|
-
* 说明(中文)
|
|
29
|
-
* - sandbox 启用时,工作目录必须收敛在 `rootPath` 范围内。
|
|
30
|
-
* - 超出项目根目录的 `cwd` 会被强制拉回 `rootPath`,避免宿主目录通过 `cwd` 泄漏回去。
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveSandboxCwd(params: {
|
|
33
|
-
rootPath: string;
|
|
34
|
-
requestedCwd: string;
|
|
35
|
-
context: AgentContext;
|
|
36
|
-
}): string;
|
|
37
|
-
//# sourceMappingURL=SandboxConfigResolver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxConfigResolver.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxConfigResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AA4B/E;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAM9E;AAyCD;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,cAAc,CAMtD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,qBAAqB,CAuBjF;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;CACvB,GAAG,MAAM,CAUT"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sandbox 配置解析器。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 这里负责把 `downcity.json` 中面向用户的最小配置,收敛成运行时可直接执行的绝对路径配置。
|
|
6
|
-
* - sandbox 是 agent 项目级能力,持久目录固定为 `<project>/.downcity/sandbox`。
|
|
7
|
-
* - 当前版本只服务 shell / CLI 这条命令执行链,不引入审批、profile 绑定或用户权限系统。
|
|
8
|
-
* - 解析结果只回答一个问题:这次命令执行的 sandbox 边界是什么。
|
|
9
|
-
*/
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
const DEFAULT_ENV_ALLOWLIST = [
|
|
12
|
-
"PATH",
|
|
13
|
-
"LANG",
|
|
14
|
-
"TERM",
|
|
15
|
-
"COLORTERM",
|
|
16
|
-
"LC_ALL",
|
|
17
|
-
"LC_CTYPE",
|
|
18
|
-
"SHELL",
|
|
19
|
-
"USER",
|
|
20
|
-
"LOGNAME",
|
|
21
|
-
];
|
|
22
|
-
const SANDBOX_RELATIVE_DIR = path.join(".downcity", "sandbox");
|
|
23
|
-
function normalizeEnvAllowlist(values) {
|
|
24
|
-
const seen = new Set();
|
|
25
|
-
const result = [];
|
|
26
|
-
for (const value of values || DEFAULT_ENV_ALLOWLIST) {
|
|
27
|
-
const normalized = String(value || "").trim();
|
|
28
|
-
if (!normalized || seen.has(normalized))
|
|
29
|
-
continue;
|
|
30
|
-
seen.add(normalized);
|
|
31
|
-
result.push(normalized);
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 判断目标路径是否位于根目录内,或与根目录本身相同。
|
|
37
|
-
*/
|
|
38
|
-
export function isPathInsideRoot(rootPath, targetPath) {
|
|
39
|
-
const normalizedRoot = path.resolve(rootPath);
|
|
40
|
-
const normalizedTarget = path.resolve(targetPath);
|
|
41
|
-
if (normalizedRoot === normalizedTarget)
|
|
42
|
-
return true;
|
|
43
|
-
const relative = path.relative(normalizedRoot, normalizedTarget);
|
|
44
|
-
return Boolean(relative) && !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
45
|
-
}
|
|
46
|
-
function normalizeWritablePaths(params) {
|
|
47
|
-
const { rootPath, sandboxDir, writablePaths, context } = params;
|
|
48
|
-
const rawValues = Array.isArray(writablePaths) && writablePaths.length > 0
|
|
49
|
-
? [rootPath, sandboxDir, ...writablePaths]
|
|
50
|
-
: [rootPath, sandboxDir];
|
|
51
|
-
const seen = new Set();
|
|
52
|
-
const result = [];
|
|
53
|
-
for (const rawValue of rawValues) {
|
|
54
|
-
const normalizedValue = String(rawValue || "").trim();
|
|
55
|
-
if (!normalizedValue)
|
|
56
|
-
continue;
|
|
57
|
-
const resolvedPath = path.resolve(path.isAbsolute(normalizedValue) ? normalizedValue : path.join(rootPath, normalizedValue));
|
|
58
|
-
if (!isPathInsideRoot(rootPath, resolvedPath)) {
|
|
59
|
-
context.logger.warn("[sandbox] writable path ignored because it escapes project root", {
|
|
60
|
-
rootPath,
|
|
61
|
-
ignoredPath: normalizedValue,
|
|
62
|
-
resolvedPath,
|
|
63
|
-
});
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (seen.has(resolvedPath))
|
|
67
|
-
continue;
|
|
68
|
-
seen.add(resolvedPath);
|
|
69
|
-
result.push(resolvedPath);
|
|
70
|
-
}
|
|
71
|
-
if (result.length === 0) {
|
|
72
|
-
result.push(path.resolve(rootPath));
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* 根据宿主平台解析当前 sandbox backend。
|
|
78
|
-
*/
|
|
79
|
-
export function resolveSandboxBackend() {
|
|
80
|
-
if (process.platform === "darwin")
|
|
81
|
-
return "macos-seatbelt";
|
|
82
|
-
if (process.platform === "linux")
|
|
83
|
-
return "linux-bubblewrap";
|
|
84
|
-
throw new Error(`sandbox backend is required for shell execution, but current platform is unsupported: ${process.platform}`);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* 解析当前请求最终使用的 sandbox 配置。
|
|
88
|
-
*/
|
|
89
|
-
export function resolveSandboxConfig(context) {
|
|
90
|
-
const rootPath = path.resolve(context.rootPath);
|
|
91
|
-
const projectConfig = context.config?.sandbox;
|
|
92
|
-
const sandboxDir = path.join(rootPath, SANDBOX_RELATIVE_DIR);
|
|
93
|
-
const tmpDir = path.join(sandboxDir, "tmp");
|
|
94
|
-
const cacheDir = path.join(sandboxDir, ".cache");
|
|
95
|
-
return {
|
|
96
|
-
backend: resolveSandboxBackend(),
|
|
97
|
-
rootPath,
|
|
98
|
-
sandboxDir,
|
|
99
|
-
homeDir: sandboxDir,
|
|
100
|
-
tmpDir,
|
|
101
|
-
cacheDir,
|
|
102
|
-
envAllowlist: normalizeEnvAllowlist(projectConfig?.envAllowlist),
|
|
103
|
-
writablePaths: normalizeWritablePaths({
|
|
104
|
-
rootPath,
|
|
105
|
-
sandboxDir,
|
|
106
|
-
writablePaths: projectConfig?.writablePaths,
|
|
107
|
-
context,
|
|
108
|
-
}),
|
|
109
|
-
networkMode: projectConfig?.networkMode || "full",
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* 归一化 sandbox 内实际使用的工作目录。
|
|
114
|
-
*
|
|
115
|
-
* 说明(中文)
|
|
116
|
-
* - sandbox 启用时,工作目录必须收敛在 `rootPath` 范围内。
|
|
117
|
-
* - 超出项目根目录的 `cwd` 会被强制拉回 `rootPath`,避免宿主目录通过 `cwd` 泄漏回去。
|
|
118
|
-
*/
|
|
119
|
-
export function resolveSandboxCwd(params) {
|
|
120
|
-
const normalizedCwd = path.resolve(params.requestedCwd);
|
|
121
|
-
if (isPathInsideRoot(params.rootPath, normalizedCwd)) {
|
|
122
|
-
return normalizedCwd;
|
|
123
|
-
}
|
|
124
|
-
params.context.logger.warn("[sandbox] cwd escapes project root and was reset to rootPath", {
|
|
125
|
-
rootPath: params.rootPath,
|
|
126
|
-
requestedCwd: normalizedCwd,
|
|
127
|
-
});
|
|
128
|
-
return params.rootPath;
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=SandboxConfigResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxConfigResolver.js","sourceRoot":"","sources":["../../src/sandbox/SandboxConfigResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAK7B,MAAM,qBAAqB,GAAG;IAC5B,MAAM;IACN,MAAM;IACN,MAAM;IACN,WAAW;IACX,QAAQ;IACR,UAAU;IACV,OAAO;IACP,MAAM;IACN,SAAS;CACV,CAAC;AAEF,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAE/D,SAAS,qBAAqB,CAAC,MAAiB;IAC9C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,KAAK,IAAI,MAAM,IAAI,qBAAqB,EAAE,CAAC;QACpD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9C,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE,SAAS;QAClD,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,UAAkB;IACnE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,QA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,qBAAqB,EAAE;QAChC,QAAQ;QACR,UAAU;QACV,OAAO,EAAE,UAAU;QACnB,MAAM;QACN,QAAQ;QACR,YAAY,EAAE,qBAAqB,CAAC,aAAa,EAAE,YAAY,CAAC;QAChE,aAAa,EAAE,sBAAsB,CAAC;YACpC,QAAQ;YACR,UAAU;YACV,aAAa,EAAE,aAAa,EAAE,aAAa;YAC3C,OAAO;SACR,CAAC;QACF,WAAW,EAAE,aAAa,EAAE,WAAW,IAAI,MAAM;KAClD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAIjC;IACC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACxD,IAAI,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,EAAE,CAAC;QACrD,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8DAA8D,EAAE;QACzF,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,YAAY,EAAE,aAAa;KAC5B,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,QAAQ,CAAC;AACzB,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SandboxPreflight:本机 shell sandbox 依赖预检。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - shell 命令必须进入 sandbox;这里提前检查 backend 依赖,避免启动后首次 shell 执行才失败。
|
|
6
|
-
* - Linux backend 基于 bubblewrap,本质使用 Linux namespaces / bind mount 等内核能力。
|
|
7
|
-
* - 本模块只诊断并给出修复建议,不自动安装软件,也不修改宿主机 sysctl。
|
|
8
|
-
*/
|
|
9
|
-
import type { SandboxBackend } from "../sandbox/types/SandboxRuntime.js";
|
|
10
|
-
/**
|
|
11
|
-
* sandbox 预检失败原因。
|
|
12
|
-
*/
|
|
13
|
-
export type SandboxPreflightIssueCode = "unsupported-platform" | "missing-command" | "userns-disabled";
|
|
14
|
-
/**
|
|
15
|
-
* 单条 sandbox 预检失败。
|
|
16
|
-
*/
|
|
17
|
-
export interface SandboxPreflightIssue {
|
|
18
|
-
/**
|
|
19
|
-
* 机器可读的失败原因。
|
|
20
|
-
*/
|
|
21
|
-
code: SandboxPreflightIssueCode;
|
|
22
|
-
/**
|
|
23
|
-
* 人类可读的失败说明。
|
|
24
|
-
*/
|
|
25
|
-
message: string;
|
|
26
|
-
/**
|
|
27
|
-
* 可复制的修复建议列表。
|
|
28
|
-
*/
|
|
29
|
-
fixes: string[];
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* sandbox 预检结果。
|
|
33
|
-
*/
|
|
34
|
-
export interface SandboxPreflightResult {
|
|
35
|
-
/**
|
|
36
|
-
* 当前平台是否满足 shell sandbox 启动要求。
|
|
37
|
-
*/
|
|
38
|
-
ok: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* 当前宿主平台。
|
|
41
|
-
*/
|
|
42
|
-
platform: NodeJS.Platform;
|
|
43
|
-
/**
|
|
44
|
-
* 当前平台对应的 sandbox backend。
|
|
45
|
-
*/
|
|
46
|
-
backend?: SandboxBackend;
|
|
47
|
-
/**
|
|
48
|
-
* 失败原因集合。
|
|
49
|
-
*/
|
|
50
|
-
issues: SandboxPreflightIssue[];
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* sandbox 预检宿主探测依赖。
|
|
54
|
-
*/
|
|
55
|
-
export interface ShellSandboxPreflightProbe {
|
|
56
|
-
/**
|
|
57
|
-
* 判断命令是否存在于 PATH 中。
|
|
58
|
-
*/
|
|
59
|
-
commandExists(command: string): Promise<boolean>;
|
|
60
|
-
/**
|
|
61
|
-
* 读取 `/proc` 下整数配置。
|
|
62
|
-
*/
|
|
63
|
-
readProcInt(filePath: string): Promise<number | null>;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* 检查当前宿主是否满足 shell sandbox 运行要求。
|
|
67
|
-
*/
|
|
68
|
-
export declare function checkShellSandboxPreflight(): Promise<SandboxPreflightResult>;
|
|
69
|
-
/**
|
|
70
|
-
* 使用注入探针检查当前宿主是否满足 shell sandbox 运行要求。
|
|
71
|
-
*/
|
|
72
|
-
export declare function checkShellSandboxPreflightWithProbe(probe: ShellSandboxPreflightProbe): Promise<SandboxPreflightResult>;
|
|
73
|
-
//# sourceMappingURL=SandboxPreflight.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxPreflight.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxPreflight.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,sBAAsB,GACtB,iBAAiB,GACjB,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,yBAAyB,CAAC;IAEhC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,EAAE,EAAE,OAAO,CAAC;IAEZ;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAE1B;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;OAEG;IACH,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEjD;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACvD;AAyCD;;GAEG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAKlF;AAED;;GAEG;AACH,wBAAsB,mCAAmC,CACvD,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,sBAAsB,CAAC,CAoEjC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SandboxPreflight:本机 shell sandbox 依赖预检。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - shell 命令必须进入 sandbox;这里提前检查 backend 依赖,避免启动后首次 shell 执行才失败。
|
|
6
|
-
* - Linux backend 基于 bubblewrap,本质使用 Linux namespaces / bind mount 等内核能力。
|
|
7
|
-
* - 本模块只诊断并给出修复建议,不自动安装软件,也不修改宿主机 sysctl。
|
|
8
|
-
*/
|
|
9
|
-
import { access, readFile } from "node:fs/promises";
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
import { delimiter } from "node:path";
|
|
12
|
-
async function commandExists(command) {
|
|
13
|
-
const pathValue = String(process.env.PATH || "").trim();
|
|
14
|
-
const dirs = pathValue ? pathValue.split(delimiter) : [];
|
|
15
|
-
for (const dir of dirs) {
|
|
16
|
-
const candidate = path.join(dir, command);
|
|
17
|
-
try {
|
|
18
|
-
await access(candidate);
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
// continue
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
async function readProcInt(filePath) {
|
|
28
|
-
try {
|
|
29
|
-
const raw = await readFile(filePath, "utf-8");
|
|
30
|
-
const value = Number.parseInt(raw.trim(), 10);
|
|
31
|
-
return Number.isFinite(value) && !Number.isNaN(value) ? value : null;
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async function isLinuxUserNamespaceEnabled(probe) {
|
|
38
|
-
const unprivilegedUsernsClone = await probe.readProcInt("/proc/sys/kernel/unprivileged_userns_clone");
|
|
39
|
-
if (unprivilegedUsernsClone === 0)
|
|
40
|
-
return false;
|
|
41
|
-
const maxUserNamespaces = await probe.readProcInt("/proc/sys/user/max_user_namespaces");
|
|
42
|
-
if (maxUserNamespaces === 0)
|
|
43
|
-
return false;
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* 检查当前宿主是否满足 shell sandbox 运行要求。
|
|
48
|
-
*/
|
|
49
|
-
export async function checkShellSandboxPreflight() {
|
|
50
|
-
return await checkShellSandboxPreflightWithProbe({
|
|
51
|
-
commandExists,
|
|
52
|
-
readProcInt,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 使用注入探针检查当前宿主是否满足 shell sandbox 运行要求。
|
|
57
|
-
*/
|
|
58
|
-
export async function checkShellSandboxPreflightWithProbe(probe) {
|
|
59
|
-
const platform = process.platform;
|
|
60
|
-
const issues = [];
|
|
61
|
-
if (platform === "darwin") {
|
|
62
|
-
if (!(await probe.commandExists("sandbox-exec"))) {
|
|
63
|
-
issues.push({
|
|
64
|
-
code: "missing-command",
|
|
65
|
-
message: "macOS shell sandbox requires sandbox-exec, but it was not found.",
|
|
66
|
-
fixes: [
|
|
67
|
-
"Use a macOS system that includes /usr/bin/sandbox-exec.",
|
|
68
|
-
],
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
ok: issues.length === 0,
|
|
73
|
-
platform,
|
|
74
|
-
backend: "macos-seatbelt",
|
|
75
|
-
issues,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (platform === "linux") {
|
|
79
|
-
if (!(await probe.commandExists("bwrap"))) {
|
|
80
|
-
issues.push({
|
|
81
|
-
code: "missing-command",
|
|
82
|
-
message: "Linux shell sandbox requires bubblewrap (bwrap), but it was not found.",
|
|
83
|
-
fixes: [
|
|
84
|
-
"Debian / Ubuntu: sudo apt install bubblewrap",
|
|
85
|
-
"Fedora: sudo dnf install bubblewrap",
|
|
86
|
-
"Arch: sudo pacman -S bubblewrap",
|
|
87
|
-
],
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (!(await isLinuxUserNamespaceEnabled(probe))) {
|
|
91
|
-
issues.push({
|
|
92
|
-
code: "userns-disabled",
|
|
93
|
-
message: "Linux user namespaces are disabled, so bubblewrap cannot create the sandbox.",
|
|
94
|
-
fixes: [
|
|
95
|
-
"Check: cat /proc/sys/kernel/unprivileged_userns_clone",
|
|
96
|
-
"Check: cat /proc/sys/user/max_user_namespaces",
|
|
97
|
-
"Debian / Ubuntu: sudo sysctl kernel.unprivileged_userns_clone=1",
|
|
98
|
-
],
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return {
|
|
102
|
-
ok: issues.length === 0,
|
|
103
|
-
platform,
|
|
104
|
-
backend: "linux-bubblewrap",
|
|
105
|
-
issues,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
ok: false,
|
|
110
|
-
platform,
|
|
111
|
-
issues: [
|
|
112
|
-
{
|
|
113
|
-
code: "unsupported-platform",
|
|
114
|
-
message: `Shell sandbox is not supported on this platform: ${platform}.`,
|
|
115
|
-
fixes: [
|
|
116
|
-
"Use macOS or Linux for local shell execution.",
|
|
117
|
-
],
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=SandboxPreflight.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxPreflight.js","sourceRoot":"","sources":["../../src/sandbox/SandboxPreflight.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW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YAChD,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,iBAAiB;gBACvB,OAAO,EAAE,8EAA8E;gBACvF,KAAK,EAAE;oBACL,uDAAuD;oBACvD,+CAA+C;oBAC/C,iEAAiE;iBAClE;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YACvB,QAAQ;YACR,OAAO,EAAE,kBAAkB;YAC3B,MAAM;SACP,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,KAAK;QACT,QAAQ;QACR,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,oDAAoD,QAAQ,GAAG;gBACxE,KAAK,EAAE;oBACL,+CAA+C;iBAChD;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SandboxRunner 入口。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 这里不实现完整的 session/read/write 协议,只负责本地子进程创建时统一进入 agent sandbox backend。
|
|
6
|
-
* - 当前版本接入 macOS seatbelt 与 Linux bubblewrap backend。
|
|
7
|
-
* - 本地命令不再允许回退到宿主机普通子进程执行。
|
|
8
|
-
*/
|
|
9
|
-
import type { AgentContext } from "../types/runtime/agent/AgentContext.js";
|
|
10
|
-
import type { SandboxSpawnResult } from "../sandbox/types/SandboxRuntime.js";
|
|
11
|
-
/**
|
|
12
|
-
* 启动 shell 子进程。
|
|
13
|
-
*/
|
|
14
|
-
export declare function spawnShellProcess(params: {
|
|
15
|
-
context: AgentContext;
|
|
16
|
-
shellId: string;
|
|
17
|
-
shellDir: string;
|
|
18
|
-
cmd: string;
|
|
19
|
-
cwd: string;
|
|
20
|
-
shellPath: string;
|
|
21
|
-
login: boolean;
|
|
22
|
-
baseEnv: NodeJS.ProcessEnv;
|
|
23
|
-
sandboxMode?: "safe" | "unrestricted";
|
|
24
|
-
}): Promise<SandboxSpawnResult>;
|
|
25
|
-
/**
|
|
26
|
-
* 在当前 agent sandbox 中启动本地子进程。
|
|
27
|
-
*/
|
|
28
|
-
export declare function spawnInSandbox(params: {
|
|
29
|
-
context: AgentContext;
|
|
30
|
-
executionId: string;
|
|
31
|
-
executionDir: string;
|
|
32
|
-
cmd: string;
|
|
33
|
-
cwd: string;
|
|
34
|
-
shellPath: string;
|
|
35
|
-
login: boolean;
|
|
36
|
-
baseEnv: NodeJS.ProcessEnv;
|
|
37
|
-
sandboxMode?: "safe" | "unrestricted";
|
|
38
|
-
}): Promise<SandboxSpawnResult>;
|
|
39
|
-
/**
|
|
40
|
-
* 执行一次 one-shot sandbox 命令并等待结束。
|
|
41
|
-
*
|
|
42
|
-
* 关键点(中文)
|
|
43
|
-
* - 供 task script 这类“直接执行命令但不需要 shell session 管理”的路径复用。
|
|
44
|
-
* - 非零退出码会直接抛错,行为与原先 `execa(..., { reject: true })` 保持一致。
|
|
45
|
-
*/
|
|
46
|
-
export declare function runSandboxCommand(params: {
|
|
47
|
-
context: AgentContext;
|
|
48
|
-
executionId: string;
|
|
49
|
-
executionDir: string;
|
|
50
|
-
cmd: string;
|
|
51
|
-
cwd: string;
|
|
52
|
-
shellPath: string;
|
|
53
|
-
login: boolean;
|
|
54
|
-
baseEnv: NodeJS.ProcessEnv;
|
|
55
|
-
}): Promise<{
|
|
56
|
-
stdout: string;
|
|
57
|
-
stderr: string;
|
|
58
|
-
exitCode: number;
|
|
59
|
-
spawn: SandboxSpawnResult;
|
|
60
|
-
}>;
|
|
61
|
-
//# sourceMappingURL=SandboxRunner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxRunner.d.ts","sourceRoot":"","sources":["../../src/sandbox/SandboxRunner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,KA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