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 type { ClawdbotConfig } from "../../config/config.js";
import { import {
resolveSessionFilePath, resolveSessionFilePath,
saveSessionStore,
type SessionEntry, type SessionEntry,
updateSessionStore, updateSessionStore,
} from "../../config/sessions.js"; } 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 { resolveAgentDir, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../../agents/agent-scope.js";
import { resolveDefaultAgentWorkspaceDir } from "../../agents/workspace.js"; import { resolveDefaultAgentWorkspaceDir } from "../../agents/workspace.js";
import { parseDurationMs } from "../../cli/parse-duration.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 type { RuntimeEnv } from "../../runtime.js";
import { stylePromptHint, stylePromptMessage } from "../../terminal/prompt-style.js"; import { stylePromptHint, stylePromptMessage } from "../../terminal/prompt-style.js";
import { applyAuthProfileConfig } from "../onboard-auth.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 { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.js";
import type { RuntimeEnv } from "../runtime.js"; import type { RuntimeEnv } from "../runtime.js";
import { formatDocsLink } from "../terminal/links.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 type { ChannelChoice } from "./onboard-types.js";
import { import {
getChannelOnboardingAdapter, getChannelOnboardingAdapter,
@@ -44,12 +44,28 @@ async function promptConfiguredAction(params: {
supportsDelete: boolean; supportsDelete: boolean;
}): Promise<ConfiguredChannelAction> { }): Promise<ConfiguredChannelAction> {
const { prompter, label, supportsDisable, supportsDelete } = params; const { prompter, label, supportsDisable, supportsDelete } = params;
const options = [ const updateOption: WizardSelectOption<ConfiguredChannelAction> = {
{ value: "update", label: "Modify settings" }, value: "update",
...(supportsDisable ? [{ value: "disable", label: "Disable (keeps config)" }] : []), label: "Modify settings",
...(supportsDelete ? [{ value: "delete", label: "Delete config" }] : []), };
{ value: "skip", label: "Skip (leave as-is)" }, const disableOption: WizardSelectOption<ConfiguredChannelAction> = {
] as const; 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({ return (await prompter.select({
message: `${label} already configured. What do you want to do?`, message: `${label} already configured. What do you want to do?`,
options, options,

View File

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

View File

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

View File

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