fix(pairing): bypass store and channel barrels

This commit is contained in:
Vincent Koc
2026-04-11 21:07:42 +01:00
parent 8e952eba75
commit cde21de828
4 changed files with 5 additions and 11 deletions

View File

@@ -1,13 +1,9 @@
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { RuntimeEnv } from "../../runtime.js";
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
import {
type ChannelId,
getChannelPlugin,
listChannelPlugins,
normalizeChannelId,
} from "./index.js";
import type { ChannelId } from "./channel-id.types.js";
import type { ChannelPairingAdapter } from "./pairing.types.js";
import { getChannelPlugin, listChannelPlugins, normalizeChannelId } from "./registry.js";
export function listPairingChannels(): ChannelId[] {
// Channel docking: pairing support is declared via plugin.pairing.

View File

@@ -1,5 +1,5 @@
import { getPairingAdapter } from "../channels/plugins/pairing.js";
import type { PairingChannel } from "./pairing-store.js";
import type { PairingChannel } from "./pairing-store.types.js";
export function resolvePairingIdLabel(channel: PairingChannel): string {
return getPairingAdapter(channel)?.idLabel ?? "userId";

View File

@@ -1,5 +1,5 @@
import { formatCliCommand } from "../cli/command-format.js";
import type { PairingChannel } from "./pairing-store.js";
import type { PairingChannel } from "./pairing-store.types.js";
export function buildPairingReply(params: {
channel: PairingChannel;

View File

@@ -2,7 +2,6 @@ import crypto from "node:crypto";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import type { ChannelId } from "../channels/plugins/channel-id.types.js";
import { getPairingAdapter } from "../channels/plugins/pairing.js";
import type { ChannelPairingAdapter } from "../channels/plugins/pairing.types.js";
import { resolveOAuthDir, resolveStateDir } from "../config/paths.js";
@@ -16,6 +15,7 @@ import {
normalizeOptionalString,
normalizeStringifiedOptionalString,
} from "../shared/string-coerce.js";
import type { PairingChannel } from "./pairing-store.types.js";
const PAIRING_CODE_LENGTH = 8;
const PAIRING_CODE_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
@@ -41,8 +41,6 @@ type AllowFromStatLike = { mtimeMs: number; size: number } | null;
const allowFromReadCache = new Map<string, AllowFromReadCacheEntry>();
export type PairingChannel = ChannelId;
export type PairingRequest = {
id: string;
code: string;