refactor!: rename chat providers to channels

This commit is contained in:
Peter Steinberger
2026-01-13 06:16:43 +00:00
parent 0cd632ba84
commit 90342a4f3a
393 changed files with 8004 additions and 6737 deletions

View File

@@ -1,3 +1,4 @@
import { DEFAULT_CHAT_CHANNEL } from "../channels/registry.js";
import type { CliDeps } from "../cli/deps.js";
import { withProgress } from "../cli/progress.js";
import { loadConfig } from "../config/config.js";
@@ -7,14 +8,13 @@ import {
resolveStorePath,
} from "../config/sessions.js";
import { callGateway, randomIdempotencyKey } from "../gateway/call.js";
import { DEFAULT_CHAT_PROVIDER } from "../providers/registry.js";
import { normalizeMainKey } from "../routing/session-key.js";
import type { RuntimeEnv } from "../runtime.js";
import {
GATEWAY_CLIENT_MODES,
GATEWAY_CLIENT_NAMES,
normalizeMessageProvider,
} from "../utils/message-provider.js";
normalizeMessageChannel,
} from "../utils/message-channel.js";
import { agentCommand } from "./agent.js";
type AgentGatewayResult = {
@@ -42,7 +42,7 @@ export type AgentCliOpts = {
json?: boolean;
timeout?: string;
deliver?: boolean;
provider?: string;
channel?: string;
bestEffortDeliver?: boolean;
lane?: string;
runId?: string;
@@ -129,8 +129,7 @@ export async function agentViaGatewayCommand(
sessionId: opts.sessionId,
});
const provider =
normalizeMessageProvider(opts.provider) ?? DEFAULT_CHAT_PROVIDER;
const channel = normalizeMessageChannel(opts.channel) ?? DEFAULT_CHAT_CHANNEL;
const idempotencyKey = opts.runId?.trim() || randomIdempotencyKey();
const response = await withProgress(
@@ -149,7 +148,7 @@ export async function agentViaGatewayCommand(
sessionKey,
thinking: opts.thinking,
deliver: Boolean(opts.deliver),
provider,
channel,
timeout: timeoutSeconds,
lane: opts.lane,
extraSystemPrompt: opts.extraSystemPrompt,