Commit Graph
25 Commits
Author SHA1 Message Date
KokerZhou 0edc64d99a fix(settings): allow memory as the default session tab (#494) 2026-10-12 20:50:43 +08:00
digua eadadda071 feat(electron): add persistent UI scale setting 2026-09-28 16:59:25 +08:00
digua 47299a94cb feat(cli): make clb web the primary web command 2026-08-12 12:47:00 +08:00
digua 3db40375b6 fix(electron): default Windows close to background
Remove the one-time close prompt and remembered-choice path so Windows close behavior is always explicit and predictable. New installations now minimize to the system tray by default, while users can still choose to quit from settings.
2026-08-07 20:29:37 +08:00
digua 35880228b7 feat(electron): add Windows close-to-tray behavior 2026-08-07 20:29:37 +08:00
digua 7bdd1fe751 fix(runtime): harden migration and cleanup safety 2026-08-01 16:41:30 +08:00
digua 7bf7768c03 refactor(ai): unify LLM configuration storage 2026-07-23 19:46:22 +08:00
digua 53bd6750af feat(analysis): merge session overview into insights 2026-07-22 19:00:39 +08:00
digua 801e7fc66a fix(cli): harden agent query safeguards
Tighten agent-facing query validation, privacy guards, SQL result handling, config writes, and LIKE search semantics for the CLI query workflow.
2026-07-04 15:12:50 +08:00
digua 217e765305 feat(config): add CLI privacy gates 2026-07-04 15:12:50 +08:00
diguaandClaude Sonnet 4.6 39393cf38d refactor: remove dead code and simplify over-engineered abstractions
- Delete NotificationBus interface (no implementations, no callers)
- Delete useAsyncData/useMultipleAsyncData composables (zero import sites)
- Inline CHART_CAPABILITY_SKILL_ID into tool-catalog.ts (was a single-constant file)
- Inline AsyncSqlExecutor into message-query-functions.ts (was a single-interface file)
- Rename tools TimeFilter → ToolTimeRange to eliminate name collision with shared-types
- Shrink useToast wrapper: two interfaces → one type, 40 lines → 17 lines
- Simplify deepMerge: remove recursion, config is at most 1 level deep

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 14:18:32 +08:00
digua 2887f1cb73 test(parser,config): cover representative fixtures and migrations 2026-06-08 10:14:42 +08:00
diguaandCursor a75fd0186d feat(cli): add --require-auth flag for /_web/* API protection
When enabled, all /_web/* routes require Bearer token authentication,
same as /api/v1/*. This hardens security for server/headless/public
deployments where the same-origin assumption doesn't hold.

- Add `require_auth` field to config schema (default: false)
- Add `setRequireAuth()` to auth hook, conditionally enforce auth on /_web/*
- Support `--require-auth` in both `chatlab start` and `--daemon` mode
- Read from config.api.require_auth or CLI flag override

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:41:21 +08:00
diguaandCursor 6727ff609c feat(ai): add summary strategy with brief and standard detail levels
Support two summary strategies (brief/standard) for AI-generated session
summaries. Users can choose their preferred detail level in Settings > AI >
Session Index. Standard (default) produces richer summaries covering people,
events, and key details.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-27 23:47:27 +08:00
diguaandCursor 0ba9ae04a6 chore: migrate workspace packages to ESM
- Add "type": "module" to all workspace package.json files
- Replace __dirname with import.meta.url-based resolveCliPath() helper
- Convert stream-json/stream-chain CJS named imports to default + destructure
  for ESM compatibility
- Use createRequire() for @node-rs/jieba native module loading in ESM context

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 23:19:47 +08:00
diguaandCursor 6ec03d330f fix(electron): prevent unified migration from reverting data dir changes
The unified directory migration (needsUnifiedDirMigration) would
re-trigger after a user changed their data directory, overwriting
config.toml back to the old Electron path.

Root cause: no persistent flag tracking whether the migration had
already completed. If old databases remained (cleanup failure or
timing), it would re-detect and re-run.

Fix:
- Add `electron_migration_done` flag to config.toml [data] section
- Set flag after migrateToUnifiedDirs succeeds and in setCustomDataDir
- Check flag at start of needsUnifiedDirMigration to skip if done
- Add "migrate to default" button when data is at non-default path
- Fix NLP directory path: move from userDataDir to systemDir (~/.chatlab/nlp)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-26 23:19:47 +08:00
digua e3370b52c2 fix(web): align dev server node runtime 2026-05-22 10:20:39 +08:00
digua 415dcefc7d fix(ai): use provider name instead of config name for auth profile keys 2026-05-19 23:50:50 +08:00
digua 08260499f8 feat: migrate localStorage to backend storage with declarative persist plugin
- Add backendPersist Pinia plugin for declarative preferences.json persistence
- Move Preferences types to @openchatlab/shared-types (single source of truth)
- Migrate sessionGapThreshold from localStorage to config.toml [ui]
- Migrate chatlab_filter_history from localStorage to preferences.json
- Fix stale localStorage locale read in i18n/index.ts
- Simplify usePreferencesSync (172 → 75 lines) by delegating to plugin

Adding a new backend-synced preference now only requires 3 changes:
1. shared-types interface  2. node-runtime DEFAULTS  3. store backendPersist.pick
2026-05-19 22:42:00 +08:00
digua 6352a3f191 refactor: implement Migration Runner for config data migrations
Extract migration logic from loadConfigStore into a shared Migration Runner
system (packages/config/src/migrations/). Runs at app startup in both
Electron and CLI, enabling CLI to handle encrypted key migration independently.
2026-05-14 21:14:15 +08:00
digua b479fd3b2d feat(web): enable AI chat in web mode with shared conversation module
- Extract AIConversationManager to @openchatlab/node-runtime for Electron + Server reuse
- Add /_web/ai/conversations/* HTTP endpoints for conversation/message CRUD
- Create FetchAIAdapter to replace WebAIAdapter stub
- Implement server-side Agent with SSE streaming (/_web/ai/agent/stream)
- Add agentApi SSE client shim in frontend registry
- Migrate API key storage from encrypted llm-config.json to auth-profiles.json
- Add @openchatlab/config auth-profiles module for credential management
2026-05-14 20:55:54 +08:00
digua 61a6e72c64 refactor: unify data directory for Electron and CLI
Split PathProvider into dual-root architecture: systemDir (~/.chatlab/)
for config/logs/cache/ai/settings, and userDataDir (~/.chatlab/data/ by
default) for chat databases. Both Electron and CLI share the same
config.toml for user_data_dir resolution.

- Refactor PathProvider interface (getSystemDir + getUserDataDir)
- Update config schema (data.dir → data.user_data_dir)
- Add writeConfigField() for config.toml manipulation
- Fix needsUnifiedDirMigration() to detect old Electron data even when
  user_data_dir was already set by CLI (compare paths instead of
  checking existence)
2026-05-14 19:35:36 +08:00
digua 6ca27b1194 refactor: unify query logic into @openchatlab/core and add analytics HTTP routes 2026-05-14 19:20:51 +08:00
digua 9afabedca8 feat(server): extract standalone HTTP API from Electron
Create packages/server/src/http/ with platform-agnostic HTTP API:
- errors.ts: error codes and response helpers
- auth.ts: Bearer token auth using @openchatlab/config
- server.ts: Fastify factory with auth hook and error handler
- routes/system.ts: status and schema endpoints
- routes/sessions.ts: 7 session endpoints using DatabaseManager + core
- index.ts: server lifecycle (startHttpServer/stopHttpServer)

Add token field to @openchatlab/config apiConfigSchema.
Add fastify dependency to packages/server.
2026-05-11 20:28:26 +08:00
digua e49f2fbbe8 feat(config): create @openchatlab/config package
Phase 1.6: configuration management with TOML/JSON file support,
CHATLAB_* environment variable overrides, and Zod schema validation.
Config file location: ~/.chatlab/config.toml
2026-05-11 19:55:33 +08:00