mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
refactor(extensions): remove dead local exports (#107146)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
// Tests for the durable ClickClack agent-activity publisher (coalescing rules).
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createClickClackActivityPublisher, type ClickClackActivityClient } from "./activity.js";
|
||||
import { createClickClackActivityPublisher } from "./activity.js";
|
||||
import type { ClickClackMessage } from "./types.js";
|
||||
|
||||
type ActivityClient = Parameters<typeof createClickClackActivityPublisher>[0]["client"];
|
||||
|
||||
function createClientMock(): {
|
||||
client: ClickClackActivityClient;
|
||||
client: ActivityClient;
|
||||
createActivityMessage: ReturnType<typeof vi.fn>;
|
||||
updateMessageBody: ReturnType<typeof vi.fn>;
|
||||
} {
|
||||
@@ -15,7 +17,7 @@ function createClientMock(): {
|
||||
});
|
||||
const updateMessageBody = vi.fn(async () => ({}) as ClickClackMessage);
|
||||
return {
|
||||
client: { createActivityMessage, updateMessageBody } as ClickClackActivityClient,
|
||||
client: { createActivityMessage, updateMessageBody } as ActivityClient,
|
||||
createActivityMessage,
|
||||
updateMessageBody,
|
||||
};
|
||||
@@ -253,7 +255,7 @@ describe("createClickClackActivityPublisher", () => {
|
||||
});
|
||||
const updateMessageBody = vi.fn(async () => ({}) as ClickClackMessage);
|
||||
const publisher = createClickClackActivityPublisher({
|
||||
client: { createActivityMessage, updateMessageBody } as ClickClackActivityClient,
|
||||
client: { createActivityMessage, updateMessageBody } as ActivityClient,
|
||||
target: { channelId: "chn_1" },
|
||||
turnId: "msg_turn",
|
||||
onError,
|
||||
|
||||
@@ -42,7 +42,7 @@ type ClickClackActivityTarget = {
|
||||
};
|
||||
|
||||
/** Client subset needed by the publisher (satisfied by `createClickClackClient`). */
|
||||
export type ClickClackActivityClient = {
|
||||
type ClickClackActivityClient = {
|
||||
createActivityMessage(params: {
|
||||
channelId?: string;
|
||||
conversationId?: string;
|
||||
|
||||
@@ -208,4 +208,3 @@ export const testing = {
|
||||
googleAuthRuntimeTesting.resetGoogleAuthRuntimeForTests();
|
||||
},
|
||||
};
|
||||
export { testing as __testing };
|
||||
|
||||
@@ -20,7 +20,7 @@ type NextcloudTalkBotAdminEntry = {
|
||||
features?: number | string;
|
||||
};
|
||||
|
||||
export type NextcloudTalkBotResponseFeatureProbe = {
|
||||
type NextcloudTalkBotResponseFeatureProbe = {
|
||||
ok: boolean;
|
||||
skipped?: boolean;
|
||||
code:
|
||||
|
||||
@@ -138,4 +138,3 @@ export async function resolveNextcloudTalkRoomKind(params: {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
export { testing as __testing };
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Smoke tests for the `openclaw path` CLI handlers.
|
||||
*
|
||||
* Tests invoke each subcommand handler directly with a capturing
|
||||
* `OutputRuntimeEnv` — no commander wiring, no child process spawn.
|
||||
* a derived runtime interface — no commander wiring, no child process spawn.
|
||||
* Assertions inspect captured stdout/stderr and the exit code the
|
||||
* handler set on the runtime.
|
||||
*/
|
||||
@@ -11,7 +11,6 @@ import { tmpdir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
type OutputRuntimeEnv,
|
||||
formatUnifiedDiff,
|
||||
pathEmitCommand,
|
||||
pathFindCommand,
|
||||
@@ -20,7 +19,9 @@ import {
|
||||
pathValidateCommand,
|
||||
} from "./cli.js";
|
||||
|
||||
interface TestRuntime extends OutputRuntimeEnv {
|
||||
type CliRuntime = Parameters<typeof pathResolveCommand>[2];
|
||||
|
||||
interface TestRuntime extends CliRuntime {
|
||||
readonly stdout: string[];
|
||||
readonly stderr: string[];
|
||||
exitCode: number;
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
type OcPath,
|
||||
} from "./oc-path/index.js";
|
||||
|
||||
export type OutputRuntimeEnv = {
|
||||
type OutputRuntimeEnv = {
|
||||
writeStdout(value: string): void;
|
||||
error(value: string): void;
|
||||
exit(code: number): void;
|
||||
|
||||
@@ -41,7 +41,7 @@ import { resolveOcPath } from "./universal.js";
|
||||
// ---------- Public types ---------------------------------------------------
|
||||
|
||||
/** A find result: a concrete (wildcard-free) path plus its match info. */
|
||||
export interface OcPathMatch {
|
||||
interface OcPathMatch {
|
||||
readonly path: OcPath;
|
||||
readonly match: OcMatch;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import { OcEmitSentinelError, REDACTED_SENTINEL } from "../sentinel.js";
|
||||
import type { JsoncAst, JsoncValue } from "./ast.js";
|
||||
|
||||
export interface JsoncEmitOptions {
|
||||
interface JsoncEmitOptions {
|
||||
readonly mode?: "roundtrip" | "render";
|
||||
readonly fileNameForGuard?: string;
|
||||
readonly acceptPreExistingSentinel?: boolean;
|
||||
|
||||
@@ -23,7 +23,7 @@ export const MAX_JSONC_INPUT_BYTES = 16 * 1024 * 1024;
|
||||
const JSONC_PARSE_INVALID_SYMBOL = 1;
|
||||
const JSONC_PARSE_END_OF_FILE_EXPECTED = 9;
|
||||
|
||||
export interface JsoncParseResult {
|
||||
interface JsoncParseResult {
|
||||
readonly ast: JsoncAst;
|
||||
readonly diagnostics: readonly Diagnostic[];
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ async function sendSynologyChatMedia(
|
||||
});
|
||||
}
|
||||
|
||||
export const synologyChatMessageAdapter = defineChannelMessageAdapter({
|
||||
const synologyChatMessageAdapter = defineChannelMessageAdapter({
|
||||
id: CHANNEL_ID,
|
||||
durableFinal: {
|
||||
capabilities: {
|
||||
|
||||
@@ -14,9 +14,9 @@ import type { PendingApproval } from "../settings.js";
|
||||
|
||||
export type { PendingApproval };
|
||||
|
||||
export type ApprovalType = "dm" | "channel" | "group";
|
||||
type ApprovalType = "dm" | "channel" | "group";
|
||||
|
||||
export type CreateApprovalParams = {
|
||||
type CreateApprovalParams = {
|
||||
type: ApprovalType;
|
||||
requestingShip: string;
|
||||
channelNest?: string;
|
||||
@@ -98,7 +98,7 @@ export function formatApprovalRequest(approval: PendingApproval): string {
|
||||
throw new Error("Unsupported approval type");
|
||||
}
|
||||
|
||||
export type ApprovalResponse = {
|
||||
type ApprovalResponse = {
|
||||
action: "approve" | "deny" | "block";
|
||||
id?: string;
|
||||
};
|
||||
@@ -197,10 +197,7 @@ export function formatApprovalConfirmation(
|
||||
// Admin Commands
|
||||
// ============================================================================
|
||||
|
||||
export type AdminCommand =
|
||||
| { type: "unblock"; ship: string }
|
||||
| { type: "blocked" }
|
||||
| { type: "pending" };
|
||||
type AdminCommand = { type: "unblock"; ship: string } | { type: "blocked" } | { type: "pending" };
|
||||
|
||||
/**
|
||||
* Parse an admin command from owner message.
|
||||
|
||||
@@ -8,7 +8,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"extensions/canvas/src/host/a2ui.ts: injectCanvasRuntime",
|
||||
"extensions/canvas/src/host/a2ui.ts: isA2uiPath",
|
||||
"extensions/canvas/src/host/server.ts: CANVAS_LIVE_RELOAD_MAX_INBOUND_MESSAGE_BYTES",
|
||||
"extensions/clickclack/src/activity.ts: ClickClackActivityClient",
|
||||
"extensions/copilot/src/auth-bridge.ts: COPILOT_DEFAULT_AGENT_ID",
|
||||
"extensions/copilot/src/auth-bridge.ts: COPILOT_TOKEN_PROFILE_ERROR",
|
||||
"extensions/copilot/src/auth-bridge.ts: sanitizeAgentId",
|
||||
@@ -120,7 +119,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"extensions/google-meet/src/transports/chrome.ts: testing",
|
||||
"extensions/google/src/gemini-web-search-provider.ts: testing",
|
||||
"extensions/googlechat/src/approval-card-actions.ts: clearGoogleChatApprovalCardBindingsForTest",
|
||||
"extensions/googlechat/src/auth.ts: __testing",
|
||||
"extensions/googlechat/src/auth.ts: testing",
|
||||
"extensions/googlechat/src/google-auth.runtime.ts: __testing",
|
||||
"extensions/googlechat/src/google-auth.runtime.ts: createGoogleAuthFetch",
|
||||
@@ -212,21 +210,15 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"extensions/msteams/src/team-identity.ts: _teamGroupIdCacheForTest",
|
||||
"extensions/msteams/src/thread-parent-context.ts: resetThreadParentContextCachesForTest",
|
||||
"extensions/msteams/src/user-agent.ts: resetUserAgentCache",
|
||||
"extensions/nextcloud-talk/src/bot-preflight.ts: NextcloudTalkBotResponseFeatureProbe",
|
||||
"extensions/nextcloud-talk/src/monitor.ts: NextcloudTalkRetryableWebhookError",
|
||||
"extensions/nextcloud-talk/src/monitor.ts: readNextcloudTalkWebhookBody",
|
||||
"extensions/nextcloud-talk/src/room-info.ts: __testing",
|
||||
"extensions/nextcloud-talk/src/room-info.ts: testing",
|
||||
"extensions/oc-path/src/cli.ts: formatUnifiedDiff",
|
||||
"extensions/oc-path/src/cli.ts: OutputRuntimeEnv",
|
||||
"extensions/oc-path/src/cli.ts: pathEmitCommand",
|
||||
"extensions/oc-path/src/cli.ts: pathFindCommand",
|
||||
"extensions/oc-path/src/cli.ts: pathResolveCommand",
|
||||
"extensions/oc-path/src/cli.ts: pathSetCommand",
|
||||
"extensions/oc-path/src/cli.ts: pathValidateCommand",
|
||||
"extensions/oc-path/src/oc-path/find.ts: OcPathMatch",
|
||||
"extensions/oc-path/src/oc-path/jsonc/emit.ts: JsoncEmitOptions",
|
||||
"extensions/oc-path/src/oc-path/jsonc/parse.ts: JsoncParseResult",
|
||||
"extensions/oc-path/src/oc-path/jsonc/parse.ts: MAX_JSONC_INPUT_BYTES",
|
||||
"extensions/oc-path/src/oc-path/oc-path.ts: getPathLayout",
|
||||
"extensions/oc-path/src/oc-path/oc-path.ts: isPattern",
|
||||
@@ -305,7 +297,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"extensions/sms/src/twilio.ts: TwilioSmsApiError",
|
||||
"extensions/sms/src/webhook.ts: testing",
|
||||
"extensions/synology-chat/src/channel.ts: createSynologyChatPlugin",
|
||||
"extensions/synology-chat/src/channel.ts: synologyChatMessageAdapter",
|
||||
"extensions/synology-chat/src/client.ts: fetchChatUsers (synologyClient)",
|
||||
"extensions/synology-chat/src/webhook-handler.ts: clearSynologyWebhookRateLimiterStateForTest",
|
||||
"extensions/tavily/src/config.ts: DEFAULT_TAVILY_EXTRACT_TIMEOUT_SECONDS",
|
||||
@@ -351,10 +342,6 @@ export const KNIP_UNUSED_EXPORT_BASELINE = [
|
||||
"extensions/telegram/src/update-offset-store.ts: TelegramUpdateOffsetState",
|
||||
"extensions/tlon/src/config-schema.ts: TlonAuthorizationSchema",
|
||||
"extensions/tlon/src/config-schema.ts: TlonConfigSchema",
|
||||
"extensions/tlon/src/monitor/approval.ts: AdminCommand",
|
||||
"extensions/tlon/src/monitor/approval.ts: ApprovalResponse",
|
||||
"extensions/tlon/src/monitor/approval.ts: ApprovalType",
|
||||
"extensions/tlon/src/monitor/approval.ts: CreateApprovalParams",
|
||||
"extensions/tlon/src/monitor/approval.ts: generateApprovalId",
|
||||
"extensions/tlon/src/monitor/media.ts: downloadMedia",
|
||||
"extensions/tlon/src/monitor/media.ts: extractImageBlocks",
|
||||
|
||||
Reference in New Issue
Block a user