@clawos-dev/clawd 0.2.151-beta.319.24d7cf9 → 0.2.152-beta.320.c7b0769
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/cli.cjs +22 -39
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -4536,6 +4536,9 @@ var init_persona_schemas = __esm({
|
|
|
4536
4536
|
enabled: external_exports.boolean().optional(),
|
|
4537
4537
|
autoAllowBashIfSandboxed: external_exports.boolean().optional(),
|
|
4538
4538
|
allowUnsandboxedCommands: external_exports.boolean().optional(),
|
|
4539
|
+
// 命令前缀白名单(CC `sandbox.excludedCommands`):匹配的命令在沙箱外运行,
|
|
4540
|
+
// 用于需逃出沙箱的工具(如 'docker *' / 'aliyun *' 要访问宿主 socket / 凭证)。
|
|
4541
|
+
excludedCommands: external_exports.array(external_exports.string()).optional(),
|
|
4539
4542
|
filesystem: external_exports.object({
|
|
4540
4543
|
denyRead: external_exports.array(external_exports.string()).optional(),
|
|
4541
4544
|
allowRead: external_exports.array(external_exports.string()).optional(),
|
|
@@ -32009,6 +32012,9 @@ function applyProfile(base, profile) {
|
|
|
32009
32012
|
if (pn.allowedDomains) n.allowedDomains = unionArr(n.allowedDomains, pn.allowedDomains);
|
|
32010
32013
|
if (pn.allowLocalBinding !== void 0) n.allowLocalBinding = pn.allowLocalBinding;
|
|
32011
32014
|
}
|
|
32015
|
+
if (profile.sandbox?.excludedCommands) {
|
|
32016
|
+
base.sandbox.excludedCommands = unionArr(base.sandbox.excludedCommands, profile.sandbox.excludedCommands);
|
|
32017
|
+
}
|
|
32012
32018
|
return base;
|
|
32013
32019
|
}
|
|
32014
32020
|
function composeGuestSandbox(base, userWorkDir, spawnCwd) {
|
|
@@ -35695,7 +35701,12 @@ var DEFAULT_PERSONAS = [
|
|
|
35695
35701
|
model: "opus",
|
|
35696
35702
|
iconKey: "doc",
|
|
35697
35703
|
public: false,
|
|
35698
|
-
|
|
35704
|
+
// 同 DEFAULT_BYPASS_PROFILE(bypassPermissions + 最严格沙箱),额外把 aliyun CLI 放沙箱外跑:
|
|
35705
|
+
// 上传 HTML 演示稿到 OSS 需 aliyun 读宿主凭证 / 外联,沙箱内会被拦。
|
|
35706
|
+
sandboxProfile: {
|
|
35707
|
+
permissions: { defaultMode: "bypassPermissions" },
|
|
35708
|
+
sandbox: { excludedCommands: ["aliyun *"] }
|
|
35709
|
+
}
|
|
35699
35710
|
}
|
|
35700
35711
|
];
|
|
35701
35712
|
function bundleSiblingFromArgv(argv1, sibling) {
|
|
@@ -37161,68 +37172,40 @@ function observeReady(surface, opts) {
|
|
|
37161
37172
|
}
|
|
37162
37173
|
};
|
|
37163
37174
|
}
|
|
37164
|
-
var BYPASS_SETTLE_MS = 300;
|
|
37165
37175
|
function createBootGate(pty, logger) {
|
|
37166
37176
|
const stripAnsi = (s) => s.replace(/\x1b\[[0-9;?]*C/g, " ").replace(/\x1b\[[0-9;?]*[a-zA-Z]/g, "").replace(/\x1b\][^\x07]*\x07/g, "").replace(/\x1b[NOPM=>78]/g, "").replace(/[\x00-\x1f\x7f]/g, " ");
|
|
37167
37177
|
const popups = {
|
|
37168
|
-
trust: {
|
|
37169
|
-
handled: false,
|
|
37170
|
-
fired: false,
|
|
37171
|
-
timer: void 0,
|
|
37172
|
-
regex: /trust\s*this\s*folder/i,
|
|
37173
|
-
accept: "\r",
|
|
37174
|
-
settleMs: 0,
|
|
37175
|
-
label: "trust-folder"
|
|
37176
|
-
},
|
|
37178
|
+
trust: { handled: false, regex: /trust this folder/i, accept: "\r", label: "trust-folder" },
|
|
37177
37179
|
bypass: {
|
|
37178
37180
|
handled: false,
|
|
37179
|
-
|
|
37180
|
-
timer: void 0,
|
|
37181
|
-
regex: /Bypass\s*Permissions\s*mode|By\s*proceeding/i,
|
|
37181
|
+
regex: /Bypass Permissions mode|By proceeding/i,
|
|
37182
37182
|
accept: "2\r",
|
|
37183
|
-
settleMs: BYPASS_SETTLE_MS,
|
|
37184
37183
|
label: "bypass-warning"
|
|
37185
37184
|
}
|
|
37186
37185
|
};
|
|
37187
37186
|
let scanBuf = "";
|
|
37188
|
-
const press = (popup) => {
|
|
37189
|
-
popup.fired = true;
|
|
37190
|
-
logger?.debug(`${popup.label} popup auto-yes`);
|
|
37191
|
-
try {
|
|
37192
|
-
pty.write(popup.accept);
|
|
37193
|
-
} catch (err) {
|
|
37194
|
-
logger?.warn(`${popup.label} auto-yes write failed`, {
|
|
37195
|
-
error: err.message
|
|
37196
|
-
});
|
|
37197
|
-
}
|
|
37198
|
-
};
|
|
37199
|
-
let disposed = false;
|
|
37200
37187
|
return {
|
|
37201
37188
|
feedBytes(data) {
|
|
37202
|
-
if (disposed) return;
|
|
37203
37189
|
scanBuf += data.toString("utf8");
|
|
37204
37190
|
const cleanBuf = stripAnsi(scanBuf).replace(/\s+/g, " ");
|
|
37205
37191
|
for (const popup of Object.values(popups)) {
|
|
37206
37192
|
if (popup.handled) continue;
|
|
37207
37193
|
if (popup.regex.test(cleanBuf)) {
|
|
37208
37194
|
popup.handled = true;
|
|
37195
|
+
logger?.debug(`${popup.label} popup auto-yes`);
|
|
37196
|
+
try {
|
|
37197
|
+
pty.write(popup.accept);
|
|
37198
|
+
} catch (err) {
|
|
37199
|
+
logger?.warn(`${popup.label} auto-yes write failed`, {
|
|
37200
|
+
error: err.message
|
|
37201
|
+
});
|
|
37202
|
+
}
|
|
37209
37203
|
scanBuf = "";
|
|
37210
|
-
if (popup.settleMs === 0) press(popup);
|
|
37211
|
-
}
|
|
37212
|
-
}
|
|
37213
|
-
for (const popup of Object.values(popups)) {
|
|
37214
|
-
if (popup.handled && popup.settleMs > 0 && !popup.fired) {
|
|
37215
|
-
if (popup.timer) clearTimeout(popup.timer);
|
|
37216
|
-
popup.timer = setTimeout(() => press(popup), popup.settleMs);
|
|
37217
37204
|
}
|
|
37218
37205
|
}
|
|
37219
37206
|
if (scanBuf.length > 8192) scanBuf = scanBuf.slice(-4096);
|
|
37220
37207
|
},
|
|
37221
37208
|
dispose() {
|
|
37222
|
-
disposed = true;
|
|
37223
|
-
for (const popup of Object.values(popups)) {
|
|
37224
|
-
if (popup.timer) clearTimeout(popup.timer);
|
|
37225
|
-
}
|
|
37226
37209
|
}
|
|
37227
37210
|
};
|
|
37228
37211
|
}
|
package/package.json
CHANGED