refactor(extensions): remove dead local exports (#107146)

This commit is contained in:
Vincent Koc
2026-07-14 13:09:20 +08:00
committed by GitHub
parent cac097946d
commit ee6d6e7e78
13 changed files with 21 additions and 36 deletions
+6 -4
View File
@@ -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,
+1 -1
View File
@@ -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;
-1
View File
@@ -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 };
+4 -3
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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[];
}
+1 -1
View File
@@ -285,7 +285,7 @@ async function sendSynologyChatMedia(
});
}
export const synologyChatMessageAdapter = defineChannelMessageAdapter({
const synologyChatMessageAdapter = defineChannelMessageAdapter({
id: CHANNEL_ID,
durableFinal: {
capabilities: {
+4 -7
View File
@@ -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.
-13
View File
@@ -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",