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,395 +0,0 @@
|
|
|
1
|
-
import { t as Button } from "./button-CmTDnzOn.js";
|
|
2
|
-
import { n as useSettings } from "./settings-store-DpEJEQ7M.js";
|
|
3
|
-
import { c as deleteThreadFn, d as exportThreadsFn, f as recoverProjectThreadsFn, l as deleteThreadsFn, r as projectThreadsQueryOptions, u as exportThreadFn } from "./codex-queries-CtgeZ7VL.js";
|
|
4
|
-
import { o as withTextQuerySearch } from "./route-search-ts4W9MJ9.js";
|
|
5
|
-
import { t as Route } from "./projects._project-Bpbc3C-L.js";
|
|
6
|
-
import { t as DataTable } from "./data-table-Cdct823O.js";
|
|
7
|
-
import { t as PageHeader } from "./page-header-VNSaM3xd.js";
|
|
8
|
-
import { n as formatBytes, o as formatNumber, r as formatDateTime, s as formatTokens } from "./formatters-FJaGZgJk.js";
|
|
9
|
-
import { n as downloadUrlFile, t as downloadTextFile } from "./download-DMmiy1xf.js";
|
|
10
|
-
import { i as DropdownMenuTrigger, n as DropdownMenuContent, r as DropdownMenuItem, t as DropdownMenu } from "./dropdown-menu-Dy_9t6TN.js";
|
|
11
|
-
import { n as ListSearchInput, t as matchesTextQuery } from "./text-filter-CGKxMCKt.js";
|
|
12
|
-
import { t as DeleteConfirmDialog } from "./delete-confirm-dialog-BcBNCxWB.js";
|
|
13
|
-
import { t as ExportDialog } from "./export-dialog-BItjWgkZ.js";
|
|
14
|
-
import { startTransition, useDeferredValue, useMemo, useState } from "react";
|
|
15
|
-
import { Link, useNavigate } from "@tanstack/react-router";
|
|
16
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { useMutation, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
18
|
-
import { Download, MoreHorizontal, RefreshCcw, Trash2, X } from "lucide-react";
|
|
19
|
-
import { createColumnHelper } from "@tanstack/react-table";
|
|
20
|
-
//#region src/components/threads-table.tsx
|
|
21
|
-
var columnHelper = createColumnHelper();
|
|
22
|
-
var defaultSorting = [{
|
|
23
|
-
desc: true,
|
|
24
|
-
id: "updatedAt"
|
|
25
|
-
}];
|
|
26
|
-
var columns = (onDeleteThread, onExportThread) => [
|
|
27
|
-
columnHelper.accessor((row) => row.thread.title, {
|
|
28
|
-
cell: (info) => /* @__PURE__ */ jsxs(Link, {
|
|
29
|
-
className: "block w-[16rem] max-w-[20rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto",
|
|
30
|
-
params: { threadId: info.row.original.thread.id },
|
|
31
|
-
to: "/threads/$threadId",
|
|
32
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
33
|
-
className: "truncate font-medium underline-offset-2 hover:underline",
|
|
34
|
-
children: info.getValue()
|
|
35
|
-
}), /* @__PURE__ */ jsx("p", {
|
|
36
|
-
className: "line-clamp-2 text-[var(--muted-foreground)] text-xs",
|
|
37
|
-
children: info.row.original.thread.preview
|
|
38
|
-
})]
|
|
39
|
-
}),
|
|
40
|
-
header: "Thread",
|
|
41
|
-
id: "title"
|
|
42
|
-
}),
|
|
43
|
-
columnHelper.accessor((row) => row.thread.updated_at_ms ?? row.thread.updated_at * 1e3, {
|
|
44
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
45
|
-
className: "whitespace-nowrap text-sm",
|
|
46
|
-
suppressHydrationWarning: true,
|
|
47
|
-
children: formatDateTime(info.getValue())
|
|
48
|
-
}),
|
|
49
|
-
header: "Updated",
|
|
50
|
-
id: "updatedAt"
|
|
51
|
-
}),
|
|
52
|
-
columnHelper.accessor((row) => row.thread.created_at_ms ?? row.thread.created_at * 1e3, {
|
|
53
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
54
|
-
className: "whitespace-nowrap text-sm",
|
|
55
|
-
suppressHydrationWarning: true,
|
|
56
|
-
children: formatDateTime(info.getValue())
|
|
57
|
-
}),
|
|
58
|
-
header: "Created",
|
|
59
|
-
id: "createdAt"
|
|
60
|
-
}),
|
|
61
|
-
columnHelper.accessor((row) => row.thread.model ?? "unknown", {
|
|
62
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
63
|
-
className: "truncate font-mono text-sm",
|
|
64
|
-
children: info.getValue()
|
|
65
|
-
}),
|
|
66
|
-
header: "Model",
|
|
67
|
-
id: "model"
|
|
68
|
-
}),
|
|
69
|
-
columnHelper.accessor((row) => row.thread.tokens_used, {
|
|
70
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
71
|
-
className: "whitespace-nowrap font-mono text-sm",
|
|
72
|
-
children: formatTokens(info.getValue())
|
|
73
|
-
}),
|
|
74
|
-
header: "Tokens",
|
|
75
|
-
id: "tokens"
|
|
76
|
-
}),
|
|
77
|
-
columnHelper.accessor((row) => row.rolloutSizeBytes, {
|
|
78
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
79
|
-
className: "whitespace-nowrap font-mono text-sm",
|
|
80
|
-
children: formatBytes(info.getValue() ?? 0)
|
|
81
|
-
}),
|
|
82
|
-
header: "Size",
|
|
83
|
-
id: "size"
|
|
84
|
-
}),
|
|
85
|
-
columnHelper.accessor((row) => row.stats.toolCallCount, {
|
|
86
|
-
cell: (info) => info.row.original.stats.deferred ? /* @__PURE__ */ jsx("span", {
|
|
87
|
-
className: "text-[var(--muted-foreground)] text-sm",
|
|
88
|
-
children: "Deferred"
|
|
89
|
-
}) : /* @__PURE__ */ jsx("span", {
|
|
90
|
-
className: "font-mono text-sm",
|
|
91
|
-
children: formatNumber(info.getValue())
|
|
92
|
-
}),
|
|
93
|
-
header: "Tools",
|
|
94
|
-
id: "tools"
|
|
95
|
-
}),
|
|
96
|
-
columnHelper.accessor((row) => row.thread.archived, {
|
|
97
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
98
|
-
className: "text-sm",
|
|
99
|
-
children: info.getValue() ? "Archived" : "Active"
|
|
100
|
-
}),
|
|
101
|
-
header: "State",
|
|
102
|
-
id: "state"
|
|
103
|
-
}),
|
|
104
|
-
columnHelper.display({
|
|
105
|
-
cell: (info) => /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
106
|
-
asChild: true,
|
|
107
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
108
|
-
className: "rounded-full",
|
|
109
|
-
size: "icon",
|
|
110
|
-
type: "button",
|
|
111
|
-
variant: "ghost",
|
|
112
|
-
onClick: (event) => event.stopPropagation(),
|
|
113
|
-
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
|
|
114
|
-
})
|
|
115
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
116
|
-
align: "end",
|
|
117
|
-
children: [/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
118
|
-
onClick: () => onExportThread(info.row.original),
|
|
119
|
-
children: [/* @__PURE__ */ jsx(Download, { className: "mr-2 size-4" }), "Export thread"]
|
|
120
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
121
|
-
className: "text-[var(--destructive)]",
|
|
122
|
-
onClick: () => onDeleteThread(info.row.original),
|
|
123
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-4" }), "Delete thread"]
|
|
124
|
-
})]
|
|
125
|
-
})] }),
|
|
126
|
-
enableSorting: false,
|
|
127
|
-
header: "",
|
|
128
|
-
id: "actions"
|
|
129
|
-
})
|
|
130
|
-
];
|
|
131
|
-
function ThreadsTable({ threads, onDeleteThread, onDeleteThreads, onExportThread, onExportThreads }) {
|
|
132
|
-
return /* @__PURE__ */ jsx(DataTable, {
|
|
133
|
-
columns: columns(onDeleteThread, onExportThread),
|
|
134
|
-
data: threads,
|
|
135
|
-
emptyMessage: "No threads match the current project filter.",
|
|
136
|
-
enableRowSelection: true,
|
|
137
|
-
getRowId: (row) => row.thread.id,
|
|
138
|
-
initialSorting: defaultSorting,
|
|
139
|
-
renderToolbar: ({ clearSelection, selectedRows }) => {
|
|
140
|
-
if (selectedRows.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
141
|
-
className: "text-[var(--muted-foreground)] text-sm",
|
|
142
|
-
children: "Select threads to export or delete them in a batch."
|
|
143
|
-
});
|
|
144
|
-
const selectedThreadIds = selectedRows.map((row) => row.thread.id);
|
|
145
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
146
|
-
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
147
|
-
children: [/* @__PURE__ */ jsxs("p", {
|
|
148
|
-
className: "text-sm",
|
|
149
|
-
children: [
|
|
150
|
-
selectedRows.length,
|
|
151
|
-
" thread",
|
|
152
|
-
selectedRows.length === 1 ? "" : "s",
|
|
153
|
-
" selected"
|
|
154
|
-
]
|
|
155
|
-
}), /* @__PURE__ */ jsxs("div", {
|
|
156
|
-
className: "flex flex-wrap gap-2",
|
|
157
|
-
children: [
|
|
158
|
-
/* @__PURE__ */ jsxs(Button, {
|
|
159
|
-
className: "rounded-full",
|
|
160
|
-
size: "sm",
|
|
161
|
-
type: "button",
|
|
162
|
-
variant: "outline",
|
|
163
|
-
onClick: () => onExportThreads(selectedThreadIds),
|
|
164
|
-
children: [/* @__PURE__ */ jsx(Download, { className: "mr-2 size-4" }), "Export selected threads"]
|
|
165
|
-
}),
|
|
166
|
-
/* @__PURE__ */ jsxs(Button, {
|
|
167
|
-
className: "rounded-full border-[var(--destructive)]/20 text-[var(--destructive)]",
|
|
168
|
-
size: "sm",
|
|
169
|
-
type: "button",
|
|
170
|
-
variant: "outline",
|
|
171
|
-
onClick: () => onDeleteThreads(selectedThreadIds),
|
|
172
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-4" }), "Delete selected threads"]
|
|
173
|
-
}),
|
|
174
|
-
/* @__PURE__ */ jsxs(Button, {
|
|
175
|
-
className: "rounded-full",
|
|
176
|
-
size: "sm",
|
|
177
|
-
type: "button",
|
|
178
|
-
variant: "ghost",
|
|
179
|
-
onClick: clearSelection,
|
|
180
|
-
children: [/* @__PURE__ */ jsx(X, { className: "mr-2 size-4" }), "Clear selection"]
|
|
181
|
-
})
|
|
182
|
-
]
|
|
183
|
-
})]
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/routes/projects.$project.tsx?tsr-split=component
|
|
190
|
-
var shouldForceZipArchive = (pendingExport) => {
|
|
191
|
-
return Boolean(pendingExport && pendingExport.threadIds.length > 1);
|
|
192
|
-
};
|
|
193
|
-
var getDeleteConfirmLabel = (pendingDelete, isPending) => {
|
|
194
|
-
if (isPending) return "Deleting...";
|
|
195
|
-
if (pendingDelete && pendingDelete.threads.length > 1) return "Delete threads";
|
|
196
|
-
return "Delete thread";
|
|
197
|
-
};
|
|
198
|
-
var getDeleteDescription = (pendingDelete) => {
|
|
199
|
-
if (!pendingDelete) return "";
|
|
200
|
-
if (pendingDelete.threads.length === 1) return `Delete the thread "${pendingDelete.threads[0].thread.title}" from the Codex database. Leave Session files unchecked if you only want to remove the current DB row.`;
|
|
201
|
-
return `Delete ${pendingDelete.threads.length} selected threads from the Codex database. Enable Delete Session files if you also want to remove their rollout JSONL files.`;
|
|
202
|
-
};
|
|
203
|
-
var getDeleteTitle = (pendingDelete) => {
|
|
204
|
-
if (pendingDelete && pendingDelete.threads.length > 1) return `Delete ${pendingDelete.threads.length} Codex threads?`;
|
|
205
|
-
return "Delete Codex thread?";
|
|
206
|
-
};
|
|
207
|
-
function ProjectDetailPage() {
|
|
208
|
-
const navigate = useNavigate({ from: Route.fullPath });
|
|
209
|
-
const params = Route.useParams();
|
|
210
|
-
const queryClient = useQueryClient();
|
|
211
|
-
const threads = useSuspenseQuery(projectThreadsQueryOptions(params.project)).data;
|
|
212
|
-
const { settings } = useSettings();
|
|
213
|
-
const searchInput = Route.useSearch().q ?? "";
|
|
214
|
-
const [pendingDelete, setPendingDelete] = useState(null);
|
|
215
|
-
const [pendingExport, setPendingExport] = useState(null);
|
|
216
|
-
const deferredSearch = useDeferredValue(searchInput.trim().toLowerCase());
|
|
217
|
-
const deleteThreadMutation = useMutation({
|
|
218
|
-
mutationFn: (input) => {
|
|
219
|
-
if (input.threadIds.length === 1) return deleteThreadFn({ data: {
|
|
220
|
-
deleteSessionFiles: input.deleteSessionFiles,
|
|
221
|
-
threadId: input.threadIds[0]
|
|
222
|
-
} });
|
|
223
|
-
return deleteThreadsFn({ data: input });
|
|
224
|
-
},
|
|
225
|
-
onSuccess: async () => {
|
|
226
|
-
await Promise.all([
|
|
227
|
-
queryClient.invalidateQueries({ queryKey: ["analytics"] }),
|
|
228
|
-
queryClient.invalidateQueries({ queryKey: ["dashboard"] }),
|
|
229
|
-
queryClient.invalidateQueries({ queryKey: ["project-threads", params.project] }),
|
|
230
|
-
queryClient.invalidateQueries({ queryKey: ["projects"] })
|
|
231
|
-
]);
|
|
232
|
-
setPendingDelete(null);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
const recoverProjectMutation = useMutation({
|
|
236
|
-
mutationFn: () => recoverProjectThreadsFn({ data: { project: params.project } }),
|
|
237
|
-
onSuccess: async () => {
|
|
238
|
-
await Promise.all([
|
|
239
|
-
queryClient.invalidateQueries({ queryKey: ["analytics"] }),
|
|
240
|
-
queryClient.invalidateQueries({ queryKey: ["dashboard"] }),
|
|
241
|
-
queryClient.invalidateQueries({ queryKey: ["project-threads", params.project] }),
|
|
242
|
-
queryClient.invalidateQueries({ queryKey: ["projects"] })
|
|
243
|
-
]);
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
const exportThreadMutation = useMutation({
|
|
247
|
-
mutationFn: async (options) => {
|
|
248
|
-
if (!pendingExport) throw new Error("No thread selected for export");
|
|
249
|
-
console.info("[spiracha:export-ui] request", {
|
|
250
|
-
outputFormat: options.outputFormat,
|
|
251
|
-
project: params.project,
|
|
252
|
-
selectedThreadCount: pendingExport.threadIds.length,
|
|
253
|
-
selectedThreadIds: pendingExport.threadIds,
|
|
254
|
-
zipArchive: options.zipArchive
|
|
255
|
-
});
|
|
256
|
-
const download = pendingExport.threadIds.length === 1 ? await exportThreadFn({ data: {
|
|
257
|
-
...options,
|
|
258
|
-
...settings,
|
|
259
|
-
threadId: pendingExport.threadIds[0]
|
|
260
|
-
} }) : await exportThreadsFn({ data: {
|
|
261
|
-
...options,
|
|
262
|
-
...settings,
|
|
263
|
-
threadIds: pendingExport.threadIds
|
|
264
|
-
} });
|
|
265
|
-
console.info("[spiracha:export-ui] response", {
|
|
266
|
-
downloadUrl: download.mode === "download_url" ? download.downloadUrl : null,
|
|
267
|
-
fileName: download.fileName,
|
|
268
|
-
mode: download.mode,
|
|
269
|
-
project: params.project,
|
|
270
|
-
selectedThreadCount: pendingExport.threadIds.length
|
|
271
|
-
});
|
|
272
|
-
if (download.mode === "download") {
|
|
273
|
-
downloadTextFile(download.fileName, download.content, download.mimeType);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
await downloadUrlFile(download.fileName, download.downloadUrl);
|
|
277
|
-
},
|
|
278
|
-
onError: (error) => {
|
|
279
|
-
console.error("[spiracha:export-ui] failed", {
|
|
280
|
-
error: error instanceof Error ? error.message : String(error),
|
|
281
|
-
project: params.project,
|
|
282
|
-
selectedThreadCount: pendingExport?.threadIds.length ?? 0,
|
|
283
|
-
selectedThreadIds: pendingExport?.threadIds ?? []
|
|
284
|
-
});
|
|
285
|
-
},
|
|
286
|
-
onSuccess: () => {
|
|
287
|
-
setPendingExport(null);
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
const visibleThreads = [...threads].filter((thread) => {
|
|
291
|
-
return matchesTextQuery(deferredSearch, [
|
|
292
|
-
thread.thread.title,
|
|
293
|
-
thread.thread.preview,
|
|
294
|
-
thread.thread.model,
|
|
295
|
-
thread.thread.id
|
|
296
|
-
]);
|
|
297
|
-
});
|
|
298
|
-
const visibleThreadsById = useMemo(() => new Map(visibleThreads.map((thread) => [thread.thread.id, thread])), [visibleThreads]);
|
|
299
|
-
const updateSearchInput = (value) => {
|
|
300
|
-
startTransition(() => {
|
|
301
|
-
navigate({
|
|
302
|
-
params: true,
|
|
303
|
-
replace: true,
|
|
304
|
-
search: (previous) => withTextQuerySearch(previous, value)
|
|
305
|
-
});
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
const lookupSelectedThreads = (threadIds) => {
|
|
309
|
-
return threadIds.map((threadId) => visibleThreadsById.get(threadId) ?? null).filter((thread) => thread !== null);
|
|
310
|
-
};
|
|
311
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
312
|
-
className: "space-y-6",
|
|
313
|
-
children: [
|
|
314
|
-
/* @__PURE__ */ jsx(PageHeader, {
|
|
315
|
-
actions: /* @__PURE__ */ jsxs("div", {
|
|
316
|
-
className: "flex flex-col gap-2 sm:flex-row",
|
|
317
|
-
children: [/* @__PURE__ */ jsxs(Button, {
|
|
318
|
-
className: "rounded-full",
|
|
319
|
-
disabled: recoverProjectMutation.isPending,
|
|
320
|
-
type: "button",
|
|
321
|
-
variant: "outline",
|
|
322
|
-
onClick: () => recoverProjectMutation.mutate(),
|
|
323
|
-
children: [/* @__PURE__ */ jsx(RefreshCcw, { className: "mr-2 size-4" }), recoverProjectMutation.isPending ? "Recovering..." : "Recover"]
|
|
324
|
-
}), /* @__PURE__ */ jsx(ListSearchInput, {
|
|
325
|
-
placeholder: "Search thread title, preview, or model",
|
|
326
|
-
value: searchInput,
|
|
327
|
-
onValueChange: updateSearchInput
|
|
328
|
-
})]
|
|
329
|
-
}),
|
|
330
|
-
eyebrow: "Codex project",
|
|
331
|
-
subtitle: "Sort by any column, inspect tool call volume, manage thread records, or repair stale Codex thread metadata for this derived project.",
|
|
332
|
-
title: params.project
|
|
333
|
-
}),
|
|
334
|
-
recoverProjectMutation.isError ? /* @__PURE__ */ jsx("p", {
|
|
335
|
-
className: "text-[var(--destructive)] text-sm",
|
|
336
|
-
children: recoverProjectMutation.error instanceof Error ? recoverProjectMutation.error.message : "Project recovery failed"
|
|
337
|
-
}) : null,
|
|
338
|
-
recoverProjectMutation.isSuccess ? /* @__PURE__ */ jsx("p", {
|
|
339
|
-
className: "text-[var(--success)] text-sm",
|
|
340
|
-
children: "Project thread metadata recovery completed."
|
|
341
|
-
}) : null,
|
|
342
|
-
/* @__PURE__ */ jsx(ThreadsTable, {
|
|
343
|
-
threads: visibleThreads,
|
|
344
|
-
onDeleteThread: (thread) => setPendingDelete({ threads: [thread] }),
|
|
345
|
-
onDeleteThreads: (threadIds) => {
|
|
346
|
-
const selectedThreads = lookupSelectedThreads(threadIds);
|
|
347
|
-
if (selectedThreads.length === 0) return;
|
|
348
|
-
setPendingDelete({ threads: selectedThreads });
|
|
349
|
-
},
|
|
350
|
-
onExportThread: (thread) => setPendingExport({
|
|
351
|
-
threadIds: [thread.thread.id],
|
|
352
|
-
threadLabel: thread.thread.title
|
|
353
|
-
}),
|
|
354
|
-
onExportThreads: (threadIds) => {
|
|
355
|
-
const selectedThreads = lookupSelectedThreads(threadIds);
|
|
356
|
-
if (selectedThreads.length === 0) return;
|
|
357
|
-
setPendingExport({
|
|
358
|
-
threadIds: selectedThreads.map((thread) => thread.thread.id),
|
|
359
|
-
threadLabel: selectedThreads.length === 1 ? selectedThreads[0].thread.title : `${selectedThreads.length} selected threads`
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
}),
|
|
363
|
-
/* @__PURE__ */ jsx(DeleteConfirmDialog, {
|
|
364
|
-
confirmLabel: getDeleteConfirmLabel(pendingDelete, deleteThreadMutation.isPending),
|
|
365
|
-
defaultDeleteSessionFiles: true,
|
|
366
|
-
description: getDeleteDescription(pendingDelete),
|
|
367
|
-
open: pendingDelete !== null,
|
|
368
|
-
showDeleteSessionFilesOption: true,
|
|
369
|
-
title: getDeleteTitle(pendingDelete),
|
|
370
|
-
onConfirm: ({ deleteSessionFiles }) => {
|
|
371
|
-
if (!pendingDelete) return;
|
|
372
|
-
deleteThreadMutation.mutate({
|
|
373
|
-
deleteSessionFiles,
|
|
374
|
-
threadIds: pendingDelete.threads.map((thread) => thread.thread.id)
|
|
375
|
-
});
|
|
376
|
-
},
|
|
377
|
-
onOpenChange: (open) => {
|
|
378
|
-
if (!open) setPendingDelete(null);
|
|
379
|
-
}
|
|
380
|
-
}),
|
|
381
|
-
/* @__PURE__ */ jsx(ExportDialog, {
|
|
382
|
-
forceZipArchive: shouldForceZipArchive(pendingExport),
|
|
383
|
-
open: pendingExport !== null,
|
|
384
|
-
pending: exportThreadMutation.isPending,
|
|
385
|
-
title: pendingExport ? `Export ${pendingExport.threadLabel}` : "Export thread",
|
|
386
|
-
onExport: (options) => exportThreadMutation.mutate(options),
|
|
387
|
-
onOpenChange: (open) => {
|
|
388
|
-
if (!open) setPendingExport(null);
|
|
389
|
-
}
|
|
390
|
-
})
|
|
391
|
-
]
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
//#endregion
|
|
395
|
-
export { ProjectDetailPage as component };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { t as ReloadErrorPanel } from "./reload-error-panel-BJMxY3U1.js";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
//#region src/routes/projects.index.tsx?tsr-split=errorComponent
|
|
4
|
-
function ProjectsErrorComponent({ error }) {
|
|
5
|
-
const isSqlite = error.message.includes("unable to open database") || error.message.includes("database is locked");
|
|
6
|
-
return /* @__PURE__ */ jsx(ReloadErrorPanel, {
|
|
7
|
-
description: isSqlite ? "Codex may have an exclusive lock on the database. Reload to retry." : error.message,
|
|
8
|
-
title: isSqlite ? "Database unavailable" : "Failed to load Codex inventory"
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { ProjectsErrorComponent as errorComponent };
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { t as Button } from "./button-CmTDnzOn.js";
|
|
2
|
-
import { i as projectsQueryOptions, s as deleteProjectFn } from "./codex-queries-CtgeZ7VL.js";
|
|
3
|
-
import { o as withTextQuerySearch } from "./route-search-ts4W9MJ9.js";
|
|
4
|
-
import { t as Route } from "./projects.index-DesYXwfi.js";
|
|
5
|
-
import { t as DataTable } from "./data-table-Cdct823O.js";
|
|
6
|
-
import { t as PageHeader } from "./page-header-VNSaM3xd.js";
|
|
7
|
-
import { i as formatList, o as formatNumber, r as formatDateTime, s as formatTokens } from "./formatters-FJaGZgJk.js";
|
|
8
|
-
import { i as DropdownMenuTrigger, n as DropdownMenuContent, r as DropdownMenuItem, t as DropdownMenu } from "./dropdown-menu-Dy_9t6TN.js";
|
|
9
|
-
import { n as ListSearchInput, t as matchesTextQuery } from "./text-filter-CGKxMCKt.js";
|
|
10
|
-
import { t as DeleteConfirmDialog } from "./delete-confirm-dialog-BcBNCxWB.js";
|
|
11
|
-
import { startTransition, useDeferredValue, useState } from "react";
|
|
12
|
-
import { Link, useNavigate } from "@tanstack/react-router";
|
|
13
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useMutation, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
15
|
-
import { MoreHorizontal, Trash2 } from "lucide-react";
|
|
16
|
-
import { createColumnHelper } from "@tanstack/react-table";
|
|
17
|
-
//#region src/components/projects-table.tsx
|
|
18
|
-
var columnHelper = createColumnHelper();
|
|
19
|
-
var columns = (onDeleteProject) => [
|
|
20
|
-
columnHelper.accessor("name", {
|
|
21
|
-
cell: (info) => /* @__PURE__ */ jsxs(Link, {
|
|
22
|
-
className: "block w-[14rem] max-w-[18rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto",
|
|
23
|
-
params: { project: info.row.original.name },
|
|
24
|
-
to: "/projects/$project",
|
|
25
|
-
children: [/* @__PURE__ */ jsx("p", {
|
|
26
|
-
className: "font-medium underline-offset-2 hover:underline",
|
|
27
|
-
children: info.getValue()
|
|
28
|
-
}), /* @__PURE__ */ jsxs("p", {
|
|
29
|
-
className: "text-[var(--muted-foreground)] text-xs",
|
|
30
|
-
children: [
|
|
31
|
-
formatNumber(info.row.original.cwdPaths.length),
|
|
32
|
-
" cwd path",
|
|
33
|
-
info.row.original.cwdPaths.length === 1 ? "" : "s"
|
|
34
|
-
]
|
|
35
|
-
})]
|
|
36
|
-
}),
|
|
37
|
-
header: "Project"
|
|
38
|
-
}),
|
|
39
|
-
columnHelper.accessor("threadCount", {
|
|
40
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
41
|
-
className: "font-mono text-sm",
|
|
42
|
-
children: formatNumber(info.getValue())
|
|
43
|
-
}),
|
|
44
|
-
header: "Threads"
|
|
45
|
-
}),
|
|
46
|
-
columnHelper.accessor("totalTokens", {
|
|
47
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
48
|
-
className: "font-mono text-sm",
|
|
49
|
-
children: formatTokens(info.getValue())
|
|
50
|
-
}),
|
|
51
|
-
header: "Tokens"
|
|
52
|
-
}),
|
|
53
|
-
columnHelper.accessor("lastUpdatedAtMs", {
|
|
54
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
55
|
-
className: "text-sm",
|
|
56
|
-
suppressHydrationWarning: true,
|
|
57
|
-
children: formatDateTime(info.getValue())
|
|
58
|
-
}),
|
|
59
|
-
header: "Last updated"
|
|
60
|
-
}),
|
|
61
|
-
columnHelper.display({
|
|
62
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
63
|
-
className: "text-[var(--muted-foreground)] text-sm",
|
|
64
|
-
children: formatList(info.row.original.modelNames)
|
|
65
|
-
}),
|
|
66
|
-
header: "Models",
|
|
67
|
-
id: "models"
|
|
68
|
-
}),
|
|
69
|
-
columnHelper.accessor("archivedThreadCount", {
|
|
70
|
-
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
71
|
-
className: "text-sm",
|
|
72
|
-
children: formatNumber(info.getValue())
|
|
73
|
-
}),
|
|
74
|
-
header: "Archived"
|
|
75
|
-
}),
|
|
76
|
-
columnHelper.display({
|
|
77
|
-
cell: (info) => /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
78
|
-
asChild: true,
|
|
79
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
80
|
-
className: "rounded-full",
|
|
81
|
-
size: "icon",
|
|
82
|
-
type: "button",
|
|
83
|
-
variant: "ghost",
|
|
84
|
-
onClick: (event) => event.stopPropagation(),
|
|
85
|
-
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
|
|
86
|
-
})
|
|
87
|
-
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
88
|
-
align: "end",
|
|
89
|
-
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
90
|
-
className: "text-[var(--destructive)]",
|
|
91
|
-
onClick: () => onDeleteProject(info.row.original),
|
|
92
|
-
children: [/* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-4" }), "Delete project"]
|
|
93
|
-
})
|
|
94
|
-
})] }),
|
|
95
|
-
header: "",
|
|
96
|
-
id: "actions"
|
|
97
|
-
})
|
|
98
|
-
];
|
|
99
|
-
function ProjectsTable({ projects, onDeleteProject }) {
|
|
100
|
-
return /* @__PURE__ */ jsx(DataTable, {
|
|
101
|
-
columns: columns(onDeleteProject),
|
|
102
|
-
data: projects,
|
|
103
|
-
emptyMessage: "No projects match the current search.",
|
|
104
|
-
initialSorting: [{
|
|
105
|
-
desc: true,
|
|
106
|
-
id: "lastUpdatedAtMs"
|
|
107
|
-
}]
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/routes/projects.index.tsx?tsr-split=component
|
|
112
|
-
function ProjectsPage() {
|
|
113
|
-
const navigate = useNavigate({ from: Route.fullPath });
|
|
114
|
-
const queryClient = useQueryClient();
|
|
115
|
-
const projects = useSuspenseQuery(projectsQueryOptions()).data;
|
|
116
|
-
const searchInput = Route.useSearch().q ?? "";
|
|
117
|
-
const [pendingDelete, setPendingDelete] = useState(null);
|
|
118
|
-
const deferredSearch = useDeferredValue(searchInput.trim().toLowerCase());
|
|
119
|
-
const deleteProjectMutation = useMutation({
|
|
120
|
-
mutationFn: (input) => deleteProjectFn({ data: input }),
|
|
121
|
-
onSuccess: async () => {
|
|
122
|
-
await Promise.all([
|
|
123
|
-
queryClient.invalidateQueries({ queryKey: ["analytics"] }),
|
|
124
|
-
queryClient.invalidateQueries({ queryKey: ["dashboard"] }),
|
|
125
|
-
queryClient.invalidateQueries({ queryKey: ["projects"] })
|
|
126
|
-
]);
|
|
127
|
-
setPendingDelete(null);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
const visibleProjects = projects.filter((project) => {
|
|
131
|
-
return matchesTextQuery(deferredSearch, [
|
|
132
|
-
project.name,
|
|
133
|
-
project.cwdPaths.join("\n"),
|
|
134
|
-
project.modelNames.join("\n")
|
|
135
|
-
]);
|
|
136
|
-
});
|
|
137
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
138
|
-
className: "space-y-6",
|
|
139
|
-
children: [
|
|
140
|
-
/* @__PURE__ */ jsx(PageHeader, {
|
|
141
|
-
actions: /* @__PURE__ */ jsx(ListSearchInput, {
|
|
142
|
-
placeholder: "Search project name, cwd, or model",
|
|
143
|
-
value: searchInput,
|
|
144
|
-
onValueChange: (value) => {
|
|
145
|
-
startTransition(() => {
|
|
146
|
-
navigate({
|
|
147
|
-
replace: true,
|
|
148
|
-
search: (previous) => withTextQuerySearch(previous, value)
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}),
|
|
153
|
-
eyebrow: "Inventory",
|
|
154
|
-
subtitle: "Derived projects are grouped from the final basename of each thread cwd, matching the existing CLI behavior.",
|
|
155
|
-
title: "Codex"
|
|
156
|
-
}),
|
|
157
|
-
/* @__PURE__ */ jsx(ProjectsTable, {
|
|
158
|
-
projects: visibleProjects,
|
|
159
|
-
onDeleteProject: setPendingDelete
|
|
160
|
-
}),
|
|
161
|
-
/* @__PURE__ */ jsx(DeleteConfirmDialog, {
|
|
162
|
-
confirmLabel: deleteProjectMutation.isPending ? "Deleting..." : "Delete project",
|
|
163
|
-
description: pendingDelete ? `Delete ${pendingDelete.threadCount} thread records for the derived project "${pendingDelete.name}" from the Codex database. Enable Delete Session files to remove the rollout JSONL files too.` : "",
|
|
164
|
-
open: pendingDelete !== null,
|
|
165
|
-
showDeleteSessionFilesOption: true,
|
|
166
|
-
title: "Delete Codex project?",
|
|
167
|
-
onConfirm: ({ deleteSessionFiles }) => {
|
|
168
|
-
if (!pendingDelete) return;
|
|
169
|
-
deleteProjectMutation.mutate({
|
|
170
|
-
deleteSessionFiles,
|
|
171
|
-
project: pendingDelete.name
|
|
172
|
-
});
|
|
173
|
-
},
|
|
174
|
-
onOpenChange: (open) => {
|
|
175
|
-
if (!open) setPendingDelete(null);
|
|
176
|
-
}
|
|
177
|
-
})
|
|
178
|
-
]
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
//#endregion
|
|
182
|
-
export { ProjectsPage as component };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { i as projectsQueryOptions } from "./codex-queries-CtgeZ7VL.js";
|
|
2
|
-
import { i as parseTextQuerySearch } from "./route-search-ts4W9MJ9.js";
|
|
3
|
-
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
|
-
//#region src/routes/projects.index.tsx
|
|
5
|
-
var $$splitErrorComponentImporter = () => import("./projects.index-BLXOx5eL.js");
|
|
6
|
-
var $$splitComponentImporter = () => import("./projects.index-BkLiF2FF.js");
|
|
7
|
-
var Route = createFileRoute("/projects/")({
|
|
8
|
-
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
9
|
-
errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"),
|
|
10
|
-
loader: ({ context }) => context.queryClient.ensureQueryData(projectsQueryOptions()),
|
|
11
|
-
validateSearch: parseTextQuerySearch
|
|
12
|
-
});
|
|
13
|
-
//#endregion
|
|
14
|
-
export { Route as t };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
//#region src/components/reload-error-panel.tsx
|
|
3
|
-
function ReloadErrorPanel({ description, title }) {
|
|
4
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
5
|
-
className: "rounded-xl border border-[var(--border)] bg-[var(--panel)] px-6 py-10 text-center",
|
|
6
|
-
children: [
|
|
7
|
-
/* @__PURE__ */ jsx("p", {
|
|
8
|
-
className: "font-medium text-[var(--destructive)] text-sm",
|
|
9
|
-
children: title
|
|
10
|
-
}),
|
|
11
|
-
/* @__PURE__ */ jsx("p", {
|
|
12
|
-
className: "mt-2 text-[var(--muted-foreground)] text-sm",
|
|
13
|
-
children: description
|
|
14
|
-
}),
|
|
15
|
-
/* @__PURE__ */ jsx("button", {
|
|
16
|
-
className: "mt-4 text-[var(--accent)] text-sm underline-offset-2 hover:underline",
|
|
17
|
-
type: "button",
|
|
18
|
-
onClick: () => window.location.reload(),
|
|
19
|
-
children: "Reload"
|
|
20
|
-
})
|
|
21
|
-
]
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
25
|
-
export { ReloadErrorPanel as t };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//#region src/lib/route-search.ts
|
|
2
|
-
var asNonBlankString = (value) => {
|
|
3
|
-
if (typeof value !== "string") return;
|
|
4
|
-
const trimmed = value.trim();
|
|
5
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
6
|
-
};
|
|
7
|
-
var parseTextQuerySearch = (search) => {
|
|
8
|
-
const q = asNonBlankString(search.q);
|
|
9
|
-
return q ? { q } : {};
|
|
10
|
-
};
|
|
11
|
-
var parseAnalyticsSearch = (search) => {
|
|
12
|
-
const project = asNonBlankString(search.project);
|
|
13
|
-
return project ? { project } : {};
|
|
14
|
-
};
|
|
15
|
-
var withTextQuerySearch = (current, query) => {
|
|
16
|
-
const next = { ...current };
|
|
17
|
-
const q = asNonBlankString(query);
|
|
18
|
-
if (q) next.q = q;
|
|
19
|
-
else delete next.q;
|
|
20
|
-
return next;
|
|
21
|
-
};
|
|
22
|
-
var withAnalyticsProjectSearch = (current, project) => {
|
|
23
|
-
const next = { ...current };
|
|
24
|
-
const trimmedProject = asNonBlankString(project);
|
|
25
|
-
if (trimmedProject) next.project = trimmedProject;
|
|
26
|
-
else delete next.project;
|
|
27
|
-
return next;
|
|
28
|
-
};
|
|
29
|
-
var ALL_PROJECTS_SELECT_VALUE = "__all__";
|
|
30
|
-
var PROJECT_SELECT_PREFIX = "project:";
|
|
31
|
-
var encodeAnalyticsProjectSelectValue = (project) => {
|
|
32
|
-
return project ? `${PROJECT_SELECT_PREFIX}${project}` : ALL_PROJECTS_SELECT_VALUE;
|
|
33
|
-
};
|
|
34
|
-
var decodeAnalyticsProjectSelectValue = (value) => {
|
|
35
|
-
return value === ALL_PROJECTS_SELECT_VALUE || !value.startsWith(PROJECT_SELECT_PREFIX) ? null : value.slice(8);
|
|
36
|
-
};
|
|
37
|
-
//#endregion
|
|
38
|
-
export { withAnalyticsProjectSearch as a, parseTextQuerySearch as i, encodeAnalyticsProjectSelectValue as n, withTextQuerySearch as o, parseAnalyticsSearch as r, decodeAnalyticsProjectSelectValue as t };
|