Adapter guide
Add another AI tool.
- Verify the storage format on a real machine first: where sessions live, the line/record format, any index database and its schema, how the tool lists sessions, how it stores paths, which processes mean "running". Write it down at the top of the adapter file.
- Add a
ProviderIdincrates/core/src/providers/mod.rsand a fileproviders/<tool>.rsimplementingProviderAdapter:detect,list_projects,list_sessions,read_session,export_session,import_session, optionallyappend_session,context_file_name,process_names. - Rules every adapter follows: refuse to write while the tool runs (
ensure_not_running), back up every file before writing (ImportOptions.backups), honourdry_run, honourkeep_both(save a diverged incoming session under a new id), and turn import off (with a warning inProviderStatus) on any format it doesn't recognise. - Put pure parsing in a file without file-system access (like
codex_format.rs) so the web viewer can use it, and add it tomessages_from_bundle. - Add fixture files under
crates/core/tests/fixtures/<tool>/and tests: detect, list, read, export → import on a second fake machine (paths rewritten), update, local-ahead, conflict, running-process refusal, unknown format. - Add the label in
src/shared/types.ts(PROVIDER_LABELS). Badges, filters, push/pull, summaries and the viewer pick it up from there.