Commit e1e2b09
authored
feat!: remove the v1 line-based socket protocol (#75)
v2 JSON-RPC is now the only socket protocol. All consumers were migrated
first (CLI in #74, shell integration in #72, tests in #71/#73; the remote
daemon was already v2-only), so this deletes the v1 line dispatch itself
and everything that only existed to serve it.
- TerminalController.processCommand now dispatches JSON unconditionally;
a non-JSON line gets a terse v1_removed error instead of being routed
to the old space-delimited command switch.
- Deletes the v1 switch (~90 cases) and every handler function that
becomes unreferenced, plus their v1-only parsing helpers
(parseOptions/parseOptionsNoStop, resolveTabForReport,
withReportTargetSurface, upsertSidebarMetadata/clearSidebarMetadata/
listSidebarMetadata, schedulePanelMetadataMutation,
parseReadScreenArgs). Debug handlers that v2's debug.* methods reuse
as their implementation core (setShortcut, simulateShortcut,
activateApp, isTerminalFocused, readTerminalText, renderStats,
layoutDebug, bonsplit/empty-panel/flash counters,
focusFromNotification, panelSnapshot(Reset), captureScreenshot) are
kept, since they're still live v2 entry points, not v1 relics.
Self.socketFastPathState and tailTerminalLines/
readTerminalTextBase64(terminalPanel:) stay too - v2 surface-telemetry
and screen-read methods depend on them directly.
- auth was already a connection-level preamble (authResponseIfNeeded,
handled before any protocol dispatch) supporting both a raw
auth-plus-password line and v2 auth.login; only the CLI's raw-line
call needed migrating, which this does (auth.login now).
- Removes the now-unreachable isV2:false focus-intent allowlist
(focusIntentV1Commands) and updates the one unit test that exercised
it directly to cover the v2 equivalent instead.
- Docs: v2-api-migration.md collapses to a short removal note plus the
v1->v2 name mapping (kept for reference); socket-focus-steal-audit.todo.md
and agent-browser-port-spec.md get historical annotations; CLAUDE.md's
socket-threading-policy examples are reworded to v2 method names.
TerminalController.swift: 12834 -> 9615 lines (-3219). Net repo diff:
+156/-3410 across 7 files.
Breaking change: any external script or tool that still speaks the old
space-delimited socket protocol directly (rather than through the CLI)
will now get a v1_removed JSON error instead of a response. Use the CLI
or the v2 JSON-RPC protocol described in docs/v2-api-migration.md.1 parent f6bd6a2 commit e1e2b09
7 files changed
Lines changed: 1036 additions & 4290 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2835 | 2835 | | |
2836 | 2836 | | |
2837 | 2837 | | |
2838 | | - | |
2839 | | - | |
2840 | | - | |
2841 | | - | |
2842 | | - | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
2843 | 2844 | | |
2844 | 2845 | | |
2845 | 2846 | | |
| |||
0 commit comments