import: add importers for cursor, pi, factory, codex, copilot, gemini

main

Commit

computermode3mo ago

Extends entire import beyond Claude Code to the other supported agents. PR #1527 built the agent-agnostic orchestration (discovery loop, idempotent per-turn IDs, redaction, checkpoint write) behind an Importer seam; this adds one self-contained Importer per agent and registers them, so each entire import <agent> subcommand surfaces automatically.

Each importer reuses its agent's existing transcript methods rather than re-encoding parsing:

  • cursor: shared transcript.ExtractUserContent; no native token/model data
  • pi: CalculateTokenUsage + ExtractModel (branch-aware), <ts>_<uuid> filenames
  • factoryai-droid: subagent-aware CalculateTotalTokenUsage; model from the adjacent .settings.json
  • codex: walks the global sessions tree, filters by session_meta cwd, uses the cumulative-usage delta for per-turn tokens
  • copilot-cli: flat session-state store, filters by session.start cwd/gitRoot
  • gemini: single JSON document, imported per-session (message-index offsets)

Codex and Copilot share a repoMatches helper (equal-or-descendant, symlink normalized) so their global/flat stores only import this repo's sessions. Imported checkpoints keep the merged Claude behavior: commit-less, Kind "imported", not rewindable, idempotent.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com Entire-Checkpoint: b66e383bcad8

Checkpoints

Following work done in https://github.com/entireio/cli/pull/1527, we want to extend the import capabilities to detect the other agents we support, including gemini, opencode, codex etc. Use existing p

Claude CodeOpus 4.8
View session
Checkpoint 1