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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import type { ExportFormat, JsonValue } from './shared';
|
|
4
|
+
|
|
5
|
+
export type { ClaudeCodeAssistantMessagePhase } from './claude-code-transcript-phase';
|
|
6
|
+
export { getClaudeCodeAssistantMessagePhase } from './claude-code-transcript-phase';
|
|
7
|
+
|
|
8
|
+
export const getDefaultClaudeCodeDataDir = (_env: NodeJS.ProcessEnv = process.env, homeDir = os.homedir()): string => {
|
|
9
|
+
return path.join(homeDir, '.claude');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_CLAUDE_CODE_DATA_DIR = getDefaultClaudeCodeDataDir();
|
|
13
|
+
|
|
14
|
+
export const resolveClaudeCodeDataDir = (): string => {
|
|
15
|
+
const configured =
|
|
16
|
+
process.env.SPIRACHA_CLAUDE_CODE_DATA_DIR?.trim() ||
|
|
17
|
+
process.env.SPIRACHA_CLAUDE_CODE_DIR?.trim() ||
|
|
18
|
+
process.env.SPIRACHA_CLAUDE_HOME?.trim();
|
|
19
|
+
return configured ? configured : DEFAULT_CLAUDE_CODE_DATA_DIR;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const resolveClaudeCodeProjectsDir = (): string => {
|
|
23
|
+
const configured = process.env.SPIRACHA_CLAUDE_CODE_PROJECTS_DIR?.trim();
|
|
24
|
+
return configured ? configured : path.join(resolveClaudeCodeDataDir(), 'projects');
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ClaudeCodeWorkspaceGroup = {
|
|
28
|
+
assistantMessageCount: number;
|
|
29
|
+
directoryName: string;
|
|
30
|
+
key: string;
|
|
31
|
+
label: string;
|
|
32
|
+
lastActiveAtIso: string | null;
|
|
33
|
+
lastActiveAtMs: number | null;
|
|
34
|
+
messageCount: number;
|
|
35
|
+
sessionCount: number;
|
|
36
|
+
toolCallCount: number;
|
|
37
|
+
toolResultCount: number;
|
|
38
|
+
uri: string;
|
|
39
|
+
userMessageCount: number;
|
|
40
|
+
worktree: string;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type ClaudeCodeSessionSummary = {
|
|
44
|
+
assistantMessageCount: number;
|
|
45
|
+
attachmentCount: number;
|
|
46
|
+
cacheCreationInputTokens: number;
|
|
47
|
+
cacheReadInputTokens: number;
|
|
48
|
+
createdAtIso: string | null;
|
|
49
|
+
createdAtMs: number | null;
|
|
50
|
+
cwd: string | null;
|
|
51
|
+
filePath: string;
|
|
52
|
+
gitBranch: string | null;
|
|
53
|
+
inputTokens: number;
|
|
54
|
+
lastActiveAtIso: string | null;
|
|
55
|
+
lastActiveAtMs: number | null;
|
|
56
|
+
messageCount: number;
|
|
57
|
+
model: string | null;
|
|
58
|
+
outputTokens: number;
|
|
59
|
+
renderablePartCount: number;
|
|
60
|
+
sessionId: string;
|
|
61
|
+
title: string;
|
|
62
|
+
toolCallCount: number;
|
|
63
|
+
toolResultCount: number;
|
|
64
|
+
totalTokens: number;
|
|
65
|
+
userMessageCount: number;
|
|
66
|
+
version: string | null;
|
|
67
|
+
workspaceKey: string;
|
|
68
|
+
workspaceLabel: string;
|
|
69
|
+
worktree: string;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export type ClaudeCodePartType = 'attachment' | 'text' | 'thinking' | 'tool_result' | 'tool_use' | 'unknown';
|
|
73
|
+
|
|
74
|
+
export type ClaudeCodeTranscriptPart = {
|
|
75
|
+
argumentsText?: string | null;
|
|
76
|
+
attachmentType?: string | null;
|
|
77
|
+
isError?: boolean | null;
|
|
78
|
+
outputText?: string | null;
|
|
79
|
+
raw: Record<string, JsonValue>;
|
|
80
|
+
text?: string;
|
|
81
|
+
toolName?: string | null;
|
|
82
|
+
toolUseId?: string | null;
|
|
83
|
+
type: ClaudeCodePartType;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export type ClaudeCodeTranscriptEntry = {
|
|
87
|
+
cwd: string | null;
|
|
88
|
+
entryId: string;
|
|
89
|
+
model?: string | null;
|
|
90
|
+
parentEntryId?: string | null;
|
|
91
|
+
parts: ClaudeCodeTranscriptPart[];
|
|
92
|
+
raw: Record<string, JsonValue>;
|
|
93
|
+
role: string;
|
|
94
|
+
timestamp: string | null;
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type ClaudeCodeSessionTranscript = {
|
|
99
|
+
entries: ClaudeCodeTranscriptEntry[];
|
|
100
|
+
rawEvents: Record<string, JsonValue>[];
|
|
101
|
+
renderablePartCount: number;
|
|
102
|
+
session: ClaudeCodeSessionSummary;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export type ClaudeCodeExportOptions = {
|
|
106
|
+
includeCommentary: boolean;
|
|
107
|
+
includeMetadata: boolean;
|
|
108
|
+
includeTools: boolean;
|
|
109
|
+
outputFormat: ExportFormat;
|
|
110
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { JsonValue } from './shared';
|
|
2
|
+
|
|
3
|
+
export type ClaudeCodeAssistantMessagePhase = 'commentary' | 'final_answer';
|
|
4
|
+
|
|
5
|
+
type ClaudeCodeAssistantPhaseEntry = {
|
|
6
|
+
raw: Record<string, JsonValue>;
|
|
7
|
+
role: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const asMessageObject = (value: JsonValue | undefined): Record<string, JsonValue> | null => {
|
|
11
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value)
|
|
12
|
+
? (value as Record<string, JsonValue>)
|
|
13
|
+
: null;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const getClaudeCodeAssistantMessagePhase = (
|
|
17
|
+
entry: ClaudeCodeAssistantPhaseEntry,
|
|
18
|
+
): ClaudeCodeAssistantMessagePhase | null => {
|
|
19
|
+
if (entry.role !== 'assistant') {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const stopReason = asMessageObject(entry.raw.message)?.stop_reason;
|
|
24
|
+
return stopReason === 'tool_use' ? 'commentary' : 'final_answer';
|
|
25
|
+
};
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ClaudeCodeExportOptions,
|
|
3
|
+
ClaudeCodeSessionSummary,
|
|
4
|
+
ClaudeCodeSessionTranscript,
|
|
5
|
+
ClaudeCodeTranscriptEntry,
|
|
6
|
+
ClaudeCodeTranscriptPart,
|
|
7
|
+
} from './claude-code-exporter-types';
|
|
8
|
+
import { getClaudeCodeAssistantMessagePhase } from './claude-code-transcript-phase';
|
|
9
|
+
import {
|
|
10
|
+
cleanExtractedText,
|
|
11
|
+
cleanInlineTitle,
|
|
12
|
+
formatInlineLiteral,
|
|
13
|
+
type MetadataEntry,
|
|
14
|
+
renderCodeBlock,
|
|
15
|
+
renderDocumentTitle,
|
|
16
|
+
renderMetadataBlock,
|
|
17
|
+
renderSection,
|
|
18
|
+
} from './shared';
|
|
19
|
+
|
|
20
|
+
const TOOL_OUTPUT_PREVIEW_LIMIT = 4000;
|
|
21
|
+
|
|
22
|
+
const getSessionTitle = (session: ClaudeCodeSessionSummary): string => {
|
|
23
|
+
return cleanInlineTitle(session.title || session.sessionId);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const buildMetadataEntries = (session: ClaudeCodeSessionSummary): MetadataEntry[] => [
|
|
27
|
+
{ key: 'exported_from', value: 'claude_code_local_jsonl' },
|
|
28
|
+
{ key: 'session_id', value: session.sessionId },
|
|
29
|
+
{ key: 'title', value: session.title },
|
|
30
|
+
{ key: 'source_transcript_path', value: session.filePath },
|
|
31
|
+
{ key: 'workspace_key', value: session.workspaceKey },
|
|
32
|
+
{ key: 'worktree', value: session.worktree },
|
|
33
|
+
{ key: 'cwd', value: session.cwd },
|
|
34
|
+
{ key: 'model', value: session.model },
|
|
35
|
+
{ key: 'version', value: session.version },
|
|
36
|
+
{ key: 'git_branch', value: session.gitBranch },
|
|
37
|
+
{ key: 'created_at_iso', value: session.createdAtIso },
|
|
38
|
+
{ key: 'last_active_at_iso', value: session.lastActiveAtIso },
|
|
39
|
+
{ key: 'message_count', value: session.messageCount },
|
|
40
|
+
{ key: 'tool_call_count', value: session.toolCallCount },
|
|
41
|
+
{ key: 'tool_result_count', value: session.toolResultCount },
|
|
42
|
+
{ key: 'total_tokens', value: session.totalTokens },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
const roleTitle = (role: string): string => {
|
|
46
|
+
if (role === 'assistant') {
|
|
47
|
+
return 'Assistant';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (role === 'user') {
|
|
51
|
+
return 'User';
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (role === 'system') {
|
|
55
|
+
return 'System';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return role ? cleanInlineTitle(role) : 'Message';
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const truncateOutput = (text: string): string => {
|
|
62
|
+
if (text.length <= TOOL_OUTPUT_PREVIEW_LIMIT) {
|
|
63
|
+
return text;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return `${text.slice(0, TOOL_OUTPUT_PREVIEW_LIMIT)}\n... (truncated)`;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const renderTextPart = (part: ClaudeCodeTranscriptPart, role: string, options: ClaudeCodeExportOptions): string => {
|
|
70
|
+
const text = cleanExtractedText(part.text ?? '').trim();
|
|
71
|
+
return text ? renderSection(roleTitle(role), text, options.outputFormat) : '';
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const renderThinkingPart = (part: ClaudeCodeTranscriptPart, options: ClaudeCodeExportOptions): string => {
|
|
75
|
+
if (!options.includeCommentary) {
|
|
76
|
+
return '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const text = cleanExtractedText(part.text ?? '').trim();
|
|
80
|
+
return text ? renderSection('Reasoning', text, options.outputFormat) : '';
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const renderToolUsePart = (part: ClaudeCodeTranscriptPart, options: ClaudeCodeExportOptions): string => {
|
|
84
|
+
if (!options.includeTools) {
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const toolName = part.toolName ?? 'unknown';
|
|
89
|
+
const lines = [`Tool: ${formatInlineLiteral(toolName, options.outputFormat)}`];
|
|
90
|
+
if (part.toolUseId) {
|
|
91
|
+
lines.push(`Call ID: ${part.toolUseId}`);
|
|
92
|
+
}
|
|
93
|
+
if (part.argumentsText?.trim()) {
|
|
94
|
+
lines.push('', 'Input:', '', renderCodeBlock(part.argumentsText.trim(), options.outputFormat));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return renderSection('Tool Call', lines.join('\n'), options.outputFormat);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const renderToolResultPart = (part: ClaudeCodeTranscriptPart, options: ClaudeCodeExportOptions): string => {
|
|
101
|
+
if (!options.includeTools) {
|
|
102
|
+
return '';
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const outputText = part.outputText?.trim();
|
|
106
|
+
if (!outputText) {
|
|
107
|
+
return '';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const lines: string[] = [];
|
|
111
|
+
if (part.isError) {
|
|
112
|
+
lines.push('Error: true', '');
|
|
113
|
+
}
|
|
114
|
+
if (part.toolUseId) {
|
|
115
|
+
lines.push(`Call ID: ${part.toolUseId}`, '');
|
|
116
|
+
}
|
|
117
|
+
lines.push(renderCodeBlock(truncateOutput(outputText), options.outputFormat));
|
|
118
|
+
return renderSection('Tool Output', lines.join('\n'), options.outputFormat);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const renderAttachmentPart = (part: ClaudeCodeTranscriptPart, options: ClaudeCodeExportOptions): string => {
|
|
122
|
+
if (!options.includeCommentary) {
|
|
123
|
+
return '';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const text = cleanExtractedText(part.text ?? '').trim();
|
|
127
|
+
if (!text) {
|
|
128
|
+
return '';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const title = part.attachmentType ? `Attachment: ${part.attachmentType}` : 'Attachment';
|
|
132
|
+
return renderSection(title, text, options.outputFormat);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const renderPart = (
|
|
136
|
+
entry: ClaudeCodeTranscriptEntry,
|
|
137
|
+
part: ClaudeCodeTranscriptPart,
|
|
138
|
+
options: ClaudeCodeExportOptions,
|
|
139
|
+
): string => {
|
|
140
|
+
switch (part.type) {
|
|
141
|
+
case 'text':
|
|
142
|
+
if (getClaudeCodeAssistantMessagePhase(entry) === 'commentary' && !options.includeCommentary) {
|
|
143
|
+
return '';
|
|
144
|
+
}
|
|
145
|
+
return renderTextPart(part, entry.role, options);
|
|
146
|
+
case 'thinking':
|
|
147
|
+
return renderThinkingPart(part, options);
|
|
148
|
+
case 'tool_use':
|
|
149
|
+
return renderToolUsePart(part, options);
|
|
150
|
+
case 'tool_result':
|
|
151
|
+
return renderToolResultPart(part, options);
|
|
152
|
+
case 'attachment':
|
|
153
|
+
return renderAttachmentPart(part, options);
|
|
154
|
+
case 'unknown':
|
|
155
|
+
return '';
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const renderClaudeCodeTranscript = (
|
|
160
|
+
transcript: ClaudeCodeSessionTranscript,
|
|
161
|
+
options: ClaudeCodeExportOptions,
|
|
162
|
+
): string | null => {
|
|
163
|
+
const sections = transcript.entries.flatMap((entry) =>
|
|
164
|
+
entry.parts.map((part) => renderPart(entry, part, options)).filter(Boolean),
|
|
165
|
+
);
|
|
166
|
+
if (sections.length === 0) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const parts = [
|
|
171
|
+
renderDocumentTitle(getSessionTitle(transcript.session), options.outputFormat),
|
|
172
|
+
'',
|
|
173
|
+
options.includeMetadata
|
|
174
|
+
? renderMetadataBlock(buildMetadataEntries(transcript.session), options.outputFormat)
|
|
175
|
+
: '',
|
|
176
|
+
...sections,
|
|
177
|
+
].filter(Boolean);
|
|
178
|
+
|
|
179
|
+
return `${parts.join('\n').trimEnd()}\n`;
|
|
180
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { listScopedThreads } from './codex-browser-db';
|
|
2
2
|
import type { CodexAnalytics, DistributionItem, ModelTokenSummary } from './codex-browser-types';
|
|
3
|
-
import type { ThreadRow } from './codex-
|
|
3
|
+
import type { ThreadRow } from './codex-thread-types';
|
|
4
4
|
import { mapWithConcurrency } from './concurrency';
|
|
5
5
|
import { asObject, asString, getPortablePathBasename, readJsonlObjects } from './shared';
|
|
6
6
|
import { hashCacheKeyParts, hashCacheKeyPartsIterable, withCachedJson } from './ui-cache';
|