diff --git a/.oxlintrc.json b/.oxlintrc.json index 2f063ecd9..24536d90b 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -18,13 +18,13 @@ "typescript/no-unsafe-type-assertion": "off", "typescript/no-unnecessary-template-expression": "off", "unicorn/consistent-function-scoping": "off", + "unicorn/require-post-message-target-origin": "off", "typescript/no-extraneous-class": "off", "oxc/no-async-endpoint-handlers": "off", "eslint/no-useless-concat": "off", - "eslint/no-unused-vars": "off", + "eslint/no-unused-vars": "error", "eslint/no-new": "off", "eslint/preserve-caught-error": "off", - "unicorn/require-post-message-target-origin": "off", }, "ignorePatterns": ["src/canvas-host/a2ui/a2ui.bundle.js"] } diff --git a/src/agents/auth-profiles/oauth.ts b/src/agents/auth-profiles/oauth.ts index 0e66dea3d..d8c762d6b 100644 --- a/src/agents/auth-profiles/oauth.ts +++ b/src/agents/auth-profiles/oauth.ts @@ -1,4 +1,4 @@ -import { getOAuthApiKey, type OAuthCredentials, type OAuthProvider } from "@mariozechner/pi-ai"; +import { getOAuthApiKey, type OAuthCredentials } from "@mariozechner/pi-ai"; import lockfile from "proper-lockfile"; import type { OpenClawConfig } from "../../config/config.js"; diff --git a/src/agents/cache-trace.ts b/src/agents/cache-trace.ts index 0d119b6ba..1ea62aee1 100644 --- a/src/agents/cache-trace.ts +++ b/src/agents/cache-trace.ts @@ -3,7 +3,6 @@ import fs from "node:fs/promises"; import path from "node:path"; import type { AgentMessage, StreamFn } from "@mariozechner/pi-agent-core"; -import type { Api, Model } from "@mariozechner/pi-ai"; import type { OpenClawConfig } from "../config/config.js"; import { resolveStateDir } from "../config/paths.js"; diff --git a/src/agents/pi-embedded-runner/extra-params.ts b/src/agents/pi-embedded-runner/extra-params.ts index 745ef2361..8109ff836 100644 --- a/src/agents/pi-embedded-runner/extra-params.ts +++ b/src/agents/pi-embedded-runner/extra-params.ts @@ -1,5 +1,5 @@ import type { StreamFn } from "@mariozechner/pi-agent-core"; -import type { Api, Model, SimpleStreamOptions } from "@mariozechner/pi-ai"; +import type { SimpleStreamOptions } from "@mariozechner/pi-ai"; import { streamSimple } from "@mariozechner/pi-ai"; import type { OpenClawConfig } from "../../config/config.js"; diff --git a/src/agents/pi-embedded-subscribe.handlers.messages.ts b/src/agents/pi-embedded-subscribe.handlers.messages.ts index 568303e34..be5a3d58c 100644 --- a/src/agents/pi-embedded-subscribe.handlers.messages.ts +++ b/src/agents/pi-embedded-subscribe.handlers.messages.ts @@ -1,5 +1,4 @@ import type { AgentEvent, AgentMessage } from "@mariozechner/pi-agent-core"; -import type { AssistantMessage } from "@mariozechner/pi-ai"; import { parseReplyDirectives } from "../auto-reply/reply/reply-directives.js"; import { emitAgentEvent } from "../infra/agent-events.js"; diff --git a/src/agents/tools/image-tool.ts b/src/agents/tools/image-tool.ts index 29cd240a5..1906b0f46 100644 --- a/src/agents/tools/image-tool.ts +++ b/src/agents/tools/image-tool.ts @@ -1,13 +1,7 @@ import fs from "node:fs/promises"; import path from "node:path"; -import { - type Api, - type AssistantMessage, - type Context, - complete, - type Model, -} from "@mariozechner/pi-ai"; +import { type Api, type Context, complete, type Model } from "@mariozechner/pi-ai"; import { discoverAuthStorage, discoverModels } from "../pi-model-discovery.js"; import { Type } from "@sinclair/typebox"; diff --git a/src/browser/pw-tools-core.snapshot.ts b/src/browser/pw-tools-core.snapshot.ts index f446eaa74..357283624 100644 --- a/src/browser/pw-tools-core.snapshot.ts +++ b/src/browser/pw-tools-core.snapshot.ts @@ -1,5 +1,3 @@ -import type { Page } from "playwright-core"; - import { type AriaSnapshotNode, formatAriaSnapshot, type RawAXNode } from "./cdp.js"; import { buildRoleSnapshotFromAiSnapshot, diff --git a/src/discord/resolve-channels.ts b/src/discord/resolve-channels.ts index 2fc01fa2c..6035d2120 100644 --- a/src/discord/resolve-channels.ts +++ b/src/discord/resolve-channels.ts @@ -1,5 +1,3 @@ -import type { RESTGetAPIChannelResult, RESTGetAPIGuildChannelsResult } from "discord-api-types/v10"; - import { fetchDiscord } from "./api.js"; import { normalizeDiscordSlug } from "./monitor/allow-list.js"; import { normalizeDiscordToken } from "./token.js"; diff --git a/src/gateway/server-methods/agent.ts b/src/gateway/server-methods/agent.ts index 0747ce216..e2b50ab06 100644 --- a/src/gateway/server-methods/agent.ts +++ b/src/gateway/server-methods/agent.ts @@ -26,8 +26,6 @@ import { import { normalizeAgentId } from "../../routing/session-key.js"; import { parseMessageWithAttachments } from "../chat-attachments.js"; import { - type AgentIdentityParams, - type AgentWaitParams, ErrorCodes, errorShape, formatValidationErrors, diff --git a/src/gateway/server-methods/send.ts b/src/gateway/server-methods/send.ts index fb8184833..58807bccf 100644 --- a/src/gateway/server-methods/send.ts +++ b/src/gateway/server-methods/send.ts @@ -1,5 +1,4 @@ import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; -import type { ChannelId } from "../../channels/plugins/types.js"; import { DEFAULT_CHAT_CHANNEL } from "../../channels/registry.js"; import { loadConfig } from "../../config/config.js"; import { createOutboundSendDeps } from "../../cli/deps.js"; @@ -10,7 +9,6 @@ import { resolveOutboundSessionRoute, } from "../../infra/outbound/outbound-session.js"; import { resolveSessionAgentId } from "../../agents/agent-scope.js"; -import type { OutboundChannel } from "../../infra/outbound/targets.js"; import { resolveOutboundTarget } from "../../infra/outbound/targets.js"; import { normalizePollInput } from "../../polls.js"; import { diff --git a/src/gateway/server/ws-connection/message-handler.ts b/src/gateway/server/ws-connection/message-handler.ts index 658b93d10..c6aa083b1 100644 --- a/src/gateway/server/ws-connection/message-handler.ts +++ b/src/gateway/server/ws-connection/message-handler.ts @@ -35,7 +35,6 @@ import { errorShape, formatValidationErrors, PROTOCOL_VERSION, - type RequestFrame, validateConnectParams, validateRequestFrame, } from "../../protocol/index.js"; diff --git a/src/hooks/bundled/soul-evil/handler.ts b/src/hooks/bundled/soul-evil/handler.ts index dc1192708..71611bcab 100644 --- a/src/hooks/bundled/soul-evil/handler.ts +++ b/src/hooks/bundled/soul-evil/handler.ts @@ -1,4 +1,3 @@ -import type { OpenClawConfig } from "../../../config/config.js"; import { isSubagentSessionKey } from "../../../routing/session-key.js"; import { resolveHookConfig } from "../../config.js"; import { isAgentBootstrapEvent, type HookHandler } from "../../hooks.js"; diff --git a/src/infra/outbound/message.ts b/src/infra/outbound/message.ts index b71e5c766..10faea09f 100644 --- a/src/infra/outbound/message.ts +++ b/src/infra/outbound/message.ts @@ -1,5 +1,4 @@ import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; -import type { ChannelId } from "../../channels/plugins/types.js"; import type { OpenClawConfig } from "../../config/config.js"; import { loadConfig } from "../../config/config.js"; import { callGateway, randomIdempotencyKey } from "../../gateway/call.js"; @@ -18,7 +17,6 @@ import { type OutboundSendDeps, } from "./deliver.js"; import { normalizeReplyPayloadsForDelivery } from "./payloads.js"; -import type { OutboundChannel } from "./targets.js"; import { resolveOutboundTarget } from "./targets.js"; export type MessageGatewayOptions = { diff --git a/src/infra/outbound/targets.ts b/src/infra/outbound/targets.ts index cc8281f36..824f27a57 100644 --- a/src/infra/outbound/targets.ts +++ b/src/infra/outbound/targets.ts @@ -1,6 +1,6 @@ import { getChannelPlugin, normalizeChannelId } from "../../channels/plugins/index.js"; import { formatCliCommand } from "../../cli/command-format.js"; -import type { ChannelId, ChannelOutboundTargetMode } from "../../channels/plugins/types.js"; +import type { ChannelOutboundTargetMode } from "../../channels/plugins/types.js"; import type { OpenClawConfig } from "../../config/config.js"; import type { SessionEntry } from "../../config/sessions.js"; import type { AgentDefaultsConfig } from "../../config/types.agent-defaults.js"; diff --git a/src/line/bot-message-context.ts b/src/line/bot-message-context.ts index 8e1e691f7..20244465d 100644 --- a/src/line/bot-message-context.ts +++ b/src/line/bot-message-context.ts @@ -1,11 +1,4 @@ -import type { - MessageEvent, - TextEventMessage, - StickerEventMessage, - LocationEventMessage, - EventSource, - PostbackEvent, -} from "@line/bot-sdk"; +import type { MessageEvent, StickerEventMessage, EventSource, PostbackEvent } from "@line/bot-sdk"; import { formatInboundEnvelope, resolveEnvelopeFormatOptions } from "../auto-reply/envelope.js"; import { finalizeInboundContext } from "../auto-reply/reply/inbound-context.js"; import { formatLocationText, toLocationContext } from "../channels/location.js"; diff --git a/src/media-understanding/providers/image.ts b/src/media-understanding/providers/image.ts index cf3cc60bf..a4e876b31 100644 --- a/src/media-understanding/providers/image.ts +++ b/src/media-understanding/providers/image.ts @@ -1,4 +1,4 @@ -import type { Api, AssistantMessage, Context, Model } from "@mariozechner/pi-ai"; +import type { Api, Context, Model } from "@mariozechner/pi-ai"; import { complete } from "@mariozechner/pi-ai"; import { discoverAuthStorage, discoverModels } from "../../agents/pi-model-discovery.js"; diff --git a/src/slack/monitor/events/reactions.ts b/src/slack/monitor/events/reactions.ts index 942682040..5df15912d 100644 --- a/src/slack/monitor/events/reactions.ts +++ b/src/slack/monitor/events/reactions.ts @@ -5,7 +5,7 @@ import { enqueueSystemEvent } from "../../../infra/system-events.js"; import { resolveSlackChannelLabel } from "../channel-config.js"; import type { SlackMonitorContext } from "../context.js"; -import type { SlackMessageEvent, SlackReactionEvent } from "../types.js"; +import type { SlackReactionEvent } from "../types.js"; export function registerSlackReactionEvents(params: { ctx: SlackMonitorContext }) { const { ctx } = params; diff --git a/src/test-utils/ports.ts b/src/test-utils/ports.ts index 1bd062c03..188b25271 100644 --- a/src/test-utils/ports.ts +++ b/src/test-utils/ports.ts @@ -1,4 +1,4 @@ -import { type AddressInfo, createServer } from "node:net"; +import { createServer } from "node:net"; import { isMainThread, threadId } from "node:worker_threads"; async function isPortFree(port: number): Promise { diff --git a/src/tui/components/custom-editor.ts b/src/tui/components/custom-editor.ts index ac87b39c9..4dc42391f 100644 --- a/src/tui/components/custom-editor.ts +++ b/src/tui/components/custom-editor.ts @@ -1,11 +1,4 @@ -import { - Editor, - type EditorOptions, - type EditorTheme, - type TUI, - Key, - matchesKey, -} from "@mariozechner/pi-tui"; +import { Editor, Key, matchesKey } from "@mariozechner/pi-tui"; export class CustomEditor extends Editor { onEscape?: () => void; diff --git a/src/wizard/onboarding.finalize.ts b/src/wizard/onboarding.finalize.ts index 37bd01c09..6c8e6d610 100644 --- a/src/wizard/onboarding.finalize.ts +++ b/src/wizard/onboarding.finalize.ts @@ -5,7 +5,6 @@ import { DEFAULT_BOOTSTRAP_FILENAME } from "../agents/workspace.js"; import { DEFAULT_GATEWAY_DAEMON_RUNTIME, GATEWAY_DAEMON_RUNTIME_OPTIONS, - type GatewayDaemonRuntime, } from "../commands/daemon-runtime.js"; import { healthCommand } from "../commands/health.js"; import { formatHealthCheckFailure } from "../commands/health-format.js";