style: align formatting with oxfmt 0.33

This commit is contained in:
Peter Steinberger
2026-02-18 01:34:35 +00:00
parent 31f9be126c
commit b8b43175c5
1119 changed files with 2077 additions and 2077 deletions

View File

@@ -10,7 +10,6 @@ import {
type ChannelMessageActionName, type ChannelMessageActionName,
type ChannelToolSend, type ChannelToolSend,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { BlueBubblesSendTarget } from "./types.js";
import { resolveBlueBubblesAccount } from "./accounts.js"; import { resolveBlueBubblesAccount } from "./accounts.js";
import { sendBlueBubblesAttachment } from "./attachments.js"; import { sendBlueBubblesAttachment } from "./attachments.js";
import { import {
@@ -27,6 +26,7 @@ import { getCachedBlueBubblesPrivateApiStatus, isMacOS26OrHigher } from "./probe
import { sendBlueBubblesReaction } from "./reactions.js"; import { sendBlueBubblesReaction } from "./reactions.js";
import { resolveChatGuidForTarget, sendMessageBlueBubbles } from "./send.js"; import { resolveChatGuidForTarget, sendMessageBlueBubbles } from "./send.js";
import { normalizeBlueBubblesHandle, parseBlueBubblesTarget } from "./targets.js"; import { normalizeBlueBubblesHandle, parseBlueBubblesTarget } from "./targets.js";
import type { BlueBubblesSendTarget } from "./types.js";
const providerId = "bluebubbles"; const providerId = "bluebubbles";

View File

@@ -1,9 +1,9 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import "./test-mocks.js"; import "./test-mocks.js";
import type { BlueBubblesAttachment } from "./types.js";
import { downloadBlueBubblesAttachment, sendBlueBubblesAttachment } from "./attachments.js"; import { downloadBlueBubblesAttachment, sendBlueBubblesAttachment } from "./attachments.js";
import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js"; import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";
import { installBlueBubblesFetchTestHooks } from "./test-harness.js"; import { installBlueBubblesFetchTestHooks } from "./test-harness.js";
import type { BlueBubblesAttachment } from "./types.js";
const mockFetch = vi.fn(); const mockFetch = vi.fn();

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import crypto from "node:crypto"; import crypto from "node:crypto";
import path from "node:path"; import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { resolveBlueBubblesServerAccount } from "./account-resolve.js"; import { resolveBlueBubblesServerAccount } from "./account-resolve.js";
import { postMultipartFormData } from "./multipart.js"; import { postMultipartFormData } from "./multipart.js";
import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js"; import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import crypto from "node:crypto"; import crypto from "node:crypto";
import path from "node:path"; import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { resolveBlueBubblesServerAccount } from "./account-resolve.js"; import { resolveBlueBubblesServerAccount } from "./account-resolve.js";
import { postMultipartFormData } from "./multipart.js"; import { postMultipartFormData } from "./multipart.js";
import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js"; import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";

View File

@@ -1,8 +1,8 @@
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import { pathToFileURL } from "node:url"; import { pathToFileURL } from "node:url";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { sendBlueBubblesMedia } from "./media-send.js"; import { sendBlueBubblesMedia } from "./media-send.js";
import { setBlueBubblesRuntime } from "./runtime.js"; import { setBlueBubblesRuntime } from "./runtime.js";

View File

@@ -1,5 +1,5 @@
import type { BlueBubblesAttachment } from "./types.js";
import { normalizeBlueBubblesHandle } from "./targets.js"; import { normalizeBlueBubblesHandle } from "./targets.js";
import type { BlueBubblesAttachment } from "./types.js";
function asRecord(value: unknown): Record<string, unknown> | null { function asRecord(value: unknown): Record<string, unknown> | null {
return value && typeof value === "object" && !Array.isArray(value) return value && typeof value === "object" && !Array.isArray(value)

View File

@@ -8,11 +8,6 @@ import {
resolveControlCommandGate, resolveControlCommandGate,
stripMarkdown, stripMarkdown,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type {
BlueBubblesCoreRuntime,
BlueBubblesRuntimeEnv,
WebhookTarget,
} from "./monitor-shared.js";
import { downloadBlueBubblesAttachment } from "./attachments.js"; import { downloadBlueBubblesAttachment } from "./attachments.js";
import { markBlueBubblesChatRead, sendBlueBubblesTyping } from "./chat.js"; import { markBlueBubblesChatRead, sendBlueBubblesTyping } from "./chat.js";
import { sendBlueBubblesMedia } from "./media-send.js"; import { sendBlueBubblesMedia } from "./media-send.js";
@@ -33,6 +28,11 @@ import {
resolveBlueBubblesMessageId, resolveBlueBubblesMessageId,
resolveReplyContextFromCache, resolveReplyContextFromCache,
} from "./monitor-reply-cache.js"; } from "./monitor-reply-cache.js";
import type {
BlueBubblesCoreRuntime,
BlueBubblesRuntimeEnv,
WebhookTarget,
} from "./monitor-shared.js";
import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js"; import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";
import { normalizeBlueBubblesReactionInput, sendBlueBubblesReaction } from "./reactions.js"; import { normalizeBlueBubblesReactionInput, sendBlueBubblesReaction } from "./reactions.js";
import { resolveChatGuidForTarget, sendMessageBlueBubbles } from "./send.js"; import { resolveChatGuidForTarget, sendMessageBlueBubbles } from "./send.js";

View File

@@ -1,7 +1,7 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk"; import type { OpenClawConfig } from "openclaw/plugin-sdk";
import type { ResolvedBlueBubblesAccount } from "./accounts.js"; import type { ResolvedBlueBubblesAccount } from "./accounts.js";
import type { BlueBubblesAccountConfig } from "./types.js";
import { getBlueBubblesRuntime } from "./runtime.js"; import { getBlueBubblesRuntime } from "./runtime.js";
import type { BlueBubblesAccountConfig } from "./types.js";
export type BlueBubblesRuntimeEnv = { export type BlueBubblesRuntimeEnv = {
log?: (message: string) => void; log?: (message: string) => void;

View File

@@ -1,6 +1,6 @@
import { EventEmitter } from "node:events";
import type { IncomingMessage, ServerResponse } from "node:http"; import type { IncomingMessage, ServerResponse } from "node:http";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk"; import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import { EventEmitter } from "node:events";
import { removeAckReactionAfterReply, shouldAckReaction } from "openclaw/plugin-sdk"; import { removeAckReactionAfterReply, shouldAckReaction } from "openclaw/plugin-sdk";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { ResolvedBlueBubblesAccount } from "./accounts.js"; import type { ResolvedBlueBubblesAccount } from "./accounts.js";

View File

@@ -1,6 +1,6 @@
import { timingSafeEqual } from "node:crypto";
import type { IncomingMessage, ServerResponse } from "node:http"; import type { IncomingMessage, ServerResponse } from "node:http";
import type { OpenClawConfig } from "openclaw/plugin-sdk"; import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { timingSafeEqual } from "node:crypto";
import { import {
registerWebhookTarget, registerWebhookTarget,
rejectNonPostWebhookRequest, rejectNonPostWebhookRequest,

View File

@@ -1,5 +1,5 @@
import type { BlueBubblesSendTarget } from "./types.js";
import { normalizeBlueBubblesHandle, parseBlueBubblesTarget } from "./targets.js"; import { normalizeBlueBubblesHandle, parseBlueBubblesTarget } from "./targets.js";
import type { BlueBubblesSendTarget } from "./types.js";
export function resolveBlueBubblesSendTarget(raw: string): BlueBubblesSendTarget { export function resolveBlueBubblesSendTarget(raw: string): BlueBubblesSendTarget {
const parsed = parseBlueBubblesTarget(raw); const parsed = parseBlueBubblesTarget(raw);

View File

@@ -1,9 +1,9 @@
import { beforeEach, describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vitest";
import "./test-mocks.js"; import "./test-mocks.js";
import type { BlueBubblesSendTarget } from "./types.js";
import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js"; import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";
import { sendMessageBlueBubbles, resolveChatGuidForTarget } from "./send.js"; import { sendMessageBlueBubbles, resolveChatGuidForTarget } from "./send.js";
import { installBlueBubblesFetchTestHooks } from "./test-harness.js"; import { installBlueBubblesFetchTestHooks } from "./test-harness.js";
import type { BlueBubblesSendTarget } from "./types.js";
const mockFetch = vi.fn(); const mockFetch = vi.fn();

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import crypto from "node:crypto"; import crypto from "node:crypto";
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { stripMarkdown } from "openclaw/plugin-sdk"; import { stripMarkdown } from "openclaw/plugin-sdk";
import { resolveBlueBubblesAccount } from "./accounts.js"; import { resolveBlueBubblesAccount } from "./accounts.js";
import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js"; import { getCachedBlueBubblesPrivateApiStatus } from "./probe.js";

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import os from "node:os"; import os from "node:os";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { approveDevicePairing, listDevicePairing } from "openclaw/plugin-sdk"; import { approveDevicePairing, listDevicePairing } from "openclaw/plugin-sdk";
import qrcode from "qrcode-terminal"; import qrcode from "qrcode-terminal";

View File

@@ -1,6 +1,5 @@
import type { SeverityNumber } from "@opentelemetry/api-logs";
import type { DiagnosticEventPayload, OpenClawPluginService } from "openclaw/plugin-sdk";
import { metrics, trace, SpanStatusCode } from "@opentelemetry/api"; import { metrics, trace, SpanStatusCode } from "@opentelemetry/api";
import type { SeverityNumber } from "@opentelemetry/api-logs";
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http"; import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http"; import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"; import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
@@ -10,6 +9,7 @@ import { PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
import { NodeSDK } from "@opentelemetry/sdk-node"; import { NodeSDK } from "@opentelemetry/sdk-node";
import { ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-base"; import { ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-base";
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions"; import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
import type { DiagnosticEventPayload, OpenClawPluginService } from "openclaw/plugin-sdk";
import { onDiagnosticEvent, registerLogTransport } from "openclaw/plugin-sdk"; import { onDiagnosticEvent, registerLogTransport } from "openclaw/plugin-sdk";
const DEFAULT_SERVICE_NAME = "openclaw"; const DEFAULT_SERVICE_NAME = "openclaw";

View File

@@ -1,7 +1,7 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { Type } from "@sinclair/typebox"; import { Type } from "@sinclair/typebox";
import type { FeishuConfig } from "./types.js"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { createFeishuClient } from "./client.js"; import { createFeishuClient } from "./client.js";
import type { FeishuConfig } from "./types.js";
// ============ Helpers ============ // ============ Helpers ============

View File

@@ -7,8 +7,6 @@ import {
DEFAULT_GROUP_HISTORY_LIMIT, DEFAULT_GROUP_HISTORY_LIMIT,
type HistoryEntry, type HistoryEntry,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { FeishuMessageContext, FeishuMediaInfo, ResolvedFeishuAccount } from "./types.js";
import type { DynamicAgentCreationConfig } from "./types.js";
import { resolveFeishuAccount } from "./accounts.js"; import { resolveFeishuAccount } from "./accounts.js";
import { createFeishuClient } from "./client.js"; import { createFeishuClient } from "./client.js";
import { tryRecordMessage } from "./dedup.js"; import { tryRecordMessage } from "./dedup.js";
@@ -24,6 +22,8 @@ import {
import { createFeishuReplyDispatcher } from "./reply-dispatcher.js"; import { createFeishuReplyDispatcher } from "./reply-dispatcher.js";
import { getFeishuRuntime } from "./runtime.js"; import { getFeishuRuntime } from "./runtime.js";
import { getMessageFeishu, sendMessageFeishu } from "./send.js"; import { getMessageFeishu, sendMessageFeishu } from "./send.js";
import type { FeishuMessageContext, FeishuMediaInfo, ResolvedFeishuAccount } from "./types.js";
import type { DynamicAgentCreationConfig } from "./types.js";
// --- Permission error extraction --- // --- Permission error extraction ---
// Extract permission grant URL from Feishu API error response. // Extract permission grant URL from Feishu API error response.

View File

@@ -5,7 +5,6 @@ import {
DEFAULT_ACCOUNT_ID, DEFAULT_ACCOUNT_ID,
PAIRING_APPROVED_MESSAGE, PAIRING_APPROVED_MESSAGE,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { ResolvedFeishuAccount, FeishuConfig } from "./types.js";
import { import {
resolveFeishuAccount, resolveFeishuAccount,
resolveFeishuCredentials, resolveFeishuCredentials,
@@ -24,6 +23,7 @@ import { resolveFeishuGroupToolPolicy } from "./policy.js";
import { probeFeishu } from "./probe.js"; import { probeFeishu } from "./probe.js";
import { sendMessageFeishu } from "./send.js"; import { sendMessageFeishu } from "./send.js";
import { normalizeFeishuTarget, looksLikeFeishuId, formatFeishuTarget } from "./targets.js"; import { normalizeFeishuTarget, looksLikeFeishuId, formatFeishuTarget } from "./targets.js";
import type { ResolvedFeishuAccount, FeishuConfig } from "./types.js";
const meta: ChannelMeta = { const meta: ChannelMeta = {
id: "feishu", id: "feishu",

View File

@@ -1,7 +1,7 @@
import type * as Lark from "@larksuiteoapi/node-sdk";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { Type } from "@sinclair/typebox";
import { Readable } from "stream"; import { Readable } from "stream";
import type * as Lark from "@larksuiteoapi/node-sdk";
import { Type } from "@sinclair/typebox";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { listEnabledFeishuAccounts } from "./accounts.js"; import { listEnabledFeishuAccounts } from "./accounts.js";
import { createFeishuClient } from "./client.js"; import { createFeishuClient } from "./client.js";
import { FeishuDocSchema, type FeishuDocParams } from "./doc-schema.js"; import { FeishuDocSchema, type FeishuDocParams } from "./doc-schema.js";

View File

@@ -1,7 +1,7 @@
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import fs from "node:fs"; import fs from "node:fs";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import type { DynamicAgentCreationConfig } from "./types.js"; import type { DynamicAgentCreationConfig } from "./types.js";
export type MaybeCreateDynamicAgentResult = { export type MaybeCreateDynamicAgentResult = {

View File

@@ -1,8 +1,8 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk";
import fs from "fs"; import fs from "fs";
import os from "os"; import os from "os";
import path from "path"; import path from "path";
import { Readable } from "stream"; import { Readable } from "stream";
import type { ClawdbotConfig } from "openclaw/plugin-sdk";
import { resolveFeishuAccount } from "./accounts.js"; import { resolveFeishuAccount } from "./accounts.js";
import { createFeishuClient } from "./client.js"; import { createFeishuClient } from "./client.js";
import { getFeishuRuntime } from "./runtime.js"; import { getFeishuRuntime } from "./runtime.js";

View File

@@ -1,16 +1,16 @@
import * as Lark from "@larksuiteoapi/node-sdk";
import * as http from "http"; import * as http from "http";
import * as Lark from "@larksuiteoapi/node-sdk";
import { import {
type ClawdbotConfig, type ClawdbotConfig,
type RuntimeEnv, type RuntimeEnv,
type HistoryEntry, type HistoryEntry,
installRequestBodyLimitGuard, installRequestBodyLimitGuard,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { ResolvedFeishuAccount } from "./types.js";
import { resolveFeishuAccount, listEnabledFeishuAccounts } from "./accounts.js"; import { resolveFeishuAccount, listEnabledFeishuAccounts } from "./accounts.js";
import { handleFeishuMessage, type FeishuMessageEvent, type FeishuBotAddedEvent } from "./bot.js"; import { handleFeishuMessage, type FeishuMessageEvent, type FeishuBotAddedEvent } from "./bot.js";
import { createFeishuWSClient, createEventDispatcher } from "./client.js"; import { createFeishuWSClient, createEventDispatcher } from "./client.js";
import { probeFeishu } from "./probe.js"; import { probeFeishu } from "./probe.js";
import type { ResolvedFeishuAccount } from "./types.js";
export type MonitorFeishuOpts = { export type MonitorFeishuOpts = {
config?: ClawdbotConfig; config?: ClawdbotConfig;

View File

@@ -6,9 +6,9 @@ import type {
WizardPrompter, WizardPrompter,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import { addWildcardAllowFrom, DEFAULT_ACCOUNT_ID, formatDocsLink } from "openclaw/plugin-sdk"; import { addWildcardAllowFrom, DEFAULT_ACCOUNT_ID, formatDocsLink } from "openclaw/plugin-sdk";
import type { FeishuConfig } from "./types.js";
import { resolveFeishuCredentials } from "./accounts.js"; import { resolveFeishuCredentials } from "./accounts.js";
import { probeFeishu } from "./probe.js"; import { probeFeishu } from "./probe.js";
import type { FeishuConfig } from "./types.js";
const channel = "feishu" as const; const channel = "feishu" as const;

View File

@@ -1,5 +1,5 @@
import type { FeishuProbeResult } from "./types.js";
import { createFeishuClient, type FeishuClientCredentials } from "./client.js"; import { createFeishuClient, type FeishuClientCredentials } from "./client.js";
import type { FeishuProbeResult } from "./types.js";
export async function probeFeishu(creds?: FeishuClientCredentials): Promise<FeishuProbeResult> { export async function probeFeishu(creds?: FeishuClientCredentials): Promise<FeishuProbeResult> {
if (!creds?.appId || !creds?.appSecret) { if (!creds?.appId || !creds?.appSecret) {

View File

@@ -6,9 +6,9 @@ import {
type ReplyPayload, type ReplyPayload,
type RuntimeEnv, type RuntimeEnv,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { MentionTarget } from "./mention.js";
import { resolveFeishuAccount } from "./accounts.js"; import { resolveFeishuAccount } from "./accounts.js";
import { createFeishuClient } from "./client.js"; import { createFeishuClient } from "./client.js";
import type { MentionTarget } from "./mention.js";
import { buildMentionedCardContent } from "./mention.js"; import { buildMentionedCardContent } from "./mention.js";
import { getFeishuRuntime } from "./runtime.js"; import { getFeishuRuntime } from "./runtime.js";
import { sendMarkdownCardFeishu, sendMessageFeishu } from "./send.js"; import { sendMarkdownCardFeishu, sendMessageFeishu } from "./send.js";

View File

@@ -1,12 +1,12 @@
import type { ClawdbotConfig } from "openclaw/plugin-sdk"; import type { ClawdbotConfig } from "openclaw/plugin-sdk";
import type { MentionTarget } from "./mention.js";
import type { FeishuSendResult, ResolvedFeishuAccount } from "./types.js";
import { resolveFeishuAccount } from "./accounts.js"; import { resolveFeishuAccount } from "./accounts.js";
import { createFeishuClient } from "./client.js"; import { createFeishuClient } from "./client.js";
import type { MentionTarget } from "./mention.js";
import { buildMentionedMessage, buildMentionedCardContent } from "./mention.js"; import { buildMentionedMessage, buildMentionedCardContent } from "./mention.js";
import { getFeishuRuntime } from "./runtime.js"; import { getFeishuRuntime } from "./runtime.js";
import { assertFeishuMessageApiSuccess, toFeishuSendResult } from "./send-result.js"; import { assertFeishuMessageApiSuccess, toFeishuSendResult } from "./send-result.js";
import { resolveReceiveIdType, normalizeFeishuTarget } from "./targets.js"; import { resolveReceiveIdType, normalizeFeishuTarget } from "./targets.js";
import type { FeishuSendResult, ResolvedFeishuAccount } from "./types.js";
export type FeishuMessageInfo = { export type FeishuMessageInfo = {
messageId: string; messageId: string;

View File

@@ -1,7 +1,7 @@
import crypto from "node:crypto"; import crypto from "node:crypto";
import type { ResolvedGoogleChatAccount } from "./accounts.js"; import type { ResolvedGoogleChatAccount } from "./accounts.js";
import type { GoogleChatReaction } from "./types.js";
import { getGoogleChatAccessToken } from "./auth.js"; import { getGoogleChatAccessToken } from "./auth.js";
import type { GoogleChatReaction } from "./types.js";
const CHAT_API_BASE = "https://chat.googleapis.com/v1"; const CHAT_API_BASE = "https://chat.googleapis.com/v1";
const CHAT_UPLOAD_BASE = "https://chat.googleapis.com/upload/v1"; const CHAT_UPLOAD_BASE = "https://chat.googleapis.com/upload/v1";

View File

@@ -10,14 +10,6 @@ import {
requestBodyErrorToText, requestBodyErrorToText,
resolveMentionGatingWithBypass, resolveMentionGatingWithBypass,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type {
GoogleChatAnnotation,
GoogleChatAttachment,
GoogleChatEvent,
GoogleChatSpace,
GoogleChatMessage,
GoogleChatUser,
} from "./types.js";
import { type ResolvedGoogleChatAccount } from "./accounts.js"; import { type ResolvedGoogleChatAccount } from "./accounts.js";
import { import {
downloadGoogleChatMedia, downloadGoogleChatMedia,
@@ -27,6 +19,14 @@ import {
} from "./api.js"; } from "./api.js";
import { verifyGoogleChatRequest, type GoogleChatAudienceType } from "./auth.js"; import { verifyGoogleChatRequest, type GoogleChatAudienceType } from "./auth.js";
import { getGoogleChatRuntime } from "./runtime.js"; import { getGoogleChatRuntime } from "./runtime.js";
import type {
GoogleChatAnnotation,
GoogleChatAttachment,
GoogleChatEvent,
GoogleChatSpace,
GoogleChatMessage,
GoogleChatUser,
} from "./types.js";
export type GoogleChatRuntimeEnv = { export type GoogleChatRuntimeEnv = {
log?: (message: string) => void; log?: (message: string) => void;

View File

@@ -1,9 +1,9 @@
import { EventEmitter } from "node:events";
import type { IncomingMessage } from "node:http"; import type { IncomingMessage } from "node:http";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk"; import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import { EventEmitter } from "node:events";
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import type { ResolvedGoogleChatAccount } from "./accounts.js";
import { createMockServerResponse } from "../../../src/test-utils/mock-http-response.js"; import { createMockServerResponse } from "../../../src/test-utils/mock-http-response.js";
import type { ResolvedGoogleChatAccount } from "./accounts.js";
import { verifyGoogleChatRequest } from "./auth.js"; import { verifyGoogleChatRequest } from "./auth.js";
import { handleGoogleChatWebhookRequest, registerGoogleChatWebhookTarget } from "./monitor.js"; import { handleGoogleChatWebhookRequest, registerGoogleChatWebhookTarget } from "./monitor.js";

View File

@@ -8,7 +8,6 @@ import {
deleteAccountFromConfigSection, deleteAccountFromConfigSection,
type ChannelPlugin, type ChannelPlugin,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig, IrcProbe } from "./types.js";
import { import {
listIrcAccountIds, listIrcAccountIds,
resolveDefaultIrcAccountId, resolveDefaultIrcAccountId,
@@ -28,6 +27,7 @@ import { resolveIrcGroupMatch, resolveIrcRequireMention } from "./policy.js";
import { probeIrc } from "./probe.js"; import { probeIrc } from "./probe.js";
import { getIrcRuntime } from "./runtime.js"; import { getIrcRuntime } from "./runtime.js";
import { sendMessageIrc } from "./send.js"; import { sendMessageIrc } from "./send.js";
import type { CoreConfig, IrcProbe } from "./types.js";
const meta = getChatChannelMeta("irc"); const meta = getChatChannelMeta("irc");

View File

@@ -6,7 +6,6 @@ import {
type RuntimeEnv, type RuntimeEnv,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { ResolvedIrcAccount } from "./accounts.js"; import type { ResolvedIrcAccount } from "./accounts.js";
import type { CoreConfig, IrcInboundMessage } from "./types.js";
import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js"; import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js";
import { import {
resolveIrcMentionGate, resolveIrcMentionGate,
@@ -17,6 +16,7 @@ import {
} from "./policy.js"; } from "./policy.js";
import { getIrcRuntime } from "./runtime.js"; import { getIrcRuntime } from "./runtime.js";
import { sendMessageIrc } from "./send.js"; import { sendMessageIrc } from "./send.js";
import type { CoreConfig, IrcInboundMessage } from "./types.js";
const CHANNEL_ID = "irc" as const; const CHANNEL_ID = "irc" as const;

View File

@@ -1,5 +1,4 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk"; import type { RuntimeEnv } from "openclaw/plugin-sdk";
import type { CoreConfig, IrcInboundMessage } from "./types.js";
import { resolveIrcAccount } from "./accounts.js"; import { resolveIrcAccount } from "./accounts.js";
import { connectIrcClient, type IrcClient } from "./client.js"; import { connectIrcClient, type IrcClient } from "./client.js";
import { buildIrcConnectOptions } from "./connect-options.js"; import { buildIrcConnectOptions } from "./connect-options.js";
@@ -7,6 +6,7 @@ import { handleIrcInbound } from "./inbound.js";
import { isChannelTarget } from "./normalize.js"; import { isChannelTarget } from "./normalize.js";
import { makeIrcMessageId } from "./protocol.js"; import { makeIrcMessageId } from "./protocol.js";
import { getIrcRuntime } from "./runtime.js"; import { getIrcRuntime } from "./runtime.js";
import type { CoreConfig, IrcInboundMessage } from "./types.js";
export type IrcMonitorOptions = { export type IrcMonitorOptions = {
accountId?: string; accountId?: string;

View File

@@ -1,5 +1,5 @@
import type { IrcInboundMessage } from "./types.js";
import { hasIrcControlChars } from "./control-chars.js"; import { hasIrcControlChars } from "./control-chars.js";
import type { IrcInboundMessage } from "./types.js";
const IRC_TARGET_PATTERN = /^[^\s:]+$/u; const IRC_TARGET_PATTERN = /^[^\s:]+$/u;

View File

@@ -1,7 +1,7 @@
import type { RuntimeEnv, WizardPrompter } from "openclaw/plugin-sdk"; import type { RuntimeEnv, WizardPrompter } from "openclaw/plugin-sdk";
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
import type { CoreConfig } from "./types.js";
import { ircOnboardingAdapter } from "./onboarding.js"; import { ircOnboardingAdapter } from "./onboarding.js";
import type { CoreConfig } from "./types.js";
const selectFirstOption = async <T>(params: { options: Array<{ value: T }> }): Promise<T> => { const selectFirstOption = async <T>(params: { options: Array<{ value: T }> }): Promise<T> => {
const first = params.options[0]; const first = params.options[0];

View File

@@ -9,13 +9,13 @@ import {
type DmPolicy, type DmPolicy,
type WizardPrompter, type WizardPrompter,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig, IrcAccountConfig, IrcNickServConfig } from "./types.js";
import { listIrcAccountIds, resolveDefaultIrcAccountId, resolveIrcAccount } from "./accounts.js"; import { listIrcAccountIds, resolveDefaultIrcAccountId, resolveIrcAccount } from "./accounts.js";
import { import {
isChannelTarget, isChannelTarget,
normalizeIrcAllowEntry, normalizeIrcAllowEntry,
normalizeIrcMessagingTarget, normalizeIrcMessagingTarget,
} from "./normalize.js"; } from "./normalize.js";
import type { CoreConfig, IrcAccountConfig, IrcNickServConfig } from "./types.js";
const channel = "irc" as const; const channel = "irc" as const;

View File

@@ -1,6 +1,6 @@
import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js";
import type { IrcAccountConfig, IrcChannelConfig } from "./types.js"; import type { IrcAccountConfig, IrcChannelConfig } from "./types.js";
import type { IrcInboundMessage } from "./types.js"; import type { IrcInboundMessage } from "./types.js";
import { normalizeIrcAllowlist, resolveIrcAllowlistMatch } from "./normalize.js";
export type IrcGroupMatch = { export type IrcGroupMatch = {
allowed: boolean; allowed: boolean;

View File

@@ -1,7 +1,7 @@
import type { CoreConfig, IrcProbe } from "./types.js";
import { resolveIrcAccount } from "./accounts.js"; import { resolveIrcAccount } from "./accounts.js";
import { connectIrcClient } from "./client.js"; import { connectIrcClient } from "./client.js";
import { buildIrcConnectOptions } from "./connect-options.js"; import { buildIrcConnectOptions } from "./connect-options.js";
import type { CoreConfig, IrcProbe } from "./types.js";
function formatError(err: unknown): string { function formatError(err: unknown): string {
if (err instanceof Error) { if (err instanceof Error) {

View File

@@ -1,11 +1,11 @@
import type { IrcClient } from "./client.js";
import type { CoreConfig } from "./types.js";
import { resolveIrcAccount } from "./accounts.js"; import { resolveIrcAccount } from "./accounts.js";
import type { IrcClient } from "./client.js";
import { connectIrcClient } from "./client.js"; import { connectIrcClient } from "./client.js";
import { buildIrcConnectOptions } from "./connect-options.js"; import { buildIrcConnectOptions } from "./connect-options.js";
import { normalizeIrcMessagingTarget } from "./normalize.js"; import { normalizeIrcMessagingTarget } from "./normalize.js";
import { makeIrcMessageId } from "./protocol.js"; import { makeIrcMessageId } from "./protocol.js";
import { getIrcRuntime } from "./runtime.js"; import { getIrcRuntime } from "./runtime.js";
import type { CoreConfig } from "./types.js";
type SendIrcOptions = { type SendIrcOptions = {
accountId?: string; accountId?: string;

View File

@@ -1,8 +1,8 @@
import { Type } from "@sinclair/typebox";
import Ajv from "ajv";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import { Type } from "@sinclair/typebox";
import Ajv from "ajv";
// NOTE: This extension is intended to be bundled with OpenClaw. // NOTE: This extension is intended to be bundled with OpenClaw.
// When running from source (tests/dev), OpenClaw internals live under src/. // When running from source (tests/dev), OpenClaw internals live under src/.
// When running from a built install, internals live under dist/ (no src/ tree). // When running from a built install, internals live under dist/ (no src/ tree).

View File

@@ -1,7 +1,7 @@
import { Type } from "@sinclair/typebox";
import { spawn } from "node:child_process"; import { spawn } from "node:child_process";
import fs from "node:fs"; import fs from "node:fs";
import path from "node:path"; import path from "node:path";
import { Type } from "@sinclair/typebox";
import type { OpenClawPluginApi } from "../../../src/plugins/types.js"; import type { OpenClawPluginApi } from "../../../src/plugins/types.js";
type LobsterEnvelope = type LobsterEnvelope =

View File

@@ -7,9 +7,9 @@ import {
type ChannelMessageActionName, type ChannelMessageActionName,
type ChannelToolSend, type ChannelToolSend,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { resolveMatrixAccount } from "./matrix/accounts.js"; import { resolveMatrixAccount } from "./matrix/accounts.js";
import { handleMatrixAction } from "./tool-actions.js"; import { handleMatrixAction } from "./tool-actions.js";
import type { CoreConfig } from "./types.js";
export const matrixMessageActions: ChannelMessageActionAdapter = { export const matrixMessageActions: ChannelMessageActionAdapter = {
listActions: ({ cfg }) => { listActions: ({ cfg }) => {

View File

@@ -1,8 +1,8 @@
import type { PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk"; import type { PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk";
import { beforeEach, describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vitest";
import type { CoreConfig } from "./types.js";
import { matrixPlugin } from "./channel.js"; import { matrixPlugin } from "./channel.js";
import { setMatrixRuntime } from "./runtime.js"; import { setMatrixRuntime } from "./runtime.js";
import type { CoreConfig } from "./types.js";
vi.mock("@vector-im/matrix-bot-sdk", () => ({ vi.mock("@vector-im/matrix-bot-sdk", () => ({
ConsoleLogger: class { ConsoleLogger: class {

View File

@@ -9,7 +9,6 @@ import {
setAccountEnabledInConfigSection, setAccountEnabledInConfigSection,
type ChannelPlugin, type ChannelPlugin,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { matrixMessageActions } from "./actions.js"; import { matrixMessageActions } from "./actions.js";
import { MatrixConfigSchema } from "./config-schema.js"; import { MatrixConfigSchema } from "./config-schema.js";
import { listMatrixDirectoryGroupsLive, listMatrixDirectoryPeersLive } from "./directory-live.js"; import { listMatrixDirectoryGroupsLive, listMatrixDirectoryPeersLive } from "./directory-live.js";
@@ -31,6 +30,7 @@ import { sendMessageMatrix } from "./matrix/send.js";
import { matrixOnboardingAdapter } from "./onboarding.js"; import { matrixOnboardingAdapter } from "./onboarding.js";
import { matrixOutbound } from "./outbound.js"; import { matrixOutbound } from "./outbound.js";
import { resolveMatrixTargets } from "./resolve-targets.js"; import { resolveMatrixTargets } from "./resolve-targets.js";
import type { CoreConfig } from "./types.js";
// Mutex for serializing account startup (workaround for concurrent dynamic import race condition) // Mutex for serializing account startup (workaround for concurrent dynamic import race condition)
let matrixStartupLock: Promise<void> = Promise.resolve(); let matrixStartupLock: Promise<void> = Promise.resolve();

View File

@@ -1,7 +1,7 @@
import type { ChannelGroupContext, GroupToolPolicyConfig } from "openclaw/plugin-sdk"; import type { ChannelGroupContext, GroupToolPolicyConfig } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { resolveMatrixAccountConfig } from "./matrix/accounts.js"; import { resolveMatrixAccountConfig } from "./matrix/accounts.js";
import { resolveMatrixRoomConfig } from "./matrix/monitor/rooms.js"; import { resolveMatrixRoomConfig } from "./matrix/monitor/rooms.js";
import type { CoreConfig } from "./types.js";
function stripLeadingPrefixCaseInsensitive(value: string, prefix: string): string { function stripLeadingPrefixCaseInsensitive(value: string, prefix: string): string {
return value.toLowerCase().startsWith(prefix.toLowerCase()) return value.toLowerCase().startsWith(prefix.toLowerCase())

View File

@@ -1,10 +1,10 @@
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { CoreConfig } from "../../types.js";
import type { MatrixActionClient, MatrixActionClientOpts } from "./types.js";
import { getMatrixRuntime } from "../../runtime.js"; import { getMatrixRuntime } from "../../runtime.js";
import type { CoreConfig } from "../../types.js";
import { getActiveMatrixClient } from "../active-client.js"; import { getActiveMatrixClient } from "../active-client.js";
import { createPreparedMatrixClient } from "../client-bootstrap.js"; import { createPreparedMatrixClient } from "../client-bootstrap.js";
import { isBunRuntime, resolveMatrixAuth, resolveSharedMatrixClient } from "../client.js"; import { isBunRuntime, resolveMatrixAuth, resolveSharedMatrixClient } from "../client.js";
import type { MatrixActionClient, MatrixActionClientOpts } from "./types.js";
export function ensureNodeRuntime() { export function ensureNodeRuntime() {
if (isBunRuntime()) { if (isBunRuntime()) {

View File

@@ -1,9 +1,9 @@
import { MatrixClient } from "@vector-im/matrix-bot-sdk"; import { MatrixClient } from "@vector-im/matrix-bot-sdk";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { CoreConfig } from "../../types.js";
import type { MatrixAuth, MatrixResolvedConfig } from "./types.js";
import { getMatrixRuntime } from "../../runtime.js"; import { getMatrixRuntime } from "../../runtime.js";
import type { CoreConfig } from "../../types.js";
import { ensureMatrixSdkLoggingConfigured } from "./logging.js"; import { ensureMatrixSdkLoggingConfigured } from "./logging.js";
import type { MatrixAuth, MatrixResolvedConfig } from "./types.js";
function clean(value?: string): string { function clean(value?: string): string {
return value?.trim() ?? ""; return value?.trim() ?? "";

View File

@@ -1,3 +1,4 @@
import fs from "node:fs";
import type { IStorageProvider, ICryptoStorageProvider } from "@vector-im/matrix-bot-sdk"; import type { IStorageProvider, ICryptoStorageProvider } from "@vector-im/matrix-bot-sdk";
import { import {
LogService, LogService,
@@ -5,7 +6,6 @@ import {
SimpleFsStorageProvider, SimpleFsStorageProvider,
RustSdkCryptoStorageProvider, RustSdkCryptoStorageProvider,
} from "@vector-im/matrix-bot-sdk"; } from "@vector-im/matrix-bot-sdk";
import fs from "node:fs";
import { ensureMatrixSdkLoggingConfigured } from "./logging.js"; import { ensureMatrixSdkLoggingConfigured } from "./logging.js";
import { import {
maybeMigrateLegacyStorage, maybeMigrateLegacyStorage,

View File

@@ -2,10 +2,10 @@ import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import { LogService } from "@vector-im/matrix-bot-sdk"; import { LogService } from "@vector-im/matrix-bot-sdk";
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { CoreConfig } from "../../types.js"; import type { CoreConfig } from "../../types.js";
import type { MatrixAuth } from "./types.js";
import { resolveMatrixAuth } from "./config.js"; import { resolveMatrixAuth } from "./config.js";
import { createMatrixClient } from "./create-client.js"; import { createMatrixClient } from "./create-client.js";
import { DEFAULT_ACCOUNT_KEY } from "./storage.js"; import { DEFAULT_ACCOUNT_KEY } from "./storage.js";
import type { MatrixAuth } from "./types.js";
type SharedMatrixClientState = { type SharedMatrixClientState = {
client: MatrixClient; client: MatrixClient;

View File

@@ -2,8 +2,8 @@ import crypto from "node:crypto";
import fs from "node:fs"; import fs from "node:fs";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import type { MatrixStoragePaths } from "./types.js";
import { getMatrixRuntime } from "../../runtime.js"; import { getMatrixRuntime } from "../../runtime.js";
import type { MatrixStoragePaths } from "./types.js";
export const DEFAULT_ACCOUNT_KEY = "default"; export const DEFAULT_ACCOUNT_KEY = "default";
const STORAGE_META_FILENAME = "storage-meta.json"; const STORAGE_META_FILENAME = "storage-meta.json";

View File

@@ -1,8 +1,8 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import fs from "node:fs"; import fs from "node:fs";
import { createRequire } from "node:module"; import { createRequire } from "node:module";
import path from "node:path"; import path from "node:path";
import { fileURLToPath } from "node:url"; import { fileURLToPath } from "node:url";
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import { getMatrixRuntime } from "../runtime.js"; import { getMatrixRuntime } from "../runtime.js";
const MATRIX_SDK_PACKAGE = "@vector-im/matrix-bot-sdk"; const MATRIX_SDK_PACKAGE = "@vector-im/matrix-bot-sdk";

View File

@@ -1,8 +1,8 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk"; import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import { AutojoinRoomsMixin } from "@vector-im/matrix-bot-sdk"; import { AutojoinRoomsMixin } from "@vector-im/matrix-bot-sdk";
import type { CoreConfig } from "../../types.js"; import type { RuntimeEnv } from "openclaw/plugin-sdk";
import { getMatrixRuntime } from "../../runtime.js"; import { getMatrixRuntime } from "../../runtime.js";
import type { CoreConfig } from "../../types.js";
export function registerMatrixAutoJoin(params: { export function registerMatrixAutoJoin(params: {
client: MatrixClient; client: MatrixClient;

View File

@@ -11,7 +11,6 @@ import {
type RuntimeLogger, type RuntimeLogger,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig, MatrixRoomConfig, ReplyToMode } from "../../types.js"; import type { CoreConfig, MatrixRoomConfig, ReplyToMode } from "../../types.js";
import type { MatrixRawEvent, RoomMessageEventContent } from "./types.js";
import { fetchEventSummary } from "../actions/summary.js"; import { fetchEventSummary } from "../actions/summary.js";
import { import {
formatPollAsText, formatPollAsText,
@@ -36,6 +35,7 @@ import { resolveMentions } from "./mentions.js";
import { deliverMatrixReplies } from "./replies.js"; import { deliverMatrixReplies } from "./replies.js";
import { resolveMatrixRoomConfig } from "./rooms.js"; import { resolveMatrixRoomConfig } from "./rooms.js";
import { resolveMatrixThreadRootId, resolveMatrixThreadTarget } from "./threads.js"; import { resolveMatrixThreadRootId, resolveMatrixThreadTarget } from "./threads.js";
import type { MatrixRawEvent, RoomMessageEventContent } from "./types.js";
import { EventType, RelationType } from "./types.js"; import { EventType, RelationType } from "./types.js";
export type MatrixMonitorHandlerParams = { export type MatrixMonitorHandlerParams = {

View File

@@ -1,8 +1,8 @@
import { format } from "node:util"; import { format } from "node:util";
import { mergeAllowlist, summarizeMapping, type RuntimeEnv } from "openclaw/plugin-sdk"; import { mergeAllowlist, summarizeMapping, type RuntimeEnv } from "openclaw/plugin-sdk";
import type { CoreConfig, ReplyToMode } from "../../types.js";
import { resolveMatrixTargets } from "../../resolve-targets.js"; import { resolveMatrixTargets } from "../../resolve-targets.js";
import { getMatrixRuntime } from "../../runtime.js"; import { getMatrixRuntime } from "../../runtime.js";
import type { CoreConfig, ReplyToMode } from "../../types.js";
import { resolveMatrixAccount } from "../accounts.js"; import { resolveMatrixAccount } from "../accounts.js";
import { setActiveMatrixClient } from "../active-client.js"; import { setActiveMatrixClient } from "../active-client.js";
import { import {

View File

@@ -1,7 +1,7 @@
import type { MatrixClient } from "@vector-im/matrix-bot-sdk"; import type { MatrixClient } from "@vector-im/matrix-bot-sdk";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { CoreConfig } from "../../types.js";
import { getMatrixRuntime } from "../../runtime.js"; import { getMatrixRuntime } from "../../runtime.js";
import type { CoreConfig } from "../../types.js";
import { getActiveMatrixClient, getAnyActiveMatrixClient } from "../active-client.js"; import { getActiveMatrixClient, getAnyActiveMatrixClient } from "../active-client.js";
import { createPreparedMatrixClient } from "../client-bootstrap.js"; import { createPreparedMatrixClient } from "../client-bootstrap.js";
import { isBunRuntime, resolveMatrixAuth, resolveSharedMatrixClient } from "../client.js"; import { isBunRuntime, resolveMatrixAuth, resolveSharedMatrixClient } from "../client.js";

View File

@@ -8,11 +8,11 @@ import {
type ChannelOnboardingDmPolicy, type ChannelOnboardingDmPolicy,
type WizardPrompter, type WizardPrompter,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { listMatrixDirectoryGroupsLive } from "./directory-live.js"; import { listMatrixDirectoryGroupsLive } from "./directory-live.js";
import { resolveMatrixAccount } from "./matrix/accounts.js"; import { resolveMatrixAccount } from "./matrix/accounts.js";
import { ensureMatrixSdkInstalled, isMatrixSdkAvailable } from "./matrix/deps.js"; import { ensureMatrixSdkInstalled, isMatrixSdkAvailable } from "./matrix/deps.js";
import { resolveMatrixTargets } from "./resolve-targets.js"; import { resolveMatrixTargets } from "./resolve-targets.js";
import type { CoreConfig } from "./types.js";
const channel = "matrix" as const; const channel = "matrix" as const;

View File

@@ -6,7 +6,6 @@ import {
readReactionParams, readReactionParams,
readStringParam, readStringParam,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { import {
deleteMatrixMessage, deleteMatrixMessage,
editMatrixMessage, editMatrixMessage,
@@ -21,6 +20,7 @@ import {
unpinMatrixMessage, unpinMatrixMessage,
} from "./matrix/actions.js"; } from "./matrix/actions.js";
import { reactMatrixMessage } from "./matrix/send.js"; import { reactMatrixMessage } from "./matrix/send.js";
import type { CoreConfig } from "./types.js";
const messageActions = new Set(["sendMessage", "editMessage", "deleteMessage", "readMessages"]); const messageActions = new Set(["sendMessage", "editMessage", "deleteMessage", "readMessages"]);
const reactionActions = new Set(["react", "reactions"]); const reactionActions = new Set(["react", "reactions"]);

View File

@@ -6,11 +6,11 @@
* Provides seamless auto-recall and auto-capture via lifecycle hooks. * Provides seamless auto-recall and auto-capture via lifecycle hooks.
*/ */
import type * as LanceDB from "@lancedb/lancedb";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { Type } from "@sinclair/typebox";
import { randomUUID } from "node:crypto"; import { randomUUID } from "node:crypto";
import type * as LanceDB from "@lancedb/lancedb";
import { Type } from "@sinclair/typebox";
import OpenAI from "openai"; import OpenAI from "openai";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { import {
DEFAULT_CAPTURE_MAX_CHARS, DEFAULT_CAPTURE_MAX_CHARS,
MEMORY_CATEGORIES, MEMORY_CATEGORIES,

View File

@@ -1,8 +1,3 @@
import type {
MSTeamsAccessTokenProvider,
MSTeamsAttachmentLike,
MSTeamsInboundMedia,
} from "./types.js";
import { getMSTeamsRuntime } from "../runtime.js"; import { getMSTeamsRuntime } from "../runtime.js";
import { import {
extractInlineImageCandidates, extractInlineImageCandidates,
@@ -14,6 +9,11 @@ import {
resolveAuthAllowedHosts, resolveAuthAllowedHosts,
resolveAllowedHosts, resolveAllowedHosts,
} from "./shared.js"; } from "./shared.js";
import type {
MSTeamsAccessTokenProvider,
MSTeamsAttachmentLike,
MSTeamsInboundMedia,
} from "./types.js";
type DownloadCandidate = { type DownloadCandidate = {
url: string; url: string;

View File

@@ -1,9 +1,3 @@
import type {
MSTeamsAccessTokenProvider,
MSTeamsAttachmentLike,
MSTeamsGraphMediaResult,
MSTeamsInboundMedia,
} from "./types.js";
import { getMSTeamsRuntime } from "../runtime.js"; import { getMSTeamsRuntime } from "../runtime.js";
import { downloadMSTeamsAttachments } from "./download.js"; import { downloadMSTeamsAttachments } from "./download.js";
import { import {
@@ -13,6 +7,12 @@ import {
normalizeContentType, normalizeContentType,
resolveAllowedHosts, resolveAllowedHosts,
} from "./shared.js"; } from "./shared.js";
import type {
MSTeamsAccessTokenProvider,
MSTeamsAttachmentLike,
MSTeamsGraphMediaResult,
MSTeamsInboundMedia,
} from "./types.js";
type GraphHostedContent = { type GraphHostedContent = {
id?: string | null; id?: string | null;

View File

@@ -1,4 +1,3 @@
import type { MSTeamsAttachmentLike, MSTeamsHtmlAttachmentSummary } from "./types.js";
import { import {
ATTACHMENT_TAG_RE, ATTACHMENT_TAG_RE,
extractHtmlFromAttachment, extractHtmlFromAttachment,
@@ -7,6 +6,7 @@ import {
isLikelyImageAttachment, isLikelyImageAttachment,
safeHostForUrl, safeHostForUrl,
} from "./shared.js"; } from "./shared.js";
import type { MSTeamsAttachmentLike, MSTeamsHtmlAttachmentSummary } from "./types.js";
export function summarizeMSTeamsHtmlAttachments( export function summarizeMSTeamsHtmlAttachments(
attachments: MSTeamsAttachmentLike[] | undefined, attachments: MSTeamsAttachmentLike[] | undefined,

View File

@@ -2,8 +2,8 @@ import fs from "node:fs";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import { beforeEach, describe, expect, it } from "vitest"; import { beforeEach, describe, expect, it } from "vitest";
import type { StoredConversationReference } from "./conversation-store.js";
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js"; import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
import type { StoredConversationReference } from "./conversation-store.js";
import { setMSTeamsRuntime } from "./runtime.js"; import { setMSTeamsRuntime } from "./runtime.js";
import { msteamsRuntimeStub } from "./test-runtime.js"; import { msteamsRuntimeStub } from "./test-runtime.js";

View File

@@ -1,12 +1,12 @@
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk"; import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk";
import type { MSTeamsConversationStore } from "./conversation-store.js"; import type { MSTeamsConversationStore } from "./conversation-store.js";
import { buildFileInfoCard, parseFileConsentInvoke, uploadToConsentUrl } from "./file-consent.js";
import type { MSTeamsAdapter } from "./messenger.js"; import type { MSTeamsAdapter } from "./messenger.js";
import { createMSTeamsMessageHandler } from "./monitor-handler/message-handler.js";
import type { MSTeamsMonitorLogger } from "./monitor-types.js"; import type { MSTeamsMonitorLogger } from "./monitor-types.js";
import { getPendingUpload, removePendingUpload } from "./pending-uploads.js";
import type { MSTeamsPollStore } from "./polls.js"; import type { MSTeamsPollStore } from "./polls.js";
import type { MSTeamsTurnContext } from "./sdk-types.js"; import type { MSTeamsTurnContext } from "./sdk-types.js";
import { buildFileInfoCard, parseFileConsentInvoke, uploadToConsentUrl } from "./file-consent.js";
import { createMSTeamsMessageHandler } from "./monitor-handler/message-handler.js";
import { getPendingUpload, removePendingUpload } from "./pending-uploads.js";
export type MSTeamsAccessTokenProvider = { export type MSTeamsAccessTokenProvider = {
getAccessToken: (scope: string) => Promise<string>; getAccessToken: (scope: string) => Promise<string>;

View File

@@ -1,4 +1,3 @@
import type { MSTeamsTurnContext } from "../sdk-types.js";
import { import {
buildMSTeamsGraphMessageUrls, buildMSTeamsGraphMessageUrls,
downloadMSTeamsAttachments, downloadMSTeamsAttachments,
@@ -8,6 +7,7 @@ import {
type MSTeamsHtmlAttachmentSummary, type MSTeamsHtmlAttachmentSummary,
type MSTeamsInboundMedia, type MSTeamsInboundMedia,
} from "../attachments.js"; } from "../attachments.js";
import type { MSTeamsTurnContext } from "../sdk-types.js";
type MSTeamsLogger = { type MSTeamsLogger = {
debug?: (message: string, meta?: Record<string, unknown>) => void; debug?: (message: string, meta?: Record<string, unknown>) => void;

View File

@@ -9,15 +9,13 @@ import {
formatAllowlistMatchMeta, formatAllowlistMatchMeta,
type HistoryEntry, type HistoryEntry,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { StoredConversationReference } from "../conversation-store.js";
import type { MSTeamsMessageHandlerDeps } from "../monitor-handler.js";
import type { MSTeamsTurnContext } from "../sdk-types.js";
import { import {
buildMSTeamsAttachmentPlaceholder, buildMSTeamsAttachmentPlaceholder,
buildMSTeamsMediaPayload, buildMSTeamsMediaPayload,
type MSTeamsAttachmentLike, type MSTeamsAttachmentLike,
summarizeMSTeamsHtmlAttachments, summarizeMSTeamsHtmlAttachments,
} from "../attachments.js"; } from "../attachments.js";
import type { StoredConversationReference } from "../conversation-store.js";
import { formatUnknownError } from "../errors.js"; import { formatUnknownError } from "../errors.js";
import { import {
extractMSTeamsConversationMessageId, extractMSTeamsConversationMessageId,
@@ -26,6 +24,7 @@ import {
stripMSTeamsMentionTags, stripMSTeamsMentionTags,
wasMSTeamsBotMentioned, wasMSTeamsBotMentioned,
} from "../inbound.js"; } from "../inbound.js";
import type { MSTeamsMessageHandlerDeps } from "../monitor-handler.js";
import { import {
isMSTeamsGroupAllowed, isMSTeamsGroupAllowed,
resolveMSTeamsAllowlistMatch, resolveMSTeamsAllowlistMatch,
@@ -35,6 +34,7 @@ import {
import { extractMSTeamsPollVote } from "../polls.js"; import { extractMSTeamsPollVote } from "../polls.js";
import { createMSTeamsReplyDispatcher } from "../reply-dispatcher.js"; import { createMSTeamsReplyDispatcher } from "../reply-dispatcher.js";
import { getMSTeamsRuntime } from "../runtime.js"; import { getMSTeamsRuntime } from "../runtime.js";
import type { MSTeamsTurnContext } from "../sdk-types.js";
import { recordMSTeamsSentMessage, wasMSTeamsMessageSent } from "../sent-message-cache.js"; import { recordMSTeamsSentMessage, wasMSTeamsMessageSent } from "../sent-message-cache.js";
import { resolveMSTeamsInboundMedia } from "./inbound-media.js"; import { resolveMSTeamsInboundMedia } from "./inbound-media.js";

View File

@@ -6,10 +6,10 @@ import {
type OpenClawConfig, type OpenClawConfig,
type RuntimeEnv, type RuntimeEnv,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { MSTeamsConversationStore } from "./conversation-store.js";
import type { MSTeamsAdapter } from "./messenger.js";
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js"; import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
import type { MSTeamsConversationStore } from "./conversation-store.js";
import { formatUnknownError } from "./errors.js"; import { formatUnknownError } from "./errors.js";
import type { MSTeamsAdapter } from "./messenger.js";
import { registerMSTeamsHandlers, type MSTeamsActivityHandler } from "./monitor-handler.js"; import { registerMSTeamsHandlers, type MSTeamsActivityHandler } from "./monitor-handler.js";
import { createMSTeamsPollStoreFs, type MSTeamsPollStore } from "./polls.js"; import { createMSTeamsPollStoreFs, type MSTeamsPollStore } from "./polls.js";
import { import {

View File

@@ -9,8 +9,6 @@ import {
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js"; import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
import type { StoredConversationReference } from "./conversation-store.js"; import type { StoredConversationReference } from "./conversation-store.js";
import type { MSTeamsMonitorLogger } from "./monitor-types.js";
import type { MSTeamsTurnContext } from "./sdk-types.js";
import { import {
classifyMSTeamsSendError, classifyMSTeamsSendError,
formatMSTeamsSendErrorHint, formatMSTeamsSendErrorHint,
@@ -21,7 +19,9 @@ import {
renderReplyPayloadsToMessages, renderReplyPayloadsToMessages,
sendMSTeamsMessages, sendMSTeamsMessages,
} from "./messenger.js"; } from "./messenger.js";
import type { MSTeamsMonitorLogger } from "./monitor-types.js";
import { getMSTeamsRuntime } from "./runtime.js"; import { getMSTeamsRuntime } from "./runtime.js";
import type { MSTeamsTurnContext } from "./sdk-types.js";
export function createMSTeamsReplyDispatcher(params: { export function createMSTeamsReplyDispatcher(params: {
cfg: OpenClawConfig; cfg: OpenClawConfig;

View File

@@ -4,12 +4,12 @@ import {
type PluginRuntime, type PluginRuntime,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js"; import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
import type { import type {
MSTeamsConversationStore, MSTeamsConversationStore,
StoredConversationReference, StoredConversationReference,
} from "./conversation-store.js"; } from "./conversation-store.js";
import type { MSTeamsAdapter } from "./messenger.js"; import type { MSTeamsAdapter } from "./messenger.js";
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
import { getMSTeamsRuntime } from "./runtime.js"; import { getMSTeamsRuntime } from "./runtime.js";
import { createMSTeamsAdapter, loadMSTeamsSdkWithAuth } from "./sdk.js"; import { createMSTeamsAdapter, loadMSTeamsSdkWithAuth } from "./sdk.js";
import { resolveMSTeamsCredentials } from "./token.js"; import { resolveMSTeamsCredentials } from "./token.js";

View File

@@ -1,6 +1,6 @@
import type { PluginRuntime } from "openclaw/plugin-sdk";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import type { PluginRuntime } from "openclaw/plugin-sdk";
export const msteamsRuntimeStub = { export const msteamsRuntimeStub = {
state: { state: {

View File

@@ -10,7 +10,6 @@ import {
type OpenClawConfig, type OpenClawConfig,
type ChannelSetupInput, type ChannelSetupInput,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig } from "./types.js";
import { import {
listNextcloudTalkAccountIds, listNextcloudTalkAccountIds,
resolveDefaultNextcloudTalkAccountId, resolveDefaultNextcloudTalkAccountId,
@@ -27,6 +26,7 @@ import { nextcloudTalkOnboardingAdapter } from "./onboarding.js";
import { resolveNextcloudTalkGroupToolPolicy } from "./policy.js"; import { resolveNextcloudTalkGroupToolPolicy } from "./policy.js";
import { getNextcloudTalkRuntime } from "./runtime.js"; import { getNextcloudTalkRuntime } from "./runtime.js";
import { sendMessageNextcloudTalk } from "./send.js"; import { sendMessageNextcloudTalk } from "./send.js";
import type { CoreConfig } from "./types.js";
const meta = { const meta = {
id: "nextcloud-talk", id: "nextcloud-talk",

View File

@@ -6,7 +6,6 @@ import {
type RuntimeEnv, type RuntimeEnv,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { ResolvedNextcloudTalkAccount } from "./accounts.js"; import type { ResolvedNextcloudTalkAccount } from "./accounts.js";
import type { CoreConfig, GroupPolicy, NextcloudTalkInboundMessage } from "./types.js";
import { import {
normalizeNextcloudTalkAllowlist, normalizeNextcloudTalkAllowlist,
resolveNextcloudTalkAllowlistMatch, resolveNextcloudTalkAllowlistMatch,
@@ -18,6 +17,7 @@ import {
import { resolveNextcloudTalkRoomKind } from "./room-info.js"; import { resolveNextcloudTalkRoomKind } from "./room-info.js";
import { getNextcloudTalkRuntime } from "./runtime.js"; import { getNextcloudTalkRuntime } from "./runtime.js";
import { sendMessageNextcloudTalk } from "./send.js"; import { sendMessageNextcloudTalk } from "./send.js";
import type { CoreConfig, GroupPolicy, NextcloudTalkInboundMessage } from "./types.js";
const CHANNEL_ID = "nextcloud-talk" as const; const CHANNEL_ID = "nextcloud-talk" as const;

View File

@@ -5,16 +5,16 @@ import {
readRequestBodyWithLimit, readRequestBodyWithLimit,
requestBodyErrorToText, requestBodyErrorToText,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import { resolveNextcloudTalkAccount } from "./accounts.js";
import { handleNextcloudTalkInbound } from "./inbound.js";
import { getNextcloudTalkRuntime } from "./runtime.js";
import { extractNextcloudTalkHeaders, verifyNextcloudTalkSignature } from "./signature.js";
import type { import type {
CoreConfig, CoreConfig,
NextcloudTalkInboundMessage, NextcloudTalkInboundMessage,
NextcloudTalkWebhookPayload, NextcloudTalkWebhookPayload,
NextcloudTalkWebhookServerOptions, NextcloudTalkWebhookServerOptions,
} from "./types.js"; } from "./types.js";
import { resolveNextcloudTalkAccount } from "./accounts.js";
import { handleNextcloudTalkInbound } from "./inbound.js";
import { getNextcloudTalkRuntime } from "./runtime.js";
import { extractNextcloudTalkHeaders, verifyNextcloudTalkSignature } from "./signature.js";
const DEFAULT_WEBHOOK_PORT = 8788; const DEFAULT_WEBHOOK_PORT = 8788;
const DEFAULT_WEBHOOK_HOST = "0.0.0.0"; const DEFAULT_WEBHOOK_HOST = "0.0.0.0";

View File

@@ -10,12 +10,12 @@ import {
type OpenClawConfig, type OpenClawConfig,
type WizardPrompter, type WizardPrompter,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { CoreConfig, DmPolicy } from "./types.js";
import { import {
listNextcloudTalkAccountIds, listNextcloudTalkAccountIds,
resolveDefaultNextcloudTalkAccountId, resolveDefaultNextcloudTalkAccountId,
resolveNextcloudTalkAccount, resolveNextcloudTalkAccount,
} from "./accounts.js"; } from "./accounts.js";
import type { CoreConfig, DmPolicy } from "./types.js";
const channel = "nextcloud-talk" as const; const channel = "nextcloud-talk" as const;

View File

@@ -1,5 +1,5 @@
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import { readFileSync } from "node:fs"; import { readFileSync } from "node:fs";
import type { RuntimeEnv } from "openclaw/plugin-sdk";
import type { ResolvedNextcloudTalkAccount } from "./accounts.js"; import type { ResolvedNextcloudTalkAccount } from "./accounts.js";
const ROOM_CACHE_TTL_MS = 5 * 60 * 1000; const ROOM_CACHE_TTL_MS = 5 * 60 * 1000;

View File

@@ -1,7 +1,7 @@
import type { CoreConfig, NextcloudTalkSendResult } from "./types.js";
import { resolveNextcloudTalkAccount } from "./accounts.js"; import { resolveNextcloudTalkAccount } from "./accounts.js";
import { getNextcloudTalkRuntime } from "./runtime.js"; import { getNextcloudTalkRuntime } from "./runtime.js";
import { generateNextcloudTalkSignature } from "./signature.js"; import { generateNextcloudTalkSignature } from "./signature.js";
import type { CoreConfig, NextcloudTalkSendResult } from "./types.js";
type NextcloudTalkSendOpts = { type NextcloudTalkSendOpts = {
baseUrl?: string; baseUrl?: string;

View File

@@ -1,7 +1,7 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk"; import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
import type { NostrProfile } from "./src/config-schema.js";
import { nostrPlugin } from "./src/channel.js"; import { nostrPlugin } from "./src/channel.js";
import type { NostrProfile } from "./src/config-schema.js";
import { createNostrProfileHttpHandler } from "./src/nostr-profile-http.js"; import { createNostrProfileHttpHandler } from "./src/nostr-profile-http.js";
import { setNostrRuntime, getNostrRuntime } from "./src/runtime.js"; import { setNostrRuntime, getNostrRuntime } from "./src/runtime.js";
import { resolveNostrAccount } from "./src/types.js"; import { resolveNostrAccount } from "./src/types.js";

View File

@@ -7,10 +7,10 @@ import {
type ChannelPlugin, type ChannelPlugin,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { NostrProfile } from "./config-schema.js"; import type { NostrProfile } from "./config-schema.js";
import type { MetricEvent, MetricsSnapshot } from "./metrics.js";
import type { ProfilePublishResult } from "./nostr-profile.js";
import { NostrConfigSchema } from "./config-schema.js"; import { NostrConfigSchema } from "./config-schema.js";
import type { MetricEvent, MetricsSnapshot } from "./metrics.js";
import { normalizePubkey, startNostrBus, type NostrBusHandle } from "./nostr-bus.js"; import { normalizePubkey, startNostrBus, type NostrBusHandle } from "./nostr-bus.js";
import type { ProfilePublishResult } from "./nostr-profile.js";
import { getNostrRuntime } from "./runtime.js"; import { getNostrRuntime } from "./runtime.js";
import { import {
listNostrAccountIds, listNostrAccountIds,

View File

@@ -1,7 +1,7 @@
import type { PluginRuntime } from "openclaw/plugin-sdk";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import type { PluginRuntime } from "openclaw/plugin-sdk";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { import {
readNostrBusState, readNostrBusState,

View File

@@ -1,6 +1,6 @@
import type { OpenClawPluginApi, OpenClawPluginService } from "openclaw/plugin-sdk";
import fs from "node:fs/promises"; import fs from "node:fs/promises";
import path from "node:path"; import path from "node:path";
import type { OpenClawPluginApi, OpenClawPluginService } from "openclaw/plugin-sdk";
type ArmGroup = "camera" | "screen" | "writes" | "all"; type ArmGroup = "camera" | "screen" | "writes" | "all";

View File

@@ -1,5 +1,5 @@
import type { RuntimeEnv, ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk";
import { format } from "node:util"; import { format } from "node:util";
import type { RuntimeEnv, ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk";
import { createReplyPrefixOptions } from "openclaw/plugin-sdk"; import { createReplyPrefixOptions } from "openclaw/plugin-sdk";
import { getTlonRuntime } from "../runtime.js"; import { getTlonRuntime } from "../runtime.js";
import { normalizeShip, parseChannelNest } from "../targets.js"; import { normalizeShip, parseChannelNest } from "../targets.js";

View File

@@ -7,8 +7,8 @@ import {
type ChannelOnboardingAdapter, type ChannelOnboardingAdapter,
type WizardPrompter, type WizardPrompter,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { TlonResolvedAccount } from "./types.js";
import { buildTlonAccountFields } from "./account-fields.js"; import { buildTlonAccountFields } from "./account-fields.js";
import type { TlonResolvedAccount } from "./types.js";
import { listTlonAccountIds, resolveTlonAccount } from "./types.js"; import { listTlonAccountIds, resolveTlonAccount } from "./types.js";
import { isBlockedUrbitHostname, validateUrbitBaseUrl } from "./urbit/base-url.js"; import { isBlockedUrbitHostname, validateUrbitBaseUrl } from "./urbit/base-url.js";

View File

@@ -1,5 +1,5 @@
import type { LookupFn, SsrFPolicy } from "openclaw/plugin-sdk";
import { Readable } from "node:stream"; import { Readable } from "node:stream";
import type { LookupFn, SsrFPolicy } from "openclaw/plugin-sdk";
import { ensureUrbitChannelOpen, pokeUrbitChannel, scryUrbitPath } from "./channel-ops.js"; import { ensureUrbitChannelOpen, pokeUrbitChannel, scryUrbitPath } from "./channel-ops.js";
import { getUrbitContext, normalizeUrbitCookie } from "./context.js"; import { getUrbitContext, normalizeUrbitCookie } from "./context.js";
import { urbitFetch } from "./fetch.js"; import { urbitFetch } from "./fetch.js";

View File

@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import type { TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { checkTwitchAccessControl, extractMentions } from "./access-control.js"; import { checkTwitchAccessControl, extractMentions } from "./access-control.js";
import type { TwitchAccountConfig, TwitchChatMessage } from "./types.js";
describe("checkTwitchAccessControl", () => { describe("checkTwitchAccessControl", () => {
const mockAccount: TwitchAccountConfig = { const mockAccount: TwitchAccountConfig = {

View File

@@ -4,9 +4,9 @@
* Handles tool-based actions for Twitch, such as sending messages. * Handles tool-based actions for Twitch, such as sending messages.
*/ */
import type { ChannelMessageActionAdapter, ChannelMessageActionContext } from "./types.js";
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js"; import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import { twitchOutbound } from "./outbound.js"; import { twitchOutbound } from "./outbound.js";
import type { ChannelMessageActionAdapter, ChannelMessageActionContext } from "./types.js";
/** /**
* Create a tool result with error content. * Create a tool result with error content.

View File

@@ -5,8 +5,8 @@
* ensuring proper cleanup when accounts are stopped or reconfigured. * ensuring proper cleanup when accounts are stopped or reconfigured.
*/ */
import type { ChannelLogSink } from "./types.js";
import { TwitchClientManager } from "./twitch-client.js"; import { TwitchClientManager } from "./twitch-client.js";
import type { ChannelLogSink } from "./types.js";
/** /**
* Registry entry tracking a client manager and its associated account. * Registry entry tracking a client manager and its associated account.

View File

@@ -7,10 +7,10 @@
import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk"; import type { ReplyPayload, OpenClawConfig } from "openclaw/plugin-sdk";
import { createReplyPrefixOptions } from "openclaw/plugin-sdk"; import { createReplyPrefixOptions } from "openclaw/plugin-sdk";
import type { TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { checkTwitchAccessControl } from "./access-control.js"; import { checkTwitchAccessControl } from "./access-control.js";
import { getOrCreateClientManager } from "./client-manager-registry.js"; import { getOrCreateClientManager } from "./client-manager-registry.js";
import { getTwitchRuntime } from "./runtime.js"; import { getTwitchRuntime } from "./runtime.js";
import type { TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { stripMarkdownForTwitch } from "./utils/markdown.js"; import { stripMarkdownForTwitch } from "./utils/markdown.js";
export type TwitchRuntimeEnv = { export type TwitchRuntimeEnv = {

View File

@@ -10,8 +10,8 @@ import {
type ChannelOnboardingDmPolicy, type ChannelOnboardingDmPolicy,
type WizardPrompter, type WizardPrompter,
} from "openclaw/plugin-sdk"; } from "openclaw/plugin-sdk";
import type { TwitchAccountConfig, TwitchRole } from "./types.js";
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js"; import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import type { TwitchAccountConfig, TwitchRole } from "./types.js";
import { isAccountConfigured } from "./utils/twitch.js"; import { isAccountConfigured } from "./utils/twitch.js";
const channel = "twitch" as const; const channel = "twitch" as const;

View File

@@ -5,13 +5,13 @@
* Supports text and media (URL) sending with markdown stripping and chunking. * Supports text and media (URL) sending with markdown stripping and chunking.
*/ */
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import { sendMessageTwitchInternal } from "./send.js";
import type { import type {
ChannelOutboundAdapter, ChannelOutboundAdapter,
ChannelOutboundContext, ChannelOutboundContext,
OutboundDeliveryResult, OutboundDeliveryResult,
} from "./types.js"; } from "./types.js";
import { DEFAULT_ACCOUNT_ID, getAccountConfig } from "./config.js";
import { sendMessageTwitchInternal } from "./send.js";
import { chunkTextForTwitch } from "./utils/markdown.js"; import { chunkTextForTwitch } from "./utils/markdown.js";
import { missingTargetError, normalizeTwitchChannel } from "./utils/twitch.js"; import { missingTargetError, normalizeTwitchChannel } from "./utils/twitch.js";

View File

@@ -7,16 +7,6 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk"; import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { buildChannelConfigSchema } from "openclaw/plugin-sdk"; import { buildChannelConfigSchema } from "openclaw/plugin-sdk";
import type {
ChannelAccountSnapshot,
ChannelCapabilities,
ChannelLogSink,
ChannelMeta,
ChannelPlugin,
ChannelResolveKind,
ChannelResolveResult,
TwitchAccountConfig,
} from "./types.js";
import { twitchMessageActions } from "./actions.js"; import { twitchMessageActions } from "./actions.js";
import { removeClientManager } from "./client-manager-registry.js"; import { removeClientManager } from "./client-manager-registry.js";
import { TwitchConfigSchema } from "./config-schema.js"; import { TwitchConfigSchema } from "./config-schema.js";
@@ -27,6 +17,16 @@ import { probeTwitch } from "./probe.js";
import { resolveTwitchTargets } from "./resolver.js"; import { resolveTwitchTargets } from "./resolver.js";
import { collectTwitchStatusIssues } from "./status.js"; import { collectTwitchStatusIssues } from "./status.js";
import { resolveTwitchToken } from "./token.js"; import { resolveTwitchToken } from "./token.js";
import type {
ChannelAccountSnapshot,
ChannelCapabilities,
ChannelLogSink,
ChannelMeta,
ChannelPlugin,
ChannelResolveKind,
ChannelResolveResult,
TwitchAccountConfig,
} from "./types.js";
import { isAccountConfigured } from "./utils/twitch.js"; import { isAccountConfigured } from "./utils/twitch.js";
/** /**

View File

@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest"; import { beforeEach, describe, expect, it, vi } from "vitest";
import type { TwitchAccountConfig } from "./types.js";
import { probeTwitch } from "./probe.js"; import { probeTwitch } from "./probe.js";
import type { TwitchAccountConfig } from "./types.js";
// Mock Twurple modules - Vitest v4 compatible mocking // Mock Twurple modules - Vitest v4 compatible mocking
const mockUnbind = vi.fn(); const mockUnbind = vi.fn();

View File

@@ -1,6 +1,6 @@
import type { BaseProbeResult } from "openclaw/plugin-sdk";
import { StaticAuthProvider } from "@twurple/auth"; import { StaticAuthProvider } from "@twurple/auth";
import { ChatClient } from "@twurple/chat"; import { ChatClient } from "@twurple/chat";
import type { BaseProbeResult } from "openclaw/plugin-sdk";
import type { TwitchAccountConfig } from "./types.js"; import type { TwitchAccountConfig } from "./types.js";
import { normalizeToken } from "./utils/twitch.js"; import { normalizeToken } from "./utils/twitch.js";

View File

@@ -11,8 +11,8 @@
*/ */
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import type { ChannelAccountSnapshot } from "./types.js";
import { collectTwitchStatusIssues } from "./status.js"; import { collectTwitchStatusIssues } from "./status.js";
import type { ChannelAccountSnapshot } from "./types.js";
describe("status", () => { describe("status", () => {
describe("collectTwitchStatusIssues", () => { describe("collectTwitchStatusIssues", () => {

View File

@@ -5,9 +5,9 @@
*/ */
import type { ChannelStatusIssue } from "openclaw/plugin-sdk"; import type { ChannelStatusIssue } from "openclaw/plugin-sdk";
import type { ChannelAccountSnapshot } from "./types.js";
import { getAccountConfig } from "./config.js"; import { getAccountConfig } from "./config.js";
import { resolveTwitchToken } from "./token.js"; import { resolveTwitchToken } from "./token.js";
import type { ChannelAccountSnapshot } from "./types.js";
import { isAccountConfigured } from "./utils/twitch.js"; import { isAccountConfigured } from "./utils/twitch.js";
/** /**

View File

@@ -10,8 +10,8 @@
*/ */
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { TwitchClientManager } from "./twitch-client.js"; import { TwitchClientManager } from "./twitch-client.js";
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
// Mock @twurple dependencies // Mock @twurple dependencies
const mockConnect = vi.fn().mockResolvedValue(undefined); const mockConnect = vi.fn().mockResolvedValue(undefined);

View File

@@ -1,8 +1,8 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth"; import { RefreshingAuthProvider, StaticAuthProvider } from "@twurple/auth";
import { ChatClient, LogLevel } from "@twurple/chat"; import { ChatClient, LogLevel } from "@twurple/chat";
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js"; import type { OpenClawConfig } from "openclaw/plugin-sdk";
import { resolveTwitchToken } from "./token.js"; import { resolveTwitchToken } from "./token.js";
import type { ChannelLogSink, TwitchAccountConfig, TwitchChatMessage } from "./types.js";
import { normalizeToken } from "./utils/twitch.js"; import { normalizeToken } from "./utils/twitch.js";
/** /**

View File

@@ -1,6 +1,5 @@
import type { GatewayRequestHandlerOptions, OpenClawPluginApi } from "openclaw/plugin-sdk";
import { Type } from "@sinclair/typebox"; import { Type } from "@sinclair/typebox";
import type { CoreConfig } from "./src/core-bridge.js"; import type { GatewayRequestHandlerOptions, OpenClawPluginApi } from "openclaw/plugin-sdk";
import { registerVoiceCallCli } from "./src/cli.js"; import { registerVoiceCallCli } from "./src/cli.js";
import { import {
VoiceCallConfigSchema, VoiceCallConfigSchema,
@@ -8,6 +7,7 @@ import {
validateProviderConfig, validateProviderConfig,
type VoiceCallConfig, type VoiceCallConfig,
} from "./src/config.js"; } from "./src/config.js";
import type { CoreConfig } from "./src/core-bridge.js";
import { createVoiceCallRuntime, type VoiceCallRuntime } from "./src/runtime.js"; import { createVoiceCallRuntime, type VoiceCallRuntime } from "./src/runtime.js";
const voiceCallConfigSchema = { const voiceCallConfigSchema = {

View File

@@ -1,7 +1,7 @@
import type { Command } from "commander";
import fs from "node:fs"; import fs from "node:fs";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import type { Command } from "commander";
import { sleep } from "openclaw/plugin-sdk"; import { sleep } from "openclaw/plugin-sdk";
import type { VoiceCallConfig } from "./config.js"; import type { VoiceCallConfig } from "./config.js";
import type { VoiceCallRuntime } from "./runtime.js"; import type { VoiceCallRuntime } from "./runtime.js";

View File

@@ -1,6 +1,8 @@
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { VoiceCallConfigSchema } from "./config.js";
import { CallManager } from "./manager.js";
import type { VoiceCallProvider } from "./providers/base.js"; import type { VoiceCallProvider } from "./providers/base.js";
import type { import type {
HangupCallInput, HangupCallInput,
@@ -13,8 +15,6 @@ import type {
WebhookContext, WebhookContext,
WebhookVerificationResult, WebhookVerificationResult,
} from "./types.js"; } from "./types.js";
import { VoiceCallConfigSchema } from "./config.js";
import { CallManager } from "./manager.js";
class FakeProvider implements VoiceCallProvider { class FakeProvider implements VoiceCallProvider {
readonly name = "plivo" as const; readonly name = "plivo" as const;

View File

@@ -3,8 +3,6 @@ import os from "node:os";
import path from "node:path"; import path from "node:path";
import type { VoiceCallConfig } from "./config.js"; import type { VoiceCallConfig } from "./config.js";
import type { CallManagerContext } from "./manager/context.js"; import type { CallManagerContext } from "./manager/context.js";
import type { VoiceCallProvider } from "./providers/base.js";
import type { CallId, CallRecord, NormalizedEvent, OutboundCallOptions } from "./types.js";
import { processEvent as processManagerEvent } from "./manager/events.js"; import { processEvent as processManagerEvent } from "./manager/events.js";
import { getCallByProviderCallId as getCallByProviderCallIdFromMaps } from "./manager/lookup.js"; import { getCallByProviderCallId as getCallByProviderCallIdFromMaps } from "./manager/lookup.js";
import { import {
@@ -15,6 +13,8 @@ import {
speakInitialMessage as speakInitialMessageWithContext, speakInitialMessage as speakInitialMessageWithContext,
} from "./manager/outbound.js"; } from "./manager/outbound.js";
import { getCallHistoryFromStore, loadActiveCallsFromStore } from "./manager/store.js"; import { getCallHistoryFromStore, loadActiveCallsFromStore } from "./manager/store.js";
import type { VoiceCallProvider } from "./providers/base.js";
import type { CallId, CallRecord, NormalizedEvent, OutboundCallOptions } from "./types.js";
import { resolveUserPath } from "./utils.js"; import { resolveUserPath } from "./utils.js";
function resolveDefaultStoreBase(config: VoiceCallConfig, storePath?: string): string { function resolveDefaultStoreBase(config: VoiceCallConfig, storePath?: string): string {

View File

@@ -2,10 +2,10 @@ import fs from "node:fs";
import os from "node:os"; import os from "node:os";
import path from "node:path"; import path from "node:path";
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { VoiceCallConfigSchema } from "../config.js";
import type { VoiceCallProvider } from "../providers/base.js"; import type { VoiceCallProvider } from "../providers/base.js";
import type { HangupCallInput, NormalizedEvent } from "../types.js"; import type { HangupCallInput, NormalizedEvent } from "../types.js";
import type { CallManagerContext } from "./context.js"; import type { CallManagerContext } from "./context.js";
import { VoiceCallConfigSchema } from "../config.js";
import { processEvent } from "./events.js"; import { processEvent } from "./events.js";
function createContext(overrides: Partial<CallManagerContext> = {}): CallManagerContext { function createContext(overrides: Partial<CallManagerContext> = {}): CallManagerContext {

View File

@@ -1,7 +1,7 @@
import crypto from "node:crypto"; import crypto from "node:crypto";
import { isAllowlistedCaller, normalizePhoneNumber } from "../allowlist.js";
import type { CallRecord, CallState, NormalizedEvent } from "../types.js"; import type { CallRecord, CallState, NormalizedEvent } from "../types.js";
import type { CallManagerContext } from "./context.js"; import type { CallManagerContext } from "./context.js";
import { isAllowlistedCaller, normalizePhoneNumber } from "../allowlist.js";
import { findCall } from "./lookup.js"; import { findCall } from "./lookup.js";
import { endCall } from "./outbound.js"; import { endCall } from "./outbound.js";
import { addTranscriptEntry, transitionState } from "./state.js"; import { addTranscriptEntry, transitionState } from "./state.js";

Some files were not shown because too many files have changed in this diff Show More