fix: align config types after upstream changes

This commit is contained in:
Peter Steinberger
2026-01-16 01:49:07 +00:00
parent 1210657fda
commit af370ab23e
6 changed files with 29 additions and 14 deletions

View File

@@ -13,6 +13,7 @@ import {
import type { ClawdbotConfig } from "../../config/config.js";
import {
resolveSessionFilePath,
saveSessionStore,
type SessionEntry,
updateSessionStore,
} from "../../config/sessions.js";

View File

@@ -11,7 +11,7 @@ import { normalizeProviderId } from "../../agents/model-selection.js";
import { resolveAgentDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agents/agent-scope.js";
import { resolveDefaultAgentWorkspaceDir } from "../../agents/workspace.js";
import { parseDurationMs } from "../../cli/parse-duration.js";
import { CONFIG_PATH_CLAWDBOT, readConfigFileSnapshot } from "../../config/config.js";
import { CONFIG_PATH_CLAWDBOT, readConfigFileSnapshot, type ClawdbotConfig } from "../../config/config.js";
import type { RuntimeEnv } from "../../runtime.js";
import { stylePromptHint, stylePromptMessage } from "../../terminal/prompt-style.js";
import { applyAuthProfileConfig } from "../onboard-auth.js";

View File

@@ -8,7 +8,7 @@ import { resolveChannelDefaultAccountId } from "../channels/plugins/helpers.js";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
import type { RuntimeEnv } from "../runtime.js";
import { formatDocsLink } from "../terminal/links.js";
import type { WizardPrompter } from "../wizard/prompts.js";
import type { WizardPrompter, WizardSelectOption } from "../wizard/prompts.js";
import type { ChannelChoice } from "./onboard-types.js";
import {
getChannelOnboardingAdapter,
@@ -44,12 +44,28 @@ async function promptConfiguredAction(params: {
supportsDelete: boolean;
}): Promise<ConfiguredChannelAction> {
const { prompter, label, supportsDisable, supportsDelete } = params;
const options = [
{ value: "update", label: "Modify settings" },
...(supportsDisable ? [{ value: "disable", label: "Disable (keeps config)" }] : []),
...(supportsDelete ? [{ value: "delete", label: "Delete config" }] : []),
{ value: "skip", label: "Skip (leave as-is)" },
] as const;
const updateOption: WizardSelectOption<ConfiguredChannelAction> = {
value: "update",
label: "Modify settings",
};
const disableOption: WizardSelectOption<ConfiguredChannelAction> = {
value: "disable",
label: "Disable (keeps config)",
};
const deleteOption: WizardSelectOption<ConfiguredChannelAction> = {
value: "delete",
label: "Delete config",
};
const skipOption: WizardSelectOption<ConfiguredChannelAction> = {
value: "skip",
label: "Skip (leave as-is)",
};
const options: Array<WizardSelectOption<ConfiguredChannelAction>> = [
updateOption,
...(supportsDisable ? [disableOption] : []),
...(supportsDelete ? [deleteOption] : []),
skipOption,
];
return (await prompter.select({
message: `${label} already configured. What do you want to do?`,
options,

View File

@@ -5,6 +5,7 @@ export const createTestRegistry = (overrides: Partial<PluginRegistry> = {}): Plu
plugins: [],
tools: [],
channels: [],
providers: [],
gatewayHandlers: {},
httpHandlers: [],
cliRegistrars: [],

View File

@@ -1,11 +1,11 @@
import { createSubsystemLogger } from "../logging.js";
import { loadClawdbotPlugins } from "./loader.js";
import { loadClawdbotPlugins, type PluginLoadOptions } from "./loader.js";
import type { ProviderPlugin } from "./types.js";
const log = createSubsystemLogger("plugins");
export function resolvePluginProviders(params: {
config?: Parameters<typeof loadClawdbotPlugins>[0]["config"];
config?: PluginLoadOptions["config"];
workspaceDir?: string;
}): ProviderPlugin[] {
const registry = loadClawdbotPlugins({

View File

@@ -37,10 +37,7 @@ export function formatStatusSummary(summary: GatewayStatusSummary) {
if (sessionPath) lines.push(`Session store: ${sessionPath}`);
const defaults = summary.sessions?.defaults;
const defaultModel =
defaults?.model && defaults?.modelProvider
? `${defaults.modelProvider}/${defaults.model}`
: defaults?.model ?? "unknown";
const defaultModel = defaults?.model ?? "unknown";
const defaultCtx =
typeof defaults?.contextTokens === "number"
? ` (${formatTokenCount(defaults.contextTokens)} ctx)`