diff --git a/.oxlintrc.json b/.oxlintrc.json index f9acdbea8..e1e7383d2 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -16,6 +16,7 @@ "oxc/no-map-spread": "off", "typescript/no-explicit-any": "error", "typescript/no-extraneous-class": "off", + "typescript/no-redundant-type-constituents": "off", "typescript/no-unsafe-type-assertion": "off", "unicorn/consistent-function-scoping": "off", "unicorn/require-post-message-target-origin": "off" diff --git a/package.json b/package.json index 51d28d50c..951f3d79a 100644 --- a/package.json +++ b/package.json @@ -105,9 +105,9 @@ "ios:gen": "cd apps/ios && xcodegen generate", "ios:open": "cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj", "ios:run": "bash -lc 'cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'", - "lint": "oxlint --type-aware", + "lint": "oxlint --type-aware --tsconfig tsconfig.oxlint.json", "lint:all": "pnpm lint && pnpm lint:swift", - "lint:fix": "oxlint --type-aware --fix && pnpm format:fix", + "lint:fix": "oxlint --type-aware --tsconfig tsconfig.oxlint.json --fix && pnpm format:fix", "lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)", "mac:open": "open dist/OpenClaw.app", "mac:package": "bash scripts/package-mac-app.sh", diff --git a/src/agents/auth-profiles/oauth.ts b/src/agents/auth-profiles/oauth.ts index a77a38622..b5a52dd27 100644 --- a/src/agents/auth-profiles/oauth.ts +++ b/src/agents/auth-profiles/oauth.ts @@ -20,7 +20,7 @@ const OAUTH_PROVIDER_IDS = new Set( ); const isOAuthProvider = (provider: string): provider is OAuthProvider => - OAUTH_PROVIDER_IDS.has(provider); + OAUTH_PROVIDER_IDS.has(provider as OAuthProvider); const resolveOAuthProvider = (provider: string): OAuthProvider | null => isOAuthProvider(provider) ? provider : null; diff --git a/src/agents/pi-embedded-runner/system-prompt.ts b/src/agents/pi-embedded-runner/system-prompt.ts index 6384bc7e4..b20be1b11 100644 --- a/src/agents/pi-embedded-runner/system-prompt.ts +++ b/src/agents/pi-embedded-runner/system-prompt.ts @@ -74,8 +74,11 @@ export function buildEmbeddedSystemPrompt(params: { }); } -export function createSystemPromptOverride(systemPrompt: string): string { - return systemPrompt.trim(); +export function createSystemPromptOverride( + systemPrompt: string, +): (defaultPrompt?: string) => string { + const override = systemPrompt.trim(); + return (_defaultPrompt?: string) => override; } export function applySystemPromptOverrideToSession(session: AgentSession, override: string) { diff --git a/src/agents/pi-tool-definition-adapter.ts b/src/agents/pi-tool-definition-adapter.ts index 12f766766..a190f6dae 100644 --- a/src/agents/pi-tool-definition-adapter.ts +++ b/src/agents/pi-tool-definition-adapter.ts @@ -40,9 +40,9 @@ export function toToolDefinitions(tools: AnyAgentTool[]): ToolDefinition[] { execute: async ( toolCallId, params, - signal, onUpdate: AgentToolUpdateCallback | undefined, _ctx, + signal, ): Promise> => { try { return await tool.execute(toolCallId, params, signal, onUpdate); @@ -91,9 +91,9 @@ export function toClientToolDefinitions( execute: async ( toolCallId, params, - _signal, _onUpdate: AgentToolUpdateCallback | undefined, _ctx, + _signal, ): Promise> => { const outcome = await runBeforeToolCallHook({ toolName: func.name, diff --git a/tsconfig.oxlint.json b/tsconfig.oxlint.json new file mode 100644 index 000000000..bfec7fc55 --- /dev/null +++ b/tsconfig.oxlint.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["DOM", "DOM.Iterable", "ES2023", "ScriptHost"], + "noEmit": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true, + "target": "es2023" + }, + "include": ["src/**/*.ts", "extensions/**/*.ts"], + "exclude": ["node_modules", "dist"] +}