spiracha 1.4.0 → 2.0.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.
- package/AGENTS.md +116 -164
- package/README.md +92 -237
- package/apps/ui/AGENTS.md +36 -7
- package/apps/ui/README.md +79 -6
- package/apps/ui/components.json +21 -0
- package/apps/ui/package.json +65 -0
- package/apps/ui/{dist/client → public}/icon.svg +2 -1
- package/apps/ui/src/components/antigravity-conversations-table.tsx +206 -0
- package/apps/ui/src/components/antigravity-keychain-panel.tsx +76 -0
- package/apps/ui/src/components/antigravity-workspaces-table.tsx +63 -0
- package/apps/ui/src/components/app-shell.tsx +124 -0
- package/apps/ui/src/components/breadcrumbs.tsx +53 -0
- package/apps/ui/src/components/claude-code-sessions-table.tsx +114 -0
- package/apps/ui/src/components/claude-code-workspaces-table.tsx +55 -0
- package/apps/ui/src/components/cursor-threads-table.tsx +189 -0
- package/apps/ui/src/components/cursor-workspaces-table.tsx +140 -0
- package/apps/ui/src/components/data-table.tsx +241 -0
- package/apps/ui/src/components/delete-confirm-dialog.tsx +88 -0
- package/apps/ui/src/components/export-dialog.tsx +184 -0
- package/apps/ui/src/components/json-panel.tsx +17 -0
- package/apps/ui/src/components/kiro-sessions-table.tsx +112 -0
- package/apps/ui/src/components/kiro-workspaces-table.tsx +53 -0
- package/apps/ui/src/components/list-search-input.tsx +18 -0
- package/apps/ui/src/components/loading-panel.tsx +23 -0
- package/apps/ui/src/components/metadata-section.tsx +31 -0
- package/apps/ui/src/components/metric-card.tsx +19 -0
- package/apps/ui/src/components/opencode-sessions-table.tsx +128 -0
- package/apps/ui/src/components/opencode-workspaces-table.tsx +57 -0
- package/apps/ui/src/components/page-header.tsx +33 -0
- package/apps/ui/src/components/projects-loading-state.tsx +74 -0
- package/apps/ui/src/components/projects-table.tsx +108 -0
- package/apps/ui/src/components/qoder-sessions-table.tsx +112 -0
- package/apps/ui/src/components/qoder-workspaces-table.tsx +53 -0
- package/apps/ui/src/components/recent-threads-list.tsx +52 -0
- package/apps/ui/src/components/reload-error-panel.tsx +20 -0
- package/apps/ui/src/components/text-document-panel.tsx +19 -0
- package/apps/ui/src/components/theme-toggle.tsx +48 -0
- package/apps/ui/src/components/threads-table.tsx +202 -0
- package/apps/ui/src/components/transcript-view.tsx +552 -0
- package/apps/ui/src/components/ui/alert-dialog.tsx +160 -0
- package/apps/ui/src/components/ui/badge.tsx +45 -0
- package/apps/ui/src/components/ui/button.tsx +62 -0
- package/apps/ui/src/components/ui/checkbox.tsx +29 -0
- package/apps/ui/src/components/ui/dialog.tsx +137 -0
- package/apps/ui/src/components/ui/dropdown-menu.tsx +217 -0
- package/apps/ui/src/components/ui/input.tsx +21 -0
- package/apps/ui/src/components/ui/scroll-area.tsx +46 -0
- package/apps/ui/src/components/ui/select.tsx +163 -0
- package/apps/ui/src/components/ui/separator.tsx +28 -0
- package/apps/ui/src/components/ui/sheet.tsx +107 -0
- package/apps/ui/src/components/ui/skeleton.tsx +7 -0
- package/apps/ui/src/components/ui/table.tsx +76 -0
- package/apps/ui/src/components/ui/tabs.tsx +71 -0
- package/apps/ui/src/components/ui/tooltip.tsx +44 -0
- package/apps/ui/src/integrations/tanstack-query/devtools.tsx +6 -0
- package/apps/ui/src/integrations/tanstack-query/root-provider.tsx +10 -0
- package/apps/ui/src/lib/antigravity-conversation-state.ts +28 -0
- package/apps/ui/src/lib/antigravity-queries.ts +33 -0
- package/apps/ui/src/lib/antigravity-server.ts +128 -0
- package/apps/ui/src/lib/antigravity-transcript-events.ts +335 -0
- package/apps/ui/src/lib/claude-code-queries.ts +26 -0
- package/apps/ui/src/lib/claude-code-server.ts +75 -0
- package/apps/ui/src/lib/claude-code-transcript-events.ts +154 -0
- package/apps/ui/src/lib/codex-queries.ts +66 -0
- package/apps/ui/src/lib/codex-server.ts +209 -0
- package/apps/ui/src/lib/cursor-queries.ts +37 -0
- package/apps/ui/src/lib/cursor-server.ts +272 -0
- package/apps/ui/src/lib/cursor-transcript-events.ts +229 -0
- package/apps/ui/src/lib/download.ts +166 -0
- package/apps/ui/src/lib/formatters.ts +149 -0
- package/apps/ui/src/lib/kiro-queries.ts +22 -0
- package/apps/ui/src/lib/kiro-server.ts +73 -0
- package/apps/ui/src/lib/kiro-transcript-events.ts +113 -0
- package/apps/ui/src/lib/opencode-queries.ts +37 -0
- package/apps/ui/src/lib/opencode-server.ts +73 -0
- package/apps/ui/src/lib/opencode-transcript-events.ts +221 -0
- package/apps/ui/src/lib/package-metadata.ts +16 -0
- package/apps/ui/src/lib/path-utils.ts +13 -0
- package/apps/ui/src/lib/qoder-queries.ts +22 -0
- package/apps/ui/src/lib/qoder-server.ts +79 -0
- package/apps/ui/src/lib/qoder-transcript-events.ts +139 -0
- package/apps/ui/src/lib/route-search.ts +68 -0
- package/apps/ui/src/lib/settings-store.tsx +59 -0
- package/apps/ui/src/lib/source-session-export-server.ts +56 -0
- package/apps/ui/src/lib/text-filter.ts +22 -0
- package/apps/ui/src/lib/thread-id.ts +3 -0
- package/apps/ui/src/lib/thread-transcript-stats.ts +57 -0
- package/apps/ui/src/lib/utils.ts +7 -0
- package/apps/ui/src/routeTree.gen.ts +730 -0
- package/apps/ui/src/router.tsx +20 -0
- package/apps/ui/src/routes/$threadId.tsx +22 -0
- package/apps/ui/src/routes/__root.tsx +127 -0
- package/apps/ui/src/routes/analytics.tsx +143 -0
- package/apps/ui/src/routes/antigravity-conversations.$conversationId.tsx +438 -0
- package/apps/ui/src/routes/antigravity.$workspaceKey.tsx +127 -0
- package/apps/ui/src/routes/antigravity.index.tsx +51 -0
- package/apps/ui/src/routes/api.v1.conversation-query.ts +12 -0
- package/apps/ui/src/routes/api.v1.conversations.$source.$id.export.ts +12 -0
- package/apps/ui/src/routes/api.v1.conversations.$source.$id.ts +12 -0
- package/apps/ui/src/routes/api.v1.conversations.ts +12 -0
- package/apps/ui/src/routes/api.v1.resolve.ts +12 -0
- package/apps/ui/src/routes/api.v1.sources.ts +12 -0
- package/apps/ui/src/routes/claude-code-sessions.$sessionId.tsx +342 -0
- package/apps/ui/src/routes/claude-code.$workspaceKey.tsx +135 -0
- package/apps/ui/src/routes/claude-code.index.tsx +48 -0
- package/apps/ui/src/routes/codex.$project.tsx +390 -0
- package/apps/ui/src/routes/codex.index.tsx +116 -0
- package/apps/ui/src/routes/cursor-threads.$composerId.tsx +435 -0
- package/apps/ui/src/routes/cursor.$workspaceKey.tsx +416 -0
- package/apps/ui/src/routes/cursor.index.tsx +120 -0
- package/apps/ui/src/routes/index.tsx +124 -0
- package/apps/ui/src/routes/kiro-sessions.$sessionId.tsx +345 -0
- package/apps/ui/src/routes/kiro.$workspaceKey.tsx +136 -0
- package/apps/ui/src/routes/kiro.index.tsx +48 -0
- package/apps/ui/src/routes/opencode-sessions.$sessionId.tsx +334 -0
- package/apps/ui/src/routes/opencode.$workspaceKey.tsx +135 -0
- package/apps/ui/src/routes/opencode.index.tsx +48 -0
- package/apps/ui/src/routes/qoder-sessions.$sessionId.tsx +341 -0
- package/apps/ui/src/routes/qoder.$workspaceKey.tsx +139 -0
- package/apps/ui/src/routes/qoder.index.tsx +48 -0
- package/apps/ui/src/routes/settings.tsx +91 -0
- package/apps/ui/src/routes/threads.$threadId.tsx +619 -0
- package/apps/ui/src/styles.css +122 -0
- package/apps/ui/tsconfig.json +29 -0
- package/apps/ui/vite.config.ts +84 -0
- package/bin/spiracha.ts +32 -0
- package/package.json +50 -60
- package/src/client.ts +290 -0
- package/src/lib/antigravity-db.ts +213 -19
- package/src/lib/antigravity-exporter-types.ts +1 -0
- package/src/lib/claude-code-db.ts +655 -0
- package/src/lib/claude-code-exporter-types.ts +110 -0
- package/src/lib/claude-code-transcript-phase.ts +25 -0
- package/src/lib/claude-code-transcript.ts +180 -0
- package/src/lib/codex-analytics.ts +1 -1
- package/src/lib/codex-browser-db.ts +856 -61
- package/src/lib/codex-browser-export.ts +24 -16
- package/src/lib/codex-browser-types.ts +1 -1
- package/src/lib/codex-thread-cache.ts +17 -1
- package/src/lib/{codex-exporter-types.ts → codex-thread-types.ts} +2 -30
- package/src/lib/{codex-exporter-transcript.ts → codex-transcript-renderer.ts} +64 -28
- package/src/lib/concurrency.ts +25 -0
- package/src/lib/conversation-api.ts +792 -0
- package/src/lib/conversation-data/adapter-helpers.ts +110 -0
- package/src/lib/conversation-data/antigravity-adapter.ts +148 -0
- package/src/lib/conversation-data/claude-code-adapter.ts +175 -0
- package/src/lib/conversation-data/codex-adapter.ts +245 -0
- package/src/lib/conversation-data/cursor-adapter.ts +171 -0
- package/src/lib/conversation-data/index.ts +311 -0
- package/src/lib/conversation-data/kiro-adapter.ts +140 -0
- package/src/lib/conversation-data/message-selector.ts +37 -0
- package/src/lib/conversation-data/opencode-adapter.ts +180 -0
- package/src/lib/conversation-data/path-match.ts +79 -0
- package/src/lib/conversation-data/qoder-adapter.ts +230 -0
- package/src/lib/conversation-data/types.ts +116 -0
- package/src/lib/cursor-db.ts +67 -21
- package/src/lib/cursor-exporter-types.ts +0 -19
- package/src/lib/kiro-db.ts +949 -0
- package/src/lib/kiro-exporter-types.ts +100 -0
- package/src/lib/kiro-transcript-phase.ts +41 -0
- package/src/lib/kiro-transcript.ts +115 -0
- package/src/lib/opencode-db.ts +610 -0
- package/src/lib/opencode-exporter-types.ts +129 -0
- package/src/lib/opencode-think-tags.ts +126 -0
- package/src/lib/opencode-transcript-phase.ts +50 -0
- package/src/lib/opencode-transcript.ts +194 -0
- package/src/lib/qoder-acp-client.ts +268 -0
- package/src/lib/qoder-db.ts +1601 -0
- package/src/lib/qoder-exporter-types.ts +114 -0
- package/src/lib/qoder-transcript-phase.ts +41 -0
- package/src/lib/qoder-transcript.ts +112 -0
- package/src/lib/shared.ts +25 -0
- package/src/lib/ui-export-archive.ts +61 -0
- package/apps/ui/dist/client/assets/_threadId-CAIeH5mq.js +0 -1
- package/apps/ui/dist/client/assets/analytics-DK2jdvmI.js +0 -1
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-DmD0sN8X.js +0 -7
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-KAcXtNxI.js +0 -1
- package/apps/ui/dist/client/assets/antigravity-keychain-panel-BRHVjFAM.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-ByitGWki.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-CGV7amas.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-DEEkjlZa.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-DgW25FEV.js +0 -1
- package/apps/ui/dist/client/assets/badge-DfWvPfKF.js +0 -1
- package/apps/ui/dist/client/assets/checkbox-CdHitXWQ.js +0 -1
- package/apps/ui/dist/client/assets/createServerFn-CgRRVpBH.js +0 -3
- package/apps/ui/dist/client/assets/cursor-threads._composerId-CmBFclK8.js +0 -1
- package/apps/ui/dist/client/assets/cursor-threads._composerId-Ti2gTm63.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-CaAZjGmm.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-DzD_c6j9.js +0 -1
- package/apps/ui/dist/client/assets/cursor.index-CrnMwDCi.js +0 -1
- package/apps/ui/dist/client/assets/cursor.index-PkCFVcl4.js +0 -2
- package/apps/ui/dist/client/assets/data-table-Br78_dk3.js +0 -4
- package/apps/ui/dist/client/assets/delete-confirm-dialog-BHRmyLHr.js +0 -11
- package/apps/ui/dist/client/assets/dist-B9pyYCVU.js +0 -1
- package/apps/ui/dist/client/assets/dist-BhZOxAPP.js +0 -1
- package/apps/ui/dist/client/assets/dist-DvMS2965.js +0 -1
- package/apps/ui/dist/client/assets/download-Bf0QJKD3.js +0 -1
- package/apps/ui/dist/client/assets/dropdown-menu-Dy5cLzTy.js +0 -1
- package/apps/ui/dist/client/assets/es2015-BkCWttyM.js +0 -41
- package/apps/ui/dist/client/assets/export-dialog-C86SYHJn.js +0 -1
- package/apps/ui/dist/client/assets/formatters-BM9kB7ed.js +0 -1
- package/apps/ui/dist/client/assets/index-CPvAP-jk.js +0 -149
- package/apps/ui/dist/client/assets/jsx-runtime-DGeXAQPT.js +0 -1
- package/apps/ui/dist/client/assets/metric-card-Dplm0ZiM.js +0 -1
- package/apps/ui/dist/client/assets/page-header-Cwa3p6Tl.js +0 -1
- package/apps/ui/dist/client/assets/projects._project-Ckf6muWZ.js +0 -1
- package/apps/ui/dist/client/assets/projects._project-DSDwH4NF.js +0 -1
- package/apps/ui/dist/client/assets/projects.index-DEfhWqa8.js +0 -1
- package/apps/ui/dist/client/assets/projects.index-V5ibNZII.js +0 -3
- package/apps/ui/dist/client/assets/react-dom-DL96Jor4.js +0 -1
- package/apps/ui/dist/client/assets/refresh-ccw-BgKjOiA6.js +0 -1
- package/apps/ui/dist/client/assets/reload-error-panel-AHqu0akK.js +0 -1
- package/apps/ui/dist/client/assets/routes-Df2tgpyd.js +0 -1
- package/apps/ui/dist/client/assets/scroll-text-fM0sMOB3.js +0 -1
- package/apps/ui/dist/client/assets/select-Bf2GwfPR.js +0 -1
- package/apps/ui/dist/client/assets/settings-5VQIzME0.js +0 -1
- package/apps/ui/dist/client/assets/sqlite-error-B6uZjUe8.js +0 -1
- package/apps/ui/dist/client/assets/styles-BhRkXgwB.css +0 -1
- package/apps/ui/dist/client/assets/tabs-OO4VU5KR.js +0 -7
- package/apps/ui/dist/client/assets/text-filter-DVAZySUS.js +0 -2
- package/apps/ui/dist/client/assets/threads._threadId-BB9tTsV4.js +0 -1
- package/apps/ui/dist/client/assets/threads._threadId-BgDhFj2I.js +0 -1
- package/apps/ui/dist/client/assets/useMutation-CC_B7uy5.js +0 -1
- package/apps/ui/dist/client/assets/useQuery-C5By6WKU.js +0 -1
- package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CRW2kqj0.js +0 -232
- package/apps/ui/dist/server/assets/_threadId-B6SrBR9E.js +0 -6
- package/apps/ui/dist/server/assets/analytics-CYP_LT5Y.js +0 -16
- package/apps/ui/dist/server/assets/analytics-CtpOMVMO.js +0 -146
- package/apps/ui/dist/server/assets/antigravity-conversation-state-HgzS302O.js +0 -16
- package/apps/ui/dist/server/assets/antigravity-conversations._conversationId-BtexWY-K.js +0 -613
- package/apps/ui/dist/server/assets/antigravity-conversations._conversationId-D426O-64.js +0 -11
- package/apps/ui/dist/server/assets/antigravity-conversations._conversationId-zMrR6v6R.js +0 -20
- package/apps/ui/dist/server/assets/antigravity-db-Bh8_U9uw.js +0 -580
- package/apps/ui/dist/server/assets/antigravity-keychain-DOiuHDwK.js +0 -126
- package/apps/ui/dist/server/assets/antigravity-keychain-panel-CC7FLmAK.js +0 -55
- package/apps/ui/dist/server/assets/antigravity-queries-CGrJO9Vr.js +0 -37
- package/apps/ui/dist/server/assets/antigravity-server-CHRjVFqN.js +0 -114
- package/apps/ui/dist/server/assets/antigravity._workspaceKey-3m_MzNFA.js +0 -11
- package/apps/ui/dist/server/assets/antigravity._workspaceKey-B0QeYUOh.js +0 -28
- package/apps/ui/dist/server/assets/antigravity._workspaceKey-C3kP-qyN.js +0 -210
- package/apps/ui/dist/server/assets/antigravity.index-CPCYkqCi.js +0 -104
- package/apps/ui/dist/server/assets/antigravity.index-DudTB3Tq.js +0 -11
- package/apps/ui/dist/server/assets/badge-EvdhKK_Z.js +0 -26
- package/apps/ui/dist/server/assets/button-CmTDnzOn.js +0 -46
- package/apps/ui/dist/server/assets/checkbox-C0hovF41.js +0 -19
- package/apps/ui/dist/server/assets/codex-queries-CtgeZ7VL.js +0 -99
- package/apps/ui/dist/server/assets/codex-server-CNXSJuc2.js +0 -2004
- package/apps/ui/dist/server/assets/concurrency-VXtYvlGh.js +0 -18
- package/apps/ui/dist/server/assets/createServerRpc-CF_DEwnm.js +0 -12
- package/apps/ui/dist/server/assets/createSsrRpc-C754NPki.js +0 -16
- package/apps/ui/dist/server/assets/cursor-db-cYZEU3WQ.js +0 -830
- package/apps/ui/dist/server/assets/cursor-exporter-types-CI3goo-c.js +0 -34
- package/apps/ui/dist/server/assets/cursor-queries-NCIM0Nat.js +0 -67
- package/apps/ui/dist/server/assets/cursor-recovery-nq-kR62j.js +0 -361
- package/apps/ui/dist/server/assets/cursor-server-C3q7hrp-.js +0 -213
- package/apps/ui/dist/server/assets/cursor-threads._composerId-BB0Y_Mao.js +0 -11
- package/apps/ui/dist/server/assets/cursor-threads._composerId-BPJFWfJj.js +0 -18
- package/apps/ui/dist/server/assets/cursor-threads._composerId-BkMMTQ3v.js +0 -582
- package/apps/ui/dist/server/assets/cursor-transcript-2iL3KFSK.js +0 -125
- package/apps/ui/dist/server/assets/cursor._workspaceKey-C5PdTaKB.js +0 -28
- package/apps/ui/dist/server/assets/cursor._workspaceKey-Ckj7apKI.js +0 -401
- package/apps/ui/dist/server/assets/cursor._workspaceKey-nmg3YIOQ.js +0 -11
- package/apps/ui/dist/server/assets/cursor.index-CcsX7DG0.js +0 -11
- package/apps/ui/dist/server/assets/cursor.index-DkWT-mxw.js +0 -189
- package/apps/ui/dist/server/assets/data-table-Cdct823O.js +0 -189
- package/apps/ui/dist/server/assets/delete-confirm-dialog-BcBNCxWB.js +0 -144
- package/apps/ui/dist/server/assets/download-DMmiy1xf.js +0 -92
- package/apps/ui/dist/server/assets/dropdown-menu-Dy_9t6TN.js +0 -36
- package/apps/ui/dist/server/assets/empty-plugin-adapters-B3lHh1La.js +0 -5
- package/apps/ui/dist/server/assets/export-dialog-BItjWgkZ.js +0 -240
- package/apps/ui/dist/server/assets/formatters-FJaGZgJk.js +0 -91
- package/apps/ui/dist/server/assets/loading-panel-BGFnWseS.js +0 -27
- package/apps/ui/dist/server/assets/metric-card-ByEeLu0r.js +0 -23
- package/apps/ui/dist/server/assets/model-label-B1NWGc65.js +0 -13
- package/apps/ui/dist/server/assets/page-header-VNSaM3xd.js +0 -29
- package/apps/ui/dist/server/assets/path-transforms-DL2IwtYd.js +0 -31
- package/apps/ui/dist/server/assets/projects._project-Bpbc3C-L.js +0 -20
- package/apps/ui/dist/server/assets/projects._project-Bshqk7JA.js +0 -12
- package/apps/ui/dist/server/assets/projects._project-CvZho6EQ.js +0 -395
- package/apps/ui/dist/server/assets/projects.index-BLXOx5eL.js +0 -12
- package/apps/ui/dist/server/assets/projects.index-BkLiF2FF.js +0 -182
- package/apps/ui/dist/server/assets/projects.index-DesYXwfi.js +0 -14
- package/apps/ui/dist/server/assets/reload-error-panel-BJMxY3U1.js +0 -25
- package/apps/ui/dist/server/assets/route-search-ts4W9MJ9.js +0 -38
- package/apps/ui/dist/server/assets/router-6m-ihwqA.js +0 -410
- package/apps/ui/dist/server/assets/routes-Bsact1uB.js +0 -184
- package/apps/ui/dist/server/assets/routes-BzkJgq4W.js +0 -34
- package/apps/ui/dist/server/assets/select-GW76p-ld.js +0 -76
- package/apps/ui/dist/server/assets/settings-OayxIYQQ.js +0 -100
- package/apps/ui/dist/server/assets/settings-store-DpEJEQ7M.js +0 -52
- package/apps/ui/dist/server/assets/shared-CPRNYIql.js +0 -134
- package/apps/ui/dist/server/assets/sqlite-error-LZDrnxdd.js +0 -13
- package/apps/ui/dist/server/assets/start-CI_0bSiY.js +0 -4
- package/apps/ui/dist/server/assets/tabs-CGA13IZM.js +0 -502
- package/apps/ui/dist/server/assets/text-filter-CGKxMCKt.js +0 -36
- package/apps/ui/dist/server/assets/threads._threadId-BSSK4nkI.js +0 -26
- package/apps/ui/dist/server/assets/threads._threadId-Bs0yuqO9.js +0 -18
- package/apps/ui/dist/server/assets/threads._threadId-D2GYkVn6.js +0 -639
- package/apps/ui/dist/server/assets/ui-export-files-BHLX9bhN.js +0 -83
- package/apps/ui/dist/server/assets/utils-C_uf36nf.js +0 -8
- package/apps/ui/dist/server/server.js +0 -5847
- package/bin/codex-chats-claude.js +0 -5
- package/bin/codex-chats.js +0 -5
- package/bin/spiracha.js +0 -5
- package/src/export-chats.ts +0 -120
- package/src/export-claude.ts +0 -36
- package/src/export-cursor.ts +0 -244
- package/src/lib/claude-exporter.ts +0 -864
- package/src/lib/codex-exporter-cli.ts +0 -277
- package/src/lib/codex-exporter-db.ts +0 -319
- package/src/lib/codex-exporter.ts +0 -115
- package/src/lib/cursor-exporter.ts +0 -266
- package/src/lib/interactive-cli.ts +0 -433
- package/src/lib/native-open.ts +0 -54
- package/src/mcp-server.ts +0 -137
- package/src/spiracha.ts +0 -116
- package/src/ui-cli.ts +0 -310
- /package/apps/ui/{dist/client → public}/manifest.json +0 -0
- /package/apps/ui/{dist/client → public}/robots.txt +0 -0
|
@@ -1,639 +0,0 @@
|
|
|
1
|
-
import { t as Button } from "./button-CmTDnzOn.js";
|
|
2
|
-
import { n as useSettings } from "./settings-store-DpEJEQ7M.js";
|
|
3
|
-
import { a as threadSnapshotQueryOptions, c as deleteThreadFn, o as threadTranscriptQueryOptions, u as exportThreadFn } from "./codex-queries-CtgeZ7VL.js";
|
|
4
|
-
import { t as Route } from "./threads._threadId-Bs0yuqO9.js";
|
|
5
|
-
import { t as Checkbox } from "./checkbox-C0hovF41.js";
|
|
6
|
-
import { t as MetricCard } from "./metric-card-ByEeLu0r.js";
|
|
7
|
-
import { t as PageHeader } from "./page-header-VNSaM3xd.js";
|
|
8
|
-
import { i as formatList, n as formatBytes, r as formatDateTime, s as formatTokens, t as formatBooleanLabel } from "./formatters-FJaGZgJk.js";
|
|
9
|
-
import { a as TranscriptView, c as Breadcrumbs, i as TabsTrigger, n as TabsContent, o as MetadataSection, r as TabsList, s as JsonPanel, t as Tabs } from "./tabs-CGA13IZM.js";
|
|
10
|
-
import { t as Badge } from "./badge-EvdhKK_Z.js";
|
|
11
|
-
import { n as downloadUrlFile, t as downloadTextFile } from "./download-DMmiy1xf.js";
|
|
12
|
-
import { t as DeleteConfirmDialog } from "./delete-confirm-dialog-BcBNCxWB.js";
|
|
13
|
-
import { t as ExportDialog } from "./export-dialog-BItjWgkZ.js";
|
|
14
|
-
import { useState } from "react";
|
|
15
|
-
import { Link, useNavigate } from "@tanstack/react-router";
|
|
16
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { useMutation, useQuery, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
18
|
-
import { Download, Trash2 } from "lucide-react";
|
|
19
|
-
//#region src/routes/threads.$threadId.tsx?tsr-split=component
|
|
20
|
-
var buildThreadItems = (snapshot) => {
|
|
21
|
-
return [
|
|
22
|
-
{
|
|
23
|
-
label: "Thread ID",
|
|
24
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
25
|
-
"data-mono": "true",
|
|
26
|
-
children: snapshot.thread.id
|
|
27
|
-
})
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
label: "Project",
|
|
31
|
-
value: snapshot.project
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
label: "CWD",
|
|
35
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
36
|
-
"data-mono": "true",
|
|
37
|
-
children: snapshot.thread.cwd
|
|
38
|
-
})
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
label: "Created",
|
|
42
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
43
|
-
suppressHydrationWarning: true,
|
|
44
|
-
children: formatDateTime(snapshot.thread.created_at_ms ?? snapshot.thread.created_at * 1e3)
|
|
45
|
-
})
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "Updated",
|
|
49
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
50
|
-
suppressHydrationWarning: true,
|
|
51
|
-
children: formatDateTime(snapshot.thread.updated_at_ms ?? snapshot.thread.updated_at * 1e3)
|
|
52
|
-
})
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
label: "Session started",
|
|
56
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
57
|
-
suppressHydrationWarning: true,
|
|
58
|
-
children: formatDateTime(snapshot.transcript?.sessionMeta.timestamp ?? null)
|
|
59
|
-
})
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
label: "Rollout size",
|
|
63
|
-
value: formatBytes(snapshot.rollout.fileSizeBytes)
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
label: "Archived",
|
|
67
|
-
value: formatBooleanLabel(Boolean(snapshot.thread.archived))
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: "Archived at",
|
|
71
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
72
|
-
suppressHydrationWarning: true,
|
|
73
|
-
children: formatDateTime(snapshot.thread.archived_at ? snapshot.thread.archived_at * 1e3 : null)
|
|
74
|
-
})
|
|
75
|
-
}
|
|
76
|
-
];
|
|
77
|
-
};
|
|
78
|
-
var buildRuntimeItems = (snapshot) => {
|
|
79
|
-
return [
|
|
80
|
-
{
|
|
81
|
-
label: "Source",
|
|
82
|
-
value: snapshot.thread.source
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
label: "Originator",
|
|
86
|
-
value: snapshot.transcript?.sessionMeta.originator ?? "n/a"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
label: "Model provider",
|
|
90
|
-
value: snapshot.thread.model_provider
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
label: "Reasoning effort",
|
|
94
|
-
value: snapshot.thread.reasoning_effort ?? "n/a"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
label: "CLI version",
|
|
98
|
-
value: snapshot.thread.cli_version
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
label: "Approval mode",
|
|
102
|
-
value: snapshot.thread.approval_mode
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
label: "Memory mode",
|
|
106
|
-
value: snapshot.thread.memory_mode
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
label: "Has user event",
|
|
110
|
-
value: formatBooleanLabel(Boolean(snapshot.thread.has_user_event))
|
|
111
|
-
}
|
|
112
|
-
];
|
|
113
|
-
};
|
|
114
|
-
var buildGitItems = (snapshot) => {
|
|
115
|
-
return [
|
|
116
|
-
{
|
|
117
|
-
label: "Git branch",
|
|
118
|
-
value: snapshot.thread.git_branch ?? "n/a"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
label: "Git SHA",
|
|
122
|
-
value: snapshot.thread.git_sha ?? "n/a"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
label: "Git remote",
|
|
126
|
-
value: snapshot.thread.git_origin_url ?? "n/a"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
label: "Agent nickname",
|
|
130
|
-
value: snapshot.thread.agent_nickname ?? "n/a"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
label: "Agent role",
|
|
134
|
-
value: snapshot.thread.agent_role ?? "n/a"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
label: "Agent path",
|
|
138
|
-
value: snapshot.thread.agent_path ?? "n/a"
|
|
139
|
-
}
|
|
140
|
-
];
|
|
141
|
-
};
|
|
142
|
-
var buildRelationItems = (snapshot) => {
|
|
143
|
-
const parentThreadValue = snapshot.relations.parentThreadId ? /* @__PURE__ */ jsx(Link, {
|
|
144
|
-
className: "text-[var(--accent)]",
|
|
145
|
-
params: { threadId: snapshot.relations.parentThreadId },
|
|
146
|
-
to: "/threads/$threadId",
|
|
147
|
-
children: snapshot.relations.parentThreadId
|
|
148
|
-
}) : "n/a";
|
|
149
|
-
const childThreadValue = snapshot.relations.childEdges.length > 0 ? /* @__PURE__ */ jsx("div", {
|
|
150
|
-
className: "flex flex-wrap gap-2",
|
|
151
|
-
children: snapshot.relations.childEdges.map((edge) => /* @__PURE__ */ jsx(Link, {
|
|
152
|
-
className: "rounded-full border border-[var(--border)] px-3 py-1 text-[var(--accent)] text-xs",
|
|
153
|
-
params: { threadId: edge.child_thread_id },
|
|
154
|
-
to: "/threads/$threadId",
|
|
155
|
-
children: edge.child_thread_id
|
|
156
|
-
}, edge.child_thread_id))
|
|
157
|
-
}) : "n/a";
|
|
158
|
-
return [
|
|
159
|
-
{
|
|
160
|
-
label: "Parent thread",
|
|
161
|
-
value: parentThreadValue
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
label: "Child threads",
|
|
165
|
-
value: childThreadValue
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
label: "First user message",
|
|
169
|
-
value: snapshot.thread.first_user_message || "n/a"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
label: "Preview",
|
|
173
|
-
value: snapshot.thread.preview || "n/a"
|
|
174
|
-
}
|
|
175
|
-
];
|
|
176
|
-
};
|
|
177
|
-
var buildTranscriptStatsItems = (snapshot) => {
|
|
178
|
-
if (!snapshot.transcript) {
|
|
179
|
-
if (snapshot.transcriptState === "missing") return [
|
|
180
|
-
{
|
|
181
|
-
label: "Transcript load",
|
|
182
|
-
value: "Transcript file missing from disk"
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
label: "Rollout path",
|
|
186
|
-
value: snapshot.thread.rollout_path
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
label: "Preview mode",
|
|
190
|
-
value: "Export and transcript browsing are unavailable until the file exists again."
|
|
191
|
-
}
|
|
192
|
-
];
|
|
193
|
-
return [
|
|
194
|
-
{
|
|
195
|
-
label: "Transcript load",
|
|
196
|
-
value: "Deferred for oversized rollout"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
label: "Rollout size",
|
|
200
|
-
value: formatBytes(snapshot.rollout.fileSizeBytes)
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
label: "Preview mode",
|
|
204
|
-
value: "Load the transcript manually to inspect it."
|
|
205
|
-
}
|
|
206
|
-
];
|
|
207
|
-
}
|
|
208
|
-
return [
|
|
209
|
-
{
|
|
210
|
-
label: "Event kinds",
|
|
211
|
-
value: formatList([...new Set(snapshot.transcript.events.map((event) => event.kind))])
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
label: "Stats scope",
|
|
215
|
-
value: snapshot.transcript.statsArePartial ? "Preview only" : "Full transcript"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
label: "Tool calls",
|
|
219
|
-
value: String(snapshot.transcript.stats.toolCallCount)
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
label: "Exec calls",
|
|
223
|
-
value: String(snapshot.transcript.stats.execCommandCount)
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
label: "Web search events",
|
|
227
|
-
value: String(snapshot.transcript.stats.webSearchEventCount)
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
label: "Assistant messages",
|
|
231
|
-
value: String(snapshot.transcript.stats.assistantMessageCount)
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
label: "Commentary updates",
|
|
235
|
-
value: String(snapshot.transcript.stats.commentaryCount)
|
|
236
|
-
}
|
|
237
|
-
];
|
|
238
|
-
};
|
|
239
|
-
function TranscriptControls({ rawJsonDisabled = false, showCommentary, showExtraEvents, showRawJson, showToolCalls, showUserMessages, onShowCommentaryChange, onShowExtraEventsChange, onShowRawJsonChange, onShowToolCallsChange, onShowUserMessagesChange }) {
|
|
240
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
241
|
-
className: "flex flex-wrap gap-4 rounded-xl border border-[var(--border)] bg-[var(--panel)] px-4 py-3 shadow-[var(--panel-shadow)]",
|
|
242
|
-
children: [
|
|
243
|
-
/* @__PURE__ */ jsxs("div", {
|
|
244
|
-
className: "flex items-center gap-2 text-sm",
|
|
245
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
246
|
-
checked: showToolCalls,
|
|
247
|
-
id: "transcript-show-tool-calls",
|
|
248
|
-
onCheckedChange: (checked) => onShowToolCallsChange(checked === true)
|
|
249
|
-
}), /* @__PURE__ */ jsx("label", {
|
|
250
|
-
htmlFor: "transcript-show-tool-calls",
|
|
251
|
-
children: "Show tool calls"
|
|
252
|
-
})]
|
|
253
|
-
}),
|
|
254
|
-
/* @__PURE__ */ jsxs("div", {
|
|
255
|
-
className: "flex items-center gap-2 text-sm",
|
|
256
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
257
|
-
checked: showCommentary,
|
|
258
|
-
id: "transcript-show-commentary",
|
|
259
|
-
onCheckedChange: (checked) => onShowCommentaryChange(checked === true)
|
|
260
|
-
}), /* @__PURE__ */ jsx("label", {
|
|
261
|
-
htmlFor: "transcript-show-commentary",
|
|
262
|
-
children: "Show commentary"
|
|
263
|
-
})]
|
|
264
|
-
}),
|
|
265
|
-
/* @__PURE__ */ jsxs("div", {
|
|
266
|
-
className: "flex items-center gap-2 text-sm",
|
|
267
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
268
|
-
checked: showExtraEvents,
|
|
269
|
-
id: "transcript-show-extra-events",
|
|
270
|
-
onCheckedChange: (checked) => onShowExtraEventsChange(checked === true)
|
|
271
|
-
}), /* @__PURE__ */ jsx("label", {
|
|
272
|
-
htmlFor: "transcript-show-extra-events",
|
|
273
|
-
children: "Show extra events"
|
|
274
|
-
})]
|
|
275
|
-
}),
|
|
276
|
-
/* @__PURE__ */ jsxs("div", {
|
|
277
|
-
className: "flex items-center gap-2 text-sm",
|
|
278
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
279
|
-
checked: showRawJson,
|
|
280
|
-
disabled: rawJsonDisabled,
|
|
281
|
-
id: "transcript-show-raw-json",
|
|
282
|
-
onCheckedChange: (checked) => onShowRawJsonChange(checked === true)
|
|
283
|
-
}), /* @__PURE__ */ jsx("label", {
|
|
284
|
-
htmlFor: "transcript-show-raw-json",
|
|
285
|
-
children: "Raw JSON"
|
|
286
|
-
})]
|
|
287
|
-
}),
|
|
288
|
-
/* @__PURE__ */ jsxs("div", {
|
|
289
|
-
className: "flex items-center gap-2 text-sm",
|
|
290
|
-
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
291
|
-
checked: showUserMessages,
|
|
292
|
-
id: "transcript-show-user-messages",
|
|
293
|
-
onCheckedChange: (checked) => onShowUserMessagesChange(checked === true)
|
|
294
|
-
}), /* @__PURE__ */ jsx("label", {
|
|
295
|
-
htmlFor: "transcript-show-user-messages",
|
|
296
|
-
children: "User"
|
|
297
|
-
})]
|
|
298
|
-
})
|
|
299
|
-
]
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
function ThreadMetadataPanels({ snapshot }) {
|
|
303
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
304
|
-
className: "grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",
|
|
305
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
306
|
-
className: "space-y-4",
|
|
307
|
-
children: [
|
|
308
|
-
/* @__PURE__ */ jsx(MetadataSection, {
|
|
309
|
-
items: buildThreadItems(snapshot),
|
|
310
|
-
title: "Thread"
|
|
311
|
-
}),
|
|
312
|
-
/* @__PURE__ */ jsx(MetadataSection, {
|
|
313
|
-
items: buildRuntimeItems(snapshot),
|
|
314
|
-
title: "Runtime"
|
|
315
|
-
}),
|
|
316
|
-
/* @__PURE__ */ jsx(MetadataSection, {
|
|
317
|
-
items: buildGitItems(snapshot),
|
|
318
|
-
title: "Git and agent"
|
|
319
|
-
})
|
|
320
|
-
]
|
|
321
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
322
|
-
className: "space-y-4",
|
|
323
|
-
children: [
|
|
324
|
-
/* @__PURE__ */ jsx(MetadataSection, {
|
|
325
|
-
items: buildRelationItems(snapshot),
|
|
326
|
-
title: "Relations and summary"
|
|
327
|
-
}),
|
|
328
|
-
/* @__PURE__ */ jsxs("section", {
|
|
329
|
-
className: "rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]",
|
|
330
|
-
children: [/* @__PURE__ */ jsx("h3", {
|
|
331
|
-
className: "font-semibold text-[var(--muted-foreground)] text-sm uppercase tracking-[0.18em]",
|
|
332
|
-
children: "Available tools"
|
|
333
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
334
|
-
className: "mt-4 space-y-3",
|
|
335
|
-
children: snapshot.availableTools.map((tool) => /* @__PURE__ */ jsxs("div", {
|
|
336
|
-
className: "rounded-xl border border-[var(--border)] bg-[var(--panel-secondary)] p-3.5",
|
|
337
|
-
children: [/* @__PURE__ */ jsxs("div", {
|
|
338
|
-
className: "flex flex-wrap items-center gap-2",
|
|
339
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
340
|
-
className: "font-medium font-mono text-sm",
|
|
341
|
-
children: tool.name
|
|
342
|
-
}), tool.namespace ? /* @__PURE__ */ jsx(Badge, {
|
|
343
|
-
variant: "outline",
|
|
344
|
-
children: tool.namespace
|
|
345
|
-
}) : null]
|
|
346
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
347
|
-
className: "mt-1.5 text-[var(--muted-foreground)] text-sm",
|
|
348
|
-
children: tool.description || "No description."
|
|
349
|
-
})]
|
|
350
|
-
}, `${tool.name}-${tool.namespace ?? "global"}`))
|
|
351
|
-
})]
|
|
352
|
-
}),
|
|
353
|
-
/* @__PURE__ */ jsx(MetadataSection, {
|
|
354
|
-
items: buildTranscriptStatsItems(snapshot),
|
|
355
|
-
title: "Transcript stats"
|
|
356
|
-
})
|
|
357
|
-
]
|
|
358
|
-
})]
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
function ThreadRawPanels({ snapshot }) {
|
|
362
|
-
if (!snapshot.transcript) return /* @__PURE__ */ jsx("div", {
|
|
363
|
-
className: "rounded-xl border border-[var(--border)] bg-[var(--panel)] px-5 py-4 text-sm",
|
|
364
|
-
children: snapshot.transcriptState === "missing" ? "The rollout JSONL file is missing from disk, so raw transcript payloads are unavailable." : "Raw transcript payloads are deferred for oversized rollouts. Use Export if you only need the full thread contents, or load the transcript manually from the Transcript tab."
|
|
365
|
-
});
|
|
366
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
367
|
-
className: "space-y-4",
|
|
368
|
-
children: [
|
|
369
|
-
/* @__PURE__ */ jsx(JsonPanel, {
|
|
370
|
-
title: "Session meta",
|
|
371
|
-
value: snapshot.transcript.sessionMeta
|
|
372
|
-
}),
|
|
373
|
-
/* @__PURE__ */ jsx(JsonPanel, {
|
|
374
|
-
title: "Turn contexts",
|
|
375
|
-
value: snapshot.transcript.turnContexts
|
|
376
|
-
}),
|
|
377
|
-
/* @__PURE__ */ jsx(JsonPanel, {
|
|
378
|
-
title: "Sandbox policy",
|
|
379
|
-
value: snapshot.thread.sandbox_policy
|
|
380
|
-
})
|
|
381
|
-
]
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
function DeferredTranscriptNotice({ fileSizeBytes, missing, pending, onLoad }) {
|
|
385
|
-
return /* @__PURE__ */ jsxs("section", {
|
|
386
|
-
className: "rounded-[1.6rem] border border-[var(--border)] bg-[var(--panel)] p-5 shadow-[var(--panel-shadow)]",
|
|
387
|
-
children: [
|
|
388
|
-
/* @__PURE__ */ jsx("h3", {
|
|
389
|
-
className: "font-semibold text-base",
|
|
390
|
-
children: missing ? "Transcript file missing" : "This is a very big thread"
|
|
391
|
-
}),
|
|
392
|
-
/* @__PURE__ */ jsx("p", {
|
|
393
|
-
className: "mt-2 text-[var(--muted-foreground)] text-sm leading-6",
|
|
394
|
-
children: missing ? "The rollout JSONL referenced by this thread is no longer present on disk. Export may still work if the file is restored, but transcript browsing is unavailable right now." : `Spiracha skipped loading the transcript automatically because the rollout file is ${formatBytes(fileSizeBytes)}. Export still works immediately. If you need to inspect the thread here, load a bounded preview manually.`
|
|
395
|
-
}),
|
|
396
|
-
missing ? null : /* @__PURE__ */ jsx("div", {
|
|
397
|
-
className: "mt-4",
|
|
398
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
399
|
-
disabled: pending,
|
|
400
|
-
variant: "outline",
|
|
401
|
-
onClick: onLoad,
|
|
402
|
-
children: pending ? "Loading preview..." : "Load transcript preview"
|
|
403
|
-
})
|
|
404
|
-
})
|
|
405
|
-
]
|
|
406
|
-
});
|
|
407
|
-
}
|
|
408
|
-
function ThreadDetailPage() {
|
|
409
|
-
const navigate = useNavigate();
|
|
410
|
-
const queryClient = useQueryClient();
|
|
411
|
-
const params = Route.useParams();
|
|
412
|
-
const snapshot = useSuspenseQuery(threadSnapshotQueryOptions(params.threadId)).data;
|
|
413
|
-
const { settings } = useSettings();
|
|
414
|
-
const [shouldLoadTranscript, setShouldLoadTranscript] = useState(!snapshot.rollout.shouldDeferTranscriptLoad);
|
|
415
|
-
const [showToolCalls, setShowToolCalls] = useState(false);
|
|
416
|
-
const [showCommentary, setShowCommentary] = useState(false);
|
|
417
|
-
const [showExtraEvents, setShowExtraEvents] = useState(false);
|
|
418
|
-
const [showRawJson, setShowRawJson] = useState(false);
|
|
419
|
-
const [showUserMessages, setShowUserMessages] = useState(true);
|
|
420
|
-
const [exportOpen, setExportOpen] = useState(false);
|
|
421
|
-
const [deleteOpen, setDeleteOpen] = useState(false);
|
|
422
|
-
const transcriptQuery = useQuery({
|
|
423
|
-
...threadTranscriptQueryOptions(params.threadId),
|
|
424
|
-
enabled: shouldLoadTranscript && snapshot.transcript === null
|
|
425
|
-
});
|
|
426
|
-
const transcript = snapshot.transcript ?? transcriptQuery.data ?? null;
|
|
427
|
-
const viewSnapshot = {
|
|
428
|
-
...snapshot,
|
|
429
|
-
transcript
|
|
430
|
-
};
|
|
431
|
-
const exportThreadMutation = useMutation({
|
|
432
|
-
mutationFn: async (options) => {
|
|
433
|
-
console.info("[spiracha:export-ui] request", {
|
|
434
|
-
outputFormat: options.outputFormat,
|
|
435
|
-
project: snapshot.project,
|
|
436
|
-
selectedThreadCount: 1,
|
|
437
|
-
selectedThreadIds: [snapshot.thread.id],
|
|
438
|
-
zipArchive: options.zipArchive
|
|
439
|
-
});
|
|
440
|
-
const download = await exportThreadFn({ data: {
|
|
441
|
-
...options,
|
|
442
|
-
...settings,
|
|
443
|
-
threadId: snapshot.thread.id
|
|
444
|
-
} });
|
|
445
|
-
console.info("[spiracha:export-ui] response", {
|
|
446
|
-
downloadUrl: download.mode === "download_url" ? download.downloadUrl : null,
|
|
447
|
-
fileName: download.fileName,
|
|
448
|
-
mode: download.mode,
|
|
449
|
-
project: snapshot.project,
|
|
450
|
-
selectedThreadCount: 1
|
|
451
|
-
});
|
|
452
|
-
if (download.mode === "download") {
|
|
453
|
-
downloadTextFile(download.fileName, download.content, download.mimeType);
|
|
454
|
-
return;
|
|
455
|
-
}
|
|
456
|
-
await downloadUrlFile(download.fileName, download.downloadUrl);
|
|
457
|
-
},
|
|
458
|
-
onError: (error) => {
|
|
459
|
-
console.error("[spiracha:export-ui] failed", {
|
|
460
|
-
error: error instanceof Error ? error.message : String(error),
|
|
461
|
-
project: snapshot.project,
|
|
462
|
-
selectedThreadCount: 1,
|
|
463
|
-
selectedThreadIds: [snapshot.thread.id]
|
|
464
|
-
});
|
|
465
|
-
},
|
|
466
|
-
onSuccess: async () => {
|
|
467
|
-
setExportOpen(false);
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
const deleteThreadMutation = useMutation({
|
|
471
|
-
mutationFn: (input) => deleteThreadFn({ data: {
|
|
472
|
-
deleteSessionFiles: input.deleteSessionFiles,
|
|
473
|
-
threadId: snapshot.thread.id
|
|
474
|
-
} }),
|
|
475
|
-
onSuccess: async () => {
|
|
476
|
-
await Promise.all([
|
|
477
|
-
queryClient.invalidateQueries({ queryKey: ["analytics"] }),
|
|
478
|
-
queryClient.invalidateQueries({ queryKey: ["dashboard"] }),
|
|
479
|
-
queryClient.invalidateQueries({ queryKey: ["project-threads", snapshot.project] }),
|
|
480
|
-
queryClient.invalidateQueries({ queryKey: ["projects"] })
|
|
481
|
-
]);
|
|
482
|
-
navigate({
|
|
483
|
-
params: { project: snapshot.project },
|
|
484
|
-
to: "/projects/$project"
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
489
|
-
className: "space-y-5",
|
|
490
|
-
children: [
|
|
491
|
-
/* @__PURE__ */ jsx(PageHeader, {
|
|
492
|
-
actions: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Button, {
|
|
493
|
-
className: "rounded-full",
|
|
494
|
-
variant: "outline",
|
|
495
|
-
onClick: () => setExportOpen(true),
|
|
496
|
-
children: [/* @__PURE__ */ jsx(Download, { className: "mr-2 size-4" }), "Export"]
|
|
497
|
-
}), /* @__PURE__ */ jsxs(Button, {
|
|
498
|
-
className: "rounded-full border-[var(--destructive)]/20 text-[var(--destructive)]",
|
|
499
|
-
variant: "outline",
|
|
500
|
-
onClick: () => setDeleteOpen(true),
|
|
501
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-4" }), "Delete"]
|
|
502
|
-
})] }),
|
|
503
|
-
breadcrumb: /* @__PURE__ */ jsx(Breadcrumbs, { items: [
|
|
504
|
-
{
|
|
505
|
-
label: "Codex",
|
|
506
|
-
to: "/projects"
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
label: snapshot.project,
|
|
510
|
-
params: { project: snapshot.project },
|
|
511
|
-
to: "/projects/$project"
|
|
512
|
-
},
|
|
513
|
-
{ label: snapshot.thread.title }
|
|
514
|
-
] }),
|
|
515
|
-
eyebrow: snapshot.project,
|
|
516
|
-
subtitle: snapshot.thread.preview,
|
|
517
|
-
title: snapshot.thread.title
|
|
518
|
-
}),
|
|
519
|
-
/* @__PURE__ */ jsxs("div", {
|
|
520
|
-
className: "grid gap-3 md:grid-cols-2 xl:grid-cols-4",
|
|
521
|
-
children: [
|
|
522
|
-
/* @__PURE__ */ jsx(MetricCard, {
|
|
523
|
-
label: "Model",
|
|
524
|
-
value: snapshot.thread.model ?? "unknown"
|
|
525
|
-
}),
|
|
526
|
-
/* @__PURE__ */ jsx(MetricCard, {
|
|
527
|
-
label: "Tokens",
|
|
528
|
-
value: formatTokens(snapshot.thread.tokens_used)
|
|
529
|
-
}),
|
|
530
|
-
/* @__PURE__ */ jsx(MetricCard, {
|
|
531
|
-
label: "Updated",
|
|
532
|
-
value: /* @__PURE__ */ jsx("span", {
|
|
533
|
-
suppressHydrationWarning: true,
|
|
534
|
-
children: formatDateTime(snapshot.thread.updated_at_ms ?? snapshot.thread.updated_at * 1e3)
|
|
535
|
-
})
|
|
536
|
-
}),
|
|
537
|
-
/* @__PURE__ */ jsx(MetricCard, {
|
|
538
|
-
label: "Thread source",
|
|
539
|
-
value: snapshot.thread.thread_source ?? transcript?.sessionMeta.threadSource ?? "n/a"
|
|
540
|
-
})
|
|
541
|
-
]
|
|
542
|
-
}),
|
|
543
|
-
/* @__PURE__ */ jsxs(Tabs, {
|
|
544
|
-
className: "space-y-4",
|
|
545
|
-
defaultValue: "transcript",
|
|
546
|
-
children: [
|
|
547
|
-
/* @__PURE__ */ jsxs(TabsList, {
|
|
548
|
-
className: "grid w-fit min-w-[24rem] grid-cols-3 rounded-full border border-[var(--border)] bg-[var(--panel)] p-1",
|
|
549
|
-
children: [
|
|
550
|
-
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
551
|
-
className: "rounded-full px-5 text-sm",
|
|
552
|
-
value: "transcript",
|
|
553
|
-
children: "Transcript"
|
|
554
|
-
}),
|
|
555
|
-
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
556
|
-
className: "rounded-full px-5 text-sm",
|
|
557
|
-
value: "metadata",
|
|
558
|
-
children: "Metadata"
|
|
559
|
-
}),
|
|
560
|
-
/* @__PURE__ */ jsx(TabsTrigger, {
|
|
561
|
-
className: "rounded-full px-5 text-sm",
|
|
562
|
-
value: "raw",
|
|
563
|
-
children: "Raw"
|
|
564
|
-
})
|
|
565
|
-
]
|
|
566
|
-
}),
|
|
567
|
-
/* @__PURE__ */ jsxs(TabsContent, {
|
|
568
|
-
className: "space-y-3",
|
|
569
|
-
value: "transcript",
|
|
570
|
-
children: [
|
|
571
|
-
/* @__PURE__ */ jsx(TranscriptControls, {
|
|
572
|
-
rawJsonDisabled: !transcript?.rawIncluded,
|
|
573
|
-
showCommentary,
|
|
574
|
-
showExtraEvents,
|
|
575
|
-
showRawJson,
|
|
576
|
-
showToolCalls,
|
|
577
|
-
showUserMessages,
|
|
578
|
-
onShowCommentaryChange: setShowCommentary,
|
|
579
|
-
onShowExtraEventsChange: setShowExtraEvents,
|
|
580
|
-
onShowRawJsonChange: setShowRawJson,
|
|
581
|
-
onShowToolCallsChange: setShowToolCalls,
|
|
582
|
-
onShowUserMessagesChange: setShowUserMessages
|
|
583
|
-
}),
|
|
584
|
-
transcript ? /* @__PURE__ */ jsx(TranscriptView, {
|
|
585
|
-
assistantModel: snapshot.thread.model,
|
|
586
|
-
events: transcript.events,
|
|
587
|
-
projectPath: snapshot.thread.cwd,
|
|
588
|
-
showCommentary,
|
|
589
|
-
showExtraEvents,
|
|
590
|
-
showRawJson: showRawJson && transcript.rawIncluded,
|
|
591
|
-
showToolCalls,
|
|
592
|
-
showUserMessages
|
|
593
|
-
}) : /* @__PURE__ */ jsx(DeferredTranscriptNotice, {
|
|
594
|
-
fileSizeBytes: snapshot.rollout.fileSizeBytes,
|
|
595
|
-
missing: snapshot.transcriptState === "missing",
|
|
596
|
-
pending: transcriptQuery.isFetching,
|
|
597
|
-
onLoad: () => setShouldLoadTranscript(true)
|
|
598
|
-
}),
|
|
599
|
-
transcriptQuery.isError ? /* @__PURE__ */ jsxs("p", {
|
|
600
|
-
className: "text-[var(--destructive)] text-sm",
|
|
601
|
-
children: [
|
|
602
|
-
"Failed to load transcript preview:",
|
|
603
|
-
" ",
|
|
604
|
-
transcriptQuery.error instanceof Error ? transcriptQuery.error.message : "Unknown error"
|
|
605
|
-
]
|
|
606
|
-
}) : null
|
|
607
|
-
]
|
|
608
|
-
}),
|
|
609
|
-
/* @__PURE__ */ jsx(TabsContent, {
|
|
610
|
-
value: "metadata",
|
|
611
|
-
children: /* @__PURE__ */ jsx(ThreadMetadataPanels, { snapshot: viewSnapshot })
|
|
612
|
-
}),
|
|
613
|
-
/* @__PURE__ */ jsx(TabsContent, {
|
|
614
|
-
value: "raw",
|
|
615
|
-
children: /* @__PURE__ */ jsx(ThreadRawPanels, { snapshot: viewSnapshot })
|
|
616
|
-
})
|
|
617
|
-
]
|
|
618
|
-
}),
|
|
619
|
-
/* @__PURE__ */ jsx(DeleteConfirmDialog, {
|
|
620
|
-
confirmLabel: deleteThreadMutation.isPending ? "Deleting..." : "Delete thread",
|
|
621
|
-
defaultDeleteSessionFiles: true,
|
|
622
|
-
description: "Delete this thread from the Codex database. Enable Delete Session files if you also want to remove the rollout JSONL from disk.",
|
|
623
|
-
open: deleteOpen,
|
|
624
|
-
showDeleteSessionFilesOption: true,
|
|
625
|
-
title: "Delete this thread from Codex DB?",
|
|
626
|
-
onConfirm: ({ deleteSessionFiles }) => deleteThreadMutation.mutate({ deleteSessionFiles }),
|
|
627
|
-
onOpenChange: setDeleteOpen
|
|
628
|
-
}),
|
|
629
|
-
/* @__PURE__ */ jsx(ExportDialog, {
|
|
630
|
-
open: exportOpen,
|
|
631
|
-
pending: exportThreadMutation.isPending,
|
|
632
|
-
onExport: (options) => exportThreadMutation.mutate(options),
|
|
633
|
-
onOpenChange: setExportOpen
|
|
634
|
-
})
|
|
635
|
-
]
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
//#endregion
|
|
639
|
-
export { ThreadDetailPage as component };
|