From 0174a8edca748afe615b0f7a06b7fae14999ab2a Mon Sep 17 00:00:00 2001 From: James Feng <47167674+GhostDragon124@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:12:38 +0800 Subject: [PATCH] =?UTF-8?q?chore(typecheck):=20tsc=20=E5=9F=BA=E7=BA=BF=20?= =?UTF-8?q?62=E2=86=9226=EF=BC=8C=E8=A1=A5=20@agentclientprotocol/sdk?= =?UTF-8?q?=EF=BC=8Cdaemon=20=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 变化: - 添加 @agentclientprotocol/sdk@^0.19.0 依赖(Codex 操作) - 修复 win32.ts 跨包导入 → 构建恢复(CC_Pure Linux stub) - 固定 @stricli/core@1.2.6 消除部分 acp-link 类型错误(Codex 操作) - ExecuteTool / searchExtraTools / udsClient / udsMessaging 类型补全 - tsc 错误:62 → 26(-58%) - bun run build: ✅ 562 files - bun test: ✅ 3346 pass / 4 fail / 2 errors / 4 skip - strace: ✅ 零外连(遥测完全清除) - daemon supervisor: ✅ 可用(需先信任 workspace) 剩余 26 个 tsc 错误全在 Bridge/UDS/TCP/ACP 远程控制层, 不影响本地 CLI + daemon 持久会话功能。 --- bun.lock | 9 ++++++-- package.json | 4 +++- .../computer-use-swift/src/backends/win32.ts | 8 +++++-- packages/acp-link/package.json | 2 +- .../src/tools/ExecuteTool/ExecuteTool.ts | 3 ++- src/services/searchExtraTools/toolIndex.ts | 22 ++++++++++++++----- src/utils/searchExtraTools.ts | 12 +++++----- src/utils/udsClient.ts | 15 ++++++++++--- src/utils/udsMessaging.ts | 18 ++++++++++++--- 9 files changed, 68 insertions(+), 25 deletions(-) diff --git a/bun.lock b/bun.lock index 099a7f3ae..7d9e7000a 100644 --- a/bun.lock +++ b/bun.lock @@ -4,6 +4,9 @@ "workspaces": { "": { "name": "claude-code-best", + "dependencies": { + "@agentclientprotocol/sdk": "^0.19.0", + }, "devDependencies": { "@alcalzone/ansi-tokenize": "^0.3.0", "@ant/claude-for-chrome-mcp": "workspace:*", @@ -184,7 +187,7 @@ "@hono/node-server": "^2.0.0", "@hono/node-ws": "^1.0.5", "@stricli/auto-complete": "^1.2.4", - "@stricli/core": "^1.2.4", + "@stricli/core": "1.2.6", "hono": "^4.12.15", "pino": "^10.3.0", "pino-pretty": "^13.1.3", @@ -949,7 +952,7 @@ "@stricli/auto-complete": ["@stricli/auto-complete@1.2.7", "https://registry.npmmirror.com/@stricli/auto-complete/-/auto-complete-1.2.7.tgz", { "dependencies": { "@stricli/core": "^1.2.7" }, "bin": { "auto-complete": "dist/bin/cli.js" } }, "sha512-i7tuoYJvBLRVxvjVhzmZJjPPq1f6jVHU118EgVNW82rkbRuSOjTlUH6DY/d8BXfrDg9DemuDtaGmiL1OvPwcPA=="], - "@stricli/core": ["@stricli/core@1.2.7", "https://registry.npmmirror.com/@stricli/core/-/core-1.2.7.tgz", {}, "sha512-a0HxA/cSWjqHj/9GM+cfc/zGNmBdxVTQQpHIEvY1AbDEgo4ZU84cTCbtywYEQOHw2wIc6Vu+PKv+ZQoqZwkHnQ=="], + "@stricli/core": ["@stricli/core@1.2.6", "https://registry.npmmirror.com/@stricli/core/-/core-1.2.6.tgz", {}, "sha512-j5fa1wyOLrP9WJqqLFEJeQviqb3cK46K+FXTuISEkG/H5C820YfKDoVQ3CDVdM5WLhEx1ARdpiW6+hU4tYHjCQ=="], "@tailwindcss/node": ["@tailwindcss/node@4.3.0", "https://registry.npmmirror.com/@tailwindcss/node/-/node-4.3.0.tgz", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.21.0", "jiti": "^2.6.1", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.0" } }, "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g=="], @@ -2051,6 +2054,8 @@ "@smithy/util-utf8/@smithy/util-buffer-from": ["@smithy/util-buffer-from@3.0.0", "https://registry.npmmirror.com/@smithy/util-buffer-from/-/util-buffer-from-3.0.0.tgz", { "dependencies": { "@smithy/is-array-buffer": "^3.0.0", "tslib": "^2.6.2" } }, "sha512-aEOHCgq5RWFbP+UDPvPot26EJHjOC+bRgse5A8V3FSShqd5E5UN4qc7zkwsvJPPAVsf73QwYcHN1/gt/rtLwQA=="], + "@stricli/auto-complete/@stricli/core": ["@stricli/core@1.2.7", "https://registry.npmmirror.com/@stricli/core/-/core-1.2.7.tgz", {}, "sha512-a0HxA/cSWjqHj/9GM+cfc/zGNmBdxVTQQpHIEvY1AbDEgo4ZU84cTCbtywYEQOHw2wIc6Vu+PKv+ZQoqZwkHnQ=="], + "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.10.0", "https://registry.npmmirror.com/@emnapi/core/-/core-1.10.0.tgz", { "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" }, "bundled": true }, "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw=="], "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.10.0", "https://registry.npmmirror.com/@emnapi/runtime/-/runtime-1.10.0.tgz", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA=="], diff --git a/package.json b/package.json index cd3e627ed..6f1514ae5 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,9 @@ "docs:dev": "npx mintlify dev", "rcs": "bun run scripts/rcs.ts" }, - "dependencies": {}, + "dependencies": { + "@agentclientprotocol/sdk": "^0.19.0" + }, "devDependencies": { "vite": "^6.0.0", "openai": "^6.33.0", diff --git a/packages/@ant/computer-use-swift/src/backends/win32.ts b/packages/@ant/computer-use-swift/src/backends/win32.ts index 70f006bf1..340564cbd 100644 --- a/packages/@ant/computer-use-swift/src/backends/win32.ts +++ b/packages/@ant/computer-use-swift/src/backends/win32.ts @@ -11,8 +11,12 @@ import type { SwiftBackend, WindowDisplayInfo, } from '../types.js' -import { listWindows } from 'src/utils/computerUse/win32/windowEnum.js' -import { captureWindow, captureWindowByHwnd } from 'src/utils/computerUse/win32/windowCapture.js' +// CC_Pure: Linux-native build — Win32 imports stubbed (cross-package resolution unavailable) +// Original: import { listWindows } from 'src/utils/computerUse/win32/windowEnum.js' +// Original: import { captureWindow, captureWindowByHwnd } from 'src/utils/computerUse/win32/windowCapture.js' +const listWindows = null as any +const captureWindow = null as any +const captureWindowByHwnd = null as any // --------------------------------------------------------------------------- // PowerShell helper diff --git a/packages/acp-link/package.json b/packages/acp-link/package.json index e26596657..ac700326f 100644 --- a/packages/acp-link/package.json +++ b/packages/acp-link/package.json @@ -29,7 +29,7 @@ "@hono/node-server": "^2.0.0", "@hono/node-ws": "^1.0.5", "@stricli/auto-complete": "^1.2.4", - "@stricli/core": "^1.2.4", + "@stricli/core": "1.2.6", "hono": "^4.12.15", "pino": "^10.3.0", "pino-pretty": "^13.1.3", diff --git a/packages/builtin-tools/src/tools/ExecuteTool/ExecuteTool.ts b/packages/builtin-tools/src/tools/ExecuteTool/ExecuteTool.ts index d731713a6..a0287595f 100644 --- a/packages/builtin-tools/src/tools/ExecuteTool/ExecuteTool.ts +++ b/packages/builtin-tools/src/tools/ExecuteTool/ExecuteTool.ts @@ -7,6 +7,7 @@ import { type ToolUseContext, type ToolResult, type Tools, + type ValidationResult, } from 'src/Tool.js' import { lazySchema } from 'src/utils/lazySchema.js' import { createUserMessage } from 'src/utils/messages.js' @@ -137,7 +138,7 @@ export const ExecuteTool = buildTool({ }, newMessages: [ createUserMessage({ - content: `Invalid parameters for tool "${input.tool_name}": ${validation.message}`, + content: `Invalid parameters for tool "${input.tool_name}": ${(validation as ValidationResult & { message: string }).message}`, }), ], } diff --git a/src/services/searchExtraTools/toolIndex.ts b/src/services/searchExtraTools/toolIndex.ts index 85997d65b..528eb6293 100644 --- a/src/services/searchExtraTools/toolIndex.ts +++ b/src/services/searchExtraTools/toolIndex.ts @@ -1,13 +1,19 @@ /** * Stub — searchExtraTools/toolIndex module. * CC_Pure defers tool indexing to the main tool registry. - * This stub provides the minimum type surface. + * This stub provides the minimum type surface for typecheck passage. */ -export interface SearchExtraToolsResult { - tools: ToolIndexEntry[] +export interface SearchExtraToolResult { + name: string + description: string + score: number + inputSchema?: unknown } +// Legacy alias for compatibility +export type SearchExtraToolsResult = SearchExtraToolResult + export interface ToolIndexEntry { name: string description: string @@ -15,13 +21,17 @@ export interface ToolIndexEntry { } /** Get the current tool index. */ -export function getToolIndex(): ToolIndexEntry[] { +export function getToolIndex(_deferredTools?: unknown[]): SearchExtraToolResult[] { return [] } /** Search tools in the index by query string. */ -export function searchTools(_query: string): SearchExtraToolsResult { - return { tools: [] } +export function searchTools( + _query: string, + _index: SearchExtraToolResult[], + _maxResults?: number, +): SearchExtraToolResult[] { + return [] } /** Build a search index of all available deferred tools. */ diff --git a/src/utils/searchExtraTools.ts b/src/utils/searchExtraTools.ts index 979785dea..13ef268e7 100644 --- a/src/utils/searchExtraTools.ts +++ b/src/utils/searchExtraTools.ts @@ -9,16 +9,16 @@ export function isSearchExtraToolsEnabledOptimistic(): boolean { return false } -/** Check if SearchExtraTools tool is available. */ -export function isSearchExtraToolsToolAvailable(): boolean { +/** Check if SearchExtraTools tool is available in the given tool list. */ +export function isSearchExtraToolsToolAvailable(_tools: unknown): boolean { return false } -/** Extract discovered tool names from a search result. */ +/** Extract discovered tool names from conversation messages. */ export function extractDiscoveredToolNames( - _result: unknown, -): string[] { - return [] + _messages: unknown[], +): Set { + return new Set() } /** Search for deferred tools by query string. */ diff --git a/src/utils/udsClient.ts b/src/utils/udsClient.ts index fdadc94d1..a9f378eee 100644 --- a/src/utils/udsClient.ts +++ b/src/utils/udsClient.ts @@ -1,3 +1,12 @@ -// Auto-generated stub — replace with real implementation -export const sendToUdsSocket: (target: string, message: string) => Promise = async () => {}; -export const listAllLiveSessions: () => Promise> = async () => []; +// Stub — UDS client for peer discovery. CC_Pure keeps core remote-control. +// Full UDS mesh is disabled; these stubs satisfy the typechecker. + +export interface PeerInfo { + peerId: string + socketPath: string +} + +/** List connected peers on the UDS mesh. */ +export async function listPeers(): Promise { + return [] +} diff --git a/src/utils/udsMessaging.ts b/src/utils/udsMessaging.ts index 3f717be6f..8b3ccda34 100644 --- a/src/utils/udsMessaging.ts +++ b/src/utils/udsMessaging.ts @@ -1,3 +1,15 @@ -// Auto-generated stub — replace with real implementation -export const startUdsMessaging: (socketPath: string, options: { isExplicit: boolean }) => Promise = async () => {}; -export const getDefaultUdsSocketPath: () => string = () => ''; +// Stub — UDS messaging utilities. CC_Pure keeps core remote-control. +// Full UDS mesh is disabled; these stubs satisfy the typechecker. + +export const startUdsMessaging: (socketPath: string, options: { isExplicit: boolean }) => Promise = async () => {} +export const getDefaultUdsSocketPath: () => string = () => '' + +/** Get the UDS messaging socket path for the current peer. */ +export function getUdsMessagingSocketPath(): string { + return '' +} + +/** Format a UDS address for display. */ +export function formatUdsAddress(_socketPath: string): string { + return '' +}