Matrix: show account-scoped onboarding paths

This commit is contained in:
Gustavo Madeira Santana
2026-03-09 04:58:10 -04:00
parent 6bfbc4a3ff
commit 6a53c583e4
4 changed files with 52 additions and 3 deletions

View File

@@ -75,6 +75,10 @@ export type ChannelOnboardingDmPolicy = {
channel: ChannelId;
policyKey: string;
allowFromKey: string;
resolveConfigKeys?: (
cfg: OpenClawConfig,
accountId?: string,
) => { policyKey: string; allowFromKey: string };
getCurrent: (cfg: OpenClawConfig, accountId?: string) => DmPolicy;
setPolicy: (cfg: OpenClawConfig, policy: DmPolicy, accountId?: string) => OpenClawConfig;
promptAllowFrom?: (params: {

View File

@@ -247,12 +247,16 @@ async function maybeConfigureDmPolicies(params: {
let cfg = params.cfg;
const selectPolicy = async (policy: ChannelOnboardingDmPolicy) => {
const accountId = accountIdsByChannel?.get(policy.channel);
const { policyKey, allowFromKey } = policy.resolveConfigKeys?.(cfg, accountId) ?? {
policyKey: policy.policyKey,
allowFromKey: policy.allowFromKey,
};
await prompter.note(
[
"Default: pairing (unknown DMs get a pairing code).",
`Approve: ${formatCliCommand(`openclaw pairing approve ${policy.channel} <code>`)}`,
`Allowlist DMs: ${policy.policyKey}="allowlist" + ${policy.allowFromKey} entries.`,
`Public DMs: ${policy.policyKey}="open" + ${policy.allowFromKey} includes "*".`,
`Allowlist DMs: ${policyKey}="allowlist" + ${allowFromKey} entries.`,
`Public DMs: ${policyKey}="open" + ${allowFromKey} includes "*".`,
"Multi-user DMs: run: " +
formatCliCommand('openclaw config set session.dmScope "per-channel-peer"') +
' (or "per-account-channel-peer" for multi-account channels) to isolate sessions.',