mirror of
https://fastgit.cc/github.com/openclaw/openclaw
synced 2026-05-01 06:36:23 +08:00
fix(pairing): bypass store and channel barrels
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user