spiracha 1.5.0 → 2.1.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 +94 -269
- package/apps/ui/AGENTS.md +17 -7
- package/apps/ui/README.md +52 -8
- package/apps/ui/components.json +21 -0
- package/apps/ui/package.json +65 -0
- package/apps/ui/src/components/antigravity-conversations-table.tsx +245 -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 +125 -0
- package/apps/ui/src/components/breadcrumbs.tsx +71 -0
- package/apps/ui/src/components/claude-code-sessions-table.tsx +150 -0
- package/apps/ui/src/components/claude-code-workspaces-table.tsx +57 -0
- package/apps/ui/src/components/cursor-threads-table.tsx +152 -0
- package/apps/ui/src/components/cursor-workspaces-table.tsx +140 -0
- package/apps/ui/src/components/data-table.tsx +243 -0
- package/apps/ui/src/components/delete-confirm-dialog.tsx +88 -0
- package/apps/ui/src/components/export-dialog.tsx +174 -0
- package/apps/ui/src/components/grok-sessions-table.tsx +146 -0
- package/apps/ui/src/components/grok-workspaces-table.tsx +53 -0
- package/apps/ui/src/components/json-panel.tsx +17 -0
- package/apps/ui/src/components/kiro-sessions-table.tsx +148 -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 +164 -0
- package/apps/ui/src/components/opencode-workspaces-table.tsx +57 -0
- package/apps/ui/src/components/page-header.tsx +39 -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 +133 -0
- package/apps/ui/src/components/qoder-workspaces-table.tsx +57 -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/selection-actions-toolbar.tsx +80 -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 +165 -0
- package/apps/ui/src/components/transcript-view.tsx +648 -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 +41 -0
- package/apps/ui/src/lib/antigravity-queries.ts +33 -0
- package/apps/ui/src/lib/antigravity-server.ts +273 -0
- package/apps/ui/src/lib/antigravity-transcript-events.ts +343 -0
- package/apps/ui/src/lib/claude-code-queries.ts +34 -0
- package/apps/ui/src/lib/claude-code-server.ts +243 -0
- package/apps/ui/src/lib/claude-code-transcript-events.ts +161 -0
- package/apps/ui/src/lib/codex-queries.ts +82 -0
- package/apps/ui/src/lib/codex-server.ts +291 -0
- package/apps/ui/src/lib/cursor-queries.ts +37 -0
- package/apps/ui/src/lib/cursor-server.ts +315 -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 +147 -0
- package/apps/ui/src/lib/grok-queries.ts +22 -0
- package/apps/ui/src/lib/grok-server.ts +169 -0
- package/apps/ui/src/lib/grok-transcript-events.ts +149 -0
- package/apps/ui/src/lib/kiro-queries.ts +22 -0
- package/apps/ui/src/lib/kiro-server.ts +151 -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 +151 -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 +135 -0
- package/apps/ui/src/lib/qoder-transcript-events.ts +139 -0
- package/apps/ui/src/lib/route-search.ts +182 -0
- package/apps/ui/src/lib/settings-store.tsx +59 -0
- package/apps/ui/src/lib/source-session-export-server.ts +139 -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-load.ts +15 -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/lib/workspace-delete-navigation.ts +12 -0
- package/apps/ui/src/routeTree.gen.ts +837 -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 +504 -0
- package/apps/ui/src/routes/antigravity.$workspaceKey.tsx +365 -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 +16 -0
- package/apps/ui/src/routes/api.v1.conversations.delete.ts +12 -0
- package/apps/ui/src/routes/api.v1.conversations.export.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 +468 -0
- package/apps/ui/src/routes/claude-code.$workspaceKey.tsx +274 -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 +426 -0
- package/apps/ui/src/routes/cursor.index.tsx +120 -0
- package/apps/ui/src/routes/grok-sessions.$sessionId.tsx +388 -0
- package/apps/ui/src/routes/grok.$workspaceKey.tsx +301 -0
- package/apps/ui/src/routes/grok.index.tsx +48 -0
- package/apps/ui/src/routes/index.tsx +124 -0
- package/apps/ui/src/routes/kiro-sessions.$sessionId.tsx +396 -0
- package/apps/ui/src/routes/kiro.$workspaceKey.tsx +303 -0
- package/apps/ui/src/routes/kiro.index.tsx +48 -0
- package/apps/ui/src/routes/opencode-sessions.$sessionId.tsx +420 -0
- package/apps/ui/src/routes/opencode.$workspaceKey.tsx +327 -0
- package/apps/ui/src/routes/opencode.index.tsx +61 -0
- package/apps/ui/src/routes/qoder-sessions.$sessionId.tsx +344 -0
- package/apps/ui/src/routes/qoder.$workspaceKey.tsx +186 -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 +1103 -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 +54 -80
- package/src/client.ts +423 -0
- package/src/lib/antigravity-db.ts +414 -44
- package/src/lib/antigravity-exporter-types.ts +4 -0
- package/src/lib/antigravity-projects.ts +201 -0
- package/src/lib/claude-code-db.ts +498 -32
- package/src/lib/claude-code-exporter-types.ts +5 -0
- package/src/lib/claude-code-transcript-phase.ts +60 -1
- package/src/lib/claude-code-transcript.ts +8 -5
- package/src/lib/codex-analytics.ts +1 -1
- package/src/lib/codex-browser-db.ts +410 -74
- package/src/lib/codex-browser-export.ts +29 -41
- package/src/lib/codex-browser-types.ts +1 -1
- package/src/lib/codex-thread-cache.ts +41 -13
- package/src/lib/codex-thread-parser.ts +86 -35
- package/src/lib/{codex-exporter-types.ts → codex-thread-types.ts} +2 -30
- package/src/lib/codex-transcript-filter.ts +31 -0
- package/src/lib/{codex-exporter-transcript.ts → codex-transcript-renderer.ts} +104 -48
- package/src/lib/concurrency.ts +41 -0
- package/src/lib/conversation-api.ts +1172 -0
- package/src/lib/conversation-data/adapter-helpers.ts +110 -0
- package/src/lib/conversation-data/antigravity-adapter.ts +167 -0
- package/src/lib/conversation-data/claude-code-adapter.ts +206 -0
- package/src/lib/conversation-data/codex-adapter.ts +269 -0
- package/src/lib/conversation-data/cursor-adapter.ts +205 -0
- package/src/lib/conversation-data/grok-adapter.ts +210 -0
- package/src/lib/conversation-data/index.ts +386 -0
- package/src/lib/conversation-data/kiro-adapter.ts +174 -0
- package/src/lib/conversation-data/message-selector.ts +37 -0
- package/src/lib/conversation-data/opencode-adapter.ts +202 -0
- package/src/lib/conversation-data/path-match.ts +79 -0
- package/src/lib/conversation-data/qoder-adapter.ts +255 -0
- package/src/lib/conversation-data/types.ts +159 -0
- package/src/lib/conversation-zip-export.ts +57 -0
- package/src/lib/cursor-db.ts +100 -25
- package/src/lib/cursor-exporter-types.ts +0 -19
- package/src/lib/grok-db.ts +1026 -0
- package/src/lib/grok-exporter-types.ts +110 -0
- package/src/lib/grok-transcript-phase.ts +52 -0
- package/src/lib/grok-transcript.ts +154 -0
- package/src/lib/kiro-db.ts +52 -1
- package/src/lib/model-label.ts +11 -3
- package/src/lib/opencode-db.ts +598 -55
- package/src/lib/opencode-transcript.ts +8 -5
- 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 +12 -0
- package/src/lib/transcript-load-limiter.ts +82 -0
- package/src/lib/ui-cache.ts +43 -17
- package/src/lib/ui-export-archive.ts +60 -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
|
@@ -2,8 +2,14 @@ import { createReadStream } from 'node:fs';
|
|
|
2
2
|
import { rm } from 'node:fs/promises';
|
|
3
3
|
import path from 'node:path';
|
|
4
4
|
import { finished } from 'node:stream/promises';
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
type CodexTranscriptExportTarget,
|
|
7
|
+
type CodexTranscriptRenderOptions,
|
|
8
|
+
DEFAULT_CODEX_DIR,
|
|
9
|
+
type MessageRecord,
|
|
10
|
+
type SessionMeta,
|
|
11
|
+
type ToolRecord,
|
|
12
|
+
} from './codex-thread-types';
|
|
7
13
|
import {
|
|
8
14
|
asObject,
|
|
9
15
|
asString,
|
|
@@ -20,22 +26,30 @@ import {
|
|
|
20
26
|
renderDocumentTitle,
|
|
21
27
|
renderMetadataBlock,
|
|
22
28
|
renderSection,
|
|
29
|
+
stripCodexAppDirectiveLines,
|
|
23
30
|
} from './shared';
|
|
31
|
+
import { runWithTranscriptLoadLimit } from './transcript-load-limiter';
|
|
24
32
|
|
|
25
|
-
export const
|
|
33
|
+
export const renderCodexSessionFile = async (
|
|
34
|
+
target: CodexTranscriptExportTarget,
|
|
35
|
+
options: CodexTranscriptRenderOptions,
|
|
36
|
+
): Promise<string | null> => {
|
|
26
37
|
let transcriptState: CodexTranscriptState;
|
|
27
38
|
|
|
28
39
|
try {
|
|
29
|
-
transcriptState = await
|
|
40
|
+
transcriptState = await runWithTranscriptLoadLimit(
|
|
41
|
+
() => collectCodexTranscript(target.sessionFile, options, target.thread?.model ?? null),
|
|
42
|
+
{
|
|
43
|
+
id: target.thread?.id,
|
|
44
|
+
path: target.sessionFile,
|
|
45
|
+
source: 'codex-export-inline',
|
|
46
|
+
},
|
|
47
|
+
);
|
|
30
48
|
} catch (error) {
|
|
31
49
|
const message = error instanceof Error ? error.message : String(error);
|
|
32
50
|
throw new Error(`Failed to read Codex transcript ${target.sessionFile}: ${message}`);
|
|
33
51
|
}
|
|
34
52
|
|
|
35
|
-
if (!matchesFilters(target.thread?.cwd ?? transcriptState.sessionMeta.cwd ?? null, options)) {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
53
|
if (transcriptState.sections.length === 0) {
|
|
40
54
|
return null;
|
|
41
55
|
}
|
|
@@ -57,9 +71,9 @@ export const convertSessionFile = async (target: ExportTarget, options: CodexCli
|
|
|
57
71
|
|
|
58
72
|
type TranscriptTextTransform = (text: string) => string;
|
|
59
73
|
|
|
60
|
-
export const
|
|
61
|
-
target:
|
|
62
|
-
options:
|
|
74
|
+
export const writeCodexSessionFileExport = async (
|
|
75
|
+
target: CodexTranscriptExportTarget,
|
|
76
|
+
options: CodexTranscriptRenderOptions,
|
|
63
77
|
outputPath: string,
|
|
64
78
|
transform: TranscriptTextTransform = (text) => text,
|
|
65
79
|
): Promise<boolean> => {
|
|
@@ -73,21 +87,30 @@ export const writeSessionFileExport = async (
|
|
|
73
87
|
let wroteSection = false;
|
|
74
88
|
|
|
75
89
|
try {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
await runWithTranscriptLoadLimit(
|
|
91
|
+
async () => {
|
|
92
|
+
transcriptStream = await createExportWriteStream(transcriptOutputPath);
|
|
93
|
+
for await (const parsed of readJsonlObjects(target.sessionFile)) {
|
|
94
|
+
captureSessionMeta(parsed, state.sessionMeta);
|
|
95
|
+
const block = renderCodexTranscriptRecord(parsed, options, state);
|
|
96
|
+
if (!block) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
transcriptStream.write(transform(wroteSection ? `${getSectionSeparator()}${block}` : block));
|
|
101
|
+
wroteSection = true;
|
|
102
|
+
}
|
|
103
|
+
await finalizeExportWriteStream(transcriptStream);
|
|
104
|
+
transcriptStream = null;
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: target.thread?.id,
|
|
108
|
+
path: target.sessionFile,
|
|
109
|
+
source: 'codex-export-stream',
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
if (!wroteSection) {
|
|
91
114
|
return false;
|
|
92
115
|
}
|
|
93
116
|
|
|
@@ -127,7 +150,7 @@ type CodexTranscriptState = {
|
|
|
127
150
|
|
|
128
151
|
const collectCodexTranscript = async (
|
|
129
152
|
sessionFile: string,
|
|
130
|
-
options:
|
|
153
|
+
options: CodexTranscriptRenderOptions,
|
|
131
154
|
assistantModel: string | null = null,
|
|
132
155
|
): Promise<CodexTranscriptState> => {
|
|
133
156
|
const state: CodexTranscriptState = {
|
|
@@ -147,7 +170,7 @@ const getSectionSeparator = () => '\n';
|
|
|
147
170
|
|
|
148
171
|
const processCodexTranscriptRecord = (
|
|
149
172
|
parsed: Record<string, JsonValue>,
|
|
150
|
-
options:
|
|
173
|
+
options: CodexTranscriptRenderOptions,
|
|
151
174
|
state: CodexTranscriptState,
|
|
152
175
|
) => {
|
|
153
176
|
captureSessionMeta(parsed, state.sessionMeta);
|
|
@@ -159,7 +182,7 @@ const processCodexTranscriptRecord = (
|
|
|
159
182
|
|
|
160
183
|
const renderCodexTranscriptRecord = (
|
|
161
184
|
parsed: Record<string, JsonValue>,
|
|
162
|
-
options:
|
|
185
|
+
options: CodexTranscriptRenderOptions,
|
|
163
186
|
state: CodexTranscriptState,
|
|
164
187
|
) => {
|
|
165
188
|
const message = extractMessageRecord(parsed);
|
|
@@ -179,16 +202,24 @@ const renderCodexTranscriptRecord = (
|
|
|
179
202
|
return renderToolBlock(tool, options.outputFormat);
|
|
180
203
|
};
|
|
181
204
|
|
|
182
|
-
const processCodexMessageRecord = (
|
|
183
|
-
|
|
205
|
+
const processCodexMessageRecord = (
|
|
206
|
+
message: MessageRecord,
|
|
207
|
+
options: CodexTranscriptRenderOptions,
|
|
208
|
+
state: CodexTranscriptState,
|
|
209
|
+
) => {
|
|
210
|
+
return renderMessageBlock(message, options.outputFormat, state, options.includeCommentary);
|
|
184
211
|
};
|
|
185
212
|
|
|
186
|
-
const buildStreamExportPrefix = (
|
|
213
|
+
const buildStreamExportPrefix = (
|
|
214
|
+
target: CodexTranscriptExportTarget,
|
|
215
|
+
sessionMeta: SessionMeta,
|
|
216
|
+
options: CodexTranscriptRenderOptions,
|
|
217
|
+
) => {
|
|
218
|
+
const title = getTitle(target, sessionMeta);
|
|
187
219
|
if (!options.includeMetadata) {
|
|
188
|
-
return
|
|
220
|
+
return `${renderDocumentTitle(title, options.outputFormat)}\n`;
|
|
189
221
|
}
|
|
190
222
|
|
|
191
|
-
const title = getTitle(target, sessionMeta);
|
|
192
223
|
const parts = [
|
|
193
224
|
renderDocumentTitle(title, options.outputFormat),
|
|
194
225
|
'',
|
|
@@ -253,7 +284,7 @@ export const parseExecCommandArguments = (argumentsText?: string) => {
|
|
|
253
284
|
}
|
|
254
285
|
};
|
|
255
286
|
|
|
256
|
-
const getTitle = (target:
|
|
287
|
+
const getTitle = (target: CodexTranscriptExportTarget, sessionMeta: SessionMeta): string => {
|
|
257
288
|
if (target.thread?.title) {
|
|
258
289
|
return cleanInlineTitle(target.thread.title);
|
|
259
290
|
}
|
|
@@ -261,10 +292,21 @@ const getTitle = (target: ExportTarget, sessionMeta: SessionMeta): string => {
|
|
|
261
292
|
return sessionMeta.id ?? path.basename(target.sessionFile, '.jsonl');
|
|
262
293
|
};
|
|
263
294
|
|
|
295
|
+
const toCodexRelativePath = (targetPath: string): string => {
|
|
296
|
+
const codexRoot = path.resolve(DEFAULT_CODEX_DIR);
|
|
297
|
+
const normalized = path.resolve(targetPath);
|
|
298
|
+
|
|
299
|
+
if (normalized.startsWith(`${codexRoot}${path.sep}`)) {
|
|
300
|
+
return path.relative(codexRoot, normalized);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return normalized;
|
|
304
|
+
};
|
|
305
|
+
|
|
264
306
|
const buildMetadataEntries = (
|
|
265
|
-
target:
|
|
307
|
+
target: CodexTranscriptExportTarget,
|
|
266
308
|
sessionMeta: SessionMeta,
|
|
267
|
-
options:
|
|
309
|
+
options: CodexTranscriptRenderOptions,
|
|
268
310
|
): MetadataEntry[] => {
|
|
269
311
|
return [
|
|
270
312
|
...buildCodexExportIdentityMetadata(target, sessionMeta),
|
|
@@ -275,7 +317,10 @@ const buildMetadataEntries = (
|
|
|
275
317
|
];
|
|
276
318
|
};
|
|
277
319
|
|
|
278
|
-
const buildCodexExportIdentityMetadata = (
|
|
320
|
+
const buildCodexExportIdentityMetadata = (
|
|
321
|
+
target: CodexTranscriptExportTarget,
|
|
322
|
+
sessionMeta: SessionMeta,
|
|
323
|
+
): MetadataEntry[] => {
|
|
279
324
|
const thread = target.thread;
|
|
280
325
|
|
|
281
326
|
return [
|
|
@@ -289,7 +334,10 @@ const buildCodexExportIdentityMetadata = (target: ExportTarget, sessionMeta: Ses
|
|
|
289
334
|
];
|
|
290
335
|
};
|
|
291
336
|
|
|
292
|
-
const buildCodexExportPathMetadata = (
|
|
337
|
+
const buildCodexExportPathMetadata = (
|
|
338
|
+
target: CodexTranscriptExportTarget,
|
|
339
|
+
options: CodexTranscriptRenderOptions,
|
|
340
|
+
): MetadataEntry[] => {
|
|
293
341
|
const relativeOutputPath = target.outputRelativePath;
|
|
294
342
|
|
|
295
343
|
return [
|
|
@@ -306,7 +354,7 @@ const buildCodexExportPathMetadata = (target: ExportTarget, options: CodexCliOpt
|
|
|
306
354
|
];
|
|
307
355
|
};
|
|
308
356
|
|
|
309
|
-
const buildCodexRelationMetadata = (target:
|
|
357
|
+
const buildCodexRelationMetadata = (target: CodexTranscriptExportTarget): MetadataEntry[] => {
|
|
310
358
|
const childThreadIds = target.relations.childEdges.map((edge) => edge.child_thread_id);
|
|
311
359
|
const childEdges = target.relations.childEdges.map((edge) => ({
|
|
312
360
|
child_thread_id: edge.child_thread_id,
|
|
@@ -320,14 +368,17 @@ const buildCodexRelationMetadata = (target: ExportTarget): MetadataEntry[] => {
|
|
|
320
368
|
];
|
|
321
369
|
};
|
|
322
370
|
|
|
323
|
-
const buildCodexThreadMetadata = (target:
|
|
371
|
+
const buildCodexThreadMetadata = (target: CodexTranscriptExportTarget, sessionMeta: SessionMeta): MetadataEntry[] => {
|
|
324
372
|
return [
|
|
325
373
|
...buildCodexThreadTimingMetadata(target, sessionMeta),
|
|
326
374
|
...buildCodexThreadIdentityMetadata(target, sessionMeta),
|
|
327
375
|
];
|
|
328
376
|
};
|
|
329
377
|
|
|
330
|
-
const buildCodexThreadTimingMetadata = (
|
|
378
|
+
const buildCodexThreadTimingMetadata = (
|
|
379
|
+
target: CodexTranscriptExportTarget,
|
|
380
|
+
sessionMeta: SessionMeta,
|
|
381
|
+
): MetadataEntry[] => {
|
|
331
382
|
const thread = target.thread;
|
|
332
383
|
|
|
333
384
|
return [
|
|
@@ -341,7 +392,10 @@ const buildCodexThreadTimingMetadata = (target: ExportTarget, sessionMeta: Sessi
|
|
|
341
392
|
];
|
|
342
393
|
};
|
|
343
394
|
|
|
344
|
-
const buildCodexThreadIdentityMetadata = (
|
|
395
|
+
const buildCodexThreadIdentityMetadata = (
|
|
396
|
+
target: CodexTranscriptExportTarget,
|
|
397
|
+
sessionMeta: SessionMeta,
|
|
398
|
+
): MetadataEntry[] => {
|
|
345
399
|
const thread = target.thread;
|
|
346
400
|
|
|
347
401
|
return [
|
|
@@ -367,7 +421,7 @@ const buildCodexThreadIdentityMetadata = (target: ExportTarget, sessionMeta: Ses
|
|
|
367
421
|
];
|
|
368
422
|
};
|
|
369
423
|
|
|
370
|
-
const buildCodexAgentMetadata = (target:
|
|
424
|
+
const buildCodexAgentMetadata = (target: CodexTranscriptExportTarget): MetadataEntry[] => {
|
|
371
425
|
const thread = target.thread;
|
|
372
426
|
|
|
373
427
|
return [
|
|
@@ -506,7 +560,7 @@ const extractToolRecord = (parsed: Record<string, JsonValue>): ToolRecord | null
|
|
|
506
560
|
const renderMessageBlock = (
|
|
507
561
|
message: MessageRecord,
|
|
508
562
|
outputFormat: ExportFormat,
|
|
509
|
-
|
|
563
|
+
state: CodexTranscriptState,
|
|
510
564
|
includeCommentary: boolean,
|
|
511
565
|
): string => {
|
|
512
566
|
if (message.role !== 'user' && message.role !== 'assistant') {
|
|
@@ -517,12 +571,13 @@ const renderMessageBlock = (
|
|
|
517
571
|
return '';
|
|
518
572
|
}
|
|
519
573
|
|
|
520
|
-
const
|
|
574
|
+
const extractedText = extractText(message.content);
|
|
575
|
+
const text = stripCodexAppDirectiveLines(cleanExtractedText(stripPreviewBlock(extractedText)));
|
|
521
576
|
if (!text || shouldSkipMessage(message.role, text)) {
|
|
522
577
|
return '';
|
|
523
578
|
}
|
|
524
579
|
|
|
525
|
-
const title = message.role === 'user' ? 'User' : formatModelLabel(message.model ?? assistantModel);
|
|
580
|
+
const title = message.role === 'user' ? 'User' : formatModelLabel(message.model ?? state.assistantModel);
|
|
526
581
|
const body = message.phase ? `Phase: ${message.phase}\n\n${text}` : text;
|
|
527
582
|
|
|
528
583
|
return renderSection(title, body, outputFormat);
|
|
@@ -534,7 +589,8 @@ const renderToolBlock = (tool: ToolRecord, outputFormat: ExportFormat): string =
|
|
|
534
589
|
return details ? renderSection('Tool', details, outputFormat) : '';
|
|
535
590
|
}
|
|
536
591
|
|
|
537
|
-
const
|
|
592
|
+
const outputText = tool.outputText ?? '';
|
|
593
|
+
const summary = formatToolOutputSummary(outputText, outputFormat);
|
|
538
594
|
return summary ? renderSection('Tool Output', summary, outputFormat) : '';
|
|
539
595
|
};
|
|
540
596
|
|
package/src/lib/concurrency.ts
CHANGED
|
@@ -23,3 +23,44 @@ export const mapWithConcurrency = async <T, TResult>(
|
|
|
23
23
|
await Promise.all(Array.from({ length: Math.min(workerLimit, values.length) }, () => worker()));
|
|
24
24
|
return results;
|
|
25
25
|
};
|
|
26
|
+
|
|
27
|
+
export const createConcurrencyLimiter = (limit: number) => {
|
|
28
|
+
const requestedLimit = Number.isFinite(limit) ? Math.floor(limit) : 1;
|
|
29
|
+
const workerLimit = Math.max(1, requestedLimit);
|
|
30
|
+
const queue: Array<() => void> = [];
|
|
31
|
+
let activeCount = 0;
|
|
32
|
+
|
|
33
|
+
const drain = () => {
|
|
34
|
+
if (activeCount >= workerLimit) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const next = queue.shift();
|
|
39
|
+
if (next) {
|
|
40
|
+
next();
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return async <T>(task: () => Promise<T>): Promise<T> => {
|
|
45
|
+
await new Promise<void>((resolve) => {
|
|
46
|
+
const start = () => {
|
|
47
|
+
activeCount += 1;
|
|
48
|
+
resolve();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
if (activeCount < workerLimit) {
|
|
52
|
+
start();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
queue.push(start);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
return await task();
|
|
61
|
+
} finally {
|
|
62
|
+
activeCount -= 1;
|
|
63
|
+
drain();
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
};
|