agentel 0.2.5 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -37
- package/docs/code-reference.md +26 -13
- package/docs/history-source-handling.md +247 -82
- package/docs/release.md +1 -1
- package/package.json +5 -2
- package/src/archive.js +200 -17
- package/src/canonical-events.js +74 -25
- package/src/cli.js +2561 -204
- package/src/config.js +11 -0
- package/src/doctor.js +2 -0
- package/src/importers/claude.js +309 -11
- package/src/importers/gemini.js +2 -1
- package/src/importers/providers.js +22 -0
- package/src/importers.js +2142 -212
- package/src/parser-versions.js +1 -0
- package/src/search.js +417 -176
- package/src/sources.js +1 -0
- package/src/web-export-instructions.js +79 -0
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ Core capabilities:
|
|
|
9
9
|
- markdown-primary, redacted local archive under `~/.agentlog/data/agentlog/`
|
|
10
10
|
- canonical event JSONL alongside each transcript for provider-independent search
|
|
11
11
|
- canonical repo keying from git remotes, first commits, or path hashes
|
|
12
|
-
- Codex CLI, Codex Desktop, ChatGPT export, Claude Code CLI,
|
|
13
|
-
Desktop, Claude Workspace, Claude.ai export, Gemini CLI, Antigravity,
|
|
12
|
+
- Codex CLI, Codex Desktop, Codex SDK jobs, ChatGPT export, Claude Code CLI,
|
|
13
|
+
Claude Code Desktop, Claude Workspace, Claude.ai export, Gemini CLI, Antigravity,
|
|
14
14
|
Devin CLI, and Cursor imports
|
|
15
15
|
- event-first `agentlog history` search with markdown/transcript fallback
|
|
16
16
|
- `agentlog-recall` MCP stdio server exposing `search_past_sessions`
|
|
@@ -41,7 +41,7 @@ ref for repeatable installs:
|
|
|
41
41
|
```sh
|
|
42
42
|
npm install -g brianlzhou/agentlog
|
|
43
43
|
# or
|
|
44
|
-
npm install -g brianlzhou/agentlog#v0.2.
|
|
44
|
+
npm install -g brianlzhou/agentlog#v0.2.8
|
|
45
45
|
agentlog init
|
|
46
46
|
```
|
|
47
47
|
|
|
@@ -77,7 +77,10 @@ npm test
|
|
|
77
77
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js init --yes --skip-import --no-autostart --no-claude --no-recall --no-telemetry
|
|
78
78
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source codex-cli --since 30d
|
|
79
79
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source codex-desktop --since all
|
|
80
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import chatgpt
|
|
81
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import claude-web
|
|
80
82
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import chatgpt ~/Downloads/chatgpt-export.zip --username you@example.com
|
|
83
|
+
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import chatgpt "~/Downloads/OpenAI-export/User Online Activity" --username you@example.com
|
|
81
84
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import claude-web ~/Downloads/claude-export --username you --display-name "Personal Claude"
|
|
82
85
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source claude --since 30d
|
|
83
86
|
AGENTLOG_HOME=/tmp/agentlog-demo node ./bin/agentlog.js import --source claude-code-desktop --since all
|
|
@@ -219,7 +222,7 @@ build step. Archives still keep stable `path:<hash>` keys for folders without
|
|
|
219
222
|
git identity, but the UI displays the local path.
|
|
220
223
|
|
|
221
224
|
Provider filters use one stable order: OpenAI (`codex-cli`, `codex-desktop`,
|
|
222
|
-
`chatgpt`), Anthropic (`claude`, `claude-code-desktop`, `claude-workspace`,
|
|
225
|
+
`codex-sdk`, `chatgpt`), Anthropic (`claude`, `claude-code-desktop`, `claude-workspace`,
|
|
223
226
|
`claude-web`, `claude-sdk`), Google (`gemini-cli`, `antigravity`), Cognition
|
|
224
227
|
(`devin-cli`), then other local tools (`cursor`, `cline`, `opencode`,
|
|
225
228
|
`aider`).
|
|
@@ -362,23 +365,37 @@ alongside it:
|
|
|
362
365
|
For large multi-session stores such as Cursor SQLite, the per-session raw
|
|
363
366
|
manifest may reference one shared copy under `raw-sources/` instead of copying
|
|
364
367
|
the same database into every session folder.
|
|
368
|
+
Web chat imports may also reference a shared raw export archive; ChatGPT
|
|
369
|
+
attachments remain preserved there and fresh imports render image/file cards in
|
|
370
|
+
the readable transcript when the export includes the file bytes.
|
|
365
371
|
|
|
366
|
-
`events.jsonl` uses the local `agentlog.events.
|
|
372
|
+
`events.jsonl` uses the local `agentlog.events.v2` canonical event shape:
|
|
367
373
|
`session.started`, `prompt.submitted`, `response.generated`, `tool.called`, and
|
|
368
|
-
`tool.completed
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
374
|
+
`tool.completed`; completed tool events link back to the matching call when the
|
|
375
|
+
source exposes stable ids or matching names. Parser versions are stamped by
|
|
376
|
+
source type so importer output changes can trigger reimport with a new
|
|
377
|
+
fingerprint. Recall/search builds a keyword index over event text first and
|
|
378
|
+
falls back to transcript/markdown for legacy archives without events. The local
|
|
379
|
+
search index stores compact term postings for CLI compatibility plus a SQLite
|
|
380
|
+
FTS5 sidecar for fast web queries; when either index format changes,
|
|
381
|
+
`agentlog history` and `agentlog index` rebuild it from archived
|
|
382
|
+
transcripts/events without a full source
|
|
375
383
|
reimport. The web viewer avoids doing that rebuild on a keystroke so a large
|
|
376
384
|
old index, or a full-archive Markdown fallback, cannot block interactive
|
|
377
385
|
search.
|
|
378
386
|
|
|
379
387
|
Stats are import-time metadata, not viewer-time transcript repair. Archive
|
|
380
388
|
metadata stores message counts, user-message counts, token usage, and models for
|
|
381
|
-
each session, and the web stats view reads those fields directly.
|
|
389
|
+
each session, and the web stats view reads those fields directly. Token totals
|
|
390
|
+
include cache-read/cache-write tokens when providers report them, while the
|
|
391
|
+
stats payload and UI also keep input, output, cache, and reasoning sub-counts
|
|
392
|
+
separately when available. Codex imports preserve `threads.tokens_used` as the
|
|
393
|
+
provider total and split rollout `token_count` events into fresh input, cache
|
|
394
|
+
read, output, and reasoning metadata. Codex SDK and
|
|
395
|
+
Claude SDK batch jobs are kept out of primary activity totals, streaks, folder
|
|
396
|
+
rankings, and provider/model charts; the stats payload and web view expose them
|
|
397
|
+
as a separate SDK jobs section so high-volume automation does not drown out
|
|
398
|
+
interactive work. Cursor sessions
|
|
382
399
|
without provider-reported token usage can also carry separately labeled
|
|
383
400
|
`estimatedUsage`, which the stats view includes while reporting estimated token
|
|
384
401
|
coverage. ChatGPT and Claude.ai exports without provider usage get estimated
|
|
@@ -388,21 +405,34 @@ parts. During pre-v1 development, if those stats fields or parser semantics
|
|
|
388
405
|
change, rebuild the local archive with
|
|
389
406
|
`agentlog update --yes --since all`.
|
|
390
407
|
|
|
391
|
-
ChatGPT and Claude.ai
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
408
|
+
ChatGPT and Claude.ai are manual export providers. Run `agentlog import chatgpt`
|
|
409
|
+
or `agentlog import claude-web` for current export instructions; after the
|
|
410
|
+
provider emails a download link, pass the official `.zip`, unzipped export
|
|
411
|
+
folder, or direct JSON file back to agentlog. These imports are stored as local
|
|
412
|
+
scoped web-chat archives and displayed through virtual conversation roots such
|
|
413
|
+
as `[chatgpt]conversations/<account-id>` and
|
|
395
414
|
`[claude]conversations/<account-id>/<project>`. The importer records account
|
|
396
415
|
metadata in `~/.agentlog/state/web-accounts.json`; use
|
|
397
416
|
`agentlog import accounts list` to inspect mappings and
|
|
398
417
|
`agentlog import accounts rename <provider> <account-id-or-username> --display-name <name>`
|
|
399
|
-
to change the viewer display name.
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
418
|
+
to change the viewer display name.
|
|
419
|
+
|
|
420
|
+
For newer OpenAI privacy exports named `OpenAI-export`, unzip the download and
|
|
421
|
+
import the `User Online Activity` folder. Running `agentlog import chatgpt`
|
|
422
|
+
without a path starts a walkthrough that asks for export paths one at a time,
|
|
423
|
+
then account username/email and display name. ChatGPT
|
|
424
|
+
conversations may be split across multiple
|
|
425
|
+
`Conversations__...chatgpt...part-000N` ZIPs or folders; passing the parent
|
|
426
|
+
folder is best, but the walkthrough can also collect the split part folders
|
|
427
|
+
individually and preserve `chat.html`, manifests, ZIPs, and attached files in
|
|
428
|
+
the shared raw export archive. Claude.ai exports preserve conversation summaries
|
|
429
|
+
and split structured
|
|
430
|
+
thinking parts from visible assistant answers when the export includes that
|
|
431
|
+
detail. Repeated manual uploads are incremental: unchanged conversations are
|
|
432
|
+
skipped, and updated conversations replace the stable session for that
|
|
433
|
+
provider/account/conversation id. Existing malformed pre-v1 web-chat archives
|
|
434
|
+
are not migrated automatically; reimport from the original export after a reset
|
|
435
|
+
or cleanup.
|
|
406
436
|
|
|
407
437
|
Tool calls and tool results are normalized before archive write where provider
|
|
408
438
|
data is available. For example, Devin tool calls live in
|
|
@@ -422,16 +452,19 @@ importer/parser logic to rebuild the local archive without redoing setup:
|
|
|
422
452
|
|
|
423
453
|
```sh
|
|
424
454
|
npm install -g agentel@latest
|
|
425
|
-
agentlog update --yes
|
|
455
|
+
agentlog update --yes
|
|
426
456
|
```
|
|
427
457
|
|
|
428
458
|
`agentlog update` preserves `config.json`, redaction settings, web account
|
|
429
|
-
labels,
|
|
430
|
-
archive, import, index, cache, and
|
|
431
|
-
local sources from the stored
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
459
|
+
labels, manually imported ChatGPT/Claude.ai archives, source histories, and
|
|
460
|
+
recall integrations. It removes derived local archive, import, index, cache, and
|
|
461
|
+
sync bookkeeping, then reimports configured local sources from the stored
|
|
462
|
+
preferences. The rebuild window comes from the initial backfill or an explicit
|
|
463
|
+
all-source import such as `agentlog import --source all --since all`; the
|
|
464
|
+
fallback for legacy configs is `all`. The watcher's rolling
|
|
465
|
+
`imports.defaultSinceDays` is not used by `agentlog update`. It does not touch
|
|
466
|
+
remote sync objects by default; use `agentlog sync replace` when the remote
|
|
467
|
+
should match the rebuilt local archive.
|
|
435
468
|
|
|
436
469
|
Use `agentlog config` to change `~/.agentlog/config.json` without rerunning the
|
|
437
470
|
init wizard:
|
|
@@ -471,16 +504,19 @@ local stores.
|
|
|
471
504
|
After discovery, init offers a checkbox-style source picker. Rows marked `[x]`
|
|
472
505
|
are selected; type one or more row numbers, such as `1 3 8`, to toggle sources
|
|
473
506
|
on or off, then press Enter with no input to accept the current selection.
|
|
474
|
-
Claude SDK jobs are shown as
|
|
475
|
-
can exceed interactive sessions. The selected sources are
|
|
476
|
-
used by later `agentlog import --source all` runs unless
|
|
477
|
-
explicitly.
|
|
507
|
+
Codex SDK jobs and Claude SDK jobs are shown as separate opt-in sources because
|
|
508
|
+
batch SDK traffic can exceed interactive sessions. The selected sources are
|
|
509
|
+
saved in config and used by later `agentlog import --source all` runs unless
|
|
510
|
+
`--sources` is provided explicitly.
|
|
478
511
|
|
|
479
512
|
Default init sources:
|
|
480
513
|
|
|
481
514
|
- Codex CLI sessions and Codex Desktop sessions from Codex state, shown as
|
|
482
|
-
separate toggles
|
|
483
|
-
|
|
515
|
+
separate toggles, including linked Codex subagent child sessions when
|
|
516
|
+
`thread_spawn_edges` metadata is present; Codex SDK jobs are available as an
|
|
517
|
+
opt-in batch source
|
|
518
|
+
- Claude Code CLI transcripts from `~/.claude/projects`, including subagent
|
|
519
|
+
definition snapshots and `subagents/*.jsonl` runs imported as child sessions
|
|
484
520
|
- Claude Code Desktop metadata and Claude Workspace/local-agent sessions from
|
|
485
521
|
the Claude app data, shown as separate toggles
|
|
486
522
|
- Gemini CLI saved chats/checkpoints under `~/.gemini/tmp`, plus session/export JSONL stores with tool, usage, and checkpoint metadata
|
|
@@ -531,7 +567,11 @@ agentlog import --source all --since all
|
|
|
531
567
|
agentlog import --sources codex-cli,codex-desktop,claude,claude-code-desktop,claude-workspace,gemini-cli,antigravity,devin-cli,cursor,cline,opencode-cli,opencode-desktop,opencode-web,aider --since all
|
|
532
568
|
agentlog import --source codex-desktop --since 90d
|
|
533
569
|
agentlog import --source codex-cli --since 30d
|
|
570
|
+
agentlog import --source codex-sdk --since all
|
|
571
|
+
agentlog import chatgpt
|
|
572
|
+
agentlog import claude-web
|
|
534
573
|
agentlog import chatgpt ~/Downloads/chatgpt-export.zip --username you@example.com
|
|
574
|
+
agentlog import chatgpt "~/Downloads/OpenAI-export/User Online Activity" --username you@example.com
|
|
535
575
|
agentlog import claude-web ~/Downloads/claude-export --username you --display-name "Personal Claude"
|
|
536
576
|
agentlog import --source claude --since 30d
|
|
537
577
|
agentlog import --source claude-code-desktop --since all
|
package/docs/code-reference.md
CHANGED
|
@@ -99,11 +99,12 @@ low-signal filtering.
|
|
|
99
99
|
Exports:
|
|
100
100
|
|
|
101
101
|
- `CANONICAL_EVENT_SCHEMA_VERSION`: current event schema id,
|
|
102
|
-
`agentlog.events.
|
|
102
|
+
`agentlog.events.v2`.
|
|
103
103
|
- `EVENT_KINDS`: constants for `session.started`, `prompt.submitted`,
|
|
104
104
|
`response.generated`, `tool.called`, and `tool.completed`.
|
|
105
105
|
- `normalizeSessionEvents(session, messages, options)`: maps transcript
|
|
106
|
-
messages into canonical events.
|
|
106
|
+
messages into canonical events and links `tool.completed` events to matching
|
|
107
|
+
`tool.called` parents.
|
|
107
108
|
- `messageToCanonicalEvents(message, session, options)`: maps one message into
|
|
108
109
|
zero or more canonical events.
|
|
109
110
|
- `stableEventId(sessionId, messageIndex, kind, ordinal, content)`: creates a
|
|
@@ -219,7 +220,9 @@ Command handlers:
|
|
|
219
220
|
- `integrationsCommand(args, env)`: canonical integration command group for
|
|
220
221
|
recall surfaces.
|
|
221
222
|
- `mcpCommand(args, flags, env)`: canonical MCP server command group.
|
|
222
|
-
- `importCommand(args, flags, env)`: imports local sources
|
|
223
|
+
- `importCommand(args, flags, env)`: imports local sources and downloaded web
|
|
224
|
+
export files, or prints manual ChatGPT/Claude.ai export instructions when no
|
|
225
|
+
web export path is supplied.
|
|
223
226
|
- `recallCommand(args, env)`: handles recall server/install/show/reindex flows.
|
|
224
227
|
- `showRecallSession(sessionId, env)`: prints a session through the recall path.
|
|
225
228
|
- `showCommand(sessionId, flags, env)`: prints, opens, or JSON-serializes a
|
|
@@ -430,7 +433,10 @@ Embedded history web app functions:
|
|
|
430
433
|
- `renderMarkdownLink(label, href)`: renders safe links.
|
|
431
434
|
- `renderSkillLink(name, skillPath)`: renders `$skill` links.
|
|
432
435
|
- `compactSkillPath(value)`: shortens skill paths for display.
|
|
433
|
-
- `
|
|
436
|
+
- `captureRelativeScrollPosition()`: captures the detail pane scroll ratio.
|
|
437
|
+
- `restoreRelativeScrollPosition(position, serial)`: restores a captured scroll
|
|
438
|
+
ratio after a view-mode layout swap.
|
|
439
|
+
- `setView(mode, options)`: toggles readable and raw Markdown views.
|
|
434
440
|
- `sessionDetailsText(payload)`: builds copyable session details.
|
|
435
441
|
- `copyText(value)`: writes text to the clipboard.
|
|
436
442
|
- `copySessionDetails()`: copies session metadata for pasting into agents.
|
|
@@ -555,9 +561,9 @@ Import dispatch and generic providers:
|
|
|
555
561
|
Desktop/Workspace metadata and audit sessions.
|
|
556
562
|
- `matchesImportedSessionRepo(session, repo, wantedRepos)`: checks repo filters
|
|
557
563
|
for sessions with repo or scope attribution.
|
|
558
|
-
- `importCodexProvider(provider, since, options, env)`: imports Codex CLI
|
|
559
|
-
Desktop threads from state DB,
|
|
560
|
-
summaries when available.
|
|
564
|
+
- `importCodexProvider(provider, since, options, env)`: imports Codex CLI,
|
|
565
|
+
Desktop, or opt-in exec/SDK threads from the state DB, session index, rollout
|
|
566
|
+
files, and Codex supplementary summaries when available.
|
|
561
567
|
- `importCursorProvider(provider, since, options, env)`: imports Cursor SQLite
|
|
562
568
|
and Cursor project transcript sessions; supervisor calls set
|
|
563
569
|
`cursorRecovery=false` to skip raw SQLite salvage/backfill.
|
|
@@ -581,7 +587,10 @@ Generic parsing helpers:
|
|
|
581
587
|
shapes.
|
|
582
588
|
- `extractClaudeMessagesFromEvent(event, provider, context)`: Claude Code/SDK
|
|
583
589
|
JSONL parser for text, thinking, tool calls/results, model, request id, and
|
|
584
|
-
usage metadata, including
|
|
590
|
+
usage metadata, including lineage fields, agent/slug/tool-use ids, MCP
|
|
591
|
+
structured content, API error metadata, richer Claude usage extras, Remote
|
|
592
|
+
Control lifecycle context messages, tool result name repair from prior
|
|
593
|
+
`tool_use` ids, and `apply_patch` shell calls promoted to edit diffs.
|
|
585
594
|
- `updateClaudeParseContext(event, provider, context)`: keeps Claude model,
|
|
586
595
|
session, and cwd context while parsing JSONL records.
|
|
587
596
|
- `extractCodexSummaryMessage(event, provider)`: extracts readable Codex
|
|
@@ -599,6 +608,8 @@ Generic parsing helpers:
|
|
|
599
608
|
summary for tool-call metadata.
|
|
600
609
|
- `normalizeWebConversations(provider, data)`: normalizes web export
|
|
601
610
|
conversations.
|
|
611
|
+
- `webExportInstructions(source)`: returns the provider-specific manual export
|
|
612
|
+
instruction payload used by ChatGPT and Claude.ai import commands.
|
|
602
613
|
- `chatgptMessages(conversation)`: parses ChatGPT export conversation nodes
|
|
603
614
|
and attaches provider or estimated message usage.
|
|
604
615
|
- `claudeMessages(conversation)`: parses Claude.ai export messages, separating
|
|
@@ -610,8 +621,8 @@ Discovery and summary helpers:
|
|
|
610
621
|
|
|
611
622
|
- `summarizeFiles(files)`: counts files, projects, and oldest mtime.
|
|
612
623
|
- `summarizeCodex(env, source)`: summary wrapper for Codex threads.
|
|
613
|
-
- `summarizeCodexThreads(allThreads, source)`: summarizes Codex CLI/Desktop
|
|
614
|
-
counts.
|
|
624
|
+
- `summarizeCodexThreads(allThreads, source)`: summarizes Codex CLI/Desktop or
|
|
625
|
+
opt-in exec/SDK counts.
|
|
615
626
|
- `summarizeClaude()`: summarizes Claude Code CLI files.
|
|
616
627
|
- `summarizeClaudeScan(scan)`: formats Claude scan results.
|
|
617
628
|
- `summarizeClaudeSdk()`: summarizes Claude SDK job files.
|
|
@@ -643,11 +654,13 @@ Source location and file helpers:
|
|
|
643
654
|
- `scanClaudeProjectFiles(options)`: scans and classifies Claude project JSONL.
|
|
644
655
|
- `isClaudeConversationFile(file)`: tests whether a Claude file is interactive.
|
|
645
656
|
- `classifyClaudeFile(file)`: classifies Claude JSONL as conversation, SDK job,
|
|
646
|
-
or other
|
|
657
|
+
or other; Remote Control `sdk-cli` transcripts with Remote Control deferred
|
|
658
|
+
tool names are kept with interactive Claude Code conversations.
|
|
647
659
|
- `readInitialLines(file, maxLines, maxBytes)`: reads a bounded prefix of a
|
|
648
660
|
large JSONL file.
|
|
649
|
-
- `readCodexThreads(env)`: queries Codex state DB for top-level threads
|
|
650
|
-
optional `stage1_outputs` summary
|
|
661
|
+
- `readCodexThreads(env)`: queries Codex state DB for top-level threads, merges
|
|
662
|
+
`session_index.jsonl` titles, and reads optional `stage1_outputs` summary
|
|
663
|
+
documents.
|
|
651
664
|
- `sqliteTableExists(dbPath, tableName)`: checks optional SQLite tables before
|
|
652
665
|
querying version-dependent Codex state.
|
|
653
666
|
- `codexStateDb(env)`: resolves Codex state DB path.
|