spiracha 1.5.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 +114 -205
- package/README.md +89 -269
- package/apps/ui/AGENTS.md +17 -7
- package/apps/ui/README.md +34 -8
- package/apps/ui/components.json +21 -0
- package/apps/ui/package.json +65 -0
- 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 +46 -73
- 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/codex-analytics.ts +1 -1
- package/src/lib/codex-browser-db.ts +410 -74
- package/src/lib/codex-browser-export.ts +6 -14
- package/src/lib/codex-browser-types.ts +1 -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/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/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/apps/ui/dist/client/assets/_threadId-CAIeH5mq.js +0 -1
- package/apps/ui/dist/client/assets/analytics-DOy1b6Sh.js +0 -1
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-DqySVO2K.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-B77qJz6f.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-B3NM6gRH.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-ByitGWki.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-DP9JC2P9.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-DgW25FEV.js +0 -1
- package/apps/ui/dist/client/assets/badge-C3i4OKs8.js +0 -1
- package/apps/ui/dist/client/assets/checkbox-CdHitXWQ.js +0 -1
- package/apps/ui/dist/client/assets/claude-code-sessions._sessionId-8pQ55ci2.js +0 -1
- package/apps/ui/dist/client/assets/claude-code-sessions._sessionId-DVz5UmtU.js +0 -1
- package/apps/ui/dist/client/assets/claude-code._workspaceKey-BBKskSum.js +0 -1
- package/apps/ui/dist/client/assets/claude-code._workspaceKey-OkikMUFs.js +0 -1
- package/apps/ui/dist/client/assets/claude-code.index-Cwu76dbb.js +0 -1
- package/apps/ui/dist/client/assets/claude-code.index-D6eMd08t.js +0 -1
- package/apps/ui/dist/client/assets/createServerFn-B-KkwmHU.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-hBWlP1D-.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-BFPkIRi-.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-CaAZjGmm.js +0 -1
- package/apps/ui/dist/client/assets/cursor.index-8y4o20kb.js +0 -2
- package/apps/ui/dist/client/assets/cursor.index-CrnMwDCi.js +0 -1
- package/apps/ui/dist/client/assets/data-table-Br78_dk3.js +0 -4
- package/apps/ui/dist/client/assets/delete-confirm-dialog-Bxs07u-j.js +0 -7
- package/apps/ui/dist/client/assets/dist-B9pyYCVU.js +0 -1
- package/apps/ui/dist/client/assets/dist-BrJhN2A0.js +0 -5
- package/apps/ui/dist/client/assets/dist-Cmd3AIfD.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-D5cvPaZt.js +0 -1
- package/apps/ui/dist/client/assets/es2015-ad6040dw.js +0 -41
- package/apps/ui/dist/client/assets/export-dialog-Dr8d2MqD.js +0 -1
- package/apps/ui/dist/client/assets/formatters-BtqyrX_c.js +0 -1
- package/apps/ui/dist/client/assets/index-C-STgIH4.js +0 -166
- package/apps/ui/dist/client/assets/jsx-runtime-DGeXAQPT.js +0 -1
- package/apps/ui/dist/client/assets/kiro-sessions._sessionId-CKgfJ7GR.js +0 -1
- package/apps/ui/dist/client/assets/kiro-sessions._sessionId-zvIJHtQF.js +0 -1
- package/apps/ui/dist/client/assets/kiro._workspaceKey-DhVuJuZB.js +0 -1
- package/apps/ui/dist/client/assets/kiro._workspaceKey-QArsjkTY.js +0 -1
- package/apps/ui/dist/client/assets/kiro.index-C-fr4m7i.js +0 -1
- package/apps/ui/dist/client/assets/kiro.index-OYgAdtZd.js +0 -1
- package/apps/ui/dist/client/assets/metric-card-Dplm0ZiM.js +0 -1
- package/apps/ui/dist/client/assets/opencode-sessions._sessionId-DLjiTst-.js +0 -1
- package/apps/ui/dist/client/assets/opencode-sessions._sessionId-biBwrRbt.js +0 -8
- package/apps/ui/dist/client/assets/opencode._workspaceKey-C7OIzMOJ.js +0 -1
- package/apps/ui/dist/client/assets/opencode._workspaceKey-sBakX0oI.js +0 -1
- package/apps/ui/dist/client/assets/opencode.index-Bl_kNs9N.js +0 -1
- package/apps/ui/dist/client/assets/opencode.index-CN53bVmb.js +0 -1
- package/apps/ui/dist/client/assets/page-header-Cwa3p6Tl.js +0 -1
- package/apps/ui/dist/client/assets/preload-helper-B8fFrdxC.js +0 -1
- package/apps/ui/dist/client/assets/projects._project-D8WloxQN.js +0 -1
- package/apps/ui/dist/client/assets/projects._project-DSDwH4NF.js +0 -1
- package/apps/ui/dist/client/assets/projects.index-5xRtuJdX.js +0 -3
- package/apps/ui/dist/client/assets/projects.index-DEfhWqa8.js +0 -1
- 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-DnzF_9CX.js +0 -1
- package/apps/ui/dist/client/assets/scroll-text-fM0sMOB3.js +0 -1
- package/apps/ui/dist/client/assets/select-CYF6pF37.js +0 -1
- package/apps/ui/dist/client/assets/settings-Dx70jgP_.js +0 -1
- package/apps/ui/dist/client/assets/sqlite-error-B6uZjUe8.js +0 -1
- package/apps/ui/dist/client/assets/styles-B7Zi9EFA.css +0 -1
- package/apps/ui/dist/client/assets/tabs-CmuhkT-c.js +0 -7
- package/apps/ui/dist/client/assets/text-filter-DVAZySUS.js +0 -2
- package/apps/ui/dist/client/assets/thread-transcript-stats-BUNz6u7F.js +0 -1
- package/apps/ui/dist/client/assets/threads._threadId-BB9tTsV4.js +0 -1
- package/apps/ui/dist/client/assets/threads._threadId-BMRSFow3.js +0 -1
- package/apps/ui/dist/client/assets/useMutation-BSFult2i.js +0 -1
- package/apps/ui/dist/client/assets/useQuery-CjINKZf1.js +0 -1
- package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CQ8Jjs3B.js +0 -387
- 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-BKOyL2T6.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-eS87Dx7g.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/claude-code-db-Ik3VStKZ.js +0 -361
- package/apps/ui/dist/server/assets/claude-code-queries-Cgzi4K-e.js +0 -37
- package/apps/ui/dist/server/assets/claude-code-server-PfraClXS.js +0 -72
- package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-C55oe6zj.js +0 -18
- package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-D1RYYi3j.js +0 -473
- package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-DSvPLEUL.js +0 -11
- package/apps/ui/dist/server/assets/claude-code-transcript-C-bxh3cS.js +0 -139
- package/apps/ui/dist/server/assets/claude-code-transcript-phase-DmUMc8VU.js +0 -10
- package/apps/ui/dist/server/assets/claude-code._workspaceKey-B5Xg_-tE.js +0 -28
- package/apps/ui/dist/server/assets/claude-code._workspaceKey-BPlzyXPa.js +0 -11
- package/apps/ui/dist/server/assets/claude-code._workspaceKey-DqDve2wl.js +0 -191
- package/apps/ui/dist/server/assets/claude-code.index-B7yYR7dD.js +0 -92
- package/apps/ui/dist/server/assets/claude-code.index-BUHThG1W.js +0 -11
- package/apps/ui/dist/server/assets/codex-queries-CtgeZ7VL.js +0 -99
- package/apps/ui/dist/server/assets/codex-server-CGXU4H8-.js +0 -2294
- 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-CZnYy7aT.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-CXpO8KcD.js +0 -361
- package/apps/ui/dist/server/assets/cursor-server-DNu52A3K.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-Ckn6ItHI.js +0 -582
- package/apps/ui/dist/server/assets/cursor-threads._composerId-p9-ARAzc.js +0 -18
- package/apps/ui/dist/server/assets/cursor-transcript-B7tGnqtn.js +0 -125
- package/apps/ui/dist/server/assets/cursor._workspaceKey-CZuohIUL.js +0 -28
- package/apps/ui/dist/server/assets/cursor._workspaceKey-DPp5JSjy.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-D88ze9Gy.js +0 -240
- package/apps/ui/dist/server/assets/formatters-FJaGZgJk.js +0 -91
- package/apps/ui/dist/server/assets/kiro-db--fXrED_-.js +0 -552
- package/apps/ui/dist/server/assets/kiro-queries-CzNlM2ok.js +0 -37
- package/apps/ui/dist/server/assets/kiro-server-9WRxg2Au.js +0 -72
- package/apps/ui/dist/server/assets/kiro-sessions._sessionId-CRY2c7YO.js +0 -11
- package/apps/ui/dist/server/assets/kiro-sessions._sessionId-F1UlwxmR.js +0 -449
- package/apps/ui/dist/server/assets/kiro-sessions._sessionId-bvTulT7C.js +0 -18
- package/apps/ui/dist/server/assets/kiro-transcript-DoekQBaH.js +0 -112
- package/apps/ui/dist/server/assets/kiro-transcript-phase-CJG40nQg.js +0 -27
- package/apps/ui/dist/server/assets/kiro._workspaceKey-BDe9sQwo.js +0 -11
- package/apps/ui/dist/server/assets/kiro._workspaceKey-CJsjgNwO.js +0 -28
- package/apps/ui/dist/server/assets/kiro._workspaceKey-D_-4Qb7y.js +0 -193
- package/apps/ui/dist/server/assets/kiro.index-C__-UROk.js +0 -11
- package/apps/ui/dist/server/assets/kiro.index-CmTbqeYj.js +0 -93
- 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/opencode-db-BM7KjOzc.js +0 -397
- package/apps/ui/dist/server/assets/opencode-queries-BeNYXnQv.js +0 -50
- package/apps/ui/dist/server/assets/opencode-server-BpQ_kRze.js +0 -72
- package/apps/ui/dist/server/assets/opencode-sessions._sessionId-CGQ-t0vD.js +0 -518
- package/apps/ui/dist/server/assets/opencode-sessions._sessionId-D8Q7in_Z.js +0 -18
- package/apps/ui/dist/server/assets/opencode-sessions._sessionId-DKOvi0lV.js +0 -11
- package/apps/ui/dist/server/assets/opencode-think-tags-CAoD-EcZ.js +0 -87
- package/apps/ui/dist/server/assets/opencode-transcript-BNTcGNym.js +0 -141
- package/apps/ui/dist/server/assets/opencode-transcript-phase-OqLkiQD0.js +0 -32
- package/apps/ui/dist/server/assets/opencode._workspaceKey-BdqcWHw1.js +0 -11
- package/apps/ui/dist/server/assets/opencode._workspaceKey-CfH96HTT.js +0 -28
- package/apps/ui/dist/server/assets/opencode._workspaceKey-DdbHPDrO.js +0 -207
- package/apps/ui/dist/server/assets/opencode.index-BbVzkJXP.js +0 -11
- package/apps/ui/dist/server/assets/opencode.index-Vh_Gq_1L.js +0 -93
- 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-4io5LO0E.js +0 -20
- package/apps/ui/dist/server/assets/projects._project-Bshqk7JA.js +0 -12
- package/apps/ui/dist/server/assets/projects._project-D6ZoGhJ8.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-Sac2DGk6.js +0 -518
- 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-DyhChtHf.js +0 -137
- package/apps/ui/dist/server/assets/source-session-export-server-DNutCawb.js +0 -38
- package/apps/ui/dist/server/assets/sqlite-error-LZDrnxdd.js +0 -13
- package/apps/ui/dist/server/assets/start-B_HFwkkk.js +0 -4
- package/apps/ui/dist/server/assets/tabs-DkaChNVg.js +0 -501
- package/apps/ui/dist/server/assets/text-filter-CGKxMCKt.js +0 -36
- package/apps/ui/dist/server/assets/thread-transcript-stats-Dh34mt2u.js +0 -45
- package/apps/ui/dist/server/assets/threads._threadId-BSSK4nkI.js +0 -26
- package/apps/ui/dist/server/assets/threads._threadId-BeXEc4Lo.js +0 -648
- package/apps/ui/dist/server/assets/threads._threadId-Ci0S4mKU.js +0 -18
- 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 -5895
- 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}/icon.svg +0 -0
- /package/apps/ui/{dist/client → public}/manifest.json +0 -0
- /package/apps/ui/{dist/client → public}/robots.txt +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listOpenCodeSessionsForGroup,
|
|
3
|
+
listOpenCodeWorkspaceGroups,
|
|
4
|
+
readOpenCodeSessionTranscript,
|
|
5
|
+
} from '../opencode-db';
|
|
6
|
+
import type {
|
|
7
|
+
OpenCodeSessionSummary,
|
|
8
|
+
OpenCodeSessionTranscript,
|
|
9
|
+
OpenCodeTranscriptPart,
|
|
10
|
+
} from '../opencode-exporter-types';
|
|
11
|
+
import { resolveOpenCodeDbPath } from '../opencode-exporter-types';
|
|
12
|
+
import { splitOpenCodeThinkTaggedText } from '../opencode-think-tags';
|
|
13
|
+
import { getFinalOpenCodeAssistantTextPartIds, getOpenCodeTextPartPhase } from '../opencode-transcript-phase';
|
|
14
|
+
import { cleanInlineTitle } from '../shared';
|
|
15
|
+
import {
|
|
16
|
+
createDeepLinks,
|
|
17
|
+
createTextMessage,
|
|
18
|
+
finalizeMessages,
|
|
19
|
+
normalizeAssistantPhase,
|
|
20
|
+
normalizeRole,
|
|
21
|
+
} from './adapter-helpers';
|
|
22
|
+
import { selectConversationMessages } from './message-selector';
|
|
23
|
+
import { getConversationPathMatch } from './path-match';
|
|
24
|
+
import type {
|
|
25
|
+
ConversationAdapter,
|
|
26
|
+
ConversationDetail,
|
|
27
|
+
ConversationMessage,
|
|
28
|
+
ConversationPathMatch,
|
|
29
|
+
GetConversationOptions,
|
|
30
|
+
ListConversationsForPathOptions,
|
|
31
|
+
} from './types';
|
|
32
|
+
|
|
33
|
+
const getDbPath = (options: { locations?: { opencodeDbPath?: string } }) =>
|
|
34
|
+
options.locations?.opencodeDbPath ?? resolveOpenCodeDbPath();
|
|
35
|
+
|
|
36
|
+
const textPartToMessages = (
|
|
37
|
+
part: OpenCodeTranscriptPart,
|
|
38
|
+
finalTextPartIds: Set<string>,
|
|
39
|
+
order: number,
|
|
40
|
+
): ConversationMessage[] => {
|
|
41
|
+
const split = splitOpenCodeThinkTaggedText(part.text ?? '');
|
|
42
|
+
return [
|
|
43
|
+
...createTextMessage({
|
|
44
|
+
createdAtMs: part.createdAtMs,
|
|
45
|
+
id: `${part.partId}:reasoning`,
|
|
46
|
+
order,
|
|
47
|
+
phase: 'reasoning',
|
|
48
|
+
role: 'assistant',
|
|
49
|
+
text: split.reasoningBlocks.join('\n\n'),
|
|
50
|
+
}),
|
|
51
|
+
...createTextMessage({
|
|
52
|
+
createdAtMs: part.createdAtMs,
|
|
53
|
+
id: part.partId,
|
|
54
|
+
order,
|
|
55
|
+
phase: normalizeAssistantPhase(getOpenCodeTextPartPhase(part, finalTextPartIds), 'unknown'),
|
|
56
|
+
role: normalizeRole(part.role),
|
|
57
|
+
text: split.visibleText,
|
|
58
|
+
}),
|
|
59
|
+
];
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const partToMessages = (
|
|
63
|
+
part: OpenCodeTranscriptPart,
|
|
64
|
+
finalTextPartIds: Set<string>,
|
|
65
|
+
order: number,
|
|
66
|
+
): ConversationMessage[] => {
|
|
67
|
+
if (part.type === 'text') {
|
|
68
|
+
return textPartToMessages(part, finalTextPartIds, order);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (part.type === 'reasoning') {
|
|
72
|
+
return createTextMessage({
|
|
73
|
+
createdAtMs: part.createdAtMs,
|
|
74
|
+
id: part.partId,
|
|
75
|
+
order,
|
|
76
|
+
phase: 'reasoning',
|
|
77
|
+
role: 'assistant',
|
|
78
|
+
text: part.text,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (part.type === 'tool') {
|
|
83
|
+
return createTextMessage({
|
|
84
|
+
createdAtMs: part.createdAtMs,
|
|
85
|
+
id: part.partId,
|
|
86
|
+
metadata: { callId: part.callId, status: part.status, toolName: part.toolName },
|
|
87
|
+
order,
|
|
88
|
+
phase: part.outputText ? 'tool_output' : 'tool_call',
|
|
89
|
+
role: 'tool',
|
|
90
|
+
text: part.outputText ?? part.argumentsText ?? part.title ?? part.toolName,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return [];
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const transcriptToMessages = (transcript: OpenCodeSessionTranscript) => {
|
|
98
|
+
const parts = transcript.messages.flatMap((message) => message.parts);
|
|
99
|
+
const finalTextPartIds = getFinalOpenCodeAssistantTextPartIds(parts);
|
|
100
|
+
return finalizeMessages(parts.flatMap((part, order) => partToMessages(part, finalTextPartIds, order)));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const buildConversation = async (
|
|
104
|
+
session: OpenCodeSessionSummary,
|
|
105
|
+
dbPath: string,
|
|
106
|
+
matches: ConversationPathMatch[],
|
|
107
|
+
options: Pick<ListConversationsForPathOptions, 'includeMessages' | 'messageSelector'>,
|
|
108
|
+
loadedTranscript: OpenCodeSessionTranscript | null = null,
|
|
109
|
+
): Promise<ConversationDetail> => {
|
|
110
|
+
const transcript =
|
|
111
|
+
loadedTranscript ??
|
|
112
|
+
(options.includeMessages ? await readOpenCodeSessionTranscript(dbPath, session.sessionId) : null);
|
|
113
|
+
const allMessages = transcript ? transcriptToMessages(transcript) : [];
|
|
114
|
+
const messages = options.includeMessages
|
|
115
|
+
? selectConversationMessages(allMessages, options.messageSelector ?? 'last_final_answer')
|
|
116
|
+
: [];
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
createdAtMs: session.createdAtMs,
|
|
120
|
+
deepLinks: createDeepLinks('opencode', session.sessionId, `/opencode-sessions/${session.sessionId}`),
|
|
121
|
+
id: session.sessionId,
|
|
122
|
+
matches,
|
|
123
|
+
messageCount: options.includeMessages ? allMessages.length : session.messageCount,
|
|
124
|
+
messages,
|
|
125
|
+
metadata: {
|
|
126
|
+
agent: session.agent,
|
|
127
|
+
cost: session.cost,
|
|
128
|
+
model: session.model,
|
|
129
|
+
modelLabel: session.modelLabel,
|
|
130
|
+
totalTokens: session.totalTokens,
|
|
131
|
+
},
|
|
132
|
+
source: 'opencode',
|
|
133
|
+
title: cleanInlineTitle(session.title),
|
|
134
|
+
updatedAtMs: session.lastUpdatedAtMs,
|
|
135
|
+
workspaceKey: session.workspaceKey,
|
|
136
|
+
workspacePath: session.worktree,
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const listOpenCodeConversationsForPath = async (options: ListConversationsForPathOptions) => {
|
|
141
|
+
const dbPath = getDbPath(options);
|
|
142
|
+
const groups = await listOpenCodeWorkspaceGroups(dbPath);
|
|
143
|
+
const conversations: ConversationDetail[] = [];
|
|
144
|
+
|
|
145
|
+
for (const group of groups) {
|
|
146
|
+
const match = await getConversationPathMatch(options.cwd, group.worktree);
|
|
147
|
+
if (!match) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
const sessions = await listOpenCodeSessionsForGroup(group.key, dbPath);
|
|
151
|
+
for (const session of sessions) {
|
|
152
|
+
conversations.push(await buildConversation(session, dbPath, [match], options));
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return conversations;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const getOpenCodeConversation = async (options: GetConversationOptions): Promise<ConversationDetail | null> => {
|
|
160
|
+
const dbPath = getDbPath(options);
|
|
161
|
+
const transcript = await readOpenCodeSessionTranscript(dbPath, options.id);
|
|
162
|
+
return transcript
|
|
163
|
+
? buildConversation(
|
|
164
|
+
transcript.session,
|
|
165
|
+
dbPath,
|
|
166
|
+
[],
|
|
167
|
+
{
|
|
168
|
+
includeMessages: true,
|
|
169
|
+
messageSelector: options.messageSelector ?? 'all',
|
|
170
|
+
},
|
|
171
|
+
transcript,
|
|
172
|
+
)
|
|
173
|
+
: null;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export const opencodeConversationAdapter: ConversationAdapter = {
|
|
177
|
+
getConversation: getOpenCodeConversation,
|
|
178
|
+
listConversationsForPath: listOpenCodeConversationsForPath,
|
|
179
|
+
source: 'opencode',
|
|
180
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { realpath } from 'node:fs/promises';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import type { ConversationPathMatch } from './types';
|
|
5
|
+
|
|
6
|
+
const expandHome = (value: string) => {
|
|
7
|
+
if (value === '~') {
|
|
8
|
+
return os.homedir();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
if (value.startsWith('~/') || value.startsWith('~\\')) {
|
|
12
|
+
return path.join(os.homedir(), value.slice(2));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return value;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const trimTrailingSeparators = (value: string) => {
|
|
19
|
+
const trimmed = value.replace(/[\\/]+$/u, '');
|
|
20
|
+
return trimmed || value;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const normalizeSeparators = (value: string) => value.replace(/\\/gu, '/');
|
|
24
|
+
|
|
25
|
+
export const normalizeConversationPath = async (value: string): Promise<string> => {
|
|
26
|
+
const expanded = expandHome(value.trim());
|
|
27
|
+
const absolute = path.isAbsolute(expanded) ? expanded : path.resolve(expanded);
|
|
28
|
+
const resolved = await realpath(absolute).catch(() => absolute);
|
|
29
|
+
return normalizeSeparators(trimTrailingSeparators(resolved));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const getConversationPathMatch = async (
|
|
33
|
+
requestedPath: string,
|
|
34
|
+
candidatePath: string | null,
|
|
35
|
+
): Promise<ConversationPathMatch | null> => {
|
|
36
|
+
if (!candidatePath?.trim()) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const [requested, candidate] = await Promise.all([
|
|
41
|
+
normalizeConversationPath(requestedPath),
|
|
42
|
+
normalizeConversationPath(candidatePath),
|
|
43
|
+
]);
|
|
44
|
+
|
|
45
|
+
if (requested === candidate) {
|
|
46
|
+
return {
|
|
47
|
+
candidatePath: candidate,
|
|
48
|
+
kind: 'exact',
|
|
49
|
+
requestedPath: requested,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (
|
|
54
|
+
(requested === '/' && candidate !== '/' && candidate.startsWith('/')) ||
|
|
55
|
+
candidate.startsWith(`${requested}/`)
|
|
56
|
+
) {
|
|
57
|
+
return {
|
|
58
|
+
candidatePath: candidate,
|
|
59
|
+
kind: 'descendant',
|
|
60
|
+
requestedPath: requested,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const getFirstConversationPathMatch = async (
|
|
68
|
+
requestedPath: string,
|
|
69
|
+
candidatePaths: Array<string | null>,
|
|
70
|
+
): Promise<ConversationPathMatch | null> => {
|
|
71
|
+
for (const candidatePath of candidatePaths) {
|
|
72
|
+
const match = await getConversationPathMatch(requestedPath, candidatePath);
|
|
73
|
+
if (match) {
|
|
74
|
+
return match;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return null;
|
|
79
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { mapWithConcurrency } from '../concurrency';
|
|
2
|
+
import {
|
|
3
|
+
listQoderSessionsForGroup,
|
|
4
|
+
listQoderWorkspaceGroups,
|
|
5
|
+
readQoderSessionTranscript,
|
|
6
|
+
resolveQoderCliProjectsDir,
|
|
7
|
+
} from '../qoder-db';
|
|
8
|
+
import type {
|
|
9
|
+
QoderSessionSummary,
|
|
10
|
+
QoderSessionTranscript,
|
|
11
|
+
QoderTranscriptEntry,
|
|
12
|
+
QoderTranscriptPart,
|
|
13
|
+
} from '../qoder-exporter-types';
|
|
14
|
+
import { resolveQoderGlobalStateDb, resolveQoderWorkspaceStorageDir } from '../qoder-exporter-types';
|
|
15
|
+
import { getFinalQoderAssistantMessageEntryIds, getQoderMessagePhase } from '../qoder-transcript-phase';
|
|
16
|
+
import { cleanInlineTitle } from '../shared';
|
|
17
|
+
import {
|
|
18
|
+
createDeepLinks,
|
|
19
|
+
createTextMessage,
|
|
20
|
+
finalizeMessages,
|
|
21
|
+
normalizeAssistantPhase,
|
|
22
|
+
normalizeRole,
|
|
23
|
+
toDateMs,
|
|
24
|
+
} from './adapter-helpers';
|
|
25
|
+
import { selectConversationMessages } from './message-selector';
|
|
26
|
+
import { getConversationPathMatch } from './path-match';
|
|
27
|
+
import type {
|
|
28
|
+
ConversationAdapter,
|
|
29
|
+
ConversationDetail,
|
|
30
|
+
ConversationMessage,
|
|
31
|
+
ConversationPathMatch,
|
|
32
|
+
GetConversationOptions,
|
|
33
|
+
ListConversationsForPathOptions,
|
|
34
|
+
} from './types';
|
|
35
|
+
|
|
36
|
+
const QODER_CONVERSATION_HYDRATION_CONCURRENCY = 4;
|
|
37
|
+
|
|
38
|
+
const getQoderLocations = (options: {
|
|
39
|
+
locations?: {
|
|
40
|
+
qoderAcpSocketPath?: string;
|
|
41
|
+
qoderCliProjectsDir?: string;
|
|
42
|
+
qoderGlobalStateDb?: string;
|
|
43
|
+
qoderWorkspaceStorageDir?: string;
|
|
44
|
+
};
|
|
45
|
+
}) => ({
|
|
46
|
+
acpSocketPath: options.locations?.qoderAcpSocketPath,
|
|
47
|
+
cliProjectsDir: options.locations?.qoderCliProjectsDir ?? resolveQoderCliProjectsDir(),
|
|
48
|
+
globalStateDb: options.locations?.qoderGlobalStateDb ?? resolveQoderGlobalStateDb(),
|
|
49
|
+
workspaceStorageDir: options.locations?.qoderWorkspaceStorageDir ?? resolveQoderWorkspaceStorageDir(),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const isWithinUpdatedWindow = (
|
|
53
|
+
session: QoderSessionSummary,
|
|
54
|
+
options: Pick<ListConversationsForPathOptions, 'updatedAfterMs' | 'updatedBeforeMs'>,
|
|
55
|
+
): boolean => {
|
|
56
|
+
const updatedAtMs = session.lastActiveAtMs ?? 0;
|
|
57
|
+
if (options.updatedAfterMs !== undefined && updatedAtMs < options.updatedAfterMs) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (options.updatedBeforeMs !== undefined && updatedAtMs > options.updatedBeforeMs) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const partToMessages = (
|
|
67
|
+
entry: QoderTranscriptEntry,
|
|
68
|
+
part: QoderTranscriptPart,
|
|
69
|
+
partIndex: number,
|
|
70
|
+
finalEntryIds: Set<string>,
|
|
71
|
+
): ConversationMessage[] => {
|
|
72
|
+
if (entry.entryType === 'tool_call') {
|
|
73
|
+
return createTextMessage({
|
|
74
|
+
createdAtMs: toDateMs(entry.timestamp),
|
|
75
|
+
id: `${entry.entryId}:${partIndex}`,
|
|
76
|
+
metadata: { requestId: entry.requestId },
|
|
77
|
+
order: partIndex,
|
|
78
|
+
phase: 'tool_call',
|
|
79
|
+
role: 'tool',
|
|
80
|
+
text: part.text,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (entry.entryType === 'tool_output') {
|
|
85
|
+
return createTextMessage({
|
|
86
|
+
createdAtMs: toDateMs(entry.timestamp),
|
|
87
|
+
id: `${entry.entryId}:${partIndex}`,
|
|
88
|
+
metadata: { requestId: entry.requestId },
|
|
89
|
+
order: partIndex,
|
|
90
|
+
phase: 'tool_output',
|
|
91
|
+
role: 'tool',
|
|
92
|
+
text: part.text,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return createTextMessage({
|
|
97
|
+
createdAtMs: toDateMs(entry.timestamp),
|
|
98
|
+
id: `${entry.entryId}:${partIndex}`,
|
|
99
|
+
order: partIndex,
|
|
100
|
+
phase: normalizeAssistantPhase(getQoderMessagePhase(entry, finalEntryIds), 'unknown'),
|
|
101
|
+
role: normalizeRole(entry.role),
|
|
102
|
+
text: part.text,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const transcriptToMessages = (transcript: QoderSessionTranscript) => {
|
|
107
|
+
const finalEntryIds = getFinalQoderAssistantMessageEntryIds(transcript.entries);
|
|
108
|
+
return finalizeMessages(
|
|
109
|
+
transcript.entries.flatMap((entry) =>
|
|
110
|
+
entry.parts.flatMap((part, partIndex) => partToMessages(entry, part, partIndex, finalEntryIds)),
|
|
111
|
+
),
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const buildConversation = async (
|
|
116
|
+
session: QoderSessionSummary,
|
|
117
|
+
locations: ReturnType<typeof getQoderLocations>,
|
|
118
|
+
matches: ConversationPathMatch[],
|
|
119
|
+
options: Pick<ListConversationsForPathOptions, 'includeMessages' | 'messageSelector'>,
|
|
120
|
+
): Promise<ConversationDetail> => {
|
|
121
|
+
const transcript = options.includeMessages
|
|
122
|
+
? await readQoderSessionTranscript(
|
|
123
|
+
locations.globalStateDb,
|
|
124
|
+
locations.workspaceStorageDir,
|
|
125
|
+
session.sessionId,
|
|
126
|
+
locations.cliProjectsDir,
|
|
127
|
+
{
|
|
128
|
+
acpSocketPath: locations.acpSocketPath,
|
|
129
|
+
enableAcp: locations.acpSocketPath ? true : undefined,
|
|
130
|
+
},
|
|
131
|
+
)
|
|
132
|
+
: null;
|
|
133
|
+
const allMessages = transcript ? transcriptToMessages(transcript) : [];
|
|
134
|
+
const messages = options.includeMessages
|
|
135
|
+
? selectConversationMessages(allMessages, options.messageSelector ?? 'last_final_answer')
|
|
136
|
+
: [];
|
|
137
|
+
const assistantMessageCount = options.includeMessages
|
|
138
|
+
? allMessages.filter((message) => message.role === 'assistant').length
|
|
139
|
+
: session.assistantMessageCount;
|
|
140
|
+
const userMessageCount = options.includeMessages
|
|
141
|
+
? allMessages.filter((message) => message.role === 'user').length
|
|
142
|
+
: session.userMessageCount;
|
|
143
|
+
const renderablePartCount = options.includeMessages ? allMessages.length : session.renderablePartCount;
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
createdAtMs: session.createdAtMs,
|
|
147
|
+
deepLinks: createDeepLinks('qoder', session.sessionId, `/qoder-sessions/${session.sessionId}`),
|
|
148
|
+
id: session.sessionId,
|
|
149
|
+
matches,
|
|
150
|
+
messageCount: options.includeMessages ? allMessages.length : session.messageCount,
|
|
151
|
+
messages,
|
|
152
|
+
metadata: {
|
|
153
|
+
agentClass: session.agentClass,
|
|
154
|
+
assistantMessageCount,
|
|
155
|
+
executionMode: session.executionMode,
|
|
156
|
+
fileOperationCount: session.fileOperationCount,
|
|
157
|
+
historyIds: session.historyIds,
|
|
158
|
+
model: session.model,
|
|
159
|
+
query: session.query,
|
|
160
|
+
renderablePartCount,
|
|
161
|
+
requestId: session.requestId,
|
|
162
|
+
sourceStatePath: session.sourceStatePath,
|
|
163
|
+
status: session.status,
|
|
164
|
+
taskId: session.taskId,
|
|
165
|
+
userMessageCount,
|
|
166
|
+
workspaceStorageId: session.workspaceStorageId,
|
|
167
|
+
},
|
|
168
|
+
source: 'qoder',
|
|
169
|
+
title: cleanInlineTitle(session.title),
|
|
170
|
+
updatedAtMs: session.lastActiveAtMs,
|
|
171
|
+
workspaceKey: session.workspaceKey,
|
|
172
|
+
workspacePath: session.worktree,
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const listQoderConversationsForPath = async (options: ListConversationsForPathOptions) => {
|
|
177
|
+
const locations = getQoderLocations(options);
|
|
178
|
+
const groups = await listQoderWorkspaceGroups(locations.globalStateDb, locations.workspaceStorageDir);
|
|
179
|
+
const candidates: { match: ConversationPathMatch; session: QoderSessionSummary }[] = [];
|
|
180
|
+
|
|
181
|
+
for (const group of groups) {
|
|
182
|
+
const match = await getConversationPathMatch(options.cwd, group.worktree);
|
|
183
|
+
if (!match) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const sessions = await listQoderSessionsForGroup(
|
|
188
|
+
group.key,
|
|
189
|
+
locations.globalStateDb,
|
|
190
|
+
locations.workspaceStorageDir,
|
|
191
|
+
);
|
|
192
|
+
for (const session of sessions) {
|
|
193
|
+
if (!isWithinUpdatedWindow(session, options)) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
candidates.push({ match, session });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return await mapWithConcurrency(candidates, QODER_CONVERSATION_HYDRATION_CONCURRENCY, ({ match, session }) =>
|
|
202
|
+
buildConversation(session, locations, [match], options),
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const getQoderConversation = async (options: GetConversationOptions): Promise<ConversationDetail | null> => {
|
|
207
|
+
const locations = getQoderLocations(options);
|
|
208
|
+
const transcript = await readQoderSessionTranscript(
|
|
209
|
+
locations.globalStateDb,
|
|
210
|
+
locations.workspaceStorageDir,
|
|
211
|
+
options.id,
|
|
212
|
+
locations.cliProjectsDir,
|
|
213
|
+
{
|
|
214
|
+
acpSocketPath: locations.acpSocketPath,
|
|
215
|
+
enableAcp: locations.acpSocketPath ? true : undefined,
|
|
216
|
+
},
|
|
217
|
+
);
|
|
218
|
+
return transcript
|
|
219
|
+
? buildConversation(transcript.session, locations, [], {
|
|
220
|
+
includeMessages: true,
|
|
221
|
+
messageSelector: options.messageSelector ?? 'all',
|
|
222
|
+
})
|
|
223
|
+
: null;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const qoderConversationAdapter: ConversationAdapter = {
|
|
227
|
+
getConversation: getQoderConversation,
|
|
228
|
+
listConversationsForPath: listQoderConversationsForPath,
|
|
229
|
+
source: 'qoder',
|
|
230
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
export const CONVERSATION_SOURCES = [
|
|
2
|
+
'codex',
|
|
3
|
+
'claude-code',
|
|
4
|
+
'kiro',
|
|
5
|
+
'qoder',
|
|
6
|
+
'cursor',
|
|
7
|
+
'antigravity',
|
|
8
|
+
'opencode',
|
|
9
|
+
] as const;
|
|
10
|
+
|
|
11
|
+
export type ConversationSource = (typeof CONVERSATION_SOURCES)[number];
|
|
12
|
+
|
|
13
|
+
export type ConversationMessageRole = 'assistant' | 'system' | 'tool' | 'unknown' | 'user';
|
|
14
|
+
|
|
15
|
+
export type ConversationMessagePhase =
|
|
16
|
+
| 'commentary'
|
|
17
|
+
| 'final_answer'
|
|
18
|
+
| 'reasoning'
|
|
19
|
+
| 'tool_call'
|
|
20
|
+
| 'tool_output'
|
|
21
|
+
| 'unknown';
|
|
22
|
+
|
|
23
|
+
export type ConversationMessageSelector = 'all' | 'last_assistant' | 'last_final_answer';
|
|
24
|
+
|
|
25
|
+
export type ConversationPathMatch = {
|
|
26
|
+
candidatePath: string | null;
|
|
27
|
+
kind: 'descendant' | 'exact' | 'unknown';
|
|
28
|
+
requestedPath: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type ConversationSourceInfo = {
|
|
32
|
+
label: string;
|
|
33
|
+
source: ConversationSource;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export type ConversationDeepLinks = {
|
|
37
|
+
native: string | null;
|
|
38
|
+
spiracha: string;
|
|
39
|
+
ui: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type ConversationMessage = {
|
|
43
|
+
createdAtMs: number | null;
|
|
44
|
+
id: string;
|
|
45
|
+
metadata: Record<string, unknown>;
|
|
46
|
+
order: number;
|
|
47
|
+
phase: ConversationMessagePhase;
|
|
48
|
+
role: ConversationMessageRole;
|
|
49
|
+
text: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type ConversationDetail = {
|
|
53
|
+
createdAtMs: number | null;
|
|
54
|
+
deepLinks: ConversationDeepLinks;
|
|
55
|
+
id: string;
|
|
56
|
+
matches: ConversationPathMatch[];
|
|
57
|
+
messageCount: number | null;
|
|
58
|
+
messages: ConversationMessage[];
|
|
59
|
+
metadata: Record<string, unknown>;
|
|
60
|
+
source: ConversationSource;
|
|
61
|
+
title: string | null;
|
|
62
|
+
updatedAtMs: number | null;
|
|
63
|
+
workspaceKey: string | null;
|
|
64
|
+
workspacePath: string | null;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type ConversationPage = {
|
|
68
|
+
data: ConversationDetail[];
|
|
69
|
+
meta: {
|
|
70
|
+
hasNext: boolean;
|
|
71
|
+
nextCursor: string | null;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type ConversationDataLocations = {
|
|
76
|
+
antigravityRoots?: string[];
|
|
77
|
+
claudeCodeProjectsDir?: string;
|
|
78
|
+
codexDbPath?: string;
|
|
79
|
+
cursorUserDir?: string;
|
|
80
|
+
kiroWorkspaceSessionsDir?: string;
|
|
81
|
+
opencodeDbPath?: string;
|
|
82
|
+
qoderAcpSocketPath?: string;
|
|
83
|
+
qoderCliProjectsDir?: string;
|
|
84
|
+
qoderGlobalStateDb?: string;
|
|
85
|
+
qoderWorkspaceStorageDir?: string;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type ListConversationsForPathOptions = {
|
|
89
|
+
cursor?: string | null;
|
|
90
|
+
cwd: string;
|
|
91
|
+
includeMessages?: boolean;
|
|
92
|
+
limit?: number;
|
|
93
|
+
locations?: ConversationDataLocations;
|
|
94
|
+
messageSelector?: ConversationMessageSelector;
|
|
95
|
+
sources?: ConversationSource[] | 'all';
|
|
96
|
+
updatedAfterMs?: number;
|
|
97
|
+
updatedBeforeMs?: number;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export type GetConversationOptions = {
|
|
101
|
+
id: string;
|
|
102
|
+
locations?: ConversationDataLocations;
|
|
103
|
+
messageSelector?: ConversationMessageSelector;
|
|
104
|
+
source: ConversationSource;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export type ResolvedConversationRef = {
|
|
108
|
+
id: string;
|
|
109
|
+
source: ConversationSource;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type ConversationAdapter = {
|
|
113
|
+
getConversation: (options: GetConversationOptions) => Promise<ConversationDetail | null>;
|
|
114
|
+
listConversationsForPath: (options: ListConversationsForPathOptions) => Promise<ConversationDetail[]>;
|
|
115
|
+
source: ConversationSource;
|
|
116
|
+
};
|