spiracha 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/AGENTS.md +48 -5
  2. package/README.md +40 -5
  3. package/apps/ui/AGENTS.md +23 -4
  4. package/apps/ui/README.md +49 -2
  5. package/apps/ui/dist/client/assets/analytics-DOy1b6Sh.js +1 -0
  6. package/apps/ui/dist/client/assets/{antigravity-conversations._conversationId-DmD0sN8X.js → antigravity-conversations._conversationId-DqySVO2K.js} +2 -2
  7. package/apps/ui/dist/client/assets/antigravity-keychain-panel-B77qJz6f.js +1 -0
  8. package/apps/ui/dist/client/assets/antigravity._workspaceKey-B3NM6gRH.js +1 -0
  9. package/apps/ui/dist/client/assets/{antigravity.index-DEEkjlZa.js → antigravity.index-DP9JC2P9.js} +1 -1
  10. package/apps/ui/dist/client/assets/{badge-DfWvPfKF.js → badge-C3i4OKs8.js} +1 -1
  11. package/apps/ui/dist/client/assets/claude-code-sessions._sessionId-8pQ55ci2.js +1 -0
  12. package/apps/ui/dist/client/assets/claude-code-sessions._sessionId-DVz5UmtU.js +1 -0
  13. package/apps/ui/dist/client/assets/claude-code._workspaceKey-BBKskSum.js +1 -0
  14. package/apps/ui/dist/client/assets/claude-code._workspaceKey-OkikMUFs.js +1 -0
  15. package/apps/ui/dist/client/assets/claude-code.index-Cwu76dbb.js +1 -0
  16. package/apps/ui/dist/client/assets/claude-code.index-D6eMd08t.js +1 -0
  17. package/apps/ui/dist/client/assets/createServerFn-B-KkwmHU.js +3 -0
  18. package/apps/ui/dist/client/assets/cursor-threads._composerId-hBWlP1D-.js +1 -0
  19. package/apps/ui/dist/client/assets/cursor._workspaceKey-BFPkIRi-.js +1 -0
  20. package/apps/ui/dist/client/assets/cursor.index-8y4o20kb.js +2 -0
  21. package/apps/ui/dist/client/assets/delete-confirm-dialog-Bxs07u-j.js +7 -0
  22. package/apps/ui/dist/client/assets/dist-BrJhN2A0.js +5 -0
  23. package/apps/ui/dist/client/assets/{dist-BhZOxAPP.js → dist-Cmd3AIfD.js} +1 -1
  24. package/apps/ui/dist/client/assets/dropdown-menu-D5cvPaZt.js +1 -0
  25. package/apps/ui/dist/client/assets/{es2015-BkCWttyM.js → es2015-ad6040dw.js} +1 -1
  26. package/apps/ui/dist/client/assets/export-dialog-Dr8d2MqD.js +1 -0
  27. package/apps/ui/dist/client/assets/{formatters-BM9kB7ed.js → formatters-BtqyrX_c.js} +1 -1
  28. package/apps/ui/dist/client/assets/index-C-STgIH4.js +166 -0
  29. package/apps/ui/dist/client/assets/kiro-sessions._sessionId-CKgfJ7GR.js +1 -0
  30. package/apps/ui/dist/client/assets/kiro-sessions._sessionId-zvIJHtQF.js +1 -0
  31. package/apps/ui/dist/client/assets/kiro._workspaceKey-DhVuJuZB.js +1 -0
  32. package/apps/ui/dist/client/assets/kiro._workspaceKey-QArsjkTY.js +1 -0
  33. package/apps/ui/dist/client/assets/kiro.index-C-fr4m7i.js +1 -0
  34. package/apps/ui/dist/client/assets/kiro.index-OYgAdtZd.js +1 -0
  35. package/apps/ui/dist/client/assets/opencode-sessions._sessionId-DLjiTst-.js +1 -0
  36. package/apps/ui/dist/client/assets/opencode-sessions._sessionId-biBwrRbt.js +8 -0
  37. package/apps/ui/dist/client/assets/opencode._workspaceKey-C7OIzMOJ.js +1 -0
  38. package/apps/ui/dist/client/assets/opencode._workspaceKey-sBakX0oI.js +1 -0
  39. package/apps/ui/dist/client/assets/opencode.index-Bl_kNs9N.js +1 -0
  40. package/apps/ui/dist/client/assets/opencode.index-CN53bVmb.js +1 -0
  41. package/apps/ui/dist/client/assets/preload-helper-B8fFrdxC.js +1 -0
  42. package/apps/ui/dist/client/assets/projects._project-D8WloxQN.js +1 -0
  43. package/apps/ui/dist/client/assets/projects.index-5xRtuJdX.js +3 -0
  44. package/apps/ui/dist/client/assets/routes-DnzF_9CX.js +1 -0
  45. package/apps/ui/dist/client/assets/select-CYF6pF37.js +1 -0
  46. package/apps/ui/dist/client/assets/settings-Dx70jgP_.js +1 -0
  47. package/apps/ui/dist/client/assets/styles-B7Zi9EFA.css +1 -0
  48. package/apps/ui/dist/client/assets/tabs-CmuhkT-c.js +7 -0
  49. package/apps/ui/dist/client/assets/thread-transcript-stats-BUNz6u7F.js +1 -0
  50. package/apps/ui/dist/client/assets/threads._threadId-BMRSFow3.js +1 -0
  51. package/apps/ui/dist/client/assets/useMutation-BSFult2i.js +1 -0
  52. package/apps/ui/dist/client/assets/useQuery-CjINKZf1.js +1 -0
  53. package/apps/ui/dist/client/icon.svg +2 -1
  54. package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CQ8Jjs3B.js +387 -0
  55. package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-BtexWY-K.js → antigravity-conversations._conversationId-BKOyL2T6.js} +2 -2
  56. package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-zMrR6v6R.js → antigravity-conversations._conversationId-eS87Dx7g.js} +1 -1
  57. package/apps/ui/dist/server/assets/claude-code-db-Ik3VStKZ.js +361 -0
  58. package/apps/ui/dist/server/assets/claude-code-queries-Cgzi4K-e.js +37 -0
  59. package/apps/ui/dist/server/assets/claude-code-server-PfraClXS.js +72 -0
  60. package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-C55oe6zj.js +18 -0
  61. package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-D1RYYi3j.js +473 -0
  62. package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-DSvPLEUL.js +11 -0
  63. package/apps/ui/dist/server/assets/claude-code-transcript-C-bxh3cS.js +139 -0
  64. package/apps/ui/dist/server/assets/claude-code-transcript-phase-DmUMc8VU.js +10 -0
  65. package/apps/ui/dist/server/assets/claude-code._workspaceKey-B5Xg_-tE.js +28 -0
  66. package/apps/ui/dist/server/assets/claude-code._workspaceKey-BPlzyXPa.js +11 -0
  67. package/apps/ui/dist/server/assets/claude-code._workspaceKey-DqDve2wl.js +191 -0
  68. package/apps/ui/dist/server/assets/claude-code.index-B7yYR7dD.js +92 -0
  69. package/apps/ui/dist/server/assets/claude-code.index-BUHThG1W.js +11 -0
  70. package/apps/ui/dist/server/assets/{codex-server-CNXSJuc2.js → codex-server-CGXU4H8-.js} +319 -29
  71. package/apps/ui/dist/server/assets/{cursor-db-cYZEU3WQ.js → cursor-db-CZnYy7aT.js} +3 -3
  72. package/apps/ui/dist/server/assets/{cursor-recovery-nq-kR62j.js → cursor-recovery-CXpO8KcD.js} +2 -2
  73. package/apps/ui/dist/server/assets/{cursor-server-C3q7hrp-.js → cursor-server-DNu52A3K.js} +13 -13
  74. package/apps/ui/dist/server/assets/{cursor-threads._composerId-BkMMTQ3v.js → cursor-threads._composerId-Ckn6ItHI.js} +3 -3
  75. package/apps/ui/dist/server/assets/{cursor-threads._composerId-BPJFWfJj.js → cursor-threads._composerId-p9-ARAzc.js} +1 -1
  76. package/apps/ui/dist/server/assets/{cursor-transcript-2iL3KFSK.js → cursor-transcript-B7tGnqtn.js} +1 -1
  77. package/apps/ui/dist/server/assets/{cursor._workspaceKey-C5PdTaKB.js → cursor._workspaceKey-CZuohIUL.js} +1 -1
  78. package/apps/ui/dist/server/assets/{cursor._workspaceKey-Ckj7apKI.js → cursor._workspaceKey-DPp5JSjy.js} +2 -2
  79. package/apps/ui/dist/server/assets/{export-dialog-BItjWgkZ.js → export-dialog-D88ze9Gy.js} +2 -2
  80. package/apps/ui/dist/server/assets/kiro-db--fXrED_-.js +552 -0
  81. package/apps/ui/dist/server/assets/kiro-queries-CzNlM2ok.js +37 -0
  82. package/apps/ui/dist/server/assets/kiro-server-9WRxg2Au.js +72 -0
  83. package/apps/ui/dist/server/assets/kiro-sessions._sessionId-CRY2c7YO.js +11 -0
  84. package/apps/ui/dist/server/assets/kiro-sessions._sessionId-F1UlwxmR.js +449 -0
  85. package/apps/ui/dist/server/assets/kiro-sessions._sessionId-bvTulT7C.js +18 -0
  86. package/apps/ui/dist/server/assets/kiro-transcript-DoekQBaH.js +112 -0
  87. package/apps/ui/dist/server/assets/kiro-transcript-phase-CJG40nQg.js +27 -0
  88. package/apps/ui/dist/server/assets/kiro._workspaceKey-BDe9sQwo.js +11 -0
  89. package/apps/ui/dist/server/assets/kiro._workspaceKey-CJsjgNwO.js +28 -0
  90. package/apps/ui/dist/server/assets/kiro._workspaceKey-D_-4Qb7y.js +193 -0
  91. package/apps/ui/dist/server/assets/kiro.index-C__-UROk.js +11 -0
  92. package/apps/ui/dist/server/assets/kiro.index-CmTbqeYj.js +93 -0
  93. package/apps/ui/dist/server/assets/opencode-db-BM7KjOzc.js +397 -0
  94. package/apps/ui/dist/server/assets/opencode-queries-BeNYXnQv.js +50 -0
  95. package/apps/ui/dist/server/assets/opencode-server-BpQ_kRze.js +72 -0
  96. package/apps/ui/dist/server/assets/opencode-sessions._sessionId-CGQ-t0vD.js +518 -0
  97. package/apps/ui/dist/server/assets/opencode-sessions._sessionId-D8Q7in_Z.js +18 -0
  98. package/apps/ui/dist/server/assets/opencode-sessions._sessionId-DKOvi0lV.js +11 -0
  99. package/apps/ui/dist/server/assets/opencode-think-tags-CAoD-EcZ.js +87 -0
  100. package/apps/ui/dist/server/assets/opencode-transcript-BNTcGNym.js +141 -0
  101. package/apps/ui/dist/server/assets/opencode-transcript-phase-OqLkiQD0.js +32 -0
  102. package/apps/ui/dist/server/assets/opencode._workspaceKey-BdqcWHw1.js +11 -0
  103. package/apps/ui/dist/server/assets/opencode._workspaceKey-CfH96HTT.js +28 -0
  104. package/apps/ui/dist/server/assets/opencode._workspaceKey-DdbHPDrO.js +207 -0
  105. package/apps/ui/dist/server/assets/opencode.index-BbVzkJXP.js +11 -0
  106. package/apps/ui/dist/server/assets/opencode.index-Vh_Gq_1L.js +93 -0
  107. package/apps/ui/dist/server/assets/{projects._project-Bpbc3C-L.js → projects._project-4io5LO0E.js} +1 -1
  108. package/apps/ui/dist/server/assets/{projects._project-CvZho6EQ.js → projects._project-D6ZoGhJ8.js} +2 -2
  109. package/apps/ui/dist/server/assets/{router-6m-ihwqA.js → router-Sac2DGk6.js} +157 -49
  110. package/apps/ui/dist/server/assets/{shared-CPRNYIql.js → shared-DyhChtHf.js} +4 -1
  111. package/apps/ui/dist/server/assets/source-session-export-server-DNutCawb.js +38 -0
  112. package/apps/ui/dist/server/assets/{start-CI_0bSiY.js → start-B_HFwkkk.js} +1 -1
  113. package/apps/ui/dist/server/assets/{tabs-CGA13IZM.js → tabs-DkaChNVg.js} +0 -1
  114. package/apps/ui/dist/server/assets/thread-transcript-stats-Dh34mt2u.js +45 -0
  115. package/apps/ui/dist/server/assets/{threads._threadId-D2GYkVn6.js → threads._threadId-BeXEc4Lo.js} +15 -6
  116. package/apps/ui/dist/server/assets/{threads._threadId-Bs0yuqO9.js → threads._threadId-Ci0S4mKU.js} +1 -1
  117. package/apps/ui/dist/server/server.js +72 -24
  118. package/package.json +21 -4
  119. package/src/lib/claude-code-db.ts +655 -0
  120. package/src/lib/claude-code-exporter-types.ts +110 -0
  121. package/src/lib/claude-code-transcript-phase.ts +25 -0
  122. package/src/lib/claude-code-transcript.ts +180 -0
  123. package/src/lib/codex-browser-db.ts +490 -31
  124. package/src/lib/codex-browser-export.ts +18 -2
  125. package/src/lib/codex-thread-cache.ts +17 -1
  126. package/src/lib/concurrency.ts +25 -0
  127. package/src/lib/kiro-db.ts +949 -0
  128. package/src/lib/kiro-exporter-types.ts +100 -0
  129. package/src/lib/kiro-transcript-phase.ts +41 -0
  130. package/src/lib/kiro-transcript.ts +115 -0
  131. package/src/lib/opencode-db.ts +610 -0
  132. package/src/lib/opencode-exporter-types.ts +129 -0
  133. package/src/lib/opencode-think-tags.ts +126 -0
  134. package/src/lib/opencode-transcript-phase.ts +50 -0
  135. package/src/lib/opencode-transcript.ts +194 -0
  136. package/src/lib/shared.ts +25 -0
  137. package/src/lib/ui-export-archive.ts +61 -0
  138. package/apps/ui/dist/client/assets/analytics-DK2jdvmI.js +0 -1
  139. package/apps/ui/dist/client/assets/antigravity-keychain-panel-BRHVjFAM.js +0 -1
  140. package/apps/ui/dist/client/assets/antigravity._workspaceKey-CGV7amas.js +0 -1
  141. package/apps/ui/dist/client/assets/createServerFn-CgRRVpBH.js +0 -3
  142. package/apps/ui/dist/client/assets/cursor-threads._composerId-Ti2gTm63.js +0 -1
  143. package/apps/ui/dist/client/assets/cursor._workspaceKey-DzD_c6j9.js +0 -1
  144. package/apps/ui/dist/client/assets/cursor.index-PkCFVcl4.js +0 -2
  145. package/apps/ui/dist/client/assets/delete-confirm-dialog-BHRmyLHr.js +0 -11
  146. package/apps/ui/dist/client/assets/dropdown-menu-Dy5cLzTy.js +0 -1
  147. package/apps/ui/dist/client/assets/export-dialog-C86SYHJn.js +0 -1
  148. package/apps/ui/dist/client/assets/index-CPvAP-jk.js +0 -149
  149. package/apps/ui/dist/client/assets/projects._project-Ckf6muWZ.js +0 -1
  150. package/apps/ui/dist/client/assets/projects.index-V5ibNZII.js +0 -3
  151. package/apps/ui/dist/client/assets/routes-Df2tgpyd.js +0 -1
  152. package/apps/ui/dist/client/assets/select-Bf2GwfPR.js +0 -1
  153. package/apps/ui/dist/client/assets/settings-5VQIzME0.js +0 -1
  154. package/apps/ui/dist/client/assets/styles-BhRkXgwB.css +0 -1
  155. package/apps/ui/dist/client/assets/tabs-OO4VU5KR.js +0 -7
  156. package/apps/ui/dist/client/assets/threads._threadId-BgDhFj2I.js +0 -1
  157. package/apps/ui/dist/client/assets/useMutation-CC_B7uy5.js +0 -1
  158. package/apps/ui/dist/client/assets/useQuery-C5By6WKU.js +0 -1
  159. package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CRW2kqj0.js +0 -232
package/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- This repo exports local Codex chats, Claude Code transcripts, and Cursor Agent/Composer threads to Markdown or plain text, and the UI also browses local Antigravity conversation history.
5
+ This repo exports local Codex chats, Claude Code transcripts, and Cursor Agent/Composer threads to Markdown or plain text, and the UI also browses and exports local Claude Code, Kiro, Antigravity, and OpenCode conversation history.
6
6
 
7
7
  Main entrypoints:
8
8
  - `rtk bun start ...` for Codex chat export
@@ -10,7 +10,7 @@ Main entrypoints:
10
10
  - `rtk bun run export:claude -- ...` for Claude transcript export
11
11
  - `rtk bun run ./src/export-cursor.ts ...` (or `rtk spiracha cursor ...`) for Cursor thread export, recovery, and prune
12
12
  - `rtk bun run mcp` for the MCP server used by the local Codex plugin
13
- - `rtk bun run ui:dev` for the local browser UI across Codex, Cursor, and Antigravity data
13
+ - `rtk bun run ui:dev` for the local browser UI across Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode data
14
14
  - published package entrypoints:
15
15
  - `rtk bunx spiracha`
16
16
  - `rtk bunx spiracha ui`
@@ -73,6 +73,26 @@ Cursor exporter modules:
73
73
  - `src/lib/cursor-exporter-types.ts`
74
74
  - shared Cursor types and macOS Cursor data-dir path resolution (`SPIRACHA_CURSOR_USER_DIR` override)
75
75
 
76
+ Claude Code browser/export modules:
77
+ - `src/lib/claude-code-db.ts`
78
+ - local Claude Code project/session discovery from `~/.claude/projects`, transcript parsing, and workspace grouping
79
+ - `src/lib/claude-code-exporter-types.ts`
80
+ - shared Claude Code workspace, session, entry, part, and export option types plus default projects-dir resolution
81
+ - `src/lib/claude-code-transcript-phase.ts`
82
+ - browser-safe assistant commentary/final-answer classification based on Claude Code stop reasons
83
+ - `src/lib/claude-code-transcript.ts`
84
+ - renders local Claude Code sessions to Markdown or plain text for UI downloads
85
+
86
+ Kiro browser/export modules:
87
+ - `src/lib/kiro-db.ts`
88
+ - read-only Kiro workspace/session discovery from Kiro workspace session JSON files, transcript part parsing, and workspace grouping
89
+ - `src/lib/kiro-exporter-types.ts`
90
+ - shared Kiro workspace, session, entry, part, and export option types plus default workspace-session path resolution
91
+ - `src/lib/kiro-transcript-phase.ts`
92
+ - browser-safe assistant commentary/final-answer classification per Kiro user turn
93
+ - `src/lib/kiro-transcript.ts`
94
+ - renders Kiro sessions to Markdown or plain text for UI downloads
95
+
76
96
  Antigravity browser/export modules:
77
97
  - `src/lib/antigravity-db.ts`
78
98
  - Antigravity workspace discovery, summary-index parsing, transcript lookup, and Markdown rendering
@@ -81,6 +101,18 @@ Antigravity browser/export modules:
81
101
  - `src/lib/antigravity-keychain.ts`
82
102
  - macOS Keychain access and safe-storage decryption helpers for Antigravity transcript export
83
103
 
104
+ OpenCode browser/export modules:
105
+ - `src/lib/opencode-db.ts`
106
+ - read-only OpenCode project/session discovery, transcript part parsing, and workspace grouping
107
+ - `src/lib/opencode-exporter-types.ts`
108
+ - shared OpenCode workspace, session, message, part, and export option types plus default DB path resolution
109
+ - `src/lib/opencode-transcript-phase.ts`
110
+ - browser-safe assistant commentary/final-answer classification per OpenCode assistant run
111
+ - `src/lib/opencode-think-tags.ts`
112
+ - browser-safe MiniMax `<think>` extraction shared by OpenCode export rendering and UI adapters
113
+ - `src/lib/opencode-transcript.ts`
114
+ - renders OpenCode sessions to Markdown or plain text for UI downloads
115
+
84
116
  Other important files:
85
117
  - `src/lib/claude-exporter.ts`
86
118
  - Claude transcript export pipeline
@@ -94,6 +126,10 @@ Other important files:
94
126
  - token/tool analytics derived from thread rows plus bounded transcript parsing and DB-row metadata cache keys
95
127
  - `src/lib/concurrency.ts`
96
128
  - shared bounded-concurrency helper for large file/database workloads
129
+ - `src/lib/ui-export-archive.ts`
130
+ - browser-download filename, MIME type, and zip archive helpers
131
+ - `src/lib/ui-export-files.ts`
132
+ - browser-download temp file location, URL, and content-disposition helpers
97
133
  - `src/lib/ui-cache.ts`
98
134
  - temporary cache under `os.tmpdir()` for transcript and analytics lookups
99
135
  - `src/mcp-server.ts`
@@ -101,15 +137,20 @@ Other important files:
101
137
  - `plugins/codex-chats-export/`
102
138
  - local Codex plugin manifest, skill, and MCP wiring
103
139
  - `apps/ui/`
104
- - TanStack Start browser UI package for Codex, Cursor, and Antigravity
105
- - source-specific index/detail routes include `/threads/$threadId`, `/cursor-threads/$composerId`, and `/antigravity-conversations/$conversationId`
140
+ - TanStack Start browser UI package for Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode
141
+ - source-specific index/detail routes include `/threads/$threadId`, `/claude-code-sessions/$sessionId`, `/kiro-sessions/$sessionId`, `/cursor-threads/$composerId`, `/antigravity-conversations/$conversationId`, and `/opencode-sessions/$sessionId`
106
142
 
107
143
  ## Test Strategy
108
144
 
109
145
  Current tests cover:
110
146
  - exporter end-to-end behavior for Codex and Claude
147
+ - Claude Code direct-history discovery, transcript parsing, and export rendering
148
+ - Claude Code, Kiro, and OpenCode assistant phase classification for commentary/final-answer display and export filtering
149
+ - Kiro discovery, execution-trace enrichment, transcript parsing, and export rendering
111
150
  - Cursor export, recovery, and pruning behavior
112
151
  - Antigravity discovery, transcript parsing, and artifact export rendering
152
+ - OpenCode discovery, transcript parsing, and export rendering
153
+ - OpenCode MiniMax `<think>` tag extraction, including code-literal preservation
113
154
  - structured Codex transcript parsing
114
155
  - project/thread browsing and destructive DB flows
115
156
  - analytics aggregation
@@ -199,10 +240,12 @@ rtk bunx spiracha cursor recover --workspace summer --apply
199
240
  - `--project` matches the final `cwd` path segment for both POSIX and Windows-style paths, not the full path.
200
241
  - Running `codex-chats` or `bun start` with no args enters interactive mode.
201
242
  - Codex MCP exports must be scoped by at least one of `deeplinks`, `project`, or `cwd`.
202
- - Antigravity browsing/export currently ships through the browser UI rather than a standalone CLI command.
243
+ - Claude Code direct-history browsing/export, Kiro browsing/export, Antigravity, and OpenCode browsing/export currently ship through the browser UI rather than standalone CLI commands.
203
244
  - `txt` output is intentionally real plain text, not Markdown with a `.txt` extension.
204
245
  - The published package is Bun-first. `bin` entrypoints target Bun shebang execution.
246
+ - Keep every root-package source module imported by packaged UI server code listed in `package.json.files`.
205
247
  - The UI package runs `vite` through `bun --bun ...` because its server functions depend on Bun-only modules like `bun:sqlite`.
206
248
  - Keep UI runtime dependency versions aligned with the root package when both package manifests list the same TanStack/React runtime package; mismatched server-function manifests have broken packaged production builds.
207
249
  - TanStack Start server functions should use `.validator(...)`, not deprecated `.inputValidator(...)`.
250
+ - Keep `*-transcript-phase.ts` modules browser-safe. UI client adapters import them directly, so they must not import Node or Bun runtime modules.
208
251
  - `apps/ui/src/routeTree.gen.ts` is generated and should not be manually edited or lint-formatted.
package/README.md CHANGED
@@ -10,7 +10,7 @@
10
10
  [![runtime](https://img.shields.io/badge/runtime-Bun-000000?logo=bun)](https://bun.sh)
11
11
  [![wakatime](https://wakatime.com/badge/user/a0b906ce-b8e7-4463-8bce-383238df6d4b/project/f035d5e2-fa44-4383-913b-53c2c326d8a7.svg)](https://wakatime.com/badge/user/a0b906ce-b8e7-4463-8bce-383238df6d4b/project/f035d5e2-fa44-4383-913b-53c2c326d8a7)
12
12
 
13
- Export local Codex, Claude Code, and Cursor transcripts to Markdown or plain text, and inspect Codex, Cursor, and Antigravity history through a browser UI.
13
+ Export local Codex, Claude Code, and Cursor transcripts to Markdown or plain text, and inspect or export Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode history through a browser UI.
14
14
 
15
15
  ## Quick Start
16
16
 
@@ -34,12 +34,16 @@ rtk bunx spiracha cursor list
34
34
 
35
35
  - Export Codex session transcripts from local `.codex` history
36
36
  - Export Cursor Agent/Composer threads from local Cursor storage
37
- - Browse Codex, Cursor, and Antigravity history in a TanStack Start UI
37
+ - Browse Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode history in a TanStack Start UI
38
38
  - Inspect Codex thread timelines, tool calls, thread metadata, and raw event context
39
+ - Inspect Claude Code project workspaces, dedicated session detail pages, reasoning/tool calls, token metadata, and export sessions directly from local `~/.claude/projects` JSONL files
40
+ - Inspect Kiro workspace inventories, dedicated session detail pages, image attachments, prompt logs, execution-derived tool calls, and export sessions
39
41
  - Inspect Cursor workspace inventories, dedicated thread detail pages, recover split storage buckets, and export or delete workspace threads
40
42
  - Inspect Antigravity workspaces, dedicated conversation detail pages, unlock transcript export through macOS Keychain, and export conversation transcripts or generated artifacts
43
+ - Inspect OpenCode project workspaces, dedicated session detail pages, reasoning/tool parts, MiniMax `<think>` blocks, token metadata, and export sessions
41
44
  - Delete threads or derived projects from the Codex SQLite database after confirmation
42
- - Download thread exports directly from the UI as Markdown or plain text, with optional metadata, commentary, and tool-call inclusion
45
+ - Download thread exports directly from the UI as Markdown, plain text, or optional zip archives, with optional metadata, commentary, and tool-call inclusion
46
+ - Keep source-specific assistant commentary hidden by default while still showing final answers, with matching export filtering for Claude Code, Kiro, and OpenCode
43
47
  - View dashboard and analytics summaries, including token totals and tool-call frequency
44
48
  - Filter Codex exports by:
45
49
  - exact `cwd`
@@ -117,10 +121,25 @@ Useful flags:
117
121
 
118
122
  The UI currently includes:
119
123
  - a Codex inventory and derived-project detail flow
124
+ - a Claude Code workspace inventory, workspace-session listing, and standalone session detail flow
125
+ - a Kiro workspace inventory, workspace-session listing, and standalone session detail flow
120
126
  - a Cursor workspace inventory, workspace-thread listing, and standalone thread detail flow
121
127
  - an Antigravity workspace inventory, conversation listing, and standalone conversation detail flow
128
+ - an OpenCode workspace inventory, session listing, and standalone session detail flow
122
129
  - a Codex dashboard, Codex thread detail view, and Codex analytics page
123
130
 
131
+ Transcript detail pages use the same compact controls across sources: show or hide user messages, commentary, tool calls, extra events, and raw JSON. Claude Code uses `stop_reason` to distinguish tool-use lead-ins from final answers. Kiro uses execution traces for assistant commentary/tool calls and keeps the final assistant response for each user turn visible. OpenCode strips MiniMax `<think>` blocks into commentary, preserves literal `<think>` examples inside Markdown code, and uses the final visible assistant text in each assistant run as the final answer.
132
+
133
+ Default browser UI data locations:
134
+
135
+ | Source | Default location | Primary override |
136
+ | --- | --- | --- |
137
+ | Codex | shared Codex DB probe list | `SPIRACHA_CODEX_DB` |
138
+ | Claude Code | `~/.claude/projects` | `SPIRACHA_CLAUDE_CODE_PROJECTS_DIR` |
139
+ | Kiro | `~/Library/Application Support/Kiro/User/globalStorage/kiro.kiroagent/workspace-sessions` | `SPIRACHA_KIRO_WORKSPACE_SESSIONS_DIR` |
140
+ | OpenCode | `${XDG_DATA_HOME:-~/.local/share}/opencode/opencode.db` | `SPIRACHA_OPENCODE_DB` |
141
+ | Export downloads | OS temp directory under `spiracha-ui-exports` | `SPIRACHA_UI_EXPORT_DIR` |
142
+
124
143
  Codex inventory search and analytics project filters are stored in route search params, so filtered views can be bookmarked or reloaded. `/projects` and `/projects/$project` use `q`, and `/analytics` uses `project`.
125
144
 
126
145
  Analytics cache keys are derived from Codex DB row metadata instead of statting every rollout file. This avoids large per-rollout stat storms on big histories and lets cached analytics resolve without touching transcript files. The hard tradeoff is that manual JSONL edits outside Codex do not invalidate analytics unless the corresponding DB row metadata changes or the temp UI cache is cleared. Transcript analytics parsing uses a bounded worker pool; tune it with `SPIRACHA_ANALYTICS_TRANSCRIPT_CONCURRENCY` when benchmarking large datasets.
@@ -130,10 +149,16 @@ The thread detail page also supports a direct UUID shortcut route. Pasting `http
130
149
  Notable UI routes:
131
150
  - `/projects` and `/projects/$project` for Codex inventory and project threads
132
151
  - `/threads/$threadId` for Codex thread detail
152
+ - `/claude-code` and `/claude-code/$workspaceKey` for Claude Code workspace inventory and session lists
153
+ - `/claude-code-sessions/$sessionId` for Claude Code session detail
154
+ - `/kiro` and `/kiro/$workspaceKey` for Kiro workspace inventory and session lists
155
+ - `/kiro-sessions/$sessionId` for Kiro session detail
133
156
  - `/cursor` and `/cursor/$workspaceKey` for Cursor workspace inventory and thread lists
134
157
  - `/cursor-threads/$composerId` for Cursor thread detail
135
158
  - `/antigravity` and `/antigravity/$workspaceKey` for Antigravity workspace inventory and conversation lists
136
159
  - `/antigravity-conversations/$conversationId` for Antigravity conversation detail
160
+ - `/opencode` and `/opencode/$workspaceKey` for OpenCode workspace inventory and session lists
161
+ - `/opencode-sessions/$sessionId` for OpenCode session detail
137
162
 
138
163
  Examples:
139
164
 
@@ -198,7 +223,7 @@ Repo-local equivalent during development:
198
223
  rtk bun run ./src/export-cursor.ts --help
199
224
  ```
200
225
 
201
- Antigravity conversation browsing and export currently live in the browser UI rather than a standalone CLI subcommand.
226
+ Claude Code direct-history browsing, Kiro browsing/export, Antigravity, and OpenCode conversation browsing/export currently live in the browser UI rather than standalone CLI subcommands.
202
227
 
203
228
  ## MCP server
204
229
 
@@ -260,7 +285,7 @@ This builds the app, packs a fresh tarball in a clean temp directory, launches `
260
285
 
261
286
  ## Project Layout
262
287
 
263
- - `apps/ui/`: TanStack Start browser app for Codex, Cursor, and Antigravity browsing plus export and delete flows
288
+ - `apps/ui/`: TanStack Start browser app for Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode browsing plus export and delete flows
264
289
  - `src/export-chats.ts`: Codex CLI wrapper
265
290
  - `src/export-claude.ts`: Claude CLI wrapper
266
291
  - `src/export-cursor.ts`: Cursor CLI wrapper
@@ -270,8 +295,12 @@ This builds the app, packs a fresh tarball in a clean temp directory, launches `
270
295
  - `src/lib/codex-browser-*.ts`: shared browser/UI data, analytics, and export helpers
271
296
  - `src/lib/codex-thread-*.ts`: structured transcript parsing and caching helpers
272
297
  - `src/lib/concurrency.ts`: shared bounded-concurrency helper for large transcript and DB workloads
298
+ - `src/lib/claude-code-*.ts`: Claude Code local project/session discovery, assistant phase classification, and transcript rendering helpers
299
+ - `src/lib/kiro-*.ts`: Kiro workspace/session discovery, execution-trace enrichment, assistant phase classification, and transcript rendering helpers
273
300
  - `src/lib/claude-exporter.ts`: Claude exporter implementation
274
301
  - `src/lib/cursor-*.ts`: Cursor discovery, transcript rendering, recovery, and CLI helpers
302
+ - `src/lib/opencode-*.ts`: OpenCode project/session discovery, MiniMax think-tag handling, assistant phase classification, and transcript rendering helpers
303
+ - `src/lib/ui-export-archive.ts` and `src/lib/ui-export-files.ts`: browser download filename, MIME type, zip archive, temp file, and URL helpers
275
304
  - `plugins/codex-chats-export/`: local Codex plugin bundle
276
305
 
277
306
  ## Testing
@@ -279,13 +308,19 @@ This builds the app, packs a fresh tarball in a clean temp directory, launches `
279
308
  The test suite includes:
280
309
  - Codex exporter end-to-end coverage
281
310
  - Claude exporter end-to-end coverage
311
+ - Claude Code direct-history discovery and export coverage
312
+ - Kiro workspace session discovery and export coverage
313
+ - source-specific assistant commentary/final-answer classification and export filtering coverage
282
314
  - Cursor exporter and recovery coverage
283
315
  - Antigravity discovery and export coverage
316
+ - OpenCode discovery and export coverage
317
+ - OpenCode MiniMax `<think>` extraction coverage, including literal tags in Markdown code
284
318
  - Codex CLI helper tests
285
319
  - transcript rendering helper tests
286
320
  - route search parsing and bounded concurrency tests
287
321
  - MCP stdio protocol round-trip tests
288
322
  - local packaging should be smoke-tested with a packed tarball before publishing
323
+ - packaged source manifests are checked for UI server helper files used at runtime
289
324
 
290
325
  Coverage enforcement:
291
326
  - `rtk bun run coverage:root` checks the root Bun unit-test surface at a minimum of 90% line coverage.
package/apps/ui/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- This package is the local browser UI for Spiracha. It reads Codex, Cursor, and Antigravity local data through TanStack Start server functions and shared root-package helpers.
5
+ This package is the local browser UI for Spiracha. It reads Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode local data through TanStack Start server functions and shared root-package helpers.
6
6
 
7
7
  ## Commands
8
8
 
@@ -27,9 +27,12 @@ Important:
27
27
  - The UI supports both `/threads/$threadId` and a root shortcut route `/$threadId` that redirects straight to the thread detail page.
28
28
  - Codex project inventory and project-thread search use route search params. `/projects` and `/projects/$project` use `q`.
29
29
  - Codex analytics uses the `project` route search param so filtered analytics links can be bookmarked and reloaded.
30
+ - Claude Code session detail lives at `/claude-code-sessions/$sessionId`.
31
+ - Kiro session detail lives at `/kiro-sessions/$sessionId`.
30
32
  - Cursor thread detail lives at `/cursor-threads/$composerId`.
31
33
  - Antigravity conversation detail lives at `/antigravity-conversations/$conversationId`.
32
- - Keep the Codex, Cursor, and Antigravity list/detail pages aligned around the same table-driven index/detail pattern when adding new source integrations.
34
+ - OpenCode session detail lives at `/opencode-sessions/$sessionId`.
35
+ - Keep the Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode list/detail pages aligned around the same table-driven index/detail pattern when adding new source integrations.
33
36
 
34
37
  ## Shared Data Layer
35
38
 
@@ -40,25 +43,40 @@ The UI depends on root-package helpers via `@spiracha/*` path aliases:
40
43
  - `@spiracha/lib/codex-thread-cache`
41
44
  - `@spiracha/lib/codex-analytics`
42
45
  - `@spiracha/lib/concurrency`
46
+ - `@spiracha/lib/claude-code-db`
47
+ - `@spiracha/lib/claude-code-transcript-phase`
48
+ - `@spiracha/lib/claude-code-transcript`
49
+ - `@spiracha/lib/kiro-db`
50
+ - `@spiracha/lib/kiro-transcript-phase`
51
+ - `@spiracha/lib/kiro-transcript`
43
52
  - `@spiracha/lib/cursor-db`
44
53
  - `@spiracha/lib/cursor-recovery`
45
54
  - `@spiracha/lib/cursor-transcript`
46
55
  - `@spiracha/lib/antigravity-db`
47
56
  - `@spiracha/lib/antigravity-keychain`
57
+ - `@spiracha/lib/opencode-db`
58
+ - `@spiracha/lib/opencode-transcript-phase`
59
+ - `@spiracha/lib/opencode-think-tags`
60
+ - `@spiracha/lib/opencode-transcript`
48
61
 
49
62
  Keep server-only imports inside server functions or route loaders. Do not import Bun-only modules into purely client-side components.
63
+ The `*-transcript-phase` helpers are intentionally browser-safe and may be imported by client adapters.
50
64
 
51
65
  ## Data Access Patterns
52
66
 
53
67
  Use the existing layers consistently:
54
68
 
55
- - TanStack Start server functions in `src/lib/codex-server.ts`, `src/lib/cursor-server.ts`, and `src/lib/antigravity-server.ts`
69
+ - TanStack Start server functions in `src/lib/codex-server.ts`, `src/lib/claude-code-server.ts`, `src/lib/kiro-server.ts`, `src/lib/cursor-server.ts`, `src/lib/antigravity-server.ts`, and `src/lib/opencode-server.ts`
56
70
  - Use for any browser-triggered read/write that needs Bun-only modules, DB access, filesystem access, Keychain access, or shared root-package helpers.
57
71
  - Use `.validator(...)` for input validation. Do not add new `.inputValidator(...)` calls.
58
- - TanStack Query query options in `src/lib/codex-queries.ts`, `src/lib/cursor-queries.ts`, and `src/lib/antigravity-queries.ts`
72
+ - TanStack Query query options in `src/lib/codex-queries.ts`, `src/lib/claude-code-queries.ts`, `src/lib/kiro-queries.ts`, `src/lib/cursor-queries.ts`, `src/lib/antigravity-queries.ts`, and `src/lib/opencode-queries.ts`
59
73
  - Use for client-side fetching, caching, retries, and invalidation of server-function results.
60
74
  - Shared root-package helpers under `@spiracha/lib/*`
61
75
  - Extend these when the behavior should stay shared between the UI, CLI, and packaged launcher.
76
+ - Use the shared source-specific phase helpers for assistant commentary/final-answer rules instead of duplicating that logic in UI adapters.
77
+ - Keep OpenCode think-tag handling in `@spiracha/lib/opencode-think-tags` so UI display and exports strip MiniMax reasoning tags consistently.
78
+ - `src/lib/source-session-export-server.ts`
79
+ - Use for single-session source exports that may return either inline content or a temporary zip download URL.
62
80
  - `settings-store.tsx`
63
81
  - Use only for browser-local UI preferences. Do not put server-derived source data here.
64
82
 
@@ -73,6 +91,7 @@ For URL-backed route state, use `src/lib/route-search.ts` instead of ad hoc pars
73
91
  ## Testing
74
92
 
75
93
  - UI component tests live under `src/**/*.vitest.tsx`.
94
+ - Source-specific transcript adapter tests live next to their adapter files under `src/lib/*.vitest.ts`.
76
95
  - Route search parsing tests live next to the helper in `src/lib/route-search.vitest.ts`.
77
96
  - The root package wraps this Vitest suite from `src/ui-package.test.ts` so `rtk bun test` at the repo root exercises both the Bun suite and the UI suite.
78
97
 
package/apps/ui/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Spiracha UI
2
2
 
3
- The browser UI for browsing local Codex, Cursor, and Antigravity history, inspecting transcript details, exporting chats, and analyzing Codex usage patterns.
3
+ The browser UI for browsing local Codex, Claude Code, Kiro, Cursor, Antigravity, and OpenCode history, inspecting transcript details, exporting chats, and analyzing Codex usage patterns.
4
4
 
5
5
  ## Stack
6
6
 
@@ -18,15 +18,22 @@ The browser UI for browsing local Codex, Cursor, and Antigravity history, inspec
18
18
  - lists derived Codex projects from the Codex SQLite database
19
19
  - lists Codex threads within a project in chronological order
20
20
  - shows Codex thread timelines, tool calls, metadata, and raw event context
21
- - exports Codex threads as Markdown or plain text with optional metadata, commentary, and tool-call inclusion
21
+ - exports Codex, Claude Code, Kiro, Cursor, and OpenCode sessions or threads as Markdown, plain text, or optional zip archives with optional metadata, commentary, and tool-call inclusion
22
+ - lists Claude Code workspaces and sessions from local `~/.claude/projects` JSONL files
23
+ - shows dedicated Claude Code session detail pages with reasoning, tool calls, token metadata, and export actions
24
+ - lists Kiro workspaces and sessions from local Kiro workspace session files
25
+ - shows dedicated Kiro session detail pages with image attachments, prompt logs, execution-derived tool calls, metadata, and export actions
22
26
  - lists Cursor workspaces and workspace threads with the same table-based index/detail flow as Codex
23
27
  - shows dedicated Cursor thread detail pages with breadcrumbs back to the workspace and source
24
28
  - recovers split Cursor storage buckets, exports Cursor threads, and deletes Cursor workspaces or threads
25
29
  - lists Antigravity workspaces and conversations, including transcript/artifact availability
26
30
  - shows dedicated Antigravity conversation detail pages with shared metadata and export actions
27
31
  - unlocks Antigravity transcript export through macOS Keychain and exports conversations or artifacts as Markdown
32
+ - lists OpenCode workspaces and sessions from the local OpenCode SQLite database
33
+ - shows dedicated OpenCode session detail pages with reasoning, tool parts, MiniMax `<think>` blocks, token metadata, and export actions
28
34
  - shows dashboard and analytics summaries, including Codex token totals and tool-call frequency
29
35
  - keeps Codex inventory search and analytics project filters in URL search params for reloadable and shareable views
36
+ - keeps source-specific commentary hidden by default while preserving final answers, with matching export filtering for Claude Code, Kiro, and OpenCode
30
37
 
31
38
  ## Commands
32
39
 
@@ -58,11 +65,32 @@ Runtime configuration is intentionally small:
58
65
  - `SPIRACHA_ANALYTICS_TRANSCRIPT_CONCURRENCY`
59
66
  - Optional positive integer for Codex analytics transcript parsing concurrency.
60
67
  - Defaults to `8`.
68
+ - `SPIRACHA_CLAUDE_CODE_PROJECTS_DIR`
69
+ - Optional absolute path to the Claude Code projects directory.
70
+ - If unset, Spiracha reads `${SPIRACHA_CLAUDE_CODE_DATA_DIR:-~/.claude}/projects`. `SPIRACHA_CLAUDE_CODE_DIR` and `SPIRACHA_CLAUDE_HOME` are also accepted aliases for the Claude Code data directory.
71
+ - `SPIRACHA_KIRO_WORKSPACE_SESSIONS_DIR`
72
+ - Optional absolute path to the Kiro workspace sessions directory.
73
+ - If unset, Spiracha reads `${SPIRACHA_KIRO_DATA_DIR:-~/Library/Application Support/Kiro/User/globalStorage/kiro.kiroagent}/workspace-sessions`. `SPIRACHA_KIRO_AGENT_DIR` and `SPIRACHA_KIRO_DIR` are also accepted aliases for the Kiro data directory.
74
+ - `SPIRACHA_OPENCODE_DB`
75
+ - Optional absolute path to the OpenCode SQLite database.
76
+ - If unset, Spiracha reads `${SPIRACHA_OPENCODE_DATA_DIR:-${XDG_DATA_HOME:-~/.local/share}/opencode}/opencode.db`. `SPIRACHA_OPENCODE_DIR` is also accepted as an OpenCode data-directory alias.
61
77
 
62
78
  Export artifacts are served through the UI as attachment downloads from `/__exports/*`. The packaged `spiracha ui` launcher and the local dev server both use the same export-directory contract.
63
79
 
80
+ Default source locations:
81
+
82
+ | Source | Default location | Primary override |
83
+ | --- | --- | --- |
84
+ | Codex | shared Codex DB probe list | `SPIRACHA_CODEX_DB` |
85
+ | Claude Code | `~/.claude/projects` | `SPIRACHA_CLAUDE_CODE_PROJECTS_DIR` |
86
+ | Kiro | `~/Library/Application Support/Kiro/User/globalStorage/kiro.kiroagent/workspace-sessions` | `SPIRACHA_KIRO_WORKSPACE_SESSIONS_DIR` |
87
+ | OpenCode | `${XDG_DATA_HOME:-~/.local/share}/opencode/opencode.db` | `SPIRACHA_OPENCODE_DB` |
88
+ | Export downloads | OS temp directory under `spiracha-ui-exports` | `SPIRACHA_UI_EXPORT_DIR` |
89
+
64
90
  Codex analytics cache keys are based on Codex DB row metadata instead of statting every rollout file before cache hits. That keeps large histories responsive. The tradeoff is that manual JSONL edits outside Codex do not invalidate analytics unless DB row metadata changes or the temporary UI cache is cleared.
65
91
 
92
+ Transcript detail pages expose the same display controls across sources: user messages, commentary, tool calls, extra events, and raw JSON. Claude Code assistant lead-ins are classified from `stop_reason`, Kiro assistant phases are classified per user turn from session and execution files, and OpenCode assistant phases are classified per assistant run after stripping MiniMax `<think>` blocks into commentary. OpenCode think-tag extraction preserves literal `<think>` examples inside Markdown code spans and fenced code blocks.
93
+
66
94
  ## Routes
67
95
 
68
96
  - `/`
@@ -71,6 +99,18 @@ Codex analytics cache keys are based on Codex DB row metadata instead of stattin
71
99
  - Codex inventory and search, with `q` as the route search param
72
100
  - `/projects/$project`
73
101
  - Codex project thread listing, with `q` as the route search param
102
+ - `/claude-code`
103
+ - Claude Code workspace inventory and search
104
+ - `/claude-code/$workspaceKey`
105
+ - Claude Code workspace session listing
106
+ - `/claude-code-sessions/$sessionId`
107
+ - Claude Code session detail and export
108
+ - `/kiro`
109
+ - Kiro workspace inventory and search
110
+ - `/kiro/$workspaceKey`
111
+ - Kiro workspace session listing
112
+ - `/kiro-sessions/$sessionId`
113
+ - Kiro session detail and export
74
114
  - `/cursor`
75
115
  - Cursor workspace inventory and search
76
116
  - `/cursor/$workspaceKey`
@@ -83,6 +123,12 @@ Codex analytics cache keys are based on Codex DB row metadata instead of stattin
83
123
  - Antigravity workspace conversation listing
84
124
  - `/antigravity-conversations/$conversationId`
85
125
  - Antigravity conversation detail, export, and artifact inspection
126
+ - `/opencode`
127
+ - OpenCode workspace inventory and search
128
+ - `/opencode/$workspaceKey`
129
+ - OpenCode workspace session listing
130
+ - `/opencode-sessions/$sessionId`
131
+ - OpenCode session detail and export
86
132
  - `/threads/$threadId`
87
133
  - Codex thread detail, transcript, export, and delete
88
134
  - `/$threadId`
@@ -93,5 +139,6 @@ Codex analytics cache keys are based on Codex DB row metadata instead of stattin
93
139
  ## Testing
94
140
 
95
141
  - UI component tests live under `src/**/*.vitest.tsx`.
142
+ - Source-specific transcript event adapter tests live under `src/lib/*.vitest.ts`.
96
143
  - Route search parsing tests live in `src/lib/route-search.vitest.ts`.
97
144
  - The repo root wraps this Vitest suite from `src/ui-package.test.ts`, so `rtk bun test` at the root covers both the Bun tests and the UI tests.
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{c as r,o as i,s as a}from"./formatters-BtqyrX_c.js";import{n as o,t as s}from"./data-table-Br78_dk3.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-CYF6pF37.js";import{$ as p,Q as m,Z as h,at as g,et as _,kt as v,nt as y}from"./index-C-STgIH4.js";import{t as b}from"./metric-card-Dplm0ZiM.js";import{t as x}from"./page-header-Cwa3p6Tl.js";var S=e(n()),C=t(),w=o(),T=[w.accessor(`name`,{cell:e=>(0,C.jsx)(`span`,{className:`font-mono text-sm`,children:e.getValue()}),header:`Tool`}),w.accessor(`count`,{cell:e=>(0,C.jsx)(`span`,{className:`font-mono text-sm`,children:i(e.getValue())}),header:`Calls`})],E=o(),D=[E.accessor(`model`,{cell:e=>(0,C.jsx)(`span`,{className:`font-mono text-sm`,children:e.getValue()}),header:`Model`}),E.accessor(`threadCount`,{cell:e=>(0,C.jsx)(`span`,{className:`font-mono text-sm`,children:i(e.getValue())}),header:`Threads`}),E.accessor(`totalTokens`,{cell:e=>(0,C.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Tokens`})];function O(){let e=v({from:h.fullPath}),t=r(g()).data,n=h.useSearch().project??null,o=r(y(n)).data;return(0,C.jsxs)(`div`,{className:`space-y-6`,children:[(0,C.jsx)(x,{actions:(0,C.jsxs)(f,{value:p(n),onValueChange:t=>{(0,S.startTransition)(()=>{e({replace:!0,search:e=>_(e,m(t))})})},children:[(0,C.jsx)(l,{className:`h-10 w-full rounded-full border-[var(--border)] bg-[var(--panel)] sm:w-[15rem]`,children:(0,C.jsx)(c,{placeholder:`Filter by project`})}),(0,C.jsxs)(u,{children:[(0,C.jsx)(d,{value:`__all__`,children:`All projects`}),t.map(e=>(0,C.jsx)(d,{value:p(e.name),children:e.name},e.name))]})]}),eyebrow:`Analytics`,subtitle:`Inspect token load, tool-call distribution, and project-scoped usage patterns to understand where Codex is spending effort.`,title:`Analytics`}),(0,C.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:[(0,C.jsx)(b,{label:`Threads`,value:i(o.summary.totalThreads)}),(0,C.jsx)(b,{label:`Projects`,value:i(o.summary.totalProjects)}),(0,C.jsx)(b,{label:`Tokens`,value:a(o.summary.totalTokens)}),(0,C.jsx)(b,{label:`Average per thread`,value:a(Math.round(o.summary.averageTokensPerThread))}),(0,C.jsx)(b,{label:`Web search threads`,value:i(o.summary.threadsWithWebSearch)})]}),(0,C.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,C.jsxs)(`section`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h3`,{className:`font-semibold text-sm`,children:`Most frequent tool calls`}),(0,C.jsx)(`p`,{className:`mt-1 text-[var(--muted-foreground)] text-sm`,children:`Useful for future prompt and tool optimization work.`})]}),(0,C.jsx)(s,{columns:T,data:o.toolUsage,emptyMessage:`No tool calls recorded.`})]}),(0,C.jsxs)(`section`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`h3`,{className:`font-semibold text-sm`,children:`Model token breakdown`}),(0,C.jsx)(`p`,{className:`mt-1 text-[var(--muted-foreground)] text-sm`,children:`Compare model usage and token concentration within the current project scope.`})]}),(0,C.jsx)(s,{columns:D,data:o.modelsByTokens,emptyMessage:`No model usage recorded.`})]})]})]})}export{O as component};
@@ -1,7 +1,7 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{N as r}from"./createServerFn-CgRRVpBH.js";import{c as i,n as a,o,r as s}from"./formatters-BM9kB7ed.js";import{t as c}from"./useMutation-CC_B7uy5.js";import{t as l}from"./checkbox-CdHitXWQ.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./tabs-OO4VU5KR.js";import{r as v,t as y}from"./download-Bf0QJKD3.js";import{t as b}from"./antigravity-keychain-panel-BRHVjFAM.js";import{t as x}from"./scroll-text-fM0sMOB3.js";import{J as S,d as C,g as w,l as T,m as E,p as D,t as O}from"./index-CPvAP-jk.js";import{t as k}from"./metric-card-Dplm0ZiM.js";import{t as A}from"./page-header-Cwa3p6Tl.js";var j=e(n()),M=t(),N=({content:e,description:t,title:n})=>(0,M.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,M.jsx)(`h3`,{className:`font-semibold text-[var(--muted-foreground)] text-sm uppercase tracking-[0.18em]`,children:n}),t?(0,M.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:t}):null,(0,M.jsx)(`pre`,{className:`mt-4 overflow-x-auto whitespace-pre-wrap rounded-2xl border border-[var(--border)] bg-[var(--code-background)] p-4 text-sm leading-6 [overflow-wrap:anywhere]`,children:e})]}),P=/^##\s+(.+)$/u,F=/^_Timestamp:\s*(.+?)_$/u,I=/^tool:\s*(.+)$/iu,L=e=>{if(!e?.trim())return[];let t=[],n=e.split(/\r?\n/u),r=null,i=[],a=()=>{r&&t.push({body:i.join(`
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{M as r}from"./createServerFn-B-KkwmHU.js";import{c as i,n as a,o,r as s}from"./formatters-BtqyrX_c.js";import{t as c}from"./useMutation-BSFult2i.js";import{t as l}from"./checkbox-CdHitXWQ.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./tabs-CmuhkT-c.js";import{r as v,t as y}from"./download-Bf0QJKD3.js";import{t as b}from"./antigravity-keychain-panel-B77qJz6f.js";import{t as x}from"./scroll-text-fM0sMOB3.js";import{C as S,S as C,T as w,b as T,ht as E,t as D,v as O}from"./index-C-STgIH4.js";import{t as k}from"./metric-card-Dplm0ZiM.js";import{t as A}from"./page-header-Cwa3p6Tl.js";var j=e(n()),M=t(),N=({content:e,description:t,title:n})=>(0,M.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,M.jsx)(`h3`,{className:`font-semibold text-[var(--muted-foreground)] text-sm uppercase tracking-[0.18em]`,children:n}),t?(0,M.jsx)(`p`,{className:`mt-2 text-[var(--muted-foreground)] text-sm`,children:t}):null,(0,M.jsx)(`pre`,{className:`mt-4 overflow-x-auto whitespace-pre-wrap rounded-2xl border border-[var(--border)] bg-[var(--code-background)] p-4 text-sm leading-6 [overflow-wrap:anywhere]`,children:e})]}),P=/^##\s+(.+)$/u,F=/^_Timestamp:\s*(.+?)_$/u,I=/^tool:\s*(.+)$/iu,L=e=>{if(!e?.trim())return[];let t=[],n=e.split(/\r?\n/u),r=null,i=[],a=()=>{r&&t.push({body:i.join(`
2
2
  `).trim(),heading:r,sequence:t.length*10})};for(let e of n){let t=P.exec(e);if(t){a(),r=t[1].trim(),i=[];continue}r&&i.push(e)}return a(),t},R=e=>{let t=e.split(/\r?\n/u),n=F.exec(t[0]?.trim()??``)?.[1]?.trim()??null;return{body:n?t.slice(1).join(`
3
3
  `).trim():e.trim(),timestamp:n}},z=e=>e.split(/^###\s+/mu)[0]?.trim()??``,B=(e,t)=>{let n=e.split(/\r?\n/u),r=n.findIndex(e=>e.trim().toLowerCase()===`### ${t.toLowerCase()}`);if(r===-1)return``;let i=n.findIndex((e,t)=>t>r&&e.startsWith(`### `));return n.slice(r+1,i===-1?void 0:i).join(`
4
4
  `).trim()},V=e=>{let t=B(e,`Tool Calls`);if(!t)return[];let n=[];for(let e of t.matchAll(/-\s+`([^`]+)`(?:\s*\n+```json\s*\n([\s\S]*?)\n```)?/gu))n.push({argumentsText:e[2]?.trim()??null,name:e[1]?.trim()||`unknown`});return n},H=e=>{let t=z(e),[n,...r]=B(e,`Thinking`).split(/\n{2,}/u).map(e=>e.trim());return{content:t||r.join(`
5
5
 
6
6
  `).trim(),thinking:n??``,toolCalls:V(e)}},U=(e,t={})=>({heading:e.heading,source:`antigravity_markdown`,...t}),W=(e,t,n,r,i,a=0)=>({isHiddenByDefault:t!==`assistant`&&t!==`user`,kind:`message`,memoryCitation:null,model:null,phase:i,raw:U(e,{role:t}),role:t,sequence:e.sequence+a,text:n,timestamp:r,variant:t===`user`?`user_message`:t===`assistant`?`agent_message`:`message`}),G=(e,t,n,r)=>({argumentsParseFailed:!1,argumentsText:t.argumentsText,callId:null,command:[t.name,t.argumentsText].filter(Boolean).join(`
7
- `),kind:`tool_call`,name:t.name,raw:U(e,{argumentsText:t.argumentsText,name:t.name}),sequence:e.sequence+r,timestamp:n,workdir:null}),K=(e,t,n,r)=>({callId:null,exitCode:null,kind:`tool_output`,outputText:n,raw:U(e,{name:t}),sequence:e.sequence,summary:n,timestamp:r,wallTime:null}),q=e=>{let t=new Set,n=null,r=()=>{n!==null&&t.add(n),n=null};for(let t of e){let e=t.heading.toLowerCase();if(e===`user`){r();continue}if(e!==`assistant`)continue;let{body:i}=R(t.body),a=H(i);a.toolCalls.length>0?n=null:a.content&&(n=t.sequence)}return r(),t},J=(e,t,n,r)=>n?[W(e,t,n,r,null)]:[],Y=(e,t,n,r)=>n?[K(e,t,n,r)]:[],X=(e,t,n,r)=>{let i=H(t),a=[];if(i.thinking&&a.push(W(e,`assistant`,i.thinking,n,`commentary`)),i.content){let t=r.has(e.sequence)?`final_answer`:`commentary`;a.push(W(e,`assistant`,i.content,n,t,1))}return i.toolCalls.forEach((t,r)=>{a.push(G(e,t,n,2+r))}),a},Z=(e,t)=>{let{body:n,timestamp:r}=R(e.body),i=e.heading.toLowerCase(),a=I.exec(e.heading);return i===`user`?J(e,`user`,n,r):a?Y(e,a[1]?.trim()||`unknown`,n,r):i===`assistant`?X(e,n,r,t):i===`system`?J(e,`system`,n,r):J(e,`event`,n,r)},Q=e=>{let t=L(e),n=q(t);return t.flatMap(e=>Z(e,n))},$=(e,t)=>{e.messageCount+=1,t.role===`assistant`&&(e.assistantMessageCount+=1),t.role===`user`&&(e.userMessageCount+=1),t.phase===`commentary`&&(e.commentaryCount+=1),t.phase===`final_answer`&&(e.finalAnswerCount+=1)},ee=e=>{let t={assistantMessageCount:0,commentaryCount:0,execCommandCount:0,finalAnswerCount:0,messageCount:0,toolCallCount:0,toolOutputCount:0,userMessageCount:0,webSearchEventCount:0};for(let n of e)n.kind===`message`&&$(t,n),n.kind===`tool_call`&&(t.toolCallCount+=1),n.kind===`tool_output`&&(t.toolOutputCount+=1);return t},te=e=>[{label:`Conversation ID`,value:(0,M.jsx)(`span`,{"data-mono":`true`,children:e.conversation.conversationId})},{label:`Workspace`,value:(0,M.jsx)(r,{className:`text-[var(--accent)]`,params:{workspaceKey:e.conversation.workspaceKey},to:`/antigravity/$workspaceKey`,children:e.conversation.workspaceLabel})},{label:`Created`,value:(0,M.jsx)(`span`,{suppressHydrationWarning:!0,children:s(e.conversation.createdAtMs)})},{label:`Updated`,value:(0,M.jsx)(`span`,{suppressHydrationWarning:!0,children:s(e.conversation.lastUpdatedAtMs)})},{label:`Transcript source`,value:e.conversation.transcriptSource??`n/a`},{label:`Conversation path`,value:e.conversation.conversationPath??`n/a`},{label:`Transcript path`,value:e.conversation.transcriptPath??`n/a`},{label:`Summary path`,value:e.conversation.summaryPath??`n/a`},{label:`Source root`,value:e.conversation.sourceRoot??`n/a`}],ne=(e,t)=>{if(e.transcriptLocked)return[{label:`Transcript load`,value:`Transcript is locked until Antigravity Keychain access is enabled.`}];if(!e.conversationMarkdown)return[{label:`Transcript load`,value:`No renderable transcript content was found.`}];let n=ee(t);return[{label:`Event kinds`,value:[...new Set(t.map(e=>e.kind))].join(`, `)||`n/a`},{label:`Messages`,value:o(n.messageCount)},{label:`User messages`,value:o(n.userMessageCount)},{label:`Assistant messages`,value:o(n.assistantMessageCount)},{label:`Commentary updates`,value:o(n.commentaryCount)},{label:`Final answers`,value:o(n.finalAnswerCount)},{label:`Tool calls`,value:o(n.toolCallCount)},{label:`Tool outputs`,value:o(n.toolOutputCount)}]};function re({canExportArtifacts:e,canExportConversation:t,exportArtifactsPending:n,exportConversationPending:r,showConversationExport:i,onExportArtifacts:a,onExportConversation:o}){return(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[i?(0,M.jsxs)(S,{className:`rounded-full`,disabled:!t||r,type:`button`,variant:`outline`,onClick:o,children:[(0,M.jsx)(v,{className:`mr-2 size-4`}),`Export conversation`]}):null,e?(0,M.jsxs)(S,{className:`rounded-full`,disabled:n,type:`button`,variant:`outline`,onClick:a,children:[(0,M.jsx)(x,{className:`mr-2 size-4`}),`Export artifacts`]}):null]})}var ie=({rawJsonDisabled:e=!1,showCommentary:t,showExtraEvents:n,showRawJson:r,showToolCalls:i,showUserMessages:a,onShowCommentaryChange:o,onShowExtraEventsChange:s,onShowRawJsonChange:c,onShowToolCallsChange:u,onShowUserMessagesChange:d})=>(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-4 rounded-xl border border-[var(--border)] bg-[var(--panel)] px-4 py-3 shadow-[var(--panel-shadow)]`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:i,id:`antigravity-transcript-show-tool-calls`,onCheckedChange:e=>u(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-tool-calls`,children:`Show tool calls`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:t,id:`antigravity-transcript-show-commentary`,onCheckedChange:e=>o(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-commentary`,children:`Show commentary`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:n,id:`antigravity-transcript-show-extra-events`,onCheckedChange:e=>s(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-extra-events`,children:`Show extra events`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:r,disabled:e,id:`antigravity-transcript-show-raw-json`,onCheckedChange:e=>c(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-raw-json`,children:`Raw JSON`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:a,id:`antigravity-transcript-show-user-messages`,onCheckedChange:e=>d(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-user-messages`,children:`User`})]})]});function ae({detail:e}){return(0,M.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,M.jsx)(`h3`,{className:`font-semibold text-[var(--muted-foreground)] text-sm uppercase tracking-[0.18em]`,children:`Transcript`}),(0,M.jsx)(`p`,{className:`mt-4 text-[var(--muted-foreground)] text-sm`,children:e.transcriptLocked?`Unlock Antigravity transcript export to inspect the rendered conversation content here.`:e.artifactsMarkdown?`No transcript preview is available for this conversation. Generated artifacts are available in the Raw tab.`:`No transcript preview is available for this conversation.`})]})}function oe({detail:e,events:t}){return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(g,{title:`Conversation summary`,value:e.conversation}),(0,M.jsx)(g,{title:`Transcript events`,value:t}),e.conversationMarkdown?(0,M.jsx)(N,{content:e.conversationMarkdown,description:`Rendered transcript Markdown used for export.`,title:`Transcript Markdown`}):null,e.artifactsMarkdown?(0,M.jsx)(N,{content:e.artifactsMarkdown,description:`Generated artifacts.`,title:`Artifacts`}):null]})}function se(){let e=i(C()).data,t=i(T(O.useParams().conversationId)).data,[n,r]=(0,j.useState)(!1),[s,l]=(0,j.useState)(!1),[g,v]=(0,j.useState)(!1),[x,S]=(0,j.useState)(!1),[N,P]=(0,j.useState)(!0),F=(0,j.useMemo)(()=>Q(t.conversationMarkdown),[t.conversationMarkdown]),I=w(t.conversation,!!e?.isUnlocked),L=t.artifactsMarkdown!==null,R=I||t.transcriptLocked,z=c({mutationFn:()=>E({data:{conversationId:t.conversation.conversationId}}),onSuccess:e=>{y(e.filename,e.content,`text/markdown; charset=utf-8`)}}),B=c({mutationFn:()=>D({data:{conversationId:t.conversation.conversationId}}),onSuccess:e=>{y(e.filename,e.content,`text/markdown; charset=utf-8`)}});return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(A,{actions:(0,M.jsx)(re,{canExportArtifacts:L,canExportConversation:I,exportArtifactsPending:B.isPending,exportConversationPending:z.isPending,showConversationExport:R,onExportArtifacts:()=>B.mutate(),onExportConversation:()=>z.mutate()}),breadcrumb:(0,M.jsx)(d,{items:[{label:`Antigravity`,to:`/antigravity`},{label:t.conversation.workspaceLabel,params:{workspaceKey:t.conversation.workspaceKey},to:`/antigravity/$workspaceKey`},{label:t.conversation.title}]}),eyebrow:`Antigravity conversation`,subtitle:`Conversation detail for the selected Antigravity workspace session.`,title:t.conversation.title}),(0,M.jsx)(b,{}),(0,M.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,M.jsx)(k,{label:`Transcript entries`,value:o(t.conversation.transcriptEntryCount)}),(0,M.jsx)(k,{label:`Artifacts`,value:o(t.conversation.artifactCount)}),(0,M.jsx)(k,{label:`Size`,value:a(t.conversation.conversationBytes)}),(0,M.jsx)(k,{helper:t.conversation.transcriptSource??`summary`,label:`Indexed items`,value:o(t.conversation.indexedItemCount??0)})]}),(0,M.jsxs)(_,{className:`space-y-4`,defaultValue:`transcript`,children:[(0,M.jsxs)(h,{className:`grid w-fit min-w-[24rem] grid-cols-3 rounded-full border border-[var(--border)] bg-[var(--panel)] p-1`,children:[(0,M.jsx)(f,{className:`rounded-full px-5 text-sm`,value:`transcript`,children:`Transcript`}),(0,M.jsx)(f,{className:`rounded-full px-5 text-sm`,value:`metadata`,children:`Metadata`}),(0,M.jsx)(f,{className:`rounded-full px-5 text-sm`,value:`raw`,children:`Raw`})]}),(0,M.jsxs)(p,{className:`space-y-3`,value:`transcript`,children:[(0,M.jsx)(ie,{rawJsonDisabled:F.length===0,showCommentary:s,showExtraEvents:g,showRawJson:x,showToolCalls:n,showUserMessages:N,onShowCommentaryChange:l,onShowExtraEventsChange:v,onShowRawJsonChange:S,onShowToolCallsChange:r,onShowUserMessagesChange:P}),F.length>0?(0,M.jsx)(u,{assistantModel:null,events:F,projectPath:t.conversation.workspaceFolder,showCommentary:s,showExtraEvents:g,showRawJson:x,showToolCalls:n,showUserMessages:N}):(0,M.jsx)(ae,{detail:t})]}),(0,M.jsx)(p,{value:`metadata`,children:(0,M.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[0.95fr_1.05fr]`,children:[(0,M.jsx)(m,{items:te(t),title:`Conversation metadata`}),(0,M.jsx)(m,{items:ne(t,F),title:`Transcript stats`})]})}),(0,M.jsx)(p,{value:`raw`,children:(0,M.jsx)(oe,{detail:t,events:F})})]}),z.isError?(0,M.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:z.error instanceof Error?z.error.message:`Conversation export failed`}):null,B.isError?(0,M.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:B.error instanceof Error?B.error.message:`Artifact export failed`}):null]})}export{se as component};
7
+ `),kind:`tool_call`,name:t.name,raw:U(e,{argumentsText:t.argumentsText,name:t.name}),sequence:e.sequence+r,timestamp:n,workdir:null}),K=(e,t,n,r)=>({callId:null,exitCode:null,kind:`tool_output`,outputText:n,raw:U(e,{name:t}),sequence:e.sequence,summary:n,timestamp:r,wallTime:null}),q=e=>{let t=new Set,n=null,r=()=>{n!==null&&t.add(n),n=null};for(let t of e){let e=t.heading.toLowerCase();if(e===`user`){r();continue}if(e!==`assistant`)continue;let{body:i}=R(t.body),a=H(i);a.toolCalls.length>0?n=null:a.content&&(n=t.sequence)}return r(),t},J=(e,t,n,r)=>n?[W(e,t,n,r,null)]:[],Y=(e,t,n,r)=>n?[K(e,t,n,r)]:[],X=(e,t,n,r)=>{let i=H(t),a=[];if(i.thinking&&a.push(W(e,`assistant`,i.thinking,n,`commentary`)),i.content){let t=r.has(e.sequence)?`final_answer`:`commentary`;a.push(W(e,`assistant`,i.content,n,t,1))}return i.toolCalls.forEach((t,r)=>{a.push(G(e,t,n,2+r))}),a},Z=(e,t)=>{let{body:n,timestamp:r}=R(e.body),i=e.heading.toLowerCase(),a=I.exec(e.heading);return i===`user`?J(e,`user`,n,r):a?Y(e,a[1]?.trim()||`unknown`,n,r):i===`assistant`?X(e,n,r,t):i===`system`?J(e,`system`,n,r):J(e,`event`,n,r)},Q=e=>{let t=L(e),n=q(t);return t.flatMap(e=>Z(e,n))},$=(e,t)=>{e.messageCount+=1,t.role===`assistant`&&(e.assistantMessageCount+=1),t.role===`user`&&(e.userMessageCount+=1),t.phase===`commentary`&&(e.commentaryCount+=1),t.phase===`final_answer`&&(e.finalAnswerCount+=1)},ee=e=>{let t={assistantMessageCount:0,commentaryCount:0,execCommandCount:0,finalAnswerCount:0,messageCount:0,toolCallCount:0,toolOutputCount:0,userMessageCount:0,webSearchEventCount:0};for(let n of e)n.kind===`message`&&$(t,n),n.kind===`tool_call`&&(t.toolCallCount+=1),n.kind===`tool_output`&&(t.toolOutputCount+=1);return t},te=e=>[{label:`Conversation ID`,value:(0,M.jsx)(`span`,{"data-mono":`true`,children:e.conversation.conversationId})},{label:`Workspace`,value:(0,M.jsx)(r,{className:`text-[var(--accent)]`,params:{workspaceKey:e.conversation.workspaceKey},to:`/antigravity/$workspaceKey`,children:e.conversation.workspaceLabel})},{label:`Created`,value:(0,M.jsx)(`span`,{suppressHydrationWarning:!0,children:s(e.conversation.createdAtMs)})},{label:`Updated`,value:(0,M.jsx)(`span`,{suppressHydrationWarning:!0,children:s(e.conversation.lastUpdatedAtMs)})},{label:`Transcript source`,value:e.conversation.transcriptSource??`n/a`},{label:`Conversation path`,value:e.conversation.conversationPath??`n/a`},{label:`Transcript path`,value:e.conversation.transcriptPath??`n/a`},{label:`Summary path`,value:e.conversation.summaryPath??`n/a`},{label:`Source root`,value:e.conversation.sourceRoot??`n/a`}],ne=(e,t)=>{if(e.transcriptLocked)return[{label:`Transcript load`,value:`Transcript is locked until Antigravity Keychain access is enabled.`}];if(!e.conversationMarkdown)return[{label:`Transcript load`,value:`No renderable transcript content was found.`}];let n=ee(t);return[{label:`Event kinds`,value:[...new Set(t.map(e=>e.kind))].join(`, `)||`n/a`},{label:`Messages`,value:o(n.messageCount)},{label:`User messages`,value:o(n.userMessageCount)},{label:`Assistant messages`,value:o(n.assistantMessageCount)},{label:`Commentary updates`,value:o(n.commentaryCount)},{label:`Final answers`,value:o(n.finalAnswerCount)},{label:`Tool calls`,value:o(n.toolCallCount)},{label:`Tool outputs`,value:o(n.toolOutputCount)}]};function re({canExportArtifacts:e,canExportConversation:t,exportArtifactsPending:n,exportConversationPending:r,showConversationExport:i,onExportArtifacts:a,onExportConversation:o}){return(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[i?(0,M.jsxs)(E,{className:`rounded-full`,disabled:!t||r,type:`button`,variant:`outline`,onClick:o,children:[(0,M.jsx)(v,{className:`mr-2 size-4`}),`Export conversation`]}):null,e?(0,M.jsxs)(E,{className:`rounded-full`,disabled:n,type:`button`,variant:`outline`,onClick:a,children:[(0,M.jsx)(x,{className:`mr-2 size-4`}),`Export artifacts`]}):null]})}var ie=({rawJsonDisabled:e=!1,showCommentary:t,showExtraEvents:n,showRawJson:r,showToolCalls:i,showUserMessages:a,onShowCommentaryChange:o,onShowExtraEventsChange:s,onShowRawJsonChange:c,onShowToolCallsChange:u,onShowUserMessagesChange:d})=>(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-4 rounded-xl border border-[var(--border)] bg-[var(--panel)] px-4 py-3 shadow-[var(--panel-shadow)]`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:i,id:`antigravity-transcript-show-tool-calls`,onCheckedChange:e=>u(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-tool-calls`,children:`Show tool calls`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:t,id:`antigravity-transcript-show-commentary`,onCheckedChange:e=>o(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-commentary`,children:`Show commentary`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:n,id:`antigravity-transcript-show-extra-events`,onCheckedChange:e=>s(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-extra-events`,children:`Show extra events`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:r,disabled:e,id:`antigravity-transcript-show-raw-json`,onCheckedChange:e=>c(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-raw-json`,children:`Raw JSON`})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,M.jsx)(l,{checked:a,id:`antigravity-transcript-show-user-messages`,onCheckedChange:e=>d(e===!0)}),(0,M.jsx)(`label`,{htmlFor:`antigravity-transcript-show-user-messages`,children:`User`})]})]});function ae({detail:e}){return(0,M.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,M.jsx)(`h3`,{className:`font-semibold text-[var(--muted-foreground)] text-sm uppercase tracking-[0.18em]`,children:`Transcript`}),(0,M.jsx)(`p`,{className:`mt-4 text-[var(--muted-foreground)] text-sm`,children:e.transcriptLocked?`Unlock Antigravity transcript export to inspect the rendered conversation content here.`:e.artifactsMarkdown?`No transcript preview is available for this conversation. Generated artifacts are available in the Raw tab.`:`No transcript preview is available for this conversation.`})]})}function oe({detail:e,events:t}){return(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsx)(g,{title:`Conversation summary`,value:e.conversation}),(0,M.jsx)(g,{title:`Transcript events`,value:t}),e.conversationMarkdown?(0,M.jsx)(N,{content:e.conversationMarkdown,description:`Rendered transcript Markdown used for export.`,title:`Transcript Markdown`}):null,e.artifactsMarkdown?(0,M.jsx)(N,{content:e.artifactsMarkdown,description:`Generated artifacts.`,title:`Artifacts`}):null]})}function se(){let e=i(T()).data,t=i(O(D.useParams().conversationId)).data,[n,r]=(0,j.useState)(!1),[s,l]=(0,j.useState)(!1),[g,v]=(0,j.useState)(!1),[x,E]=(0,j.useState)(!1),[N,P]=(0,j.useState)(!0),F=(0,j.useMemo)(()=>Q(t.conversationMarkdown),[t.conversationMarkdown]),I=w(t.conversation,!!e?.isUnlocked),L=t.artifactsMarkdown!==null,R=I||t.transcriptLocked,z=c({mutationFn:()=>S({data:{conversationId:t.conversation.conversationId}}),onSuccess:e=>{y(e.filename,e.content,`text/markdown; charset=utf-8`)}}),B=c({mutationFn:()=>C({data:{conversationId:t.conversation.conversationId}}),onSuccess:e=>{y(e.filename,e.content,`text/markdown; charset=utf-8`)}});return(0,M.jsxs)(`div`,{className:`space-y-6`,children:[(0,M.jsx)(A,{actions:(0,M.jsx)(re,{canExportArtifacts:L,canExportConversation:I,exportArtifactsPending:B.isPending,exportConversationPending:z.isPending,showConversationExport:R,onExportArtifacts:()=>B.mutate(),onExportConversation:()=>z.mutate()}),breadcrumb:(0,M.jsx)(d,{items:[{label:`Antigravity`,to:`/antigravity`},{label:t.conversation.workspaceLabel,params:{workspaceKey:t.conversation.workspaceKey},to:`/antigravity/$workspaceKey`},{label:t.conversation.title}]}),eyebrow:`Antigravity conversation`,subtitle:`Conversation detail for the selected Antigravity workspace session.`,title:t.conversation.title}),(0,M.jsx)(b,{}),(0,M.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,M.jsx)(k,{label:`Transcript entries`,value:o(t.conversation.transcriptEntryCount)}),(0,M.jsx)(k,{label:`Artifacts`,value:o(t.conversation.artifactCount)}),(0,M.jsx)(k,{label:`Size`,value:a(t.conversation.conversationBytes)}),(0,M.jsx)(k,{helper:t.conversation.transcriptSource??`summary`,label:`Indexed items`,value:o(t.conversation.indexedItemCount??0)})]}),(0,M.jsxs)(_,{className:`space-y-4`,defaultValue:`transcript`,children:[(0,M.jsxs)(h,{className:`grid w-fit min-w-[24rem] grid-cols-3 rounded-full border border-[var(--border)] bg-[var(--panel)] p-1`,children:[(0,M.jsx)(f,{className:`rounded-full px-5 text-sm`,value:`transcript`,children:`Transcript`}),(0,M.jsx)(f,{className:`rounded-full px-5 text-sm`,value:`metadata`,children:`Metadata`}),(0,M.jsx)(f,{className:`rounded-full px-5 text-sm`,value:`raw`,children:`Raw`})]}),(0,M.jsxs)(p,{className:`space-y-3`,value:`transcript`,children:[(0,M.jsx)(ie,{rawJsonDisabled:F.length===0,showCommentary:s,showExtraEvents:g,showRawJson:x,showToolCalls:n,showUserMessages:N,onShowCommentaryChange:l,onShowExtraEventsChange:v,onShowRawJsonChange:E,onShowToolCallsChange:r,onShowUserMessagesChange:P}),F.length>0?(0,M.jsx)(u,{assistantModel:null,events:F,projectPath:t.conversation.workspaceFolder,showCommentary:s,showExtraEvents:g,showRawJson:x,showToolCalls:n,showUserMessages:N}):(0,M.jsx)(ae,{detail:t})]}),(0,M.jsx)(p,{value:`metadata`,children:(0,M.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[0.95fr_1.05fr]`,children:[(0,M.jsx)(m,{items:te(t),title:`Conversation metadata`}),(0,M.jsx)(m,{items:ne(t,F),title:`Transcript stats`})]})}),(0,M.jsx)(p,{value:`raw`,children:(0,M.jsx)(oe,{detail:t,events:F})})]}),z.isError?(0,M.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:z.error instanceof Error?z.error.message:`Conversation export failed`}):null,B.isError?(0,M.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:B.error instanceof Error?B.error.message:`Artifact export failed`}):null]})}export{se as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{i as t}from"./createServerFn-B-KkwmHU.js";import{t as n}from"./useMutation-BSFult2i.js";import{t as r}from"./useQuery-CjINKZf1.js";import{_ as i,h as a}from"./dist-DvMS2965.js";import{b as o,ht as s,w as c}from"./index-C-STgIH4.js";var l=i(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),u=i(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),d=i(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),f=i(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),p=e();function m(){let e=t(),i=r(o()).data??null,m=n({mutationFn:()=>c(),onSuccess:t=>{e.setQueryData(o().queryKey,t),Promise.all([e.invalidateQueries({queryKey:o().queryKey}),e.invalidateQueries({queryKey:[`antigravity-conversation`]})])}});if(!i||i.status===`unsupported`)return null;let h=i.isUnlocked,g=m.error?.message??i.error;return(0,p.jsxs)(`div`,{className:a(`flex flex-col gap-3 rounded-xl border px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,h?`border-emerald-500/30 bg-emerald-500/10`:`border-[var(--border)] bg-[var(--panel)]`),children:[(0,p.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,p.jsx)(`div`,{className:a(`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md`,h?`bg-emerald-500/15 text-emerald-600`:`bg-[var(--panel-secondary)]`),children:h?(0,p.jsx)(d,{className:`size-4`}):(0,p.jsx)(u,{className:`size-4`})}),(0,p.jsxs)(`div`,{className:`min-w-0`,children:[(0,p.jsx)(`p`,{className:`font-medium text-sm`,children:h?`Keychain access enabled`:`Unlock Antigravity transcript export`}),(0,p.jsx)(`p`,{className:`mt-1 text-[var(--muted-foreground)] text-xs`,children:h?`The Antigravity key is cached in this server process only. Transcript exports are available for local logs and safe-storage payloads.`:`Spiracha needs one-time access to ${i.keychainService} to decrypt Antigravity transcript data. macOS will ask for approval after you click unlock.`}),g?(0,p.jsxs)(`p`,{className:`mt-2 flex items-center gap-1 text-[var(--destructive)] text-xs`,children:[(0,p.jsx)(f,{className:`size-3`}),g]}):null]})]}),h?null:(0,p.jsxs)(s,{className:`shrink-0`,disabled:!i.canRequestAccess||m.isPending,type:`button`,onClick:()=>m.mutate(),children:[(0,p.jsx)(l,{className:`size-4`}),m.isPending?`Waiting...`:`Unlock`]})]})}export{u as n,m as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{M as r}from"./createServerFn-B-KkwmHU.js";import{c as i,n as a,o,r as s}from"./formatters-BtqyrX_c.js";import{t as c}from"./useMutation-BSFult2i.js";import{n as l,t as u}from"./data-table-Br78_dk3.js";import{r as d,t as f}from"./download-Bf0QJKD3.js";import{a as p,i as m,n as h,r as g,t as _}from"./dropdown-menu-D5cvPaZt.js";import{n as v,t as y}from"./antigravity-keychain-panel-B77qJz6f.js";import{t as b}from"./scroll-text-fM0sMOB3.js";import{C as x,D as S,E as C,O as w,S as T,T as E,b as D,ht as O,n as k,r as A,x as j,y as M}from"./index-C-STgIH4.js";import{t as N}from"./page-header-Cwa3p6Tl.js";import{t as P}from"./badge-C3i4OKs8.js";import{n as F,t as I}from"./text-filter-DVAZySUS.js";var L=e(n(),1),R=t(),z=l(),B=(e,t)=>{let n=e.artifactCount>0,r=!!t?.isUnlocked,i=S(e)||C(e),a=E(e,r),o=w(e,r),s=a||o;return{canExportConversation:a,hasArtifacts:n,hasTranscript:i,lockedTranscript:o,showActions:s||n,showConversationAction:s}},V=(e,t)=>t.hasTranscript?`${e.transcriptSource?e.transcriptSource.replace(/-/gu,` `):`transcript`} · ${t.lockedTranscript?`locked`:`available`}`:`Summary only`,H=(e,t,n)=>[z.accessor(`title`,{cell:t=>{let n=B(t.row.original,e);return(0,R.jsxs)(r,{className:`block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{conversationId:t.row.original.conversationId},to:`/antigravity-conversations/$conversationId`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`p`,{className:`truncate font-medium underline-offset-2 hover:underline`,children:t.getValue()}),n.hasTranscript?(0,R.jsx)(P,{variant:`secondary`,children:`transcript`}):null,n.hasArtifacts?(0,R.jsx)(P,{variant:`outline`,children:`artifact`}):null]}),(0,R.jsx)(`p`,{className:`truncate text-[var(--muted-foreground)] text-xs`,children:t.row.original.conversationId})]})},header:`Conversation`}),z.accessor(`lastUpdatedAtMs`,{cell:e=>(0,R.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:s(e.getValue())}),header:`Updated`}),z.display({cell:t=>{let n=B(t.row.original,e);return(0,R.jsxs)(`span`,{className:`text-sm`,children:[V(t.row.original,n),t.row.original.transcriptEntryCount>0?` · ${o(t.row.original.transcriptEntryCount)} entries`:``]})},header:`Transcript`,id:`transcript`}),z.accessor(`artifactCount`,{cell:e=>(0,R.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Artifacts`}),z.accessor(`conversationBytes`,{cell:e=>(0,R.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Size`}),z.display({cell:r=>{let i=B(r.row.original,e);return i.showActions?(0,R.jsxs)(_,{children:[(0,R.jsx)(m,{asChild:!0,children:(0,R.jsx)(O,{className:`rounded-full`,size:`icon`,type:`button`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:(0,R.jsx)(p,{className:`size-4`})})}),(0,R.jsxs)(h,{align:`end`,children:[i.showConversationAction?(0,R.jsxs)(g,{disabled:!i.canExportConversation,onClick:()=>t(r.row.original),children:[i.lockedTranscript?(0,R.jsx)(v,{className:`mr-2 size-4`}):(0,R.jsx)(d,{className:`mr-2 size-4`}),i.lockedTranscript?`Unlock conversation export first`:`Export conversation`]}):null,i.hasArtifacts?(0,R.jsxs)(g,{onClick:()=>n(r.row.original),children:[(0,R.jsx)(b,{className:`mr-2 size-4`}),`Export artifacts`]}):null]})]}):(0,R.jsx)(`span`,{className:`text-[var(--muted-foreground)] text-sm`,children:`No export`})},header:``,id:`actions`})];function U({conversations:e,decryptionState:t,onExportArtifacts:n,onExportConversation:r}){return(0,R.jsx)(u,{columns:(0,L.useMemo)(()=>H(t,r,n),[t,n,r]),data:e,emptyMessage:`No Antigravity conversations match the current workspace filter.`})}function W(){let e=k.useParams(),t=i(j()).data,n=A(t,e.workspaceKey),r=i(M(n.key)).data,a=i(D()).data??null,[o,s]=(0,L.useState)(``),l=(0,L.useDeferredValue)(o),u=c({mutationFn:e=>x({data:{conversationId:e.conversationId}}),onSuccess:e=>{f(e.filename,e.content,`text/markdown; charset=utf-8`)}}),d=c({mutationFn:e=>T({data:{conversationId:e.conversationId}}),onSuccess:e=>{f(e.filename,e.content,`text/markdown; charset=utf-8`)}}),p=r.filter(e=>I(l,[e.title,e.conversationId,e.transcriptSource,e.workspaceLabel]));return(0,R.jsxs)(`div`,{className:`space-y-6`,children:[(0,R.jsx)(N,{actions:(0,R.jsx)(F,{placeholder:`Search title, id, or transcript source`,value:o,onValueChange:s}),eyebrow:`Antigravity workspace`,subtitle:`Inspect conversation coverage across Antigravity transcripts, raw payloads, and generated artifacts.`,title:n.label}),(0,R.jsx)(y,{}),(0,R.jsx)(U,{conversations:p,decryptionState:a,onExportArtifacts:e=>d.mutate(e),onExportConversation:e=>u.mutate(e)}),u.isError?(0,R.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:u.error instanceof Error?u.error.message:`Conversation export failed`}):null,d.isError?(0,R.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:d.error instanceof Error?d.error.message:`Artifact export failed`}):null]})}export{W as component};
@@ -1 +1 @@
1
- import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{N as r}from"./createServerFn-CgRRVpBH.js";import{c as i,n as a,o,r as s}from"./formatters-BM9kB7ed.js";import{n as c,t as l}from"./data-table-Br78_dk3.js";import{t as u}from"./antigravity-keychain-panel-BRHVjFAM.js";import{f as d}from"./index-CPvAP-jk.js";import{t as f}from"./page-header-Cwa3p6Tl.js";import{n as p,t as m}from"./text-filter-DVAZySUS.js";var h=e(n()),g=t(),_=c(),v=[_.accessor(`label`,{cell:e=>(0,g.jsxs)(r,{className:`block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{workspaceKey:e.row.original.key},to:`/antigravity/$workspaceKey`,children:[(0,g.jsx)(`p`,{className:`font-medium underline-offset-2 hover:underline`,children:e.getValue()}),(0,g.jsx)(`p`,{className:`truncate text-[var(--muted-foreground)] text-xs`,children:e.row.original.uri??`Unknown root`})]}),header:`Workspace`}),_.accessor(`conversationCount`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Conversations`}),_.accessor(`transcriptCount`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Transcripts`}),_.accessor(`artifactCount`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Artifacts`}),_.accessor(`conversationBytes`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Size`}),_.accessor(`lastActiveMs`,{cell:e=>(0,g.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:s(e.getValue())}),header:`Last updated`})];function y({workspaces:e}){return(0,g.jsx)(l,{columns:v,data:e,emptyMessage:`No Antigravity workspaces match the current search.`})}function b(){let e=i(d()).data,[t,n]=(0,h.useState)(``),r=(0,h.useDeferredValue)(t),a=e.filter(e=>m(r,[e.label,e.uri,e.key]));return(0,g.jsxs)(`div`,{className:`space-y-6`,children:[(0,g.jsx)(f,{actions:(0,g.jsx)(p,{placeholder:`Search workspace name or path`,value:t,onValueChange:n}),eyebrow:`Inventory`,subtitle:`Workspace groups are derived from Antigravity summary indexes, raw conversation files, local logs, and brain artifacts.`,title:`Antigravity`}),(0,g.jsx)(u,{}),(0,g.jsx)(y,{workspaces:a})]})}export{b as component};
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{M as r}from"./createServerFn-B-KkwmHU.js";import{c as i,n as a,o,r as s}from"./formatters-BtqyrX_c.js";import{n as c,t as l}from"./data-table-Br78_dk3.js";import{t as u}from"./antigravity-keychain-panel-B77qJz6f.js";import{x as d}from"./index-C-STgIH4.js";import{t as f}from"./page-header-Cwa3p6Tl.js";import{n as p,t as m}from"./text-filter-DVAZySUS.js";var h=e(n()),g=t(),_=c(),v=[_.accessor(`label`,{cell:e=>(0,g.jsxs)(r,{className:`block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{workspaceKey:e.row.original.key},to:`/antigravity/$workspaceKey`,children:[(0,g.jsx)(`p`,{className:`font-medium underline-offset-2 hover:underline`,children:e.getValue()}),(0,g.jsx)(`p`,{className:`truncate text-[var(--muted-foreground)] text-xs`,children:e.row.original.uri??`Unknown root`})]}),header:`Workspace`}),_.accessor(`conversationCount`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Conversations`}),_.accessor(`transcriptCount`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Transcripts`}),_.accessor(`artifactCount`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:o(e.getValue())}),header:`Artifacts`}),_.accessor(`conversationBytes`,{cell:e=>(0,g.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Size`}),_.accessor(`lastActiveMs`,{cell:e=>(0,g.jsx)(`span`,{className:`whitespace-nowrap text-sm`,suppressHydrationWarning:!0,children:s(e.getValue())}),header:`Last updated`})];function y({workspaces:e}){return(0,g.jsx)(l,{columns:v,data:e,emptyMessage:`No Antigravity workspaces match the current search.`})}function b(){let e=i(d()).data,[t,n]=(0,h.useState)(``),r=(0,h.useDeferredValue)(t),a=e.filter(e=>m(r,[e.label,e.uri,e.key]));return(0,g.jsxs)(`div`,{className:`space-y-6`,children:[(0,g.jsx)(f,{actions:(0,g.jsx)(p,{placeholder:`Search workspace name or path`,value:t,onValueChange:n}),eyebrow:`Inventory`,subtitle:`Workspace groups are derived from Antigravity summary indexes, raw conversation files, local logs, and brain artifacts.`,title:`Antigravity`}),(0,g.jsx)(u,{}),(0,g.jsx)(y,{workspaces:a})]})}export{b as component};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{h as t,u as n}from"./dist-DvMS2965.js";import{at as r}from"./index-CPvAP-jk.js";var i=e(),a=r(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`}}});function o({className:e,variant:r=`default`,asChild:o=!1,...s}){return(0,i.jsx)(o?n:`span`,{"data-slot":`badge`,"data-variant":r,className:t(a({variant:r}),e),...s})}export{o as t};
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{h as t,u as n}from"./dist-DvMS2965.js";import{Et as r}from"./index-C-STgIH4.js";var i=e(),a=r(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{defaultVariants:{variant:`default`},variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`}}});function o({className:e,variant:r=`default`,asChild:o=!1,...s}){return(0,i.jsx)(o?n:`span`,{"data-slot":`badge`,"data-variant":r,className:t(a({variant:r}),e),...s})}export{o as t};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{M as r}from"./createServerFn-B-KkwmHU.js";import{c as i,i as a,o,r as s,s as c}from"./formatters-BtqyrX_c.js";import{t as l}from"./useMutation-BSFult2i.js";import{t as u}from"./checkbox-CdHitXWQ.js";import{a as d,c as f,i as p,n as m,o as h,r as g,s as _,t as v}from"./tabs-CmuhkT-c.js";import{n as y,r as b,t as x}from"./download-Bf0QJKD3.js";import{t as S}from"./export-dialog-Dr8d2MqD.js";import{M as C,ht as w,i as T,k as E}from"./index-C-STgIH4.js";import{t as D}from"./metric-card-Dplm0ZiM.js";import{t as O}from"./page-header-Cwa3p6Tl.js";import{t as k}from"./thread-transcript-stats-BUNz6u7F.js";var A=e(n()),j=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:null,M=e=>e.role===`assistant`?j(e.raw.message)?.stop_reason===`tool_use`?`commentary`:`final_answer`:null,N=(e,t,n)=>({entryId:e.entryId,eventType:n,role:e.role,source:`claude_code_local_jsonl`,type:t.type,...t.raw}),P=(e,t,n,r)=>({isHiddenByDefault:e.role!==`assistant`&&e.role!==`user`,kind:`message`,memoryCitation:null,model:e.model??null,phase:M(e),raw:N(e,t,`message`),role:e.role,sequence:n,text:r,timestamp:e.timestamp,variant:e.role===`user`?`user_message`:e.role===`assistant`?`agent_message`:`message`}),F=(e,t,n)=>{let r=t.text?.trim();return r?{content:r,hasEncryptedContent:!1,kind:`reasoning`,raw:N(e,t,`reasoning`),sequence:n,summary:[r],timestamp:e.timestamp}:null},I=e=>{let t=e.toolName??`unknown`;return e.argumentsText?.trim()?`${t}\n${e.argumentsText}`:t},L=(e,t,n)=>({argumentsParseFailed:!1,argumentsText:t.argumentsText??null,callId:t.toolUseId??null,command:I(t),kind:`tool_call`,name:t.toolName??`unknown`,raw:N(e,t,`tool_call`),sequence:n,timestamp:e.timestamp,workdir:e.cwd}),R=(e,t,n)=>{let r=t.outputText?.trim();return r?{callId:t.toolUseId??null,exitCode:t.isError?1:null,kind:`tool_output`,outputText:r,raw:N(e,t,`tool_output`),sequence:n,summary:r,timestamp:e.timestamp,wallTime:null}:null},z=(e,t,n)=>{if(t.type===`text`||t.type===`attachment`){let r=t.text?.trim();return r?[P(e,t,n,r)]:[]}if(t.type===`thinking`){let r=F(e,t,n);return r?[r]:[]}if(t.type===`tool_use`)return[L(e,t,n)];if(t.type===`tool_result`){let r=R(e,t,n);return r?[r]:[]}return[]},B=e=>{let t=[],n=0;for(let r of e.entries)for(let e of r.parts)t.push(...z(r,e,n)),n+=1;return t},V=e=>k(e),H=t(),U=e=>[{label:`Session ID`,value:(0,H.jsx)(`span`,{"data-mono":`true`,children:e.session.sessionId})},{label:`Workspace`,value:(0,H.jsx)(r,{className:`text-[var(--accent)]`,params:{workspaceKey:e.session.workspaceKey},to:`/claude-code/$workspaceKey`,children:e.session.workspaceLabel})},{label:`Worktree`,value:e.session.worktree},{label:`CWD`,value:e.session.cwd},{label:`Model`,value:e.session.model??`unknown`},{label:`Version`,value:e.session.version??`unknown`},{label:`Git branch`,value:e.session.gitBranch??`unknown`},{label:`Created`,value:(0,H.jsx)(`span`,{suppressHydrationWarning:!0,children:s(e.session.createdAtMs)})},{label:`Last active`,value:(0,H.jsx)(`span`,{suppressHydrationWarning:!0,children:s(e.session.lastActiveAtMs)})},{label:`Source file`,value:e.session.filePath}],W=(e,t,n)=>[{label:`Event kinds`,value:a([...new Set(t.map(e=>e.kind))])},{label:`Messages`,value:o(n.messageCount)},{label:`User messages`,value:o(n.userMessageCount)},{label:`Assistant messages`,value:o(n.assistantMessageCount)},{label:`Reasoning events`,value:o(t.filter(e=>e.kind===`reasoning`).length)},{label:`Final answers`,value:o(n.finalAnswerCount)},{label:`Tool calls`,value:o(n.toolCallCount)},{label:`Tool outputs`,value:o(n.toolOutputCount)},{label:`Attachments`,value:o(e.session.attachmentCount)},{label:`Renderable parts`,value:o(e.renderablePartCount)}],G=({rawJsonDisabled:e=!1,showCommentary:t,showExtraEvents:n,showRawJson:r,showToolCalls:i,showUserMessages:a,onShowCommentaryChange:o,onShowExtraEventsChange:s,onShowRawJsonChange:c,onShowToolCallsChange:l,onShowUserMessagesChange:d})=>(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-4 rounded-xl border border-[var(--border)] bg-[var(--panel)] px-4 py-3 shadow-[var(--panel-shadow)]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(u,{checked:i,id:`claude-code-transcript-show-tool-calls`,onCheckedChange:e=>l(e===!0)}),(0,H.jsx)(`label`,{htmlFor:`claude-code-transcript-show-tool-calls`,children:`Show tool calls`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(u,{checked:t,id:`claude-code-transcript-show-commentary`,onCheckedChange:e=>o(e===!0)}),(0,H.jsx)(`label`,{htmlFor:`claude-code-transcript-show-commentary`,children:`Show commentary`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(u,{checked:n,id:`claude-code-transcript-show-extra-events`,onCheckedChange:e=>s(e===!0)}),(0,H.jsx)(`label`,{htmlFor:`claude-code-transcript-show-extra-events`,children:`Show extra events`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(u,{checked:r,disabled:e,id:`claude-code-transcript-show-raw-json`,onCheckedChange:e=>c(e===!0)}),(0,H.jsx)(`label`,{htmlFor:`claude-code-transcript-show-raw-json`,children:`Raw JSON`})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,H.jsx)(u,{checked:a,id:`claude-code-transcript-show-user-messages`,onCheckedChange:e=>d(e===!0)}),(0,H.jsx)(`label`,{htmlFor:`claude-code-transcript-show-user-messages`,children:`User`})]})]});function K({detail:e,events:t}){return(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(_,{title:`Session summary`,value:e.session}),(0,H.jsx)(_,{title:`Claude Code entries`,value:e.entries}),(0,H.jsx)(_,{title:`Raw JSONL events`,value:e.rawEvents}),(0,H.jsx)(_,{title:`Transcript events`,value:t})]})}function q(){let e=i(E(T.useParams().sessionId)).data,[t,n]=(0,A.useState)(!1),[r,a]=(0,A.useState)(!1),[s,u]=(0,A.useState)(!1),[_,k]=(0,A.useState)(!1),[j,M]=(0,A.useState)(!1),[N,P]=(0,A.useState)(!0),F=(0,A.useMemo)(()=>B(e),[e]),I=(0,A.useMemo)(()=>V(F),[F]),L=l({mutationFn:async t=>{let n=await C({data:{includeCommentary:t.includeCommentary,includeMetadata:t.includeMetadata,includeTools:t.includeTools,outputFormat:t.outputFormat,sessionId:e.session.sessionId,zipArchive:t.zipArchive}});if(n.mode===`download`){x(n.fileName,n.content,n.mimeType);return}await y(n.fileName,n.downloadUrl)},onSuccess:()=>{n(!1)}});return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(O,{actions:(0,H.jsxs)(w,{className:`rounded-full`,type:`button`,variant:`outline`,onClick:()=>n(!0),children:[(0,H.jsx)(b,{className:`mr-2 size-4`}),`Export`]}),breadcrumb:(0,H.jsx)(f,{items:[{label:`Claude Code`,to:`/claude-code`},{label:e.session.workspaceLabel,params:{workspaceKey:e.session.workspaceKey},to:`/claude-code/$workspaceKey`},{label:e.session.title}]}),eyebrow:`Claude Code session`,subtitle:`Session detail for the selected Claude Code project conversation.`,title:e.session.title}),(0,H.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,H.jsx)(D,{label:`Messages`,value:o(e.session.messageCount)}),(0,H.jsx)(D,{label:`Tool calls`,value:o(e.session.toolCallCount)}),(0,H.jsx)(D,{label:`Tool outputs`,value:o(e.session.toolResultCount)}),(0,H.jsx)(D,{label:`Tokens`,value:c(e.session.totalTokens)})]}),(0,H.jsxs)(v,{className:`space-y-4`,defaultValue:`transcript`,children:[(0,H.jsxs)(g,{className:`grid w-fit min-w-[24rem] grid-cols-3 rounded-full border border-[var(--border)] bg-[var(--panel)] p-1`,children:[(0,H.jsx)(p,{className:`rounded-full px-5 text-sm`,value:`transcript`,children:`Transcript`}),(0,H.jsx)(p,{className:`rounded-full px-5 text-sm`,value:`metadata`,children:`Metadata`}),(0,H.jsx)(p,{className:`rounded-full px-5 text-sm`,value:`raw`,children:`Raw`})]}),(0,H.jsxs)(m,{className:`space-y-3`,value:`transcript`,children:[(0,H.jsx)(G,{rawJsonDisabled:F.length===0,showCommentary:s,showExtraEvents:_,showRawJson:j,showToolCalls:r,showUserMessages:N,onShowCommentaryChange:u,onShowExtraEventsChange:k,onShowRawJsonChange:M,onShowToolCallsChange:a,onShowUserMessagesChange:P}),F.length>0?(0,H.jsx)(d,{assistantModel:e.session.model,events:F,projectPath:e.session.worktree,showCommentary:s,showExtraEvents:_,showRawJson:j,showToolCalls:r,showUserMessages:N}):(0,H.jsxs)(`section`,{className:`rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]`,children:[(0,H.jsx)(`h3`,{className:`font-semibold text-[var(--muted-foreground)] text-sm uppercase tracking-[0.18em]`,children:`Transcript`}),(0,H.jsx)(`p`,{className:`mt-4 text-[var(--muted-foreground)] text-sm`,children:`No renderable Claude Code transcript content was found for this session.`})]})]}),(0,H.jsx)(m,{value:`metadata`,children:(0,H.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[0.95fr_1.05fr]`,children:[(0,H.jsx)(h,{items:U(e),title:`Session metadata`}),(0,H.jsx)(h,{items:W(e,F,I),title:`Transcript stats`})]})}),(0,H.jsx)(m,{value:`raw`,children:(0,H.jsx)(K,{detail:e,events:F})})]}),(0,H.jsx)(S,{errorMessage:L.isError?L.error instanceof Error?L.error.message:`Export failed`:null,open:t,pending:L.isPending,title:`Export ${e.session.title}`,onExport:e=>L.mutate(e),onOpenChange:e=>{n(e),e||L.reset()}})]})}export{q as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{t}from"./reload-error-panel-AHqu0akK.js";var n=e();function r({error:e}){return(0,n.jsx)(t,{description:e.message,title:`Failed to load Claude Code session`})}export{r as errorComponent};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{t}from"./reload-error-panel-AHqu0akK.js";var n=e();function r({error:e}){return(0,n.jsx)(t,{description:e.message,title:`Failed to load Claude Code workspace`})}export{r as errorComponent};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{M as r}from"./createServerFn-B-KkwmHU.js";import{c as i,o as a,r as o,s}from"./formatters-BtqyrX_c.js";import{t as c}from"./useMutation-BSFult2i.js";import{n as l,t as u}from"./data-table-Br78_dk3.js";import{n as d,r as f,t as p}from"./download-Bf0QJKD3.js";import{a as m,i as h,n as g,r as _,t as v}from"./dropdown-menu-D5cvPaZt.js";import{t as y}from"./export-dialog-Dr8d2MqD.js";import{A as b,M as x,a as S,ht as C,j as w,o as T}from"./index-C-STgIH4.js";import{t as E}from"./page-header-Cwa3p6Tl.js";import{n as D,t as O}from"./text-filter-DVAZySUS.js";var k=e(n(),1),A=t(),j=l(),M=[{desc:!0,id:`lastActive`}],N=e=>[j.accessor(`title`,{cell:e=>(0,A.jsxs)(r,{className:`block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{sessionId:e.row.original.sessionId},to:`/claude-code-sessions/$sessionId`,children:[(0,A.jsx)(`p`,{className:`truncate font-medium underline-offset-2 hover:underline`,children:e.getValue()}),(0,A.jsx)(`p`,{className:`truncate text-[var(--muted-foreground)] text-xs`,children:e.row.original.sessionId})]}),header:`Session`}),j.accessor(`lastActiveAtMs`,{cell:e=>(0,A.jsx)(`span`,{className:`whitespace-nowrap text-sm`,children:o(e.getValue(),{timeZone:`UTC`})}),header:`Updated`,id:`lastActive`}),j.accessor(`model`,{cell:e=>(0,A.jsx)(`span`,{className:`text-sm`,children:e.getValue()??`unknown`}),header:`Model`}),j.accessor(`messageCount`,{cell:e=>(0,A.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Messages`}),j.accessor(`toolCallCount`,{cell:e=>(0,A.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Tools`}),j.accessor(`totalTokens`,{cell:e=>(0,A.jsx)(`span`,{className:`whitespace-nowrap font-mono text-sm`,children:s(e.getValue())}),header:`Tokens`}),j.accessor(`version`,{cell:e=>(0,A.jsx)(`span`,{className:`font-mono text-sm`,children:e.getValue()??`unknown`}),header:`Version`}),j.display({cell:t=>(0,A.jsxs)(v,{children:[(0,A.jsx)(h,{asChild:!0,children:(0,A.jsx)(C,{"aria-label":`Actions for ${t.row.original.title}`,className:`rounded-full`,size:`icon`,type:`button`,variant:`ghost`,onClick:e=>e.stopPropagation(),children:(0,A.jsx)(m,{className:`size-4`})})}),(0,A.jsx)(g,{align:`end`,children:(0,A.jsxs)(_,{disabled:t.row.original.renderablePartCount===0,onClick:()=>e(t.row.original),children:[(0,A.jsx)(f,{className:`mr-2 size-4`}),`Export session`]})})]}),enableSorting:!1,header:``,id:`actions`})];function P({onExportSession:e,sessions:t}){return(0,A.jsx)(u,{columns:(0,k.useMemo)(()=>N(e),[e]),data:t,emptyMessage:`No Claude Code sessions match the current workspace filter.`,initialSorting:M})}function F(){let e=S.useParams(),t=i(w()).data,n=T(t,e.workspaceKey),r=i(b(n.key)).data,[a,o]=(0,k.useState)(``),[s,l]=(0,k.useState)(null),u=(0,k.useDeferredValue)(a),f=c({mutationFn:async e=>{if(!s)throw Error(`No Claude Code session selected for export`);let t=await x({data:{includeCommentary:e.includeCommentary,includeMetadata:e.includeMetadata,includeTools:e.includeTools,outputFormat:e.outputFormat,sessionId:s.sessionId,zipArchive:e.zipArchive}});if(t.mode===`download`){p(t.fileName,t.content,t.mimeType);return}await d(t.fileName,t.downloadUrl)},onSuccess:()=>{l(null)}}),m=r.filter(e=>O(u,[e.title,e.sessionId,e.model,e.version,e.gitBranch,e.filePath]));return(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsx)(E,{actions:(0,A.jsx)(D,{placeholder:`Search session title, id, model, or version`,value:a,onValueChange:o}),eyebrow:`Claude Code workspace`,subtitle:`Inspect local Claude Code sessions, user prompts, assistant responses, tool calls, and token totals.`,title:n.label}),(0,A.jsx)(P,{sessions:m,onExportSession:l}),(0,A.jsx)(y,{open:s!==null,pending:f.isPending,title:s?`Export ${s.title}`:`Export session`,onExport:e=>f.mutate(e),onOpenChange:e=>{e||(l(null),f.reset())}}),f.isError?(0,A.jsx)(`p`,{className:`text-[var(--destructive)] text-sm`,children:f.error instanceof Error?f.error.message:`Session export failed`}):null]})}export{F as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-DGeXAQPT.js";import{t}from"./reload-error-panel-AHqu0akK.js";var n=e();function r({error:e}){return(0,n.jsx)(t,{description:e.message,title:`Failed to load Claude Code workspaces`})}export{r as errorComponent};
@@ -0,0 +1 @@
1
+ import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{n}from"./react-dom-DL96Jor4.js";import{M as r}from"./createServerFn-B-KkwmHU.js";import{c as i,o as a,r as o}from"./formatters-BtqyrX_c.js";import{n as s,t as c}from"./data-table-Br78_dk3.js";import{j as l}from"./index-C-STgIH4.js";import{t as u}from"./page-header-Cwa3p6Tl.js";import{n as d,t as f}from"./text-filter-DVAZySUS.js";var p=e(n()),m=t(),h=s(),g=[h.accessor(`label`,{cell:e=>(0,m.jsxs)(r,{className:`block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto`,params:{workspaceKey:e.row.original.key},to:`/claude-code/$workspaceKey`,children:[(0,m.jsx)(`p`,{className:`truncate font-medium underline-offset-2 hover:underline`,children:e.getValue()}),(0,m.jsx)(`p`,{className:`truncate text-[var(--muted-foreground)] text-xs`,children:e.row.original.worktree})]}),header:`Workspace`}),h.accessor(`sessionCount`,{cell:e=>(0,m.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Sessions`}),h.accessor(`messageCount`,{cell:e=>(0,m.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Messages`}),h.accessor(`toolCallCount`,{cell:e=>(0,m.jsx)(`span`,{className:`font-mono text-sm`,children:a(e.getValue())}),header:`Tool calls`}),h.accessor(`lastActiveAtMs`,{cell:e=>(0,m.jsx)(`span`,{className:`whitespace-nowrap text-sm`,children:o(e.getValue(),{timeZone:`UTC`})}),header:`Last active`})];function _({workspaces:e}){return(0,m.jsx)(c,{columns:g,data:e,emptyMessage:`No Claude Code workspaces match the current search.`})}function v(){let e=i(l()).data,[t,n]=(0,p.useState)(``),r=(0,p.useDeferredValue)(t),a=e.filter(e=>f(r,[e.label,e.worktree,e.key,e.directoryName]));return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(u,{actions:(0,m.jsx)(d,{placeholder:`Search workspace name or path`,value:t,onValueChange:n}),eyebrow:`Inventory`,subtitle:`Workspace groups are derived from local Claude Code project JSONL transcripts.`,title:`Claude Code`}),(0,m.jsx)(_,{workspaces:a})]})}export{v as component};