diff --git a/extensions/clickclack/src/activity.test.ts b/extensions/clickclack/src/activity.test.ts index 6c55f7dfa020..a469a7bcb7c8 100644 --- a/extensions/clickclack/src/activity.test.ts +++ b/extensions/clickclack/src/activity.test.ts @@ -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[0]["client"]; + function createClientMock(): { - client: ClickClackActivityClient; + client: ActivityClient; createActivityMessage: ReturnType; updateMessageBody: ReturnType; } { @@ -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, diff --git a/extensions/clickclack/src/activity.ts b/extensions/clickclack/src/activity.ts index d6790a27dd32..85e0bb92a29c 100644 --- a/extensions/clickclack/src/activity.ts +++ b/extensions/clickclack/src/activity.ts @@ -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; diff --git a/extensions/googlechat/src/auth.ts b/extensions/googlechat/src/auth.ts index d726f4761b71..9da717486810 100644 --- a/extensions/googlechat/src/auth.ts +++ b/extensions/googlechat/src/auth.ts @@ -208,4 +208,3 @@ export const testing = { googleAuthRuntimeTesting.resetGoogleAuthRuntimeForTests(); }, }; -export { testing as __testing }; diff --git a/extensions/nextcloud-talk/src/bot-preflight.ts b/extensions/nextcloud-talk/src/bot-preflight.ts index dbdb218e88e9..2db40878a304 100644 --- a/extensions/nextcloud-talk/src/bot-preflight.ts +++ b/extensions/nextcloud-talk/src/bot-preflight.ts @@ -20,7 +20,7 @@ type NextcloudTalkBotAdminEntry = { features?: number | string; }; -export type NextcloudTalkBotResponseFeatureProbe = { +type NextcloudTalkBotResponseFeatureProbe = { ok: boolean; skipped?: boolean; code: diff --git a/extensions/nextcloud-talk/src/room-info.ts b/extensions/nextcloud-talk/src/room-info.ts index 984d3a04407c..673f5bf30fcd 100644 --- a/extensions/nextcloud-talk/src/room-info.ts +++ b/extensions/nextcloud-talk/src/room-info.ts @@ -138,4 +138,3 @@ export async function resolveNextcloudTalkRoomKind(params: { return undefined; } } -export { testing as __testing }; diff --git a/extensions/oc-path/src/cli.test.ts b/extensions/oc-path/src/cli.test.ts index 1dbe9853dbd2..087486d97c32 100644 --- a/extensions/oc-path/src/cli.test.ts +++ b/extensions/oc-path/src/cli.test.ts @@ -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[2]; + +interface TestRuntime extends CliRuntime { readonly stdout: string[]; readonly stderr: string[]; exitCode: number; diff --git a/extensions/oc-path/src/cli.ts b/extensions/oc-path/src/cli.ts index e0d36f046789..6ae36b6a26d4 100644 --- a/extensions/oc-path/src/cli.ts +++ b/extensions/oc-path/src/cli.ts @@ -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; diff --git a/extensions/oc-path/src/oc-path/find.ts b/extensions/oc-path/src/oc-path/find.ts index 6c26cb9804c2..bd0dd82cfa16 100644 --- a/extensions/oc-path/src/oc-path/find.ts +++ b/extensions/oc-path/src/oc-path/find.ts @@ -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; } diff --git a/extensions/oc-path/src/oc-path/jsonc/emit.ts b/extensions/oc-path/src/oc-path/jsonc/emit.ts index 8df49c8d3f3d..e3a83b75feea 100644 --- a/extensions/oc-path/src/oc-path/jsonc/emit.ts +++ b/extensions/oc-path/src/oc-path/jsonc/emit.ts @@ -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; diff --git a/extensions/oc-path/src/oc-path/jsonc/parse.ts b/extensions/oc-path/src/oc-path/jsonc/parse.ts index cabf611726e0..29f4e27105c9 100644 --- a/extensions/oc-path/src/oc-path/jsonc/parse.ts +++ b/extensions/oc-path/src/oc-path/jsonc/parse.ts @@ -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[]; } diff --git a/extensions/synology-chat/src/channel.ts b/extensions/synology-chat/src/channel.ts index a71158291f63..8acc2b7c8a58 100644 --- a/extensions/synology-chat/src/channel.ts +++ b/extensions/synology-chat/src/channel.ts @@ -285,7 +285,7 @@ async function sendSynologyChatMedia( }); } -export const synologyChatMessageAdapter = defineChannelMessageAdapter({ +const synologyChatMessageAdapter = defineChannelMessageAdapter({ id: CHANNEL_ID, durableFinal: { capabilities: { diff --git a/extensions/tlon/src/monitor/approval.ts b/extensions/tlon/src/monitor/approval.ts index c818384c9674..8f6e1f853f73 100644 --- a/extensions/tlon/src/monitor/approval.ts +++ b/extensions/tlon/src/monitor/approval.ts @@ -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. diff --git a/scripts/deadcode-exports.baseline.mjs b/scripts/deadcode-exports.baseline.mjs index 13a4cad0d629..5f5c99e7418e 100644 --- a/scripts/deadcode-exports.baseline.mjs +++ b/scripts/deadcode-exports.baseline.mjs @@ -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",