bingocode 1.0.41 → 1.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/bin/bingo-win.cjs +2 -1
  2. package/bin/bingocode-win.cjs +2 -1
  3. package/bin/claude-win.cjs +2 -1
  4. package/bun.lock +1716 -0
  5. package/package.json +14 -2
  6. package/src/server/config/providers.yaml +1 -1
  7. package/src/server/proxy/transform/anthropicToOpenaiChat.ts +11 -4
  8. package/adapters/README.md +0 -87
  9. package/adapters/common/__tests__/chat-queue.test.ts +0 -61
  10. package/adapters/common/__tests__/format.test.ts +0 -148
  11. package/adapters/common/__tests__/http-client.test.ts +0 -105
  12. package/adapters/common/__tests__/message-buffer.test.ts +0 -84
  13. package/adapters/common/__tests__/message-dedup.test.ts +0 -57
  14. package/adapters/common/__tests__/session-store.test.ts +0 -62
  15. package/adapters/common/__tests__/ws-bridge.test.ts +0 -177
  16. package/adapters/common/attachment/__tests__/attachment-limits.test.ts +0 -52
  17. package/adapters/common/attachment/__tests__/attachment-store.test.ts +0 -108
  18. package/adapters/common/attachment/__tests__/image-block-watcher.test.ts +0 -115
  19. package/adapters/common/attachment/attachment-limits.ts +0 -58
  20. package/adapters/common/attachment/attachment-store.ts +0 -121
  21. package/adapters/common/attachment/attachment-types.ts +0 -29
  22. package/adapters/common/attachment/image-block-watcher.ts +0 -94
  23. package/adapters/common/chat-queue.ts +0 -24
  24. package/adapters/common/config.ts +0 -96
  25. package/adapters/common/format.ts +0 -229
  26. package/adapters/common/http-client.ts +0 -107
  27. package/adapters/common/message-buffer.ts +0 -91
  28. package/adapters/common/message-dedup.ts +0 -57
  29. package/adapters/common/pairing.ts +0 -149
  30. package/adapters/common/session-store.ts +0 -60
  31. package/adapters/common/ws-bridge.ts +0 -282
  32. package/adapters/feishu/__tests__/card-errors.test.ts +0 -194
  33. package/adapters/feishu/__tests__/cardkit.test.ts +0 -295
  34. package/adapters/feishu/__tests__/extract-payload.test.ts +0 -77
  35. package/adapters/feishu/__tests__/feishu.test.ts +0 -907
  36. package/adapters/feishu/__tests__/flush-controller.test.ts +0 -290
  37. package/adapters/feishu/__tests__/markdown-style.test.ts +0 -353
  38. package/adapters/feishu/__tests__/media.test.ts +0 -120
  39. package/adapters/feishu/__tests__/streaming-card.test.ts +0 -914
  40. package/adapters/feishu/card-errors.ts +0 -151
  41. package/adapters/feishu/cardkit.ts +0 -294
  42. package/adapters/feishu/extract-payload.ts +0 -95
  43. package/adapters/feishu/flush-controller.ts +0 -149
  44. package/adapters/feishu/index.ts +0 -1275
  45. package/adapters/feishu/markdown-style.ts +0 -212
  46. package/adapters/feishu/media.ts +0 -176
  47. package/adapters/feishu/streaming-card.ts +0 -612
  48. package/adapters/package.json +0 -23
  49. package/adapters/telegram/__tests__/media.test.ts +0 -86
  50. package/adapters/telegram/__tests__/telegram.test.ts +0 -115
  51. package/adapters/telegram/index.ts +0 -754
  52. package/adapters/telegram/media.ts +0 -89
  53. package/adapters/tsconfig.json +0 -18
  54. package/runtime/mac_helper.py +0 -775
  55. package/runtime/requirements-win.txt +0 -7
  56. package/runtime/requirements.txt +0 -6
  57. package/runtime/test_helpers.py +0 -322
  58. package/runtime/win_helper.py +0 -723
  59. package/scripts/count-app-loc.ts +0 -256
  60. package/scripts/release.ts +0 -130
  61. package/start-cli.bat +0 -7
  62. package/stubs/ant-claude-for-chrome-mcp.ts +0 -24
  63. package/stubs/color-diff-napi.ts +0 -45
@@ -1,256 +0,0 @@
1
- import { readdirSync, readFileSync, statSync } from 'node:fs'
2
- import { extname, join, relative, sep } from 'node:path'
3
-
4
- type Bucket = {
5
- files: number
6
- lines: number
7
- nonBlankLines: number
8
- }
9
-
10
- type FileStat = Bucket & {
11
- path: string
12
- extension: string
13
- }
14
-
15
- const root = process.cwd()
16
-
17
- const targetRoots = ['adapters', 'desktop', 'runtime', 'src/server']
18
-
19
- const codeExtensions = new Set([
20
- '.css',
21
- '.cjs',
22
- '.html',
23
- '.js',
24
- '.jsx',
25
- '.mjs',
26
- '.nsh',
27
- '.ps1',
28
- '.py',
29
- '.rs',
30
- '.sh',
31
- '.ts',
32
- '.tsx',
33
- ])
34
-
35
- const excludedDirectoryNames = new Set([
36
- '.cache',
37
- '.git',
38
- '.next',
39
- '.nuxt',
40
- '.omx',
41
- '.parcel-cache',
42
- '.svelte-kit',
43
- '.tauri',
44
- '.turbo',
45
- '.vite',
46
- '.vite-temp',
47
- '__pycache__',
48
- 'build',
49
- 'build-artifacts',
50
- 'coverage',
51
- 'dist',
52
- 'node_modules',
53
- 'out',
54
- 'target',
55
- ])
56
-
57
- const excludedRelativePaths = new Set([
58
- 'desktop/src-tauri/binaries',
59
- 'desktop/src-tauri/icons',
60
- ])
61
-
62
- const files: FileStat[] = []
63
-
64
- function emptyBucket(): Bucket {
65
- return {
66
- files: 0,
67
- lines: 0,
68
- nonBlankLines: 0,
69
- }
70
- }
71
-
72
- function addToBucket(bucket: Bucket, file: FileStat) {
73
- bucket.files += file.files
74
- bucket.lines += file.lines
75
- bucket.nonBlankLines += file.nonBlankLines
76
- }
77
-
78
- function shouldSkipDirectory(path: string) {
79
- const name = path.split(sep).at(-1)
80
- const normalized = relative(root, path).split(sep).join('/')
81
-
82
- return (
83
- Boolean(name && excludedDirectoryNames.has(name)) ||
84
- excludedRelativePaths.has(normalized)
85
- )
86
- }
87
-
88
- function countFile(path: string): FileStat | null {
89
- const extension = extname(path)
90
-
91
- if (!codeExtensions.has(extension)) {
92
- return null
93
- }
94
-
95
- const content = readFileSync(path, 'utf8')
96
- const newlineCount = content.match(/\r\n|\r|\n/g)?.length ?? 0
97
- const lines =
98
- content.length === 0 || content.endsWith('\n') || content.endsWith('\r')
99
- ? newlineCount
100
- : newlineCount + 1
101
- const nonBlankLines = content
102
- .split(/\r\n|\r|\n/)
103
- .filter((line) => line.trim().length > 0).length
104
-
105
- return {
106
- files: 1,
107
- lines,
108
- nonBlankLines,
109
- path: relative(root, path).split(sep).join('/'),
110
- extension,
111
- }
112
- }
113
-
114
- function walk(path: string) {
115
- const stat = statSync(path)
116
-
117
- if (stat.isDirectory()) {
118
- if (shouldSkipDirectory(path)) {
119
- return
120
- }
121
-
122
- for (const entry of readdirSync(path)) {
123
- walk(join(path, entry))
124
- }
125
-
126
- return
127
- }
128
-
129
- if (!stat.isFile()) {
130
- return
131
- }
132
-
133
- const result = countFile(path)
134
- if (result) {
135
- files.push(result)
136
- }
137
- }
138
-
139
- function formatNumber(value: number) {
140
- return value.toLocaleString('en-US')
141
- }
142
-
143
- function printTable(
144
- title: string,
145
- rows: Array<{ name: string } & Bucket>,
146
- nameHeader = 'Group',
147
- ) {
148
- console.log(`\n${title}`)
149
- console.log(`${nameHeader.padEnd(28)} ${'Files'.padStart(7)} ${'Lines'.padStart(9)} ${'Nonblank'.padStart(9)}`)
150
- console.log(`${'-'.repeat(28)} ${'-'.repeat(7)} ${'-'.repeat(9)} ${'-'.repeat(9)}`)
151
-
152
- for (const row of rows) {
153
- console.log(
154
- `${row.name.padEnd(28)} ${formatNumber(row.files).padStart(7)} ${formatNumber(row.lines).padStart(9)} ${formatNumber(row.nonBlankLines).padStart(9)}`,
155
- )
156
- }
157
- }
158
-
159
- function groupBy<T extends string>(getKey: (file: FileStat) => T) {
160
- const result = new Map<T, Bucket>()
161
-
162
- for (const file of files) {
163
- const key = getKey(file)
164
- const bucket = result.get(key) ?? emptyBucket()
165
- addToBucket(bucket, file)
166
- result.set(key, bucket)
167
- }
168
-
169
- return [...result.entries()]
170
- .map(([name, bucket]) => ({ name, ...bucket }))
171
- .sort((left, right) => right.lines - left.lines)
172
- }
173
-
174
- function areaForPath(path: string) {
175
- if (path.startsWith('src/server/')) {
176
- return 'server'
177
- }
178
-
179
- if (path.startsWith('desktop/src/')) {
180
- return 'desktop frontend'
181
- }
182
-
183
- if (path.startsWith('desktop/src-tauri/')) {
184
- return 'desktop tauri'
185
- }
186
-
187
- if (path.startsWith('desktop/')) {
188
- return 'desktop support'
189
- }
190
-
191
- if (path.startsWith('adapters/')) {
192
- return 'adapters'
193
- }
194
-
195
- if (path.startsWith('runtime/')) {
196
- return 'runtime'
197
- }
198
-
199
- return 'other'
200
- }
201
-
202
- function purposeForPath(path: string) {
203
- const fileName = path.split('/').at(-1) ?? ''
204
-
205
- if (
206
- path.includes('/__tests__/') ||
207
- path.includes('/fixtures/') ||
208
- fileName.startsWith('test_') ||
209
- /\.test\.[cm]?[jt]sx?$/.test(path) ||
210
- /\.spec\.[cm]?[jt]sx?$/.test(path)
211
- ) {
212
- return 'tests and fixtures'
213
- }
214
-
215
- return 'product source'
216
- }
217
-
218
- for (const targetRoot of targetRoots) {
219
- walk(join(root, targetRoot))
220
- }
221
-
222
- const total = emptyBucket()
223
- for (const file of files) {
224
- addToBucket(total, file)
225
- }
226
-
227
- const sortedByPath = [...files].sort((left, right) =>
228
- left.path.localeCompare(right.path),
229
- )
230
-
231
- console.log('Desktop app source line count')
232
- console.log('')
233
- console.log(`Targets: ${targetRoots.join(', ')}`)
234
- console.log(`Included extensions: ${[...codeExtensions].sort().join(', ')}`)
235
- console.log(
236
- `Excluded directories: ${[...excludedDirectoryNames].sort().join(', ')}`,
237
- )
238
- console.log(`Excluded paths: ${[...excludedRelativePaths].sort().join(', ')}`)
239
-
240
- printTable('By area', groupBy((file) => areaForPath(file.path)))
241
- printTable('By purpose', groupBy((file) => purposeForPath(file.path)))
242
- printTable('By top-level target', groupBy((file) => file.path.split('/')[0]))
243
- printTable('By extension', groupBy((file) => file.extension), 'Extension')
244
-
245
- console.log('\nTotal')
246
- console.log(`Files: ${formatNumber(total.files)}`)
247
- console.log(`Lines: ${formatNumber(total.lines)}`)
248
- console.log(`Nonblank lines: ${formatNumber(total.nonBlankLines)}`)
249
-
250
- if (process.argv.includes('--files')) {
251
- printTable(
252
- 'By file',
253
- sortedByPath.map((file) => ({ name: file.path, ...file })),
254
- 'File',
255
- )
256
- }
@@ -1,130 +0,0 @@
1
- #!/usr/bin/env bun
2
- /**
3
- * Release script for Claude Code Haha Desktop
4
- *
5
- * Usage:
6
- * bun run scripts/release.ts patch # 0.1.0 → 0.1.1
7
- * bun run scripts/release.ts minor # 0.1.0 → 0.2.0
8
- * bun run scripts/release.ts major # 0.1.0 → 1.0.0
9
- * bun run scripts/release.ts 2.0.0 # explicit version
10
- * bun run scripts/release.ts patch --dry # preview without changes
11
- */
12
-
13
- import { readFileSync, writeFileSync } from 'node:fs'
14
- import path from 'node:path'
15
-
16
- const root = path.resolve(import.meta.dir, '..')
17
-
18
- const VERSION_FILES = [
19
- {
20
- path: path.join(root, 'desktop/package.json'),
21
- update(content: string, version: string) {
22
- return content.replace(/"version":\s*"[^"]*"/, `"version": "${version}"`)
23
- },
24
- },
25
- {
26
- path: path.join(root, 'desktop/src-tauri/tauri.conf.json'),
27
- update(content: string, version: string) {
28
- return content.replace(/"version":\s*"[^"]*"/, `"version": "${version}"`)
29
- },
30
- },
31
- {
32
- path: path.join(root, 'desktop/src-tauri/Cargo.toml'),
33
- update(content: string, version: string) {
34
- return content.replace(/^version\s*=\s*"[^"]*"/m, `version = "${version}"`)
35
- },
36
- },
37
- ]
38
-
39
- function getCurrentVersion(): string {
40
- const tauriConf = JSON.parse(
41
- readFileSync(path.join(root, 'desktop/src-tauri/tauri.conf.json'), 'utf-8'),
42
- )
43
- return tauriConf.version
44
- }
45
-
46
- function bumpVersion(current: string, bump: string): string {
47
- if (/^\d+\.\d+\.\d+$/.test(bump)) {
48
- return bump
49
- }
50
-
51
- const [major, minor, patch] = current.split('.').map(Number)
52
-
53
- switch (bump) {
54
- case 'patch':
55
- return `${major}.${minor}.${patch + 1}`
56
- case 'minor':
57
- return `${major}.${minor + 1}.0`
58
- case 'major':
59
- return `${major + 1}.0.0`
60
- default:
61
- console.error(`Invalid bump type: ${bump}`)
62
- console.error('Usage: bun run scripts/release.ts <patch|minor|major|x.y.z> [--dry]')
63
- process.exit(1)
64
- }
65
- }
66
-
67
- async function run(cmd: string[], cwd = root) {
68
- const proc = Bun.spawn(cmd, { cwd, stdout: 'pipe', stderr: 'pipe' })
69
- const stdout = await new Response(proc.stdout).text()
70
- const stderr = await new Response(proc.stderr).text()
71
- const code = await proc.exited
72
- if (code !== 0) {
73
- throw new Error(`Command failed: ${cmd.join(' ')}\n${stderr || stdout}`)
74
- }
75
- return stdout.trim()
76
- }
77
-
78
- // ── Main ──────────────────────────────────────────────
79
-
80
- const args = process.argv.slice(2)
81
- const dryRun = args.includes('--dry')
82
- const bumpArg = args.find((a) => a !== '--dry')
83
-
84
- if (!bumpArg) {
85
- console.error('Usage: bun run scripts/release.ts <patch|minor|major|x.y.z> [--dry]')
86
- process.exit(1)
87
- }
88
-
89
- const current = getCurrentVersion()
90
- const next = bumpVersion(current, bumpArg)
91
-
92
- console.log(`\n Version: ${current} → ${next}`)
93
- console.log(` Tag: v${next}`)
94
- console.log(` Dry run: ${dryRun}\n`)
95
-
96
- if (dryRun) {
97
- console.log('Files that would be updated:')
98
- for (const file of VERSION_FILES) {
99
- console.log(` - ${path.relative(root, file.path)}`)
100
- }
101
- process.exit(0)
102
- }
103
-
104
- // Update version in all files
105
- for (const file of VERSION_FILES) {
106
- const content = readFileSync(file.path, 'utf-8')
107
- const updated = file.update(content, next)
108
- writeFileSync(file.path, updated)
109
- console.log(` Updated: ${path.relative(root, file.path)}`)
110
- }
111
-
112
- // Regenerate Cargo.lock
113
- console.log('\n Updating Cargo.lock...')
114
- await run(['cargo', 'generate-lockfile'], path.join(root, 'desktop/src-tauri'))
115
-
116
- // Git commit + tag
117
- console.log(' Creating git commit...')
118
- await run([
119
- 'git',
120
- 'add',
121
- 'desktop/package.json',
122
- 'desktop/src-tauri/tauri.conf.json',
123
- 'desktop/src-tauri/Cargo.toml',
124
- 'desktop/src-tauri/Cargo.lock',
125
- ])
126
- await run(['git', 'commit', '-m', `release: v${next}`])
127
- await run(['git', 'tag', '-a', `v${next}`, '-m', `Release v${next}`])
128
-
129
- console.log(`\n Done! Created commit and tag v${next}`)
130
- console.log(`\n To trigger the build:\n git push origin main --tags\n`)
package/start-cli.bat DELETED
@@ -1,7 +0,0 @@
1
- @echo off
2
- REM 进入脚本所在目录,确保路径正确
3
- cd /d %~dp0
4
-
5
- start cmd /k "bun run src/server/index.ts"
6
- start cmd /k "bun run src/server/cli/providersMenu.tsx"
7
- start cmd /k "bun --env-file=.env ./src/entrypoints/cli.tsx"
@@ -1,24 +0,0 @@
1
- export type PermissionMode =
2
- | 'ask'
3
- | 'skip_all_permission_checks'
4
- | 'follow_a_plan';
5
-
6
- export type Logger = {
7
- silly?: (...args: unknown[]) => void;
8
- debug?: (...args: unknown[]) => void;
9
- info?: (...args: unknown[]) => void;
10
- warn?: (...args: unknown[]) => void;
11
- error?: (...args: unknown[]) => void;
12
- };
13
-
14
- export type ClaudeForChromeContext = Record<string, unknown>;
15
-
16
- export const BROWSER_TOOLS: Array<{ name: string }> = [];
17
-
18
- export function createClaudeForChromeMcpServer(
19
- _context: ClaudeForChromeContext,
20
- ) {
21
- return {
22
- async connect(_transport: unknown): Promise<void> {},
23
- };
24
- }
@@ -1,45 +0,0 @@
1
- export type SyntaxTheme = {
2
- theme: string;
3
- source: string | null;
4
- };
5
-
6
- export class ColorDiff {
7
- private hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] };
8
- private filePath: string;
9
- private firstLine: string | null;
10
- private prefixContent: string | null;
11
-
12
- constructor(
13
- hunk: { oldStart: number; oldLines: number; newStart: number; newLines: number; lines: string[] },
14
- firstLine: string | null,
15
- filePath: string,
16
- prefixContent?: string | null,
17
- ) {
18
- this.hunk = hunk;
19
- this.filePath = filePath;
20
- this.firstLine = firstLine;
21
- this.prefixContent = prefixContent ?? null;
22
- }
23
-
24
- render(themeName: string, width: number, dim: boolean): string[] | null {
25
- return null;
26
- }
27
- }
28
-
29
- export class ColorFile {
30
- private code: string;
31
- private filePath: string;
32
-
33
- constructor(code: string, filePath: string) {
34
- this.code = code;
35
- this.filePath = filePath;
36
- }
37
-
38
- render(themeName: string, width: number, dim: boolean): string[] | null {
39
- return null;
40
- }
41
- }
42
-
43
- export function getSyntaxTheme(themeName: string): SyntaxTheme {
44
- return { theme: themeName, source: null };
45
- }