diff --git a/extensions/diffs/src/tool.ts b/extensions/diffs/src/tool.ts index 5e0962f92c2..4513eed41c8 100644 --- a/extensions/diffs/src/tool.ts +++ b/extensions/diffs/src/tool.ts @@ -2,7 +2,8 @@ import fs from "node:fs/promises"; import { stringEnum } from "openclaw/plugin-sdk/channel-actions"; import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime"; -import { Static, Type } from "typebox"; +import { Type } from "typebox"; +import type { Static } from "typebox"; import type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginToolContext } from "../api.js"; import { PlaywrightDiffScreenshotter, type DiffScreenshotter } from "./browser.js"; import { resolveDiffImageRenderOptions } from "./config.js"; diff --git a/extensions/discord/src/monitor.gateway.ts b/extensions/discord/src/monitor.gateway.ts index 1ea48af3a7f..918af96032b 100644 --- a/extensions/discord/src/monitor.gateway.ts +++ b/extensions/discord/src/monitor.gateway.ts @@ -1,7 +1,7 @@ import type { DiscordGatewayHandle } from "./monitor/gateway-handle.js"; -import { +import { DiscordGatewayLifecycleError } from "./monitor/gateway-supervisor.js"; +import type { DiscordGatewayEvent, - DiscordGatewayLifecycleError, DiscordGatewaySupervisor, } from "./monitor/gateway-supervisor.js"; diff --git a/extensions/discord/src/monitor/provider.rest-proxy.test.ts b/extensions/discord/src/monitor/provider.rest-proxy.test.ts index 80b7ceec725..1721b30608c 100644 --- a/extensions/discord/src/monitor/provider.rest-proxy.test.ts +++ b/extensions/discord/src/monitor/provider.rest-proxy.test.ts @@ -26,10 +26,7 @@ const { undiciFetchMock, agentSpy, envHttpProxyAgentSpy, proxyAgentSpy, createMo ("httpsProxy" in options || "httpProxy" in options) ) { const proxyOptions = options as { httpsProxy?: unknown; httpProxy?: unknown }; - if ( - proxyOptions.httpsProxy === "bad-proxy" || - proxyOptions.httpProxy === "bad-proxy" - ) { + if (proxyOptions.httpsProxy === "bad-proxy" || proxyOptions.httpProxy === "bad-proxy") { throw new Error("bad env proxy"); } } diff --git a/extensions/lmstudio/index.ts b/extensions/lmstudio/index.ts index 7e85c959515..2e114242624 100644 --- a/extensions/lmstudio/index.ts +++ b/extensions/lmstudio/index.ts @@ -1,12 +1,12 @@ import { definePluginEntry, - OpenClawConfig, type OpenClawPluginApi, type ProviderAuthContext, type ProviderAuthMethodNonInteractiveContext, type ProviderAuthResult, type ProviderRuntimeModel, } from "openclaw/plugin-sdk/plugin-entry"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/plugin-entry"; import { CUSTOM_LOCAL_AUTH_MARKER } from "openclaw/plugin-sdk/provider-auth"; import { lmstudioMemoryEmbeddingProviderAdapter } from "./memory-embedding-adapter.js"; import { diff --git a/extensions/matrix/src/matrix/legacy-crypto-inspector.ts b/extensions/matrix/src/matrix/legacy-crypto-inspector.ts index 7f22cd3379d..d628751ff82 100644 --- a/extensions/matrix/src/matrix/legacy-crypto-inspector.ts +++ b/extensions/matrix/src/matrix/legacy-crypto-inspector.ts @@ -14,6 +14,8 @@ export type MatrixLegacyCryptoInspectionResult = { decryptionKeyBase64: string | null; }; +const MATRIX_CRYPTO_STORE_SQLITE = 0; + function resolveLegacyMachineStorePath(params: { cryptoRootDir: string; deviceId: string; @@ -56,7 +58,7 @@ export async function inspectLegacyMatrixCryptoStore(params: { log: params.log, }); - const { DeviceId, OlmMachine, StoreType, UserId } = requireFn( + const { DeviceId, OlmMachine, UserId } = requireFn( "@matrix-org/matrix-sdk-crypto-nodejs", ) as typeof import("@matrix-org/matrix-sdk-crypto-nodejs"); const machine = await OlmMachine.initialize( @@ -64,7 +66,7 @@ export async function inspectLegacyMatrixCryptoStore(params: { new DeviceId(params.deviceId), machineStorePath, "", - StoreType.Sqlite, + MATRIX_CRYPTO_STORE_SQLITE, ); try { diff --git a/extensions/oc-path/src/oc-path/jsonc/parse.ts b/extensions/oc-path/src/oc-path/jsonc/parse.ts index 109b57cbca9..ab805433600 100644 --- a/extensions/oc-path/src/oc-path/jsonc/parse.ts +++ b/extensions/oc-path/src/oc-path/jsonc/parse.ts @@ -1,9 +1,4 @@ -import { - ParseErrorCode, - type ParseError, - parseTree, - printParseErrorCode, -} from "jsonc-parser/lib/esm/main.js"; +import { type ParseError, parseTree, printParseErrorCode } from "jsonc-parser/lib/esm/main.js"; import type { Diagnostic } from "../ast.js"; import type { JsoncAst, JsoncEntry, JsoncValue } from "./ast.js"; @@ -24,6 +19,8 @@ export const MAX_PARSE_DEPTH = 256; * supported configuration. */ 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 { readonly ast: JsoncAst; @@ -104,9 +101,10 @@ function toDiagnostic( tree: JsoncParserNode | undefined, ): Diagnostic { const treeEnd = tree ? tree.offset + tree.length : 0; + const errorCode: number = error.error; const isTrailingInput = - error.error === ParseErrorCode.EndOfFileExpected || - (tree !== undefined && error.error === ParseErrorCode.InvalidSymbol && error.offset >= treeEnd); + errorCode === JSONC_PARSE_END_OF_FILE_EXPECTED || + (tree !== undefined && errorCode === JSONC_PARSE_INVALID_SYMBOL && error.offset >= treeEnd); return { line: lineMap.lineForOffset(error.offset), message: printParseErrorCode(error.error), diff --git a/extensions/slack/src/monitor.test-helpers.ts b/extensions/slack/src/monitor.test-helpers.ts index 8263e767cde..97531949b76 100644 --- a/extensions/slack/src/monitor.test-helpers.ts +++ b/extensions/slack/src/monitor.test-helpers.ts @@ -1,5 +1,6 @@ import type { ChannelRuntimeSurface } from "openclaw/plugin-sdk/channel-contract"; -import { Mock, vi } from "vitest"; +import { vi } from "vitest"; +import type { Mock } from "vitest"; import { clearSlackInboundDeliveryStateForTest } from "./monitor/inbound-delivery-state.js"; type SlackHandler = (args: unknown) => Promise; diff --git a/extensions/telegram/src/bot-handlers.runtime.ts b/extensions/telegram/src/bot-handlers.runtime.ts index acc15aca514..5a9597dd0f4 100644 --- a/extensions/telegram/src/bot-handlers.runtime.ts +++ b/extensions/telegram/src/bot-handlers.runtime.ts @@ -69,10 +69,8 @@ import type { TelegramMessageContextOptions, TelegramPromptContextEntry, } from "./bot-message-context.types.js"; -import { - parseTelegramNativeCommandCallbackData, - RegisterTelegramHandlerParams, -} from "./bot-native-commands.js"; +import { parseTelegramNativeCommandCallbackData } from "./bot-native-commands.js"; +import type { RegisterTelegramHandlerParams } from "./bot-native-commands.js"; import { MEDIA_GROUP_TIMEOUT_MS, type MediaGroupEntry, @@ -1315,8 +1313,11 @@ export const registerTelegramHandlers = ({ }; class TelegramRetryableCallbackError extends Error { - constructor(public override readonly cause: unknown) { + public override readonly cause: unknown; + + constructor(cause: unknown) { super(String(cause)); + this.cause = cause; this.name = "TelegramRetryableCallbackError"; } } diff --git a/extensions/telegram/src/bot-native-commands.ts b/extensions/telegram/src/bot-native-commands.ts index b6fdc5b1f6c..6507523ced3 100644 --- a/extensions/telegram/src/bot-native-commands.ts +++ b/extensions/telegram/src/bot-native-commands.ts @@ -64,7 +64,7 @@ import { syncTelegramMenuCommands as syncTelegramMenuCommandsRuntime, type TelegramMenuCommand, } from "./bot-native-command-menu.js"; -import { TelegramUpdateKeyContext } from "./bot-updates.js"; +import type { TelegramUpdateKeyContext } from "./bot-updates.js"; import type { TelegramBotOptions } from "./bot.types.js"; import { buildTelegramRoutingTarget, diff --git a/extensions/whatsapp/src/monitor-inbox.streams-inbound-messages.test-support.ts b/extensions/whatsapp/src/monitor-inbox.streams-inbound-messages.test-support.ts index 1a1e79da93e..eeaf01905d0 100644 --- a/extensions/whatsapp/src/monitor-inbox.streams-inbound-messages.test-support.ts +++ b/extensions/whatsapp/src/monitor-inbox.streams-inbound-messages.test-support.ts @@ -6,7 +6,6 @@ import { WhatsAppRetryableInboundError } from "./inbound/dedupe.js"; import { WHATSAPP_GROUP_METADATA_CACHE_MAX_ENTRIES } from "./inbound/monitor.js"; import { type InboxMonitorOptions, - InboxOnMessage, buildNotifyMessageUpsert, failNextWhatsAppPluginStateRegisterIfAbsent, getAuthDir, @@ -17,6 +16,7 @@ import { startInboxMonitor, waitForMessageCalls, } from "./monitor-inbox.test-harness.js"; +import type { InboxOnMessage } from "./monitor-inbox.test-harness.js"; const { sleepWithAbortMock } = vi.hoisted(() => ({ sleepWithAbortMock: vi.fn(async (_ms: number, _signal?: AbortSignal) => undefined), diff --git a/package.json b/package.json index aeb197a40d0..78d81008d47 100644 --- a/package.json +++ b/package.json @@ -1862,7 +1862,7 @@ "@types/markdown-it": "14.1.2", "@types/node": "25.9.1", "@types/ws": "8.18.1", - "@typescript/native-preview": "7.0.0-dev.20260519.1", + "@typescript/native-preview": "7.0.0-dev.20260524.1", "@vitest/coverage-v8": "4.1.7", "jscpd": "4.2.3", "jsdom": "29.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b7ffbb4837..6ef0fceaa34 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -222,8 +222,8 @@ importers: specifier: 8.18.1 version: 8.18.1 '@typescript/native-preview': - specifier: 7.0.0-dev.20260519.1 - version: 7.0.0-dev.20260519.1 + specifier: 7.0.0-dev.20260524.1 + version: 7.0.0-dev.20260524.1 '@vitest/coverage-v8': specifier: 4.1.7 version: 4.1.7(@vitest/browser@4.1.7)(vitest@4.1.7) @@ -250,7 +250,7 @@ importers: version: 0.21.1(signal-polyfill@0.2.2) tsdown: specifier: 0.22.0 - version: 0.22.0(@typescript/native-preview@7.0.0-dev.20260519.1)(tsx@4.22.3)(typescript@6.0.3)(unrun@0.3.0) + version: 0.22.0(@typescript/native-preview@7.0.0-dev.20260524.1)(tsx@4.22.3)(typescript@6.0.3)(unrun@0.3.0) tsx: specifier: 4.22.3 version: 4.22.3 @@ -4304,50 +4304,50 @@ packages: '@types/ws@8.18.1': resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-c9zdG6sGJf25Jpz04JgE23zhYeprqFypDGuqiX94yMTvR8IWXjq3R2oMnim66YLBDon/V1nCEy6cFixeSd/4fg==} + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-dIaYmijy9/tdrxHTxlnfwzP+AC6iAycUYGChOowLR3bVSbKhz4DUJZGMaodzGCtBEWSRUwx0MK1Sa1zBpFbM5g==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [darwin] - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-N16V3wiM0tsNmSSA7nZrxqXXt5OCJxBwiCVn35rnA7fr4WzJw6rJmwf9heNNhZ6Gh4ne3+Pexajf5akzuHR75Q==} + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-HjfPFOSQCymn5Iu07xoySqfK5lwXthEWN1vltO5SDaFYVRasK6P3DBRe4QL0AiSGr8tRfA3x7BdRPjPVu94Epg==} engines: {node: '>=16.20.0'} cpu: [x64] os: [darwin] - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-ltf91vAwKdbu0SlRQbFgi1h5ZrLLrBn6a4qIeN2VILGbtYrCXnARHRznLBv81yUETQ7aVr/LSQcmsWo1ejCK0w==} + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-dH+zYjBs2ajcIRMmb8YkapY7TXzU/yX6HITrXhuoDov+mun7nCNfiRRmRBeqbGxl5JM8mUugBl/yyyhFWjIWdQ==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [linux] - '@typescript/native-preview-linux-arm@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-8v4BExeeuCTrhaSGfeIJqm3qQkTzlZix/Qd/FkPlWoz9f7d7COvXb3Z4qhbaVolL0MMnUvQ7m005Z4kYsZ645A==} + '@typescript/native-preview-linux-arm@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-gXzD1BNpPUSAv12a9UvxLTX/+WdoC34skLw6hDLk1kv3VYbd5LecQzEIb7u+WHCsNuXVXffk79+BZP7IQNS1aw==} engines: {node: '>=16.20.0'} cpu: [arm] os: [linux] - '@typescript/native-preview-linux-x64@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-AVD0tczTtFCHNa4RQRVPvu8Hnw4P3hQ+OlUAjnz/lHowvc6o1pYB46elMqfDuaoWqIpv+EAkAPP4ipFCofJ5IA==} + '@typescript/native-preview-linux-x64@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-Fr0A8RPBMXco9IIXel598hC25LE1A5wpB33mBhwimlIQe58MMCAeW+wDHXsmLmF2NiFVT1vr1tjMGmEMMdYdsg==} engines: {node: '>=16.20.0'} cpu: [x64] os: [linux] - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-TM+qatljyejqjHevCta3WIH53i0oGC7K8SoJ6t+mf4cGMTpZTyd7NhC1ts7e6/aydZnG53Bsta2iQi1SMIlQEw==} + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-AhFD6bct2RWeZxONLEvaKPlu+c+/TNejj7ntztHWREaq+lrjz8Qg3tXryah2K66EEmYY0TooapfWUWXWe8i+VQ==} engines: {node: '>=16.20.0'} cpu: [arm64] os: [win32] - '@typescript/native-preview-win32-x64@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-r9LEsoY7JC/82gXo8hlOmpQaUXcqmngCVOv+mUx1UeMt9f+1S6oNO0W48o75mlBqqC7jfcMHqw8YS4LfVxPRGw==} + '@typescript/native-preview-win32-x64@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-3VE5kBH2y7vYpj83X9iqGbNR8gwnlQlTjzLKJBzuyfTJPZ9R/vM4txvpuTDRJo18JGzEq4FUjKg7yqpf9ajb2g==} engines: {node: '>=16.20.0'} cpu: [x64] os: [win32] - '@typescript/native-preview@7.0.0-dev.20260519.1': - resolution: {integrity: sha512-VVER7vFUDdfm5k3jbH5765tVEJa7+0rTUkFeXyGYrXPxpw9BIjA0QDxdtdlRyaU8MCZV9IKZUo6doxeAQRAjPg==} + '@typescript/native-preview@7.0.0-dev.20260524.1': + resolution: {integrity: sha512-L4YviXl4FVYt4V9vkUKRCZW1DcsUbLRaKC4gxsYmBJQqB262mtUo8eqjKqElgZNIpKwYEAAYsBDrVmNhy6ze2w==} engines: {node: '>=16.20.0'} hasBin: true @@ -10246,36 +10246,36 @@ snapshots: dependencies: '@types/node': 25.9.1 - '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260519.1': + '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview-darwin-x64@7.0.0-dev.20260519.1': + '@typescript/native-preview-darwin-x64@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview-linux-arm64@7.0.0-dev.20260519.1': + '@typescript/native-preview-linux-arm64@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview-linux-arm@7.0.0-dev.20260519.1': + '@typescript/native-preview-linux-arm@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview-linux-x64@7.0.0-dev.20260519.1': + '@typescript/native-preview-linux-x64@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview-win32-arm64@7.0.0-dev.20260519.1': + '@typescript/native-preview-win32-arm64@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview-win32-x64@7.0.0-dev.20260519.1': + '@typescript/native-preview-win32-x64@7.0.0-dev.20260524.1': optional: true - '@typescript/native-preview@7.0.0-dev.20260519.1': + '@typescript/native-preview@7.0.0-dev.20260524.1': optionalDependencies: - '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260519.1 - '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260519.1 - '@typescript/native-preview-linux-arm': 7.0.0-dev.20260519.1 - '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260519.1 - '@typescript/native-preview-linux-x64': 7.0.0-dev.20260519.1 - '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260519.1 - '@typescript/native-preview-win32-x64': 7.0.0-dev.20260519.1 + '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260524.1 + '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260524.1 + '@typescript/native-preview-linux-arm': 7.0.0-dev.20260524.1 + '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260524.1 + '@typescript/native-preview-linux-x64': 7.0.0-dev.20260524.1 + '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260524.1 + '@typescript/native-preview-win32-x64': 7.0.0-dev.20260524.1 '@typespec/ts-http-runtime@0.3.5': dependencies: @@ -13017,7 +13017,7 @@ snapshots: reusify@1.1.0: {} - rolldown-plugin-dts@0.25.1(@typescript/native-preview@7.0.0-dev.20260519.1)(rolldown@1.0.2)(typescript@6.0.3): + rolldown-plugin-dts@0.25.1(@typescript/native-preview@7.0.0-dev.20260524.1)(rolldown@1.0.2)(typescript@6.0.3): dependencies: '@babel/generator': 8.0.0-rc.5 '@babel/helper-validator-identifier': 8.0.0-rc.5 @@ -13029,7 +13029,7 @@ snapshots: obug: 2.1.1 rolldown: 1.0.2 optionalDependencies: - '@typescript/native-preview': 7.0.0-dev.20260519.1 + '@typescript/native-preview': 7.0.0-dev.20260524.1 typescript: 6.0.3 transitivePeerDependencies: - oxc-resolver @@ -13443,7 +13443,7 @@ snapshots: ts-algebra@2.0.0: {} - tsdown@0.22.0(@typescript/native-preview@7.0.0-dev.20260519.1)(tsx@4.22.3)(typescript@6.0.3)(unrun@0.3.0): + tsdown@0.22.0(@typescript/native-preview@7.0.0-dev.20260524.1)(tsx@4.22.3)(typescript@6.0.3)(unrun@0.3.0): dependencies: ansis: 4.3.0 cac: 7.0.0 @@ -13454,7 +13454,7 @@ snapshots: obug: 2.1.1 picomatch: 4.0.4 rolldown: 1.0.2 - rolldown-plugin-dts: 0.25.1(@typescript/native-preview@7.0.0-dev.20260519.1)(rolldown@1.0.2)(typescript@6.0.3) + rolldown-plugin-dts: 0.25.1(@typescript/native-preview@7.0.0-dev.20260524.1)(rolldown@1.0.2)(typescript@6.0.3) semver: 7.8.0 tinyexec: 1.1.2 tinyglobby: 0.2.16 diff --git a/src/acp/control-plane/manager.core.ts b/src/acp/control-plane/manager.core.ts index 7a9d452f396..fa5a743ff75 100644 --- a/src/acp/control-plane/manager.core.ts +++ b/src/acp/control-plane/manager.core.ts @@ -73,7 +73,8 @@ import { resolveMissingMetaError, resolveRuntimeIdleTtlMs, } from "./manager.utils.js"; -import { CachedRuntimeState, RuntimeCache } from "./runtime-cache.js"; +import { RuntimeCache } from "./runtime-cache.js"; +import type { CachedRuntimeState } from "./runtime-cache.js"; import { inferRuntimeOptionPatchFromConfigOption, mergeRuntimeOptions, @@ -179,8 +180,11 @@ export class AcpSessionManager { private readonly errorCountsByCode = new Map(); private evictedRuntimeCount = 0; private lastEvictedAt: number | undefined; + private readonly deps: AcpSessionManagerDeps; - constructor(private readonly deps: AcpSessionManagerDeps = DEFAULT_DEPS) {} + constructor(deps: AcpSessionManagerDeps = DEFAULT_DEPS) { + this.deps = deps; + } resolveSession(params: { cfg: OpenClawConfig; sessionKey: string }): AcpSessionResolution { const sessionKey = canonicalizeAcpSessionKey(params); diff --git a/src/agents/skills-install.test-mocks.ts b/src/agents/skills-install.test-mocks.ts index b87657cc01f..88458c31e3e 100644 --- a/src/agents/skills-install.test-mocks.ts +++ b/src/agents/skills-install.test-mocks.ts @@ -1,4 +1,5 @@ -import { Mock, vi } from "vitest"; +import { vi } from "vitest"; +import type { Mock } from "vitest"; export const runCommandWithTimeoutMock: Mock<(...args: unknown[]) => unknown> = vi.fn(); export const scanDirectoryWithSummaryMock: Mock<(...args: unknown[]) => unknown> = vi.fn(); diff --git a/src/agents/tools/web-fetch.ts b/src/agents/tools/web-fetch.ts index 88e4ef78faa..c6e19046fde 100644 --- a/src/agents/tools/web-fetch.ts +++ b/src/agents/tools/web-fetch.ts @@ -24,7 +24,6 @@ import { type ExtractMode, } from "./web-fetch-utils.js"; import { - CacheEntry, DEFAULT_CACHE_TTL_MINUTES, DEFAULT_TIMEOUT_SECONDS, normalizeCacheKey, @@ -34,6 +33,7 @@ import { resolveTimeoutSeconds, writeCache, } from "./web-shared.js"; +import type { CacheEntry } from "./web-shared.js"; import { resolveWebFetchToolRuntimeContext } from "./web-tool-runtime-context.js"; const EXTRACT_MODES = ["markdown", "text"] as const; diff --git a/src/agents/tools/web-search-provider-common.ts b/src/agents/tools/web-search-provider-common.ts index 11e54e6005d..62f823c8f1e 100644 --- a/src/agents/tools/web-search-provider-common.ts +++ b/src/agents/tools/web-search-provider-common.ts @@ -4,7 +4,6 @@ import { createLazyImportLoader } from "../../shared/lazy-promise.js"; import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js"; import { normalizeSecretInput } from "../../utils/normalize-secret-input.js"; import { - CacheEntry, DEFAULT_CACHE_TTL_MINUTES, DEFAULT_TIMEOUT_SECONDS, normalizeCacheKey, @@ -14,6 +13,7 @@ import { resolveTimeoutSeconds, writeCache, } from "./web-shared.js"; +import type { CacheEntry } from "./web-shared.js"; type WebGuardedFetchModule = Pick< typeof import("./web-guarded-fetch.js"), diff --git a/src/cli/config-cli.ts b/src/cli/config-cli.ts index 3fb668e4bc7..1575d75828a 100644 --- a/src/cli/config-cli.ts +++ b/src/cli/config-cli.ts @@ -513,9 +513,7 @@ function schemaAlternatives( function schemaLooksArray(schema: JsonSchemaRecord): boolean { return ( - schemaTypes(schema).has("array") || - isSchemaRecord(schema.items) || - Array.isArray(schema.items) + schemaTypes(schema).has("array") || isSchemaRecord(schema.items) || Array.isArray(schema.items) ); } diff --git a/src/gateway/test-helpers.runtime-state.ts b/src/gateway/test-helpers.runtime-state.ts index a0fb5eb4132..1f6f9194840 100644 --- a/src/gateway/test-helpers.runtime-state.ts +++ b/src/gateway/test-helpers.runtime-state.ts @@ -1,7 +1,8 @@ import crypto from "node:crypto"; import os from "node:os"; import path from "node:path"; -import { Mock, vi } from "vitest"; +import { vi } from "vitest"; +import type { Mock } from "vitest"; import type { GetReplyOptions } from "../auto-reply/get-reply-options.types.js"; import type { ReplyPayload } from "../auto-reply/reply-payload.js"; import type { MsgContext } from "../auto-reply/templating.js"; diff --git a/tsconfig.json b/tsconfig.json index cc92c808704..1d0a2eae679 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,7 @@ "esModuleInterop": true, "experimentalDecorators": true, "forceConsistentCasingInFileNames": true, + "isolatedModules": true, "lib": ["DOM", "DOM.Iterable", "ES2023", "ScriptHost"], "module": "NodeNext", "moduleResolution": "NodeNext", @@ -21,6 +22,7 @@ "target": "es2023", "types": ["node"], "useDefineForClassFields": false, + "verbatimModuleSyntax": true, "paths": { "openclaw/extension-api": ["./src/extensionAPI.ts"], "openclaw/plugin-sdk": ["./src/plugin-sdk/index.ts"], diff --git a/ui/src/ui/app-render.helpers.ts b/ui/src/ui/app-render.helpers.ts index 3e4440e1d27..a4d144f6efa 100644 --- a/ui/src/ui/app-render.helpers.ts +++ b/ui/src/ui/app-render.helpers.ts @@ -10,7 +10,8 @@ import { } from "./chat/session-controls.ts"; import { refreshSlashCommands } from "./chat/slash-commands.ts"; import { resolveControlUiAuthToken } from "./control-ui-auth.ts"; -import { ChatState, loadChatHistory } from "./controllers/chat.ts"; +import { loadChatHistory } from "./controllers/chat.ts"; +import type { ChatState } from "./controllers/chat.ts"; import { createSessionAndRefresh, loadSessions, diff --git a/ui/src/ui/controllers/channels.ts b/ui/src/ui/controllers/channels.ts index a36a7a89a8e..6f6f506d873 100644 --- a/ui/src/ui/controllers/channels.ts +++ b/ui/src/ui/controllers/channels.ts @@ -1,4 +1,4 @@ -import { ChannelsStatusSnapshot } from "../types.ts"; +import type { ChannelsStatusSnapshot } from "../types.ts"; import type { ChannelsState } from "./channels.types.ts"; import { formatMissingOperatorReadScopeMessage, diff --git a/ui/src/ui/views/usage-metrics.ts b/ui/src/ui/views/usage-metrics.ts index aa862f4a288..8f2ea1ff86a 100644 --- a/ui/src/ui/views/usage-metrics.ts +++ b/ui/src/ui/views/usage-metrics.ts @@ -6,7 +6,7 @@ import { } from "../../../../src/shared/usage-aggregates.js"; import { t } from "../../i18n/index.ts"; import { normalizeLowercaseStringOrEmpty } from "../string-coerce.ts"; -import { UsageSessionEntry, UsageTotals, UsageAggregates } from "./usageTypes.ts"; +import type { UsageSessionEntry, UsageTotals, UsageAggregates } from "./usageTypes.ts"; const CHARS_PER_TOKEN = 4; diff --git a/ui/src/ui/views/usage-query.ts b/ui/src/ui/views/usage-query.ts index ab8766256c4..d9696ac2c8c 100644 --- a/ui/src/ui/views/usage-query.ts +++ b/ui/src/ui/views/usage-query.ts @@ -1,6 +1,6 @@ import { normalizeLowercaseStringOrEmpty } from "../string-coerce.ts"; import { extractQueryTerms } from "../usage-helpers.ts"; -import { CostDailyEntry, UsageAggregates, UsageSessionEntry } from "./usageTypes.ts"; +import type { CostDailyEntry, UsageAggregates, UsageSessionEntry } from "./usageTypes.ts"; function downloadTextFile(filename: string, content: string, type = "text/plain") { const blob = new Blob([content], { type: `${type};charset=utf-8` }); diff --git a/ui/src/ui/views/usage-render-details.ts b/ui/src/ui/views/usage-render-details.ts index 743db503539..f09aa78ae4b 100644 --- a/ui/src/ui/views/usage-render-details.ts +++ b/ui/src/ui/views/usage-render-details.ts @@ -5,7 +5,7 @@ import { normalizeLowercaseStringOrEmpty } from "../string-coerce.ts"; import { parseToolSummary } from "../usage-helpers.ts"; import { charsToTokens, formatCost, formatTokens } from "./usage-metrics.ts"; import { renderInsightList } from "./usage-render-overview.ts"; -import { +import type { SessionLogEntry, SessionLogRole, TimeSeriesPoint, diff --git a/ui/src/ui/views/usage-render-overview.ts b/ui/src/ui/views/usage-render-overview.ts index 70b0877fc4c..31432ebf467 100644 --- a/ui/src/ui/views/usage-render-overview.ts +++ b/ui/src/ui/views/usage-render-overview.ts @@ -2,14 +2,9 @@ import { html, nothing } from "lit"; import { formatDurationCompact } from "../../../../src/infra/format-time/format-duration.ts"; import { t } from "../../i18n/index.ts"; import { normalizeLowercaseStringOrEmpty } from "../string-coerce.ts"; -import { - formatCost, - formatDayLabel, - formatFullDate, - formatTokens, - UsageInsightStats, -} from "./usage-metrics.ts"; -import { +import { formatCost, formatDayLabel, formatFullDate, formatTokens } from "./usage-metrics.ts"; +import type { UsageInsightStats } from "./usage-metrics.ts"; +import type { UsageAggregates, UsageColumnId, UsageSessionEntry, diff --git a/ui/src/ui/views/usage.ts b/ui/src/ui/views/usage.ts index 33307fef43d..c12d0e2b6d4 100644 --- a/ui/src/ui/views/usage.ts +++ b/ui/src/ui/views/usage.ts @@ -31,7 +31,7 @@ import { renderSessionsCard, renderUsageInsights, } from "./usage-render-overview.ts"; -import { +import type { SessionLogEntry, SessionLogRole, UsageColumnId,