Gateway/Plugins: device pairing + phone control plugins (#11755)

This commit is contained in:
Mariano Belinky
2026-02-08 18:07:13 +01:00
parent 2f91bf550f
commit 730f86dd5c
24 changed files with 1960 additions and 31 deletions

View File

@@ -64,5 +64,13 @@ describe("configureGatewayForOnboarding", () => {
});
expect(result.settings.gatewayToken).toBe("generated-token");
expect(result.nextConfig.gateway?.nodes?.denyCommands).toEqual([
"camera.snap",
"camera.clip",
"screen.record",
"calendar.add",
"contacts.add",
"reminders.add",
]);
});
});

View File

@@ -10,6 +10,20 @@ import type { WizardPrompter } from "./prompts.js";
import { normalizeGatewayTokenInput, randomToken } from "../commands/onboard-helpers.js";
import { findTailscaleBinary } from "../infra/tailscale.js";
// These commands are "high risk" (privacy writes/recording) and should be
// explicitly armed by the user when they want to use them.
//
// This only affects what the gateway will accept via node.invoke; the iOS app
// still prompts for OS permissions (camera/photos/contacts/etc) on first use.
const DEFAULT_DANGEROUS_NODE_DENY_COMMANDS = [
"camera.snap",
"camera.clip",
"screen.record",
"calendar.add",
"contacts.add",
"reminders.add",
];
type ConfigureGatewayOptions = {
flow: WizardFlow;
baseConfig: OpenClawConfig;
@@ -236,6 +250,27 @@ export async function configureGatewayForOnboarding(
},
};
// If this is a new gateway setup (no existing gateway settings), start with a
// denylist for high-risk node commands. Users can arm these temporarily via
// /phone arm ... (phone-control plugin).
if (
!quickstartGateway.hasExisting &&
nextConfig.gateway?.nodes?.denyCommands === undefined &&
nextConfig.gateway?.nodes?.allowCommands === undefined &&
nextConfig.gateway?.nodes?.browser === undefined
) {
nextConfig = {
...nextConfig,
gateway: {
...nextConfig.gateway,
nodes: {
...nextConfig.gateway?.nodes,
denyCommands: [...DEFAULT_DANGEROUS_NODE_DENY_COMMANDS],
},
},
};
}
return {
nextConfig,
settings: {