spiracha 1.3.3 → 1.5.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 +55 -6
- package/README.md +46 -5
- package/apps/ui/AGENTS.md +31 -4
- package/apps/ui/README.md +59 -5
- package/apps/ui/dist/client/assets/analytics-DOy1b6Sh.js +1 -0
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-DqySVO2K.js +7 -0
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-KAcXtNxI.js +1 -0
- package/apps/ui/dist/client/assets/antigravity-keychain-panel-B77qJz6f.js +1 -0
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-B3NM6gRH.js +1 -0
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-ByitGWki.js +1 -0
- package/apps/ui/dist/client/assets/antigravity.index-DP9JC2P9.js +1 -0
- package/apps/ui/dist/client/assets/antigravity.index-DgW25FEV.js +1 -0
- package/apps/ui/dist/client/assets/badge-C3i4OKs8.js +1 -0
- package/apps/ui/dist/client/assets/checkbox-CdHitXWQ.js +1 -0
- package/apps/ui/dist/client/assets/claude-code-sessions._sessionId-8pQ55ci2.js +1 -0
- package/apps/ui/dist/client/assets/claude-code-sessions._sessionId-DVz5UmtU.js +1 -0
- package/apps/ui/dist/client/assets/claude-code._workspaceKey-BBKskSum.js +1 -0
- package/apps/ui/dist/client/assets/claude-code._workspaceKey-OkikMUFs.js +1 -0
- package/apps/ui/dist/client/assets/claude-code.index-Cwu76dbb.js +1 -0
- package/apps/ui/dist/client/assets/claude-code.index-D6eMd08t.js +1 -0
- package/apps/ui/dist/client/assets/createServerFn-B-KkwmHU.js +3 -0
- package/apps/ui/dist/client/assets/cursor-threads._composerId-CmBFclK8.js +1 -0
- package/apps/ui/dist/client/assets/cursor-threads._composerId-hBWlP1D-.js +1 -0
- package/apps/ui/dist/client/assets/cursor._workspaceKey-BFPkIRi-.js +1 -0
- package/apps/ui/dist/client/assets/cursor._workspaceKey-CaAZjGmm.js +1 -0
- package/apps/ui/dist/client/assets/cursor.index-8y4o20kb.js +2 -0
- package/apps/ui/dist/client/assets/cursor.index-CrnMwDCi.js +1 -0
- package/apps/ui/dist/client/assets/{data-table-DeQq8xdt.js → data-table-Br78_dk3.js} +2 -2
- package/apps/ui/dist/client/assets/delete-confirm-dialog-Bxs07u-j.js +7 -0
- package/apps/ui/dist/client/assets/dist-B9pyYCVU.js +1 -0
- package/apps/ui/dist/client/assets/dist-BrJhN2A0.js +5 -0
- package/apps/ui/dist/client/assets/dist-Cmd3AIfD.js +1 -0
- package/apps/ui/dist/client/assets/dist-DvMS2965.js +1 -0
- package/apps/ui/dist/client/assets/download-Bf0QJKD3.js +1 -0
- package/apps/ui/dist/client/assets/dropdown-menu-D5cvPaZt.js +1 -0
- package/apps/ui/dist/client/assets/es2015-ad6040dw.js +41 -0
- package/apps/ui/dist/client/assets/export-dialog-Dr8d2MqD.js +1 -0
- package/apps/ui/dist/client/assets/formatters-BtqyrX_c.js +1 -0
- package/apps/ui/dist/client/assets/index-C-STgIH4.js +166 -0
- package/apps/ui/dist/client/assets/jsx-runtime-DGeXAQPT.js +1 -0
- package/apps/ui/dist/client/assets/kiro-sessions._sessionId-CKgfJ7GR.js +1 -0
- package/apps/ui/dist/client/assets/kiro-sessions._sessionId-zvIJHtQF.js +1 -0
- package/apps/ui/dist/client/assets/kiro._workspaceKey-DhVuJuZB.js +1 -0
- package/apps/ui/dist/client/assets/kiro._workspaceKey-QArsjkTY.js +1 -0
- package/apps/ui/dist/client/assets/kiro.index-C-fr4m7i.js +1 -0
- package/apps/ui/dist/client/assets/kiro.index-OYgAdtZd.js +1 -0
- package/apps/ui/dist/client/assets/metric-card-Dplm0ZiM.js +1 -0
- package/apps/ui/dist/client/assets/opencode-sessions._sessionId-DLjiTst-.js +1 -0
- package/apps/ui/dist/client/assets/opencode-sessions._sessionId-biBwrRbt.js +8 -0
- package/apps/ui/dist/client/assets/opencode._workspaceKey-C7OIzMOJ.js +1 -0
- package/apps/ui/dist/client/assets/opencode._workspaceKey-sBakX0oI.js +1 -0
- package/apps/ui/dist/client/assets/opencode.index-Bl_kNs9N.js +1 -0
- package/apps/ui/dist/client/assets/opencode.index-CN53bVmb.js +1 -0
- package/apps/ui/dist/client/assets/page-header-Cwa3p6Tl.js +1 -0
- package/apps/ui/dist/client/assets/preload-helper-B8fFrdxC.js +1 -0
- package/apps/ui/dist/client/assets/projects._project-D8WloxQN.js +1 -0
- package/apps/ui/dist/client/assets/projects._project-DSDwH4NF.js +1 -0
- package/apps/ui/dist/client/assets/projects.index-5xRtuJdX.js +3 -0
- package/apps/ui/dist/client/assets/projects.index-DEfhWqa8.js +1 -0
- package/apps/ui/dist/client/assets/react-dom-DL96Jor4.js +1 -0
- package/apps/ui/dist/client/assets/refresh-ccw-BgKjOiA6.js +1 -0
- package/apps/ui/dist/client/assets/reload-error-panel-AHqu0akK.js +1 -0
- package/apps/ui/dist/client/assets/routes-DnzF_9CX.js +1 -0
- package/apps/ui/dist/client/assets/scroll-text-fM0sMOB3.js +1 -0
- package/apps/ui/dist/client/assets/select-CYF6pF37.js +1 -0
- package/apps/ui/dist/client/assets/settings-Dx70jgP_.js +1 -0
- package/apps/ui/dist/client/assets/sqlite-error-B6uZjUe8.js +1 -0
- package/apps/ui/dist/client/assets/styles-B7Zi9EFA.css +1 -0
- package/apps/ui/dist/client/assets/tabs-CmuhkT-c.js +7 -0
- package/apps/ui/dist/client/assets/text-filter-DVAZySUS.js +2 -0
- package/apps/ui/dist/client/assets/thread-transcript-stats-BUNz6u7F.js +1 -0
- package/apps/ui/dist/client/assets/threads._threadId-BB9tTsV4.js +1 -0
- package/apps/ui/dist/client/assets/threads._threadId-BMRSFow3.js +1 -0
- package/apps/ui/dist/client/assets/useMutation-BSFult2i.js +1 -0
- package/apps/ui/dist/client/assets/useQuery-CjINKZf1.js +1 -0
- package/apps/ui/dist/client/icon.svg +2 -1
- package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-CQ8Jjs3B.js +387 -0
- package/apps/ui/dist/server/assets/analytics-CYP_LT5Y.js +16 -0
- package/apps/ui/dist/server/assets/{analytics-Dc_QDZZC.js → analytics-CtpOMVMO.js} +13 -6
- package/apps/ui/dist/server/assets/antigravity-conversations._conversationId-BKOyL2T6.js +613 -0
- package/apps/ui/dist/server/assets/{antigravity-conversations._conversationId-C9z4AeN-.js → antigravity-conversations._conversationId-eS87Dx7g.js} +2 -2
- package/apps/ui/dist/server/assets/{antigravity-db-D9gW1D8G.js → antigravity-db-Bh8_U9uw.js} +11 -7
- package/apps/ui/dist/server/assets/{antigravity-keychain-panel-bpPoxhyp.js → antigravity-keychain-panel-CC7FLmAK.js} +1 -1
- package/apps/ui/dist/server/assets/{antigravity-queries-DVIKyOXi.js → antigravity-queries-CGrJO9Vr.js} +5 -5
- package/apps/ui/dist/server/assets/{antigravity-server-Cp1lc8fp.js → antigravity-server-CHRjVFqN.js} +11 -11
- package/apps/ui/dist/server/assets/{antigravity._workspaceKey-Dl8o1ptg.js → antigravity._workspaceKey-B0QeYUOh.js} +2 -2
- package/apps/ui/dist/server/assets/{antigravity._workspaceKey-BAoa4izU.js → antigravity._workspaceKey-C3kP-qyN.js} +4 -4
- package/apps/ui/dist/server/assets/{antigravity.index-BOlrJasZ.js → antigravity.index-CPCYkqCi.js} +2 -2
- package/apps/ui/dist/server/assets/claude-code-db-Ik3VStKZ.js +361 -0
- package/apps/ui/dist/server/assets/claude-code-queries-Cgzi4K-e.js +37 -0
- package/apps/ui/dist/server/assets/claude-code-server-PfraClXS.js +72 -0
- package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-C55oe6zj.js +18 -0
- package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-D1RYYi3j.js +473 -0
- package/apps/ui/dist/server/assets/claude-code-sessions._sessionId-DSvPLEUL.js +11 -0
- package/apps/ui/dist/server/assets/claude-code-transcript-C-bxh3cS.js +139 -0
- package/apps/ui/dist/server/assets/claude-code-transcript-phase-DmUMc8VU.js +10 -0
- package/apps/ui/dist/server/assets/claude-code._workspaceKey-B5Xg_-tE.js +28 -0
- package/apps/ui/dist/server/assets/claude-code._workspaceKey-BPlzyXPa.js +11 -0
- package/apps/ui/dist/server/assets/claude-code._workspaceKey-DqDve2wl.js +191 -0
- package/apps/ui/dist/server/assets/claude-code.index-B7yYR7dD.js +92 -0
- package/apps/ui/dist/server/assets/claude-code.index-BUHThG1W.js +11 -0
- package/apps/ui/dist/server/assets/{codex-queries-ev_mRUzr.js → codex-queries-CtgeZ7VL.js} +15 -13
- package/apps/ui/dist/server/assets/{codex-server-DIYFLozB.js → codex-server-CGXU4H8-.js} +421 -146
- package/apps/ui/dist/server/assets/concurrency-VXtYvlGh.js +18 -0
- package/apps/ui/dist/server/assets/{createServerRpc-Cg-Zr1rq.js → createServerRpc-CF_DEwnm.js} +1 -1
- package/apps/ui/dist/server/assets/{createSsrRpc-DVnVQhGx.js → createSsrRpc-C754NPki.js} +1 -1
- package/apps/ui/dist/server/assets/{cursor-db-B7agkAvM.js → cursor-db-CZnYy7aT.js} +196 -9
- package/apps/ui/dist/server/assets/{cursor-queries-f7DjBKSD.js → cursor-queries-NCIM0Nat.js} +12 -10
- package/apps/ui/dist/server/assets/{cursor-recovery-9bJLs7vG.js → cursor-recovery-CXpO8KcD.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor-server-nPzojHN3.js → cursor-server-DNu52A3K.js} +71 -42
- package/apps/ui/dist/server/assets/cursor-threads._composerId-Ckn6ItHI.js +582 -0
- package/apps/ui/dist/server/assets/{cursor-threads._composerId-B3qcsh9C.js → cursor-threads._composerId-p9-ARAzc.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor-transcript-2iL3KFSK.js → cursor-transcript-B7tGnqtn.js} +1 -1
- package/apps/ui/dist/server/assets/{cursor._workspaceKey-BL_CQyHQ.js → cursor._workspaceKey-CZuohIUL.js} +2 -2
- package/apps/ui/dist/server/assets/{cursor._workspaceKey-BhQeepXB.js → cursor._workspaceKey-DPp5JSjy.js} +11 -9
- package/apps/ui/dist/server/assets/{cursor.index-CsrdckZD.js → cursor.index-DkWT-mxw.js} +2 -2
- package/apps/ui/dist/server/assets/{delete-confirm-dialog-PCD7S0_M.js → delete-confirm-dialog-BcBNCxWB.js} +5 -1
- package/apps/ui/dist/server/assets/{empty-plugin-adapters-D3qLMPfC.js → empty-plugin-adapters-B3lHh1La.js} +1 -1
- package/apps/ui/dist/server/assets/{export-dialog-DaPlOGFT.js → export-dialog-D88ze9Gy.js} +54 -12
- package/apps/ui/dist/server/assets/kiro-db--fXrED_-.js +552 -0
- package/apps/ui/dist/server/assets/kiro-queries-CzNlM2ok.js +37 -0
- package/apps/ui/dist/server/assets/kiro-server-9WRxg2Au.js +72 -0
- package/apps/ui/dist/server/assets/kiro-sessions._sessionId-CRY2c7YO.js +11 -0
- package/apps/ui/dist/server/assets/kiro-sessions._sessionId-F1UlwxmR.js +449 -0
- package/apps/ui/dist/server/assets/kiro-sessions._sessionId-bvTulT7C.js +18 -0
- package/apps/ui/dist/server/assets/kiro-transcript-DoekQBaH.js +112 -0
- package/apps/ui/dist/server/assets/kiro-transcript-phase-CJG40nQg.js +27 -0
- package/apps/ui/dist/server/assets/kiro._workspaceKey-BDe9sQwo.js +11 -0
- package/apps/ui/dist/server/assets/kiro._workspaceKey-CJsjgNwO.js +28 -0
- package/apps/ui/dist/server/assets/kiro._workspaceKey-D_-4Qb7y.js +193 -0
- package/apps/ui/dist/server/assets/kiro.index-C__-UROk.js +11 -0
- package/apps/ui/dist/server/assets/kiro.index-CmTbqeYj.js +93 -0
- package/apps/ui/dist/server/assets/opencode-db-BM7KjOzc.js +397 -0
- package/apps/ui/dist/server/assets/opencode-queries-BeNYXnQv.js +50 -0
- package/apps/ui/dist/server/assets/opencode-server-BpQ_kRze.js +72 -0
- package/apps/ui/dist/server/assets/opencode-sessions._sessionId-CGQ-t0vD.js +518 -0
- package/apps/ui/dist/server/assets/opencode-sessions._sessionId-D8Q7in_Z.js +18 -0
- package/apps/ui/dist/server/assets/opencode-sessions._sessionId-DKOvi0lV.js +11 -0
- package/apps/ui/dist/server/assets/opencode-think-tags-CAoD-EcZ.js +87 -0
- package/apps/ui/dist/server/assets/opencode-transcript-BNTcGNym.js +141 -0
- package/apps/ui/dist/server/assets/opencode-transcript-phase-OqLkiQD0.js +32 -0
- package/apps/ui/dist/server/assets/opencode._workspaceKey-BdqcWHw1.js +11 -0
- package/apps/ui/dist/server/assets/opencode._workspaceKey-CfH96HTT.js +28 -0
- package/apps/ui/dist/server/assets/opencode._workspaceKey-DdbHPDrO.js +207 -0
- package/apps/ui/dist/server/assets/opencode.index-BbVzkJXP.js +11 -0
- package/apps/ui/dist/server/assets/opencode.index-Vh_Gq_1L.js +93 -0
- package/apps/ui/dist/server/assets/{projects._project-CqqUFr4l.js → projects._project-4io5LO0E.js} +5 -3
- package/apps/ui/dist/server/assets/{projects._project-DahGqNYS.js → projects._project-D6ZoGhJ8.js} +42 -12
- package/apps/ui/dist/server/assets/{projects.index-CkTeFWNU.js → projects.index-BkLiF2FF.js} +21 -7
- package/apps/ui/dist/server/assets/projects.index-DesYXwfi.js +14 -0
- package/apps/ui/dist/server/assets/route-search-ts4W9MJ9.js +38 -0
- package/apps/ui/dist/server/assets/router-Sac2DGk6.js +518 -0
- package/apps/ui/dist/server/assets/{routes-Xix3ZeSo.js → routes-Bsact1uB.js} +2 -2
- package/apps/ui/dist/server/assets/{routes-0x1U0IHq.js → routes-BzkJgq4W.js} +2 -2
- package/apps/ui/dist/server/assets/{shared-CPRNYIql.js → shared-DyhChtHf.js} +4 -1
- package/apps/ui/dist/server/assets/source-session-export-server-DNutCawb.js +38 -0
- package/apps/ui/dist/server/assets/start-B_HFwkkk.js +4 -0
- package/apps/ui/dist/server/assets/tabs-DkaChNVg.js +501 -0
- package/apps/ui/dist/server/assets/thread-transcript-stats-Dh34mt2u.js +45 -0
- package/apps/ui/dist/server/assets/threads._threadId-BeXEc4Lo.js +648 -0
- package/apps/ui/dist/server/assets/{threads._threadId-BLCkGW--.js → threads._threadId-Ci0S4mKU.js} +2 -2
- package/apps/ui/dist/server/assets/ui-export-files-BHLX9bhN.js +83 -0
- package/apps/ui/dist/server/server.js +141 -83
- package/package.json +28 -11
- package/src/lib/antigravity-db.ts +20 -13
- 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 +118 -18
- package/src/lib/codex-browser-db.ts +491 -56
- package/src/lib/codex-browser-export.ts +27 -71
- package/src/lib/codex-thread-cache.ts +17 -1
- package/src/lib/concurrency.ts +25 -0
- package/src/lib/cursor-db.ts +318 -7
- package/src/lib/cursor-exporter.ts +2 -2
- 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/shared.ts +25 -0
- package/src/lib/ui-cache.ts +14 -1
- package/src/lib/ui-export-archive.ts +61 -0
- package/apps/ui/dist/client/assets/analytics-C83LcWNb.js +0 -1
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-DkY8EEpK.js +0 -1
- package/apps/ui/dist/client/assets/antigravity-conversations._conversationId-OraHuz8j.js +0 -1
- package/apps/ui/dist/client/assets/antigravity-keychain-panel-DnDcq1ge.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-CQaZscA5.js +0 -1
- package/apps/ui/dist/client/assets/antigravity._workspaceKey-DTs99obU.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-DbJa715k.js +0 -1
- package/apps/ui/dist/client/assets/antigravity.index-P-rs6w5X.js +0 -1
- package/apps/ui/dist/client/assets/badge-wgTVp-aq.js +0 -1
- package/apps/ui/dist/client/assets/checkbox-BUx0Gkuf.js +0 -1
- package/apps/ui/dist/client/assets/cursor-threads._composerId-D0DFXt8t.js +0 -1
- package/apps/ui/dist/client/assets/cursor-threads._composerId-tFa6Cf6A.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-Df4PfA2k.js +0 -1
- package/apps/ui/dist/client/assets/cursor._workspaceKey-DwrzEtnV.js +0 -1
- package/apps/ui/dist/client/assets/cursor.index-CNBf4ZiR.js +0 -1
- package/apps/ui/dist/client/assets/cursor.index-DP9Hy8X6.js +0 -2
- package/apps/ui/dist/client/assets/delete-confirm-dialog-CPlNsLhM.js +0 -11
- package/apps/ui/dist/client/assets/dist-Ds3kS91l.js +0 -1
- package/apps/ui/dist/client/assets/download-DLuPnxpV.js +0 -1
- package/apps/ui/dist/client/assets/dropdown-menu-lFk6zjoL.js +0 -1
- package/apps/ui/dist/client/assets/es2015-D-H_iZF6.js +0 -41
- package/apps/ui/dist/client/assets/export-dialog-CyqyvwiP.js +0 -1
- package/apps/ui/dist/client/assets/formatters-DbCKP02D.js +0 -1
- package/apps/ui/dist/client/assets/index-C-ZPpKJ0.js +0 -22
- package/apps/ui/dist/client/assets/json-panel-BsngvucB.js +0 -1
- package/apps/ui/dist/client/assets/metadata-section-Dtl8dNag.js +0 -1
- package/apps/ui/dist/client/assets/metric-card-DNzR1Rne.js +0 -1
- package/apps/ui/dist/client/assets/page-header-dha_O7ZL.js +0 -1
- package/apps/ui/dist/client/assets/projects._project-B7HBhbXv.js +0 -1
- package/apps/ui/dist/client/assets/projects._project-DHVvuT7A.js +0 -1
- package/apps/ui/dist/client/assets/projects.index-BUUtx2AZ.js +0 -1
- package/apps/ui/dist/client/assets/projects.index-BojAe1Y4.js +0 -3
- package/apps/ui/dist/client/assets/refresh-ccw-B-ASKHtx.js +0 -1
- package/apps/ui/dist/client/assets/reload-error-panel-DD8M1BIY.js +0 -1
- package/apps/ui/dist/client/assets/routes-q7bzFp35.js +0 -1
- package/apps/ui/dist/client/assets/scroll-text-TvHyiJ_N.js +0 -1
- package/apps/ui/dist/client/assets/select-BFv1HMiT.js +0 -1
- package/apps/ui/dist/client/assets/settings-CvegTo4F.js +0 -1
- package/apps/ui/dist/client/assets/styles-Ch0r3kMZ.css +0 -1
- package/apps/ui/dist/client/assets/text-document-panel-D7Rws41o.js +0 -1
- package/apps/ui/dist/client/assets/text-filter-2q5pEoZh.js +0 -2
- package/apps/ui/dist/client/assets/threads._threadId-LpZVUlPq.js +0 -7
- package/apps/ui/dist/client/assets/threads._threadId-MSmNIBkq.js +0 -1
- package/apps/ui/dist/client/assets/useMutation-BOPJU9e0.js +0 -1
- package/apps/ui/dist/client/assets/useQuery-CbxZiVGF.js +0 -1
- package/apps/ui/dist/server/assets/_tanstack-start-manifest_v-zvGzK-Yx.js +0 -229
- package/apps/ui/dist/server/assets/antigravity-conversations._conversationId-JEhx-f2R.js +0 -212
- package/apps/ui/dist/server/assets/cursor-threads._composerId-BK3iW-3e.js +0 -218
- package/apps/ui/dist/server/assets/json-panel-RYsxWFae.js +0 -16
- package/apps/ui/dist/server/assets/metadata-section-D6Lbc7D6.js +0 -54
- package/apps/ui/dist/server/assets/router-K0m7dK4T.js +0 -394
- package/apps/ui/dist/server/assets/start-bX7bXjzw.js +0 -4
- package/apps/ui/dist/server/assets/text-document-panel-D8JbQWAn.js +0 -23
- package/apps/ui/dist/server/assets/threads._threadId-LjgsGUh-.js +0 -1052
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region ../../src/lib/opencode-think-tags.ts
|
|
2
|
+
var THINK_OPEN_PATTERN = /<think\b[^>]*>/iy;
|
|
3
|
+
var THINK_CLOSE_PATTERN = /<\/think>/gi;
|
|
4
|
+
var THINK_CLOSE_TAG_LENGTH = 8;
|
|
5
|
+
var normalizeExtractedText = (text) => {
|
|
6
|
+
return text.replace(/\n{3,}/g, "\n\n").trim();
|
|
7
|
+
};
|
|
8
|
+
var getBacktickRunLength = (text, start) => {
|
|
9
|
+
let end = start;
|
|
10
|
+
while (text[end] === "`") end += 1;
|
|
11
|
+
return end - start;
|
|
12
|
+
};
|
|
13
|
+
var findClosingBackticks = (text, start, runLength) => {
|
|
14
|
+
const marker = "`".repeat(runLength);
|
|
15
|
+
const index = text.indexOf(marker, start + runLength);
|
|
16
|
+
return index === -1 ? text.length : index + runLength;
|
|
17
|
+
};
|
|
18
|
+
var findThinkCloseIndex = (text, start) => {
|
|
19
|
+
THINK_CLOSE_PATTERN.lastIndex = start;
|
|
20
|
+
const match = THINK_CLOSE_PATTERN.exec(text);
|
|
21
|
+
return match ? match.index : -1;
|
|
22
|
+
};
|
|
23
|
+
var getLastVisibleChar = (parts) => {
|
|
24
|
+
for (let index = parts.length - 1; index >= 0; index -= 1) {
|
|
25
|
+
const part = parts[index];
|
|
26
|
+
if (part) return part.at(-1) ?? "";
|
|
27
|
+
}
|
|
28
|
+
return "";
|
|
29
|
+
};
|
|
30
|
+
var getThinkReplacement = (previous, next) => {
|
|
31
|
+
if (previous === "\n" || next === "\n") return "\n";
|
|
32
|
+
if (previous && /\s/u.test(previous) || next && /\s/u.test(next)) return "";
|
|
33
|
+
return " ";
|
|
34
|
+
};
|
|
35
|
+
var shouldSkipFollowingSpace = (replacement, previous, next) => {
|
|
36
|
+
return (replacement === " " || Boolean(previous && /[^\S\n]/u.test(previous))) && /[^\S\n]/u.test(next);
|
|
37
|
+
};
|
|
38
|
+
var readThinkBlock = (text, cursor, visibleParts) => {
|
|
39
|
+
THINK_OPEN_PATTERN.lastIndex = cursor;
|
|
40
|
+
if (THINK_OPEN_PATTERN.exec(text)?.index !== cursor) return null;
|
|
41
|
+
const reasoningStart = THINK_OPEN_PATTERN.lastIndex;
|
|
42
|
+
const closeIndex = findThinkCloseIndex(text, reasoningStart);
|
|
43
|
+
const reasoningEnd = closeIndex === -1 ? text.length : closeIndex;
|
|
44
|
+
const normalizedReasoning = normalizeExtractedText(text.slice(reasoningStart, reasoningEnd));
|
|
45
|
+
let nextCursor = closeIndex === -1 ? text.length : closeIndex + THINK_CLOSE_TAG_LENGTH;
|
|
46
|
+
const previous = getLastVisibleChar(visibleParts);
|
|
47
|
+
const replacement = getThinkReplacement(previous, text[nextCursor] ?? "");
|
|
48
|
+
if (shouldSkipFollowingSpace(replacement, previous, text[nextCursor] ?? "")) nextCursor += 1;
|
|
49
|
+
return {
|
|
50
|
+
nextCursor,
|
|
51
|
+
reasoning: normalizedReasoning || null,
|
|
52
|
+
replacement
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* OpenCode can store MiniMax reasoning inline as <think> blocks. Preserve literal
|
|
57
|
+
* examples in Markdown code while extracting model-emitted tags as commentary.
|
|
58
|
+
*/
|
|
59
|
+
var splitOpenCodeThinkTaggedText = (text) => {
|
|
60
|
+
const reasoningBlocks = [];
|
|
61
|
+
const visibleParts = [];
|
|
62
|
+
let cursor = 0;
|
|
63
|
+
while (cursor < text.length) {
|
|
64
|
+
if (text[cursor] === "`") {
|
|
65
|
+
const runLength = getBacktickRunLength(text, cursor);
|
|
66
|
+
const end = findClosingBackticks(text, cursor, runLength);
|
|
67
|
+
visibleParts.push(text.slice(cursor, end));
|
|
68
|
+
cursor = end;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const thinkBlock = readThinkBlock(text, cursor, visibleParts);
|
|
72
|
+
if (thinkBlock) {
|
|
73
|
+
if (thinkBlock.reasoning) reasoningBlocks.push(thinkBlock.reasoning);
|
|
74
|
+
visibleParts.push(thinkBlock.replacement);
|
|
75
|
+
cursor = thinkBlock.nextCursor;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
visibleParts.push(text[cursor]);
|
|
79
|
+
cursor += 1;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
reasoningBlocks,
|
|
83
|
+
visibleText: normalizeExtractedText(visibleParts.join(""))
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { splitOpenCodeThinkTaggedText as t };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { a as cleanExtractedText, g as renderSection, h as renderMetadataBlock, l as formatInlineLiteral, m as renderDocumentTitle, o as cleanInlineTitle, p as renderCodeBlock } from "./shared-DyhChtHf.js";
|
|
2
|
+
import { t as splitOpenCodeThinkTaggedText } from "./opencode-think-tags-CAoD-EcZ.js";
|
|
3
|
+
import { n as getOpenCodeTextPartPhase, t as getFinalOpenCodeAssistantTextPartIds } from "./opencode-transcript-phase-OqLkiQD0.js";
|
|
4
|
+
//#region ../../src/lib/opencode-transcript.ts
|
|
5
|
+
var TOOL_OUTPUT_PREVIEW_LIMIT = 4e3;
|
|
6
|
+
var MIN_DATE_MS = -864e13;
|
|
7
|
+
var MAX_DATE_MS = 864e13;
|
|
8
|
+
var formatUnixMillis = (value) => {
|
|
9
|
+
if (value === null || value === void 0 || !Number.isFinite(value) || value < MIN_DATE_MS || value > MAX_DATE_MS) return null;
|
|
10
|
+
return new Date(value).toISOString();
|
|
11
|
+
};
|
|
12
|
+
var getSessionTitle = (session) => {
|
|
13
|
+
return cleanInlineTitle(session.title || session.sessionId);
|
|
14
|
+
};
|
|
15
|
+
var buildMetadataEntries = (session) => [
|
|
16
|
+
{
|
|
17
|
+
key: "exported_from",
|
|
18
|
+
value: "opencode_sqlite"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: "session_id",
|
|
22
|
+
value: session.sessionId
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: "title",
|
|
26
|
+
value: session.title
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
key: "slug",
|
|
30
|
+
value: session.slug
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "project_id",
|
|
34
|
+
value: session.projectId
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: "worktree",
|
|
38
|
+
value: session.worktree
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "directory",
|
|
42
|
+
value: session.directory
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "agent",
|
|
46
|
+
value: session.agent
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "model",
|
|
50
|
+
value: session.modelLabel
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "created_at_unix_ms",
|
|
54
|
+
value: session.createdAtMs
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: "created_at_iso",
|
|
58
|
+
value: formatUnixMillis(session.createdAtMs)
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "last_updated_at_unix_ms",
|
|
62
|
+
value: session.lastUpdatedAtMs
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "last_updated_at_iso",
|
|
66
|
+
value: formatUnixMillis(session.lastUpdatedAtMs)
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
key: "message_count",
|
|
70
|
+
value: session.messageCount
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "part_count",
|
|
74
|
+
value: session.partCount
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: "total_tokens",
|
|
78
|
+
value: session.totalTokens
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: "cost",
|
|
82
|
+
value: session.cost
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
var roleTitle = (role) => {
|
|
86
|
+
if (role === "assistant") return "Assistant";
|
|
87
|
+
if (role === "user") return "User";
|
|
88
|
+
if (role === "system") return "System";
|
|
89
|
+
return role ? cleanInlineTitle(role) : "Message";
|
|
90
|
+
};
|
|
91
|
+
var truncateOutput = (text) => {
|
|
92
|
+
if (text.length <= TOOL_OUTPUT_PREVIEW_LIMIT) return text;
|
|
93
|
+
return `${text.slice(0, TOOL_OUTPUT_PREVIEW_LIMIT)}\n... (truncated)`;
|
|
94
|
+
};
|
|
95
|
+
var renderTextPart = (part, options, finalAssistantTextPartIds) => {
|
|
96
|
+
const { reasoningBlocks, visibleText } = part.role === "assistant" ? splitOpenCodeThinkTaggedText(part.text ?? "") : {
|
|
97
|
+
reasoningBlocks: [],
|
|
98
|
+
visibleText: part.text ?? ""
|
|
99
|
+
};
|
|
100
|
+
const sections = [];
|
|
101
|
+
if (options.includeCommentary) sections.push(...reasoningBlocks.map((block) => cleanExtractedText(block).trim()).filter(Boolean).map((block) => renderSection("Reasoning", block, options.outputFormat)));
|
|
102
|
+
const text = cleanExtractedText(visibleText).trim();
|
|
103
|
+
if (text && (getOpenCodeTextPartPhase(part, finalAssistantTextPartIds) !== "commentary" || options.includeCommentary)) sections.push(renderSection(roleTitle(part.role), text, options.outputFormat));
|
|
104
|
+
return sections.join("\n\n");
|
|
105
|
+
};
|
|
106
|
+
var renderReasoningPart = (part, options) => {
|
|
107
|
+
if (!options.includeCommentary) return "";
|
|
108
|
+
const { reasoningBlocks, visibleText } = splitOpenCodeThinkTaggedText(part.text ?? "");
|
|
109
|
+
const text = cleanExtractedText([...reasoningBlocks, visibleText].filter(Boolean).join("\n\n")).trim();
|
|
110
|
+
return text ? renderSection("Reasoning", text, options.outputFormat) : "";
|
|
111
|
+
};
|
|
112
|
+
var renderToolPart = (part, options) => {
|
|
113
|
+
if (!options.includeTools) return "";
|
|
114
|
+
const lines = [`Tool: ${formatInlineLiteral(part.toolName ?? "unknown", options.outputFormat)}`];
|
|
115
|
+
if (part.status) lines.push(`Status: ${part.status}`);
|
|
116
|
+
if (part.callId) lines.push(`Call ID: ${part.callId}`);
|
|
117
|
+
if (part.title) lines.push(`Title: ${part.title}`);
|
|
118
|
+
if (part.argumentsText?.trim()) lines.push("", "Input:", "", renderCodeBlock(part.argumentsText.trim(), options.outputFormat));
|
|
119
|
+
if (part.outputText?.trim()) lines.push("", "Output:", "", renderCodeBlock(truncateOutput(part.outputText.trim()), options.outputFormat));
|
|
120
|
+
return renderSection("Tool Call", lines.join("\n"), options.outputFormat);
|
|
121
|
+
};
|
|
122
|
+
var renderPart = (part, options, finalAssistantTextPartIds) => {
|
|
123
|
+
if (part.type === "text") return renderTextPart(part, options, finalAssistantTextPartIds);
|
|
124
|
+
if (part.type === "reasoning") return renderReasoningPart(part, options);
|
|
125
|
+
if (part.type === "tool") return renderToolPart(part, options);
|
|
126
|
+
return "";
|
|
127
|
+
};
|
|
128
|
+
var renderOpenCodeTranscript = (transcript, options) => {
|
|
129
|
+
const partsList = transcript.messages.flatMap((message) => message.parts);
|
|
130
|
+
const finalAssistantTextPartIds = getFinalOpenCodeAssistantTextPartIds(partsList);
|
|
131
|
+
const sections = partsList.map((part) => renderPart(part, options, finalAssistantTextPartIds)).filter(Boolean);
|
|
132
|
+
if (sections.length === 0) return null;
|
|
133
|
+
return `${[
|
|
134
|
+
renderDocumentTitle(getSessionTitle(transcript.session), options.outputFormat),
|
|
135
|
+
"",
|
|
136
|
+
options.includeMetadata ? renderMetadataBlock(buildMetadataEntries(transcript.session), options.outputFormat) : "",
|
|
137
|
+
...sections
|
|
138
|
+
].filter(Boolean).join("\n").trimEnd()}\n`;
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
export { renderOpenCodeTranscript };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { t as splitOpenCodeThinkTaggedText } from "./opencode-think-tags-CAoD-EcZ.js";
|
|
2
|
+
//#region ../../src/lib/opencode-transcript-phase.ts
|
|
3
|
+
var getFinalOpenCodeAssistantTextPartIds = (parts) => {
|
|
4
|
+
const finalPartIds = /* @__PURE__ */ new Set();
|
|
5
|
+
let latestAssistantTextPartId = null;
|
|
6
|
+
const flushAssistantRun = () => {
|
|
7
|
+
if (latestAssistantTextPartId) {
|
|
8
|
+
finalPartIds.add(latestAssistantTextPartId);
|
|
9
|
+
latestAssistantTextPartId = null;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
for (const part of parts) {
|
|
13
|
+
if (part.role === "user") {
|
|
14
|
+
flushAssistantRun();
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (part.role !== "assistant") continue;
|
|
18
|
+
if (part.type === "tool") {
|
|
19
|
+
latestAssistantTextPartId = null;
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
if (part.type === "text" && splitOpenCodeThinkTaggedText(part.text ?? "").visibleText.trim()) latestAssistantTextPartId = part.partId;
|
|
23
|
+
}
|
|
24
|
+
flushAssistantRun();
|
|
25
|
+
return finalPartIds;
|
|
26
|
+
};
|
|
27
|
+
var getOpenCodeTextPartPhase = (part, finalAssistantTextPartIds) => {
|
|
28
|
+
if (part.role !== "assistant") return null;
|
|
29
|
+
return finalAssistantTextPartIds.has(part.partId) ? "final_answer" : "commentary";
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getOpenCodeTextPartPhase as n, getFinalOpenCodeAssistantTextPartIds as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as ReloadErrorPanel } from "./reload-error-panel-BJMxY3U1.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/routes/opencode.$workspaceKey.tsx?tsr-split=errorComponent
|
|
4
|
+
function OpenCodeWorkspaceErrorComponent({ error }) {
|
|
5
|
+
return /* @__PURE__ */ jsx(ReloadErrorPanel, {
|
|
6
|
+
description: error.message,
|
|
7
|
+
title: "Failed to load OpenCode workspace"
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { OpenCodeWorkspaceErrorComponent as errorComponent };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { n as openCodeSessionsQueryOptions, r as openCodeWorkspacesQueryOptions } from "./opencode-queries-BeNYXnQv.js";
|
|
2
|
+
import { t as LoadingPanel } from "./loading-panel-BGFnWseS.js";
|
|
3
|
+
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/routes/opencode.$workspaceKey.tsx?tsr-shared=1
|
|
6
|
+
var findWorkspaceOrThrow = (workspaces, workspaceKey) => {
|
|
7
|
+
const workspace = workspaces.find((candidate) => candidate.key === workspaceKey);
|
|
8
|
+
if (!workspace) throw new Error(`OpenCode workspace not found: ${workspaceKey}`);
|
|
9
|
+
return workspace;
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/routes/opencode.$workspaceKey.tsx
|
|
13
|
+
var $$splitErrorComponentImporter = () => import("./opencode._workspaceKey-BdqcWHw1.js");
|
|
14
|
+
var $$splitComponentImporter = () => import("./opencode._workspaceKey-DdbHPDrO.js");
|
|
15
|
+
var Route = createFileRoute("/opencode/$workspaceKey")({
|
|
16
|
+
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
17
|
+
errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"),
|
|
18
|
+
loader: async ({ context, params }) => {
|
|
19
|
+
findWorkspaceOrThrow(await context.queryClient.ensureQueryData(openCodeWorkspacesQueryOptions()), params.workspaceKey);
|
|
20
|
+
await context.queryClient.ensureQueryData(openCodeSessionsQueryOptions(params.workspaceKey));
|
|
21
|
+
},
|
|
22
|
+
pendingComponent: () => /* @__PURE__ */ jsx(LoadingPanel, {
|
|
23
|
+
description: "Loading OpenCode sessions and transcript metadata.",
|
|
24
|
+
title: "Loading workspace"
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { findWorkspaceOrThrow as n, Route as t };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { t as Button } from "./button-CmTDnzOn.js";
|
|
2
|
+
import { i as exportOpenCodeSessionFn, n as openCodeSessionsQueryOptions, r as openCodeWorkspacesQueryOptions } from "./opencode-queries-BeNYXnQv.js";
|
|
3
|
+
import { n as findWorkspaceOrThrow, t as Route } from "./opencode._workspaceKey-CfH96HTT.js";
|
|
4
|
+
import { t as DataTable } from "./data-table-Cdct823O.js";
|
|
5
|
+
import { t as PageHeader } from "./page-header-VNSaM3xd.js";
|
|
6
|
+
import { o as formatNumber, r as formatDateTime, s as formatTokens } from "./formatters-FJaGZgJk.js";
|
|
7
|
+
import { t as Badge } from "./badge-EvdhKK_Z.js";
|
|
8
|
+
import { n as downloadUrlFile, t as downloadTextFile } from "./download-DMmiy1xf.js";
|
|
9
|
+
import { i as DropdownMenuTrigger, n as DropdownMenuContent, r as DropdownMenuItem, t as DropdownMenu } from "./dropdown-menu-Dy_9t6TN.js";
|
|
10
|
+
import { n as ListSearchInput, t as matchesTextQuery } from "./text-filter-CGKxMCKt.js";
|
|
11
|
+
import { t as ExportDialog } from "./export-dialog-D88ze9Gy.js";
|
|
12
|
+
import { useDeferredValue, useMemo, useState } from "react";
|
|
13
|
+
import { Link } from "@tanstack/react-router";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
import { useMutation, useSuspenseQuery } from "@tanstack/react-query";
|
|
16
|
+
import { Download, MoreHorizontal } from "lucide-react";
|
|
17
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
18
|
+
//#region src/components/opencode-sessions-table.tsx
|
|
19
|
+
var columnHelper = createColumnHelper();
|
|
20
|
+
var defaultSorting = [{
|
|
21
|
+
desc: true,
|
|
22
|
+
id: "updatedAt"
|
|
23
|
+
}];
|
|
24
|
+
var formatCost = (value) => {
|
|
25
|
+
if (value <= 0) return "$0";
|
|
26
|
+
return `$${value.toFixed(value < .01 ? 4 : 2)}`;
|
|
27
|
+
};
|
|
28
|
+
var columns = (onExportSession) => [
|
|
29
|
+
columnHelper.accessor("title", {
|
|
30
|
+
cell: (info) => /* @__PURE__ */ jsxs(Link, {
|
|
31
|
+
className: "block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto",
|
|
32
|
+
params: { sessionId: info.row.original.sessionId },
|
|
33
|
+
to: "/opencode-sessions/$sessionId",
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "flex items-center gap-2",
|
|
36
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
37
|
+
className: "truncate font-medium underline-offset-2 hover:underline",
|
|
38
|
+
children: info.getValue()
|
|
39
|
+
}), info.row.original.archivedAtMs ? /* @__PURE__ */ jsx(Badge, {
|
|
40
|
+
variant: "outline",
|
|
41
|
+
children: "archived"
|
|
42
|
+
}) : null]
|
|
43
|
+
}), /* @__PURE__ */ jsxs("p", {
|
|
44
|
+
className: "truncate text-[var(--muted-foreground)] text-xs",
|
|
45
|
+
children: [
|
|
46
|
+
info.row.original.slug,
|
|
47
|
+
" · ",
|
|
48
|
+
info.row.original.sessionId
|
|
49
|
+
]
|
|
50
|
+
})]
|
|
51
|
+
}),
|
|
52
|
+
header: "Session"
|
|
53
|
+
}),
|
|
54
|
+
columnHelper.accessor("lastUpdatedAtMs", {
|
|
55
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "whitespace-nowrap text-sm",
|
|
57
|
+
suppressHydrationWarning: true,
|
|
58
|
+
children: formatDateTime(info.getValue())
|
|
59
|
+
}),
|
|
60
|
+
header: "Updated",
|
|
61
|
+
id: "updatedAt"
|
|
62
|
+
}),
|
|
63
|
+
columnHelper.accessor("agent", {
|
|
64
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: "font-mono text-sm",
|
|
66
|
+
children: info.getValue() ?? "unknown"
|
|
67
|
+
}),
|
|
68
|
+
header: "Agent"
|
|
69
|
+
}),
|
|
70
|
+
columnHelper.accessor("modelLabel", {
|
|
71
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
72
|
+
className: "text-sm",
|
|
73
|
+
children: info.getValue() ?? "unknown"
|
|
74
|
+
}),
|
|
75
|
+
header: "Model"
|
|
76
|
+
}),
|
|
77
|
+
columnHelper.accessor("messageCount", {
|
|
78
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
79
|
+
className: "font-mono text-sm",
|
|
80
|
+
children: formatNumber(info.getValue())
|
|
81
|
+
}),
|
|
82
|
+
header: "Messages"
|
|
83
|
+
}),
|
|
84
|
+
columnHelper.accessor("totalTokens", {
|
|
85
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
86
|
+
className: "whitespace-nowrap font-mono text-sm",
|
|
87
|
+
children: formatTokens(info.getValue())
|
|
88
|
+
}),
|
|
89
|
+
header: "Tokens"
|
|
90
|
+
}),
|
|
91
|
+
columnHelper.accessor("cost", {
|
|
92
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
93
|
+
className: "font-mono text-sm",
|
|
94
|
+
children: formatCost(info.getValue())
|
|
95
|
+
}),
|
|
96
|
+
header: "Cost"
|
|
97
|
+
}),
|
|
98
|
+
columnHelper.display({
|
|
99
|
+
cell: (info) => /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
100
|
+
asChild: true,
|
|
101
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
102
|
+
"aria-label": `Actions for ${info.row.original.title}`,
|
|
103
|
+
className: "rounded-full",
|
|
104
|
+
size: "icon",
|
|
105
|
+
type: "button",
|
|
106
|
+
variant: "ghost",
|
|
107
|
+
onClick: (event) => event.stopPropagation(),
|
|
108
|
+
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "size-4" })
|
|
109
|
+
})
|
|
110
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
111
|
+
align: "end",
|
|
112
|
+
children: /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
113
|
+
disabled: info.row.original.renderablePartCount === 0,
|
|
114
|
+
onClick: () => onExportSession(info.row.original),
|
|
115
|
+
children: [/* @__PURE__ */ jsx(Download, { className: "mr-2 size-4" }), "Export session"]
|
|
116
|
+
})
|
|
117
|
+
})] }),
|
|
118
|
+
enableSorting: false,
|
|
119
|
+
header: "",
|
|
120
|
+
id: "actions"
|
|
121
|
+
})
|
|
122
|
+
];
|
|
123
|
+
var OpenCodeSessionsTable = ({ onExportSession, sessions }) => {
|
|
124
|
+
return /* @__PURE__ */ jsx(DataTable, {
|
|
125
|
+
columns: useMemo(() => columns(onExportSession), [onExportSession]),
|
|
126
|
+
data: sessions,
|
|
127
|
+
emptyMessage: "No OpenCode sessions match the current workspace filter.",
|
|
128
|
+
initialSorting: defaultSorting
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/routes/opencode.$workspaceKey.tsx?tsr-split=component
|
|
133
|
+
function OpenCodeWorkspacePage() {
|
|
134
|
+
const params = Route.useParams();
|
|
135
|
+
const workspaces = useSuspenseQuery(openCodeWorkspacesQueryOptions()).data;
|
|
136
|
+
const workspace = findWorkspaceOrThrow(workspaces, params.workspaceKey);
|
|
137
|
+
const sessions = useSuspenseQuery(openCodeSessionsQueryOptions(workspace.key)).data;
|
|
138
|
+
const [searchInput, setSearchInput] = useState("");
|
|
139
|
+
const [pendingExport, setPendingExport] = useState(null);
|
|
140
|
+
const deferredSearch = useDeferredValue(searchInput);
|
|
141
|
+
const exportMutation = useMutation({
|
|
142
|
+
mutationFn: async (options) => {
|
|
143
|
+
if (!pendingExport) throw new Error("No OpenCode session selected for export");
|
|
144
|
+
const download = await exportOpenCodeSessionFn({ data: {
|
|
145
|
+
includeCommentary: options.includeCommentary,
|
|
146
|
+
includeMetadata: options.includeMetadata,
|
|
147
|
+
includeTools: options.includeTools,
|
|
148
|
+
outputFormat: options.outputFormat,
|
|
149
|
+
sessionId: pendingExport.sessionId,
|
|
150
|
+
zipArchive: options.zipArchive
|
|
151
|
+
} });
|
|
152
|
+
if (download.mode === "download") {
|
|
153
|
+
downloadTextFile(download.fileName, download.content, download.mimeType);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
await downloadUrlFile(download.fileName, download.downloadUrl);
|
|
157
|
+
},
|
|
158
|
+
onSuccess: () => {
|
|
159
|
+
setPendingExport(null);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
const visibleSessions = sessions.filter((session) => matchesTextQuery(deferredSearch, [
|
|
163
|
+
session.title,
|
|
164
|
+
session.sessionId,
|
|
165
|
+
session.slug,
|
|
166
|
+
session.agent,
|
|
167
|
+
session.modelLabel,
|
|
168
|
+
session.directory
|
|
169
|
+
]));
|
|
170
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
171
|
+
className: "space-y-6",
|
|
172
|
+
children: [
|
|
173
|
+
/* @__PURE__ */ jsx(PageHeader, {
|
|
174
|
+
actions: /* @__PURE__ */ jsx(ListSearchInput, {
|
|
175
|
+
placeholder: "Search session title, id, model, or agent",
|
|
176
|
+
value: searchInput,
|
|
177
|
+
onValueChange: setSearchInput
|
|
178
|
+
}),
|
|
179
|
+
eyebrow: "OpenCode workspace",
|
|
180
|
+
subtitle: "Inspect local OpenCode sessions, transcript parts, tool calls, reasoning, token totals, and exportable conversation text.",
|
|
181
|
+
title: workspace.label
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ jsx(OpenCodeSessionsTable, {
|
|
184
|
+
sessions: visibleSessions,
|
|
185
|
+
onExportSession: setPendingExport
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ jsx(ExportDialog, {
|
|
188
|
+
open: pendingExport !== null,
|
|
189
|
+
pending: exportMutation.isPending,
|
|
190
|
+
title: pendingExport ? `Export ${pendingExport.title}` : "Export session",
|
|
191
|
+
onExport: (options) => exportMutation.mutate(options),
|
|
192
|
+
onOpenChange: (open) => {
|
|
193
|
+
if (!open) {
|
|
194
|
+
setPendingExport(null);
|
|
195
|
+
exportMutation.reset();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}),
|
|
199
|
+
exportMutation.isError ? /* @__PURE__ */ jsx("p", {
|
|
200
|
+
className: "text-[var(--destructive)] text-sm",
|
|
201
|
+
children: exportMutation.error instanceof Error ? exportMutation.error.message : "Session export failed"
|
|
202
|
+
}) : null
|
|
203
|
+
]
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
export { OpenCodeWorkspacePage as component };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as ReloadErrorPanel } from "./reload-error-panel-BJMxY3U1.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/routes/opencode.index.tsx?tsr-split=errorComponent
|
|
4
|
+
var OpenCodeErrorComponent = ({ error }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(ReloadErrorPanel, {
|
|
6
|
+
description: error.message,
|
|
7
|
+
title: "Failed to load OpenCode workspaces"
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { OpenCodeErrorComponent as errorComponent };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { r as openCodeWorkspacesQueryOptions } from "./opencode-queries-BeNYXnQv.js";
|
|
2
|
+
import { t as DataTable } from "./data-table-Cdct823O.js";
|
|
3
|
+
import { t as PageHeader } from "./page-header-VNSaM3xd.js";
|
|
4
|
+
import { o as formatNumber, r as formatDateTime } from "./formatters-FJaGZgJk.js";
|
|
5
|
+
import { n as ListSearchInput, t as matchesTextQuery } from "./text-filter-CGKxMCKt.js";
|
|
6
|
+
import { useDeferredValue, useState } from "react";
|
|
7
|
+
import { Link } from "@tanstack/react-router";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
10
|
+
import { createColumnHelper } from "@tanstack/react-table";
|
|
11
|
+
//#region src/components/opencode-workspaces-table.tsx
|
|
12
|
+
var columnHelper = createColumnHelper();
|
|
13
|
+
var columns = [
|
|
14
|
+
columnHelper.accessor("label", {
|
|
15
|
+
cell: (info) => /* @__PURE__ */ jsxs(Link, {
|
|
16
|
+
className: "block w-[16rem] max-w-[22rem] space-y-1 rounded-md outline-none transition hover:opacity-80 focus-visible:ring-2 focus-visible:ring-[var(--accent)] lg:w-auto",
|
|
17
|
+
params: { workspaceKey: info.row.original.key },
|
|
18
|
+
to: "/opencode/$workspaceKey",
|
|
19
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
20
|
+
className: "truncate font-medium underline-offset-2 hover:underline",
|
|
21
|
+
children: info.getValue()
|
|
22
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
23
|
+
className: "truncate text-[var(--muted-foreground)] text-xs",
|
|
24
|
+
children: info.row.original.worktree
|
|
25
|
+
})]
|
|
26
|
+
}),
|
|
27
|
+
header: "Workspace"
|
|
28
|
+
}),
|
|
29
|
+
columnHelper.accessor("sessionCount", {
|
|
30
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "font-mono text-sm",
|
|
32
|
+
children: formatNumber(info.getValue())
|
|
33
|
+
}),
|
|
34
|
+
header: "Sessions"
|
|
35
|
+
}),
|
|
36
|
+
columnHelper.accessor("messageCount", {
|
|
37
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: "font-mono text-sm",
|
|
39
|
+
children: formatNumber(info.getValue())
|
|
40
|
+
}),
|
|
41
|
+
header: "Messages"
|
|
42
|
+
}),
|
|
43
|
+
columnHelper.accessor("partCount", {
|
|
44
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
45
|
+
className: "font-mono text-sm",
|
|
46
|
+
children: formatNumber(info.getValue())
|
|
47
|
+
}),
|
|
48
|
+
header: "Parts"
|
|
49
|
+
}),
|
|
50
|
+
columnHelper.accessor("lastActiveMs", {
|
|
51
|
+
cell: (info) => /* @__PURE__ */ jsx("span", {
|
|
52
|
+
className: "whitespace-nowrap text-sm",
|
|
53
|
+
suppressHydrationWarning: true,
|
|
54
|
+
children: formatDateTime(info.getValue())
|
|
55
|
+
}),
|
|
56
|
+
header: "Last updated"
|
|
57
|
+
})
|
|
58
|
+
];
|
|
59
|
+
var OpenCodeWorkspacesTable = ({ workspaces }) => {
|
|
60
|
+
return /* @__PURE__ */ jsx(DataTable, {
|
|
61
|
+
columns,
|
|
62
|
+
data: workspaces,
|
|
63
|
+
emptyMessage: "No OpenCode workspaces match the current search."
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/routes/opencode.index.tsx?tsr-split=component
|
|
68
|
+
var OpenCodePage = () => {
|
|
69
|
+
const workspaces = useSuspenseQuery(openCodeWorkspacesQueryOptions()).data;
|
|
70
|
+
const [searchInput, setSearchInput] = useState("");
|
|
71
|
+
const deferredSearch = useDeferredValue(searchInput);
|
|
72
|
+
const visibleWorkspaces = workspaces.filter((workspace) => matchesTextQuery(deferredSearch, [
|
|
73
|
+
workspace.label,
|
|
74
|
+
workspace.worktree,
|
|
75
|
+
workspace.key,
|
|
76
|
+
workspace.projectId
|
|
77
|
+
]));
|
|
78
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: "space-y-6",
|
|
80
|
+
children: [/* @__PURE__ */ jsx(PageHeader, {
|
|
81
|
+
actions: /* @__PURE__ */ jsx(ListSearchInput, {
|
|
82
|
+
placeholder: "Search workspace name or path",
|
|
83
|
+
value: searchInput,
|
|
84
|
+
onValueChange: setSearchInput
|
|
85
|
+
}),
|
|
86
|
+
eyebrow: "Inventory",
|
|
87
|
+
subtitle: "Workspace groups are derived from the local OpenCode project, session, message, and part tables.",
|
|
88
|
+
title: "OpenCode"
|
|
89
|
+
}), /* @__PURE__ */ jsx(OpenCodeWorkspacesTable, { workspaces: visibleWorkspaces })]
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { OpenCodePage as component };
|
package/apps/ui/dist/server/assets/{projects._project-CqqUFr4l.js → projects._project-4io5LO0E.js}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { r as projectThreadsQueryOptions } from "./codex-queries-
|
|
1
|
+
import { r as projectThreadsQueryOptions } from "./codex-queries-CtgeZ7VL.js";
|
|
2
|
+
import { i as parseTextQuerySearch } from "./route-search-ts4W9MJ9.js";
|
|
2
3
|
import { t as LoadingPanel } from "./loading-panel-BGFnWseS.js";
|
|
3
4
|
import { createFileRoute, lazyRouteComponent } from "@tanstack/react-router";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/routes/projects.$project.tsx
|
|
6
7
|
var $$splitErrorComponentImporter = () => import("./projects._project-Bshqk7JA.js");
|
|
7
|
-
var $$splitComponentImporter = () => import("./projects._project-
|
|
8
|
+
var $$splitComponentImporter = () => import("./projects._project-D6ZoGhJ8.js");
|
|
8
9
|
var Route = createFileRoute("/projects/$project")({
|
|
9
10
|
component: lazyRouteComponent($$splitComponentImporter, "component"),
|
|
10
11
|
errorComponent: lazyRouteComponent($$splitErrorComponentImporter, "errorComponent"),
|
|
@@ -12,7 +13,8 @@ var Route = createFileRoute("/projects/$project")({
|
|
|
12
13
|
pendingComponent: () => /* @__PURE__ */ jsx(LoadingPanel, {
|
|
13
14
|
description: "Loading project threads and transcript summaries. Large projects can take a moment.",
|
|
14
15
|
title: "Loading project"
|
|
15
|
-
})
|
|
16
|
+
}),
|
|
17
|
+
validateSearch: parseTextQuerySearch
|
|
16
18
|
});
|
|
17
19
|
//#endregion
|
|
18
20
|
export { Route as t };
|