fix(ci): repair redundant channel union types

This commit is contained in:
Peter Steinberger
2026-04-04 05:07:54 +01:00
parent 1246e2b03a
commit 53b5b1b32d
13 changed files with 19 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ import { normalizeAccountId } from "../routing/session-key.js";
import { chunkTextByBreakResolver } from "../shared/text-chunking.js";
import { INTERNAL_MESSAGE_CHANNEL } from "../utils/message-channel.js";
export type TextChunkProvider = ChannelId | typeof INTERNAL_MESSAGE_CHANNEL;
export type TextChunkProvider = ChannelId;
/**
* Chunking mode for outbound messages:

View File

@@ -4,11 +4,10 @@ import type {
MediaUnderstandingOutput,
} from "../media-understanding/types.js";
import type { InputProvenance } from "../sessions/input-provenance.js";
import type { InternalMessageChannel } from "../utils/message-channel.js";
import type { CommandArgs } from "./commands-registry.types.js";
/** Valid message channels for routing. */
export type OriginatingChannelType = ChannelId | InternalMessageChannel;
export type OriginatingChannelType = ChannelId;
export type StickerContextMetadata = {
cachedDescription?: string;

View File

@@ -19,10 +19,10 @@ function collectBundledChatChannelAliases(): Record<string, ChatChannelId> {
? entry.packageManifest.channel
: undefined;
const rawId = channel?.id?.trim();
if (!rawId || !CHAT_CHANNEL_ORDER.includes(rawId as ChatChannelId)) {
if (!rawId || !CHAT_CHANNEL_ORDER.includes(rawId)) {
continue;
}
const channelId = rawId as ChatChannelId;
const channelId = rawId;
if (!channel) {
continue;
}

View File

@@ -7,7 +7,7 @@ import type { TtsAutoMode } from "../types.tts.js";
export type SessionScope = "per-sender" | "global";
export type SessionChannelId = ChannelId | "webchat";
export type SessionChannelId = ChannelId;
export type SessionChatType = ChatType;

View File

@@ -243,7 +243,7 @@ export type AgentDefaultsConfig = {
/** Session key for heartbeat runs ("main" or explicit session key). */
session?: string;
/** Delivery target ("last", "none", or a channel id). */
target?: "last" | "none" | ChannelId;
target?: ChannelId;
/** Direct/DM delivery policy. Default: "allow". */
directPolicy?: "allow" | "block";
/** Optional delivery override (E.164 for WhatsApp, chat id for Telegram). Supports :topic:NNN suffix for Telegram topics. */

View File

@@ -64,7 +64,7 @@ export async function resolveDeliveryTarget(
cfg: OpenClawConfig,
agentId: string,
jobPayload: {
channel?: "last" | ChannelId;
channel?: ChannelId;
to?: string;
threadId?: string | number;
/** Explicit accountId from job.delivery — overrides session-derived and binding-derived values. */

View File

@@ -14,7 +14,7 @@ type DeliveryMode = "none" | "announce";
type DeliveryOverride = {
mode: DeliveryMode;
channel?: ChannelId | "last";
channel?: ChannelId;
to?: string;
};

View File

@@ -17,7 +17,7 @@ export type CronSchedule =
export type CronSessionTarget = "main" | "isolated" | "current" | `session:${string}`;
export type CronWakeMode = "next-heartbeat" | "now";
export type CronMessageChannel = ChannelId | "last";
export type CronMessageChannel = ChannelId;
export type CronDeliveryMode = "none" | "announce" | "webhook";

View File

@@ -527,7 +527,7 @@ export async function setupChannels(
if (options?.quickstartDefaults) {
const { entries } = getChannelEntries();
const choice = (await prompter.select({
const choice = await prompter.select({
message: "Select channel (QuickStart)",
options: [
...resolveChannelSetupSelectionContributions({
@@ -542,7 +542,7 @@ export async function setupChannels(
},
],
initialValue: quickstartDefault,
})) as ChannelChoice | "__skip__";
});
if (choice !== "__skip__") {
await handleChannelChoice(choice);
}
@@ -551,7 +551,7 @@ export async function setupChannels(
const initialValue = options?.initialSelection?.[0] ?? quickstartDefault;
while (true) {
const { entries } = getChannelEntries();
const choice = (await prompter.select({
const choice = await prompter.select({
message: "Select a channel",
options: [
...resolveChannelSetupSelectionContributions({
@@ -566,7 +566,7 @@ export async function setupChannels(
},
],
initialValue,
})) as ChannelChoice | typeof doneValue;
});
if (choice === doneValue) {
break;
}

View File

@@ -222,7 +222,7 @@ export type HookAgentDispatchPayload = Omit<HookAgentPayload, "sessionKey"> & {
const listHookChannelValues = () => ["last", ...listChannelPlugins().map((plugin) => plugin.id)];
export type HookMessageChannel = ChannelId | "last";
export type HookMessageChannel = ChannelId;
const getHookChannelSet = () => new Set<string>(listHookChannelValues());
export const getHookChannelError = () => `channel must be ${listHookChannelValues().join("|")}`;

View File

@@ -47,7 +47,7 @@ function parseExplicitTargetWithPlugin(params: {
export function resolveSessionDeliveryTarget(params: {
entry?: SessionEntry;
requestedChannel?: GatewayMessageChannel | "last";
requestedChannel?: GatewayMessageChannel;
explicitTo?: string;
explicitThreadId?: string | number;
fallbackChannel?: DeliverableMessageChannel;

View File

@@ -25,9 +25,9 @@ import {
} from "./channel-resolution.js";
import { missingTargetError } from "./target-errors.js";
export type OutboundChannel = DeliverableMessageChannel | "none";
export type OutboundChannel = DeliverableMessageChannel;
export type HeartbeatTarget = OutboundChannel | "last";
export type HeartbeatTarget = OutboundChannel;
export type OutboundTarget = {
channel: OutboundChannel;

View File

@@ -84,7 +84,7 @@ export const listDeliverableMessageChannels = (): ChannelId[] =>
export type DeliverableMessageChannel = ChannelId;
export type GatewayMessageChannel = DeliverableMessageChannel | InternalMessageChannel;
export type GatewayMessageChannel = DeliverableMessageChannel;
export const listGatewayMessageChannels = (): GatewayMessageChannel[] => [
...listDeliverableMessageChannels(),
@@ -94,7 +94,7 @@ export const listGatewayMessageChannels = (): GatewayMessageChannel[] => [
export const listGatewayAgentChannelAliases = (): string[] =>
Array.from(new Set([...listChatChannelAliases(), ...listPluginChannelAliases()]));
export type GatewayAgentChannelHint = GatewayMessageChannel | "last";
export type GatewayAgentChannelHint = GatewayMessageChannel;
export const listGatewayAgentChannelValues = (): string[] =>
Array.from(