bingocode 1.0.27 → 1.0.29

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 (54) hide show
  1. package/package.json +1 -2
  2. package/.github/FUNDING.yml +0 -1
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -44
  4. package/.github/ISSUE_TEMPLATE/config.yml +0 -1
  5. package/.github/ISSUE_TEMPLATE/question.md +0 -40
  6. package/.github/workflows/build-desktop-dev.yml +0 -210
  7. package/.github/workflows/deploy-docs.yml +0 -59
  8. package/.github/workflows/release-desktop.yml +0 -162
  9. package/.spine/user.yaml +0 -5
  10. package/.spine/workspace.yaml +0 -1
  11. package/adapters/common/__tests__/chat-queue.test.ts +0 -61
  12. package/adapters/common/__tests__/format.test.ts +0 -148
  13. package/adapters/common/__tests__/http-client.test.ts +0 -105
  14. package/adapters/common/__tests__/message-buffer.test.ts +0 -84
  15. package/adapters/common/__tests__/message-dedup.test.ts +0 -57
  16. package/adapters/common/__tests__/session-store.test.ts +0 -62
  17. package/adapters/common/__tests__/ws-bridge.test.ts +0 -177
  18. package/adapters/common/attachment/__tests__/attachment-limits.test.ts +0 -52
  19. package/adapters/common/attachment/__tests__/attachment-store.test.ts +0 -108
  20. package/adapters/common/attachment/__tests__/image-block-watcher.test.ts +0 -115
  21. package/adapters/feishu/__tests__/card-errors.test.ts +0 -194
  22. package/adapters/feishu/__tests__/cardkit.test.ts +0 -295
  23. package/adapters/feishu/__tests__/extract-payload.test.ts +0 -77
  24. package/adapters/feishu/__tests__/feishu.test.ts +0 -907
  25. package/adapters/feishu/__tests__/flush-controller.test.ts +0 -290
  26. package/adapters/feishu/__tests__/markdown-style.test.ts +0 -353
  27. package/adapters/feishu/__tests__/media.test.ts +0 -120
  28. package/adapters/feishu/__tests__/streaming-card.test.ts +0 -914
  29. package/adapters/telegram/__tests__/media.test.ts +0 -86
  30. package/adapters/telegram/__tests__/telegram.test.ts +0 -115
  31. package/src/server/__tests__/conversation-service.test.ts +0 -173
  32. package/src/server/__tests__/conversations.test.ts +0 -458
  33. package/src/server/__tests__/cron-scheduler.test.ts +0 -575
  34. package/src/server/__tests__/e2e/business-flow.test.ts +0 -841
  35. package/src/server/__tests__/e2e/full-flow.test.ts +0 -357
  36. package/src/server/__tests__/fixtures/mock-sdk-cli.ts +0 -123
  37. package/src/server/__tests__/haha-oauth-api.test.ts +0 -146
  38. package/src/server/__tests__/haha-oauth-service.test.ts +0 -185
  39. package/src/server/__tests__/providers-real.test.ts +0 -244
  40. package/src/server/__tests__/providers.test.ts +0 -579
  41. package/src/server/__tests__/proxy-streaming.test.ts +0 -317
  42. package/src/server/__tests__/proxy-transform.test.ts +0 -469
  43. package/src/server/__tests__/real-llm-test.ts +0 -526
  44. package/src/server/__tests__/scheduled-tasks.test.ts +0 -371
  45. package/src/server/__tests__/sessions.test.ts +0 -786
  46. package/src/server/__tests__/settings.test.ts +0 -376
  47. package/src/server/__tests__/skills.test.ts +0 -125
  48. package/src/server/__tests__/tasks.test.ts +0 -171
  49. package/src/server/__tests__/team-watcher.test.ts +0 -400
  50. package/src/server/__tests__/teams.test.ts +0 -627
  51. package/src/server/middleware/cors.test.ts +0 -27
  52. package/src/utils/__tests__/cronFrequency.test.ts +0 -153
  53. package/src/utils/__tests__/cronTasks.test.ts +0 -204
  54. package/src/utils/computerUse/permissions.test.ts +0 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bingocode",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "claude": "bin/claude-win.cjs",
@@ -36,7 +36,6 @@
36
36
  "auto-bind": "^5.0.1",
37
37
  "axios": "^1.14.0",
38
38
  "bidi-js": "^1.0.3",
39
- "bingocode": "^1.0.4",
40
39
  "chalk": "^5.6.2",
41
40
  "chokidar": "^5.0.0",
42
41
  "cli-boxes": "^4.0.1",
@@ -1 +0,0 @@
1
- github: NanmiCoder
@@ -1,44 +0,0 @@
1
- ---
2
- name: Bug 反馈
3
- about: 创建一个 Bug 报告以帮助 cc-haha 项目改进
4
- title: '[BUG] '
5
- labels: bug
6
- assignees: ''
7
- ---
8
-
9
- ## 🔍 问题检查清单
10
- <!-- 请在提交 issue 前确认以下事项 -->
11
-
12
- - [ ] 我已经仔细阅读了 [README 常见问题](https://github.com/NanmiCoder/cc-haha#常见问题) 部分
13
- - [ ] 我已经搜索并查看了[已关闭的 issues](https://github.com/NanmiCoder/cc-haha/issues?q=is%3Aissue+is%3Aclosed)
14
- - [ ] 我确认这不是由于 API Key 配置错误、API 端点不兼容、Bun 版本过低等常见原因导致的问题
15
-
16
- ## 🐛 问题描述
17
- <!-- 请详细描述你遇到的问题 -->
18
-
19
-
20
- ## 📝 复现步骤
21
- 1.
22
- 2.
23
- 3.
24
-
25
- ## 💻 运行环境
26
- - 操作系统:
27
- - Bun 版本 (`bun --version`):
28
- - Node 版本 (`node --version`):
29
- - API 提供商 (如 MiniMax / OpenRouter / Anthropic 官方等):
30
- - 使用的模型:
31
- - 启动方式 (TUI / --print / Recovery CLI):
32
-
33
- ## 📋 错误日志
34
- <!-- 请提供完整的错误日志信息 -->
35
- ```shell
36
- 在此粘贴错误日志
37
- ```
38
-
39
- ## 📷 错误截图
40
- <!-- 如有,请提供错误截图 -->
41
-
42
- ---
43
- <!-- 🤖 Dosu 机器人将自动响应此 issue -->
44
- @dosubot
@@ -1 +0,0 @@
1
- blank_issues_enabled: false
@@ -1,40 +0,0 @@
1
- ---
2
- name: 使用问题咨询
3
- about: 提交使用过程中遇到的问题
4
- title: '[问题] '
5
- labels: question
6
- assignees: ''
7
- ---
8
-
9
- ## ⚠️ 提交前确认
10
- <!-- 请确认以下事项 -->
11
- - [ ] 我已经仔细阅读了 [README 常见问题](https://github.com/NanmiCoder/cc-haha#常见问题) 部分
12
- - [ ] 我已经阅读了[第三方模型使用指南](https://github.com/NanmiCoder/cc-haha/blob/main/docs/guide/third-party-models.md)
13
- - [ ] 我已经搜索并查看了[已关闭的 issues](https://github.com/NanmiCoder/cc-haha/issues?q=is%3Aissue+is%3Aclosed)
14
-
15
- ## ❓ 问题描述
16
- <!-- 清晰简洁地描述你遇到的问题 -->
17
-
18
- ## 🔍 使用场景
19
- <!-- 描述你在使用哪个功能时遇到的问题 -->
20
- - 使用功能: (如:TUI 交互 / --print 无头模式 / MCP 服务器 / Skills 等)
21
- - API 提供商: (如:MiniMax / OpenRouter / Anthropic 官方 / LiteLLM 代理等)
22
-
23
- ## 💻 环境信息
24
- - 操作系统:
25
- - Bun 版本 (`bun --version`):
26
- - Node 版本 (`node --version`):
27
- - API 提供商:
28
- - 使用的模型:
29
-
30
- ## 📋 错误日志
31
- ```shell
32
- 在此粘贴完整的错误日志
33
- ```
34
-
35
- ## 📷 错误截图
36
- <!-- 如有,请提供错误截图 -->
37
-
38
- ---
39
- <!-- 🤖 Dosu 机器人将自动响应此 issue -->
40
- @dosubot
@@ -1,210 +0,0 @@
1
- name: Build Desktop (Dev)
2
-
3
- # 开发阶段构建 — 不创建 Release,只上传 Artifacts 供下载测试
4
- on:
5
- workflow_dispatch:
6
- inputs:
7
- platforms:
8
- description: 'Build platforms'
9
- required: true
10
- default: 'all'
11
- type: choice
12
- options:
13
- - all
14
- - macos-arm64
15
- - macos-x64
16
- - windows-x64
17
- - linux-x64
18
- - linux-arm64
19
-
20
- permissions:
21
- contents: read
22
-
23
- concurrency:
24
- group: build-desktop-dev-${{ github.ref }}
25
- cancel-in-progress: true
26
-
27
- jobs:
28
- # ── 动态生成构建矩阵 ──────────────────────────────────────
29
- prepare:
30
- runs-on: ubuntu-latest
31
- outputs:
32
- matrix: ${{ steps.set-matrix.outputs.matrix }}
33
- steps:
34
- - id: set-matrix
35
- run: |
36
- ALL='[{"platform":"macos-latest","rust_target":"aarch64-apple-darwin","tauri_args":"--target aarch64-apple-darwin","bundles":"app,dmg","label":"macOS-ARM64","artifact_name":"macos-arm64"},{"platform":"macos-latest","rust_target":"x86_64-apple-darwin","tauri_args":"--target x86_64-apple-darwin","bundles":"app,dmg","label":"macOS-x64","artifact_name":"macos-x64"},{"platform":"windows-latest","rust_target":"x86_64-pc-windows-msvc","tauri_args":"","bundles":"nsis,msi","label":"Windows-x64","artifact_name":"windows-x64"},{"platform":"ubuntu-22.04","rust_target":"x86_64-unknown-linux-gnu","tauri_args":"","bundles":"deb","label":"Linux-x64","artifact_name":"linux-x64"},{"platform":"ubuntu-22.04-arm","rust_target":"aarch64-unknown-linux-gnu","tauri_args":"","bundles":"deb","label":"Linux-ARM64","artifact_name":"linux-arm64"}]'
37
-
38
- SELECTED="${{ inputs.platforms }}"
39
- if [ "$SELECTED" = "all" ]; then
40
- MATRIX=$(echo "$ALL" | jq -c '{include: .}')
41
- else
42
- MATRIX=$(echo "$ALL" | jq -c --arg sel "$SELECTED" '{include: [.[] | select(
43
- ($sel == "macos-arm64" and .label == "macOS-ARM64") or
44
- ($sel == "macos-x64" and .label == "macOS-x64") or
45
- ($sel == "windows-x64" and .label == "Windows-x64") or
46
- ($sel == "linux-x64" and .label == "Linux-x64") or
47
- ($sel == "linux-arm64" and .label == "Linux-ARM64")
48
- )]}')
49
- fi
50
- echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
51
-
52
- # ── 构建 ────────────────────────────────────────────────────
53
- build:
54
- needs: prepare
55
- strategy:
56
- fail-fast: false
57
- matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
58
-
59
- runs-on: ${{ matrix.platform }}
60
- name: Build (${{ matrix.label }})
61
-
62
- steps:
63
- - name: Checkout
64
- uses: actions/checkout@v4
65
-
66
- # ── 读取版本号 ───────────────────────────────────────────
67
- - name: Read version
68
- id: version
69
- shell: bash
70
- run: |
71
- VERSION=$(jq -r '.version' desktop/src-tauri/tauri.conf.json)
72
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
73
-
74
- # ── 系统依赖 (Linux) ─────────────────────────────────────
75
- # libfuse2 是 AppImage 运行时依赖:linuxdeploy 工具链本身是 AppImage 格式,
76
- # 运行时需要 libfuse2,Ubuntu 22.04 默认未安装。
77
- - name: Install Linux dependencies
78
- if: contains(matrix.platform, 'ubuntu')
79
- run: |
80
- sudo apt-get update
81
- sudo apt-get install -y \
82
- build-essential curl wget file \
83
- libxdo-dev libssl-dev \
84
- libwebkit2gtk-4.1-dev \
85
- libayatana-appindicator3-dev \
86
- librsvg2-dev patchelf \
87
- libfuse2
88
-
89
- # ── Bun ──────────────────────────────────────────────────
90
- - name: Setup Bun
91
- uses: oven-sh/setup-bun@v2
92
- with:
93
- bun-version: latest
94
-
95
- # ── Node.js ──────────────────────────────────────────────
96
- - name: Setup Node.js
97
- uses: actions/setup-node@v4
98
- with:
99
- node-version: 20
100
-
101
- # ── Rust ─────────────────────────────────────────────────
102
- - name: Setup Rust
103
- uses: dtolnay/rust-toolchain@stable
104
- with:
105
- targets: ${{ matrix.rust_target }}
106
-
107
- - name: Rust cache
108
- uses: swatinem/rust-cache@v2
109
- with:
110
- workspaces: 'desktop/src-tauri -> target'
111
- shared-key: ${{ matrix.rust_target }}
112
-
113
- # ── 安装依赖 ─────────────────────────────────────────────
114
- - name: Install root dependencies
115
- run: bun install
116
-
117
- - name: Install desktop dependencies
118
- working-directory: desktop
119
- run: bun install
120
-
121
- - name: Install adapter dependencies
122
- working-directory: adapters
123
- run: bun install
124
-
125
- # ── 构建 sidecars ────────────────────────────────────────
126
- - name: Build sidecars
127
- working-directory: desktop
128
- env:
129
- TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}
130
- run: bun run build:sidecars
131
-
132
- # ── 构建 Tauri (无签名、无 updater) ──────────────────────
133
- - name: Build Tauri app
134
- working-directory: desktop
135
- env:
136
- TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}
137
- run: |
138
- # 开发构建: 禁用 updater artifacts (不需要签名密钥)
139
- echo '{"bundle":{"createUpdaterArtifacts":false}}' > /tmp/dev-build.json
140
-
141
- ARGS=(bunx tauri build --bundles ${{ matrix.bundles }} --ci --config /tmp/dev-build.json)
142
-
143
- if [ -n "${{ matrix.tauri_args }}" ]; then
144
- ARGS+=(${{ matrix.tauri_args }})
145
- fi
146
-
147
- "${ARGS[@]}"
148
- shell: bash
149
-
150
- # ── 收集产物 ─────────────────────────────────────────────
151
- - name: Collect artifacts
152
- id: collect
153
- shell: bash
154
- run: |
155
- BUNDLE_DIR="desktop/src-tauri/target/${{ matrix.rust_target }}/release/bundle"
156
- FALLBACK_DIR="desktop/src-tauri/target/release/bundle"
157
-
158
- # 优先使用带 target 的路径
159
- if [ -d "$BUNDLE_DIR" ]; then
160
- SEARCH_DIR="$BUNDLE_DIR"
161
- else
162
- SEARCH_DIR="$FALLBACK_DIR"
163
- fi
164
-
165
- STAGING="desktop/build-artifacts/ci-Claude-Code-Haha-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}"
166
- mkdir -p "$STAGING"
167
-
168
- echo "Searching for artifacts in: $SEARCH_DIR"
169
- if [ -d "$SEARCH_DIR" ]; then
170
- find "$SEARCH_DIR" \
171
- \( -type f \( \
172
- -name "*.dmg" -o -name "*.exe" -o -name "*.msi" -o \
173
- -name "*.deb" -o -name "*.AppImage" -o -name "*.zip" \
174
- \) \) -o \
175
- \( -type d -name "*.app" \) | while read -r f; do
176
- echo " Copying: $(basename "$f")"
177
- cp -R "$f" "$STAGING/"
178
- done
179
- fi
180
-
181
- echo "staging_dir=$STAGING" >> "$GITHUB_OUTPUT"
182
- echo "=== Collected artifacts ==="
183
- ls -lh "$STAGING/" 2>/dev/null || echo "(empty)"
184
-
185
- # ── 上传为 GitHub Artifact ───────────────────────────────
186
- - name: Upload artifacts
187
- uses: actions/upload-artifact@v4
188
- with:
189
- name: Claude-Code-Haha-v${{ steps.version.outputs.version }}-${{ matrix.artifact_name }}
190
- path: ${{ steps.collect.outputs.staging_dir }}
191
- retention-days: 7
192
- if-no-files-found: warn
193
-
194
- # ── 构建完成汇总 ────────────────────────────────────────────
195
- summary:
196
- needs: build
197
- runs-on: ubuntu-latest
198
- if: always()
199
- steps:
200
- - name: Build summary
201
- run: |
202
- echo "## Desktop Dev Build Summary" >> $GITHUB_STEP_SUMMARY
203
- echo "" >> $GITHUB_STEP_SUMMARY
204
- echo "| Platform | Status |" >> $GITHUB_STEP_SUMMARY
205
- echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
206
- echo "Branch: \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
207
- echo "Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
208
- echo "" >> $GITHUB_STEP_SUMMARY
209
- echo "📦 Artifacts are available for download from the **Artifacts** section above." >> $GITHUB_STEP_SUMMARY
210
- echo "Artifacts will be retained for **7 days**." >> $GITHUB_STEP_SUMMARY
@@ -1,59 +0,0 @@
1
- name: Deploy VitePress Docs
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- paths:
7
- - 'docs/**'
8
- - 'package.json'
9
- - '.github/workflows/deploy-docs.yml'
10
- workflow_dispatch:
11
-
12
- permissions:
13
- contents: read
14
- pages: write
15
- id-token: write
16
-
17
- concurrency:
18
- group: pages
19
- cancel-in-progress: true
20
-
21
- jobs:
22
- build:
23
- runs-on: ubuntu-latest
24
- steps:
25
- - name: Checkout
26
- uses: actions/checkout@v4
27
- with:
28
- fetch-depth: 0
29
-
30
- - name: Setup Node
31
- uses: actions/setup-node@v4
32
- with:
33
- node-version: 20
34
- cache: npm
35
-
36
- - name: Setup Pages
37
- uses: actions/configure-pages@v4
38
-
39
- - name: Install dependencies
40
- run: npm ci
41
-
42
- - name: Build with VitePress
43
- run: npm run docs:build
44
-
45
- - name: Upload artifact
46
- uses: actions/upload-pages-artifact@v3
47
- with:
48
- path: docs/.vitepress/dist
49
-
50
- deploy:
51
- environment:
52
- name: github-pages
53
- url: ${{ steps.deployment.outputs.page_url }}
54
- needs: build
55
- runs-on: ubuntu-latest
56
- steps:
57
- - name: Deploy to GitHub Pages
58
- id: deployment
59
- uses: actions/deploy-pages@v4
@@ -1,162 +0,0 @@
1
- name: Release Desktop
2
-
3
- on:
4
- push:
5
- tags: ['v*.*.*']
6
- workflow_dispatch:
7
- inputs:
8
- draft:
9
- description: 'Create as draft release'
10
- required: false
11
- default: true
12
- type: boolean
13
-
14
- permissions:
15
- contents: write
16
-
17
- concurrency:
18
- group: release-desktop-${{ github.ref }}
19
- cancel-in-progress: true
20
-
21
- jobs:
22
- build:
23
- strategy:
24
- fail-fast: false
25
- matrix:
26
- include:
27
- # macOS Apple Silicon
28
- - platform: macos-latest
29
- rust_target: aarch64-apple-darwin
30
- tauri_args: '--target aarch64-apple-darwin'
31
- label: macOS-ARM64
32
-
33
- # macOS Intel
34
- - platform: macos-latest
35
- rust_target: x86_64-apple-darwin
36
- tauri_args: '--target x86_64-apple-darwin'
37
- label: macOS-x64
38
-
39
- # Linux x64
40
- - platform: ubuntu-22.04
41
- rust_target: x86_64-unknown-linux-gnu
42
- tauri_args: '--bundles deb'
43
- label: Linux-x64
44
-
45
- # Linux ARM64
46
- - platform: ubuntu-22.04-arm
47
- rust_target: aarch64-unknown-linux-gnu
48
- tauri_args: '--bundles deb'
49
- label: Linux-ARM64
50
-
51
- # Windows x64
52
- - platform: windows-latest
53
- rust_target: x86_64-pc-windows-msvc
54
- tauri_args: ''
55
- label: Windows-x64
56
-
57
- runs-on: ${{ matrix.platform }}
58
- name: Build (${{ matrix.label }})
59
-
60
- steps:
61
- - name: Checkout
62
- uses: actions/checkout@v4
63
-
64
- # ── System dependencies (Linux) ──────────────────────────
65
- - name: Install Linux dependencies
66
- if: contains(matrix.platform, 'ubuntu')
67
- run: |
68
- sudo apt-get update
69
- sudo apt-get install -y \
70
- build-essential \
71
- curl \
72
- wget \
73
- file \
74
- libxdo-dev \
75
- libssl-dev \
76
- libwebkit2gtk-4.1-dev \
77
- libayatana-appindicator3-dev \
78
- librsvg2-dev \
79
- patchelf \
80
- libfuse2
81
-
82
- # ── Bun ──────────────────────────────────────────────────
83
- - name: Setup Bun
84
- uses: oven-sh/setup-bun@v2
85
- with:
86
- bun-version: latest
87
-
88
- # ── Node.js (for tauri-action compatibility) ─────────────
89
- - name: Setup Node.js
90
- uses: actions/setup-node@v4
91
- with:
92
- node-version: 20
93
-
94
- # ── Rust ─────────────────────────────────────────────────
95
- - name: Setup Rust
96
- uses: dtolnay/rust-toolchain@stable
97
- with:
98
- targets: ${{ matrix.rust_target }}
99
-
100
- - name: Rust cache
101
- uses: swatinem/rust-cache@v2
102
- with:
103
- workspaces: 'desktop/src-tauri -> target'
104
- shared-key: ${{ matrix.rust_target }}
105
-
106
- # ── Install dependencies ─────────────────────────────────
107
- - name: Install root dependencies
108
- run: bun install
109
-
110
- - name: Install desktop dependencies
111
- working-directory: desktop
112
- run: bun install
113
-
114
- - name: Install adapter dependencies
115
- working-directory: adapters
116
- run: bun install
117
-
118
- # ── Build sidecars ───────────────────────────────────────
119
- - name: Build sidecars
120
- working-directory: desktop
121
- env:
122
- TAURI_ENV_TARGET_TRIPLE: ${{ matrix.rust_target }}
123
- run: bun run build:sidecars
124
-
125
- # ── Build Tauri app ──────────────────────────────────────
126
- - name: Build Tauri app
127
- uses: tauri-apps/tauri-action@v0
128
- env:
129
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
131
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
132
- with:
133
- projectPath: desktop
134
- tauriScript: bunx tauri
135
- tagName: v__VERSION__
136
- releaseName: 'Claude Code Haha v__VERSION__'
137
- releaseBody: |
138
- ## Claude Code Haha v__VERSION__
139
-
140
- ### Downloads
141
-
142
- | Platform | File |
143
- |----------|------|
144
- | macOS (Apple Silicon) | `.dmg` |
145
- | macOS (Intel) | `.dmg` |
146
- | Windows | `.exe` (NSIS installer) |
147
- | Linux | `.deb` |
148
-
149
- ### First-time installation
150
-
151
- **macOS**: This build is unsigned. If you see "app is damaged" or "unidentified developer", run:
152
- ```bash
153
- xattr -cr /Applications/Claude\ Code\ Haha.app
154
- ```
155
-
156
- **Windows**: If SmartScreen blocks the app, click "More info" → "Run anyway".
157
-
158
- ---
159
- See [Installation Guide](https://github.com/NanmiCoder/cc-haha/blob/main/docs/desktop/04-installation.md) for details.
160
- releaseDraft: ${{ github.event_name == 'workflow_dispatch' && inputs.draft || false }}
161
- prerelease: false
162
- args: ${{ matrix.tauri_args }} --config src-tauri/tauri.release-ci.json
package/.spine/user.yaml DELETED
@@ -1,5 +0,0 @@
1
- name: leanchy
2
- email: ""
3
- isGuest: false
4
- login_at: 2026-04-23T10:20:39.366Z
5
- hostname: CNCDUW2771
@@ -1 +0,0 @@
1
- current_project: P-001-演示项目
@@ -1,61 +0,0 @@
1
- import { describe, it, expect } from 'bun:test'
2
- import { enqueue } from '../chat-queue.js'
3
-
4
- describe('ChatQueue', () => {
5
- it('executes tasks for the same chatId serially', async () => {
6
- const order: number[] = []
7
-
8
- await Promise.all([
9
- enqueue('chat-1', async () => {
10
- await new Promise((r) => setTimeout(r, 30))
11
- order.push(1)
12
- }),
13
- enqueue('chat-1', async () => {
14
- order.push(2)
15
- }),
16
- enqueue('chat-1', async () => {
17
- order.push(3)
18
- }),
19
- ])
20
-
21
- // Wait for all to complete
22
- await new Promise((r) => setTimeout(r, 50))
23
- expect(order).toEqual([1, 2, 3])
24
- })
25
-
26
- it('executes tasks for different chatIds in parallel', async () => {
27
- const order: string[] = []
28
-
29
- const p1 = enqueue('chat-a', async () => {
30
- await new Promise((r) => setTimeout(r, 30))
31
- order.push('a')
32
- })
33
-
34
- const p2 = enqueue('chat-b', async () => {
35
- order.push('b') // should run immediately, not wait for chat-a
36
- })
37
-
38
- await Promise.all([p1, p2])
39
- await new Promise((r) => setTimeout(r, 50))
40
-
41
- // 'b' should appear before 'a' since chat-a has a delay
42
- expect(order[0]).toBe('b')
43
- expect(order[1]).toBe('a')
44
- })
45
-
46
- it('continues processing after a task fails', async () => {
47
- const order: number[] = []
48
-
49
- await enqueue('chat-err', async () => {
50
- order.push(1)
51
- throw new Error('task failed')
52
- })
53
-
54
- await enqueue('chat-err', async () => {
55
- order.push(2) // should still run
56
- })
57
-
58
- await new Promise((r) => setTimeout(r, 20))
59
- expect(order).toEqual([1, 2])
60
- })
61
- })