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,100 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import type { ExportFormat, JsonValue } from './shared';
|
|
4
|
+
|
|
5
|
+
export const getDefaultKiroDataDir = (_env: NodeJS.ProcessEnv = process.env, homeDir = os.homedir()): string => {
|
|
6
|
+
return path.join(homeDir, 'Library', 'Application Support', 'Kiro', 'User', 'globalStorage', 'kiro.kiroagent');
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_KIRO_DATA_DIR = getDefaultKiroDataDir();
|
|
10
|
+
|
|
11
|
+
export const resolveKiroDataDir = (): string => {
|
|
12
|
+
const configured =
|
|
13
|
+
process.env.SPIRACHA_KIRO_DATA_DIR?.trim() ||
|
|
14
|
+
process.env.SPIRACHA_KIRO_AGENT_DIR?.trim() ||
|
|
15
|
+
process.env.SPIRACHA_KIRO_DIR?.trim();
|
|
16
|
+
return configured ? configured : DEFAULT_KIRO_DATA_DIR;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const resolveKiroWorkspaceSessionsDir = (): string => {
|
|
20
|
+
const configured = process.env.SPIRACHA_KIRO_WORKSPACE_SESSIONS_DIR?.trim();
|
|
21
|
+
return configured ? configured : path.join(resolveKiroDataDir(), 'workspace-sessions');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type KiroWorkspaceGroup = {
|
|
25
|
+
assistantMessageCount: number;
|
|
26
|
+
directoryName: string;
|
|
27
|
+
imageCount: number;
|
|
28
|
+
key: string;
|
|
29
|
+
label: string;
|
|
30
|
+
lastActiveAtIso: string | null;
|
|
31
|
+
lastActiveAtMs: number | null;
|
|
32
|
+
messageCount: number;
|
|
33
|
+
promptLogCount: number;
|
|
34
|
+
sessionCount: number;
|
|
35
|
+
uri: string;
|
|
36
|
+
userMessageCount: number;
|
|
37
|
+
worktree: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type KiroSessionSummary = {
|
|
41
|
+
assistantMessageCount: number;
|
|
42
|
+
autonomyMode: string | null;
|
|
43
|
+
createdAtIso: string | null;
|
|
44
|
+
createdAtMs: number | null;
|
|
45
|
+
defaultModelTitle: string | null;
|
|
46
|
+
filePath: string;
|
|
47
|
+
imageCount: number;
|
|
48
|
+
lastActiveAtIso: string | null;
|
|
49
|
+
lastActiveAtMs: number | null;
|
|
50
|
+
messageCount: number;
|
|
51
|
+
promptLogCount: number;
|
|
52
|
+
renderablePartCount: number;
|
|
53
|
+
selectedModel: string | null;
|
|
54
|
+
selectedProfileId: string | null;
|
|
55
|
+
sessionId: string;
|
|
56
|
+
sessionType: string | null;
|
|
57
|
+
title: string;
|
|
58
|
+
userMessageCount: number;
|
|
59
|
+
workspaceDirectory: string | null;
|
|
60
|
+
workspaceKey: string;
|
|
61
|
+
workspaceLabel: string;
|
|
62
|
+
workspacePath: string | null;
|
|
63
|
+
worktree: string;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export type KiroPartType = 'image' | 'text' | 'unknown';
|
|
67
|
+
|
|
68
|
+
export type KiroTranscriptPart = {
|
|
69
|
+
imageUrl?: string | null;
|
|
70
|
+
raw: Record<string, JsonValue>;
|
|
71
|
+
text?: string;
|
|
72
|
+
type: KiroPartType;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export type KiroTranscriptEntryType = 'message' | 'tool_call';
|
|
76
|
+
|
|
77
|
+
export type KiroTranscriptEntry = {
|
|
78
|
+
entryType: KiroTranscriptEntryType;
|
|
79
|
+
entryId: string;
|
|
80
|
+
executionId: string | null;
|
|
81
|
+
parts: KiroTranscriptPart[];
|
|
82
|
+
promptLogCount: number;
|
|
83
|
+
raw: Record<string, JsonValue>;
|
|
84
|
+
role: string;
|
|
85
|
+
timestamp: string | null;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export type KiroSessionTranscript = {
|
|
89
|
+
entries: KiroTranscriptEntry[];
|
|
90
|
+
rawSession: Record<string, JsonValue>;
|
|
91
|
+
renderablePartCount: number;
|
|
92
|
+
session: KiroSessionSummary;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export type KiroExportOptions = {
|
|
96
|
+
includeCommentary: boolean;
|
|
97
|
+
includeMetadata: boolean;
|
|
98
|
+
includeTools: boolean;
|
|
99
|
+
outputFormat: ExportFormat;
|
|
100
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { KiroTranscriptEntry } from './kiro-exporter-types';
|
|
2
|
+
|
|
3
|
+
export type KiroMessagePhase = 'commentary' | 'final_answer' | null;
|
|
4
|
+
|
|
5
|
+
export const getFinalKiroAssistantMessageEntryIds = (entries: KiroTranscriptEntry[]): Set<string> => {
|
|
6
|
+
const finalEntryIds = new Set<string>();
|
|
7
|
+
let latestAssistantMessageEntryId: string | null = null;
|
|
8
|
+
|
|
9
|
+
const flushAssistantRun = () => {
|
|
10
|
+
if (latestAssistantMessageEntryId) {
|
|
11
|
+
finalEntryIds.add(latestAssistantMessageEntryId);
|
|
12
|
+
latestAssistantMessageEntryId = null;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
for (const entry of entries) {
|
|
17
|
+
if (entry.entryType === 'tool_call') {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (entry.role === 'user') {
|
|
22
|
+
flushAssistantRun();
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (entry.role === 'assistant') {
|
|
27
|
+
latestAssistantMessageEntryId = entry.entryId;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
flushAssistantRun();
|
|
32
|
+
return finalEntryIds;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const getKiroMessagePhase = (entry: KiroTranscriptEntry, finalAssistantMessageEntryIds: Set<string>) => {
|
|
36
|
+
if (entry.role !== 'assistant') {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return finalAssistantMessageEntryIds.has(entry.entryId) ? 'final_answer' : 'commentary';
|
|
41
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
KiroExportOptions,
|
|
3
|
+
KiroSessionSummary,
|
|
4
|
+
KiroSessionTranscript,
|
|
5
|
+
KiroTranscriptEntry,
|
|
6
|
+
KiroTranscriptPart,
|
|
7
|
+
} from './kiro-exporter-types';
|
|
8
|
+
import { getFinalKiroAssistantMessageEntryIds, getKiroMessagePhase } from './kiro-transcript-phase';
|
|
9
|
+
import {
|
|
10
|
+
cleanExtractedText,
|
|
11
|
+
cleanInlineTitle,
|
|
12
|
+
type MetadataEntry,
|
|
13
|
+
renderDocumentTitle,
|
|
14
|
+
renderMetadataBlock,
|
|
15
|
+
renderSection,
|
|
16
|
+
} from './shared';
|
|
17
|
+
|
|
18
|
+
const getSessionTitle = (session: KiroSessionSummary): string => {
|
|
19
|
+
return cleanInlineTitle(session.title || session.sessionId);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const buildMetadataEntries = (session: KiroSessionSummary): MetadataEntry[] => [
|
|
23
|
+
{ key: 'exported_from', value: 'kiro_workspace_sessions' },
|
|
24
|
+
{ key: 'session_id', value: session.sessionId },
|
|
25
|
+
{ key: 'title', value: session.title },
|
|
26
|
+
{ key: 'source_session_path', value: session.filePath },
|
|
27
|
+
{ key: 'workspace_key', value: session.workspaceKey },
|
|
28
|
+
{ key: 'workspace_directory', value: session.workspaceDirectory },
|
|
29
|
+
{ key: 'workspace_path', value: session.workspacePath },
|
|
30
|
+
{ key: 'selected_model', value: session.selectedModel },
|
|
31
|
+
{ key: 'default_model_title', value: session.defaultModelTitle },
|
|
32
|
+
{ key: 'selected_profile_id', value: session.selectedProfileId },
|
|
33
|
+
{ key: 'autonomy_mode', value: session.autonomyMode },
|
|
34
|
+
{ key: 'session_type', value: session.sessionType },
|
|
35
|
+
{ key: 'created_at_iso', value: session.createdAtIso },
|
|
36
|
+
{ key: 'last_active_at_iso', value: session.lastActiveAtIso },
|
|
37
|
+
{ key: 'message_count', value: session.messageCount },
|
|
38
|
+
{ key: 'image_count', value: session.imageCount },
|
|
39
|
+
{ key: 'prompt_log_count', value: session.promptLogCount },
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const roleTitle = (role: string): string => {
|
|
43
|
+
if (role === 'assistant') {
|
|
44
|
+
return 'Assistant';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (role === 'user') {
|
|
48
|
+
return 'User';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (role === 'system') {
|
|
52
|
+
return 'System';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return role ? cleanInlineTitle(role) : 'Message';
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const renderTextPart = (part: KiroTranscriptPart, title: string, options: KiroExportOptions): string => {
|
|
59
|
+
const text = cleanExtractedText(part.text ?? '').trim();
|
|
60
|
+
return text ? renderSection(title, text, options.outputFormat) : '';
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const renderImagePart = (part: KiroTranscriptPart, options: KiroExportOptions): string => {
|
|
64
|
+
if (!options.includeCommentary) {
|
|
65
|
+
return '';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const text = cleanExtractedText(part.text ?? 'Image attachment').trim();
|
|
69
|
+
return renderSection('Attachment', text, options.outputFormat);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const renderPart = (
|
|
73
|
+
entry: KiroTranscriptEntry,
|
|
74
|
+
part: KiroTranscriptPart,
|
|
75
|
+
options: KiroExportOptions,
|
|
76
|
+
finalAssistantMessageEntryIds: Set<string>,
|
|
77
|
+
): string => {
|
|
78
|
+
if (entry.entryType === 'tool_call') {
|
|
79
|
+
return options.includeTools && part.type === 'text' ? renderTextPart(part, 'Tool call', options) : '';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (getKiroMessagePhase(entry, finalAssistantMessageEntryIds) === 'commentary' && !options.includeCommentary) {
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
switch (part.type) {
|
|
87
|
+
case 'text':
|
|
88
|
+
return renderTextPart(part, roleTitle(entry.role), options);
|
|
89
|
+
case 'image':
|
|
90
|
+
return renderImagePart(part, options);
|
|
91
|
+
case 'unknown':
|
|
92
|
+
return '';
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const renderKiroTranscript = (transcript: KiroSessionTranscript, options: KiroExportOptions): string | null => {
|
|
97
|
+
const finalAssistantMessageEntryIds = getFinalKiroAssistantMessageEntryIds(transcript.entries);
|
|
98
|
+
const sections = transcript.entries.flatMap((entry) =>
|
|
99
|
+
entry.parts.map((part) => renderPart(entry, part, options, finalAssistantMessageEntryIds)).filter(Boolean),
|
|
100
|
+
);
|
|
101
|
+
if (sections.length === 0) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const parts = [
|
|
106
|
+
renderDocumentTitle(getSessionTitle(transcript.session), options.outputFormat),
|
|
107
|
+
'',
|
|
108
|
+
options.includeMetadata
|
|
109
|
+
? renderMetadataBlock(buildMetadataEntries(transcript.session), options.outputFormat)
|
|
110
|
+
: '',
|
|
111
|
+
...sections,
|
|
112
|
+
].filter(Boolean);
|
|
113
|
+
|
|
114
|
+
return `${parts.join('\n').trimEnd()}\n`;
|
|
115
|
+
};
|