Skip to content

Commit fac9341

Browse files
feat: 全面清理类型错误 — tsc 零错误,any 标注全部消除
- 修复所有 33 个原始 tsc 编译错误(ink JSX 声明、类型不匹配、null check 等) - 清理 176 处 `: any` 类型标注,全部替换为具体推断类型 - 修复清理过程中引入的 41 个回归错误 - 最终结果:0 tsc 错误,0 个非注释 any 标注 - Build 验证通过(25.75MB bundle) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 58f1bd4 commit fac9341

129 files changed

Lines changed: 555 additions & 252 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bun.lock

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
"zod": "^4.3.6"
120120
},
121121
"devDependencies": {
122+
"@biomejs/biome": "^2.4.10",
122123
"@types/bun": "^1.3.11",
123124
"@types/cacache": "^20.0.1",
124125
"@types/plist": "^3.0.5",

src/QueryEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ export async function* ask({
12761276
tools,
12771277
commands,
12781278
mcpClients,
1279-
agents,
1279+
agents: agents ?? [],
12801280
canUseTool,
12811281
getAppState,
12821282
setAppState,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Auto-generated stub — replace with real implementation
22
export {};
3-
export const AssistantSessionChooser: any = (() => {}) as any;
3+
export const AssistantSessionChooser: (props: Record<string, unknown>) => null = () => null;

src/assistant/gate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Auto-generated stub — replace with real implementation
22
export {};
3-
export const isKairosEnabled: any = (() => {}) as any;
3+
export const isKairosEnabled: () => Promise<boolean> = () => Promise.resolve(false);

src/assistant/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Auto-generated stub — replace with real implementation
22
export {};
3-
export const isAssistantMode: any = (() => {}) as any;
4-
export const initializeAssistantTeam: any = (() => {}) as any;
5-
export const markAssistantForced: any = (() => {}) as any;
6-
export const isAssistantForced: any = (() => {}) as any;
7-
export const getAssistantSystemPromptAddendum: any = (() => {}) as any;
8-
export const getAssistantActivationPath: any = (() => {}) as any;
3+
export const isAssistantMode: () => boolean = () => false;
4+
export const initializeAssistantTeam: () => Promise<void> = async () => {};
5+
export const markAssistantForced: () => void = () => {};
6+
export const isAssistantForced: () => boolean = () => false;
7+
export const getAssistantSystemPromptAddendum: () => string = () => '';
8+
export const getAssistantActivationPath: () => string | undefined = () => undefined;

src/assistant/sessionDiscovery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Auto-generated stub — replace with real implementation
2-
export type AssistantSession = any;
3-
export const discoverAssistantSessions: any = (() => {}) as any;
2+
export type AssistantSession = { id: string; [key: string]: unknown };
3+
export const discoverAssistantSessions: () => Promise<AssistantSession[]> = () => Promise.resolve([]);

src/bridge/peerSessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Auto-generated stub — replace with real implementation
22
export {};
3-
export const postInterClaudeMessage: any = (() => {}) as any;
3+
export const postInterClaudeMessage: (target: string, message: string) => Promise<{ ok: boolean; error?: string }> = () => Promise.resolve({ ok: false });

src/bridge/webhookSanitizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// Auto-generated stub — replace with real implementation
22
export {};
3-
export const sanitizeInboundWebhookContent: any = (() => {}) as any;
3+
export const sanitizeInboundWebhookContent: (content: string) => string = (content) => content;

src/cli/bg.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Auto-generated stub — replace with real implementation
22
export {};
3-
export const psHandler: any = (() => {}) as any;
4-
export const logsHandler: any = (() => {}) as any;
5-
export const attachHandler: any = (() => {}) as any;
6-
export const killHandler: any = (() => {}) as any;
7-
export const handleBgFlag: any = (() => {}) as any;
3+
export const psHandler: (args: string[]) => Promise<void> = (async () => {}) as (args: string[]) => Promise<void>;
4+
export const logsHandler: (sessionId: string | undefined) => Promise<void> = (async () => {}) as (sessionId: string | undefined) => Promise<void>;
5+
export const attachHandler: (sessionId: string | undefined) => Promise<void> = (async () => {}) as (sessionId: string | undefined) => Promise<void>;
6+
export const killHandler: (sessionId: string | undefined) => Promise<void> = (async () => {}) as (sessionId: string | undefined) => Promise<void>;
7+
export const handleBgFlag: (args: string[]) => Promise<void> = (async () => {}) as (args: string[]) => Promise<void>;

0 commit comments

Comments
 (0)