mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 21:54:31 +00:00
refactor!: rename chat providers to channels
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user