Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.env.*
!.env.example
node_modules

dist/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ echo "explain this code" | ./bin/claude-haha -p
./bin/claude-haha --help
```

### 5. 编译

```bash
bun run build

```


#### Windows

> **前置要求**:必须安装 [Git for Windows](https://git-scm.com/download/win)(提供 Git Bash,项目内部 Shell 执行依赖它)。
Expand Down
814 changes: 814 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
},
"scripts": {
"claude-haha": "bun run ./bin/claude-haha",
"start": "bun run ./bin/claude-haha"
"start": "bun run ./bin/claude-haha",
"build": "bun build ./src/entrypoints/cli-bundle.tsx --compile --outfile ./dist/claude-haha.exe --target=bun --external sharp --external fflate --external turndown --external \"@aws-sdk/client-bedrock\" --external \"@aws-sdk/client-sts\" --external \"@anthropic-ai/bedrock-sdk\" --external \"@anthropic-ai/foundry-sdk\" --external \"@anthropic-ai/vertex-sdk\" --external \"@azure/identity\" --external \"@opentelemetry/exporter-metrics-otlp-grpc\" --external \"@opentelemetry/exporter-metrics-otlp-http\" --external \"@opentelemetry/exporter-metrics-otlp-proto\" --external \"@opentelemetry/exporter-prometheus\" --external \"@opentelemetry/exporter-logs-otlp-grpc\" --external \"@opentelemetry/exporter-logs-otlp-http\" --external \"@opentelemetry/exporter-logs-otlp-proto\" --external \"@opentelemetry/exporter-trace-otlp-grpc\" --external \"@opentelemetry/exporter-trace-otlp-http\" --external \"@opentelemetry/exporter-trace-otlp-proto\" --external \"@anthropic-ai/mcpb\""
},
"dependencies": {
"@anthropic-ai/sandbox-runtime": "^0.0.44",
Expand Down Expand Up @@ -73,5 +74,9 @@
"xss": "^1.0.15",
"yaml": "^2.8.3",
"zod": "^4.3.6"
},
"devDependencies": {
"@types/node": "^25.5.0",
"bun-types": "^1.3.11"
}
}
1 change: 1 addition & 0 deletions src/SendUserFileTool/prompt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
9 changes: 9 additions & 0 deletions src/assistant/AssistantSessionChooser.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

export function AssistantSessionChooser(props: {
sessions: unknown[]
onSelect: (id: string | null) => void
onCancel: () => void
}) {
return React.createElement('div', null, 'AssistantSessionChooser stub')
}
1 change: 1 addition & 0 deletions src/assistant/gate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
2 changes: 2 additions & 0 deletions src/assistant/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default null
export const isAssistantMode = (): boolean => false
5 changes: 5 additions & 0 deletions src/assistant/sessionDiscovery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type AssistantSession = {
id: string
name?: string
createdAt?: string
}
1 change: 1 addition & 0 deletions src/bridge/webhookSanitizer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
1 change: 1 addition & 0 deletions src/commands/agents-platform/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null
14 changes: 14 additions & 0 deletions src/commands/assistant/assistant.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react'

export function NewInstallWizard(props: {
defaultDir: string
onInstalled: (dir: string) => void
onCancel: () => void
onError: (message: string) => void
}) {
return React.createElement('div', null, 'NewInstallWizard stub')
}

export async function computeDefaultInstallDir(): Promise<string> {
return ''
}
1 change: 1 addition & 0 deletions src/commands/buddy/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null
1 change: 1 addition & 0 deletions src/commands/fork/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null
1 change: 1 addition & 0 deletions src/commands/peers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null
1 change: 1 addition & 0 deletions src/commands/workflows/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default null
11 changes: 11 additions & 0 deletions src/components/agents/SnapshotUpdateDialog.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'

export function SnapshotUpdateDialog(props: {
agentType: string
scope: unknown
snapshotTimestamp: string
onComplete: (result: 'merge' | 'keep' | 'replace') => void
onCancel: () => void
}) {
return React.createElement('div', null, 'SnapshotUpdateDialog stub')
}
5 changes: 5 additions & 0 deletions src/constants/querySource.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const enum QuerySource {
USER = 'user',
SYSTEM = 'system',
TOOL = 'tool',
}
1 change: 1 addition & 0 deletions src/daemon/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
1 change: 1 addition & 0 deletions src/daemon/workerRegistry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
20 changes: 20 additions & 0 deletions src/entrypoints/cli-bundle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const version = process.env.CLAUDE_CODE_LOCAL_VERSION ?? '999.0.0-local';
const packageUrl = process.env.CLAUDE_CODE_LOCAL_PACKAGE_URL ?? 'claude-code-local';
const buildTime = process.env.CLAUDE_CODE_LOCAL_BUILD_TIME ?? new Date().toISOString();

process.env.CLAUDE_CODE_LOCAL_SKIP_REMOTE_PREFETCH ??= '1';

Object.assign(globalThis, {
MACRO: {
VERSION: version,
PACKAGE_URL: packageUrl,
NATIVE_PACKAGE_URL: packageUrl,
BUILD_TIME: buildTime,
FEEDBACK_CHANNEL: 'local',
VERSION_CHANGELOG: '',
ISSUES_EXPLAINER: '',
},
});

await import('./cli.js');
export {};
4 changes: 4 additions & 0 deletions src/entrypoints/sdk/controlTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export type SDKControlRequest = unknown
export type SDKResultSuccess = { ok: true }
export type SDKResultFailure = { ok: false; error: string }
export type SDKResult = SDKResultSuccess | SDKResultFailure
2 changes: 2 additions & 0 deletions src/ink/devtools.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// devtools stub - only used in development
export {}
1 change: 1 addition & 0 deletions src/jobs/classifier.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
1 change: 1 addition & 0 deletions src/memdir/memoryShapeTelemetry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
1 change: 1 addition & 0 deletions src/oauth/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
4 changes: 4 additions & 0 deletions src/proactive/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const isProactiveActive = (): boolean => false
export const isProactivePaused = (): boolean => false
export const activateProactive = (): void => {}
export const deactivateProactive = (): void => {}
11 changes: 11 additions & 0 deletions src/services/compact/cachedMicrocompact.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface CachedMCState {
// stub
}

export interface CacheEditsBlock {
// stub
}

export function createCachedMCState(): CachedMCState {
return {}
}
9 changes: 9 additions & 0 deletions src/services/compact/snipCompact.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { Message } from '../../types/message.js'

export function isSnipRuntimeEnabled(): boolean {
return false
}

export function shouldNudgeForSnips(messages: Message[]): boolean {
return false
}
1 change: 1 addition & 0 deletions src/services/contextCollapse/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isContextCollapseEnabled = (): boolean => false
1 change: 1 addition & 0 deletions src/services/sessionTranscript/sessionTranscript.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const flushOnDateChange: (() => void) | null = null
1 change: 1 addition & 0 deletions src/services/skillSearch/featureCheck.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const isSkillSearchEnabled = (): boolean => false
1 change: 1 addition & 0 deletions src/services/skillSearch/localSearch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const clearSkillIndexCache: (() => void) | null = null
1 change: 1 addition & 0 deletions src/services/skillSearch/prefetch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getTurnZeroSkillDiscovery: (() => unknown) | null = null
5 changes: 5 additions & 0 deletions src/services/skillSearch/signals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export type DiscoverySignal = unknown
export const enum SignalType {
FILE_CHANGE = 'file_change',
GIT_CHANGE = 'git_change',
}
1 change: 1 addition & 0 deletions src/tools/DiscoverSkillsTool/prompt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
3 changes: 3 additions & 0 deletions src/tools/REPLTool/REPLTool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { Tool } from '../../Tool.js'

export const REPLTool: Tool | null = null
1 change: 1 addition & 0 deletions src/tools/SendUserFileTool/prompt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
1 change: 1 addition & 0 deletions src/tools/SnipTool/prompt.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
3 changes: 3 additions & 0 deletions src/tools/SuggestBackgroundPRTool/SuggestBackgroundPRTool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { Tool } from '../../Tool.js'

export const SuggestBackgroundPRTool: Tool | null = null
3 changes: 3 additions & 0 deletions src/tools/VerifyPlanExecutionTool/VerifyPlanExecutionTool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { Tool } from '../../Tool.js'

export const VerifyPlanExecutionTool: Tool | null = null
1 change: 1 addition & 0 deletions src/tools/WebBrowserTool/WebBrowserPanel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
1 change: 1 addition & 0 deletions src/tools/WorkflowTool/createWorkflowCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const getWorkflowCommands: ((cwd: string) => Promise<unknown[]>) | null = null
1 change: 1 addition & 0 deletions src/transports/Transport.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {}
13 changes: 13 additions & 0 deletions src/types/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
declare const MACRO: {
VERSION: string
PACKAGE_URL: string
NATIVE_PACKAGE_URL: string
BUILD_TIME: string
FEEDBACK_CHANNEL: string
VERSION_CHANGELOG: string
ISSUES_EXPLAINER: string
}

declare module 'bun:bundle' {
export function feature(name: string): boolean
}
8 changes: 8 additions & 0 deletions src/types/message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export type Message = Record<string, unknown>
export type MessageContent = unknown
export type MessageRole = 'user' | 'assistant' | 'system'
export const enum QuerySource {
USER = 'user',
SYSTEM = 'system',
TOOL = 'tool',
}
3 changes: 3 additions & 0 deletions src/utils/protectedNamespace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function checkProtectedNamespace(): boolean {
return false
}
19 changes: 7 additions & 12 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@
"jsx": "react-jsx",
"baseUrl": ".",
"paths": {
"@ant/claude-for-chrome-mcp": [
"./stubs/ant-claude-for-chrome-mcp.ts"
],
"color-diff-napi": [
"./stubs/color-diff-napi.ts"
],
"src/*": [
"./src/*"
]
"@ant/claude-for-chrome-mcp": ["./stubs/ant-claude-for-chrome-mcp.ts"],
"color-diff-napi": ["./stubs/color-diff-napi.ts"],
"src/*": ["./src/*"]
},
"types": [
"bun-types"
]
"types": ["bun-types", "./src/types/global.d.ts"],
"skipLibCheck": true,
"noEmit": true,
"strict": false
}
}