Introduce an Electron app with session browser, memory list, and usage
views (vanilla JS + Vue scaffolding). On the data layer: add content_type
and is_meta to messages for transcript control-plane filtering, introduce
FTS5-backed memory recall with safe tokenization, support memory archival
via forget() through the renamed --attune runtime, and expose anchors on
memory records.
Memory layer is now English-indexed: memories() query terms and
remember() summaries must be English. Adds a runtime assertion that
rejects CJK text in both paths, guiding the agent to translate
non-English user requests before querying or writing memories.
Ensures consistent retrieval regardless of conversation language.
The old slug-to-path conversion (replace hyphens with slashes) was
lossy and wrong for paths containing hyphens. Now infers project_path
from the most-frequent observed cwd across session messages, falling
back to slug decoding only when no cwd data exists. Adds
refreshSessionProjectPaths() to backfill existing sessions on rebuild.
Resolves current project from cwd, lists all known projects with session
and memory counts, and returns the current project's recent sessions and
memories in one call. Enables the agent to orient itself at the start of
a retrieval without multiple exploratory queries.
Add a memories table (survives index rebuilds) for agent-written
conclusions with provenance (session, message range, project). The agent
writes markdown files via Write tool (user-approved), then registers
them via a --remember CodeAct script with remember(). Recall via
memories() in --query scripts, filtered by project/session/time.
Separates query (read-only, assertReadOnlySql) from remember (write)
execution contexts in runtime.mjs.
Split the monolithic skill prompt into three tiers:
- Core API (search/context/sql) stays in the first prompt
- Structured helpers listed as one-liners with filter signatures
- Detailed patterns and pitfalls extracted to references/
Add references/query-patterns.md (copyable CodeAct recipes) and
references/pitfalls.md (scope, FTS, ordering, compactness traps).
Clarify project scope semantics (slug vs path vs cwd) throughout.
Add ORDER BY timestamp DESC to failures() for newest-first default.
lightweight workflowTree, build debounce, minor fixes
- Index phase, label, model, state, duration, tokens per workflow agent
- Index duration, total_tokens, status, name per workflow run
- workflowTree returns parsed result + agent summaries instead of
dumping all messages
- 30s debounce on buildIndex to avoid repeated directory scans
- Fix broken BASH_EXIT_PAT (SQLite LIKE has no character classes)
- Fix SKILL.md step numbering, document FTS5 hyphen limitation
Index the is_error boolean from JSONL tool_result blocks into a new
column, replacing the old ERROR_PATS text-matching approach that
produced ~90% false positives. Bash exit code pattern kept as fallback.
Add sessions() as first-class entry point for session discovery with
project/time/branch filters. Extend summaries, workflows, failures,
subagents, fileHistory with the same opts vocabulary that search()
already had — no more pulling full datasets to filter client-side.
Prepares for adding Codex JSONL support — new indexers can be added
without touching the query layer.
- db.mjs: schema, openDb, truncation helpers, shared utilities
- indexer.mjs: file discovery, JSONL parsing, SQLite writes
- query.mjs: all query API functions (search, context, raw, etc.)
- runtime.mjs: thin CLI entry point + VM script executor
- Replace readFileSync+split with chunked line reader (readLines) to
avoid loading entire JSONL files into memory at once
- Wrap each file's indexing in its own transaction so one corrupt file
doesn't roll back the entire index
- Log warnings to stderr instead of silently swallowing errors in
indexSubagentMeta, indexWorkflows, and indexHistory
- Add try/catch around readdirSync calls in discoverJsonlFiles and
indexWorkflows to survive unreadable directories
- Push error-pattern filtering in failures() into SQL LIKE clauses
instead of scanning all tool_results in JS
- Don't truncate workflow result_json and script (low-volume, must
stay parseable)
- Replace blind string truncation on tool_calls.input_json with
structure-aware truncJson that shortens individual string values
while keeping the JSON skeleton valid
- Add raw(uuid, {offset, limit}) API for windowed access to the
original JSONL line, so truncated content can be recovered on demand
Previously the session metadata accumulator started from zero on every
reindex pass, so an incremental update would overwrite started_at and
message_count with values derived only from the new lines.
Now reads the existing session row first and merges new data on top.