feat: add pure ssh2 remote operations

This commit is contained in:
云服务部-叶林立
2026-08-21 19:51:43 +08:00
parent d3bf562189
commit 0ac50eb581
62 changed files with 3701 additions and 47 deletions
+14 -9
View File
@@ -242,17 +242,22 @@ export function mergeUnifiedConfigs(
}
}
// shellTools: shallow-merge by tool name so a project entry overrides a
// colliding tool's alias but never drops a global entry (a dropped alias is
// a silent enforcement regression).
// shellTools: merge by tool name, then by descriptor field. A project can
// replace argument names, but omitting a global decisionFloor must not silently
// remove that security boundary.
const baseShell = base.shellTools;
const overrideShell = override.shellTools;
if (baseShell && overrideShell) {
merged.shellTools = { ...baseShell, ...overrideShell };
} else if (baseShell) {
merged.shellTools = baseShell;
} else if (overrideShell) {
merged.shellTools = overrideShell;
if (baseShell || overrideShell) {
const toolNames = new Set([
...Object.keys(baseShell ?? {}),
...Object.keys(overrideShell ?? {}),
]);
merged.shellTools = Object.fromEntries(
[...toolNames].map((toolName) => [
toolName,
{ ...baseShell?.[toolName], ...overrideShell?.[toolName] },
]),
) as ShellToolsConfig;
}
// Permission: deep-shallow merge