mirror of https://github.com/openclaw/openclaw.git
refactor: rename channel setup flow seam
This commit is contained in:
parent
ca6dbc0f0a
commit
77d0ff629c
|
|
@ -1,4 +1,4 @@
|
|||
import { setTopLevelChannelDmPolicyWithAllowFrom } from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
import { setTopLevelChannelDmPolicyWithAllowFrom } from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
import type { WizardPrompter } from "../../../src/wizard/prompts.js";
|
||||
import { resolveBlueBubblesAccount } from "./accounts.js";
|
||||
|
|
@ -27,8 +27,8 @@ async function createBlueBubblesConfigureAdapter() {
|
|||
}).config.allowFrom ?? [],
|
||||
},
|
||||
setup: blueBubblesSetupAdapter,
|
||||
} as Parameters<typeof buildChannelOnboardingAdapterFromSetupWizard>[0]["plugin"];
|
||||
return buildChannelOnboardingAdapterFromSetupWizard({
|
||||
} as Parameters<typeof buildChannelSetupFlowAdapterFromSetupWizard>[0]["plugin"];
|
||||
return buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin,
|
||||
wizard: blueBubblesSetupWizard,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
mergeAllowFromEntries,
|
||||
resolveOnboardingAccountId,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
resolveSetupAccountId,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { DmPolicy } from "../../../src/config/types.js";
|
||||
|
|
@ -55,7 +55,7 @@ async function promptBlueBubblesAllowFrom(params: {
|
|||
prompter: WizardPrompter;
|
||||
accountId?: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const accountId = resolveOnboardingAccountId({
|
||||
const accountId = resolveSetupAccountId({
|
||||
accountId: params.accountId,
|
||||
defaultAccountId: resolveDefaultBlueBubblesAccountId(params.cfg),
|
||||
});
|
||||
|
|
@ -148,7 +148,7 @@ function validateBlueBubblesWebhookPath(value: string): string | undefined {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
const dmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const dmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "BlueBubbles",
|
||||
channel,
|
||||
policyKey: "channels.bluebubbles.dmPolicy",
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
patchChannelConfigForAccount,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
@ -140,7 +140,7 @@ export const discordSetupAdapter: ChannelSetupAdapter = {
|
|||
export function createDiscordSetupWizardProxy(
|
||||
loadWizard: () => Promise<{ discordSetupWizard: ChannelSetupWizard }>,
|
||||
) {
|
||||
const discordDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const discordDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Discord",
|
||||
channel,
|
||||
policyKey: "channels.discord.dmPolicy",
|
||||
|
|
@ -343,6 +343,6 @@ export function createDiscordSetupWizardProxy(
|
|||
}),
|
||||
},
|
||||
dmPolicy: discordDmPolicy,
|
||||
disable: (cfg: OpenClawConfig) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg: OpenClawConfig) => setSetupChannelEnabled(cfg, channel, false),
|
||||
} satisfies ChannelSetupWizard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
patchChannelConfigForAccount,
|
||||
promptLegacyChannelAllowFrom,
|
||||
resolveOnboardingAccountId,
|
||||
resolveSetupAccountId,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
|
|
@ -59,7 +59,7 @@ async function promptDiscordAllowFrom(params: {
|
|||
prompter: WizardPrompter;
|
||||
accountId?: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const accountId = resolveOnboardingAccountId({
|
||||
const accountId = resolveSetupAccountId({
|
||||
accountId: params.accountId,
|
||||
defaultAccountId: resolveDefaultDiscordAccountId(params.cfg),
|
||||
});
|
||||
|
|
@ -92,7 +92,7 @@ async function promptDiscordAllowFrom(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const discordDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const discordDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Discord",
|
||||
channel,
|
||||
policyKey: "channels.discord.dmPolicy",
|
||||
|
|
@ -273,5 +273,5 @@ export const discordSetupWizard: ChannelSetupWizard = {
|
|||
}),
|
||||
},
|
||||
dmPolicy: discordDmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { OpenClawConfig } from "openclaw/plugin-sdk/feishu";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { feishuPlugin } from "./channel.js";
|
||||
|
||||
const feishuConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const feishuConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: feishuPlugin,
|
||||
wizard: feishuPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
|
||||
vi.mock("./probe.js", () => ({
|
||||
probeFeishu: vi.fn(async () => ({ ok: false, error: "mocked" })),
|
||||
|
|
@ -56,7 +56,7 @@ async function getStatusWithEnvRefs(params: { appIdKey: string; appSecretKey: st
|
|||
});
|
||||
}
|
||||
|
||||
const feishuConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const feishuConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: feishuPlugin,
|
||||
wizard: feishuPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
buildSingleChannelSecretPromptState,
|
||||
mergeAllowFromEntries,
|
||||
|
|
@ -6,8 +5,9 @@ import {
|
|||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
setTopLevelChannelGroupPolicy,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { DmPolicy } from "../../../src/config/types.js";
|
||||
|
|
@ -115,7 +115,7 @@ function isFeishuConfigured(cfg: OpenClawConfig): boolean {
|
|||
|
||||
async function promptFeishuAllowFrom(params: {
|
||||
cfg: OpenClawConfig;
|
||||
prompter: Parameters<NonNullable<ChannelOnboardingDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
prompter: Parameters<NonNullable<ChannelSetupDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
}): Promise<OpenClawConfig> {
|
||||
const existing = params.cfg.channels?.feishu?.allowFrom ?? [];
|
||||
await params.prompter.note(
|
||||
|
|
@ -136,7 +136,7 @@ async function promptFeishuAllowFrom(params: {
|
|||
initialValue: existing[0] ? String(existing[0]) : undefined,
|
||||
validate: (value) => (String(value ?? "").trim() ? undefined : "Required"),
|
||||
});
|
||||
const parts = splitOnboardingEntries(String(entry));
|
||||
const parts = splitSetupEntries(String(entry));
|
||||
if (parts.length === 0) {
|
||||
await params.prompter.note("Enter at least one user.", "Feishu allowlist");
|
||||
continue;
|
||||
|
|
@ -177,7 +177,7 @@ async function promptFeishuAppId(params: {
|
|||
).trim();
|
||||
}
|
||||
|
||||
const feishuDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const feishuDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Feishu",
|
||||
channel,
|
||||
policyKey: "channels.feishu.dmPolicy",
|
||||
|
|
@ -458,7 +458,7 @@ export const feishuSetupWizard: ChannelSetupWizard = {
|
|||
initialValue: existing.length > 0 ? existing.map(String).join(", ") : undefined,
|
||||
});
|
||||
if (entry) {
|
||||
const parts = splitOnboardingEntries(String(entry));
|
||||
const parts = splitSetupEntries(String(entry));
|
||||
if (parts.length > 0) {
|
||||
next = setFeishuGroupAllowFrom(next, parts);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { OpenClawConfig, WizardPrompter } from "openclaw/plugin-sdk/googlechat";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { createRuntimeEnv } from "../../test-utils/runtime-env.js";
|
||||
import { googlechatPlugin } from "./channel.js";
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
|||
};
|
||||
}
|
||||
|
||||
const googlechatConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const googlechatConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: googlechatPlugin,
|
||||
wizard: googlechatPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
addWildcardAllowFrom,
|
||||
mergeAllowFromEntries,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import {
|
||||
applySetupAccountConfigPatch,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
@ -48,7 +48,7 @@ function setGoogleChatDmPolicy(cfg: OpenClawConfig, policy: DmPolicy) {
|
|||
|
||||
async function promptAllowFrom(params: {
|
||||
cfg: OpenClawConfig;
|
||||
prompter: Parameters<NonNullable<ChannelOnboardingDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
prompter: Parameters<NonNullable<ChannelSetupDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
}): Promise<OpenClawConfig> {
|
||||
const current = params.cfg.channels?.googlechat?.dm?.allowFrom ?? [];
|
||||
const entry = await params.prompter.text({
|
||||
|
|
@ -57,7 +57,7 @@ async function promptAllowFrom(params: {
|
|||
initialValue: current[0] ? String(current[0]) : undefined,
|
||||
validate: (value) => (String(value ?? "").trim() ? undefined : "Required"),
|
||||
});
|
||||
const parts = splitOnboardingEntries(String(entry));
|
||||
const parts = splitSetupEntries(String(entry));
|
||||
const unique = mergeAllowFromEntries(undefined, parts);
|
||||
return {
|
||||
...params.cfg,
|
||||
|
|
@ -76,7 +76,7 @@ async function promptAllowFrom(params: {
|
|||
};
|
||||
}
|
||||
|
||||
const googlechatDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const googlechatDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Google Chat",
|
||||
channel,
|
||||
policyKey: "channels.googlechat.dm.policy",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
parseOnboardingEntriesAllowingWildcard,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
@ -25,7 +25,7 @@ import { normalizeIMessageHandle } from "./targets.js";
|
|||
const channel = "imessage" as const;
|
||||
|
||||
export function parseIMessageAllowFromEntries(raw: string): { entries: string[]; error?: string } {
|
||||
return parseOnboardingEntriesAllowingWildcard(raw, (entry) => {
|
||||
return parseSetupEntriesAllowingWildcard(raw, (entry) => {
|
||||
const lower = entry.toLowerCase();
|
||||
if (lower.startsWith("chat_id:")) {
|
||||
const id = entry.slice("chat_id:".length).trim();
|
||||
|
|
@ -157,7 +157,7 @@ export const imessageSetupAdapter: ChannelSetupAdapter = {
|
|||
export function createIMessageSetupWizardProxy(
|
||||
loadWizard: () => Promise<{ imessageSetupWizard: ChannelSetupWizard }>,
|
||||
) {
|
||||
const imessageDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const imessageDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "iMessage",
|
||||
channel,
|
||||
policyKey: "channels.imessage.dmPolicy",
|
||||
|
|
@ -231,6 +231,6 @@ export function createIMessageSetupWizardProxy(
|
|||
],
|
||||
},
|
||||
dmPolicy: imessageDmPolicy,
|
||||
disable: (cfg: OpenClawConfig) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg: OpenClawConfig) => setSetupChannelEnabled(cfg, channel, false),
|
||||
} satisfies ChannelSetupWizard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
parseOnboardingEntriesAllowingWildcard,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import { type ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { detectBinary } from "../../../src/commands/onboard-helpers.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
|
|
@ -50,7 +50,7 @@ async function promptIMessageAllowFrom(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const imessageDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const imessageDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "iMessage",
|
||||
channel,
|
||||
policyKey: "channels.imessage.dmPolicy",
|
||||
|
|
@ -129,7 +129,7 @@ export const imessageSetupWizard: ChannelSetupWizard = {
|
|||
],
|
||||
},
|
||||
dmPolicy: imessageDmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
export { imessageSetupAdapter, parseIMessageAllowFromEntries };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { RuntimeEnv, WizardPrompter } from "openclaw/plugin-sdk/irc";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { createRuntimeEnv } from "../../test-utils/runtime-env.js";
|
||||
import { ircPlugin } from "./channel.js";
|
||||
import type { CoreConfig } from "./types.js";
|
||||
|
|
@ -27,7 +27,7 @@ function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
|||
};
|
||||
}
|
||||
|
||||
const ircConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const ircConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: ircPlugin,
|
||||
wizard: ircPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
patchScopedAccountConfig,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
resolveOnboardingAccountId,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
resolveSetupAccountId,
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { DmPolicy } from "../../../src/config/types.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
|
|
@ -165,7 +165,7 @@ async function promptIrcNickServConfig(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const ircDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const ircDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "IRC",
|
||||
channel,
|
||||
policyKey: "channels.irc.dmPolicy",
|
||||
|
|
@ -176,7 +176,7 @@ const ircDmPolicy: ChannelOnboardingDmPolicy = {
|
|||
await promptIrcAllowFrom({
|
||||
cfg: cfg as CoreConfig,
|
||||
prompter,
|
||||
accountId: resolveOnboardingAccountId({
|
||||
accountId: resolveSetupAccountId({
|
||||
accountId,
|
||||
defaultAccountId: resolveDefaultIrcAccountId(cfg as CoreConfig),
|
||||
}),
|
||||
|
|
@ -458,7 +458,7 @@ export const ircSetupWizard: ChannelSetupWizard = {
|
|||
],
|
||||
},
|
||||
dmPolicy: ircDmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
export { ircSetupAdapter };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { OpenClawConfig } from "openclaw/plugin-sdk/line";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import {
|
||||
listLineAccountIds,
|
||||
resolveDefaultLineAccountId,
|
||||
|
|
@ -30,7 +30,7 @@ function createPrompter(overrides: Partial<WizardPrompter> = {}): WizardPrompter
|
|||
};
|
||||
}
|
||||
|
||||
const lineConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const lineConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: {
|
||||
id: "line",
|
||||
meta: { label: "LINE" },
|
||||
|
|
@ -41,7 +41,7 @@ const lineConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
|||
resolveLineAccount({ cfg, accountId: accountId ?? undefined }).config.allowFrom,
|
||||
},
|
||||
setup: lineSetupAdapter,
|
||||
} as Parameters<typeof buildChannelOnboardingAdapterFromSetupWizard>[0]["plugin"],
|
||||
} as Parameters<typeof buildChannelSetupFlowAdapterFromSetupWizard>[0]["plugin"],
|
||||
wizard: lineSetupWizard,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
setOnboardingChannelEnabled,
|
||||
setSetupChannelEnabled,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { resolveLineAccount } from "../../../src/line/accounts.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
|
|
@ -35,7 +35,7 @@ const LINE_ALLOW_FROM_HELP_LINES = [
|
|||
`Docs: ${formatDocsLink("/channels/line", "channels/line")}`,
|
||||
];
|
||||
|
||||
const lineDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const lineDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "LINE",
|
||||
channel,
|
||||
policyKey: "channels.line.dmPolicy",
|
||||
|
|
@ -169,7 +169,7 @@ export const lineSetupWizard: ChannelSetupWizard = {
|
|||
placeholder: "U1234567890abcdef1234567890abcdef",
|
||||
invalidWithoutCredentialNote:
|
||||
"LINE allowFrom requires raw user ids like U1234567890abcdef1234567890abcdef.",
|
||||
parseInputs: splitOnboardingEntries,
|
||||
parseInputs: splitSetupEntries,
|
||||
parseId: parseLineAllowFromId,
|
||||
resolveEntries: async ({ entries }) =>
|
||||
entries.map((entry) => {
|
||||
|
|
@ -198,5 +198,5 @@ export const lineSetupWizard: ChannelSetupWizard = {
|
|||
`Docs: ${formatDocsLink("/channels/line", "channels/line")}`,
|
||||
],
|
||||
},
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
addWildcardAllowFrom,
|
||||
buildSingleChannelSecretPromptState,
|
||||
mergeAllowFromEntries,
|
||||
promptSingleChannelSecretInput,
|
||||
setTopLevelChannelGroupPolicy,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { DmPolicy } from "../../../src/config/types.js";
|
||||
|
|
@ -242,7 +242,7 @@ const matrixGroupAccess: NonNullable<ChannelSetupWizard["groupAccess"]> = {
|
|||
setMatrixGroupRooms(cfg as CoreConfig, resolved as string[]),
|
||||
};
|
||||
|
||||
const matrixDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const matrixDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Matrix",
|
||||
channel,
|
||||
policyKey: "channels.matrix.dm.policy",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
mergeAllowFromEntries,
|
||||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
setTopLevelChannelGroupPolicy,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { DmPolicy, MSTeamsTeamConfig } from "../../../src/config/types.js";
|
||||
|
|
@ -93,7 +93,7 @@ async function promptMSTeamsAllowFrom(params: {
|
|||
initialValue: existing[0] ? String(existing[0]) : undefined,
|
||||
validate: (value) => (String(value ?? "").trim() ? undefined : "Required"),
|
||||
});
|
||||
const parts = splitOnboardingEntries(String(entry));
|
||||
const parts = splitSetupEntries(String(entry));
|
||||
if (parts.length === 0) {
|
||||
await params.prompter.note("Enter at least one user.", "MS Teams allowlist");
|
||||
continue;
|
||||
|
|
@ -280,7 +280,7 @@ const msteamsGroupAccess: NonNullable<ChannelSetupWizard["groupAccess"]> = {
|
|||
setMSTeamsTeamsAllowlist(cfg, resolved as Array<{ teamKey: string; channelKey?: string }>),
|
||||
};
|
||||
|
||||
const msteamsDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const msteamsDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "MS Teams",
|
||||
channel,
|
||||
policyKey: "channels.msteams.dmPolicy",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
mergeAllowFromEntries,
|
||||
resolveOnboardingAccountId,
|
||||
setOnboardingChannelEnabled,
|
||||
resolveSetupAccountId,
|
||||
setSetupChannelEnabled,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
patchScopedAccountConfig,
|
||||
|
|
@ -163,7 +163,7 @@ async function promptNextcloudTalkAllowFromForAccount(params: {
|
|||
prompter: WizardPrompter;
|
||||
accountId?: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const accountId = resolveOnboardingAccountId({
|
||||
const accountId = resolveSetupAccountId({
|
||||
accountId: params.accountId,
|
||||
defaultAccountId: resolveDefaultNextcloudTalkAccountId(params.cfg as CoreConfig),
|
||||
});
|
||||
|
|
@ -174,7 +174,7 @@ async function promptNextcloudTalkAllowFromForAccount(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const nextcloudTalkDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const nextcloudTalkDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Nextcloud Talk",
|
||||
channel,
|
||||
policyKey: "channels.nextcloud-talk.dmPolicy",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
mergeAllowFromEntries,
|
||||
resolveOnboardingAccountId,
|
||||
setOnboardingChannelEnabled,
|
||||
resolveSetupAccountId,
|
||||
setSetupChannelEnabled,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import { type ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { ChannelSetupInput } from "../../../src/channels/plugins/types.core.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
|
|
@ -85,7 +85,7 @@ async function promptNextcloudTalkAllowFromForAccount(params: {
|
|||
prompter: WizardPrompter;
|
||||
accountId?: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const accountId = resolveOnboardingAccountId({
|
||||
const accountId = resolveSetupAccountId({
|
||||
accountId: params.accountId,
|
||||
defaultAccountId: resolveDefaultNextcloudTalkAccountId(params.cfg as CoreConfig),
|
||||
});
|
||||
|
|
@ -96,7 +96,7 @@ async function promptNextcloudTalkAllowFromForAccount(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const nextcloudTalkDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const nextcloudTalkDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Nextcloud Talk",
|
||||
channel,
|
||||
policyKey: "channels.nextcloud-talk.dmPolicy",
|
||||
|
|
@ -272,7 +272,7 @@ export const nextcloudTalkSetupWizard: ChannelSetupWizard = {
|
|||
},
|
||||
],
|
||||
dmPolicy: nextcloudTalkDmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
export { nextcloudTalkSetupAdapter };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { OpenClawConfig } from "openclaw/plugin-sdk/nostr";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { WizardPrompter } from "../../../src/wizard/prompts.js";
|
||||
import { createRuntimeEnv } from "../../test-utils/runtime-env.js";
|
||||
import { nostrPlugin } from "./channel.js";
|
||||
|
|
@ -25,7 +25,7 @@ function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
|||
};
|
||||
}
|
||||
|
||||
const nostrConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const nostrConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: nostrPlugin,
|
||||
wizard: nostrPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
mergeAllowFromEntries,
|
||||
parseOnboardingEntriesWithParser,
|
||||
parseSetupEntriesWithParser,
|
||||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
|
|
@ -76,7 +76,7 @@ function setNostrAllowFrom(cfg: OpenClawConfig, allowFrom: string[]): OpenClawCo
|
|||
}
|
||||
|
||||
function parseRelayUrls(raw: string): { relays: string[]; error?: string } {
|
||||
const entries = splitOnboardingEntries(raw);
|
||||
const entries = splitSetupEntries(raw);
|
||||
const relays: string[] = [];
|
||||
for (const entry of entries) {
|
||||
try {
|
||||
|
|
@ -93,7 +93,7 @@ function parseRelayUrls(raw: string): { relays: string[]; error?: string } {
|
|||
}
|
||||
|
||||
function parseNostrAllowFrom(raw: string): { entries: string[]; error?: string } {
|
||||
return parseOnboardingEntriesWithParser(raw, (entry) => {
|
||||
return parseSetupEntriesWithParser(raw, (entry) => {
|
||||
const cleaned = entry.replace(/^nostr:/i, "").trim();
|
||||
try {
|
||||
return { value: normalizePubkey(cleaned) };
|
||||
|
|
@ -125,7 +125,7 @@ async function promptNostrAllowFrom(params: {
|
|||
return setNostrAllowFrom(params.cfg, mergeAllowFromEntries(existing, parsed.entries));
|
||||
}
|
||||
|
||||
const nostrDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const nostrDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Nostr",
|
||||
channel,
|
||||
policyKey: "channels.nostr.dmPolicy",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
parseOnboardingEntriesAllowingWildcard,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
@ -51,7 +51,7 @@ function isUuidLike(value: string): boolean {
|
|||
}
|
||||
|
||||
export function parseSignalAllowFromEntries(raw: string): { entries: string[]; error?: string } {
|
||||
return parseOnboardingEntriesAllowingWildcard(raw, (entry) => {
|
||||
return parseSetupEntriesAllowingWildcard(raw, (entry) => {
|
||||
if (entry.toLowerCase().startsWith("uuid:")) {
|
||||
const id = entry.slice("uuid:".length).trim();
|
||||
if (!id) {
|
||||
|
|
@ -186,7 +186,7 @@ export const signalSetupAdapter: ChannelSetupAdapter = {
|
|||
export function createSignalSetupWizardProxy(
|
||||
loadWizard: () => Promise<{ signalSetupWizard: ChannelSetupWizard }>,
|
||||
) {
|
||||
const signalDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const signalDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Signal",
|
||||
channel,
|
||||
policyKey: "channels.signal.dmPolicy",
|
||||
|
|
@ -270,6 +270,6 @@ export function createSignalSetupWizardProxy(
|
|||
],
|
||||
},
|
||||
dmPolicy: signalDmPolicy,
|
||||
disable: (cfg: OpenClawConfig) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg: OpenClawConfig) => setSetupChannelEnabled(cfg, channel, false),
|
||||
} satisfies ChannelSetupWizard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
parseOnboardingEntriesAllowingWildcard,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import { type ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { formatCliCommand } from "../../../src/cli/command-format.js";
|
||||
import { detectBinary } from "../../../src/commands/onboard-helpers.js";
|
||||
|
|
@ -56,7 +56,7 @@ async function promptSignalAllowFrom(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const signalDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const signalDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Signal",
|
||||
channel,
|
||||
policyKey: "channels.signal.dmPolicy",
|
||||
|
|
@ -179,7 +179,7 @@ export const signalSetupWizard: ChannelSetupWizard = {
|
|||
],
|
||||
},
|
||||
dmPolicy: signalDmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
export { normalizeSignalAccountInput, parseSignalAllowFromEntries, signalSetupAdapter };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
|
|
@ -6,8 +5,9 @@ import {
|
|||
patchChannelConfigForAccount,
|
||||
setAccountGroupPolicyForChannel,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
@ -216,7 +216,7 @@ export const slackSetupAdapter: ChannelSetupAdapter = {
|
|||
export function createSlackSetupWizardProxy(
|
||||
loadWizard: () => Promise<{ slackSetupWizard: ChannelSetupWizard }>,
|
||||
) {
|
||||
const slackDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const slackDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Slack",
|
||||
channel,
|
||||
policyKey: "channels.slack.dmPolicy",
|
||||
|
|
@ -490,6 +490,6 @@ export function createSlackSetupWizardProxy(
|
|||
resolved: unknown;
|
||||
}) => setSlackChannelAllowlist(cfg, accountId, resolved as string[]),
|
||||
},
|
||||
disable: (cfg: OpenClawConfig) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg: OpenClawConfig) => setSetupChannelEnabled(cfg, channel, false),
|
||||
} satisfies ChannelSetupWizard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
patchChannelConfigForAccount,
|
||||
promptLegacyChannelAllowFrom,
|
||||
resolveOnboardingAccountId,
|
||||
resolveSetupAccountId,
|
||||
setAccountGroupPolicyForChannel,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type {
|
||||
ChannelSetupWizard,
|
||||
ChannelSetupWizardAllowFromEntry,
|
||||
|
|
@ -166,7 +166,7 @@ async function promptSlackAllowFrom(params: {
|
|||
prompter: WizardPrompter;
|
||||
accountId?: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const accountId = resolveOnboardingAccountId({
|
||||
const accountId = resolveSetupAccountId({
|
||||
accountId: params.accountId,
|
||||
defaultAccountId: resolveDefaultSlackAccountId(params.cfg),
|
||||
});
|
||||
|
|
@ -210,7 +210,7 @@ async function promptSlackAllowFrom(params: {
|
|||
});
|
||||
}
|
||||
|
||||
const slackDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const slackDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Slack",
|
||||
channel,
|
||||
policyKey: "channels.slack.dmPolicy",
|
||||
|
|
@ -424,5 +424,5 @@ export const slackSetupWizard: ChannelSetupWizard = {
|
|||
applyAllowlist: ({ cfg, accountId, resolved }) =>
|
||||
setSlackChannelAllowlist(cfg, accountId, resolved as string[]),
|
||||
},
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
patchChannelConfigForAccount,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import {
|
||||
applyAccountNameToChannelSection,
|
||||
migrateBaseNameToDefaultAccount,
|
||||
|
|
@ -73,7 +73,7 @@ export async function promptTelegramAllowFromForAccount(params: {
|
|||
cfg: OpenClawConfig;
|
||||
prompter: Parameters<
|
||||
NonNullable<
|
||||
import("../../../src/channels/plugins/onboarding-types.js").ChannelOnboardingDmPolicy["promptAllowFrom"]
|
||||
import("../../../src/channels/plugins/setup-flow-types.js").ChannelSetupDmPolicy["promptAllowFrom"]
|
||||
>
|
||||
>[0]["prompter"];
|
||||
accountId?: string;
|
||||
|
|
@ -88,7 +88,7 @@ export async function promptTelegramAllowFromForAccount(params: {
|
|||
);
|
||||
}
|
||||
const { promptResolvedAllowFrom } =
|
||||
await import("../../../src/channels/plugins/onboarding/helpers.js");
|
||||
await import("../../../src/channels/plugins/setup-flow-helpers.js");
|
||||
const unique = await promptResolvedAllowFrom({
|
||||
prompter: params.prompter,
|
||||
existing: resolved.config.allowFrom ?? [],
|
||||
|
|
@ -96,7 +96,7 @@ export async function promptTelegramAllowFromForAccount(params: {
|
|||
message: "Telegram allowFrom (numeric sender id; @username resolves to id)",
|
||||
placeholder: "@username",
|
||||
label: "Telegram allowlist",
|
||||
parseInputs: splitOnboardingEntries,
|
||||
parseInputs: splitSetupEntries,
|
||||
parseId: parseTelegramAllowFromId,
|
||||
invalidWithoutTokenNote:
|
||||
"Telegram token missing; use numeric sender ids (usernames require a bot token).",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { type ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
patchChannelConfigForAccount,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import { type ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import { type ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import { hasConfiguredSecretInput } from "../../../src/config/types.secrets.js";
|
||||
|
|
@ -22,7 +22,7 @@ import {
|
|||
|
||||
const channel = "telegram" as const;
|
||||
|
||||
const dmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const dmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Telegram",
|
||||
channel,
|
||||
policyKey: "channels.telegram.dmPolicy",
|
||||
|
|
@ -89,7 +89,7 @@ export const telegramSetupWizard: ChannelSetupWizard = {
|
|||
placeholder: "@username",
|
||||
invalidWithoutCredentialNote:
|
||||
"Telegram token missing; use numeric sender ids (usernames require a bot token).",
|
||||
parseInputs: splitOnboardingEntries,
|
||||
parseInputs: splitSetupEntries,
|
||||
parseId: parseTelegramAllowFromId,
|
||||
resolveEntries: async ({ credentialValues, entries }) =>
|
||||
resolveTelegramAllowFromEntries({
|
||||
|
|
@ -105,7 +105,7 @@ export const telegramSetupWizard: ChannelSetupWizard = {
|
|||
}),
|
||||
},
|
||||
dmPolicy,
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
};
|
||||
|
||||
export { parseTelegramAllowFromId, telegramSetupAdapter };
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { OpenClawConfig, RuntimeEnv, WizardPrompter } from "openclaw/plugin-sdk/tlon";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { createRuntimeEnv } from "../../test-utils/runtime-env.js";
|
||||
import { tlonPlugin } from "./channel.js";
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
|||
};
|
||||
}
|
||||
|
||||
const tlonConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const tlonConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: tlonPlugin,
|
||||
wizard: tlonPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
* Twitch setup wizard surface for CLI setup.
|
||||
*/
|
||||
|
||||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { ChannelSetupAdapter } from "../../../src/channels/plugins/types.adapters.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
|
|
@ -183,7 +183,7 @@ export async function configureWithEnvToken(
|
|||
account: TwitchAccountConfig | null,
|
||||
envToken: string,
|
||||
forceAllowFrom: boolean,
|
||||
dmPolicy: ChannelOnboardingDmPolicy,
|
||||
dmPolicy: ChannelSetupDmPolicy,
|
||||
): Promise<{ cfg: OpenClawConfig } | null> {
|
||||
const useEnv = await prompter.confirm({
|
||||
message: "Twitch env var OPENCLAW_TWITCH_ACCESS_TOKEN detected. Use env token?",
|
||||
|
|
@ -247,7 +247,7 @@ function setTwitchGroupPolicy(
|
|||
return setTwitchAccessControl(cfg, allowedRoles, true);
|
||||
}
|
||||
|
||||
const twitchDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const twitchDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Twitch",
|
||||
channel,
|
||||
policyKey: "channels.twitch.allowedRoles",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../src/routing/session-key.js";
|
||||
import type { RuntimeEnv } from "../../../src/runtime.js";
|
||||
import type { WizardPrompter } from "../../../src/wizard/prompts.js";
|
||||
|
|
@ -83,7 +83,7 @@ function createRuntime(): RuntimeEnv {
|
|||
} as unknown as RuntimeEnv;
|
||||
}
|
||||
|
||||
const whatsappConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const whatsappConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: whatsappPlugin,
|
||||
wizard: whatsappPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ import path from "node:path";
|
|||
import { loginWeb } from "../../../src/channel-web.js";
|
||||
import {
|
||||
normalizeAllowFromEntries,
|
||||
splitOnboardingEntries,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
import { setOnboardingChannelEnabled } from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import { setSetupChannelEnabled } from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { formatCliCommand } from "../../../src/cli/command-format.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
|
|
@ -96,7 +96,7 @@ async function applyWhatsAppOwnerAllowlist(params: {
|
|||
}
|
||||
|
||||
function parseWhatsAppAllowFromEntries(raw: string): { entries: string[]; invalidEntry?: string } {
|
||||
const parts = splitOnboardingEntries(raw);
|
||||
const parts = splitSetupEntries(raw);
|
||||
if (parts.length === 0) {
|
||||
return { entries: [] };
|
||||
}
|
||||
|
|
@ -330,7 +330,7 @@ export const whatsappSetupWizard: ChannelSetupWizard = {
|
|||
});
|
||||
return { cfg: next };
|
||||
},
|
||||
disable: (cfg) => setOnboardingChannelEnabled(cfg, channel, false),
|
||||
disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
|
||||
onAccountRecorded: (accountId, options) => {
|
||||
options?.onWhatsAppAccountId?.(accountId);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { OpenClawConfig } from "openclaw/plugin-sdk/zalo";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { zaloPlugin } from "./channel.js";
|
||||
|
||||
const zaloConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const zaloConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: zaloPlugin,
|
||||
wizard: zaloPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { OpenClawConfig, RuntimeEnv, WizardPrompter } from "openclaw/plugin-sdk/zalo";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { createRuntimeEnv } from "../../test-utils/runtime-env.js";
|
||||
import { zaloPlugin } from "./channel.js";
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
|||
};
|
||||
}
|
||||
|
||||
const zaloConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const zaloConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: zaloPlugin,
|
||||
wizard: zaloPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
buildSingleChannelSecretPromptState,
|
||||
mergeAllowFromEntries,
|
||||
promptSingleChannelSecretInput,
|
||||
runSingleChannelSecretStep,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
import type { SecretInput } from "../../../src/config/types.secrets.js";
|
||||
|
|
@ -122,7 +122,7 @@ async function noteZaloTokenHelp(
|
|||
|
||||
async function promptZaloAllowFrom(params: {
|
||||
cfg: OpenClawConfig;
|
||||
prompter: Parameters<NonNullable<ChannelOnboardingDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
prompter: Parameters<NonNullable<ChannelSetupDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
accountId: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const { cfg, prompter, accountId } = params;
|
||||
|
|
@ -182,7 +182,7 @@ async function promptZaloAllowFrom(params: {
|
|||
} as OpenClawConfig;
|
||||
}
|
||||
|
||||
const zaloDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const zaloDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Zalo",
|
||||
channel,
|
||||
policyKey: "channels.zalo.dmPolicy",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { OpenClawConfig, WizardPrompter } from "openclaw/plugin-sdk/zalouser";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { buildChannelOnboardingAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { buildChannelSetupFlowAdapterFromSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import { createRuntimeEnv } from "../../test-utils/runtime-env.js";
|
||||
|
||||
vi.mock("./zalo-js.js", async (importOriginal) => {
|
||||
|
|
@ -50,7 +50,7 @@ function createPrompter(overrides: Partial<WizardPrompter>): WizardPrompter {
|
|||
};
|
||||
}
|
||||
|
||||
const zalouserConfigureAdapter = buildChannelOnboardingAdapterFromSetupWizard({
|
||||
const zalouserConfigureAdapter = buildChannelSetupFlowAdapterFromSetupWizard({
|
||||
plugin: zalouserPlugin,
|
||||
wizard: zalouserPlugin.setupWizard!,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { ChannelOnboardingDmPolicy } from "../../../src/channels/plugins/onboarding-types.js";
|
||||
import {
|
||||
mergeAllowFromEntries,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../../../src/channels/plugins/onboarding/helpers.js";
|
||||
} from "../../../src/channels/plugins/setup-flow-helpers.js";
|
||||
import type { ChannelSetupDmPolicy } from "../../../src/channels/plugins/setup-flow-types.js";
|
||||
import { patchScopedAccountConfig } from "../../../src/channels/plugins/setup-helpers.js";
|
||||
import type { ChannelSetupWizard } from "../../../src/channels/plugins/setup-wizard.js";
|
||||
import type { OpenClawConfig } from "../../../src/config/config.js";
|
||||
|
|
@ -91,7 +91,7 @@ async function noteZalouserHelp(
|
|||
|
||||
async function promptZalouserAllowFrom(params: {
|
||||
cfg: OpenClawConfig;
|
||||
prompter: Parameters<NonNullable<ChannelOnboardingDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
prompter: Parameters<NonNullable<ChannelSetupDmPolicy["promptAllowFrom"]>>[0]["prompter"];
|
||||
accountId: string;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const { cfg, prompter, accountId } = params;
|
||||
|
|
@ -144,7 +144,7 @@ async function promptZalouserAllowFrom(params: {
|
|||
}
|
||||
}
|
||||
|
||||
const zalouserDmPolicy: ChannelOnboardingDmPolicy = {
|
||||
const zalouserDmPolicy: ChannelSetupDmPolicy = {
|
||||
label: "Zalo Personal",
|
||||
channel,
|
||||
policyKey: "channels.zalouser.dmPolicy",
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { OpenClawConfig } from "../../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../../routing/session-key.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../routing/session-key.js";
|
||||
|
||||
const promptAccountIdSdkMock = vi.hoisted(() => vi.fn(async () => "default"));
|
||||
vi.mock("../../../plugin-sdk/onboarding.js", () => ({
|
||||
vi.mock("../../plugin-sdk/onboarding.js", () => ({
|
||||
promptAccountId: promptAccountIdSdkMock,
|
||||
}));
|
||||
|
||||
|
|
@ -14,17 +14,17 @@ import {
|
|||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
parseOnboardingEntriesAllowingWildcard,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
patchChannelConfigForAccount,
|
||||
patchLegacyDmChannelConfig,
|
||||
promptLegacyChannelAllowFrom,
|
||||
parseOnboardingEntriesWithParser,
|
||||
parseSetupEntriesWithParser,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
promptSingleChannelSecretInput,
|
||||
promptSingleChannelToken,
|
||||
promptResolvedAllowFrom,
|
||||
resolveAccountIdForConfigure,
|
||||
resolveOnboardingAccountId,
|
||||
resolveSetupAccountId,
|
||||
setAccountAllowFromForChannel,
|
||||
setAccountGroupPolicyForChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
|
|
@ -33,9 +33,9 @@ import {
|
|||
setTopLevelChannelGroupPolicy,
|
||||
setLegacyChannelAllowFrom,
|
||||
setLegacyChannelDmPolicyWithAllowFrom,
|
||||
setOnboardingChannelEnabled,
|
||||
splitOnboardingEntries,
|
||||
} from "./helpers.js";
|
||||
setSetupChannelEnabled,
|
||||
splitSetupEntries,
|
||||
} from "./setup-flow-helpers.js";
|
||||
|
||||
function createPrompter(inputs: string[]) {
|
||||
return {
|
||||
|
|
@ -464,7 +464,7 @@ describe("promptParsedAllowFromForScopedChannel", () => {
|
|||
message: "msg",
|
||||
placeholder: "placeholder",
|
||||
parseEntries: (raw) =>
|
||||
parseOnboardingEntriesWithParser(raw, (entry) => ({ value: entry.toLowerCase() })),
|
||||
parseSetupEntriesWithParser(raw, (entry) => ({ value: entry.toLowerCase() })),
|
||||
getExistingAllowFrom: ({ cfg }) => cfg.channels?.imessage?.allowFrom ?? [],
|
||||
});
|
||||
|
||||
|
|
@ -748,7 +748,7 @@ describe("patchChannelConfigForAccount", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("setOnboardingChannelEnabled", () => {
|
||||
describe("setSetupChannelEnabled", () => {
|
||||
it("updates enabled and keeps existing channel fields", () => {
|
||||
const cfg: OpenClawConfig = {
|
||||
channels: {
|
||||
|
|
@ -759,13 +759,13 @@ describe("setOnboardingChannelEnabled", () => {
|
|||
},
|
||||
};
|
||||
|
||||
const next = setOnboardingChannelEnabled(cfg, "discord", false);
|
||||
const next = setSetupChannelEnabled(cfg, "discord", false);
|
||||
expect(next.channels?.discord?.enabled).toBe(false);
|
||||
expect(next.channels?.discord?.token).toBe("abc");
|
||||
});
|
||||
|
||||
it("creates missing channel config with enabled state", () => {
|
||||
const next = setOnboardingChannelEnabled({}, "signal", true);
|
||||
const next = setSetupChannelEnabled({}, "signal", true);
|
||||
expect(next.channels?.signal?.enabled).toBe(true);
|
||||
});
|
||||
});
|
||||
|
|
@ -1016,16 +1016,16 @@ describe("setTopLevelChannelGroupPolicy", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("splitOnboardingEntries", () => {
|
||||
describe("splitSetupEntries", () => {
|
||||
it("splits comma/newline/semicolon input and trims blanks", () => {
|
||||
expect(splitOnboardingEntries(" alice, bob \ncarol; ;\n")).toEqual(["alice", "bob", "carol"]);
|
||||
expect(splitSetupEntries(" alice, bob \ncarol; ;\n")).toEqual(["alice", "bob", "carol"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("parseOnboardingEntriesWithParser", () => {
|
||||
describe("parseSetupEntriesWithParser", () => {
|
||||
it("maps entries and de-duplicates parsed values", () => {
|
||||
expect(
|
||||
parseOnboardingEntriesWithParser(" alice, ALICE ; * ", (entry) => {
|
||||
parseSetupEntriesWithParser(" alice, ALICE ; * ", (entry) => {
|
||||
if (entry === "*") {
|
||||
return { value: "*" };
|
||||
}
|
||||
|
|
@ -1038,7 +1038,7 @@ describe("parseOnboardingEntriesWithParser", () => {
|
|||
|
||||
it("returns parser errors and clears parsed entries", () => {
|
||||
expect(
|
||||
parseOnboardingEntriesWithParser("ok, bad", (entry) =>
|
||||
parseSetupEntriesWithParser("ok, bad", (entry) =>
|
||||
entry === "bad" ? { error: "invalid entry: bad" } : { value: entry },
|
||||
),
|
||||
).toEqual({
|
||||
|
|
@ -1048,10 +1048,10 @@ describe("parseOnboardingEntriesWithParser", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("parseOnboardingEntriesAllowingWildcard", () => {
|
||||
describe("parseSetupEntriesAllowingWildcard", () => {
|
||||
it("preserves wildcard and delegates non-wildcard entries", () => {
|
||||
expect(
|
||||
parseOnboardingEntriesAllowingWildcard(" *, Foo ", (entry) => ({
|
||||
parseSetupEntriesAllowingWildcard(" *, Foo ", (entry) => ({
|
||||
value: entry.toLowerCase(),
|
||||
})),
|
||||
).toEqual({
|
||||
|
|
@ -1061,7 +1061,7 @@ describe("parseOnboardingEntriesAllowingWildcard", () => {
|
|||
|
||||
it("returns parser errors for non-wildcard entries", () => {
|
||||
expect(
|
||||
parseOnboardingEntriesAllowingWildcard("ok,bad", (entry) =>
|
||||
parseSetupEntriesAllowingWildcard("ok,bad", (entry) =>
|
||||
entry === "bad" ? { error: "bad entry" } : { value: entry },
|
||||
),
|
||||
).toEqual({
|
||||
|
|
@ -1129,10 +1129,10 @@ describe("normalizeAllowFromEntries", () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe("resolveOnboardingAccountId", () => {
|
||||
describe("resolveSetupAccountId", () => {
|
||||
it("normalizes provided account ids", () => {
|
||||
expect(
|
||||
resolveOnboardingAccountId({
|
||||
resolveSetupAccountId({
|
||||
accountId: " Work Account ",
|
||||
defaultAccountId: DEFAULT_ACCOUNT_ID,
|
||||
}),
|
||||
|
|
@ -1141,7 +1141,7 @@ describe("resolveOnboardingAccountId", () => {
|
|||
|
||||
it("falls back to default account id when input is blank", () => {
|
||||
expect(
|
||||
resolveOnboardingAccountId({
|
||||
resolveSetupAccountId({
|
||||
accountId: " ",
|
||||
defaultAccountId: "custom-default",
|
||||
}),
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
import {
|
||||
promptSecretRefForOnboarding,
|
||||
resolveSecretInputModeForEnvSelection,
|
||||
} from "../../../commands/auth-choice.apply-helpers.js";
|
||||
import type { OpenClawConfig } from "../../../config/config.js";
|
||||
import type { DmPolicy, GroupPolicy } from "../../../config/types.js";
|
||||
import type { SecretInput } from "../../../config/types.secrets.js";
|
||||
import { promptAccountId as promptAccountIdSdk } from "../../../plugin-sdk/onboarding.js";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../../routing/session-key.js";
|
||||
import type { WizardPrompter } from "../../../wizard/prompts.js";
|
||||
import type { PromptAccountId, PromptAccountIdParams } from "../onboarding-types.js";
|
||||
} from "../../commands/auth-choice.apply-helpers.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { DmPolicy, GroupPolicy } from "../../config/types.js";
|
||||
import type { SecretInput } from "../../config/types.secrets.js";
|
||||
import { promptAccountId as promptAccountIdSdk } from "../../plugin-sdk/onboarding.js";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../../routing/session-key.js";
|
||||
import type { WizardPrompter } from "../../wizard/prompts.js";
|
||||
import type { PromptAccountId, PromptAccountIdParams } from "./setup-flow-types.js";
|
||||
import {
|
||||
moveSingleAccountChannelSectionToDefaultAccount,
|
||||
patchScopedAccountConfig,
|
||||
} from "../setup-helpers.js";
|
||||
} from "./setup-helpers.js";
|
||||
|
||||
export const promptAccountId: PromptAccountId = async (params: PromptAccountIdParams) => {
|
||||
return await promptAccountIdSdk(params);
|
||||
|
|
@ -34,20 +34,20 @@ export function mergeAllowFromEntries(
|
|||
return [...new Set(merged)];
|
||||
}
|
||||
|
||||
export function splitOnboardingEntries(raw: string): string[] {
|
||||
export function splitSetupEntries(raw: string): string[] {
|
||||
return raw
|
||||
.split(/[\n,;]+/g)
|
||||
.map((entry) => entry.trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
type ParsedOnboardingEntry = { value: string } | { error: string };
|
||||
type ParsedSetupEntry = { value: string } | { error: string };
|
||||
|
||||
export function parseOnboardingEntriesWithParser(
|
||||
export function parseSetupEntriesWithParser(
|
||||
raw: string,
|
||||
parseEntry: (entry: string) => ParsedOnboardingEntry,
|
||||
parseEntry: (entry: string) => ParsedSetupEntry,
|
||||
): { entries: string[]; error?: string } {
|
||||
const parts = splitOnboardingEntries(String(raw ?? ""));
|
||||
const parts = splitSetupEntries(String(raw ?? ""));
|
||||
const entries: string[] = [];
|
||||
for (const part of parts) {
|
||||
const parsed = parseEntry(part);
|
||||
|
|
@ -59,11 +59,11 @@ export function parseOnboardingEntriesWithParser(
|
|||
return { entries: normalizeAllowFromEntries(entries) };
|
||||
}
|
||||
|
||||
export function parseOnboardingEntriesAllowingWildcard(
|
||||
export function parseSetupEntriesAllowingWildcard(
|
||||
raw: string,
|
||||
parseEntry: (entry: string) => ParsedOnboardingEntry,
|
||||
parseEntry: (entry: string) => ParsedSetupEntry,
|
||||
): { entries: string[]; error?: string } {
|
||||
return parseOnboardingEntriesWithParser(raw, (entry) => {
|
||||
return parseSetupEntriesWithParser(raw, (entry) => {
|
||||
if (entry === "*") {
|
||||
return { value: "*" };
|
||||
}
|
||||
|
|
@ -117,7 +117,7 @@ export function normalizeAllowFromEntries(
|
|||
return [...new Set(normalized)];
|
||||
}
|
||||
|
||||
export function resolveOnboardingAccountId(params: {
|
||||
export function resolveSetupAccountId(params: {
|
||||
accountId?: string;
|
||||
defaultAccountId: string;
|
||||
}): string {
|
||||
|
|
@ -338,7 +338,7 @@ export function patchLegacyDmChannelConfig(params: {
|
|||
};
|
||||
}
|
||||
|
||||
export function setOnboardingChannelEnabled(
|
||||
export function setSetupChannelEnabled(
|
||||
cfg: OpenClawConfig,
|
||||
channel: string,
|
||||
enabled: boolean,
|
||||
|
|
@ -656,7 +656,7 @@ export async function promptParsedAllowFromForScopedChannel(params: {
|
|||
accountId: string;
|
||||
}) => Array<string | number>;
|
||||
}): Promise<OpenClawConfig> {
|
||||
const accountId = resolveOnboardingAccountId({
|
||||
const accountId = resolveSetupAccountId({
|
||||
accountId: params.accountId,
|
||||
defaultAccountId: params.defaultAccountId,
|
||||
});
|
||||
|
|
@ -799,7 +799,7 @@ export async function promptLegacyChannelAllowFrom(params: {
|
|||
message: params.message,
|
||||
placeholder: params.placeholder,
|
||||
label: params.noteTitle,
|
||||
parseInputs: splitOnboardingEntries,
|
||||
parseInputs: splitSetupEntries,
|
||||
parseId: params.parseId,
|
||||
invalidWithoutTokenNote: params.invalidWithoutTokenNote,
|
||||
resolveEntries: params.resolveEntries,
|
||||
|
|
@ -40,7 +40,7 @@ export type PromptAccountIdParams = {
|
|||
|
||||
export type PromptAccountId = (params: PromptAccountIdParams) => Promise<string>;
|
||||
|
||||
export type ChannelOnboardingStatus = {
|
||||
export type ChannelSetupStatus = {
|
||||
channel: ChannelId;
|
||||
configured: boolean;
|
||||
statusLines: string[];
|
||||
|
|
@ -48,13 +48,13 @@ export type ChannelOnboardingStatus = {
|
|||
quickstartScore?: number;
|
||||
};
|
||||
|
||||
export type ChannelOnboardingStatusContext = {
|
||||
export type ChannelSetupStatusContext = {
|
||||
cfg: OpenClawConfig;
|
||||
options?: SetupChannelsOptions;
|
||||
accountOverrides: Partial<Record<ChannelId, string>>;
|
||||
};
|
||||
|
||||
export type ChannelOnboardingConfigureContext = {
|
||||
export type ChannelSetupConfigureContext = {
|
||||
cfg: OpenClawConfig;
|
||||
runtime: RuntimeEnv;
|
||||
prompter: WizardPrompter;
|
||||
|
|
@ -64,19 +64,19 @@ export type ChannelOnboardingConfigureContext = {
|
|||
forceAllowFrom: boolean;
|
||||
};
|
||||
|
||||
export type ChannelOnboardingResult = {
|
||||
export type ChannelSetupResult = {
|
||||
cfg: OpenClawConfig;
|
||||
accountId?: string;
|
||||
};
|
||||
|
||||
export type ChannelOnboardingConfiguredResult = ChannelOnboardingResult | "skip";
|
||||
export type ChannelSetupConfiguredResult = ChannelSetupResult | "skip";
|
||||
|
||||
export type ChannelOnboardingInteractiveContext = ChannelOnboardingConfigureContext & {
|
||||
export type ChannelSetupInteractiveContext = ChannelSetupConfigureContext & {
|
||||
configured: boolean;
|
||||
label: string;
|
||||
};
|
||||
|
||||
export type ChannelOnboardingDmPolicy = {
|
||||
export type ChannelSetupDmPolicy = {
|
||||
label: string;
|
||||
channel: ChannelId;
|
||||
policyKey: string;
|
||||
|
|
@ -90,17 +90,17 @@ export type ChannelOnboardingDmPolicy = {
|
|||
}) => Promise<OpenClawConfig>;
|
||||
};
|
||||
|
||||
export type ChannelOnboardingAdapter = {
|
||||
export type ChannelSetupFlowAdapter = {
|
||||
channel: ChannelId;
|
||||
getStatus: (ctx: ChannelOnboardingStatusContext) => Promise<ChannelOnboardingStatus>;
|
||||
configure: (ctx: ChannelOnboardingConfigureContext) => Promise<ChannelOnboardingResult>;
|
||||
getStatus: (ctx: ChannelSetupStatusContext) => Promise<ChannelSetupStatus>;
|
||||
configure: (ctx: ChannelSetupConfigureContext) => Promise<ChannelSetupResult>;
|
||||
configureInteractive?: (
|
||||
ctx: ChannelOnboardingInteractiveContext,
|
||||
) => Promise<ChannelOnboardingConfiguredResult>;
|
||||
ctx: ChannelSetupInteractiveContext,
|
||||
) => Promise<ChannelSetupConfiguredResult>;
|
||||
configureWhenConfigured?: (
|
||||
ctx: ChannelOnboardingInteractiveContext,
|
||||
) => Promise<ChannelOnboardingConfiguredResult>;
|
||||
dmPolicy?: ChannelOnboardingDmPolicy;
|
||||
ctx: ChannelSetupInteractiveContext,
|
||||
) => Promise<ChannelSetupConfiguredResult>;
|
||||
dmPolicy?: ChannelSetupDmPolicy;
|
||||
onAccountRecorded?: (accountId: string, options?: SetupChannelsOptions) => void;
|
||||
disable?: (cfg: OpenClawConfig) => OpenClawConfig;
|
||||
};
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
import type { WizardPrompter } from "../../wizard/prompts.js";
|
||||
import { splitOnboardingEntries } from "./onboarding/helpers.js";
|
||||
import { splitSetupEntries } from "./setup-flow-helpers.js";
|
||||
|
||||
export type ChannelAccessPolicy = "allowlist" | "open" | "disabled";
|
||||
|
||||
export function parseAllowlistEntries(raw: string): string[] {
|
||||
return splitOnboardingEntries(String(raw ?? ""));
|
||||
return splitSetupEntries(String(raw ?? ""));
|
||||
}
|
||||
|
||||
export function formatAllowlistEntries(entries: string[]): string {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { DEFAULT_ACCOUNT_ID } from "../../routing/session-key.js";
|
||||
import type { WizardPrompter } from "../../wizard/prompts.js";
|
||||
import type {
|
||||
ChannelOnboardingAdapter,
|
||||
ChannelOnboardingConfigureContext,
|
||||
ChannelOnboardingDmPolicy,
|
||||
ChannelOnboardingStatus,
|
||||
ChannelOnboardingStatusContext,
|
||||
} from "./onboarding-types.js";
|
||||
import {
|
||||
promptResolvedAllowFrom,
|
||||
resolveAccountIdForConfigure,
|
||||
runSingleChannelSecretStep,
|
||||
splitOnboardingEntries,
|
||||
} from "./onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "./setup-flow-helpers.js";
|
||||
import type {
|
||||
ChannelSetupFlowAdapter,
|
||||
ChannelSetupConfigureContext,
|
||||
ChannelSetupDmPolicy,
|
||||
ChannelSetupStatus,
|
||||
ChannelSetupStatusContext,
|
||||
} from "./setup-flow-types.js";
|
||||
import { configureChannelAccessWithAllowlist } from "./setup-group-access-configure.js";
|
||||
import type { ChannelAccessPolicy } from "./setup-group-access.js";
|
||||
import type { ChannelSetupInput } from "./types.core.js";
|
||||
|
|
@ -211,9 +211,9 @@ export type ChannelSetupWizardPrepare = (params: {
|
|||
cfg: OpenClawConfig;
|
||||
accountId: string;
|
||||
credentialValues: ChannelSetupWizardCredentialValues;
|
||||
runtime: ChannelOnboardingConfigureContext["runtime"];
|
||||
runtime: ChannelSetupConfigureContext["runtime"];
|
||||
prompter: WizardPrompter;
|
||||
options?: ChannelOnboardingConfigureContext["options"];
|
||||
options?: ChannelSetupConfigureContext["options"];
|
||||
}) =>
|
||||
| {
|
||||
cfg?: OpenClawConfig;
|
||||
|
|
@ -229,9 +229,9 @@ export type ChannelSetupWizardFinalize = (params: {
|
|||
cfg: OpenClawConfig;
|
||||
accountId: string;
|
||||
credentialValues: ChannelSetupWizardCredentialValues;
|
||||
runtime: ChannelOnboardingConfigureContext["runtime"];
|
||||
runtime: ChannelSetupConfigureContext["runtime"];
|
||||
prompter: WizardPrompter;
|
||||
options?: ChannelOnboardingConfigureContext["options"];
|
||||
options?: ChannelSetupConfigureContext["options"];
|
||||
forceAllowFrom: boolean;
|
||||
}) =>
|
||||
| {
|
||||
|
|
@ -252,7 +252,7 @@ export type ChannelSetupWizard = {
|
|||
resolveAccountIdForConfigure?: (params: {
|
||||
cfg: OpenClawConfig;
|
||||
prompter: WizardPrompter;
|
||||
options?: ChannelOnboardingConfigureContext["options"];
|
||||
options?: ChannelSetupConfigureContext["options"];
|
||||
accountOverride?: string;
|
||||
shouldPromptAccountIds: boolean;
|
||||
listAccountIds: ChannelSetupWizardPlugin["config"]["listAccountIds"];
|
||||
|
|
@ -260,7 +260,7 @@ export type ChannelSetupWizard = {
|
|||
}) => string | Promise<string>;
|
||||
resolveShouldPromptAccountIds?: (params: {
|
||||
cfg: OpenClawConfig;
|
||||
options?: ChannelOnboardingConfigureContext["options"];
|
||||
options?: ChannelSetupConfigureContext["options"];
|
||||
shouldPromptAccountIds: boolean;
|
||||
}) => boolean;
|
||||
prepare?: ChannelSetupWizardPrepare;
|
||||
|
|
@ -269,11 +269,11 @@ export type ChannelSetupWizard = {
|
|||
textInputs?: ChannelSetupWizardTextInput[];
|
||||
finalize?: ChannelSetupWizardFinalize;
|
||||
completionNote?: ChannelSetupWizardNote;
|
||||
dmPolicy?: ChannelOnboardingDmPolicy;
|
||||
dmPolicy?: ChannelSetupDmPolicy;
|
||||
allowFrom?: ChannelSetupWizardAllowFrom;
|
||||
groupAccess?: ChannelSetupWizardGroupAccess;
|
||||
disable?: (cfg: OpenClawConfig) => OpenClawConfig;
|
||||
onAccountRecorded?: ChannelOnboardingAdapter["onAccountRecorded"];
|
||||
onAccountRecorded?: ChannelSetupFlowAdapter["onAccountRecorded"];
|
||||
};
|
||||
|
||||
type ChannelSetupWizardPlugin = Pick<ChannelPlugin, "id" | "meta" | "config" | "setup">;
|
||||
|
|
@ -281,8 +281,8 @@ type ChannelSetupWizardPlugin = Pick<ChannelPlugin, "id" | "meta" | "config" | "
|
|||
async function buildStatus(
|
||||
plugin: ChannelSetupWizardPlugin,
|
||||
wizard: ChannelSetupWizard,
|
||||
ctx: ChannelOnboardingStatusContext,
|
||||
): Promise<ChannelOnboardingStatus> {
|
||||
ctx: ChannelSetupStatusContext,
|
||||
): Promise<ChannelSetupStatus> {
|
||||
const configured = await wizard.status.resolveConfigured({ cfg: ctx.cfg });
|
||||
const statusLines = (await wizard.status.resolveStatusLines?.({
|
||||
cfg: ctx.cfg,
|
||||
|
|
@ -399,10 +399,10 @@ async function applyWizardTextInputValue(params: {
|
|||
}).cfg;
|
||||
}
|
||||
|
||||
export function buildChannelOnboardingAdapterFromSetupWizard(params: {
|
||||
export function buildChannelSetupFlowAdapterFromSetupWizard(params: {
|
||||
plugin: ChannelSetupWizardPlugin;
|
||||
wizard: ChannelSetupWizard;
|
||||
}): ChannelOnboardingAdapter {
|
||||
}): ChannelSetupFlowAdapter {
|
||||
const { plugin, wizard } = params;
|
||||
return {
|
||||
channel: plugin.id,
|
||||
|
|
@ -809,7 +809,7 @@ export function buildChannelOnboardingAdapterFromSetupWizard(params: {
|
|||
message: allowFrom.message,
|
||||
placeholder: allowFrom.placeholder,
|
||||
label: allowFrom.helpTitle ?? `${plugin.meta.label} allowlist`,
|
||||
parseInputs: allowFrom.parseInputs ?? splitOnboardingEntries,
|
||||
parseInputs: allowFrom.parseInputs ?? splitSetupEntries,
|
||||
parseId: allowFrom.parseId,
|
||||
invalidWithoutTokenNote: allowFrom.invalidWithoutCredentialNote,
|
||||
resolveEntries: async ({ entries }) =>
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
export * from "../../channels/plugins/setup-flow-types.js";
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from "../../channels/plugins/onboarding-types.js";
|
||||
|
|
@ -35,7 +35,7 @@ export {
|
|||
addWildcardAllowFrom,
|
||||
mergeAllowFromEntries,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@ export {
|
|||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
setTopLevelChannelGroupPolicy,
|
||||
splitOnboardingEntries,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export type {
|
||||
BaseProbeResult,
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ export { resolveChannelMediaMaxBytes } from "../channels/plugins/media-limits.js
|
|||
export {
|
||||
addWildcardAllowFrom,
|
||||
mergeAllowFromEntries,
|
||||
splitOnboardingEntries,
|
||||
splitSetupEntries,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ export {
|
|||
export {
|
||||
promptSingleChannelSecretInput,
|
||||
type SingleChannelSecretInputPromptResult,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { buildOauthProviderAuthResult } from "./provider-auth-result.js";
|
||||
export { formatResolvedUnresolvedNote } from "./resolution-notes.js";
|
||||
export { buildChannelSendResult } from "./channel-send-result.js";
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export {
|
|||
addWildcardAllowFrom,
|
||||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export { patchScopedAccountConfig } from "../channels/plugins/setup-helpers.js";
|
||||
export type { BaseProbeResult } from "../channels/plugins/types.js";
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export {
|
|||
mergeAllowFromEntries,
|
||||
promptSingleChannelSecretInput,
|
||||
setTopLevelChannelGroupPolicy,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export { applyAccountNameToChannelSection } from "../channels/plugins/setup-helpers.js";
|
||||
export { createAccountListHelpers } from "../channels/plugins/account-helpers.js";
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export {
|
|||
buildSingleChannelSecretPromptState,
|
||||
promptSingleChannelSecretInput,
|
||||
runSingleChannelSecretStep,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
applySetupAccountConfigPatch,
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ export {
|
|||
setTopLevelChannelAllowFrom,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
setTopLevelChannelGroupPolicy,
|
||||
splitOnboardingEntries,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
splitSetupEntries,
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export type {
|
||||
BaseProbeResult,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export {
|
|||
promptSingleChannelSecretInput,
|
||||
runSingleChannelSecretStep,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
patchScopedAccountConfig,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export {
|
|||
promptSingleChannelSecretInput,
|
||||
runSingleChannelSecretStep,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export { PAIRING_APPROVED_MESSAGE } from "../channels/plugins/pairing-message.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export {
|
|||
addWildcardAllowFrom,
|
||||
mergeAllowFromEntries,
|
||||
setTopLevelChannelDmPolicyWithAllowFrom,
|
||||
} from "../channels/plugins/onboarding/helpers.js";
|
||||
} from "../channels/plugins/setup-flow-helpers.js";
|
||||
export {
|
||||
applyAccountNameToChannelSection,
|
||||
applySetupAccountConfigPatch,
|
||||
|
|
|
|||
Loading…
Reference in New Issue