chore(typecheck): tsc 基线 62→26,补 @agentclientprotocol/sdk,daemon 可用

变化:
- 添加 @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 持久会话功能。
This commit is contained in:
James Feng 2026-06-02 11:12:38 +08:00
parent fa954535b0
commit 0174a8edca
9 changed files with 68 additions and 25 deletions

View File

@ -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=="],

View File

@ -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",

View File

@ -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

View File

@ -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",

View File

@ -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}`,
}),
],
}

View File

@ -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. */

View File

@ -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<string> {
return new Set()
}
/** Search for deferred tools by query string. */

View File

@ -1,3 +1,12 @@
// Auto-generated stub — replace with real implementation
export const sendToUdsSocket: (target: string, message: string) => Promise<void> = async () => {};
export const listAllLiveSessions: () => Promise<Array<{ kind?: string; sessionId?: string }>> = 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<PeerInfo[]> {
return []
}

View File

@ -1,3 +1,15 @@
// Auto-generated stub — replace with real implementation
export const startUdsMessaging: (socketPath: string, options: { isExplicit: boolean }) => Promise<void> = 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<void> = 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 ''
}