Skip to content

Extend session sources to OpenCode, Cursor, and DeepSeek Harness (dsh) #7

Description

@miniLV

Context

Today the memory loop compiles only Codex and Claude Code sessions into Daily Wiki pages. SCHEMA.md treats these as the supported raw session sources, and scripts/capture-ai-chats.mjs hard-codes two source scanners. Conversations with other local agents (OpenCode, Cursor, DeepSeek Harness) are not captured, so the vault misses a meaningful slice of engineering work.

Goal

Add three additional session sources so a user's conversations with OpenCode, Cursor, and DeepSeek Harness are automatically organized into the local Daily Wiki:

  • OpenCode~/.local/share/opencode/opencode.db (SQLite: session / message / part), with a fallback to the legacy storage/ JSON tree.
  • Cursor~/Library/Application Support/Cursor/User workspaceStorage + globalStorage state.vscdb (SQLite ItemTable / cursorDiskKV). This store is version-fragile (2.x composerData vs 3.0 bubbleId:*); treat as best-effort and degrade to a warning instead of crashing.
  • DeepSeek Harness (dsh)~/.dsh/storages/ event-sourced JSONL session logs, based on the official deepseek-harness persistence format (best-effort, no real sessions yet to validate against).

Requirements

  • New source flags: opencodeSourcesEnabled, cursorSourcesEnabled, dshSourcesEnabled — all default off; a source is only consulted when === true (keeps existing sourcesConfirmed gating intact).
  • capture-ai-chats.mjs reads these flags, resolves each adapter to normalized {role, text, timestamp} records, and reuses the existing buildSessionFromRecords evidence pipeline — no duplicated normalization.
  • SQLite is read with built-in node:sqlite (Node ≥22.13) so no new dependency is added. If node:sqlite is unavailable or a DB is missing/incompatible, skip that source with a warning rather than failing the whole capture.
  • Evidence IDs and agent names: opencode-* / OpenCode, cursor-* / Cursor, dsh-* / DeepSeek Harness.
  • Config UI: add the three source checkboxes to the source modal; update readForm/writeForm/source-gate detail and the zh/en strings.
  • SCHEMA.md generalizes the agent: value list; wiki/templates/Daily AI Chat Summary Template.md and the ingest/setup skill wording are updated.
  • README.md + README.en.md supported-source table updated.

Constraint

Skill sync to an agent stays Codex-only (as today) — the engineering-memory-loader continues to be exposed only to ~/.codex/skills. The new options are extraction sources only, not skill-sync targets.

Notes / Caveats

  • Cursor is the fragile source: its on-disk schema moved across Cursor versions and on the author's machine the workspace composerData composer list only partially overlaps the global bubbleId:* store. Confirmed working for the global-bubble path with lastUpdatedAt-based dates; missing_model is expected (Cursor records no model). Validate on real data before relying on it.
  • dsh default persistence is Zstandard-frame JSONL; the adapter reads raw-line JSONL and skips Zstd frames (no zstd binary dependency).

Verify

  • node --test scripts/*.test.mjs (53 tests incl. new opencode + dsh fixtures) passes.
  • node scripts/wiki-lint.mjs reports 0 errors / 0 warnings.
  • Capture on the author's machine discovers OpenCode sessions for 2026-08-30 and Cursor sessions for 2025-05-06 without crashing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentScoped and ready for an agent to implement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions