mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 05:00:21 +00:00
refactor: harden plugin metadata and bundled channel entry seams
This commit is contained in:
@@ -2,7 +2,8 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { resolveDefaultAgentId } from "../agents/agent-scope.js";
|
||||
import { listBootstrapChannelPlugins } from "../channels/plugins/bootstrap-registry.js";
|
||||
import { listBundledChannelPluginIds } from "../channels/plugins/bundled-ids.js";
|
||||
import { hasBundledChannelPersistedAuthState } from "../channels/plugins/persisted-auth-state.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveOAuthDir, resolveStateDir } from "../config/paths.js";
|
||||
@@ -463,8 +464,8 @@ function shouldRequireOAuthDir(cfg: OpenClawConfig, env: NodeJS.ProcessEnv): boo
|
||||
if (!isRecord(channels)) {
|
||||
return false;
|
||||
}
|
||||
for (const plugin of listBootstrapChannelPlugins()) {
|
||||
if (plugin.config.hasPersistedAuthState?.({ cfg, env })) {
|
||||
for (const channelId of listBundledChannelPluginIds()) {
|
||||
if (hasBundledChannelPersistedAuthState({ channelId, cfg, env })) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { listBootstrapChannelPlugins } from "../../../channels/plugins/bootstrap-registry.js";
|
||||
import { iterateBootstrapChannelPlugins } from "../../../channels/plugins/bootstrap-registry.js";
|
||||
import type { OpenClawConfig } from "../../../config/types.js";
|
||||
|
||||
export function applyChannelDoctorCompatibilityMigrations(cfg: Record<string, unknown>): {
|
||||
@@ -7,7 +7,7 @@ export function applyChannelDoctorCompatibilityMigrations(cfg: Record<string, un
|
||||
} {
|
||||
let nextCfg = cfg as OpenClawConfig & Record<string, unknown>;
|
||||
const changes: string[] = [];
|
||||
for (const plugin of listBootstrapChannelPlugins()) {
|
||||
for (const plugin of iterateBootstrapChannelPlugins()) {
|
||||
const mutation = plugin.doctor?.normalizeCompatibilityConfig?.({ cfg: nextCfg });
|
||||
if (!mutation || mutation.changes.length === 0) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user