Skip to content

Commit a1c762a

Browse files
mjacobsclaudewesm
authored
feat: parse decrypted Antigravity CLI trajectory sidecars (#552)
Adds support for `<uuid>.trajectory.json` sidecars next to the existing AES-encrypted `<uuid>.pb` files under `~/.gemini/antigravity-cli/{conversations,implicit}/`. The sidecars are produced out-of-process by [agy-reader](https://github.com/mjacobs/agy-reader), which holds the decryption path and writes the resulting transcript as plain JSON; agentsview's parser now detects the sidecar and uses it as the source of truth for messages, tool calls, and tool results, falling back to the existing `history.jsonl` + brain artifact path when no sidecar is present. The sync engine treats the sidecar as part of the session for change detection (combined mtime/size via `AntigravityCLIFileInfo`) and forces message replacement on AgentAntigravityCLI sessions so trajectory updates land cleanly. Per the trust-boundary table in `SECURITY.md`, sidecars are treated as untrusted structured input under the "Imports and new readers" row: the parser is defensive against unknown step types, volatile fields are decoded through `json.RawMessage` accessors, and reads are size-capped at 64 MB. No new outbound channel is introduced; agy-reader is local-only. The legacy in-process `ANTIGRAVITY_KEY` decrypt path is preserved as a fallback for users without agy-reader installed; consolidating on the sidecar path is left for a follow-up. --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> Co-authored-by: Wes McKinney <wesmckinn+git@gmail.com>
1 parent c6dc0b3 commit a1c762a

8 files changed

Lines changed: 1311 additions & 36 deletions

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,44 @@ agentsview auto-discovers sessions from all of these:
213213
| Warp | `~/.warp/` (platform-dependent) |
214214
| Positron Assistant | `~/Library/Application Support/Positron/User/` (macOS) |
215215
| Antigravity | `~/.gemini/antigravity/` |
216-
| Antigravity CLI | `~/.gemini/antigravity-cli/` (summary mode) |
216+
| Antigravity CLI | `~/.gemini/antigravity-cli/` (see note below) |
217217

218218
Each directory can be overridden with an environment variable. See the
219219
[configuration docs](https://agentsview.io/configuration/) for details.
220220

221+
### Antigravity CLI: high-resolution transcripts
222+
223+
By default, agentsview indexes Antigravity CLI sessions in **summary mode**:
224+
your prompts from `history.jsonl` plus any plain-text artifacts under `brain/`
225+
(plans, walkthroughs, checkpoints). Assistant turns and tool calls live in
226+
AES-GCM-encrypted `.pb` files and are not visible in this mode.
227+
228+
To unlock full transcripts, run
229+
[agy-reader](https://github.com/mjacobs/agy-reader) alongside agentsview.
230+
agy-reader talks to the local Antigravity daemon, decrypts each conversation,
231+
and writes a `<uuid>.trajectory.json` sidecar next to the encrypted `.pb` file.
232+
agentsview's file watcher detects the sidecar automatically and parses it in
233+
place of summary mode -- no agentsview restart needed.
234+
235+
```bash
236+
go install github.com/mjacobs/agy-reader@latest
237+
238+
# Generate sidecars for existing sessions...
239+
agy-reader --sync
240+
241+
# ...or keep them fresh as you work.
242+
agy-reader --watch
243+
```
244+
245+
agy-reader auto-discovers the Antigravity daemon URL by parsing
246+
`~/.gemini/antigravity-cli/cli.log`. If discovery fails (e.g. the log has
247+
rotated), the command prints platform-specific instructions for locating the
248+
port and exporting `ANTIGRAVITY_DAEMON_URL` manually.
249+
250+
Sidecars stay on your machine. agentsview makes no outbound request to produce
251+
or read them, and treats sidecars as untrusted structured input -- see
252+
[SECURITY.md](SECURITY.md) for the trust model.
253+
221254
## PostgreSQL Sync
222255

223256
Push session data to a shared PostgreSQL instance for team dashboards:

internal/config/config_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ func setupTestEnv(t *testing.T) string {
5151

5252
func loadConfigFromFlags(t *testing.T, args ...string) (Config, error) {
5353
t.Helper()
54+
if os.Getenv("AGENTSVIEW_DATA_DIR") == "" {
55+
t.Setenv("AGENTSVIEW_DATA_DIR", t.TempDir())
56+
}
5457
fs := flag.NewFlagSet("test", flag.ContinueOnError)
5558
RegisterServeFlags(fs)
5659
if err := fs.Parse(args); err != nil {
@@ -61,6 +64,9 @@ func loadConfigFromFlags(t *testing.T, args ...string) (Config, error) {
6164

6265
func loadConfigFromPFlags(t *testing.T, args ...string) (Config, error) {
6366
t.Helper()
67+
if os.Getenv("AGENTSVIEW_DATA_DIR") == "" {
68+
t.Setenv("AGENTSVIEW_DATA_DIR", t.TempDir())
69+
}
6470
fs := pflag.NewFlagSet("test", pflag.ContinueOnError)
6571
RegisterServePFlags(fs)
6672
if err := fs.Parse(args); err != nil {

0 commit comments

Comments
 (0)