You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/instructions/cli.instructions.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,8 @@ Or from the repo root:
31
31
32
32
When adding support for a new editor or data source, wire it into **both**`vscode-extension/src/` (see `.github/instructions/vscode-extension.instructions.md`) **and** this CLI.
33
33
34
+
> **Adapter architecture (issue #654)**: The CLI shares the adapter classes from `vscode-extension/src/adapters/` and registers them in `_ecosystems` inside `cli/src/helpers.ts`. Currently 9 adapters are registered: OpenCode, Crush, Continue, ClaudeCode, ClaudeDesktop, VisualStudio, MistralVibe, **CopilotChat**, **CopilotCli**. The Copilot adapters own discovery but their `handles()` returns `false`, so `processSessionFile()` falls through to the existing per-format helpers (JSONL/JSON parsing) for those files. Order matters — register Copilot adapters **last**.
Copy file name to clipboardExpand all lines: .github/instructions/vscode-extension.instructions.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,3 +151,17 @@ To maintain a consistent, VS Code-native look across all webview panels (Details
151
151
## Adding a New Editor / Data Source
152
152
153
153
When adding support for a new editor or data source, you must wire it into **both** this extension (`vscode-extension/src/`) **and** the CLI (`cli/src/`). See `.github/instructions/cli.instructions.md` for the CLI integration checklist.
154
+
155
+
### Adapter architecture (issue #654)
156
+
157
+
All editor integrations live as adapters under `vscode-extension/src/adapters/` implementing `IEcosystemAdapter` (and `IDiscoverableEcosystem` when discovery is needed). `sessionDiscovery.ts` is intentionally a thin generic loop: it iterates the adapters registered in `extension.ts` (`this.ecosystems`) and dedupes the resulting paths. There are **no hardcoded editor paths in `sessionDiscovery.ts`**.
-`CopilotChatAdapter` — VS Code Copilot Chat (workspaceStorage chatSessions in 3 layouts, globalStorage emptyWindowChatSessions, globalStorage `{GitHub,github}.copilot-chat` recursive scan, WSL Windows-side paths)
162
+
-`CopilotCliAdapter` — `~/.copilot/session-state/` flat `.json`/`.jsonl` plus UUID subdirs with `events.jsonl`
163
+
164
+
**Adapter ordering matters**: register more-specific adapters first. `CopilotChatAdapter` and `CopilotCliAdapter` are registered **last** in `this.ecosystems`.
165
+
166
+
**`handles()` for CopilotChat/Cli currently returns `false`**: discovery is owned by the adapters, but per-session parsing is still routed through the existing fallback path in `extension.ts` (`countInteractionsInSession`, `estimateTokensFromSession`, `getSessionFileDataCached`). A future PR can flip `handles()` to use the exported `isCopilotChatSessionPath` / `isCopilotCliSessionPath` predicates once the JSON parser helpers are extracted from `extension.ts`. When you flip `handles()`, also fix `_detectEditorSource(filePath, (p) => !!this.findEcosystem(p))` at extension.ts:~3224 — the predicate must check `?.id === 'opencode'` (or use `getEditorTypeFromPath` convention) so that VS Code paths are still labeled "VS Code", not "OpenCode".
0 commit comments