Commit Graph
143 Commits
Author SHA1 Message Date
digua d5f34af445 refactor(parser): standardize format identifiers 2026-08-04 17:29:09 +08:00
digua 256e93605a refactor(database): remove legacy session FTS 2026-08-03 17:28:19 +08:00
digua 2bb5eb3715 test(apps): strengthen application and build verification 2026-08-01 16:41:30 +08:00
digua f96fef7b46 feat(cli): install local embedding runtime on demand 2026-08-01 13:19:41 +08:00
digua 3debb13ff9 fix(import): wire batch adapters and failure diagnostics
Preserve batch support through telemetry, forward item-scoped progress across Desktop and CLI Web, and retain original backend failure details for diagnostics and unfinished results.
2026-07-31 20:22:50 +08:00
digua 62b7104f1f feat(import): add safe batch coordinator 2026-07-31 20:22:50 +08:00
digua 4155386676 fix(import): generate session index once 2026-07-31 17:22:05 +08:00
digua 860bf52d62 feat(analytics): add privacy-safe product telemetry
Add self-hosted Umami reporting alongside existing telemetry across Desktop and CLI Web.

Track normalized startup, import, feature, and AI usage with a stable anonymous ID and strict privacy allowlists. Keep incremental usage platform-independent and preserve accurate failure classifications and platform metadata across import paths.
2026-07-29 14:28:48 +08:00
digua dc20320041 fix(demo): harden cross-platform demo imports
Rebase official Demo timelines against the browser timezone, bound stalled downloads, and roll back partial batches across Desktop, CLI Web, and Web WASM. Document the platform cleanup hook's established best-effort boundary.
2026-07-26 01:43:43 +08:00
digua 9e7c76fb89 feat(demo): add rolling cross-platform imports 2026-07-26 01:43:43 +08:00
digua 7bf7768c03 refactor(ai): unify LLM configuration storage 2026-07-23 19:46:22 +08:00
digua a8e59174af refactor: remove obsolete import and database code 2026-07-23 17:37:50 +08:00
digua 53bd6750af feat(analysis): merge session overview into insights 2026-07-22 19:00:39 +08:00
digua 73c6de364e chore(web): add Web WASM development workflow 2026-07-20 17:24:55 +08:00
digua 3a995f6491 feat(cli): add ChatLab format validator 2026-07-19 15:16:29 +08:00
digua 739f8c7522 fix(data): preserve old directory after migration 2026-07-18 16:15:19 +08:00
digua 79e2027b43 fix(ai): initialize and migrate default assistants
Load standalone CLI assistant configs through the shared manager so fresh data directories receive locale defaults. Back up custom assistants that occupy newly reserved default IDs before installing canonical templates.
2026-07-17 00:42:04 +08:00
digua 3dc8fb3157 fix(ai): share default assistants across runtimes 2026-07-17 00:42:04 +08:00
digua e4eb7fa683 feat(ai): improve default assistant experience 2026-07-17 00:42:04 +08:00
digua 7d156040f8 fix(runtime): contain and clean temporary workspaces 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 bf7004d0e0 refactor(http): share server infrastructure 2026-07-16 20:09:18 +08:00
digua f949c7a8f9 refactor(http): unify API error model 2026-07-16 20:09:18 +08:00
digua a14de9fc10 refactor(electron): organize desktop runtime modules 2026-07-16 20:09:18 +08:00
digua 5a5fae880a refactor: remove redundant re-export proxies 2026-07-16 20:09:18 +08:00
digua 82710e2d5a fix(import): keep dry-run database access read-only
Use non-migrating session enumeration during import analysis so previews cannot mutate legacy schemas or raise data-directory compatibility gates.
2026-07-14 11:32:22 +08:00
digua 53406f4c6d feat(import): add dry-run preview
Share auto-import planning between preview and write paths, expose a machine-readable CLI result envelope, and preserve explicit parser options during analysis.
2026-07-14 11:32:22 +08:00
digua 16ee4d8348 refactor(ai): unify desktop tool adapters 2026-07-13 20:42:27 +08:00
digua 5be001fea5 fix(sync): preserve pull cursor on lock conflict
Propagate retryable import lock conflicts through CLI and Desktop pull adapters so scheduled pulls defer without advancing past unimported messages.
2026-07-13 01:01:42 +08:00
digua 61d42b2500 fix(import): harden automatic incremental imports 2026-07-13 01:01:42 +08:00
digua 5823797256 feat(web): enable automatic incremental imports 2026-07-13 01:01:42 +08:00
digua 0606d5f5f7 feat(cli): enable automatic incremental imports 2026-07-13 01:01:42 +08:00
digua 312a0306cb fix(parser-native): harden native parser test edge cases 2026-07-05 22:49:38 +08:00
digua c0548f63c8 feat(import): prepare native parser rollout 2026-07-05 22:49:38 +08:00
diguaandCursor c265925e3e fix(import): report accurate post-parse progress stages in real time
The UI stayed on "parsing messages" during the whole post-parse phase:
the importer emitted an 'importing' stage the frontend had no text for,
and on CLI Web the synchronous DB writes / index / FTS build starved the
event loop so buffered SSE progress events only arrived after the import
finished.

- Replace 'importing' with 'saving' (message writes) and a new 'indexing'
  stage (indexes / FTS / session index) in ParseProgress, with UI texts
  for all four locales.
- Yield a macrotask between native parser batches and before heavy
  synchronous steps so SSE progress events flush while importing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 22:49:38 +08:00
digua 73553c4c2c fix(query): clamp SQL rows and stabilize response stats
Clamp CLI SQL output after execution so user-provided LIMIT clauses cannot bypass the requested row cap. Add a deterministic message id tie-breaker for response-time statistics.
2026-07-04 15:12:50 +08:00
digua 8fd3f397e0 fix(query): hide context time filters
Remove time filter options from the message context command so agents do not pass unsupported bounds that would be silently ignored.
2026-07-04 15:12:50 +08:00
digua 6e5a0fa893 fix(query): dedupe expanded search tail
Avoid appending search hits that were already included as context when max message expansion limits only expand the first hits.
2026-07-04 15:12:50 +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 c4f5e06e5e feat(cli): add agent-facing query commands 2026-07-04 15:12:50 +08:00
digua b346b51eee refactor(sync): share automation routes across runtimes 2026-07-02 10:35:02 +08:00
digua 70ada5031c fix(ai): share AI log opening route 2026-07-02 10:35:02 +08:00
digua c8c4e1aca6 feat(contacts): compute contacts in background worker 2026-06-27 15:54:08 +08:00
diguaandClaude Sonnet 4.6 1209e2ce4b refactor(import): migrate CLI sync/pull path to shared streaming importer
Removes the legacy apps/cli/src/import/importer.ts (hand-rolled FTS, dedup,
session-ID generation) and apps/cli/src/import/chatlab-reader.ts (buffered
in-memory JSON/JSONL parser). DirectImporter in sync/adapters.ts now calls
streamImport / incrementalImport from stream-import.ts, which use the
@openchatlab/parser streaming pipeline and node-runtime shared logic.

Changes:
- Add sessionId? to StreamImportOptions so callers can fix the target session
  ID instead of auto-generating one (needed by pull engine full-import path)
- Rewrite DirectImporter.incrementalImportFile and fullImportFile to use
  the shared importers; map IncrementalImportResult fields to ImportResult
- Remove legacy exports from apps/cli/src/import/index.ts
- Rewrite importer.test.ts to use streamImport + a temp ChatLab JSON file
  (same two data-dir compatibility gate assertions as before)
- Delete importer.ts and chatlab-reader.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 21:45:16 +08:00
diguaandClaude Sonnet 4.6 ced4ed16bd feat(import): auto-generate session index after all import paths
Session index (segment/message_context tables) was previously generated
inconsistently: CLI used postImportHook, Desktop relied on a separate
explicit RPC call, and the CLI sync/pull legacy importer never built it.

Move generateSessionIndex / generateIncrementalSessionIndex into the
shared importers (streaming-importer.ts, incremental-importer.ts) so
every caller gets it automatically. Remove the now-redundant calls from
CLI's postImportHook. Also add the calls to the legacy importer.ts used
by CLI sync/pull, which had no session index at all.

Incremental imports use generateIncrementalSessionIndex, which preserves
existing AI summaries. Full imports call generateSessionIndex only on
newly created sessions where no summaries exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-25 21:45:16 +08:00
diguaandClaude Sonnet 4.6 aff59c7503 feat(import): wire Google Chat archive sources into CLI, Electron and frontend
Add archive reader, Google Chat resolver and source manager in node-runtime.
Expose prepared archive sources via CLI HTTP route and Electron IPC.
Add frontend service adapters and an import selection flow with i18n support
for all four locales. Fix rescanning on repeated archive imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 18:10:30 +08:00
diguaandClaude Sonnet 4.6 2dbe569f2a fix(logging): fix four review issues in unified logger
- Front-end error reporter was posting to /_web/_web/logs/report (double
  base URL prefix); fixed to /logs/report
- uncaughtException/unhandledRejection handlers in CLI and Electron did not
  exit after logging, overriding Node's default crash behavior; added
  process.exit(1)
- NodePathProvider constructor in run() and chatlab status triggered
  migrateFromElectronIfNeeded() as a side effect; added getSystemLogsDir()
  to get the system logs path without resolving user data
- formatData() was called outside write()'s try/catch, so errors with
  circular cause objects could escape appLogger.error(); moved inside

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 15:28:09 +08:00
diguaandClaude Opus 4.8 7c21d1c879 feat(logging): add unified app logger with file rotation and global error capture
Build a shared appLogger (node-runtime) that all three runtimes write to a
single rolling logs/app.log (10 MB → rename to app.old.log). Replaces the
four independent hand-written loggers (app.log/api.log Electron wrappers)
with a unified entry point while leaving AiLogger/perf-logger intact.

Key additions:
- packages/node-runtime/src/logging/app-logger.ts: initAppLogger/appLogger
  singleton, INFO threshold by default (CHATLAB_LOG_LEVEL to override),
  atomic rename rotation, Error data auto-extracts message+stack
- Three-runtime init: Electron main, CLI Web (http/index.ts), CLI (run())
- Global crash capture: uncaughtException + unhandledRejection on all three
  Node runtimes now land in app.log scope 'crash'
- Fastify setErrorHandler fallback logs scope 'http' on CLI Web and Electron
  internal server for unexpected 5xx errors
- Frontend: window.onerror + unhandledrejection + Vue errorHandler feed into
  POST /_web/logs/report (scope 'web') with dedup+throttle
- AGENTS.md: logging rules section requiring key-path logs on new/changed features

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 15:28:09 +08:00
digua 43e6ffdb81 fix(cli): include analytics key in release build 2026-06-23 22:58:22 +08:00
diguaandClaude Sonnet 4.6 c8cccbefd4 feat(analytics): track CLI web daily active users via shared AnalyticsService
- Extract shared AnalyticsService to packages/node-runtime using direct
  Aptabase HTTP API (removes @aptabase/electron dependency)
- Add POST /_web/telemetry/track route for generic event reporting
- Desktop: migrate analytics.json from userData to systemDir (~/.chatlab/),
  trigger daily active from renderer via new IPC so user-selected locale is used
- CLI: inject APTABASE_APP_KEY at build time, create AnalyticsService on
  server start, report app_active with platform: cli-web
- Both platforms report user-selected locale via platform service abstraction

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 22:58:22 +08:00