Commit Graph

155 Commits

Author SHA1 Message Date
Arvin Xu
acbb72a752 🔨 chore: update docker yml (#10433)
update
2025-11-26 13:19:23 +08:00
Lucas
d77288f925 Fix issue to avoid sync error in forked repos (#10410) 2025-11-25 13:02:45 +08:00
renovate[bot]
fd93f6d0c7 Update dependency node to v24.11.1 (#10327)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-21 14:18:45 +08:00
René Wang
c0542e80a3 🔨 chore: Add CI to Check console.log (#10333)
* lint: Clean breakpoints

* build: Add CI to check

* build: Add `next` branch

* build: Remove markdown files

* fix: CI hang out

* fix: Show warning on GitHub

* feat: Send comment

* fix: CI error

* fix: show file list
2025-11-21 14:18:10 +08:00
Arvin Xu
deab4d0386 feat: add Security Blacklist for agent runtime (#10325) 2025-11-20 17:57:45 +08:00
Arvin Xu
3f4313095f 🔨 chore: update desktop build workflow (#10276)
* fix desktop build

* Revert "fix desktop build"

This reverts commit 455996af6b.

* fix desktop build
2025-11-18 01:20:28 +08:00
Arvin Xu
4cd6347d7e feat: support to collapse message (#10234)
*  feat: add message collapse functionality

- Add collapsed field to MessageMetadata type and schema
- Add isMessageCollapsed selector to check message collapse state
- Add toggleMessageCollapsed action with optimistic update
- Export getDisplayMessageById for internal use
- Collapse state persists to database via metadata field

* 💄 ui: add collapse UI for assistant messages

- Add collapse/expand action icons to action bar
- Add collapsed message style with 200px max height and gradient overlay
- Add collapse/expand translations (zh-CN)
- Integrate with toggleMessageCollapsed store action
- Show appropriate icon based on collapsed state

* support CollapsedMessage

* update

* improve test time

* refactor fixtures

* fix tests

* improve i18n
2025-11-16 14:46:27 +08:00
Arvin Xu
0e2bad0a23 🔨 chore: add conversation-flow module (#10052)
* wip

* refactor

* snapshot

* fix input

* fix assistant-tools calling case

* fix assistant-tools calling case

* fix

* fix compare-mode

* fix basic-branch-mode

* refactor branch test case

* refactor branch test case

* implement branch parse

* improve compare

* improve compare

* improve compare

* refactor

* refactor the transformer

* clean tests

* add test workflow

* update

* fix issue
2025-11-05 22:24:51 +08:00
Arvin Xu
3556e5986c 🔨 chore: add auto creating test workflow (#10030)
create auto test mode
2025-11-04 02:18:35 +08:00
Arvin Xu
2da01ca1c7 🔨 chore: add workflow for translating Chinese comments to English (#10027)
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-04 01:54:07 +08:00
Arvin Xu
665e6c99f5 🔨 chore: add desktop test workflow (#10024)
* workflow

* fix tests

* update

* update
2025-11-04 01:36:05 +08:00
Arvin Xu
f2ab2fcef6 ♻️ refactor: remove NEXT_PUBLIC_SERVICE_MODE env and use server by default (#10017)
* remove NEXT_PUBLIC_SERVICE_MODE

* update

* fix tests

* update e2e workflow

* update config

* Rename DATABASE_TEST_URL to DATABASE_URL
2025-11-04 00:34:37 +08:00
YuTengjing
44776b40bc 👷 build: nodejs 24 (#10003)
* build: upgrade node 24

* build: run pnpm update

* fix: tsgo not support baseUrl
2025-11-03 12:56:15 +08:00
YuTengjing
637460bdf0 🔧 chore(workflow): fix desktop PR build concurrency to isolate per-PR builds (#10005) 2025-11-03 12:23:39 +08:00
Arvin Xu
b99bb9a856 🔨 chore: fix desktop-pr workflow (#9992)
fix desktop
2025-11-02 14:28:32 +08:00
renovate[bot]
831948a305 Update GitHub Artifact Actions (major) (#9986)
Update GitHub Artifact Actions

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 11:26:30 +08:00
Arvin Xu
7eaa7ca326 🔨 chore: fix docker workflow (#9987)
fix docker workflow
2025-11-02 11:08:29 +08:00
renovate[bot]
08f97dcee4 Update actions/setup-node action to v6 (#9964)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 10:15:08 +08:00
renovate[bot]
5f4e1d37fb Update actions/checkout action to v5 (#9963)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-11-02 10:14:17 +08:00
Arvin Xu
abb71ec846 feat: upgrade to Next 16 (#9851)
* upgrade next 16

* try to fix

* try to fix

* upgrade

* fix sitemap build

* try to fix build

* try to fix build with next 16

* fix docker permission

* 🔒 fix(ci): fix code injection vulnerability and permissions in docker workflow

- Add pull-requests: write permission to allow PR comments
- Fix code injection vulnerability by using env variables instead of direct interpolation
- Prevent potential security risks from malicious branch names in pull_request_target events

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* 🔧 chore(ci): change desktop pr build to use pull_request_target

- Change from pull_request to pull_request_target to access secrets and write permissions
- Update permissions from read-all to specific write permissions for contents and pull-requests
- This allows PR builds to create releases and comment on PRs from forks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* add comment

* fix on

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-02 00:53:13 +08:00
arvinxx
1d95153960 update 2025-10-30 21:18:47 +08:00
arvinxx
177f3f5589 update workflow 2025-10-30 21:02:42 +08:00
Arvin Xu
b6f1fc4a14 test: add BDD test framework and initial tests with Playwright and Cucumber (#9843)
* try with bdd test

* update

* update

* add workspace

* update

* fix

* ci

* ci

* fix

* update

* update

* update parallel

* update config

* ️ perf: increase e2e timeout to 120 seconds

Co-authored-by: Arvin Xu <arvinxx@users.noreply.github.com>

* update config

* more parallel

* fix parallel

* fix tests

* refactor to improve performance

* fix

* fix

* fix

* refactor with tsx

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Arvin Xu <arvinxx@users.noreply.github.com>
2025-10-23 02:15:24 +08:00
Arvin Xu
48ee38cf9b 👷 build: fix build (#9847)
* fix build

* use pnpm install to keep lint stricter
2025-10-23 00:40:57 +08:00
bbbugg
be952f95fd 📝 docs: update GitHub stars link and tutorial URLs in README files (#9831) 2025-10-22 11:04:38 +08:00
renovate[bot]
cc37acb30b Update actions/download-artifact action to v5 (#8740)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-21 12:14:18 +08:00
Arvin Xu
0a8c80dfd2 🐛 fix: fix duplicate tools id issue and fix link dialog issue (#9731)
* add

* baseline

*  test(store): add tests for discover store plugin and mcp slices

- Add comprehensive tests for discover/slices/plugin/action.ts (15 tests)
- Add comprehensive tests for discover/slices/mcp/action.ts (11 tests)
- Update test-coverage.md with new metrics and completed work
- Coverage: 74.24% overall (+26 tests, 2 new test files)
- Action files coverage: 29/40 tested (72.5%, +2 files)

Features tested:
- Plugin/MCP categories, detail, identifiers, and list fetching
- SWR key generation with locale and parameters
- SWR configuration verification
- Service integration with discoverService

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* 📝 docs(testing): add SWR hooks testing guide and subagent workflow

Testing Guide Updates:
- Add comprehensive SWR hooks testing section with examples
- Document key differences from regular action tests
- Add examples for testing SWR key generation and configuration
- Add examples for testing conditional fetching
- Update references to include SWR hook test examples

Test Coverage Guide Updates:
- Add detailed subagent workflow for parallel testing
- Document when and how to use subagents for testing
- Add complete workflow example using subagents
- Add benefits and best practices for subagent usage
- Clarify that subagents should NOT commit or update docs
- Add step-by-step guide for launching parallel subagents

Key improvements:
- Better documentation for testing SWR-based store actions
- Clear workflow for efficient parallel testing using subagents
- Single atomic commit strategy after all subagents complete
- Improved testing efficiency and organization

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* ♻️ refactor(test): fix SWR mock strategy to properly test fetcher

Previously, tests were hardcoding return values instead of calling
the fetcher function. This bypassed the actual service call logic.

Changes:
- Fix useSWR mock to call fetcher and return its Promise
- Update assertions to await Promise results
- Update testing guide with correct mock pattern
- Add explanation of why this approach is correct

Before (incorrect):
```typescript
useSWRMock.mockImplementation(((key, fetcher) => {
  fetcher?.(); // Call but ignore result
  return { data: mockData }; // Hardcoded
}) as any);
expect(result.current.data).toEqual(mockData);
```

After (correct):
```typescript
useSWRMock.mockImplementation(((key, fetcher) => {
  const data = fetcher?.(); // Get Promise from fetcher
  return { data }; // Return Promise
}) as any);
const resolvedData = await result.current.data;
expect(resolvedData).toEqual(mockData);
```

Benefits:
-  Actually tests the fetcher function
-  Mirrors real SWR behavior (data is Promise)
-  Service calls are properly verified
-  Tests are more accurate and maintainable

Updated files:
- .cursor/rules/testing-guide/zustand-store-action-test.mdc
- src/store/discover/slices/plugin/action.test.ts
- src/store/discover/slices/mcp/action.test.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* 🐛 fix(test): correct SWR mock strategy to match project standards

- Remove useSWR mocking, use real SWR implementation instead
- Only mock service methods (fetchers) with vi.spyOn
- Use waitFor for async assertions
- Update testing guide with correct SWR pattern
- Add reference to src/store/chat/slices/message/action.test.ts

This fixes the incorrect mocking approach from previous commits.
All 13 tests pass with the corrected strategy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(store): add comprehensive tests for high priority action files

- Add mcpStore action tests (41 tests, 624 LOC covered)
  - MCP plugin installation flow (normal, resume, dependencies, config)
  - Connection testing (HTTP and STDIO)
  - Plugin lifecycle management
  - Error handling and cancellation flows

- Add fileManager action tests (35 tests, 205 LOC covered)
  - File upload and processing workflows
  - Chunk embedding and parsing
  - File list management and refresh
  - SWR data fetching

Testing approach:
- Used parallel subagents for efficient development
- Followed zustand testing patterns from guide
- Proper test layering and per-test mocking
- All tests pass type-check and lint

Coverage improvement: 74.24% → ~76% (+76 tests, 2 files)
Action files: 29/40 → 31/40 tested (77.5%)

🏆 Milestone: All high priority files (>200 LOC) now have tests!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

*  test(store): complete 100% action file coverage with 160 new tests

Added comprehensive tests for all remaining 9 medium-priority action files:

Discovery Store (33 tests):
- assistant/action.ts: 10 tests (SWR hooks, categories, detail, identifiers, list)
- provider/action.ts: 11 tests (SWR hooks, detail with readme, identifiers, list with filters)
- model/action.ts: 12 tests (SWR hooks, categories, detail, identifiers, list with params)

Knowledge Base Store (29 tests):
- crud/action.ts: 19 tests (create, update, remove, refresh, loading states, SWR hooks)
- content/action.ts: 10 tests (add files, remove files, error handling)

File Store (36 tests):
- upload/action.ts: 18 tests (base64 upload, file upload with progress, type detection, KB integration)
- chunk/action.ts: 18 tests (drawer management, highlight, semantic search)

AI Infrastructure Store (23 tests):
- aiModel/action.ts: 23 tests (CRUD, batch operations, remote sync, toggle enabled, SWR hooks)

Chat Store (39 tests):
- thread/action.ts: 39 tests (CRUD, messaging, AI title generation, validation, loading states)

Testing approach:
- Used 9 parallel subagents for efficient development
- Followed zustand testing patterns from guide
- SWR hook testing for discovery slices
- Complex async flows with proper error handling
- File operations with progress callbacks
- Semantic search and RAG integration

Coverage improvement: ~76% → ~80% (+160 tests, 9 files)
Action files: 31/40 → 40/40 tested (100%)

🎉 MILESTONE: All 40 action files now have comprehensive test coverage!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix test

* fix test

* fix context-engine

* add tests

* remove

* remove tools bar

* pin bun version

* fix

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-15 22:38:53 +08:00
Arvin Xu
ff41f4bb82 🔨 chore: improve Claude Code triage workflow (#9713)
* 🔨 chore: unify Claude Code workflows to use claude-code-action@main

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* 🔧 chore: extract issue triage prompt to separate file

- Add .claude/prompts/issue-triage.md with comprehensive triage guide
- Update workflow to read from issue-triage.md instead of inline prompt
- Simplify workflow configuration for better maintainability
- Add provider detection rules including aihubmix

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-14 23:05:25 +08:00
Arvin Xu
60f43d90e5 🔨 chore: unify Claude Code workflows to use claude-code-action@main (#9712)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
2025-10-14 21:49:52 +08:00
Arvin Xu
8dcb00e2c9 🔧 fix: update Claude workflows to use oauth token (#9711) 2025-10-14 21:31:25 +08:00
Arvin Xu
3719bf4d52 🔨 chore: add claude code powered workflows (#9709)
* add claude dedupe issue workflow

* add triage

* add auto close duplicate

* improve triage

* improve
2025-10-14 21:24:26 +08:00
Arvin Xu
8693d95e0d 🔨 chore: add e2e workflow (#9677)
* add e2e test

* Potential fix for code scanning alert no. 137: Workflow does not contain permissions

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* remove

* update

* fix tests

* add e2e

* update

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-10-14 13:32:52 +08:00
Stella Wang
d330cf4e94 🔨 chore(ci): Improve Claude translator prompt to prevent hallucination (#9673)
🐛 fix(ci): Improve Claude translator prompt to prevent hallucination

Add critical rules to prevent translation hallucination issues:
- Enforce exact preservation of original content without modification
- Ensure code blocks, error logs, and JSON appear in both sections
- Clarify that only natural language should be translated
- Add verification step to check original content accuracy
- Prevent dropping or hallucinating end-of-comment sentences

This addresses issues where the translator was hallucinating content
in the "Original Content" section and incorrectly handling large
technical blocks like error logs and JSON structures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-12 16:03:52 +08:00
renovate[bot]
ba3c890f62 Update actions/github-script action to v8 (#9554)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-10-11 16:19:15 +08:00
Arvin Xu
9349ce2d2f 🐛 fix: disable rich text in markdown editor (#9637)
* clean

* update

* add labs

* fix

* improve

* update

* fix

* hide lab

* improve workflow
2025-10-11 15:59:56 +08:00
YuTengjing
ca033420b9 🐛 fix(desktop): macos26 small icon (#9421)
* 🐛 fix(desktop): macos26 icon small

* Revert "🐛 fix(desktop): macos26 icon small"

This reverts commit 4a4b7b230c.

*  feat(desktop): support Liquid Glass icons for macOS 26

- Add pre-generated Assets.car files for all build variants
- Configure afterPack hook to copy Assets.car during build
- Maintain backward compatibility with .icns fallback for older macOS

Reference: https://github.com/electron-userland/electron-builder/issues/9254

* docs: optimize comments

* fix: update deprecated macos-13 to macos-15-intel

* docs: optimize ai rules
2025-10-08 23:30:35 +08:00
Arvin Xu
0d48ebddd9 🔧 chore: fix workflows does not contain permissions (#9544)
* Potential fix for code scanning alert no. 39: Workflow does not contain permissions

* update permissions

---------
2025-10-05 20:05:10 +08:00
renovate[bot]
249b46e5cf Update codecov/codecov-action action to v5 (#4714) 2025-10-05 11:37:16 +02:00
renovate[bot]
dbe7d7ef7c Update actions/checkout action to v5 (#9553) 2025-10-05 11:36:11 +02:00
Arvin Xu
e10aa05a11 🔨 chore: improve github workflow (#9511)
* improve workflow file

* clean

* update
2025-10-02 04:56:34 +08:00
Arvin Xu
79bc08a076 🔨 chore: add claude translator and improve issue template (#9479)
* add translator

* use claude translator
2025-09-30 04:22:01 +08:00
Aloxaf
fa6ef94067 feat: add builtin Python plugin (#8873)
* feat: 初步完成

* chore: type

* feat: 图片功能

* feat: 文件下载功能

* refactor: 简化代码

* chore: 清理代码

* chore: clean

* chore: 清理代码

* chore: 清理代码

* chore: 小改进

* fix: 上传完成前图片无法显示

* refactor: 增加 python-interpreter package

* chore: 清理

* feat: 传入上下文中的文件

* chore: 小优化

* chore: 中文字体

* chore: clean

* fix: 服务端部署

* fix: 重复文件检查

* test: 增加 interpreter.test.ts

* test: add worker.test.ts

* style: fix import

* test: fix

* style: fix import

* style: move env file to envs

* style: 限制代码框高度

* style: 重命名

* misc: 小修小补

* refactor: 重命名为 code-interpreter

---------

Co-authored-by: Arvin Xu <arvinx@foxmail.com>
2025-09-30 04:20:57 +08:00
Arvin Xu
1776a24943 🔨 chore: add auto close issues workflow (#9473)
* add auto close issues

* update
2025-09-30 02:14:47 +08:00
Arvin Xu
72443783a1 🔨 chore: update dbschema workflow (#9282)
update workflow
2025-09-16 15:25:55 +08:00
Arvin Xu
66562170ac 💄 style: improve error handle with agent config (#9263)
fix
2025-09-15 11:23:13 +08:00
Arvin Xu
d942a635b3 🔨 chore: add agent-runtime (#9206)
* add agent runtime

* add agent runtime

* support finish reason

* update workflow

* 支持中断

* 支持 token usage 统计

* refactor

* add example

* add docs

* update
2025-09-14 17:29:19 +08:00
Arvin Xu
dacfffdb63 ♻️ refactor: refactor message proccesser to the context engine (#9230)
* init context engine

* refactor

* refactor

* move

* refactor

* refactor PlaceholderVariables

* refactor name

* refactor

* update

* fix tests

* update workflow

* clean code

* add test

* move from store into service

* implement the HistoryTruncate and Input Template into context engine

* fix history truncate

* clean
2025-09-13 00:12:53 +08:00
YuTengjing
ea819a3421 feat: support mac intel desktop (#9136) 2025-09-08 23:46:57 +08:00
Arvin Xu
ae28f1794c ️ build : Revert "support mac intel chip" (#9134)
Revert "feat(desktop): support mac intel chip (#9084)"

This reverts commit 1a75f4a6b5.
2025-09-06 16:14:42 +08:00
YuTengjing
1a75f4a6b5 feat(desktop): support mac intel chip (#9084) 2025-09-06 14:03:16 +08:00