mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 14:41:34 +00:00
IRC: break runtime-api cycle in accounts
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import { createAccountListHelpers } from "openclaw/plugin-sdk/account-helpers";
|
||||
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
||||
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/infra-runtime";
|
||||
import {
|
||||
createAccountListHelpers,
|
||||
normalizeResolvedSecretInputString,
|
||||
parseOptionalDelimitedEntries,
|
||||
} from "./runtime-api.js";
|
||||
import type { CoreConfig, IrcAccountConfig, IrcNickServConfig } from "./types.js";
|
||||
|
||||
const TRUTHY_ENV = new Set(["true", "1", "yes", "on"]);
|
||||
@@ -43,6 +40,17 @@ function parseIntEnv(value?: string): number | undefined {
|
||||
return parsed;
|
||||
}
|
||||
|
||||
function parseOptionalDelimitedEntries(value?: string): string[] | undefined {
|
||||
if (!value?.trim()) {
|
||||
return undefined;
|
||||
}
|
||||
const parsed = value
|
||||
.split(/[\n,;]+/g)
|
||||
.map((entry) => entry.trim())
|
||||
.filter(Boolean);
|
||||
return parsed.length > 0 ? parsed : undefined;
|
||||
}
|
||||
|
||||
const { listAccountIds: listIrcAccountIds, resolveDefaultAccountId: resolveDefaultIrcAccountId } =
|
||||
createAccountListHelpers("irc", { normalizeAccountId });
|
||||
export { listIrcAccountIds, resolveDefaultIrcAccountId };
|
||||
|
||||
Reference in New Issue
Block a user