18 Commits
Author SHA1 Message Date
Sanssssssssssssssss 02b9ccb59f fix(ai): enforce the tool round limit
Stop after one final-answer turn and pin Pi 0.84.2 for the public stop hook.
到达工具轮次上限后只允许一轮终答,并锁定提供公开停止钩子的 Pi 0.84.2。
2026-08-28 22:33:10 +08:00
digua cf1aee9e5b refactor(ai): upgrade pi runtime and define execution semantics 2026-08-18 17:27:48 +08:00
digua 7d156040f8 fix(runtime): contain and clean temporary workspaces 2026-07-16 20:09:18 +08:00
digua c34f71ed2d chore(workspace): enforce dependency declarations 2026-07-16 20:09:18 +08:00
digua 4b52a7d2f8 refactor(http): organize shared route package 2026-07-16 20:09:18 +08:00
digua c6ae5d4cfa refactor(electron): modularize path management 2026-07-16 20:09:18 +08:00
digua 68e33cd0b0 refactor(electron): formalize runtime import boundaries 2026-07-16 20:09:18 +08:00
digua f304146c8f fix(semantic-index): honor proxy for local model downloads
Pass a model download proxy through the semantic index worker and local embedding provider so local Hugging Face downloads use the effective proxy.

Restart idle local workers when the proxy changes before preload, build, or search calls, and initialize app logging inside the worker process for preload diagnostics.
2026-06-26 09:56:32 +08:00
diguaandClaude Sonnet 4.6 984fe3df3b fix(import): declare stream-json/stream-chain deps and stop multiChat scan fallthrough
- stream-json and stream-chain were used directly in GoogleChatTakeoutResolver
  but not declared in node-runtime's package.json; fixes module resolution
  failure in non-hoisted installs
- when detectFormat returns multiChat but scanMultiChatFile returns empty,
  the code fell through to single-file import and could silently import the
  first chat; now returns early with an error message in both cases

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 18:10:30 +08:00
diguaandClaude Sonnet 4.6 7ea95d5c74 feat(parser): parse Google Chat takeout conversations
Add streaming zip reader dependency (fflate) and a new parser for Google
Chat takeout conversation files. Handles localized message types, reactions,
topic threads, and deduplication of multi-file exports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 18:10:30 +08:00
digua da1432a1d3 fix(semantic-index): package local embedding runtime deps 2026-06-23 22:58:22 +08:00
diguaandCursor fede744758 chore(deps): add sqlite-vec and transformers for semantic index P0
为语义索引 Phase 1 的 P0 前置验证引入 sqlite-vec(vec0 向量存储)
和 @huggingface/transformers(本地 ONNX embedding 推理)依赖。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 16:18:39 +08:00
diguaandCursor 6c3d36e7df feat(ai): upgrade pi-ai from @mariozechner 0.54 to @earendil-works 0.74
- Replace @mariozechner/pi-ai and pi-agent-core with @earendil-works scope
- Adapt to AgentTool.execute() params type change (Record → unknown)
- Migrate Agent constructor to use initialState for systemPrompt/tools/messages
- Update onPayload callback signature to include model parameter
- Filter finalMessages with isPiMessage() for new AgentMessage union type
- Use state.errorMessage instead of deprecated state.error

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 23:19:47 +08:00
digua b12c07dc32 refactor: extract Electron shell to apps/desktop/
Move Electron-specific code (main, preload, shared) and configs
(electron.vite, electron-builder) into apps/desktop/ to prepare
for multi-platform support (Web Browser standalone).

- Create apps/desktop/ with dedicated package.json and tsconfig
- Split Electron deps (electron, electron-updater, better-sqlite3,
  etc.) from shared frontend deps in root package.json
- Declare better-sqlite3 and @node-rs/jieba in packages/node-runtime
- Add stream-json to packages/parser where it belongs
- Update all path aliases (@electron/* → apps/desktop/*) in tsconfig,
  vite configs, and relative imports in preload/main
- Keep slim root tsconfig.node.json as shared base for packages
- Update CI/CD release workflow for new directory layout
- Fix pre-existing type errors (pi-ai Model generic, SQLLabTab
  LLMChatStreamChunk, filter.test.ts empty methods)
2026-05-19 00:31:00 +08:00
digua 8dd3e2396c refactor(ai): extract shared Agent core to @openchatlab/node-runtime
- Create runAgentCore() in node-runtime/src/ai/agent/ encapsulating
  PiAgentCore construction, history conversion, event subscription,
  abort forwarding, tool round management, and usage collection
- Re-export pi-agent-core/pi-ai types (AgentTool, Type, Model, etc.)
  and functions (completeSimple, streamSimple) from node-runtime
- Refactor Server agent.ts to use runAgentCore, removing all direct
  pi-agent-core/pi-ai imports (~335→~210 lines)
- Remove pi-agent-core and pi-ai from Server package.json dependencies
- Refactor Electron agent/index.ts and event-handler.ts to use
  runAgentCore with DI hooks (streamFn, onConvertToLlm, onDebugContext)
- Document remaining Electron pi-ai usage points for future migration
2026-05-14 23:36:11 +08:00
digua b195750f34 refactor: extract tokenizer to @openchatlab/node-runtime
Move countTokens/countMessagesTokens from Electron to shared package.
Electron side becomes a thin re-export wrapper.
2026-05-14 21:27:39 +08:00
digua 12f9ae90eb feat(web): enable AI page data loading in web mode via HTTP endpoints
- Move assistant/skill MD parsers to @openchatlab/node-runtime (shared)
- Move BUILTIN_TOOL_CATALOG, provider-registry, model-catalog to @openchatlab/core
- Add /_web/ai/* HTTP routes for assistants, skills, LLM config, providers, models, tools
- Frontend shims: read ops call HTTP, write/agent ops return stubs
- Remove IS_ELECTRON guard in llm.ts to enable web-mode config loading
- Improve web-mode AI chat error message to be user-friendly
2026-05-14 20:29:06 +08:00
digua 7c99ae2d26 feat(node-runtime): add BetterSqliteAdapter implementing DatabaseAdapter
Phase 1.2: create @openchatlab/node-runtime package with better-sqlite3
adapter that implements the DatabaseAdapter interface from core. Also add
pragma() method to the DatabaseAdapter interface.
2026-05-11 19:45:45 +08:00