@namzu/cli 50.1.0 → 50.3.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/CHANGELOG.md +55 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-PFKCDYRZ.js → acp-2T35QG5N.js} +76 -87
- package/dist/chunks/acp-2T35QG5N.js.map +6 -0
- package/dist/chunks/{activity-command-VZNRTS4Y.js → activity-command-I3AIOI7D.js} +12 -12
- package/dist/chunks/{add-ILOY57M3.js → add-UGB46RWA.js} +19 -19
- package/dist/chunks/{agent-7XMB6YDL.js → agent-2667K2DP.js} +37 -35
- package/dist/chunks/agent-session-5KMMWJTY.js +69 -0
- package/dist/chunks/{archive-YUJITQ3K.js → archive-3AAGSJMI.js} +10 -10
- package/dist/chunks/{bin-main-QQCDUNOU.js → bin-main-N76J3LXV.js} +7 -7
- package/dist/chunks/{binding-QXY72MYE.js → binding-YGRSM4NK.js} +3 -3
- package/dist/chunks/{browser-T5M3N46O.js → browser-55KWOLRE.js} +6 -6
- package/dist/chunks/{chat-H6P7555R.js → chat-2JCXYCK4.js} +15 -15
- package/dist/chunks/{chunk-SFGTJCGU.js → chunk-2ADHYVB2.js} +2 -2
- package/dist/chunks/{chunk-UBB7EIHC.js → chunk-2T3C6WAE.js} +3 -3
- package/dist/chunks/{chunk-IZHREIZK.js → chunk-2VKT4OPG.js} +192 -85
- package/dist/chunks/chunk-2VKT4OPG.js.map +6 -0
- package/dist/chunks/{chunk-SSPDO3JT.js → chunk-2WSCH27F.js} +9 -9
- package/dist/chunks/{chunk-GKPO6EGA.js → chunk-35KJUUIZ.js} +2 -2
- package/dist/chunks/{chunk-HYWVPQQD.js → chunk-3L7O76A5.js} +4 -4
- package/dist/chunks/{chunk-FXAHVRUE.js → chunk-4XONZ3IH.js} +3 -3
- package/dist/chunks/{chunk-GN424XZ3.js → chunk-5ISSWZYV.js} +7 -7
- package/dist/chunks/{chunk-GL6KSVMS.js → chunk-7DCFWJDK.js} +9 -9
- package/dist/chunks/{chunk-SECKALTU.js → chunk-7JPWIMTU.js} +2 -2
- package/dist/chunks/{chunk-CFCULKSN.js → chunk-7OYYEJXX.js} +2 -2
- package/dist/chunks/{chunk-AKXUNA4X.js → chunk-AXB6T7KH.js} +6 -6
- package/dist/chunks/{chunk-MAMV7MUG.js → chunk-B72UXUIV.js} +9 -9
- package/dist/chunks/{chunk-HUKEVKWH.js → chunk-BFK5ZLTI.js} +3 -3
- package/dist/chunks/{chunk-FM2QPMPK.js → chunk-BKAGWRB7.js} +2 -2
- package/dist/chunks/{chunk-NXRUXNJ5.js → chunk-CI2P6MWQ.js} +2 -2
- package/dist/chunks/{chunk-JQUAYX3B.js → chunk-CKQSYJLF.js} +5 -5
- package/dist/chunks/{chunk-K4PPNYXR.js → chunk-DBPV2NYH.js} +2 -2
- package/dist/chunks/{chunk-IQPD7KYD.js → chunk-ENQ34C3Q.js} +3 -3
- package/dist/chunks/{chunk-SVB7IHBE.js → chunk-FPW3QSQD.js} +3 -3
- package/dist/chunks/{chunk-QNIHTTLG.js → chunk-G3R4GLH5.js} +3 -3
- package/dist/chunks/{chunk-T4BQXXZS.js → chunk-GMCZYW6K.js} +5 -5
- package/dist/chunks/{chunk-GWXAAFPJ.js → chunk-GNBTKM54.js} +2 -2
- package/dist/chunks/{chunk-JGYCZO6C.js → chunk-H734PAIA.js} +2 -2
- package/dist/chunks/{chunk-HYUVSO4X.js → chunk-HHZYPDYM.js} +4 -4
- package/dist/chunks/{chunk-PCW42R33.js → chunk-HM3XROXV.js} +5 -5
- package/dist/chunks/{chunk-2BMVENUB.js → chunk-HOBBN5HG.js} +2 -2
- package/dist/chunks/{chunk-CPWGSBBN.js → chunk-I7DZMDL4.js} +3 -3
- package/dist/chunks/{chunk-RZ6PDAMQ.js → chunk-IDHX5QU5.js} +2 -2
- package/dist/chunks/{chunk-MIJGXF3Z.js → chunk-IO6AH6S6.js} +2 -2
- package/dist/chunks/{chunk-4IP74K5V.js → chunk-IWBRKHR3.js} +2 -2
- package/dist/chunks/{chunk-URBIMXZN.js → chunk-JNPUGWLC.js} +6 -6
- package/dist/chunks/{chunk-EPDDCCV5.js → chunk-JXIZ23M4.js} +2 -2
- package/dist/chunks/{chunk-IXDECEIX.js → chunk-JZVNLDXW.js} +4 -4
- package/dist/chunks/{chunk-6X3NKVRL.js → chunk-K6CL6T23.js} +30 -4
- package/dist/chunks/{chunk-6X3NKVRL.js.map → chunk-K6CL6T23.js.map} +1 -1
- package/dist/chunks/{chunk-FIIZZRMV.js → chunk-KCRRCSBK.js} +3 -3
- package/dist/chunks/{chunk-XC6UYANY.js → chunk-KONJIEUP.js} +2 -2
- package/dist/chunks/{chunk-SB3GBZ65.js → chunk-KRGFQLGY.js} +3 -3
- package/dist/chunks/{chunk-WKW65PAC.js → chunk-KUPDSMDC.js} +2 -2
- package/dist/chunks/{chunk-Y22AUU3X.js → chunk-L37OHUPQ.js} +4 -4
- package/dist/chunks/{chunk-WTMP5H7T.js → chunk-LJFJLXD5.js} +4 -4
- package/dist/chunks/{chunk-RGUF5E22.js → chunk-LYTJJ2LG.js} +4 -4
- package/dist/chunks/{chunk-7VXBUWVA.js → chunk-M3BND4IS.js} +2 -2
- package/dist/chunks/{chunk-NVZRRJJS.js → chunk-MT2KWIQD.js} +2 -2
- package/dist/chunks/{chunk-SAJGEVVD.js → chunk-MVCDUAE3.js} +3 -3
- package/dist/chunks/{chunk-S4Q4PC2L.js → chunk-MZI3ULZR.js} +21 -5
- package/dist/chunks/{chunk-S4Q4PC2L.js.map → chunk-MZI3ULZR.js.map} +1 -1
- package/dist/chunks/{chunk-HDOYZYBW.js → chunk-P2CH7AHO.js} +3 -3
- package/dist/chunks/{chunk-XXHZE4KV.js → chunk-PMUGOF5V.js} +2 -2
- package/dist/chunks/{chunk-D7W5LUXV.js → chunk-PP5FDOXX.js} +3 -3
- package/dist/chunks/{chunk-UXXV6VCO.js → chunk-QAQBDQOO.js} +3 -3
- package/dist/chunks/{chunk-QPREGR6U.js → chunk-QFECRPMQ.js} +4 -4
- package/dist/chunks/{chunk-57EJUGDT.js → chunk-QHNAT275.js} +3 -3
- package/dist/chunks/{chunk-56WREK7X.js → chunk-QKRGJPU6.js} +2 -2
- package/dist/chunks/{chunk-UARXWUZO.js → chunk-QUADPKLH.js} +4 -4
- package/dist/chunks/{chunk-HNVUVSOI.js → chunk-RC3A3XQL.js} +2 -2
- package/dist/chunks/{chunk-2FQ6QJIZ.js → chunk-RSMLOV7S.js} +12 -12
- package/dist/chunks/{chunk-T2DRSTJV.js → chunk-RVWRZVRT.js} +2 -2
- package/dist/chunks/{chunk-FGEJOOL4.js → chunk-S5HIHXZO.js} +3 -3
- package/dist/chunks/{chunk-E6BNHEYX.js → chunk-SDK374XH.js} +2 -2
- package/dist/chunks/{chunk-KKEWKJVL.js → chunk-SWEP7MWK.js} +3 -3
- package/dist/chunks/{chunk-5WSDPQ3D.js → chunk-TCOZSNNY.js} +4 -4
- package/dist/chunks/{chunk-CR23VYUE.js → chunk-TKXFM6UF.js} +15 -14
- package/dist/chunks/{chunk-CR23VYUE.js.map → chunk-TKXFM6UF.js.map} +1 -1
- package/dist/chunks/{chunk-BIDU2JUB.js → chunk-TPYEIOFB.js} +2 -2
- package/dist/chunks/{chunk-Z3DTGVZS.js → chunk-UDA4YOUW.js} +127 -42
- package/dist/chunks/chunk-UDA4YOUW.js.map +6 -0
- package/dist/chunks/{chunk-45PI33XV.js → chunk-UGECQ2K7.js} +3 -3
- package/dist/chunks/{chunk-P2E6HFIP.js → chunk-ULRP7FUP.js} +2 -2
- package/dist/chunks/{chunk-G5OCRPZF.js → chunk-UU6Z4RNI.js} +2 -2
- package/dist/chunks/{chunk-ZJKISI2K.js → chunk-V6W5ILRM.js} +13 -5
- package/dist/chunks/chunk-V6W5ILRM.js.map +6 -0
- package/dist/chunks/{chunk-ITNMS75R.js → chunk-VXZ4I76G.js} +2 -2
- package/dist/chunks/{chunk-P7NXR4OV.js → chunk-VZD5OAVF.js} +4 -4
- package/dist/chunks/{chunk-ZE6HLPD4.js → chunk-W4BOQPYP.js} +944 -327
- package/dist/chunks/chunk-W4BOQPYP.js.map +6 -0
- package/dist/chunks/{chunk-VQ7FOO7M.js → chunk-WBDMD7WY.js} +2 -2
- package/dist/chunks/{chunk-424T6RL4.js → chunk-WBWDM4FM.js} +2 -2
- package/dist/chunks/{chunk-IXNUPR24.js → chunk-WHZO5JAN.js} +33 -33
- package/dist/chunks/{chunk-C2PBNQYT.js → chunk-YEDLKZJU.js} +10 -10
- package/dist/chunks/{chunk-RSAB3MPL.js → chunk-ZVAXTBZ4.js} +11 -11
- package/dist/chunks/{cli-runtime-JXRGA4O7.js → cli-runtime-WBHLU5Z2.js} +11 -11
- package/dist/chunks/{commands-3K6WWRUN.js → commands-Q5YVFT5H.js} +5 -5
- package/dist/chunks/{crash-report-NTEADY4P.js → crash-report-7B6INW5Z.js} +6 -6
- package/dist/chunks/{dist-Z2QVC4OK.js → dist-55O7DGZC.js} +2 -2
- package/dist/chunks/{dist-WDRMCFAU.js → dist-64A6FTG4.js} +10 -2
- package/dist/chunks/{dist-G2QITXMW.js → dist-CX6YZPQP.js} +2 -2
- package/dist/chunks/{dist-5ZAKSBZS.js → dist-DM56OGFI.js} +2 -2
- package/dist/chunks/{dist-43NXQHZ2.js → dist-JFEBD4RQ.js} +2 -2
- package/dist/chunks/{dist-EHAGNOTG.js → dist-JTKWJRF3.js} +2 -2
- package/dist/chunks/{dist-VEUKVTZP.js → dist-JXBZJMCJ.js} +2 -2
- package/dist/chunks/{dist-CRT6EQAR.js → dist-XF4ALE5R.js} +2 -2
- package/dist/chunks/{doctor-UVX6YR2I.js → doctor-J74VP3YF.js} +16 -16
- package/dist/chunks/{drain-URR6CUUH.js → drain-43YQMN3N.js} +9 -9
- package/dist/chunks/{entry-WCWSORA2.js → entry-EBSTYPZD.js} +6 -6
- package/dist/chunks/{eval-Y6FUUDCX.js → eval-6FWPUHTJ.js} +2 -2
- package/dist/chunks/{exec-5BUTAYMJ.js → exec-3OL72UXM.js} +34 -34
- package/dist/chunks/{home-HDE3CFLB.js → home-S7VBBT2P.js} +3 -3
- package/dist/chunks/{host-TZ6GSDWP.js → host-F6WQBUBZ.js} +10 -10
- package/dist/chunks/{host-queries-Y7A4XJ64.js → host-queries-PXLHY5OD.js} +15 -15
- package/dist/chunks/{learn-GYBZNIT3.js → learn-NNNC4PEC.js} +11 -11
- package/dist/chunks/{learn-builtin-EJXTHMX6.js → learn-builtin-BDKIORNW.js} +14 -14
- package/dist/chunks/{lifecycle-5EM2QRFV.js → lifecycle-6UXAIU2W.js} +28 -28
- package/dist/chunks/{list-M34JU5AG.js → list-RAVXA62R.js} +11 -11
- package/dist/chunks/{live-XMBIOII4.js → live-R457RDVD.js} +15 -15
- package/dist/chunks/{login-NI3DFWOW.js → login-XFL5R3F3.js} +13 -13
- package/dist/chunks/{logs-OI6GZRRC.js → logs-FHXX2ZYY.js} +4 -4
- package/dist/chunks/{mcp-FK3OBBSJ.js → mcp-GJYWIZDK.js} +24 -21
- package/dist/chunks/{mcp-FK3OBBSJ.js.map → mcp-GJYWIZDK.js.map} +1 -1
- package/dist/chunks/{message-command-CIYB47HZ.js → message-command-HLV22I75.js} +41 -41
- package/dist/chunks/{open-XYGGZHXM.js → open-52RISMYT.js} +8 -8
- package/dist/chunks/{operator-tools-QSZS57PI.js → operator-tools-KRVBU5DK.js} +13 -13
- package/dist/chunks/{output-schema-BTNJ6DL5.js → output-schema-TN574F4W.js} +3 -3
- package/dist/chunks/{pal-EQAAJBWP.js → pal-F6UND6OQ.js} +16 -16
- package/dist/chunks/{peers-35H6CZOZ.js → peers-TJCZBKJN.js} +7 -7
- package/dist/chunks/{peers-KN4BGJHU.js → peers-VBFD7USO.js} +6 -6
- package/dist/chunks/{providers-I2GONE3C.js → providers-WZ5ZDUB3.js} +11 -11
- package/dist/chunks/{pty-GZ4R2DCS.js → pty-KWFUBODN.js} +3 -3
- package/dist/chunks/resume-FVNBMR6D.js +23 -0
- package/dist/chunks/{resume-command-TOAGIGZO.js → resume-command-RVILL4QU.js} +4 -4
- package/dist/chunks/{schedule-FU5WY3WV.js → schedule-3QGQRJB7.js} +8 -8
- package/dist/chunks/{service-3UYEV4JX.js → service-MI36D5ZK.js} +28 -28
- package/dist/chunks/{skills-4V2SBEY3.js → skills-W5AH33BU.js} +8 -8
- package/dist/chunks/{start-check-RBYWVZT4.js → start-check-567HOC4A.js} +2 -2
- package/dist/chunks/{startup-failure-SST73T7Q.js → startup-failure-AXFS5D3F.js} +2 -2
- package/dist/chunks/{state-N46ZI3LZ.js → state-NYIQ2RRT.js} +2 -2
- package/dist/chunks/{store-RHAHG45U.js → store-BEOWOJIT.js} +4 -4
- package/dist/chunks/{store-R662Y2YQ.js → store-JUC4TU6P.js} +14 -10
- package/dist/chunks/{store-KA6NETSP.js → store-LNGCY3CJ.js} +3 -3
- package/dist/chunks/{store-M56FSIZT.js → store-LWOLZU4Z.js} +6 -6
- package/dist/chunks/{tui-TJNH67YO.js → tui-W7I4CLSF.js} +1006 -350
- package/dist/chunks/tui-W7I4CLSF.js.map +6 -0
- package/dist/chunks/{upgrade-YNYPRYFI.js → upgrade-APJTDSEG.js} +7 -7
- package/dist/chunks/{workspaces-OITS2AZJ.js → workspaces-F6RNJXKR.js} +16 -16
- package/dist/chunks/{worktree-DJW4XCBG.js → worktree-LE5FPYCK.js} +12 -12
- package/dist/commands/acp-harness.d.ts.map +1 -1
- package/dist/commands/acp-provider-retry.d.ts.map +1 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/desktop-host.d.ts.map +1 -1
- package/dist/commands/desktop-model-catalogue.d.ts +4 -0
- package/dist/commands/desktop-model-catalogue.d.ts.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/schema.d.ts +10 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/settings-descriptors.d.ts.map +1 -1
- package/dist/index.js +19 -19
- package/dist/integrations/mcp/servers.d.ts +25 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/sessions/conversation-facts.d.ts +76 -0
- package/dist/integrations/sessions/conversation-facts.d.ts.map +1 -0
- package/dist/integrations/sessions/store.d.ts +22 -18
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/rounds/types.d.ts +1 -1
- package/dist/rounds/types.d.ts.map +1 -1
- package/dist/schedule/daemon/sessions.d.ts +3 -3
- package/dist/schedule/daemon/sessions.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +7 -1
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/ReadSearchGroup.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts +1 -1
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +7 -1
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/attachment-rows.d.ts +39 -0
- package/dist/tui/attachment-rows.d.ts.map +1 -0
- package/dist/tui/composer-undo.d.ts +3 -0
- package/dist/tui/composer-undo.d.ts.map +1 -1
- package/dist/tui/diff-view.d.ts +1 -0
- package/dist/tui/diff-view.d.ts.map +1 -1
- package/dist/tui/fullscreen/FullscreenTranscript.d.ts +3 -1
- package/dist/tui/fullscreen/FullscreenTranscript.d.ts.map +1 -1
- package/dist/tui/fullscreen/layout.d.ts +23 -4
- package/dist/tui/fullscreen/layout.d.ts.map +1 -1
- package/dist/tui/fullscreen/rows.d.ts +2 -0
- package/dist/tui/fullscreen/rows.d.ts.map +1 -1
- package/dist/tui/fullscreen/viewport.d.ts +27 -0
- package/dist/tui/fullscreen/viewport.d.ts.map +1 -1
- package/dist/tui/group-rows.d.ts +10 -0
- package/dist/tui/group-rows.d.ts.map +1 -1
- package/dist/tui/live-window.d.ts.map +1 -1
- package/dist/tui/outcome-line.d.ts +27 -0
- package/dist/tui/outcome-line.d.ts.map +1 -1
- package/dist/tui/paste-chips.d.ts +55 -6
- package/dist/tui/paste-chips.d.ts.map +1 -1
- package/dist/tui/read-search-group.d.ts +34 -1
- package/dist/tui/read-search-group.d.ts.map +1 -1
- package/dist/tui/restored-rows.d.ts +16 -1
- package/dist/tui/restored-rows.d.ts.map +1 -1
- package/dist/tui/shell-cell.d.ts +4 -0
- package/dist/tui/shell-cell.d.ts.map +1 -1
- package/dist/tui/terminal-hyperlinks.d.ts +8 -0
- package/dist/tui/terminal-hyperlinks.d.ts.map +1 -1
- package/dist/tui/tidy-tool-output.d.ts.map +1 -1
- package/dist/tui/tool-end-rows.d.ts.map +1 -1
- package/dist/tui/transcript-scroll.d.ts +12 -2
- package/dist/tui/transcript-scroll.d.ts.map +1 -1
- package/dist/tui/truncation.d.ts +9 -0
- package/dist/tui/truncation.d.ts.map +1 -1
- package/dist/tui/types.d.ts +3 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/useReadSearchGroup.d.ts +13 -6
- package/dist/tui/useReadSearchGroup.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/chunks/acp-PFKCDYRZ.js.map +0 -6
- package/dist/chunks/agent-session-EJPBND2I.js +0 -69
- package/dist/chunks/chunk-IZHREIZK.js.map +0 -6
- package/dist/chunks/chunk-Z3DTGVZS.js.map +0 -6
- package/dist/chunks/chunk-ZE6HLPD4.js.map +0 -6
- package/dist/chunks/chunk-ZJKISI2K.js.map +0 -6
- package/dist/chunks/resume-4KW4GUYR.js +0 -23
- package/dist/chunks/tui-TJNH67YO.js.map +0 -6
- /package/dist/chunks/{activity-command-VZNRTS4Y.js.map → activity-command-I3AIOI7D.js.map} +0 -0
- /package/dist/chunks/{add-ILOY57M3.js.map → add-UGB46RWA.js.map} +0 -0
- /package/dist/chunks/{agent-7XMB6YDL.js.map → agent-2667K2DP.js.map} +0 -0
- /package/dist/chunks/{agent-session-EJPBND2I.js.map → agent-session-5KMMWJTY.js.map} +0 -0
- /package/dist/chunks/{archive-YUJITQ3K.js.map → archive-3AAGSJMI.js.map} +0 -0
- /package/dist/chunks/{bin-main-QQCDUNOU.js.map → bin-main-N76J3LXV.js.map} +0 -0
- /package/dist/chunks/{binding-QXY72MYE.js.map → binding-YGRSM4NK.js.map} +0 -0
- /package/dist/chunks/{browser-T5M3N46O.js.map → browser-55KWOLRE.js.map} +0 -0
- /package/dist/chunks/{chat-H6P7555R.js.map → chat-2JCXYCK4.js.map} +0 -0
- /package/dist/chunks/{chunk-SFGTJCGU.js.map → chunk-2ADHYVB2.js.map} +0 -0
- /package/dist/chunks/{chunk-UBB7EIHC.js.map → chunk-2T3C6WAE.js.map} +0 -0
- /package/dist/chunks/{chunk-SSPDO3JT.js.map → chunk-2WSCH27F.js.map} +0 -0
- /package/dist/chunks/{chunk-GKPO6EGA.js.map → chunk-35KJUUIZ.js.map} +0 -0
- /package/dist/chunks/{chunk-HYWVPQQD.js.map → chunk-3L7O76A5.js.map} +0 -0
- /package/dist/chunks/{chunk-FXAHVRUE.js.map → chunk-4XONZ3IH.js.map} +0 -0
- /package/dist/chunks/{chunk-GN424XZ3.js.map → chunk-5ISSWZYV.js.map} +0 -0
- /package/dist/chunks/{chunk-GL6KSVMS.js.map → chunk-7DCFWJDK.js.map} +0 -0
- /package/dist/chunks/{chunk-SECKALTU.js.map → chunk-7JPWIMTU.js.map} +0 -0
- /package/dist/chunks/{chunk-CFCULKSN.js.map → chunk-7OYYEJXX.js.map} +0 -0
- /package/dist/chunks/{chunk-AKXUNA4X.js.map → chunk-AXB6T7KH.js.map} +0 -0
- /package/dist/chunks/{chunk-MAMV7MUG.js.map → chunk-B72UXUIV.js.map} +0 -0
- /package/dist/chunks/{chunk-HUKEVKWH.js.map → chunk-BFK5ZLTI.js.map} +0 -0
- /package/dist/chunks/{chunk-FM2QPMPK.js.map → chunk-BKAGWRB7.js.map} +0 -0
- /package/dist/chunks/{chunk-NXRUXNJ5.js.map → chunk-CI2P6MWQ.js.map} +0 -0
- /package/dist/chunks/{chunk-JQUAYX3B.js.map → chunk-CKQSYJLF.js.map} +0 -0
- /package/dist/chunks/{chunk-K4PPNYXR.js.map → chunk-DBPV2NYH.js.map} +0 -0
- /package/dist/chunks/{chunk-IQPD7KYD.js.map → chunk-ENQ34C3Q.js.map} +0 -0
- /package/dist/chunks/{chunk-SVB7IHBE.js.map → chunk-FPW3QSQD.js.map} +0 -0
- /package/dist/chunks/{chunk-QNIHTTLG.js.map → chunk-G3R4GLH5.js.map} +0 -0
- /package/dist/chunks/{chunk-T4BQXXZS.js.map → chunk-GMCZYW6K.js.map} +0 -0
- /package/dist/chunks/{chunk-GWXAAFPJ.js.map → chunk-GNBTKM54.js.map} +0 -0
- /package/dist/chunks/{chunk-JGYCZO6C.js.map → chunk-H734PAIA.js.map} +0 -0
- /package/dist/chunks/{chunk-HYUVSO4X.js.map → chunk-HHZYPDYM.js.map} +0 -0
- /package/dist/chunks/{chunk-PCW42R33.js.map → chunk-HM3XROXV.js.map} +0 -0
- /package/dist/chunks/{chunk-2BMVENUB.js.map → chunk-HOBBN5HG.js.map} +0 -0
- /package/dist/chunks/{chunk-CPWGSBBN.js.map → chunk-I7DZMDL4.js.map} +0 -0
- /package/dist/chunks/{chunk-RZ6PDAMQ.js.map → chunk-IDHX5QU5.js.map} +0 -0
- /package/dist/chunks/{chunk-MIJGXF3Z.js.map → chunk-IO6AH6S6.js.map} +0 -0
- /package/dist/chunks/{chunk-4IP74K5V.js.map → chunk-IWBRKHR3.js.map} +0 -0
- /package/dist/chunks/{chunk-URBIMXZN.js.map → chunk-JNPUGWLC.js.map} +0 -0
- /package/dist/chunks/{chunk-EPDDCCV5.js.map → chunk-JXIZ23M4.js.map} +0 -0
- /package/dist/chunks/{chunk-IXDECEIX.js.map → chunk-JZVNLDXW.js.map} +0 -0
- /package/dist/chunks/{chunk-FIIZZRMV.js.map → chunk-KCRRCSBK.js.map} +0 -0
- /package/dist/chunks/{chunk-XC6UYANY.js.map → chunk-KONJIEUP.js.map} +0 -0
- /package/dist/chunks/{chunk-SB3GBZ65.js.map → chunk-KRGFQLGY.js.map} +0 -0
- /package/dist/chunks/{chunk-WKW65PAC.js.map → chunk-KUPDSMDC.js.map} +0 -0
- /package/dist/chunks/{chunk-Y22AUU3X.js.map → chunk-L37OHUPQ.js.map} +0 -0
- /package/dist/chunks/{chunk-WTMP5H7T.js.map → chunk-LJFJLXD5.js.map} +0 -0
- /package/dist/chunks/{chunk-RGUF5E22.js.map → chunk-LYTJJ2LG.js.map} +0 -0
- /package/dist/chunks/{chunk-7VXBUWVA.js.map → chunk-M3BND4IS.js.map} +0 -0
- /package/dist/chunks/{chunk-NVZRRJJS.js.map → chunk-MT2KWIQD.js.map} +0 -0
- /package/dist/chunks/{chunk-SAJGEVVD.js.map → chunk-MVCDUAE3.js.map} +0 -0
- /package/dist/chunks/{chunk-HDOYZYBW.js.map → chunk-P2CH7AHO.js.map} +0 -0
- /package/dist/chunks/{chunk-XXHZE4KV.js.map → chunk-PMUGOF5V.js.map} +0 -0
- /package/dist/chunks/{chunk-D7W5LUXV.js.map → chunk-PP5FDOXX.js.map} +0 -0
- /package/dist/chunks/{chunk-UXXV6VCO.js.map → chunk-QAQBDQOO.js.map} +0 -0
- /package/dist/chunks/{chunk-QPREGR6U.js.map → chunk-QFECRPMQ.js.map} +0 -0
- /package/dist/chunks/{chunk-57EJUGDT.js.map → chunk-QHNAT275.js.map} +0 -0
- /package/dist/chunks/{chunk-56WREK7X.js.map → chunk-QKRGJPU6.js.map} +0 -0
- /package/dist/chunks/{chunk-UARXWUZO.js.map → chunk-QUADPKLH.js.map} +0 -0
- /package/dist/chunks/{chunk-HNVUVSOI.js.map → chunk-RC3A3XQL.js.map} +0 -0
- /package/dist/chunks/{chunk-2FQ6QJIZ.js.map → chunk-RSMLOV7S.js.map} +0 -0
- /package/dist/chunks/{chunk-T2DRSTJV.js.map → chunk-RVWRZVRT.js.map} +0 -0
- /package/dist/chunks/{chunk-FGEJOOL4.js.map → chunk-S5HIHXZO.js.map} +0 -0
- /package/dist/chunks/{chunk-E6BNHEYX.js.map → chunk-SDK374XH.js.map} +0 -0
- /package/dist/chunks/{chunk-KKEWKJVL.js.map → chunk-SWEP7MWK.js.map} +0 -0
- /package/dist/chunks/{chunk-5WSDPQ3D.js.map → chunk-TCOZSNNY.js.map} +0 -0
- /package/dist/chunks/{chunk-BIDU2JUB.js.map → chunk-TPYEIOFB.js.map} +0 -0
- /package/dist/chunks/{chunk-45PI33XV.js.map → chunk-UGECQ2K7.js.map} +0 -0
- /package/dist/chunks/{chunk-P2E6HFIP.js.map → chunk-ULRP7FUP.js.map} +0 -0
- /package/dist/chunks/{chunk-G5OCRPZF.js.map → chunk-UU6Z4RNI.js.map} +0 -0
- /package/dist/chunks/{chunk-ITNMS75R.js.map → chunk-VXZ4I76G.js.map} +0 -0
- /package/dist/chunks/{chunk-P7NXR4OV.js.map → chunk-VZD5OAVF.js.map} +0 -0
- /package/dist/chunks/{chunk-VQ7FOO7M.js.map → chunk-WBDMD7WY.js.map} +0 -0
- /package/dist/chunks/{chunk-424T6RL4.js.map → chunk-WBWDM4FM.js.map} +0 -0
- /package/dist/chunks/{chunk-IXNUPR24.js.map → chunk-WHZO5JAN.js.map} +0 -0
- /package/dist/chunks/{chunk-C2PBNQYT.js.map → chunk-YEDLKZJU.js.map} +0 -0
- /package/dist/chunks/{chunk-RSAB3MPL.js.map → chunk-ZVAXTBZ4.js.map} +0 -0
- /package/dist/chunks/{cli-runtime-JXRGA4O7.js.map → cli-runtime-WBHLU5Z2.js.map} +0 -0
- /package/dist/chunks/{commands-3K6WWRUN.js.map → commands-Q5YVFT5H.js.map} +0 -0
- /package/dist/chunks/{crash-report-NTEADY4P.js.map → crash-report-7B6INW5Z.js.map} +0 -0
- /package/dist/chunks/{dist-Z2QVC4OK.js.map → dist-55O7DGZC.js.map} +0 -0
- /package/dist/chunks/{dist-WDRMCFAU.js.map → dist-64A6FTG4.js.map} +0 -0
- /package/dist/chunks/{dist-G2QITXMW.js.map → dist-CX6YZPQP.js.map} +0 -0
- /package/dist/chunks/{dist-5ZAKSBZS.js.map → dist-DM56OGFI.js.map} +0 -0
- /package/dist/chunks/{dist-43NXQHZ2.js.map → dist-JFEBD4RQ.js.map} +0 -0
- /package/dist/chunks/{dist-EHAGNOTG.js.map → dist-JTKWJRF3.js.map} +0 -0
- /package/dist/chunks/{dist-VEUKVTZP.js.map → dist-JXBZJMCJ.js.map} +0 -0
- /package/dist/chunks/{dist-CRT6EQAR.js.map → dist-XF4ALE5R.js.map} +0 -0
- /package/dist/chunks/{doctor-UVX6YR2I.js.map → doctor-J74VP3YF.js.map} +0 -0
- /package/dist/chunks/{drain-URR6CUUH.js.map → drain-43YQMN3N.js.map} +0 -0
- /package/dist/chunks/{entry-WCWSORA2.js.map → entry-EBSTYPZD.js.map} +0 -0
- /package/dist/chunks/{eval-Y6FUUDCX.js.map → eval-6FWPUHTJ.js.map} +0 -0
- /package/dist/chunks/{exec-5BUTAYMJ.js.map → exec-3OL72UXM.js.map} +0 -0
- /package/dist/chunks/{home-HDE3CFLB.js.map → home-S7VBBT2P.js.map} +0 -0
- /package/dist/chunks/{host-TZ6GSDWP.js.map → host-F6WQBUBZ.js.map} +0 -0
- /package/dist/chunks/{host-queries-Y7A4XJ64.js.map → host-queries-PXLHY5OD.js.map} +0 -0
- /package/dist/chunks/{learn-GYBZNIT3.js.map → learn-NNNC4PEC.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-EJXTHMX6.js.map → learn-builtin-BDKIORNW.js.map} +0 -0
- /package/dist/chunks/{lifecycle-5EM2QRFV.js.map → lifecycle-6UXAIU2W.js.map} +0 -0
- /package/dist/chunks/{list-M34JU5AG.js.map → list-RAVXA62R.js.map} +0 -0
- /package/dist/chunks/{live-XMBIOII4.js.map → live-R457RDVD.js.map} +0 -0
- /package/dist/chunks/{login-NI3DFWOW.js.map → login-XFL5R3F3.js.map} +0 -0
- /package/dist/chunks/{logs-OI6GZRRC.js.map → logs-FHXX2ZYY.js.map} +0 -0
- /package/dist/chunks/{message-command-CIYB47HZ.js.map → message-command-HLV22I75.js.map} +0 -0
- /package/dist/chunks/{open-XYGGZHXM.js.map → open-52RISMYT.js.map} +0 -0
- /package/dist/chunks/{operator-tools-QSZS57PI.js.map → operator-tools-KRVBU5DK.js.map} +0 -0
- /package/dist/chunks/{output-schema-BTNJ6DL5.js.map → output-schema-TN574F4W.js.map} +0 -0
- /package/dist/chunks/{pal-EQAAJBWP.js.map → pal-F6UND6OQ.js.map} +0 -0
- /package/dist/chunks/{peers-35H6CZOZ.js.map → peers-TJCZBKJN.js.map} +0 -0
- /package/dist/chunks/{peers-KN4BGJHU.js.map → peers-VBFD7USO.js.map} +0 -0
- /package/dist/chunks/{providers-I2GONE3C.js.map → providers-WZ5ZDUB3.js.map} +0 -0
- /package/dist/chunks/{pty-GZ4R2DCS.js.map → pty-KWFUBODN.js.map} +0 -0
- /package/dist/chunks/{resume-4KW4GUYR.js.map → resume-FVNBMR6D.js.map} +0 -0
- /package/dist/chunks/{resume-command-TOAGIGZO.js.map → resume-command-RVILL4QU.js.map} +0 -0
- /package/dist/chunks/{schedule-FU5WY3WV.js.map → schedule-3QGQRJB7.js.map} +0 -0
- /package/dist/chunks/{service-3UYEV4JX.js.map → service-MI36D5ZK.js.map} +0 -0
- /package/dist/chunks/{skills-4V2SBEY3.js.map → skills-W5AH33BU.js.map} +0 -0
- /package/dist/chunks/{start-check-RBYWVZT4.js.map → start-check-567HOC4A.js.map} +0 -0
- /package/dist/chunks/{startup-failure-SST73T7Q.js.map → startup-failure-AXFS5D3F.js.map} +0 -0
- /package/dist/chunks/{state-N46ZI3LZ.js.map → state-NYIQ2RRT.js.map} +0 -0
- /package/dist/chunks/{store-KA6NETSP.js.map → store-BEOWOJIT.js.map} +0 -0
- /package/dist/chunks/{store-M56FSIZT.js.map → store-JUC4TU6P.js.map} +0 -0
- /package/dist/chunks/{store-R662Y2YQ.js.map → store-LNGCY3CJ.js.map} +0 -0
- /package/dist/chunks/{store-RHAHG45U.js.map → store-LWOLZU4Z.js.map} +0 -0
- /package/dist/chunks/{upgrade-YNYPRYFI.js.map → upgrade-APJTDSEG.js.map} +0 -0
- /package/dist/chunks/{workspaces-OITS2AZJ.js.map → workspaces-F6RNJXKR.js.map} +0 -0
- /package/dist/chunks/{worktree-DJW4XCBG.js.map → worktree-LE5FPYCK.js.map} +0 -0
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
confirmationView,
|
|
12
12
|
describeChanges,
|
|
13
13
|
permissionsChanged
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DBPV2NYH.js";
|
|
15
15
|
import {
|
|
16
16
|
visibleScheduleMessage
|
|
17
17
|
} from "./chunk-NADQQMMG.js";
|
|
18
18
|
import {
|
|
19
19
|
selectDesktopBackend
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-35KJUUIZ.js";
|
|
21
21
|
import {
|
|
22
22
|
TURN_LIMIT_FIELDS,
|
|
23
23
|
ThemeEpochContext,
|
|
@@ -54,10 +54,10 @@ import {
|
|
|
54
54
|
turnLimitCommands,
|
|
55
55
|
useThemeEpoch,
|
|
56
56
|
useThemeSubscription
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-ZVAXTBZ4.js";
|
|
58
58
|
import {
|
|
59
59
|
handleTerminationSignals
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-BKAGWRB7.js";
|
|
61
61
|
import "./chunk-R66H2G5R.js";
|
|
62
62
|
import {
|
|
63
63
|
describeAllCredentialsLogout,
|
|
@@ -69,16 +69,16 @@ import {
|
|
|
69
69
|
} from "./chunk-MDK4RMBQ.js";
|
|
70
70
|
import {
|
|
71
71
|
applyProviderFlags
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-ENQ34C3Q.js";
|
|
73
73
|
import {
|
|
74
74
|
reportCrash
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-7JPWIMTU.js";
|
|
76
76
|
import {
|
|
77
77
|
BYPASS_CONSENT_BODY,
|
|
78
78
|
BYPASS_CONSENT_TITLE,
|
|
79
79
|
acknowledgeBypass,
|
|
80
80
|
hasAcknowledgedBypass
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-HOBBN5HG.js";
|
|
82
82
|
import {
|
|
83
83
|
applyFallbackFlag,
|
|
84
84
|
capChoiceLines,
|
|
@@ -92,13 +92,13 @@ import {
|
|
|
92
92
|
} from "./chunk-7HYNH2U5.js";
|
|
93
93
|
import {
|
|
94
94
|
settleAnsweredPark
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-5ISSWZYV.js";
|
|
96
96
|
import "./chunk-GWQEMJFS.js";
|
|
97
97
|
import {
|
|
98
98
|
DELIVERY_READ_LIMIT,
|
|
99
99
|
readSourceDeliveryPage,
|
|
100
100
|
takeSuppressedCount
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-TKXFM6UF.js";
|
|
102
102
|
import {
|
|
103
103
|
DEFAULT_MAX_ITERATIONS,
|
|
104
104
|
DEFAULT_TIMEOUT_MS,
|
|
@@ -111,29 +111,29 @@ import {
|
|
|
111
111
|
runsPerDay,
|
|
112
112
|
scriptShellUnavailableReason,
|
|
113
113
|
verifyScheduledScript
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-LJFJLXD5.js";
|
|
115
115
|
import {
|
|
116
116
|
callsCount
|
|
117
117
|
} from "./chunk-HFY2647W.js";
|
|
118
|
-
import "./chunk-
|
|
118
|
+
import "./chunk-TPYEIOFB.js";
|
|
119
119
|
import {
|
|
120
120
|
allowsCommands,
|
|
121
121
|
compileJobPolicy,
|
|
122
122
|
compileScriptCheckPolicy,
|
|
123
123
|
isPresetName
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-3L7O76A5.js";
|
|
125
125
|
import "./chunk-XEUQN4JC.js";
|
|
126
126
|
import {
|
|
127
127
|
formatResumeShellCommand,
|
|
128
128
|
parkedRunWords,
|
|
129
129
|
resumeCommand
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-IWBRKHR3.js";
|
|
131
131
|
import {
|
|
132
132
|
appendHistory,
|
|
133
133
|
nextFireOf,
|
|
134
134
|
readHistory,
|
|
135
135
|
readState
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-M3BND4IS.js";
|
|
137
137
|
import {
|
|
138
138
|
callEndpoint,
|
|
139
139
|
readEndpoint
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
snapRange,
|
|
157
157
|
wordAt,
|
|
158
158
|
workspacesSignal
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-2ADHYVB2.js";
|
|
160
160
|
import {
|
|
161
161
|
motionAllowed,
|
|
162
162
|
reducedMotion,
|
|
@@ -175,28 +175,29 @@ import {
|
|
|
175
175
|
openLivePeers,
|
|
176
176
|
peerMailLabel,
|
|
177
177
|
peerMailMessage
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-KRGFQLGY.js";
|
|
179
179
|
import {
|
|
180
180
|
AUTO_CHOICE_ID,
|
|
181
|
+
NOTHING_TOLD,
|
|
181
182
|
PR_NONE,
|
|
182
183
|
PrPoller,
|
|
183
184
|
conversationMarkdown,
|
|
184
185
|
hasBothGroups,
|
|
185
186
|
isAutoChoice,
|
|
186
187
|
modelStep,
|
|
187
|
-
|
|
188
|
+
outcomeNotice,
|
|
188
189
|
rawDetail,
|
|
189
190
|
rowSection,
|
|
190
191
|
sectionHeading,
|
|
191
192
|
withAutoChoice,
|
|
192
193
|
writeConversationExport
|
|
193
|
-
} from "./chunk-
|
|
194
|
+
} from "./chunk-MZI3ULZR.js";
|
|
194
195
|
import {
|
|
195
196
|
tuiPalDefinition,
|
|
196
197
|
tuiPalEnvironment,
|
|
197
198
|
tuiPalOwner,
|
|
198
199
|
tuiPalPreferences
|
|
199
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-GMCZYW6K.js";
|
|
200
201
|
import {
|
|
201
202
|
isModelOnlyContext,
|
|
202
203
|
runtimeContextLabel
|
|
@@ -204,15 +205,18 @@ import {
|
|
|
204
205
|
import {
|
|
205
206
|
deleteUserConfigValue,
|
|
206
207
|
setUserConfigValue
|
|
207
|
-
} from "./chunk-
|
|
208
|
-
import "./chunk-
|
|
209
|
-
import "./chunk-
|
|
210
|
-
import "./chunk-
|
|
208
|
+
} from "./chunk-SWEP7MWK.js";
|
|
209
|
+
import "./chunk-S5HIHXZO.js";
|
|
210
|
+
import "./chunk-YEDLKZJU.js";
|
|
211
|
+
import "./chunk-JNPUGWLC.js";
|
|
211
212
|
import {
|
|
212
213
|
claimPalConversation,
|
|
213
214
|
listPalConversations
|
|
214
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-HHZYPDYM.js";
|
|
215
216
|
import {
|
|
217
|
+
CLICK_EXPAND_HINT,
|
|
218
|
+
CLICK_FOLD_HINT,
|
|
219
|
+
COMMAND_ROW_INDENT,
|
|
216
220
|
COMPACTED_HINT,
|
|
217
221
|
COMPACTING_LABEL,
|
|
218
222
|
COMPACT_NOT_SAVED_TEXT,
|
|
@@ -246,6 +250,7 @@ import {
|
|
|
246
250
|
assistantTranscriptTexts,
|
|
247
251
|
builtinToolPresenter,
|
|
248
252
|
clipText,
|
|
253
|
+
commandRows,
|
|
249
254
|
compactResultLine,
|
|
250
255
|
compactionSummaryLines,
|
|
251
256
|
connectorToolLabel,
|
|
@@ -273,6 +278,7 @@ import {
|
|
|
273
278
|
hiddenLinesHint,
|
|
274
279
|
hintRows,
|
|
275
280
|
historyHoldsAnyMemory,
|
|
281
|
+
isOneCommand,
|
|
276
282
|
isSessionPlanPath,
|
|
277
283
|
listMatches,
|
|
278
284
|
matchMemories,
|
|
@@ -314,12 +320,12 @@ import {
|
|
|
314
320
|
webLiveStatus,
|
|
315
321
|
webSettledLine,
|
|
316
322
|
withDebugDetail
|
|
317
|
-
} from "./chunk-
|
|
323
|
+
} from "./chunk-UDA4YOUW.js";
|
|
318
324
|
import {
|
|
319
325
|
openManagedWorktrees,
|
|
320
326
|
worktreeOpenHint
|
|
321
|
-
} from "./chunk-
|
|
322
|
-
import "./chunk-
|
|
327
|
+
} from "./chunk-VZD5OAVF.js";
|
|
328
|
+
import "./chunk-G3R4GLH5.js";
|
|
323
329
|
import {
|
|
324
330
|
SAVE_SKILL_TOOL_NAME,
|
|
325
331
|
SKILL_CREATOR_SKILL,
|
|
@@ -343,25 +349,25 @@ import {
|
|
|
343
349
|
runTokens,
|
|
344
350
|
sandboxRunsShellUnasked,
|
|
345
351
|
settledElapsed
|
|
346
|
-
} from "./chunk-
|
|
347
|
-
import "./chunk-
|
|
348
|
-
import "./chunk-
|
|
352
|
+
} from "./chunk-P2CH7AHO.js";
|
|
353
|
+
import "./chunk-FPW3QSQD.js";
|
|
354
|
+
import "./chunk-QUADPKLH.js";
|
|
349
355
|
import {
|
|
350
356
|
MCP_OUTPUT_CHARS,
|
|
351
357
|
boundedMcpText,
|
|
352
358
|
validatePromptArguments
|
|
353
|
-
} from "./chunk-
|
|
359
|
+
} from "./chunk-K6CL6T23.js";
|
|
354
360
|
import {
|
|
355
361
|
openInBrowser
|
|
356
|
-
} from "./chunk-
|
|
362
|
+
} from "./chunk-H734PAIA.js";
|
|
357
363
|
import {
|
|
358
364
|
describePlainInterruption,
|
|
359
365
|
describeProviderWait,
|
|
360
366
|
describeProviderWaitClock,
|
|
361
367
|
isSelfMending,
|
|
362
368
|
isSpentAllowance
|
|
363
|
-
} from "./chunk-
|
|
364
|
-
import "./chunk-
|
|
369
|
+
} from "./chunk-UGECQ2K7.js";
|
|
370
|
+
import "./chunk-TCOZSNNY.js";
|
|
365
371
|
import {
|
|
366
372
|
describeBrowserStatus
|
|
367
373
|
} from "./chunk-WHODOMXA.js";
|
|
@@ -373,7 +379,7 @@ import {
|
|
|
373
379
|
handoffContinuationNote,
|
|
374
380
|
refusalDetail,
|
|
375
381
|
retryAfterMs
|
|
376
|
-
} from "./chunk-
|
|
382
|
+
} from "./chunk-SDK374XH.js";
|
|
377
383
|
import {
|
|
378
384
|
MAY_BE_LIMITED_WINDOW_MS,
|
|
379
385
|
accountProductName,
|
|
@@ -393,7 +399,7 @@ import {
|
|
|
393
399
|
permissionModeDescription,
|
|
394
400
|
permissionModeLabel,
|
|
395
401
|
permissionModeName
|
|
396
|
-
} from "./chunk-
|
|
402
|
+
} from "./chunk-WBWDM4FM.js";
|
|
397
403
|
import {
|
|
398
404
|
expandTabs,
|
|
399
405
|
terminalDisplayText
|
|
@@ -405,25 +411,25 @@ import {
|
|
|
405
411
|
loadSkillBody,
|
|
406
412
|
renderSkillRoster,
|
|
407
413
|
skillTierLabel
|
|
408
|
-
} from "./chunk-
|
|
414
|
+
} from "./chunk-QHNAT275.js";
|
|
409
415
|
import "./chunk-ZWA2JRJV.js";
|
|
410
416
|
import "./chunk-NUGPLXVK.js";
|
|
411
417
|
import {
|
|
412
418
|
beginSubscriptionLogin,
|
|
413
419
|
parsePastedInput
|
|
414
|
-
} from "./chunk-
|
|
420
|
+
} from "./chunk-CKQSYJLF.js";
|
|
415
421
|
import {
|
|
416
422
|
apiKeyLogoutWord,
|
|
417
423
|
isApiKeyLogoutTarget
|
|
418
|
-
} from "./chunk-
|
|
424
|
+
} from "./chunk-PP5FDOXX.js";
|
|
419
425
|
import {
|
|
420
426
|
API_KEY_ACCOUNT_PROVIDERS,
|
|
421
427
|
openCliAccounts,
|
|
422
428
|
storedAccountSignedIn
|
|
423
|
-
} from "./chunk-
|
|
429
|
+
} from "./chunk-HM3XROXV.js";
|
|
424
430
|
import {
|
|
425
431
|
beginCodexDeviceLogin
|
|
426
|
-
} from "./chunk-
|
|
432
|
+
} from "./chunk-QFECRPMQ.js";
|
|
427
433
|
import {
|
|
428
434
|
ConversationIndexRefreshError,
|
|
429
435
|
activeConversationTurn,
|
|
@@ -443,7 +449,7 @@ import {
|
|
|
443
449
|
openSessions,
|
|
444
450
|
pullRequestLabel,
|
|
445
451
|
pullRequestOfShellCall,
|
|
446
|
-
|
|
452
|
+
readConversationRecords,
|
|
447
453
|
recordGeneratedTitle,
|
|
448
454
|
requireWritableConversation,
|
|
449
455
|
setTitle,
|
|
@@ -453,29 +459,29 @@ import {
|
|
|
453
459
|
typedTextOf,
|
|
454
460
|
unansweredReviewPark,
|
|
455
461
|
unarchiveConversation
|
|
456
|
-
} from "./chunk-
|
|
457
|
-
import "./chunk-
|
|
462
|
+
} from "./chunk-2VKT4OPG.js";
|
|
463
|
+
import "./chunk-KCRRCSBK.js";
|
|
458
464
|
import "./chunk-JQIBPPOL.js";
|
|
459
|
-
import "./chunk-
|
|
465
|
+
import "./chunk-JZVNLDXW.js";
|
|
460
466
|
import {
|
|
461
467
|
isTrusted,
|
|
462
468
|
trustDir
|
|
463
|
-
} from "./chunk-
|
|
469
|
+
} from "./chunk-VXZ4I76G.js";
|
|
464
470
|
import {
|
|
465
471
|
bindAccount,
|
|
466
472
|
findAccountByName,
|
|
467
473
|
isDefaultAccountId
|
|
468
|
-
} from "./chunk-
|
|
474
|
+
} from "./chunk-IO6AH6S6.js";
|
|
469
475
|
import {
|
|
470
476
|
startAutoUpdate
|
|
471
|
-
} from "./chunk-
|
|
477
|
+
} from "./chunk-4XONZ3IH.js";
|
|
472
478
|
import {
|
|
473
479
|
resolveNpmInvocation
|
|
474
|
-
} from "./chunk-
|
|
480
|
+
} from "./chunk-7OYYEJXX.js";
|
|
475
481
|
import {
|
|
476
482
|
readManifest
|
|
477
483
|
} from "./chunk-AK2U3N2A.js";
|
|
478
|
-
import "./chunk-
|
|
484
|
+
import "./chunk-I7DZMDL4.js";
|
|
479
485
|
import {
|
|
480
486
|
ScheduleConflictError,
|
|
481
487
|
confirmationHolds,
|
|
@@ -504,7 +510,7 @@ import {
|
|
|
504
510
|
describeCacheLifetime,
|
|
505
511
|
promptCacheTtl,
|
|
506
512
|
providerOffersCacheLifetime
|
|
507
|
-
} from "./chunk-
|
|
513
|
+
} from "./chunk-BFK5ZLTI.js";
|
|
508
514
|
import "./chunk-OH6TB27S.js";
|
|
509
515
|
import {
|
|
510
516
|
COMPOSER_TRIGGER_DEFAULTS,
|
|
@@ -534,14 +540,14 @@ import {
|
|
|
534
540
|
saveDecisionKey,
|
|
535
541
|
shouldOfferDecisionSetup,
|
|
536
542
|
writeConnection
|
|
537
|
-
} from "./chunk-
|
|
543
|
+
} from "./chunk-V6W5ILRM.js";
|
|
538
544
|
import "./chunk-KONYGNG6.js";
|
|
539
545
|
import "./chunk-LCGXWCVU.js";
|
|
540
|
-
import "./chunk-
|
|
546
|
+
import "./chunk-QAQBDQOO.js";
|
|
541
547
|
import {
|
|
542
548
|
contextLogging,
|
|
543
549
|
installCliLogging
|
|
544
|
-
} from "./chunk-
|
|
550
|
+
} from "./chunk-JXIZ23M4.js";
|
|
545
551
|
import {
|
|
546
552
|
PROJECT_MCP_FILE,
|
|
547
553
|
parseMcpServerFile
|
|
@@ -571,7 +577,7 @@ import {
|
|
|
571
577
|
import {
|
|
572
578
|
primaryProvider,
|
|
573
579
|
writePreferences
|
|
574
|
-
} from "./chunk-
|
|
580
|
+
} from "./chunk-RSMLOV7S.js";
|
|
575
581
|
import {
|
|
576
582
|
automaticChoice,
|
|
577
583
|
automaticKind,
|
|
@@ -580,7 +586,7 @@ import {
|
|
|
580
586
|
discoverProviders,
|
|
581
587
|
hasApiCredential,
|
|
582
588
|
signedInSubscriptionProviders
|
|
583
|
-
} from "./chunk-
|
|
589
|
+
} from "./chunk-L37OHUPQ.js";
|
|
584
590
|
import "./chunk-4QIWRKJO.js";
|
|
585
591
|
import {
|
|
586
592
|
ALL_PROVIDER_IDS,
|
|
@@ -594,9 +600,9 @@ import "./chunk-RI2KAZJO.js";
|
|
|
594
600
|
import {
|
|
595
601
|
isAnthropicOAuthToken,
|
|
596
602
|
readCodexCredentialFile
|
|
597
|
-
} from "./chunk-
|
|
598
|
-
import "./chunk-
|
|
599
|
-
import "./chunk-
|
|
603
|
+
} from "./chunk-PMUGOF5V.js";
|
|
604
|
+
import "./chunk-UU6Z4RNI.js";
|
|
605
|
+
import "./chunk-GNBTKM54.js";
|
|
600
606
|
import "./chunk-JORONMD3.js";
|
|
601
607
|
import {
|
|
602
608
|
apiKeysPath,
|
|
@@ -615,10 +621,10 @@ import {
|
|
|
615
621
|
readStoredSubscriptionCredential,
|
|
616
622
|
writeStoredApiKey,
|
|
617
623
|
writeStoredGeminiApiKey
|
|
618
|
-
} from "./chunk-
|
|
624
|
+
} from "./chunk-RC3A3XQL.js";
|
|
619
625
|
import {
|
|
620
626
|
namzuHomePath
|
|
621
|
-
} from "./chunk-
|
|
627
|
+
} from "./chunk-KUPDSMDC.js";
|
|
622
628
|
import {
|
|
623
629
|
ACCEPT_EDITS_TOOLS,
|
|
624
630
|
AccountRegistryError,
|
|
@@ -663,6 +669,7 @@ import {
|
|
|
663
669
|
nextFireTime,
|
|
664
670
|
parseAccountId,
|
|
665
671
|
parseScheduleSpec,
|
|
672
|
+
parseTurnOutcome,
|
|
666
673
|
parseWorkflowMeta,
|
|
667
674
|
prettySink,
|
|
668
675
|
resolveBoundAccount,
|
|
@@ -674,7 +681,7 @@ import {
|
|
|
674
681
|
validateTimeZone,
|
|
675
682
|
wakeBudgetFromEnv,
|
|
676
683
|
wrapUntrusted
|
|
677
|
-
} from "./chunk-
|
|
684
|
+
} from "./chunk-W4BOQPYP.js";
|
|
678
685
|
import {
|
|
679
686
|
__commonJS,
|
|
680
687
|
__export,
|
|
@@ -34090,9 +34097,9 @@ var measure_element_default = measureElement;
|
|
|
34090
34097
|
var import_react63 = __toESM(require_react(), 1);
|
|
34091
34098
|
|
|
34092
34099
|
// src/tui/App.tsx
|
|
34093
|
-
import { existsSync as
|
|
34100
|
+
import { existsSync as existsSync4, rmSync as rmSync2 } from "node:fs";
|
|
34094
34101
|
import { homedir } from "node:os";
|
|
34095
|
-
import { join as
|
|
34102
|
+
import { join as join10, relative as relative3, resolve as resolve8 } from "node:path";
|
|
34096
34103
|
var import_react62 = __toESM(require_react(), 1);
|
|
34097
34104
|
|
|
34098
34105
|
// src/tui/system-rows.ts
|
|
@@ -34528,33 +34535,33 @@ function workflowRowVariants(workflow, now) {
|
|
|
34528
34535
|
const count2 = `${workflow.done}/${workflow.total}`;
|
|
34529
34536
|
const elapsed2 = formatElapsed(Math.max(0, (workflow.endedAt ?? now) - workflow.startedAt));
|
|
34530
34537
|
const spent = workflow.tokens === void 0 ? void 0 : formatCompactCount(workflow.tokens);
|
|
34531
|
-
const
|
|
34538
|
+
const join13 = /* @__PURE__ */ __name((parts) => parts.filter((part) => part !== void 0).join(" \xB7 "), "join");
|
|
34532
34539
|
const [wide, mid, narrow] = WORKFLOW_BAR_WIDTHS;
|
|
34533
34540
|
const warned = workflow.large ? [
|
|
34534
34541
|
{
|
|
34535
34542
|
barWidth: wide,
|
|
34536
|
-
text:
|
|
34543
|
+
text: join13([count2, elapsed2, spent && `\u2193 ${spent} tokens`, LARGE_WORKFLOW_WARNING])
|
|
34537
34544
|
},
|
|
34538
34545
|
{
|
|
34539
34546
|
barWidth: wide,
|
|
34540
|
-
text:
|
|
34547
|
+
text: join13([count2, elapsed2, spent && `\u2193 ${spent} tokens`, LARGE_WORKFLOW_WARNING_SHORT])
|
|
34541
34548
|
},
|
|
34542
34549
|
{
|
|
34543
34550
|
barWidth: wide,
|
|
34544
|
-
text:
|
|
34551
|
+
text: join13([elapsed2, spent && `\u2193 ${spent}`, LARGE_WORKFLOW_WARNING_SHORT])
|
|
34545
34552
|
}
|
|
34546
34553
|
] : [];
|
|
34547
34554
|
const variants = [
|
|
34548
34555
|
...warned,
|
|
34549
34556
|
{
|
|
34550
34557
|
barWidth: wide,
|
|
34551
|
-
text:
|
|
34558
|
+
text: join13([count2, elapsed2, spent && `\u2193 ${spent} tokens`])
|
|
34552
34559
|
},
|
|
34553
|
-
{ barWidth: wide, text:
|
|
34554
|
-
{ barWidth: wide, text:
|
|
34555
|
-
{ barWidth: wide, text:
|
|
34556
|
-
{ barWidth: mid, text:
|
|
34557
|
-
{ barWidth: narrow, text:
|
|
34560
|
+
{ barWidth: wide, text: join13([elapsed2, spent && `\u2193 ${spent} tokens`]) },
|
|
34561
|
+
{ barWidth: wide, text: join13([elapsed2, spent && `\u2193 ${spent}`]) },
|
|
34562
|
+
{ barWidth: wide, text: join13([spent && `\u2193 ${spent}`]) },
|
|
34563
|
+
{ barWidth: mid, text: join13([spent && `\u2193 ${spent}`]) },
|
|
34564
|
+
{ barWidth: narrow, text: join13([spent && `\u2193 ${spent}`]) },
|
|
34558
34565
|
{ barWidth: narrow, text: "" }
|
|
34559
34566
|
];
|
|
34560
34567
|
return variants.filter(
|
|
@@ -35886,7 +35893,13 @@ function lineStream(lines2, tone, limit, options) {
|
|
|
35886
35893
|
if (hidden <= 0) return rows;
|
|
35887
35894
|
return [
|
|
35888
35895
|
...rows,
|
|
35889
|
-
{
|
|
35896
|
+
{
|
|
35897
|
+
text: hiddenLinesHint(hidden, {
|
|
35898
|
+
canExpand: options.canExpand !== false,
|
|
35899
|
+
...options.hint !== void 0 ? { hint: options.hint } : {}
|
|
35900
|
+
}),
|
|
35901
|
+
tone: "dim"
|
|
35902
|
+
}
|
|
35890
35903
|
];
|
|
35891
35904
|
}
|
|
35892
35905
|
__name(lineStream, "lineStream");
|
|
@@ -35901,7 +35914,8 @@ function stream(lines2, tone, limit, options) {
|
|
|
35901
35914
|
{
|
|
35902
35915
|
text: hiddenLinesHint(hidden, {
|
|
35903
35916
|
...options.byLine ? {} : { chars: rows.slice(limit).reduce((sum, row2) => sum + row2.text.length, 0) },
|
|
35904
|
-
canExpand: options.canExpand !== false
|
|
35917
|
+
canExpand: options.canExpand !== false,
|
|
35918
|
+
...options.hint !== void 0 ? { hint: options.hint } : {}
|
|
35905
35919
|
}),
|
|
35906
35920
|
tone: "dim"
|
|
35907
35921
|
}
|
|
@@ -35932,6 +35946,10 @@ function shellCollapses(shell) {
|
|
|
35932
35946
|
);
|
|
35933
35947
|
}
|
|
35934
35948
|
__name(shellCollapses, "shellCollapses");
|
|
35949
|
+
function shellPlainLines(shell) {
|
|
35950
|
+
return shellResultRows(shell, { expanded: true }).map((row2) => row2.text);
|
|
35951
|
+
}
|
|
35952
|
+
__name(shellPlainLines, "shellPlainLines");
|
|
35935
35953
|
function shellRunningRows(tail2, elapsed2, timeout) {
|
|
35936
35954
|
const suffix = timeout ? `${elapsed2} \xB7 timeout ${timeout}` : elapsed2;
|
|
35937
35955
|
if (tail2.length === 0) return [{ text: `Running\u2026 (${suffix})`, tone: "dim" }];
|
|
@@ -37751,7 +37769,7 @@ function BackgroundJobsPanel({
|
|
|
37751
37769
|
terminalDisplayText(detailed.command).replace(/\t/gu, " "),
|
|
37752
37770
|
columns
|
|
37753
37771
|
);
|
|
37754
|
-
const
|
|
37772
|
+
const commandRows2 = allCommandRows.slice(0, 2);
|
|
37755
37773
|
const commandMore = allCommandRows.length > 2;
|
|
37756
37774
|
const shownOutput = outputRows.map((text, index) => ({ index, text })).slice(start, end);
|
|
37757
37775
|
const canStop = detailed.status === "running" && !busyJobId;
|
|
@@ -37794,7 +37812,7 @@ function BackgroundJobsPanel({
|
|
|
37794
37812
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { children: truncateChoiceText(oneLine4(detailed.description ?? ""), innerColumns - 10) })
|
|
37795
37813
|
] }) : null,
|
|
37796
37814
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { bold: true, children: "Command:" }),
|
|
37797
|
-
|
|
37815
|
+
commandRows2.map((row2) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.text.primary, wrap: "truncate-end", children: row2.text || " " }, row2.index)),
|
|
37798
37816
|
commandMore ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { color: theme.text.muted, children: "\u2026 command continues" }) : null,
|
|
37799
37817
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text, { bold: true, wrap: "truncate-end", children: truncateChoiceText(
|
|
37800
37818
|
earlierOutputOmitted ? "Output: (earlier output not shown)" : "Output:",
|
|
@@ -38362,6 +38380,8 @@ function createBlockCache() {
|
|
|
38362
38380
|
__name(createBlockCache, "createBlockCache");
|
|
38363
38381
|
|
|
38364
38382
|
// src/tui/terminal-hyperlinks.ts
|
|
38383
|
+
import { isAbsolute } from "node:path";
|
|
38384
|
+
import { pathToFileURL } from "node:url";
|
|
38365
38385
|
var OSC3 = "\x1B]";
|
|
38366
38386
|
var ST = "\x1B\\";
|
|
38367
38387
|
var MAX_TARGET_BYTES = 4096;
|
|
@@ -38392,6 +38412,13 @@ function terminalWebHyperlink(label, rawTarget) {
|
|
|
38392
38412
|
return `${OSC3}8;;${target}${ST}${label}${OSC3}8;;${ST}`;
|
|
38393
38413
|
}
|
|
38394
38414
|
__name(terminalWebHyperlink, "terminalWebHyperlink");
|
|
38415
|
+
function terminalFileHyperlink(label, absolutePath) {
|
|
38416
|
+
if (!isAbsolute(absolutePath) || containsTerminalControl(absolutePath)) return null;
|
|
38417
|
+
const target = pathToFileURL(absolutePath).href;
|
|
38418
|
+
if (Buffer.byteLength(target, "utf8") > MAX_TARGET_BYTES) return null;
|
|
38419
|
+
return `${OSC3}8;;${target}${ST}${label}${OSC3}8;;${ST}`;
|
|
38420
|
+
}
|
|
38421
|
+
__name(terminalFileHyperlink, "terminalFileHyperlink");
|
|
38395
38422
|
function containsTerminalControl(value) {
|
|
38396
38423
|
for (const char of value) {
|
|
38397
38424
|
const code = char.codePointAt(0) ?? 0;
|
|
@@ -39331,6 +39358,7 @@ function ReadSearchGroup({
|
|
|
39331
39358
|
const live = message.pending === true;
|
|
39332
39359
|
useReducedMotion();
|
|
39333
39360
|
const { stdout } = use_stdout_default();
|
|
39361
|
+
const width = useContentWidth();
|
|
39334
39362
|
const screenReader = use_is_screen_reader_enabled_default();
|
|
39335
39363
|
const motion = live && stdout.isTTY === true && !screenReader && motionAllowed();
|
|
39336
39364
|
const { frame } = useAnimation({ isActive: motion, interval: 300 });
|
|
@@ -39348,6 +39376,11 @@ function ReadSearchGroup({
|
|
|
39348
39376
|
const segments = groupSegments(state, live);
|
|
39349
39377
|
const hint = live ? visibleHint(state, now()) : void 0;
|
|
39350
39378
|
const hintLines = hint ? hint.split("\n").map(terminalDisplayText) : [];
|
|
39379
|
+
const ran = message.detailExpanded ? [] : commandRows(state, width - COMMAND_ROW_INDENT).map(terminalDisplayText);
|
|
39380
|
+
const under = [
|
|
39381
|
+
...ran.map((text) => ({ text, wrap: "truncate-end" })),
|
|
39382
|
+
...hintLines.map((text) => ({ text, wrap: "wrap" }))
|
|
39383
|
+
];
|
|
39351
39384
|
const shownHint = message.detailExpanded ? void 0 : live ? EXPAND_HINT : message.meta;
|
|
39352
39385
|
const tone = live ? theme.text.secondary : theme.text.muted;
|
|
39353
39386
|
const blink = motion ? Math.floor(frame / 2) % 2 === 0 : true;
|
|
@@ -39365,11 +39398,11 @@ function ReadSearchGroup({
|
|
|
39365
39398
|
] }) : null
|
|
39366
39399
|
] }) })
|
|
39367
39400
|
] }),
|
|
39368
|
-
|
|
39401
|
+
under.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { flexDirection: "column", paddingLeft: RESULT_GUTTER_INDENT, children: under.map(({ text: line, wrap: wrap3 }, i) => (
|
|
39369
39402
|
// biome-ignore lint/suspicious/noArrayIndexKey: these rows hold no state of their own.
|
|
39370
39403
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Box_default, { flexDirection: "row", children: [
|
|
39371
39404
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { width: RESULT_GUTTER_WIDTH, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: theme.text.muted, children: i === 0 ? "\u23BF" : " " }) }),
|
|
39372
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: theme.text.muted, wrap:
|
|
39405
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Box_default, { flexGrow: 1, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { color: theme.text.muted, wrap: wrap3, children: line }) })
|
|
39373
39406
|
] }, i)
|
|
39374
39407
|
)) }) : null
|
|
39375
39408
|
] });
|
|
@@ -39460,6 +39493,220 @@ function StatusPanel({ rows }) {
|
|
|
39460
39493
|
}
|
|
39461
39494
|
__name(StatusPanel, "StatusPanel");
|
|
39462
39495
|
|
|
39496
|
+
// src/tui/attachment-rows.ts
|
|
39497
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
39498
|
+
import { existsSync as existsSync2, mkdirSync, renameSync, writeFileSync } from "node:fs";
|
|
39499
|
+
import { extname, join as join2 } from "node:path";
|
|
39500
|
+
|
|
39501
|
+
// src/tui/paste-chips.ts
|
|
39502
|
+
var PASTE_CHIP = /\[Pasted text #(\d+)(?: \+\d+ lines)?\]/g;
|
|
39503
|
+
var ANY_CHIP = /\[(?:Pasted text #(\d+)(?: \+\d+ lines)?|(?:Image|Document) #\d+)\]/g;
|
|
39504
|
+
var ATTACHMENT_MARKER = /\[(Image|Document) #(\d+)\]/g;
|
|
39505
|
+
var PASTE_CHIP_CHARS = 800;
|
|
39506
|
+
function pasteChipLines(rows) {
|
|
39507
|
+
return Math.min(rows - 10, 2);
|
|
39508
|
+
}
|
|
39509
|
+
__name(pasteChipLines, "pasteChipLines");
|
|
39510
|
+
function isChipPaste(text, rows) {
|
|
39511
|
+
let newlines2 = 0;
|
|
39512
|
+
for (let i = 0; i < text.length; i += 1) if (text.charCodeAt(i) === 10) newlines2 += 1;
|
|
39513
|
+
return text.length > PASTE_CHIP_CHARS || newlines2 > pasteChipLines(rows);
|
|
39514
|
+
}
|
|
39515
|
+
__name(isChipPaste, "isChipPaste");
|
|
39516
|
+
function pasteChip(id, text) {
|
|
39517
|
+
let newlines2 = 0;
|
|
39518
|
+
for (let i = 0; i < text.length; i += 1) if (text.charCodeAt(i) === 10) newlines2 += 1;
|
|
39519
|
+
return newlines2 > 0 ? `[Pasted text #${id} +${newlines2} lines]` : `[Pasted text #${id}]`;
|
|
39520
|
+
}
|
|
39521
|
+
__name(pasteChip, "pasteChip");
|
|
39522
|
+
function attachmentChip(kind, id) {
|
|
39523
|
+
return `[${kind} #${id}]`;
|
|
39524
|
+
}
|
|
39525
|
+
__name(attachmentChip, "attachmentChip");
|
|
39526
|
+
function expandChips(value, pastes) {
|
|
39527
|
+
return value.replace(PASTE_CHIP, (chip, id) => pastes.get(Number(id)) ?? chip);
|
|
39528
|
+
}
|
|
39529
|
+
__name(expandChips, "expandChips");
|
|
39530
|
+
function chipRanges(value, known) {
|
|
39531
|
+
const found = [];
|
|
39532
|
+
for (const match of value.matchAll(ANY_CHIP)) {
|
|
39533
|
+
const text = match[0];
|
|
39534
|
+
const paste = match[1];
|
|
39535
|
+
const real = paste !== void 0 ? known.pastes.has(Number(paste)) : known.attachments.has(text);
|
|
39536
|
+
if (real) found.push({ start: match.index, end: match.index + text.length, text });
|
|
39537
|
+
}
|
|
39538
|
+
return found;
|
|
39539
|
+
}
|
|
39540
|
+
__name(chipRanges, "chipRanges");
|
|
39541
|
+
function snapOutOfChip(ranges, position, bias) {
|
|
39542
|
+
for (const chip of ranges) {
|
|
39543
|
+
if (position <= chip.start || position >= chip.end) continue;
|
|
39544
|
+
if (bias < 0) return chip.start;
|
|
39545
|
+
if (bias > 0) return chip.end;
|
|
39546
|
+
return position - chip.start <= chip.end - position ? chip.start : chip.end;
|
|
39547
|
+
}
|
|
39548
|
+
return position;
|
|
39549
|
+
}
|
|
39550
|
+
__name(snapOutOfChip, "snapOutOfChip");
|
|
39551
|
+
function widenOverChips(ranges, start, end) {
|
|
39552
|
+
let from = start;
|
|
39553
|
+
let to = end;
|
|
39554
|
+
for (const chip of ranges) {
|
|
39555
|
+
if (from > chip.start && from < chip.end) from = chip.start;
|
|
39556
|
+
if (to > chip.start && to < chip.end) to = chip.end;
|
|
39557
|
+
}
|
|
39558
|
+
return [from, to];
|
|
39559
|
+
}
|
|
39560
|
+
__name(widenOverChips, "widenOverChips");
|
|
39561
|
+
function keepChipsWhole(previous, ranges, edit, inserted, cursorAfter) {
|
|
39562
|
+
let { start, deleteEnd } = edit;
|
|
39563
|
+
if (start === deleteEnd) {
|
|
39564
|
+
start = snapOutOfChip(ranges, start, 1);
|
|
39565
|
+
deleteEnd = start;
|
|
39566
|
+
} else [start, deleteEnd] = widenOverChips(ranges, start, deleteEnd);
|
|
39567
|
+
const value = previous.slice(0, start) + inserted + previous.slice(deleteEnd);
|
|
39568
|
+
const typicalCursor = edit.start + inserted.length;
|
|
39569
|
+
const cursor = cursorAfter === typicalCursor ? start + inserted.length : cursorAfter;
|
|
39570
|
+
return { value, cursor };
|
|
39571
|
+
}
|
|
39572
|
+
__name(keepChipsWhole, "keepChipsWhole");
|
|
39573
|
+
function attachmentMarkers(text) {
|
|
39574
|
+
return [...text.matchAll(ATTACHMENT_MARKER)].map((match) => ({
|
|
39575
|
+
kind: match[1],
|
|
39576
|
+
id: Number(match[2])
|
|
39577
|
+
}));
|
|
39578
|
+
}
|
|
39579
|
+
__name(attachmentMarkers, "attachmentMarkers");
|
|
39580
|
+
function numberAttachments(text, kinds, floor) {
|
|
39581
|
+
const markers = attachmentMarkers(text);
|
|
39582
|
+
const queue = {
|
|
39583
|
+
Image: [...new Set(markers.filter((m) => m.kind === "Image").map((m) => m.id))].sort(
|
|
39584
|
+
(a, b) => a - b
|
|
39585
|
+
),
|
|
39586
|
+
Document: [...new Set(markers.filter((m) => m.kind === "Document").map((m) => m.id))].sort(
|
|
39587
|
+
(a, b) => a - b
|
|
39588
|
+
)
|
|
39589
|
+
};
|
|
39590
|
+
const matched = ["Image", "Document"].every(
|
|
39591
|
+
(kind) => queue[kind].length >= kinds.filter((k) => k === kind).length
|
|
39592
|
+
);
|
|
39593
|
+
if (matched) {
|
|
39594
|
+
for (const kind of ["Image", "Document"]) {
|
|
39595
|
+
const count2 = kinds.filter((k) => k === kind).length;
|
|
39596
|
+
queue[kind] = queue[kind].slice(queue[kind].length - count2);
|
|
39597
|
+
}
|
|
39598
|
+
return kinds.map((kind) => queue[kind].shift());
|
|
39599
|
+
}
|
|
39600
|
+
const start = Math.max(floor, ...markers.map((m) => m.id));
|
|
39601
|
+
return kinds.map((_, index) => start + index + 1);
|
|
39602
|
+
}
|
|
39603
|
+
__name(numberAttachments, "numberAttachments");
|
|
39604
|
+
function highestAttachmentNumber(text) {
|
|
39605
|
+
let highest = 0;
|
|
39606
|
+
for (const marker of attachmentMarkers(text)) highest = Math.max(highest, marker.id);
|
|
39607
|
+
return highest;
|
|
39608
|
+
}
|
|
39609
|
+
__name(highestAttachmentNumber, "highestAttachmentNumber");
|
|
39610
|
+
var NUMBERS_GIVEN = /* @__PURE__ */ new WeakMap();
|
|
39611
|
+
function noteAttachmentNumber(attachment, id) {
|
|
39612
|
+
NUMBERS_GIVEN.set(attachment, id);
|
|
39613
|
+
}
|
|
39614
|
+
__name(noteAttachmentNumber, "noteAttachmentNumber");
|
|
39615
|
+
function givenAttachmentNumber(attachment) {
|
|
39616
|
+
return NUMBERS_GIVEN.get(attachment);
|
|
39617
|
+
}
|
|
39618
|
+
__name(givenAttachmentNumber, "givenAttachmentNumber");
|
|
39619
|
+
|
|
39620
|
+
// src/tui/attachment-rows.ts
|
|
39621
|
+
function attachmentDirOf(sessions, sessionId) {
|
|
39622
|
+
try {
|
|
39623
|
+
return join2(sessions.paths.sessionDir({ sessionId }), "attachments");
|
|
39624
|
+
} catch {
|
|
39625
|
+
return void 0;
|
|
39626
|
+
}
|
|
39627
|
+
}
|
|
39628
|
+
__name(attachmentDirOf, "attachmentDirOf");
|
|
39629
|
+
function attachmentKind(attachment) {
|
|
39630
|
+
return attachment.type === "document" || attachment.type === "stored" && attachment.kind !== "image" ? "Document" : "Image";
|
|
39631
|
+
}
|
|
39632
|
+
__name(attachmentKind, "attachmentKind");
|
|
39633
|
+
function attachmentName(attachment) {
|
|
39634
|
+
const named = attachment;
|
|
39635
|
+
const name = typeof named.filename === "string" ? named.filename : named.name;
|
|
39636
|
+
if (typeof name !== "string") return void 0;
|
|
39637
|
+
const trimmed = name.trim();
|
|
39638
|
+
return trimmed === "" || trimmed === "Pasted image" ? void 0 : trimmed;
|
|
39639
|
+
}
|
|
39640
|
+
__name(attachmentName, "attachmentName");
|
|
39641
|
+
function byteLength(base64) {
|
|
39642
|
+
const padding = base64.endsWith("==") ? 2 : base64.endsWith("=") ? 1 : 0;
|
|
39643
|
+
return Math.max(0, Math.floor(base64.length * 3 / 4) - padding);
|
|
39644
|
+
}
|
|
39645
|
+
__name(byteLength, "byteLength");
|
|
39646
|
+
var EXTENSIONS = {
|
|
39647
|
+
"image/png": "png",
|
|
39648
|
+
"image/jpeg": "jpg",
|
|
39649
|
+
"image/gif": "gif",
|
|
39650
|
+
"image/webp": "webp",
|
|
39651
|
+
"image/heic": "heic",
|
|
39652
|
+
"image/bmp": "bmp",
|
|
39653
|
+
"application/pdf": "pdf",
|
|
39654
|
+
"text/plain": "txt",
|
|
39655
|
+
"text/markdown": "md"
|
|
39656
|
+
};
|
|
39657
|
+
function extensionOf(attachment) {
|
|
39658
|
+
const known = EXTENSIONS[attachment.mediaType];
|
|
39659
|
+
if (known) return known;
|
|
39660
|
+
const own = extname(attachmentName(attachment) ?? "").slice(1).toLowerCase();
|
|
39661
|
+
return /^[a-z0-9]{1,8}$/.test(own) ? own : "bin";
|
|
39662
|
+
}
|
|
39663
|
+
__name(extensionOf, "extensionOf");
|
|
39664
|
+
function attachmentPath(directory, attachment) {
|
|
39665
|
+
if (attachment.type === "stored") return void 0;
|
|
39666
|
+
const digest = createHash2("sha256").update(attachment.data, "base64").digest("hex").slice(0, 32);
|
|
39667
|
+
return join2(directory, `${digest}.${extensionOf(attachment)}`);
|
|
39668
|
+
}
|
|
39669
|
+
__name(attachmentPath, "attachmentPath");
|
|
39670
|
+
function ensureAttachmentFile(directory, attachment) {
|
|
39671
|
+
const path = attachmentPath(directory, attachment);
|
|
39672
|
+
if (path === void 0 || attachment.type === "stored") return void 0;
|
|
39673
|
+
try {
|
|
39674
|
+
if (existsSync2(path)) return path;
|
|
39675
|
+
mkdirSync(directory, { recursive: true, mode: 448 });
|
|
39676
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
39677
|
+
writeFileSync(temporary, Buffer.from(attachment.data, "base64"), { mode: 384 });
|
|
39678
|
+
renameSync(temporary, path);
|
|
39679
|
+
return path;
|
|
39680
|
+
} catch {
|
|
39681
|
+
return void 0;
|
|
39682
|
+
}
|
|
39683
|
+
}
|
|
39684
|
+
__name(ensureAttachmentFile, "ensureAttachmentFile");
|
|
39685
|
+
var NAME_CELLS = 32;
|
|
39686
|
+
function attachmentLine(row2) {
|
|
39687
|
+
const name = row2.name ? ` ${truncateChoiceText(row2.name, NAME_CELLS)}` : "";
|
|
39688
|
+
return `${row2.marker}${name}${row2.size ? ` \xB7 ${row2.size}` : ""}`;
|
|
39689
|
+
}
|
|
39690
|
+
__name(attachmentLine, "attachmentLine");
|
|
39691
|
+
function attachmentRows(text, attachments, floor, directory) {
|
|
39692
|
+
const kinds = attachments.map(attachmentKind);
|
|
39693
|
+
const derived = numberAttachments(text, kinds, floor);
|
|
39694
|
+
const numbers = attachments.map((attachment, index) => {
|
|
39695
|
+
return givenAttachmentNumber(attachment) ?? derived[index];
|
|
39696
|
+
});
|
|
39697
|
+
return attachments.map((attachment, index) => {
|
|
39698
|
+
const name = attachmentName(attachment);
|
|
39699
|
+
const path = directory ? ensureAttachmentFile(directory, attachment) : void 0;
|
|
39700
|
+
return {
|
|
39701
|
+
marker: attachmentChip(kinds[index], numbers[index]),
|
|
39702
|
+
...name ? { name } : {},
|
|
39703
|
+
...attachment.type === "stored" ? {} : { size: formatSize(byteLength(attachment.data)) },
|
|
39704
|
+
...path ? { path } : {}
|
|
39705
|
+
};
|
|
39706
|
+
});
|
|
39707
|
+
}
|
|
39708
|
+
__name(attachmentRows, "attachmentRows");
|
|
39709
|
+
|
|
39463
39710
|
// src/tui/Transcript.tsx
|
|
39464
39711
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
39465
39712
|
var COLLAPSE_LINES = 6;
|
|
@@ -39566,7 +39813,7 @@ function MessageRow({
|
|
|
39566
39813
|
const web = message.activity === "web";
|
|
39567
39814
|
const continuesWeb = web && prev?.activity === "web";
|
|
39568
39815
|
const gap = !prev || message.glyph === "\u23BF" || continuesWeb ? 0 : 1;
|
|
39569
|
-
if (message.group) {
|
|
39816
|
+
if (message.group && message.shell === void 0) {
|
|
39570
39817
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "column", marginTop: gap, children: [
|
|
39571
39818
|
screen && message.thinking ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ThinkingBlock, { text: message.thinking }) : null,
|
|
39572
39819
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ReadSearchGroup, { message }),
|
|
@@ -39624,6 +39871,14 @@ function MessageRow({
|
|
|
39624
39871
|
message.pending && content.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: theme.text.muted, children: "\u2026" }) : null
|
|
39625
39872
|
] }) })
|
|
39626
39873
|
] }),
|
|
39874
|
+
message.attachments && message.attachments.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, children: message.attachments.map((row2, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
39875
|
+
AttachmentLineRow,
|
|
39876
|
+
{
|
|
39877
|
+
row: row2,
|
|
39878
|
+
hyperlinks
|
|
39879
|
+
},
|
|
39880
|
+
index
|
|
39881
|
+
)) }) : null,
|
|
39627
39882
|
message.checklist && message.checklist.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Checklist, { items: message.checklist }) }) : null,
|
|
39628
39883
|
message.shell ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
39629
39884
|
ShellBlock,
|
|
@@ -39760,7 +40015,7 @@ function willCollapse(detail, diff2) {
|
|
|
39760
40015
|
return detail.length > COLLAPSE_LINES || detail.some((line) => terminalDisplayText(line).length > PREVIEW_LINE_CHARS);
|
|
39761
40016
|
}
|
|
39762
40017
|
__name(willCollapse, "willCollapse");
|
|
39763
|
-
function splitDetail(lines2, expanded, detailRef) {
|
|
40018
|
+
function splitDetail(lines2, expanded, detailRef, hint) {
|
|
39764
40019
|
if (expanded) return lines2;
|
|
39765
40020
|
const canExpand = detailRef !== void 0;
|
|
39766
40021
|
const fragmentLines = COLLAPSE_LINES / 2;
|
|
@@ -39773,51 +40028,55 @@ function splitDetail(lines2, expanded, detailRef) {
|
|
|
39773
40028
|
const clipped = selected.some((line) => line.length > PREVIEW_LINE_CHARS);
|
|
39774
40029
|
const shown = selected.map(clipLine);
|
|
39775
40030
|
if (hidden > 0) {
|
|
39776
|
-
const
|
|
40031
|
+
const hiddenRow = hiddenLinesHint(hidden, {
|
|
39777
40032
|
chars: folded.reduce((sum, line) => sum + line.length, 0),
|
|
39778
|
-
canExpand
|
|
40033
|
+
canExpand,
|
|
40034
|
+
...hint !== void 0 ? { hint } : {}
|
|
39779
40035
|
});
|
|
39780
|
-
return [...shown.slice(0, fragmentLines),
|
|
40036
|
+
return [...shown.slice(0, fragmentLines), hiddenRow, ...shown.slice(fragmentLines)];
|
|
39781
40037
|
}
|
|
39782
|
-
return clipped ? [...shown, `\u2026 line shortened${canExpand ? ` ${EXPAND_HINT}` : ""}`] : shown;
|
|
40038
|
+
return clipped ? [...shown, `\u2026 line shortened${canExpand ? ` ${hint ?? EXPAND_HINT}` : ""}`] : shown;
|
|
39783
40039
|
}
|
|
39784
40040
|
__name(splitDetail, "splitDetail");
|
|
39785
40041
|
function clipLine(line) {
|
|
39786
40042
|
return clipText(line, PREVIEW_LINE_CHARS);
|
|
39787
40043
|
}
|
|
39788
40044
|
__name(clipLine, "clipLine");
|
|
39789
|
-
function renderedDetailLines(message, columns) {
|
|
40045
|
+
function renderedDetailLines(message, columns, hint) {
|
|
39790
40046
|
const checklist = (message.checklist ?? []).map((item) => ` ${checklistLine(item)}`);
|
|
39791
|
-
return [...checklist, ...renderedBodyLines(message, columns)];
|
|
40047
|
+
return [...checklist, ...renderedBodyLines(message, columns, hint)];
|
|
39792
40048
|
}
|
|
39793
40049
|
__name(renderedDetailLines, "renderedDetailLines");
|
|
39794
|
-
function renderedBodyLines(message, columns) {
|
|
40050
|
+
function renderedBodyLines(message, columns, hint) {
|
|
39795
40051
|
if (message.shell) {
|
|
39796
40052
|
return shellResultRows(message.shell, {
|
|
39797
40053
|
expanded: message.detailExpanded === true,
|
|
40054
|
+
...hint !== void 0 ? { hint } : {},
|
|
39798
40055
|
...message.shell.byLine === true && columns !== void 0 ? { width: shellBodyWidth(Math.max(10, columns - 4)) } : {}
|
|
39799
40056
|
}).map((row2) => " ".repeat(SHELL_RESULT_INDENT) + terminalDisplayText(row2.text));
|
|
39800
40057
|
}
|
|
39801
40058
|
const lines2 = message.detail;
|
|
39802
40059
|
if (!lines2 || lines2.length === 0 || message.activity !== void 0 && !message.detailExpanded)
|
|
39803
40060
|
return [];
|
|
39804
|
-
if (message.diff) return renderedDiffLines(lines2, message, columns);
|
|
40061
|
+
if (message.diff) return renderedDiffLines(lines2, message, columns, hint);
|
|
39805
40062
|
const shown = splitDetail(
|
|
39806
40063
|
lines2.map(terminalDisplayText),
|
|
39807
40064
|
message.detailExpanded === true,
|
|
39808
|
-
message.detailRef
|
|
40065
|
+
message.detailRef,
|
|
40066
|
+
hint
|
|
39809
40067
|
);
|
|
39810
40068
|
const gutter = " ".repeat(SHELL_RESULT_INDENT);
|
|
39811
40069
|
return shown.map((line) => gutter + line);
|
|
39812
40070
|
}
|
|
39813
40071
|
__name(renderedBodyLines, "renderedBodyLines");
|
|
39814
|
-
function renderedDiffLines(lines2, message, columns) {
|
|
40072
|
+
function renderedDiffLines(lines2, message, columns, hint) {
|
|
39815
40073
|
const indent = " ".repeat(SHELL_RESULT_INDENT);
|
|
39816
40074
|
if (message.diff && columns !== void 0) {
|
|
39817
40075
|
const drawn = diffViewBody(message.diff, {
|
|
39818
40076
|
width: diffBodyWidth(columns),
|
|
39819
40077
|
expanded: message.detailExpanded === true,
|
|
39820
|
-
canExpand: message.detailRef !== void 0
|
|
40078
|
+
canExpand: message.detailRef !== void 0,
|
|
40079
|
+
...hint !== void 0 ? { hint } : {}
|
|
39821
40080
|
});
|
|
39822
40081
|
return drawn.map((row2) => `${indent}${terminalDisplayText(viewRowText(row2))}`);
|
|
39823
40082
|
}
|
|
@@ -39826,7 +40085,10 @@ function renderedDiffLines(lines2, message, columns) {
|
|
|
39826
40085
|
const shown = lines2.slice(0, limit).map((line) => `${indent}${terminalDisplayText(line)}..`);
|
|
39827
40086
|
if (lines2.length > limit) {
|
|
39828
40087
|
shown.push(
|
|
39829
|
-
`${indent}${hiddenLinesHint(lines2.length - limit, {
|
|
40088
|
+
`${indent}${hiddenLinesHint(lines2.length - limit, {
|
|
40089
|
+
canExpand: message.detailRef !== void 0,
|
|
40090
|
+
...hint !== void 0 ? { hint } : {}
|
|
40091
|
+
})}`
|
|
39830
40092
|
);
|
|
39831
40093
|
}
|
|
39832
40094
|
return shown;
|
|
@@ -39881,6 +40143,15 @@ function metaSeparator(meta) {
|
|
|
39881
40143
|
return meta.startsWith("(") ? " " : " \xB7 ";
|
|
39882
40144
|
}
|
|
39883
40145
|
__name(metaSeparator, "metaSeparator");
|
|
40146
|
+
function AttachmentLineRow({
|
|
40147
|
+
row: row2,
|
|
40148
|
+
hyperlinks
|
|
40149
|
+
}) {
|
|
40150
|
+
const label = terminalDisplayText(attachmentLine(row2));
|
|
40151
|
+
const linked = hyperlinks && row2.path ? terminalFileHyperlink(label, row2.path) : null;
|
|
40152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: theme.text.muted, wrap: "truncate-end", underline: linked !== null, children: linked ?? label });
|
|
40153
|
+
}
|
|
40154
|
+
__name(AttachmentLineRow, "AttachmentLineRow");
|
|
39884
40155
|
|
|
39885
40156
|
// src/tui/transcript-screen.ts
|
|
39886
40157
|
var TRANSCRIPT_SCREEN_TAIL = 30;
|
|
@@ -40039,8 +40310,8 @@ __name(TranscriptScreen, "TranscriptScreen");
|
|
|
40039
40310
|
|
|
40040
40311
|
// src/integrations/accounts/codex-login.ts
|
|
40041
40312
|
import { spawn as nodeSpawn } from "node:child_process";
|
|
40042
|
-
import { mkdirSync, rmSync } from "node:fs";
|
|
40043
|
-
import { join as
|
|
40313
|
+
import { mkdirSync as mkdirSync2, rmSync } from "node:fs";
|
|
40314
|
+
import { join as join3 } from "node:path";
|
|
40044
40315
|
function loginAddressIn(line) {
|
|
40045
40316
|
return /https?:\/\/[^\s"'<>]+/.exec(line)?.[0];
|
|
40046
40317
|
}
|
|
@@ -40060,7 +40331,7 @@ async function runCodexLogin(options) {
|
|
|
40060
40331
|
rmSync(options.dir, { recursive: true, force: true });
|
|
40061
40332
|
}, "cleanup");
|
|
40062
40333
|
if (options.signal.aborted) return { kind: "cancelled" };
|
|
40063
|
-
|
|
40334
|
+
mkdirSync2(options.dir, { recursive: true, mode: 448 });
|
|
40064
40335
|
const start = options.spawn ?? nodeSpawn;
|
|
40065
40336
|
let child;
|
|
40066
40337
|
try {
|
|
@@ -40103,7 +40374,7 @@ async function runCodexLogin(options) {
|
|
|
40103
40374
|
message: "Codex is not installed on this computer. Install it, then add the account again."
|
|
40104
40375
|
} : { kind: "failed", message: outcome.error.message };
|
|
40105
40376
|
}
|
|
40106
|
-
const credential = readCodexCredentialFile(
|
|
40377
|
+
const credential = readCodexCredentialFile(join3(options.dir, "auth.json"));
|
|
40107
40378
|
if (outcome.code !== 0 || !credential) {
|
|
40108
40379
|
cleanup();
|
|
40109
40380
|
return {
|
|
@@ -40563,8 +40834,8 @@ __name(mcpPersonCommand, "mcpPersonCommand");
|
|
|
40563
40834
|
|
|
40564
40835
|
// src/integrations/notifications/sound.ts
|
|
40565
40836
|
import { spawn as spawn2 } from "node:child_process";
|
|
40566
|
-
import { existsSync as
|
|
40567
|
-
import { join as
|
|
40837
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, renameSync as renameSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
40838
|
+
import { join as join4 } from "node:path";
|
|
40568
40839
|
|
|
40569
40840
|
// src/integrations/notifications/sound/chime.ts
|
|
40570
40841
|
var FIGURES = {
|
|
@@ -40666,7 +40937,7 @@ var POWERSHELL_ARGS = [
|
|
|
40666
40937
|
function onPath(env3, exists, name) {
|
|
40667
40938
|
for (const dir of (env3.PATH ?? "").split(":")) {
|
|
40668
40939
|
if (!dir || dir.startsWith("/mnt/")) continue;
|
|
40669
|
-
const candidate =
|
|
40940
|
+
const candidate = join4(dir, name);
|
|
40670
40941
|
if (exists(candidate)) return candidate;
|
|
40671
40942
|
}
|
|
40672
40943
|
return void 0;
|
|
@@ -40675,7 +40946,7 @@ __name(onPath, "onPath");
|
|
|
40675
40946
|
function selectSoundPlayer(probe = {}) {
|
|
40676
40947
|
const platform2 = probe.platform ?? process.platform;
|
|
40677
40948
|
const env3 = probe.env ?? process.env;
|
|
40678
|
-
const exists = probe.exists ??
|
|
40949
|
+
const exists = probe.exists ?? existsSync3;
|
|
40679
40950
|
if (platform2 === "darwin") {
|
|
40680
40951
|
return { name: "afplay", command: "/usr/bin/afplay", args: /* @__PURE__ */ __name((file) => [file], "args") };
|
|
40681
40952
|
}
|
|
@@ -40718,7 +40989,7 @@ function selectSoundPlayer(probe = {}) {
|
|
|
40718
40989
|
}
|
|
40719
40990
|
__name(selectSoundPlayer, "selectSoundPlayer");
|
|
40720
40991
|
function soundFilePath(kind, home = namzuHomePath()) {
|
|
40721
|
-
return
|
|
40992
|
+
return join4(home, "cache", "sound", `namzu-${kind}-v1.wav`);
|
|
40722
40993
|
}
|
|
40723
40994
|
__name(soundFilePath, "soundFilePath");
|
|
40724
40995
|
function ensureSoundFile(kind, home) {
|
|
@@ -40728,10 +40999,10 @@ function ensureSoundFile(kind, home) {
|
|
|
40728
40999
|
if (statSync2(file).size === wav.length) return file;
|
|
40729
41000
|
} catch {
|
|
40730
41001
|
}
|
|
40731
|
-
|
|
41002
|
+
mkdirSync3(join4(file, ".."), { recursive: true });
|
|
40732
41003
|
const staging = `${file}.${process.pid}.tmp`;
|
|
40733
|
-
|
|
40734
|
-
|
|
41004
|
+
writeFileSync2(staging, wav);
|
|
41005
|
+
renameSync2(staging, file);
|
|
40735
41006
|
return file;
|
|
40736
41007
|
}
|
|
40737
41008
|
__name(ensureSoundFile, "ensureSoundFile");
|
|
@@ -41201,12 +41472,9 @@ function mergeUndeliveredLiveInput(queued, undelivered) {
|
|
|
41201
41472
|
return merged;
|
|
41202
41473
|
}
|
|
41203
41474
|
__name(mergeUndeliveredLiveInput, "mergeUndeliveredLiveInput");
|
|
41204
|
-
function humanPromptMeta(attachedFiles,
|
|
41475
|
+
function humanPromptMeta(attachedFiles, live = false) {
|
|
41205
41476
|
const parts = [];
|
|
41206
41477
|
if (attachedFiles > 0) parts.push(`${attachedFiles} file${attachedFiles > 1 ? "s" : ""} attached`);
|
|
41207
|
-
if (attachments && attachments.length > 0) {
|
|
41208
|
-
parts.push(`${attachments.length} attachment${attachments.length > 1 ? "s" : ""}`);
|
|
41209
|
-
}
|
|
41210
41478
|
if (live) parts.push("sent while working");
|
|
41211
41479
|
return parts.length > 0 ? parts.join(" \xB7 ") : void 0;
|
|
41212
41480
|
}
|
|
@@ -42083,7 +42351,7 @@ __name(loadImageFiles, "loadImageFiles");
|
|
|
42083
42351
|
// src/integrations/clipboard/image.ts
|
|
42084
42352
|
import { spawn as spawn3 } from "node:child_process";
|
|
42085
42353
|
import { readFile as readFile2, rm } from "node:fs/promises";
|
|
42086
|
-
import { join as
|
|
42354
|
+
import { join as join5 } from "node:path";
|
|
42087
42355
|
var MAX_IMAGE_BASE64_BYTES = 5 * 1024 * 1024;
|
|
42088
42356
|
function imageFitsProvider(image2) {
|
|
42089
42357
|
return image2.data.length <= MAX_IMAGE_BASE64_BYTES;
|
|
@@ -42284,7 +42552,7 @@ async function readLinux(run4, wsl, readText, fit2) {
|
|
|
42284
42552
|
__name(readLinux, "readLinux");
|
|
42285
42553
|
async function readMac(run4, fit2) {
|
|
42286
42554
|
const dir = await createTempDir("clip-");
|
|
42287
|
-
const file =
|
|
42555
|
+
const file = join5(dir, "clip.png");
|
|
42288
42556
|
try {
|
|
42289
42557
|
const result = await run4(
|
|
42290
42558
|
"osascript",
|
|
@@ -42942,44 +43210,6 @@ function autoModelLabel(route) {
|
|
|
42942
43210
|
}
|
|
42943
43211
|
__name(autoModelLabel, "autoModelLabel");
|
|
42944
43212
|
|
|
42945
|
-
// src/tui/paste-chips.ts
|
|
42946
|
-
var PASTE_CHIP = /\[Pasted text #(\d+)(?: \+\d+ lines)?\]/g;
|
|
42947
|
-
var ANY_CHIP = /\[(?:Pasted text #\d+(?: \+\d+ lines)?|Image #\d+|Document #\d+)\]$/;
|
|
42948
|
-
var PASTE_CHIP_CHARS = 800;
|
|
42949
|
-
function pasteChipLines(rows) {
|
|
42950
|
-
return Math.min(rows - 10, 2);
|
|
42951
|
-
}
|
|
42952
|
-
__name(pasteChipLines, "pasteChipLines");
|
|
42953
|
-
function isChipPaste(text, rows) {
|
|
42954
|
-
let newlines2 = 0;
|
|
42955
|
-
for (let i = 0; i < text.length; i += 1) if (text.charCodeAt(i) === 10) newlines2 += 1;
|
|
42956
|
-
return text.length > PASTE_CHIP_CHARS || newlines2 > pasteChipLines(rows);
|
|
42957
|
-
}
|
|
42958
|
-
__name(isChipPaste, "isChipPaste");
|
|
42959
|
-
function pasteChip(id, text) {
|
|
42960
|
-
let newlines2 = 0;
|
|
42961
|
-
for (let i = 0; i < text.length; i += 1) if (text.charCodeAt(i) === 10) newlines2 += 1;
|
|
42962
|
-
return newlines2 > 0 ? `[Pasted text #${id} +${newlines2} lines]` : `[Pasted text #${id}]`;
|
|
42963
|
-
}
|
|
42964
|
-
__name(pasteChip, "pasteChip");
|
|
42965
|
-
function attachmentChip(kind, id) {
|
|
42966
|
-
return `[${kind} #${id}]`;
|
|
42967
|
-
}
|
|
42968
|
-
__name(attachmentChip, "attachmentChip");
|
|
42969
|
-
function expandChips(value, pastes) {
|
|
42970
|
-
return value.replace(PASTE_CHIP, (chip, id) => pastes.get(Number(id)) ?? chip);
|
|
42971
|
-
}
|
|
42972
|
-
__name(expandChips, "expandChips");
|
|
42973
|
-
function chipBefore(value, cursor) {
|
|
42974
|
-
const match = ANY_CHIP.exec(value.slice(0, cursor));
|
|
42975
|
-
return match ? { start: match.index, chip: match[0] } : null;
|
|
42976
|
-
}
|
|
42977
|
-
__name(chipBefore, "chipBefore");
|
|
42978
|
-
function stripAttachmentChips(value) {
|
|
42979
|
-
return value.replace(/ ?\[(?:Image|Document) #\d+\]/g, "");
|
|
42980
|
-
}
|
|
42981
|
-
__name(stripAttachmentChips, "stripAttachmentChips");
|
|
42982
|
-
|
|
42983
43213
|
// src/tui/triggers/copy.ts
|
|
42984
43214
|
function cap(label) {
|
|
42985
43215
|
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
@@ -44048,7 +44278,7 @@ function renderSegments(segments) {
|
|
|
44048
44278
|
(segment, index) => segment.style ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
44049
44279
|
Text,
|
|
44050
44280
|
{
|
|
44051
|
-
color: segment.style === "armed" ? theme.accent.trigger : theme.status.warn,
|
|
44281
|
+
color: segment.style === "chip" ? theme.accent.system : segment.style === "armed" ? theme.accent.trigger : theme.status.warn,
|
|
44052
44282
|
bold: segment.style === "armed",
|
|
44053
44283
|
underline: segment.style === "armed",
|
|
44054
44284
|
children: segment.text
|
|
@@ -44229,6 +44459,7 @@ function deleteNextWordAt(source, cursor) {
|
|
|
44229
44459
|
}
|
|
44230
44460
|
__name(deleteNextWordAt, "deleteNextWordAt");
|
|
44231
44461
|
function Composer({
|
|
44462
|
+
attachmentFloor = 0,
|
|
44232
44463
|
disabled = false,
|
|
44233
44464
|
plainText = false,
|
|
44234
44465
|
mayReadImage,
|
|
@@ -44301,21 +44532,35 @@ function Composer({
|
|
|
44301
44532
|
const [attachments, setAttachments] = (0, import_react42.useState)([]);
|
|
44302
44533
|
const attachmentsRef = (0, import_react42.useRef)([]);
|
|
44303
44534
|
const attachmentIdsRef = (0, import_react42.useRef)(/* @__PURE__ */ new WeakMap());
|
|
44304
|
-
const
|
|
44535
|
+
const attachmentHighRef = (0, import_react42.useRef)(attachmentFloor);
|
|
44536
|
+
const attachmentFloorRef = (0, import_react42.useRef)(attachmentFloor);
|
|
44305
44537
|
const idFor = (0, import_react42.useCallback)((attachment) => {
|
|
44306
44538
|
let id = attachmentIdsRef.current.get(attachment);
|
|
44307
44539
|
if (id === void 0) {
|
|
44308
|
-
id =
|
|
44309
|
-
|
|
44540
|
+
id = Math.max(attachmentHighRef.current, attachmentFloorRef.current) + 1;
|
|
44541
|
+
attachmentHighRef.current = id;
|
|
44310
44542
|
attachmentIdsRef.current.set(attachment, id);
|
|
44311
44543
|
}
|
|
44312
44544
|
return id;
|
|
44313
44545
|
}, []);
|
|
44546
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
44547
|
+
const before = attachmentFloorRef.current;
|
|
44548
|
+
attachmentFloorRef.current = attachmentFloor;
|
|
44549
|
+
if (attachmentFloor >= before) {
|
|
44550
|
+
attachmentHighRef.current = Math.max(attachmentHighRef.current, attachmentFloor);
|
|
44551
|
+
return;
|
|
44552
|
+
}
|
|
44553
|
+
let high = attachmentFloor;
|
|
44554
|
+
for (const attachment of attachmentsRef.current) {
|
|
44555
|
+
const id = attachmentIdsRef.current.get(attachment);
|
|
44556
|
+
if (id !== void 0) high = Math.max(high, id);
|
|
44557
|
+
}
|
|
44558
|
+
attachmentHighRef.current = high;
|
|
44559
|
+
}, [attachmentFloor]);
|
|
44314
44560
|
const replaceAttachments = (0, import_react42.useCallback)(
|
|
44315
44561
|
(next) => {
|
|
44316
44562
|
const resolved = typeof next === "function" ? next(attachmentsRef.current) : next;
|
|
44317
44563
|
attachmentsRef.current = resolved;
|
|
44318
|
-
if (resolved.length === 0) nextAttachmentIdRef.current = 1;
|
|
44319
44564
|
setAttachments(resolved);
|
|
44320
44565
|
},
|
|
44321
44566
|
[]
|
|
@@ -44445,22 +44690,59 @@ function Composer({
|
|
|
44445
44690
|
else if (nearest.state === "suggested") setOverride(nearest, "armed");
|
|
44446
44691
|
else setOverride(nearest, "dropped");
|
|
44447
44692
|
}, "toggleNearestTrigger");
|
|
44693
|
+
const chipsNow = (0, import_react42.useCallback)(
|
|
44694
|
+
() => chipRanges(valueRef.current, {
|
|
44695
|
+
attachments: new Set(
|
|
44696
|
+
attachmentsRef.current.map((attachment) => chipFor(attachment, idFor(attachment)))
|
|
44697
|
+
),
|
|
44698
|
+
pastes: new Set(pasteStoreRef.current.keys())
|
|
44699
|
+
}),
|
|
44700
|
+
[idFor]
|
|
44701
|
+
);
|
|
44702
|
+
const placeCursor = /* @__PURE__ */ __name((position, bias) => {
|
|
44703
|
+
const at = snapOutOfChip(chipsNow(), position, bias);
|
|
44704
|
+
cursorRef.current = at;
|
|
44705
|
+
setCursorState(at);
|
|
44706
|
+
}, "placeCursor");
|
|
44707
|
+
const wholeRange = /* @__PURE__ */ __name((start, end) => widenOverChips(chipsNow(), start, end), "wholeRange");
|
|
44448
44708
|
const undoRef = (0, import_react42.useRef)(createUndoStack());
|
|
44449
44709
|
const stashRef = (0, import_react42.useRef)(null);
|
|
44450
44710
|
const recordUndo = (0, import_react42.useCallback)((after, typed) => {
|
|
44451
44711
|
undoRef.current.record(
|
|
44452
|
-
{
|
|
44712
|
+
{
|
|
44713
|
+
value: valueRef.current,
|
|
44714
|
+
cursor: cursorRef.current,
|
|
44715
|
+
spans: spansRef.current,
|
|
44716
|
+
attachments: attachmentsRef.current
|
|
44717
|
+
},
|
|
44453
44718
|
after,
|
|
44454
44719
|
typed
|
|
44455
44720
|
);
|
|
44456
44721
|
}, []);
|
|
44457
44722
|
const editBuffer = (0, import_react42.useCallback)(
|
|
44458
|
-
(
|
|
44723
|
+
(initialValue, initialCursor = initialValue.length, origin = "typed") => {
|
|
44724
|
+
let nextValue = initialValue;
|
|
44725
|
+
let nextCursor = initialCursor;
|
|
44459
44726
|
verticalColumnRef.current = null;
|
|
44460
44727
|
historyDraftRef.current = null;
|
|
44461
44728
|
setHistorySearch(null);
|
|
44462
44729
|
setHistoryIndex(-1);
|
|
44463
|
-
|
|
44730
|
+
let edit = diffEdit(valueRef.current, nextValue, cursorRef.current);
|
|
44731
|
+
const chips = chipsNow();
|
|
44732
|
+
if (chips.length > 0) {
|
|
44733
|
+
const whole = keepChipsWhole(
|
|
44734
|
+
valueRef.current,
|
|
44735
|
+
chips,
|
|
44736
|
+
edit,
|
|
44737
|
+
nextValue.slice(edit.start, edit.start + edit.insertLength),
|
|
44738
|
+
nextCursor
|
|
44739
|
+
);
|
|
44740
|
+
if (whole.value !== nextValue) {
|
|
44741
|
+
nextValue = whole.value;
|
|
44742
|
+
nextCursor = whole.cursor;
|
|
44743
|
+
edit = diffEdit(valueRef.current, nextValue, cursorRef.current);
|
|
44744
|
+
}
|
|
44745
|
+
}
|
|
44464
44746
|
const inserted = nextValue.slice(edit.start, edit.start + edit.insertLength);
|
|
44465
44747
|
recordUndo(
|
|
44466
44748
|
nextValue,
|
|
@@ -44471,7 +44753,7 @@ function Composer({
|
|
|
44471
44753
|
setBuffer(nextValue, nextCursor, origin, spans);
|
|
44472
44754
|
overridesRef.current = overrides;
|
|
44473
44755
|
},
|
|
44474
|
-
[recordUndo, setBuffer, setHistoryIndex, setHistorySearch]
|
|
44756
|
+
[chipsNow, recordUndo, setBuffer, setHistoryIndex, setHistorySearch]
|
|
44475
44757
|
);
|
|
44476
44758
|
const reset = (0, import_react42.useCallback)(() => {
|
|
44477
44759
|
undoRef.current.clear();
|
|
@@ -44499,13 +44781,22 @@ function Composer({
|
|
|
44499
44781
|
(draft) => {
|
|
44500
44782
|
let restoredText = draft.text;
|
|
44501
44783
|
const restoredAttachments = draft.attachments ? [...draft.attachments] : [];
|
|
44502
|
-
nextAttachmentIdRef.current = 1;
|
|
44503
44784
|
attachmentIdsRef.current = /* @__PURE__ */ new WeakMap();
|
|
44504
|
-
|
|
44505
|
-
|
|
44506
|
-
|
|
44507
|
-
|
|
44508
|
-
|
|
44785
|
+
const numbers = numberAttachments(
|
|
44786
|
+
draft.text,
|
|
44787
|
+
restoredAttachments.map(
|
|
44788
|
+
(attachment) => isDocumentLike(attachment) ? "Document" : "Image"
|
|
44789
|
+
),
|
|
44790
|
+
Math.max(attachmentFloorRef.current, attachmentHighRef.current)
|
|
44791
|
+
);
|
|
44792
|
+
restoredAttachments.forEach((attachment, index) => {
|
|
44793
|
+
const number = numbers[index];
|
|
44794
|
+
attachmentIdsRef.current.set(attachment, number);
|
|
44795
|
+
attachmentHighRef.current = Math.max(attachmentHighRef.current, number);
|
|
44796
|
+
});
|
|
44797
|
+
const missing = restoredAttachments.map((attachment) => chipFor(attachment, idFor(attachment))).filter((chip) => !restoredText.includes(chip));
|
|
44798
|
+
if (missing.length > 0)
|
|
44799
|
+
restoredText = `${missing.join(" ")}${restoredText ? " " : ""}${restoredText}`;
|
|
44509
44800
|
clearPastes();
|
|
44510
44801
|
setBuffer(restoredText, restoredText.length, "restored");
|
|
44511
44802
|
if (triggers && draft.triggers?.length) {
|
|
@@ -44568,7 +44859,8 @@ function Composer({
|
|
|
44568
44859
|
let value2 = valueRef.current;
|
|
44569
44860
|
let position = cursorRef.current;
|
|
44570
44861
|
for (const image2 of images) {
|
|
44571
|
-
const
|
|
44862
|
+
const apart = position > 0 && !/\s/u.test(value2.charAt(position - 1));
|
|
44863
|
+
const chip = `${apart ? " " : ""}${chipFor(image2, idFor(image2))}`;
|
|
44572
44864
|
value2 = value2.slice(0, position) + chip + value2.slice(position);
|
|
44573
44865
|
position += chip.length;
|
|
44574
44866
|
}
|
|
@@ -44804,13 +45096,15 @@ function Composer({
|
|
|
44804
45096
|
}
|
|
44805
45097
|
const submit = /* @__PURE__ */ __name((mode) => {
|
|
44806
45098
|
const pastes = pasteStoreRef.current;
|
|
44807
|
-
const toMessage = /* @__PURE__ */ __name((draft) => expandChips(
|
|
45099
|
+
const toMessage = /* @__PURE__ */ __name((draft) => expandChips(draft, pastes), "toMessage");
|
|
44808
45100
|
const message = toMessage(valueRef.current).trim();
|
|
44809
45101
|
const currentAttachments = attachmentsRef.current.filter(
|
|
44810
45102
|
(attachment) => valueRef.current.includes(chipFor(attachment, idFor(attachment)))
|
|
44811
45103
|
);
|
|
44812
45104
|
if (message.length === 0 && currentAttachments.length === 0) return false;
|
|
44813
45105
|
const submittedAttachments = currentAttachments.length > 0 ? currentAttachments : void 0;
|
|
45106
|
+
for (const attachment of currentAttachments)
|
|
45107
|
+
noteAttachmentNumber(attachment, idFor(attachment));
|
|
44814
45108
|
const detection2 = detect(valueRef.current);
|
|
44815
45109
|
const whole = toMessage(valueRef.current);
|
|
44816
45110
|
const lead = whole.length - whole.trimStart().length;
|
|
@@ -44854,11 +45148,12 @@ function Composer({
|
|
|
44854
45148
|
setHistorySearch(null);
|
|
44855
45149
|
setHistoryIndex(-1);
|
|
44856
45150
|
setSelectedIndex(0);
|
|
45151
|
+
if (previous.attachments) replaceAttachments(previous.attachments);
|
|
44857
45152
|
setBuffer(previous.value, previous.cursor, "typed", previous.spans);
|
|
44858
45153
|
return;
|
|
44859
45154
|
}
|
|
44860
45155
|
const typedDraft = /* @__PURE__ */ __name(() => {
|
|
44861
|
-
const text = expandChips(
|
|
45156
|
+
const text = expandChips(valueRef.current, pasteStoreRef.current);
|
|
44862
45157
|
if (text.trim().length === 0 && attachmentsRef.current.length === 0) return void 0;
|
|
44863
45158
|
return {
|
|
44864
45159
|
text,
|
|
@@ -44887,7 +45182,7 @@ function Composer({
|
|
|
44887
45182
|
restoreDraft(stashed);
|
|
44888
45183
|
return;
|
|
44889
45184
|
}
|
|
44890
|
-
const draft = expandChips(
|
|
45185
|
+
const draft = expandChips(valueRef.current, pasteStoreRef.current);
|
|
44891
45186
|
const earlier = stashRef.current;
|
|
44892
45187
|
stashRef.current = {
|
|
44893
45188
|
text: draft,
|
|
@@ -44978,7 +45273,7 @@ function Composer({
|
|
|
44978
45273
|
clearTimeout(clearArmRef.current);
|
|
44979
45274
|
clearArmRef.current = null;
|
|
44980
45275
|
onFooterNoticeRemove?.(ESC_CLEAR_KEY);
|
|
44981
|
-
const cleared = expandChips(
|
|
45276
|
+
const cleared = expandChips(valueRef.current, pasteStoreRef.current);
|
|
44982
45277
|
if (cleared.trim().length > 0) onClearedDraft?.(cleared);
|
|
44983
45278
|
reset();
|
|
44984
45279
|
return;
|
|
@@ -44999,7 +45294,7 @@ function Composer({
|
|
|
44999
45294
|
if (isAction("edit:deleteWordBack", input, key) && key.backspace) {
|
|
45000
45295
|
const source = valueRef.current;
|
|
45001
45296
|
const position2 = cursorRef.current;
|
|
45002
|
-
const start = previousWordBoundary(source, position2);
|
|
45297
|
+
const [start] = wholeRange(previousWordBoundary(source, position2), position2);
|
|
45003
45298
|
if (start < position2) killBufferRef.current = source.slice(start, position2);
|
|
45004
45299
|
const result = deletePreviousWordAt(valueRef.current, cursorRef.current);
|
|
45005
45300
|
editBuffer(result.value, result.cursor);
|
|
@@ -45007,12 +45302,8 @@ function Composer({
|
|
|
45007
45302
|
}
|
|
45008
45303
|
if (key.backspace) {
|
|
45009
45304
|
const position2 = cursorRef.current;
|
|
45010
|
-
const chip =
|
|
45305
|
+
const chip = chipsNow().find((range) => range.end === position2);
|
|
45011
45306
|
if (chip) {
|
|
45012
|
-
const gone = attachmentsRef.current.findIndex(
|
|
45013
|
-
(attachment) => chipFor(attachment, idFor(attachment)) === chip.chip
|
|
45014
|
-
);
|
|
45015
|
-
if (gone >= 0) replaceAttachments((p) => p.filter((_, index) => index !== gone));
|
|
45016
45307
|
editBuffer(
|
|
45017
45308
|
valueRef.current.slice(0, chip.start) + valueRef.current.slice(position2),
|
|
45018
45309
|
chip.start
|
|
@@ -45038,16 +45329,12 @@ function Composer({
|
|
|
45038
45329
|
}
|
|
45039
45330
|
if (isAction("edit:wordLeft", input, key)) {
|
|
45040
45331
|
verticalColumnRef.current = null;
|
|
45041
|
-
|
|
45042
|
-
cursorRef.current = previous;
|
|
45043
|
-
setCursorState(previous);
|
|
45332
|
+
placeCursor(previousWordBoundary(valueRef.current, cursorRef.current), -1);
|
|
45044
45333
|
return;
|
|
45045
45334
|
}
|
|
45046
45335
|
if (isAction("edit:wordRight", input, key)) {
|
|
45047
45336
|
verticalColumnRef.current = null;
|
|
45048
|
-
|
|
45049
|
-
cursorRef.current = next;
|
|
45050
|
-
setCursorState(next);
|
|
45337
|
+
placeCursor(nextWordBoundary(valueRef.current, cursorRef.current), 1);
|
|
45051
45338
|
return;
|
|
45052
45339
|
}
|
|
45053
45340
|
if (key.leftArrow && onOpenWorkspaces) {
|
|
@@ -45079,16 +45366,12 @@ function Composer({
|
|
|
45079
45366
|
}
|
|
45080
45367
|
if (isAction("edit:charLeft", input, key)) {
|
|
45081
45368
|
verticalColumnRef.current = null;
|
|
45082
|
-
|
|
45083
|
-
cursorRef.current = previous;
|
|
45084
|
-
setCursorState(previous);
|
|
45369
|
+
placeCursor(previousGraphemeBoundary(valueRef.current, cursorRef.current), -1);
|
|
45085
45370
|
return;
|
|
45086
45371
|
}
|
|
45087
45372
|
if (isAction("edit:charRight", input, key)) {
|
|
45088
45373
|
verticalColumnRef.current = null;
|
|
45089
|
-
|
|
45090
|
-
cursorRef.current = next;
|
|
45091
|
-
setCursorState(next);
|
|
45374
|
+
placeCursor(nextGraphemeBoundary(valueRef.current, cursorRef.current), 1);
|
|
45092
45375
|
return;
|
|
45093
45376
|
}
|
|
45094
45377
|
if (key.pageUp && !hasLiveSuggestions && onScrollTranscript) {
|
|
@@ -45105,16 +45388,12 @@ function Composer({
|
|
|
45105
45388
|
}
|
|
45106
45389
|
if (isAction("edit:lineStart", input, key)) {
|
|
45107
45390
|
verticalColumnRef.current = null;
|
|
45108
|
-
|
|
45109
|
-
cursorRef.current = start;
|
|
45110
|
-
setCursorState(start);
|
|
45391
|
+
placeCursor(lineStart(valueRef.current, cursorRef.current), -1);
|
|
45111
45392
|
return;
|
|
45112
45393
|
}
|
|
45113
45394
|
if (isAction("edit:lineEnd", input, key)) {
|
|
45114
45395
|
verticalColumnRef.current = null;
|
|
45115
|
-
|
|
45116
|
-
cursorRef.current = end;
|
|
45117
|
-
setCursorState(end);
|
|
45396
|
+
placeCursor(lineEnd(valueRef.current, cursorRef.current), 1);
|
|
45118
45397
|
return;
|
|
45119
45398
|
}
|
|
45120
45399
|
if (isAction("edit:linePrevious", input, key)) {
|
|
@@ -45130,8 +45409,7 @@ function Composer({
|
|
|
45130
45409
|
);
|
|
45131
45410
|
if (vertical) {
|
|
45132
45411
|
verticalColumnRef.current = vertical.column;
|
|
45133
|
-
|
|
45134
|
-
setCursorState(vertical.cursor);
|
|
45412
|
+
placeCursor(vertical.cursor, -1);
|
|
45135
45413
|
return;
|
|
45136
45414
|
}
|
|
45137
45415
|
verticalColumnRef.current = null;
|
|
@@ -45161,8 +45439,7 @@ function Composer({
|
|
|
45161
45439
|
);
|
|
45162
45440
|
if (vertical) {
|
|
45163
45441
|
verticalColumnRef.current = vertical.column;
|
|
45164
|
-
|
|
45165
|
-
setCursorState(vertical.cursor);
|
|
45442
|
+
placeCursor(vertical.cursor, 1);
|
|
45166
45443
|
return;
|
|
45167
45444
|
}
|
|
45168
45445
|
verticalColumnRef.current = null;
|
|
@@ -45201,7 +45478,7 @@ function Composer({
|
|
|
45201
45478
|
if (isAction("edit:deleteWordBack", input, key)) {
|
|
45202
45479
|
const source = valueRef.current;
|
|
45203
45480
|
const position2 = cursorRef.current;
|
|
45204
|
-
const start = previousWordBoundary(source, position2);
|
|
45481
|
+
const [start] = wholeRange(previousWordBoundary(source, position2), position2);
|
|
45205
45482
|
if (start < position2) killBufferRef.current = source.slice(start, position2);
|
|
45206
45483
|
const result = deletePreviousWordAt(valueRef.current, cursorRef.current);
|
|
45207
45484
|
editBuffer(result.value, result.cursor);
|
|
@@ -45209,14 +45486,14 @@ function Composer({
|
|
|
45209
45486
|
}
|
|
45210
45487
|
if (isAction("edit:deleteToLineStart", input, key)) {
|
|
45211
45488
|
const position2 = cursorRef.current;
|
|
45212
|
-
const start = lineStart(valueRef.current, position2);
|
|
45489
|
+
const [start] = wholeRange(lineStart(valueRef.current, position2), position2);
|
|
45213
45490
|
if (start < position2) killBufferRef.current = valueRef.current.slice(start, position2);
|
|
45214
45491
|
editBuffer(valueRef.current.slice(0, start) + valueRef.current.slice(position2), start);
|
|
45215
45492
|
return;
|
|
45216
45493
|
}
|
|
45217
45494
|
if (isAction("edit:deleteToLineEnd", input, key)) {
|
|
45218
45495
|
const position2 = cursorRef.current;
|
|
45219
|
-
const end = lineEnd(valueRef.current, position2);
|
|
45496
|
+
const [, end] = wholeRange(position2, lineEnd(valueRef.current, position2));
|
|
45220
45497
|
if (position2 < end) killBufferRef.current = valueRef.current.slice(position2, end);
|
|
45221
45498
|
editBuffer(valueRef.current.slice(0, position2) + valueRef.current.slice(end), position2);
|
|
45222
45499
|
return;
|
|
@@ -45224,7 +45501,7 @@ function Composer({
|
|
|
45224
45501
|
if (isAction("edit:deleteWordForward", input, key)) {
|
|
45225
45502
|
const source = valueRef.current;
|
|
45226
45503
|
const position2 = cursorRef.current;
|
|
45227
|
-
const end = nextWordBoundary(source, position2);
|
|
45504
|
+
const [, end] = wholeRange(position2, nextWordBoundary(source, position2));
|
|
45228
45505
|
if (position2 < end) killBufferRef.current = source.slice(position2, end);
|
|
45229
45506
|
const result = deleteNextWordAt(valueRef.current, cursorRef.current);
|
|
45230
45507
|
editBuffer(result.value, result.cursor);
|
|
@@ -45293,9 +45570,12 @@ function Composer({
|
|
|
45293
45570
|
highestEffort: triggers.highestEffort,
|
|
45294
45571
|
standaloneAllowed: attachments.length === 0
|
|
45295
45572
|
}) : null;
|
|
45296
|
-
const styledSpans =
|
|
45297
|
-
|
|
45298
|
-
|
|
45573
|
+
const styledSpans = [
|
|
45574
|
+
...detection.hits.flatMap(
|
|
45575
|
+
(hit) => hit.state === "armed" || hit.state === "unavailable" ? [{ start: hit.start, end: hit.end, style: hit.state }] : []
|
|
45576
|
+
),
|
|
45577
|
+
...chipsNow().map((chip) => ({ start: chip.start, end: chip.end, style: "chip" }))
|
|
45578
|
+
].sort((a, b) => a.start - b.start);
|
|
45299
45579
|
const beforeSegments = displaySegments(value, displayValue.start, cursor, styledSpans);
|
|
45300
45580
|
const afterSegments = displaySegments(value, cursor, displayValue.end, styledSpans);
|
|
45301
45581
|
const promptGlyph = disabled && !railFocused ? "\u2026" : "\u276F";
|
|
@@ -45407,10 +45687,13 @@ function Composer({
|
|
|
45407
45687
|
}
|
|
45408
45688
|
__name(Composer, "Composer");
|
|
45409
45689
|
function chipFor(attachment, id) {
|
|
45410
|
-
|
|
45411
|
-
return attachmentChip(isDocument ? "Document" : "Image", id);
|
|
45690
|
+
return attachmentChip(isDocumentLike(attachment) ? "Document" : "Image", id);
|
|
45412
45691
|
}
|
|
45413
45692
|
__name(chipFor, "chipFor");
|
|
45693
|
+
function isDocumentLike(attachment) {
|
|
45694
|
+
return attachment.type === "document" || attachment.type === "stored" && attachment.kind !== "image";
|
|
45695
|
+
}
|
|
45696
|
+
__name(isDocumentLike, "isDocumentLike");
|
|
45414
45697
|
|
|
45415
45698
|
// src/tui/ComposerFrame.tsx
|
|
45416
45699
|
var import_react43 = __toESM(require_react(), 1);
|
|
@@ -49843,6 +50126,7 @@ var import_react51 = __toESM(require_react(), 1);
|
|
|
49843
50126
|
|
|
49844
50127
|
// src/tui/transcript-scroll.ts
|
|
49845
50128
|
var GUTTER = 2;
|
|
50129
|
+
var COMMAND_HANG = 3;
|
|
49846
50130
|
function transcriptScrollRows(messages, pending, pendingAt, columns) {
|
|
49847
50131
|
const at = Math.min(Math.max(pendingAt ?? messages.length, 0), messages.length);
|
|
49848
50132
|
const ordered = pending ? [...messages.slice(0, at), pending, ...messages.slice(at)] : messages;
|
|
@@ -49860,33 +50144,62 @@ function scrollTextWidth(columns) {
|
|
|
49860
50144
|
return Math.max(4, Math.floor(columns) - GUTTER);
|
|
49861
50145
|
}
|
|
49862
50146
|
__name(scrollTextWidth, "scrollTextWidth");
|
|
49863
|
-
function scrollBodyText(message) {
|
|
49864
|
-
return message.statusRows ? message.statusRows.map(([label, value]) => `${label} ${value}`).join("\n") : `${message.content.length > 0 ? message.content : message.pending ? "\u2026" : ""}${message.meta ? ` \xB7 ${terminalDisplayText(message.meta)}` : ""}`;
|
|
50147
|
+
function scrollBodyText(message, hint) {
|
|
50148
|
+
return message.statusRows ? message.statusRows.map(([label, value]) => `${label} ${value}`).join("\n") : `${message.content.length > 0 ? message.content : message.pending ? "\u2026" : ""}${message.meta ? ` \xB7 ${saying(terminalDisplayText(message.meta), hint)}` : ""}`;
|
|
49865
50149
|
}
|
|
49866
50150
|
__name(scrollBodyText, "scrollBodyText");
|
|
49867
|
-
function
|
|
50151
|
+
function saying(meta, hint) {
|
|
50152
|
+
if (hint === void 0 || !meta.endsWith(EXPAND_HINT)) return meta;
|
|
50153
|
+
return `${meta.slice(0, -EXPAND_HINT.length)}${hint}`;
|
|
50154
|
+
}
|
|
50155
|
+
__name(saying, "saying");
|
|
50156
|
+
function messageScrollRows(message, hasPrev, width, options = {}) {
|
|
49868
50157
|
const glyph = message.glyph ?? glyphForRole(message.role);
|
|
49869
50158
|
const glyphColor = paint(message.glyphColor) ?? (glyph === "\u23BF" ? theme.text.muted : glyphColorForRole(message.role));
|
|
49870
50159
|
const color = paint(message.contentColor) ?? contentColorForRole(message.role);
|
|
49871
|
-
const joined = scrollBodyText(message);
|
|
50160
|
+
const joined = scrollBodyText(message, options.hint);
|
|
49872
50161
|
const body = wrapChoiceText(joined, width);
|
|
49873
|
-
const
|
|
49874
|
-
(
|
|
50162
|
+
const attachmentRows2 = message.statusRows ? [] : (message.attachments ?? []).map(
|
|
50163
|
+
(row2) => truncateChoiceText(terminalDisplayText(attachmentLine(row2)), width + GUTTER)
|
|
49875
50164
|
);
|
|
50165
|
+
const plainLines = message.statusRows ? [] : renderedDetailLines(message);
|
|
50166
|
+
const wordedLines = message.statusRows || options.hint === void 0 ? plainLines : renderedDetailLines(message, void 0, options.hint);
|
|
50167
|
+
const detail = message.statusRows ? [] : [
|
|
50168
|
+
...attachmentRows2.map((text) => ({ text, hint: false })),
|
|
50169
|
+
...wordedLines.flatMap(
|
|
50170
|
+
(line, i) => wrapChoiceText(line.length > 0 ? line : " ", width + GUTTER).map((text) => ({
|
|
50171
|
+
text,
|
|
50172
|
+
hint: line !== plainLines[i]
|
|
50173
|
+
}))
|
|
50174
|
+
)
|
|
50175
|
+
];
|
|
50176
|
+
const hinted = (message.meta?.endsWith(EXPAND_HINT) ?? false) || detail.some((line) => line.hint);
|
|
49876
50177
|
const rows = [];
|
|
49877
50178
|
body.forEach((text, i) => {
|
|
49878
50179
|
rows.push({ glyph: i === 0 ? glyph : " ", glyphColor, text, color });
|
|
49879
50180
|
});
|
|
49880
|
-
|
|
50181
|
+
if (message.group && message.shell === void 0 && !message.detailExpanded) {
|
|
50182
|
+
commandRows(message.group, width - COMMAND_HANG).forEach((line, i) => {
|
|
50183
|
+
rows.push({
|
|
50184
|
+
glyph: " ",
|
|
50185
|
+
glyphColor,
|
|
50186
|
+
text: `${i === 0 ? "\u23BF" : " "} ${terminalDisplayText(line)}`,
|
|
50187
|
+
color: theme.text.muted,
|
|
50188
|
+
command: true
|
|
50189
|
+
});
|
|
50190
|
+
});
|
|
50191
|
+
}
|
|
50192
|
+
for (const { text, hint } of detail) {
|
|
49881
50193
|
rows.push({
|
|
49882
50194
|
glyph: " ",
|
|
49883
50195
|
glyphColor,
|
|
49884
50196
|
text: text.trimStart() ? text : "",
|
|
49885
|
-
color: theme.text.muted
|
|
50197
|
+
color: theme.text.muted,
|
|
50198
|
+
...hint ? { hint: true } : {}
|
|
49886
50199
|
});
|
|
49887
50200
|
}
|
|
49888
50201
|
const wantsGap = hasPrev && glyph !== "\u23BF";
|
|
49889
|
-
return { gap: wantsGap ? { glyph: " ", glyphColor, text: "", color } : null, rows };
|
|
50202
|
+
return { hinted, gap: wantsGap ? { glyph: " ", glyphColor, text: "", color } : null, rows };
|
|
49890
50203
|
}
|
|
49891
50204
|
__name(messageScrollRows, "messageScrollRows");
|
|
49892
50205
|
function lastTop(total, height) {
|
|
@@ -51230,7 +51543,7 @@ __name(editablePrompts, "editablePrompts");
|
|
|
51230
51543
|
// src/tui/external-editor.ts
|
|
51231
51544
|
import { spawn as spawn4 } from "node:child_process";
|
|
51232
51545
|
import { lstat, mkdtemp, readFile as readFile4, rm as rm2, writeFile } from "node:fs/promises";
|
|
51233
|
-
import { join as
|
|
51546
|
+
import { join as join6 } from "node:path";
|
|
51234
51547
|
var MAX_EDITED_DRAFT_BYTES = 4 * 1024 * 1024;
|
|
51235
51548
|
var ExternalEditorError = class extends Error {
|
|
51236
51549
|
static {
|
|
@@ -51316,8 +51629,8 @@ __name(resolveExternalEditorCommand, "resolveExternalEditorCommand");
|
|
|
51316
51629
|
async function editDraftInExternalEditor(seed, options) {
|
|
51317
51630
|
options.signal?.throwIfAborted();
|
|
51318
51631
|
const command = resolveExternalEditorCommand(options.env, options.pressed);
|
|
51319
|
-
const directory = options.temporaryRoot === void 0 ? await createTempDir("editor-") : await mkdtemp(
|
|
51320
|
-
const draftPath =
|
|
51632
|
+
const directory = options.temporaryRoot === void 0 ? await createTempDir("editor-") : await mkdtemp(join6(options.temporaryRoot, "namzu-editor-"));
|
|
51633
|
+
const draftPath = join6(directory, "draft.md");
|
|
51321
51634
|
let edited;
|
|
51322
51635
|
let failure;
|
|
51323
51636
|
try {
|
|
@@ -51400,7 +51713,7 @@ async function fastModeBlocker(providerId, model, now = Date.now(), otherHost =
|
|
|
51400
51713
|
return `Fast mode is offered on the vendor's own endpoint only, and requests here go to ${otherHost}.`;
|
|
51401
51714
|
}
|
|
51402
51715
|
if (!model) return "Fast mode needs a model; pick one with /model.";
|
|
51403
|
-
const { resolveFastModeVerdict } = await import("./dist-
|
|
51716
|
+
const { resolveFastModeVerdict } = await import("./dist-JTKWJRF3.js");
|
|
51404
51717
|
const verdict = resolveFastModeVerdict(model, now);
|
|
51405
51718
|
return verdict.ok ? void 0 : verdict.reason;
|
|
51406
51719
|
}
|
|
@@ -51632,6 +51945,16 @@ function stateAt(index, row2, height) {
|
|
|
51632
51945
|
return { follow: false, anchor: anchorAt(index, bounded), seenTail: index.tail };
|
|
51633
51946
|
}
|
|
51634
51947
|
__name(stateAt, "stateAt");
|
|
51948
|
+
function heldState(index, row2) {
|
|
51949
|
+
if (row2 >= lastRow(index)) return FOLLOWING;
|
|
51950
|
+
return {
|
|
51951
|
+
follow: false,
|
|
51952
|
+
anchor: anchorAt(index, Math.max(0, row2)),
|
|
51953
|
+
seenTail: index.tail,
|
|
51954
|
+
held: true
|
|
51955
|
+
};
|
|
51956
|
+
}
|
|
51957
|
+
__name(heldState, "heldState");
|
|
51635
51958
|
function moveView(state, move, index, height, wheelRows = WHEEL_ROWS) {
|
|
51636
51959
|
if (index.total === 0) return FOLLOWING;
|
|
51637
51960
|
const bottom = bottomRow(state, index);
|
|
@@ -51655,6 +51978,8 @@ function moveView(state, move, index, height, wheelRows = WHEEL_ROWS) {
|
|
|
51655
51978
|
case "bottom":
|
|
51656
51979
|
return FOLLOWING;
|
|
51657
51980
|
}
|
|
51981
|
+
if (next < bottom && !state.follow && state.held === true && bottom < minBottom(index, height))
|
|
51982
|
+
return state;
|
|
51658
51983
|
const result = stateAt(index, next, height);
|
|
51659
51984
|
if (result.follow && state.follow) return state;
|
|
51660
51985
|
if (!result.follow && !state.follow && bottomRow(result, index) === bottom) return state;
|
|
@@ -51664,7 +51989,8 @@ __name(moveView, "moveView");
|
|
|
51664
51989
|
function syncView(state, index, height) {
|
|
51665
51990
|
if (state.follow) return state;
|
|
51666
51991
|
const bottom = bottomRow(state, index);
|
|
51667
|
-
const
|
|
51992
|
+
const held = state.held === true && bottom < minBottom(index, height);
|
|
51993
|
+
const next = held ? heldState(index, bottom) : stateAt(index, bottom, height);
|
|
51668
51994
|
if (next.follow) return next;
|
|
51669
51995
|
if (next.follow === false && state.anchor.id === next.anchor.id && state.anchor.offset === next.anchor.offset)
|
|
51670
51996
|
return state;
|
|
@@ -51702,6 +52028,24 @@ function revealRow(state, index, row2, height) {
|
|
|
51702
52028
|
return stateAt(index, row2 + Math.floor((h - 1) / 2), h);
|
|
51703
52029
|
}
|
|
51704
52030
|
__name(revealRow, "revealRow");
|
|
52031
|
+
function rowIn(index, id, offset) {
|
|
52032
|
+
const at = index.ids.indexOf(id);
|
|
52033
|
+
if (at < 0) return null;
|
|
52034
|
+
const start = index.starts[at] ?? 0;
|
|
52035
|
+
const end = (index.starts[at + 1] ?? index.total) - 1;
|
|
52036
|
+
return Math.min(start + Math.max(0, offset), Math.max(start, end));
|
|
52037
|
+
}
|
|
52038
|
+
__name(rowIn, "rowIn");
|
|
52039
|
+
function holdRow(state, before, after, id, offset, options) {
|
|
52040
|
+
const was = rowIn(before, id, offset);
|
|
52041
|
+
const now = rowIn(after, id, offset);
|
|
52042
|
+
if (was === null || now === null) return syncView(state, after, options.height);
|
|
52043
|
+
const below = bottomRow(state, before) - was + options.footer;
|
|
52044
|
+
const pinned = options.searching ? 1 : 0;
|
|
52045
|
+
if (now + below - pinned >= lastRow(after)) return FOLLOWING;
|
|
52046
|
+
return heldState(after, now + below - 1);
|
|
52047
|
+
}
|
|
52048
|
+
__name(holdRow, "holdRow");
|
|
51705
52049
|
|
|
51706
52050
|
// src/tui/fullscreen/layout.ts
|
|
51707
52051
|
function rendersMarkdown(message) {
|
|
@@ -51710,7 +52054,47 @@ function rendersMarkdown(message) {
|
|
|
51710
52054
|
message.meta === void 0 && message.contextView === void 0 && message.kind !== "recap" && !message.group;
|
|
51711
52055
|
}
|
|
51712
52056
|
__name(rendersMarkdown, "rendersMarkdown");
|
|
51713
|
-
|
|
52057
|
+
var PLAIN = { click: false, open: false };
|
|
52058
|
+
function openedMessage(message) {
|
|
52059
|
+
const shown = screenMessage(message);
|
|
52060
|
+
const meta = message.meta ?? "";
|
|
52061
|
+
const kept = (meta.endsWith(EXPAND_HINT) ? meta.slice(0, -EXPAND_HINT.length) : meta).replace(/[\s·]+$/u, "").trim();
|
|
52062
|
+
const fullHeader = message.shell?.fullHeader;
|
|
52063
|
+
return {
|
|
52064
|
+
...shown,
|
|
52065
|
+
...fullHeader !== void 0 ? { content: fullHeader } : {},
|
|
52066
|
+
meta: kept.length > 0 ? `${kept} \xB7 ${CLICK_FOLD_HINT}` : CLICK_FOLD_HINT
|
|
52067
|
+
};
|
|
52068
|
+
}
|
|
52069
|
+
__name(openedMessage, "openedMessage");
|
|
52070
|
+
function clickableRows(message, hasPrev, width, open) {
|
|
52071
|
+
if (message.role !== "tool" && message.role !== "system") return null;
|
|
52072
|
+
const closed = messageScrollRows(message, hasPrev, width, { hint: CLICK_EXPAND_HINT });
|
|
52073
|
+
if (!closed.hinted) return null;
|
|
52074
|
+
const shown = open ? openedMessage(message) : message;
|
|
52075
|
+
const hint = open ? void 0 : CLICK_EXPAND_HINT;
|
|
52076
|
+
const plain = open ? messageScrollRows(shown, hasPrev, width) : closed;
|
|
52077
|
+
const text = scrollBodyText(shown, hint);
|
|
52078
|
+
const body = wrapChoiceText(text, width).length;
|
|
52079
|
+
const joins = wrapJoiners(
|
|
52080
|
+
text,
|
|
52081
|
+
plain.rows.slice(0, body).map((r) => r.text)
|
|
52082
|
+
);
|
|
52083
|
+
return {
|
|
52084
|
+
gap: plain.gap ? plainRow(plain.gap) : null,
|
|
52085
|
+
rows: plain.rows.map((row2, i) => {
|
|
52086
|
+
const own = plainRow(row2, i < body ? joins[i] ?? null : null);
|
|
52087
|
+
const answers = i < body || !open && (row2.command === true || row2.hint === true);
|
|
52088
|
+
return answers ? { ...own, opens: true } : own;
|
|
52089
|
+
})
|
|
52090
|
+
};
|
|
52091
|
+
}
|
|
52092
|
+
__name(clickableRows, "clickableRows");
|
|
52093
|
+
function fullscreenMessageRows(message, hasPrev, width, mode = PLAIN) {
|
|
52094
|
+
if (mode.click) {
|
|
52095
|
+
const clickable = clickableRows(message, hasPrev, width, mode.open);
|
|
52096
|
+
if (clickable) return clickable;
|
|
52097
|
+
}
|
|
51714
52098
|
const plain = messageScrollRows(message, hasPrev, width);
|
|
51715
52099
|
const gap = plain.gap ? plainRow(plain.gap) : null;
|
|
51716
52100
|
const first = plain.rows[0];
|
|
@@ -51743,10 +52127,10 @@ function fullscreenMessageRows(message, hasPrev, width) {
|
|
|
51743
52127
|
}
|
|
51744
52128
|
__name(fullscreenMessageRows, "fullscreenMessageRows");
|
|
51745
52129
|
function createLayoutCache() {
|
|
51746
|
-
return /* @__PURE__ */ new WeakMap();
|
|
52130
|
+
return { kept: /* @__PURE__ */ new WeakMap(), laid: 0 };
|
|
51747
52131
|
}
|
|
51748
52132
|
__name(createLayoutCache, "createLayoutCache");
|
|
51749
|
-
function layoutTranscript(messages, pending, pendingAt, columns, cache3) {
|
|
52133
|
+
function layoutTranscript(messages, pending, pendingAt, columns, cache3, view = { click: false, open: /* @__PURE__ */ new Set() }) {
|
|
51750
52134
|
const at = Math.min(Math.max(pendingAt ?? messages.length, 0), messages.length);
|
|
51751
52135
|
const ordered = pending ? [...messages.slice(0, at), pending, ...messages.slice(at)] : messages;
|
|
51752
52136
|
const width = scrollTextWidth(columns);
|
|
@@ -51755,10 +52139,19 @@ function layoutTranscript(messages, pending, pendingAt, columns, cache3) {
|
|
|
51755
52139
|
const blocks = [];
|
|
51756
52140
|
ordered.forEach((message, i) => {
|
|
51757
52141
|
const hasPrev = i > 0;
|
|
51758
|
-
|
|
51759
|
-
|
|
51760
|
-
|
|
51761
|
-
|
|
52142
|
+
const mode = { click: view.click, open: view.click && view.open.has(message.id) };
|
|
52143
|
+
let hit = cache3.kept.get(message);
|
|
52144
|
+
if (!hit || hit.width !== width || hit.hasPrev !== hasPrev || hit.theme !== theme2 || hit.click !== mode.click || hit.open !== mode.open) {
|
|
52145
|
+
hit = {
|
|
52146
|
+
width,
|
|
52147
|
+
hasPrev,
|
|
52148
|
+
theme: theme2,
|
|
52149
|
+
click: mode.click,
|
|
52150
|
+
open: mode.open,
|
|
52151
|
+
block: fullscreenMessageRows(message, hasPrev, width, mode)
|
|
52152
|
+
};
|
|
52153
|
+
cache3.kept.set(message, hit);
|
|
52154
|
+
cache3.laid += 1;
|
|
51762
52155
|
}
|
|
51763
52156
|
const { gap, rows: own } = hit.block;
|
|
51764
52157
|
if (gap) rows.push(gap);
|
|
@@ -52048,10 +52441,22 @@ function FullscreenTranscript({
|
|
|
52048
52441
|
}) {
|
|
52049
52442
|
const cache3 = (0, import_react53.useRef)(createLayoutCache()).current;
|
|
52050
52443
|
const epoch = useThemeEpoch();
|
|
52444
|
+
const click = subscribePointer !== void 0;
|
|
52445
|
+
const [open, setOpen] = (0, import_react53.useState)(() => /* @__PURE__ */ new Set());
|
|
52446
|
+
const openRef = (0, import_react53.useRef)(open);
|
|
52051
52447
|
const { rows, index } = (0, import_react53.useMemo)(
|
|
52052
|
-
() => layoutTranscript(messages, pending, pendingAt, columns, cache3),
|
|
52053
|
-
[messages, pending, pendingAt, columns, cache3, epoch]
|
|
52448
|
+
() => layoutTranscript(messages, pending, pendingAt, columns, cache3, { click, open }),
|
|
52449
|
+
[messages, pending, pendingAt, columns, cache3, epoch, click, open]
|
|
52054
52450
|
);
|
|
52451
|
+
(0, import_react53.useEffect)(() => {
|
|
52452
|
+
if (open.size === 0) return;
|
|
52453
|
+
const present = new Set(index.ids);
|
|
52454
|
+
const kept = [...open].filter((id) => present.has(id));
|
|
52455
|
+
if (kept.length === open.size) return;
|
|
52456
|
+
const next = new Set(kept);
|
|
52457
|
+
openRef.current = next;
|
|
52458
|
+
setOpen(next);
|
|
52459
|
+
}, [open, index]);
|
|
52055
52460
|
const [view, setView] = (0, import_react53.useState)(FOLLOWING);
|
|
52056
52461
|
const boxRef = (0, import_react53.useRef)(null);
|
|
52057
52462
|
const roomRef = (0, import_react53.useRef)(maxRows);
|
|
@@ -52067,8 +52472,8 @@ function FullscreenTranscript({
|
|
|
52067
52472
|
(0, import_react53.useEffect)(() => {
|
|
52068
52473
|
if (synced !== view) setView(synced);
|
|
52069
52474
|
}, [synced, view]);
|
|
52070
|
-
const latest = (0, import_react53.useRef)({ synced, index, rows });
|
|
52071
|
-
latest.current = { synced, index, rows };
|
|
52475
|
+
const latest = (0, import_react53.useRef)({ synced, index, rows, messages, pending, pendingAt, columns });
|
|
52476
|
+
latest.current = { synced, index, rows, messages, pending, pendingAt, columns };
|
|
52072
52477
|
const scroll = (0, import_react53.useCallback)(
|
|
52073
52478
|
(move) => {
|
|
52074
52479
|
const { synced: state, index: now } = latest.current;
|
|
@@ -52137,6 +52542,28 @@ function FullscreenTranscript({
|
|
|
52137
52542
|
left: 1 + SCREEN_PADDING + GUTTER2,
|
|
52138
52543
|
cols: textWidth
|
|
52139
52544
|
});
|
|
52545
|
+
const toggleAt = (0, import_react53.useCallback)(
|
|
52546
|
+
(line) => {
|
|
52547
|
+
const now = latest.current;
|
|
52548
|
+
const { id, offset } = anchorAt(now.index, line);
|
|
52549
|
+
const next = new Set(openRef.current);
|
|
52550
|
+
if (!next.delete(id)) next.add(id);
|
|
52551
|
+
const after = layoutTranscript(now.messages, now.pending, now.pendingAt, now.columns, cache3, {
|
|
52552
|
+
click,
|
|
52553
|
+
open: next
|
|
52554
|
+
});
|
|
52555
|
+
setView(
|
|
52556
|
+
holdRow(now.synced, now.index, after.index, id, offset, {
|
|
52557
|
+
height: room(),
|
|
52558
|
+
footer: geometryRef.current.footer,
|
|
52559
|
+
searching: searchRef.current !== null
|
|
52560
|
+
})
|
|
52561
|
+
);
|
|
52562
|
+
openRef.current = next;
|
|
52563
|
+
setOpen(next);
|
|
52564
|
+
},
|
|
52565
|
+
[cache3, click, room]
|
|
52566
|
+
);
|
|
52140
52567
|
const pointer = (0, import_react53.useCallback)(
|
|
52141
52568
|
(report) => {
|
|
52142
52569
|
const node = boxRef.current;
|
|
@@ -52157,7 +52584,9 @@ function FullscreenTranscript({
|
|
|
52157
52584
|
selection: { anchor: landing.point, focus: landing.point, mode },
|
|
52158
52585
|
moved: mode !== "char",
|
|
52159
52586
|
pressing: true,
|
|
52160
|
-
copied: false
|
|
52587
|
+
copied: false,
|
|
52588
|
+
at: { x: report.x, y: report.y },
|
|
52589
|
+
replaced: current?.moved === true
|
|
52161
52590
|
});
|
|
52162
52591
|
return;
|
|
52163
52592
|
}
|
|
@@ -52179,13 +52608,16 @@ function FullscreenTranscript({
|
|
|
52179
52608
|
const f = current.selection.focus;
|
|
52180
52609
|
if (!current.moved || current.selection.mode === "char" && a.line === f.line && a.col === f.col) {
|
|
52181
52610
|
updateSelection(null);
|
|
52611
|
+
const row2 = landing.kind === "on" ? latest.current.rows[landing.point.line] : void 0;
|
|
52612
|
+
if (click && !current.moved && !current.replaced && row2?.opens === true && landing.kind === "on" && report.x === current.at.x && report.y === current.at.y)
|
|
52613
|
+
toggleAt(landing.point.line);
|
|
52182
52614
|
return;
|
|
52183
52615
|
}
|
|
52184
52616
|
updateSelection(finished);
|
|
52185
52617
|
if (copyOnSelect) copySelection(finished);
|
|
52186
52618
|
else showNote({ text: "Selected. Press ctrl+c to copy it, or esc to let go.", ok: true });
|
|
52187
52619
|
},
|
|
52188
|
-
[clicks, copyOnSelect, copySelection, scroll, showNote, updateSelection]
|
|
52620
|
+
[clicks, click, copyOnSelect, copySelection, scroll, showNote, toggleAt, updateSelection]
|
|
52189
52621
|
);
|
|
52190
52622
|
(0, import_react53.useEffect)(
|
|
52191
52623
|
() => subscribePointer ? subscribePointer(pointer) : void 0,
|
|
@@ -52256,8 +52688,8 @@ function FullscreenTranscript({
|
|
|
52256
52688
|
}, [keysActive, closeSearch]);
|
|
52257
52689
|
use_input_default(
|
|
52258
52690
|
(input, key) => {
|
|
52259
|
-
const
|
|
52260
|
-
if (
|
|
52691
|
+
const open2 = searchRef.current;
|
|
52692
|
+
if (open2) {
|
|
52261
52693
|
if (key.pageUp) {
|
|
52262
52694
|
scroll("page-up");
|
|
52263
52695
|
return;
|
|
@@ -52266,7 +52698,7 @@ function FullscreenTranscript({
|
|
|
52266
52698
|
scroll("page-down");
|
|
52267
52699
|
return;
|
|
52268
52700
|
}
|
|
52269
|
-
const edit = editSearch(
|
|
52701
|
+
const edit = editSearch(open2.query, input, key);
|
|
52270
52702
|
const { rows: now, synced: state, index: at } = latest.current;
|
|
52271
52703
|
if (edit.kind === "query") {
|
|
52272
52704
|
const found = findMatches(now, edit.query);
|
|
@@ -52277,13 +52709,13 @@ function FullscreenTranscript({
|
|
|
52277
52709
|
});
|
|
52278
52710
|
goTo(first);
|
|
52279
52711
|
} else if (edit.kind === "next" || edit.kind === "previous") {
|
|
52280
|
-
const found = findMatches(now,
|
|
52712
|
+
const found = findMatches(now, open2.query);
|
|
52281
52713
|
const was = found.findIndex(
|
|
52282
|
-
(m) => m.row ===
|
|
52714
|
+
(m) => m.row === open2.cursor?.row && m.from === open2.cursor?.from
|
|
52283
52715
|
);
|
|
52284
52716
|
const to2 = found[stepMatch(found.length, was, edit.kind === "next" ? 1 : -1)];
|
|
52285
52717
|
if (to2) {
|
|
52286
|
-
updateSearch({ ...
|
|
52718
|
+
updateSearch({ ...open2, cursor: { row: to2.row, from: to2.from } });
|
|
52287
52719
|
goTo(to2);
|
|
52288
52720
|
}
|
|
52289
52721
|
}
|
|
@@ -52495,6 +52927,7 @@ function messageLines(message, hasPrev, raw, columns) {
|
|
|
52495
52927
|
return [
|
|
52496
52928
|
...hasPrev ? [""] : [],
|
|
52497
52929
|
`${content}${meta ? ` \xB7 ${meta}` : ""}`,
|
|
52930
|
+
...(message.attachments ?? []).map((row2) => terminalDisplayText(attachmentLine(row2))),
|
|
52498
52931
|
...(message.checklist ?? []).map(checklistLine),
|
|
52499
52932
|
...message.detail && message.detail.length > 0 ? ["", ...message.detail.map(terminalDisplayText)] : []
|
|
52500
52933
|
];
|
|
@@ -52503,11 +52936,16 @@ function messageLines(message, hasPrev, raw, columns) {
|
|
|
52503
52936
|
const shown = typeof cut3 === "string" ? cut3 : `${cut3.head}
|
|
52504
52937
|
${hiddenTextRule(hiddenTextNote(cut3), 20)}
|
|
52505
52938
|
${cut3.tail}`;
|
|
52506
|
-
const
|
|
52939
|
+
const group = message.group !== void 0 && !isOneCommand(message.group) ? message.group : void 0;
|
|
52940
|
+
const open = group !== void 0 && message.pending === true;
|
|
52507
52941
|
return [
|
|
52508
52942
|
...hasPrev && message.glyph !== "\u23BF" ? [""] : [],
|
|
52509
52943
|
` ${shown}${meta ? ` \xB7 ${meta}` : ""}${open ? ` ${EXPAND_HINT}` : ""}`,
|
|
52510
|
-
...
|
|
52944
|
+
...(message.attachments ?? []).map((row2) => ` ${terminalDisplayText(attachmentLine(row2))}`),
|
|
52945
|
+
...group ? commandRows(group, (columns ?? 80) - COMMAND_ROW_INDENT - 1).map(
|
|
52946
|
+
(line) => ` ${terminalDisplayText(line)}`
|
|
52947
|
+
) : [],
|
|
52948
|
+
...open && group ? hintRows(group).map((line) => ` ${terminalDisplayText(line)}`) : [],
|
|
52511
52949
|
...renderedDetailLines(message, columns)
|
|
52512
52950
|
];
|
|
52513
52951
|
}
|
|
@@ -52960,7 +53398,7 @@ var AskQueue = class {
|
|
|
52960
53398
|
};
|
|
52961
53399
|
|
|
52962
53400
|
// src/tui/plugin-view.ts
|
|
52963
|
-
import { join as
|
|
53401
|
+
import { join as join7 } from "node:path";
|
|
52964
53402
|
function pluginOption(plugin) {
|
|
52965
53403
|
return {
|
|
52966
53404
|
label: plugin.name,
|
|
@@ -53003,9 +53441,9 @@ function emptyPluginReport(config, cwd2) {
|
|
|
53003
53441
|
const reason = config?.enabled !== true ? "Plugins are off. Set plugins.enabled: true in your Namzu configuration to load trusted plugins at startup." : config.autoDiscovery === false ? "Plugin discovery is off (plugins.autoDiscovery: false)." : scopes.length === 0 ? "No plugin scopes are allowed (plugins.allowedScopes: [])." : "No plugins are loaded in this conversation.";
|
|
53004
53442
|
return [
|
|
53005
53443
|
reason,
|
|
53006
|
-
`Configuration: ${
|
|
53007
|
-
...scopes.includes("project") ? [`Project plugins: ${
|
|
53008
|
-
...scopes.includes("user") ? [`User plugins: ${
|
|
53444
|
+
`Configuration: ${join7(home, "config.yaml")}`,
|
|
53445
|
+
...scopes.includes("project") ? [`Project plugins: ${join7(cwd2, ".namzu", "plugins")}`] : [],
|
|
53446
|
+
...scopes.includes("user") ? [`User plugins: ${join7(home, "plugins")}`] : [],
|
|
53009
53447
|
"Each plugin directory contains plugin.json. Only Namzu plugin manifests are supported.",
|
|
53010
53448
|
"Tools, hooks and MCP servers can execute code. Enable only plugins you trust, then restart Namzu."
|
|
53011
53449
|
].map(choiceDisplayText).join("\n");
|
|
@@ -53116,6 +53554,57 @@ function readRows(value) {
|
|
|
53116
53554
|
}
|
|
53117
53555
|
__name(readRows, "readRows");
|
|
53118
53556
|
|
|
53557
|
+
// src/tui/group-rows.ts
|
|
53558
|
+
function joinSections(body, section) {
|
|
53559
|
+
if (section.length === 0) return body ?? [];
|
|
53560
|
+
return body && body.length > 0 ? [...body, "", ...section] : section;
|
|
53561
|
+
}
|
|
53562
|
+
__name(joinSections, "joinSections");
|
|
53563
|
+
function commandSection(cell) {
|
|
53564
|
+
return [cell.shell.fullHeader ?? cell.header, ...shellPlainLines(cell.shell)];
|
|
53565
|
+
}
|
|
53566
|
+
__name(commandSection, "commandSection");
|
|
53567
|
+
function groupFields(state, live) {
|
|
53568
|
+
if (isOneCommand(state)) {
|
|
53569
|
+
return {
|
|
53570
|
+
content: state.cell.header,
|
|
53571
|
+
glyph: "\u25CF",
|
|
53572
|
+
glyphColor: tokenColor("status.ok"),
|
|
53573
|
+
shell: state.cell.shell,
|
|
53574
|
+
activity: void 0,
|
|
53575
|
+
group: state
|
|
53576
|
+
};
|
|
53577
|
+
}
|
|
53578
|
+
return {
|
|
53579
|
+
content: groupText(state, live),
|
|
53580
|
+
glyph: " ",
|
|
53581
|
+
glyphColor: tokenColor("text.muted"),
|
|
53582
|
+
shell: void 0,
|
|
53583
|
+
activity: "exploration",
|
|
53584
|
+
group: state
|
|
53585
|
+
};
|
|
53586
|
+
}
|
|
53587
|
+
__name(groupFields, "groupFields");
|
|
53588
|
+
function mergeGroupRows(rows) {
|
|
53589
|
+
const out = [];
|
|
53590
|
+
for (const row2 of rows) {
|
|
53591
|
+
const last = out.at(-1);
|
|
53592
|
+
if (row2.group && !row2.pending && last?.group && !last.pending) {
|
|
53593
|
+
const group = mergeGroups(last.group, row2.group);
|
|
53594
|
+
out[out.length - 1] = {
|
|
53595
|
+
...last,
|
|
53596
|
+
...groupFields(group, false),
|
|
53597
|
+
meta: EXPAND_HINT,
|
|
53598
|
+
detail: joinSections(last.detail, row2.detail ?? [])
|
|
53599
|
+
};
|
|
53600
|
+
continue;
|
|
53601
|
+
}
|
|
53602
|
+
out.push(row2);
|
|
53603
|
+
}
|
|
53604
|
+
return out;
|
|
53605
|
+
}
|
|
53606
|
+
__name(mergeGroupRows, "mergeGroupRows");
|
|
53607
|
+
|
|
53119
53608
|
// src/tui/model-catalogue-view.ts
|
|
53120
53609
|
function modelCatalogueView(output) {
|
|
53121
53610
|
let value;
|
|
@@ -53348,7 +53837,7 @@ function headOf(event, start) {
|
|
|
53348
53837
|
__name(headOf, "headOf");
|
|
53349
53838
|
function toolEndRows(event, start, ctx) {
|
|
53350
53839
|
const rows = /* @__PURE__ */ __name((list2) => ({ kind: "rows", rows: list2 }), "rows");
|
|
53351
|
-
const fold2 = foldOf(start);
|
|
53840
|
+
const fold2 = event.unknownTool ? void 0 : foldOf(start);
|
|
53352
53841
|
if (!event.isError && !event.declined && fold2) {
|
|
53353
53842
|
const raw = event.output !== void 0 ? event.output.split("\n") : [...event.summary ? [event.summary] : [], ...event.detail ?? []];
|
|
53354
53843
|
const answer = event.shell?.note;
|
|
@@ -53536,6 +54025,23 @@ function toolEndRows(event, start, ctx) {
|
|
|
53536
54025
|
const header = command ? formatToolCall(event.toolName, shellCommandHeader(command)) : start.label;
|
|
53537
54026
|
const full = command ? formatToolCall(event.toolName, shellCommandFull(command)) : void 0;
|
|
53538
54027
|
const settled2 = event.isError && event.shell.stderr.length === 0 ? { ...event.shell, stdout: [], stderr: event.shell.stdout, failed: true } : { ...event.shell, failed };
|
|
54028
|
+
const shell = full !== void 0 && full !== header ? { ...settled2, fullHeader: full } : settled2;
|
|
54029
|
+
if (!failed && event.toolName === "bash" && shell.background !== true && command.trim().length > 0) {
|
|
54030
|
+
const cell = { header, shell };
|
|
54031
|
+
const state = foldOp(EMPTY_GROUP, { kind: "run", command, cell }, 0);
|
|
54032
|
+
return rows([
|
|
54033
|
+
{
|
|
54034
|
+
// The row a group of this one command is drawn as; see `groupFields`.
|
|
54035
|
+
role: "tool",
|
|
54036
|
+
content: header,
|
|
54037
|
+
glyph: "\u25CF",
|
|
54038
|
+
glyphColor: tokenColor("status.ok"),
|
|
54039
|
+
shell,
|
|
54040
|
+
group: state,
|
|
54041
|
+
detail: [...commandSection(cell)]
|
|
54042
|
+
}
|
|
54043
|
+
]);
|
|
54044
|
+
}
|
|
53539
54045
|
return rows([
|
|
53540
54046
|
{
|
|
53541
54047
|
role: "tool",
|
|
@@ -53543,7 +54049,7 @@ function toolEndRows(event, start, ctx) {
|
|
|
53543
54049
|
glyph: "\u25CF",
|
|
53544
54050
|
detail: [...settled2.stdout, ...settled2.stderr],
|
|
53545
54051
|
glyphColor: failed ? tokenColor("status.error") : tokenColor("status.ok"),
|
|
53546
|
-
shell
|
|
54052
|
+
shell
|
|
53547
54053
|
}
|
|
53548
54054
|
]);
|
|
53549
54055
|
}
|
|
@@ -53639,7 +54145,7 @@ function noResumeText(input) {
|
|
|
53639
54145
|
__name(noResumeText, "noResumeText");
|
|
53640
54146
|
|
|
53641
54147
|
// src/tui/schedule/host-commands.ts
|
|
53642
|
-
import { isAbsolute, relative, resolve as resolve3 } from "node:path";
|
|
54148
|
+
import { isAbsolute as isAbsolute2, relative, resolve as resolve3 } from "node:path";
|
|
53643
54149
|
|
|
53644
54150
|
// src/tui/schedule/loop-host.ts
|
|
53645
54151
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
@@ -53910,7 +54416,7 @@ async function confirmInTui(ctx, job, verb) {
|
|
|
53910
54416
|
const roots = [ctx.cwd, ...ctx.extraRoots ?? []];
|
|
53911
54417
|
const outside = job.workspace !== "none" && !roots.some((root) => {
|
|
53912
54418
|
const rel = relative(root, job.folder.canonical);
|
|
53913
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
54419
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute2(rel);
|
|
53914
54420
|
});
|
|
53915
54421
|
const hasScript = runKind !== "agent";
|
|
53916
54422
|
const networkCapable = policy.network || job.permissions.execution === "host" && (hasScript || allowsCommands(job.permissions));
|
|
@@ -54439,7 +54945,7 @@ __name(prepareScheduledResume, "prepareScheduledResume");
|
|
|
54439
54945
|
|
|
54440
54946
|
// src/tui/schedule/startup.ts
|
|
54441
54947
|
import { readFileSync as readFileSync6 } from "node:fs";
|
|
54442
|
-
import { join as
|
|
54948
|
+
import { join as join8 } from "node:path";
|
|
54443
54949
|
function ago(ms) {
|
|
54444
54950
|
if (ms < 36e5) return `${Math.max(1, Math.round(ms / 6e4))} min`;
|
|
54445
54951
|
if (ms < 1728e5) return `${Math.round(ms / 36e5)} h`;
|
|
@@ -54521,7 +55027,7 @@ function scheduleStartupLine(home, cwd2, now = Date.now()) {
|
|
|
54521
55027
|
parts.push("The scheduler is installed but has not started \u2014 namzu schedule status");
|
|
54522
55028
|
}
|
|
54523
55029
|
}
|
|
54524
|
-
const suppressed = takeSuppressedCount(
|
|
55030
|
+
const suppressed = takeSuppressedCount(join8(paths.daemon, "notify.json"));
|
|
54525
55031
|
if (suppressed > 0)
|
|
54526
55032
|
parts.push(
|
|
54527
55033
|
`${plural(suppressed, "scheduled notification")} ${suppressed === 1 ? "was" : "were"} held back`
|
|
@@ -54540,10 +55046,10 @@ __name(scheduleStartupLine, "scheduleStartupLine");
|
|
|
54540
55046
|
|
|
54541
55047
|
// src/tui/schedule/tool-host.ts
|
|
54542
55048
|
import { realpathSync as realpathSync3 } from "node:fs";
|
|
54543
|
-
import { isAbsolute as
|
|
55049
|
+
import { isAbsolute as isAbsolute3, relative as relative2, resolve as resolve5 } from "node:path";
|
|
54544
55050
|
function within(root, path) {
|
|
54545
55051
|
const rel = relative2(root, path);
|
|
54546
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
55052
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute3(rel);
|
|
54547
55053
|
}
|
|
54548
55054
|
__name(within, "within");
|
|
54549
55055
|
function canonicalCwd(cwd2) {
|
|
@@ -55575,12 +56081,12 @@ function setSkillSuggestions(on, opts = {}) {
|
|
|
55575
56081
|
__name(setSkillSuggestions, "setSkillSuggestions");
|
|
55576
56082
|
|
|
55577
56083
|
// src/tui/skills/suggestion-ledger.ts
|
|
55578
|
-
import { mkdirSync as
|
|
55579
|
-
import { dirname, join as
|
|
56084
|
+
import { mkdirSync as mkdirSync4, readFileSync as readFileSync7, renameSync as renameSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
56085
|
+
import { dirname, join as join9 } from "node:path";
|
|
55580
56086
|
var SUGGESTION_IGNORE_LIMIT = 3;
|
|
55581
56087
|
var FRESH_LEDGER = { v: 1, unanswered: 0, stopped: false };
|
|
55582
56088
|
function suggestionLedgerPath(namzuHome) {
|
|
55583
|
-
return
|
|
56089
|
+
return join9(namzuHome, "skills", ".suggestions.json");
|
|
55584
56090
|
}
|
|
55585
56091
|
__name(suggestionLedgerPath, "suggestionLedgerPath");
|
|
55586
56092
|
function readSuggestionLedger(namzuHome) {
|
|
@@ -55596,11 +56102,11 @@ __name(readSuggestionLedger, "readSuggestionLedger");
|
|
|
55596
56102
|
function writeSuggestionLedger(namzuHome, ledger) {
|
|
55597
56103
|
const path = suggestionLedgerPath(namzuHome);
|
|
55598
56104
|
try {
|
|
55599
|
-
|
|
56105
|
+
mkdirSync4(dirname(path), { recursive: true });
|
|
55600
56106
|
const temp = `${path}.${process.pid}.tmp`;
|
|
55601
|
-
|
|
56107
|
+
writeFileSync3(temp, `${JSON.stringify(ledger)}
|
|
55602
56108
|
`, { mode: 384 });
|
|
55603
|
-
|
|
56109
|
+
renameSync3(temp, path);
|
|
55604
56110
|
} catch {
|
|
55605
56111
|
}
|
|
55606
56112
|
}
|
|
@@ -56526,32 +57032,6 @@ __name(runBrowserSlash, "runBrowserSlash");
|
|
|
56526
57032
|
// src/tui/exit-hint.ts
|
|
56527
57033
|
var EXIT_HINT_MS = 800;
|
|
56528
57034
|
|
|
56529
|
-
// src/tui/group-rows.ts
|
|
56530
|
-
function joinSections(body, section) {
|
|
56531
|
-
if (section.length === 0) return body ?? [];
|
|
56532
|
-
return body && body.length > 0 ? [...body, "", ...section] : section;
|
|
56533
|
-
}
|
|
56534
|
-
__name(joinSections, "joinSections");
|
|
56535
|
-
function mergeGroupRows(rows) {
|
|
56536
|
-
const out = [];
|
|
56537
|
-
for (const row2 of rows) {
|
|
56538
|
-
const last = out.at(-1);
|
|
56539
|
-
if (row2.group && !row2.pending && last?.group && !last.pending) {
|
|
56540
|
-
const group = mergeGroups(last.group, row2.group);
|
|
56541
|
-
out[out.length - 1] = {
|
|
56542
|
-
...last,
|
|
56543
|
-
group,
|
|
56544
|
-
content: groupText(group, false),
|
|
56545
|
-
detail: joinSections(last.detail, row2.detail ?? [])
|
|
56546
|
-
};
|
|
56547
|
-
continue;
|
|
56548
|
-
}
|
|
56549
|
-
out.push(row2);
|
|
56550
|
-
}
|
|
56551
|
-
return out;
|
|
56552
|
-
}
|
|
56553
|
-
__name(mergeGroupRows, "mergeGroupRows");
|
|
56554
|
-
|
|
56555
57035
|
// src/tui/mention-sources.ts
|
|
56556
57036
|
var DESCRIPTION_CHARS = 60;
|
|
56557
57037
|
var BUILT_IN_AGENTS = [
|
|
@@ -56823,12 +57303,20 @@ function trailFromRecords(records) {
|
|
|
56823
57303
|
mergeUsedMemories(recalled.get(turnId) ?? [], usedMemoriesOf(record3.memories))
|
|
56824
57304
|
);
|
|
56825
57305
|
break;
|
|
57306
|
+
case "turn_outcome_recorded":
|
|
57307
|
+
if (turnId) {
|
|
57308
|
+
const outcome = parseTurnOutcome(record3.outcome);
|
|
57309
|
+
if (outcome) turn(turnId).outcome = outcome;
|
|
57310
|
+
else delete turn(turnId).outcome;
|
|
57311
|
+
}
|
|
57312
|
+
break;
|
|
56826
57313
|
case "turn_completed":
|
|
56827
57314
|
case "turn_failed":
|
|
56828
57315
|
if (turnId) {
|
|
56829
57316
|
const t = turn(turnId);
|
|
56830
57317
|
t.endedAt = atOf(record3);
|
|
56831
57318
|
if (record3.type === "turn_completed") {
|
|
57319
|
+
t.completed = true;
|
|
56832
57320
|
if (typeof record3.stopReason === "string") t.stopReason = record3.stopReason;
|
|
56833
57321
|
if (typeof record3.cancelCause === "string") t.cancelCause = record3.cancelCause;
|
|
56834
57322
|
t.budget = record3.budget;
|
|
@@ -57020,6 +57508,21 @@ function createRestoredTurnWriter(messages, nextId, options) {
|
|
|
57020
57508
|
let current;
|
|
57021
57509
|
const shownMemories = /* @__PURE__ */ new Set();
|
|
57022
57510
|
const atTurn = /* @__PURE__ */ __name((turnId) => trail.turns.get(turnId)?.startedAt ?? Date.now(), "atTurn");
|
|
57511
|
+
let telling = options.telling ?? NOTHING_TOLD;
|
|
57512
|
+
const outcomeRow = /* @__PURE__ */ __name((turn) => {
|
|
57513
|
+
if (turn.completed !== true) return void 0;
|
|
57514
|
+
const said = outcomeNotice(turn.outcome, telling, options.cannotTellReason);
|
|
57515
|
+
telling = said.telling;
|
|
57516
|
+
if (!said.line) return void 0;
|
|
57517
|
+
const style = systemRowStyle("notice");
|
|
57518
|
+
return {
|
|
57519
|
+
id: nextId(),
|
|
57520
|
+
role: "system",
|
|
57521
|
+
content: said.line,
|
|
57522
|
+
glyph: style.glyph,
|
|
57523
|
+
glyphColor: style.color
|
|
57524
|
+
};
|
|
57525
|
+
}, "outcomeRow");
|
|
57023
57526
|
const closing = /* @__PURE__ */ __name((turnId) => {
|
|
57024
57527
|
if (!turnId) return [];
|
|
57025
57528
|
const turn = trail.turns.get(turnId);
|
|
@@ -57027,6 +57530,8 @@ function createRestoredTurnWriter(messages, nextId, options) {
|
|
|
57027
57530
|
const rows = [];
|
|
57028
57531
|
if (turn.stopReason === "cancelled" && turn.cancelCause === "user") {
|
|
57029
57532
|
rows.push({ id: nextId(), role: "system", content: "Interrupted." });
|
|
57533
|
+
const said2 = outcomeRow(turn);
|
|
57534
|
+
if (said2) rows.push(said2);
|
|
57030
57535
|
return rows;
|
|
57031
57536
|
}
|
|
57032
57537
|
const notice = describeTurnStop(
|
|
@@ -57034,6 +57539,8 @@ function createRestoredTurnWriter(messages, nextId, options) {
|
|
|
57034
57539
|
turn.budget
|
|
57035
57540
|
);
|
|
57036
57541
|
if (notice) rows.push({ id: nextId(), role: "system", content: notice, glyph: "\u25A0" });
|
|
57542
|
+
const said = outcomeRow(turn);
|
|
57543
|
+
if (said) rows.push(said);
|
|
57037
57544
|
const completed = turn.stopReason === void 0 || turn.stopReason === "end_turn";
|
|
57038
57545
|
if (turn.startedAt !== void 0 && turn.endedAt !== void 0) {
|
|
57039
57546
|
const stand = turn.agents.map(
|
|
@@ -57103,7 +57610,8 @@ function createRestoredTurnWriter(messages, nextId, options) {
|
|
|
57103
57610
|
const rows = closing(current);
|
|
57104
57611
|
current = void 0;
|
|
57105
57612
|
return rows;
|
|
57106
|
-
}
|
|
57613
|
+
},
|
|
57614
|
+
told: /* @__PURE__ */ __name(() => telling, "told")
|
|
57107
57615
|
};
|
|
57108
57616
|
}
|
|
57109
57617
|
__name(createRestoredTurnWriter, "createRestoredTurnWriter");
|
|
@@ -58069,23 +58577,49 @@ function settled(state) {
|
|
|
58069
58577
|
return rest;
|
|
58070
58578
|
}
|
|
58071
58579
|
__name(settled, "settled");
|
|
58580
|
+
function rebuilt(ops, from) {
|
|
58581
|
+
let state = EMPTY_GROUP;
|
|
58582
|
+
for (const { op } of ops) state = foldOp(state, { ...op, hint: void 0 }, 0);
|
|
58583
|
+
return {
|
|
58584
|
+
...state,
|
|
58585
|
+
...from.hintShown !== void 0 ? { hintShown: from.hintShown } : {},
|
|
58586
|
+
...from.hintShownAt !== void 0 ? { hintShownAt: from.hintShownAt } : {},
|
|
58587
|
+
...from.hintQueued !== void 0 ? { hintQueued: from.hintQueued } : {}
|
|
58588
|
+
};
|
|
58589
|
+
}
|
|
58590
|
+
__name(rebuilt, "rebuilt");
|
|
58591
|
+
function numberOf(prev, id) {
|
|
58592
|
+
return prev.filter((row2) => row2.id !== id && row2.detailRef !== void 0).length + 1;
|
|
58593
|
+
}
|
|
58594
|
+
__name(numberOf, "numberOf");
|
|
58595
|
+
function shaped(m, state, live, prev) {
|
|
58596
|
+
const { detailRef: _ref, meta: _meta, ...rest } = m;
|
|
58597
|
+
const alone = isOneCommand(state) && shellCollapses(state.cell.shell);
|
|
58598
|
+
return {
|
|
58599
|
+
...rest,
|
|
58600
|
+
...groupFields(state, live),
|
|
58601
|
+
...alone ? { detailRef: numberOf(prev, m.id) } : {}
|
|
58602
|
+
};
|
|
58603
|
+
}
|
|
58604
|
+
__name(shaped, "shaped");
|
|
58072
58605
|
function useReadSearchGroup(setMessages, nextId, takeThinking) {
|
|
58073
58606
|
const openRef = (0, import_react61.useRef)(null);
|
|
58074
58607
|
const start = (0, import_react61.useCallback)(
|
|
58075
|
-
(memberKey, op) => {
|
|
58608
|
+
(memberKey, op, section) => {
|
|
58076
58609
|
const now = Date.now();
|
|
58077
58610
|
const open = openRef.current;
|
|
58078
58611
|
if (open) {
|
|
58079
58612
|
open.state = foldOp(open.state, op, now);
|
|
58613
|
+
open.ops.push({ key: memberKey, op });
|
|
58080
58614
|
open.members.add(memberKey);
|
|
58081
|
-
|
|
58615
|
+
if (section) open.detail = joinSections(open.detail, section);
|
|
58616
|
+
const { id: id2, state: state2, detail: detail2 } = open;
|
|
58082
58617
|
const more = takeThinking?.();
|
|
58083
58618
|
setMessages(
|
|
58084
58619
|
(prev) => prev.map(
|
|
58085
58620
|
(m) => m.id === id2 ? {
|
|
58086
|
-
...m,
|
|
58087
|
-
|
|
58088
|
-
content: groupText(state2, true),
|
|
58621
|
+
...shaped(m, state2, true, prev),
|
|
58622
|
+
...section ? { detail: detail2 } : {},
|
|
58089
58623
|
...more ? { thinking: `${m.thinking ?? ""}${more}` } : {}
|
|
58090
58624
|
} : m
|
|
58091
58625
|
)
|
|
@@ -58094,20 +58628,30 @@ function useReadSearchGroup(setMessages, nextId, takeThinking) {
|
|
|
58094
58628
|
}
|
|
58095
58629
|
const id = nextId();
|
|
58096
58630
|
const state = foldOp(EMPTY_GROUP, op, now);
|
|
58097
|
-
|
|
58631
|
+
const detail = section ? joinSections([], section) : [];
|
|
58632
|
+
openRef.current = {
|
|
58633
|
+
id,
|
|
58634
|
+
state,
|
|
58635
|
+
ops: [{ key: memberKey, op }],
|
|
58636
|
+
members: /* @__PURE__ */ new Set([memberKey]),
|
|
58637
|
+
detail
|
|
58638
|
+
};
|
|
58098
58639
|
const thinking = takeThinking?.();
|
|
58099
58640
|
setMessages((prev) => [
|
|
58100
58641
|
...prev,
|
|
58101
|
-
|
|
58102
|
-
|
|
58103
|
-
|
|
58104
|
-
|
|
58105
|
-
|
|
58106
|
-
|
|
58107
|
-
|
|
58108
|
-
|
|
58109
|
-
|
|
58110
|
-
|
|
58642
|
+
shaped(
|
|
58643
|
+
{
|
|
58644
|
+
id,
|
|
58645
|
+
role: "tool",
|
|
58646
|
+
content: "",
|
|
58647
|
+
pending: true,
|
|
58648
|
+
...detail.length > 0 ? { detail } : {},
|
|
58649
|
+
...thinking ? { thinking } : {}
|
|
58650
|
+
},
|
|
58651
|
+
state,
|
|
58652
|
+
true,
|
|
58653
|
+
prev
|
|
58654
|
+
)
|
|
58111
58655
|
]);
|
|
58112
58656
|
},
|
|
58113
58657
|
[nextId, setMessages, takeThinking]
|
|
@@ -58123,6 +58667,24 @@ function useReadSearchGroup(setMessages, nextId, takeThinking) {
|
|
|
58123
58667
|
},
|
|
58124
58668
|
[setMessages]
|
|
58125
58669
|
);
|
|
58670
|
+
const retract = (0, import_react61.useCallback)(
|
|
58671
|
+
(memberKey) => {
|
|
58672
|
+
const open = openRef.current;
|
|
58673
|
+
if (!open?.members.has(memberKey)) return;
|
|
58674
|
+
open.members.delete(memberKey);
|
|
58675
|
+
open.ops = open.ops.filter((entry) => entry.key !== memberKey);
|
|
58676
|
+
const { id } = open;
|
|
58677
|
+
if (open.ops.length === 0) {
|
|
58678
|
+
openRef.current = null;
|
|
58679
|
+
setMessages((prev) => prev.filter((m) => m.id !== id));
|
|
58680
|
+
return;
|
|
58681
|
+
}
|
|
58682
|
+
open.state = rebuilt(open.ops, open.state);
|
|
58683
|
+
const { state } = open;
|
|
58684
|
+
setMessages((prev) => prev.map((m) => m.id === id ? shaped(m, state, true, prev) : m));
|
|
58685
|
+
},
|
|
58686
|
+
[setMessages]
|
|
58687
|
+
);
|
|
58126
58688
|
const close = (0, import_react61.useCallback)(() => {
|
|
58127
58689
|
const open = openRef.current;
|
|
58128
58690
|
if (!open) return;
|
|
@@ -58130,23 +58692,18 @@ function useReadSearchGroup(setMessages, nextId, takeThinking) {
|
|
|
58130
58692
|
const { id, detail } = open;
|
|
58131
58693
|
const state = settled(open.state);
|
|
58132
58694
|
setMessages(
|
|
58133
|
-
(prev) => prev.map(
|
|
58134
|
-
(m
|
|
58135
|
-
|
|
58136
|
-
|
|
58137
|
-
|
|
58138
|
-
|
|
58139
|
-
...detail.length > 0 ? {
|
|
58140
|
-
|
|
58141
|
-
|
|
58142
|
-
// Numbered as `pushMessage` numbers any body Ctrl+O can open.
|
|
58143
|
-
detailRef: prev.filter((row2) => row2.detailRef !== void 0).length + 1
|
|
58144
|
-
} : {}
|
|
58145
|
-
} : m
|
|
58146
|
-
)
|
|
58695
|
+
(prev) => prev.map((m) => {
|
|
58696
|
+
if (m.id !== id) return m;
|
|
58697
|
+
const row2 = { ...shaped(m, state, false, prev), pending: false };
|
|
58698
|
+
if (isOneCommand(state)) return row2;
|
|
58699
|
+
return {
|
|
58700
|
+
...row2,
|
|
58701
|
+
...detail.length > 0 ? { detail, meta: EXPAND_HINT, detailRef: numberOf(prev, id) } : {}
|
|
58702
|
+
};
|
|
58703
|
+
})
|
|
58147
58704
|
);
|
|
58148
58705
|
}, [setMessages]);
|
|
58149
|
-
return (0, import_react61.useMemo)(() => ({ start, finish, close }), [start, finish, close]);
|
|
58706
|
+
return (0, import_react61.useMemo)(() => ({ start, finish, retract, close }), [start, finish, retract, close]);
|
|
58150
58707
|
}
|
|
58151
58708
|
__name(useReadSearchGroup, "useReadSearchGroup");
|
|
58152
58709
|
|
|
@@ -58395,10 +58952,13 @@ function promptHistoryFromConversation(messages) {
|
|
|
58395
58952
|
__name(promptHistoryFromConversation, "promptHistoryFromConversation");
|
|
58396
58953
|
function projectConversation(messages, nextId, readableUserTexts = [], restore) {
|
|
58397
58954
|
let userOrdinal = 0;
|
|
58955
|
+
let attachmentFloor = 0;
|
|
58398
58956
|
const writer = createRestoredTurnWriter(messages, nextId, {
|
|
58399
58957
|
presenter: restore?.presenter ?? builtinToolPresenter(),
|
|
58400
58958
|
...restore?.trail ? { trail: restore.trail } : {},
|
|
58401
|
-
...restore?.cwd ? { cwd: restore.cwd } : {}
|
|
58959
|
+
...restore?.cwd ? { cwd: restore.cwd } : {},
|
|
58960
|
+
...restore?.cannotTellReason ? { cannotTellReason: restore.cannotTellReason } : {},
|
|
58961
|
+
...restore?.telling ? { telling: restore.telling } : {}
|
|
58402
58962
|
});
|
|
58403
58963
|
const out = [];
|
|
58404
58964
|
for (const message of messages) {
|
|
@@ -58414,6 +58974,7 @@ function projectConversation(messages, nextId, readableUserTexts = [], restore)
|
|
|
58414
58974
|
}
|
|
58415
58975
|
}
|
|
58416
58976
|
out.push(...writer.finish());
|
|
58977
|
+
restore?.onTold?.(writer.told());
|
|
58417
58978
|
return numberDetailRows(mergeGroupRows(out));
|
|
58418
58979
|
function projectMessage(message) {
|
|
58419
58980
|
if (message.role === "user") {
|
|
@@ -58466,11 +59027,20 @@ function projectConversation(messages, nextId, readableUserTexts = [], restore)
|
|
|
58466
59027
|
}
|
|
58467
59028
|
const readable = readableUserTexts[userOrdinal];
|
|
58468
59029
|
userOrdinal += 1;
|
|
59030
|
+
const attachments = message.attachments?.length ? attachmentRows(
|
|
59031
|
+
message.content,
|
|
59032
|
+
message.attachments,
|
|
59033
|
+
attachmentFloor,
|
|
59034
|
+
restore?.attachmentDir
|
|
59035
|
+
) : void 0;
|
|
59036
|
+
for (const row2 of attachments ?? [])
|
|
59037
|
+
attachmentFloor = Math.max(attachmentFloor, highestAttachmentNumber(row2.marker));
|
|
58469
59038
|
return [
|
|
58470
59039
|
{
|
|
58471
59040
|
id: nextId(),
|
|
58472
59041
|
role: "user",
|
|
58473
|
-
content: readable ?? message.content
|
|
59042
|
+
content: readable ?? message.content,
|
|
59043
|
+
...attachments ? { attachments } : {}
|
|
58474
59044
|
}
|
|
58475
59045
|
];
|
|
58476
59046
|
}
|
|
@@ -58736,6 +59306,12 @@ function AppBody({
|
|
|
58736
59306
|
const sandboxShell = sandboxRunsShellUnasked(session?.sandbox);
|
|
58737
59307
|
const sandboxShellRef = (0, import_react62.useRef)(sandboxShell);
|
|
58738
59308
|
sandboxShellRef.current = sandboxShell;
|
|
59309
|
+
const cannotTellReasonRef = (0, import_react62.useRef)(void 0);
|
|
59310
|
+
cannotTellReasonRef.current = session?.sandbox?.workspace === "ephemeral" ? "copy" : void 0;
|
|
59311
|
+
const outcomeToldRef = (0, import_react62.useRef)({
|
|
59312
|
+
id: void 0,
|
|
59313
|
+
telling: NOTHING_TOLD
|
|
59314
|
+
});
|
|
58739
59315
|
const [offeredCommands, setOfferedCommands] = (0, import_react62.useState)(/* @__PURE__ */ new Set());
|
|
58740
59316
|
(0, import_react62.useEffect)(() => {
|
|
58741
59317
|
const foreground = session?.foreground;
|
|
@@ -59495,6 +60071,28 @@ ${blocks.join("\n\n")}`;
|
|
|
59495
60071
|
const trustGrants = (0, import_react62.useMemo)(() => readFolderGrants(trustedCwdRef.current), []);
|
|
59496
60072
|
const sessionsRef = (0, import_react62.useRef)(null);
|
|
59497
60073
|
const scopeRef = (0, import_react62.useRef)(null);
|
|
60074
|
+
const attachmentFloor = (0, import_react62.useMemo)(() => {
|
|
60075
|
+
let highest = 0;
|
|
60076
|
+
for (const row2 of messages) {
|
|
60077
|
+
if (!row2.attachments) continue;
|
|
60078
|
+
for (const attachment of row2.attachments)
|
|
60079
|
+
highest = Math.max(highest, highestAttachmentNumber(attachment.marker));
|
|
60080
|
+
}
|
|
60081
|
+
return highest;
|
|
60082
|
+
}, [messages]);
|
|
60083
|
+
const attachmentFloorRef = (0, import_react62.useRef)(0);
|
|
60084
|
+
attachmentFloorRef.current = attachmentFloor;
|
|
60085
|
+
const attachmentRowsFor = /* @__PURE__ */ __name((text, attachments) => {
|
|
60086
|
+
if (!attachments || attachments.length === 0) return void 0;
|
|
60087
|
+
const sessions = sessionsRef.current;
|
|
60088
|
+
const sessionId = scopeRef.current?.sessionId;
|
|
60089
|
+
return attachmentRows(
|
|
60090
|
+
text,
|
|
60091
|
+
attachments,
|
|
60092
|
+
attachmentFloorRef.current,
|
|
60093
|
+
sessions && sessionId ? attachmentDirOf(sessions, sessionId) : void 0
|
|
60094
|
+
);
|
|
60095
|
+
}, "attachmentRowsFor");
|
|
59498
60096
|
const [conversationNames, setConversationNames] = (0, import_react62.useState)({});
|
|
59499
60097
|
const namesSessionRef = (0, import_react62.useRef)(void 0);
|
|
59500
60098
|
const conversationNamesRef = (0, import_react62.useRef)(conversationNames);
|
|
@@ -59529,7 +60127,7 @@ ${blocks.join("\n\n")}`;
|
|
|
59529
60127
|
const scope = scopeRef.current;
|
|
59530
60128
|
if (!sessions || !scope || !conversationMaterializedRef.current) return void 0;
|
|
59531
60129
|
try {
|
|
59532
|
-
return
|
|
60130
|
+
return join10(sessions.paths.sessionDir({ sessionId: scope.sessionId }), "loops.json");
|
|
59533
60131
|
} catch {
|
|
59534
60132
|
return void 0;
|
|
59535
60133
|
}
|
|
@@ -59837,7 +60435,7 @@ ${blocks.join("\n\n")}`;
|
|
|
59837
60435
|
});
|
|
59838
60436
|
const thinkingForNextRowRef = (0, import_react62.useRef)("");
|
|
59839
60437
|
const pushMessage = (0, import_react62.useCallback)(
|
|
59840
|
-
(role, content, pending = false, glyph, detail, glyphColor, meta, activity, sourceDelivery, shell, diff2, contentColor) => {
|
|
60438
|
+
(role, content, pending = false, glyph, detail, glyphColor, meta, activity, sourceDelivery, shell, diff2, contentColor, attachments) => {
|
|
59841
60439
|
if (role === "assistant") flushLaunchReceiptsRef.current();
|
|
59842
60440
|
if (!(role === "assistant" && !pending && content.trim().length === 0))
|
|
59843
60441
|
readSearchGroup.close();
|
|
@@ -59878,6 +60476,7 @@ ${blocks.join("\n\n")}`;
|
|
|
59878
60476
|
...shell ? { shell } : {},
|
|
59879
60477
|
...diff2 ? { diff: diff2 } : {},
|
|
59880
60478
|
...contentColor ? { contentColor } : {},
|
|
60479
|
+
...attachments && attachments.length > 0 ? { attachments } : {},
|
|
59881
60480
|
...sourceDelivery ? { sourceDelivery } : {},
|
|
59882
60481
|
// Numbered only if this body will actually be COLLAPSED — the
|
|
59883
60482
|
// number exists to be read off a hint, and a body that fits
|
|
@@ -61516,7 +62115,7 @@ ${blocks.join("\n\n")}`;
|
|
|
61516
62115
|
sessionId = asSessionId(requestedConversationId);
|
|
61517
62116
|
modelHistoryRef.current = restored;
|
|
61518
62117
|
try {
|
|
61519
|
-
const facts = await
|
|
62118
|
+
const facts = await readConversationRecords(sessions, sessionId, "tolerant");
|
|
61520
62119
|
const lastBinding = facts?.records.filter((record3) => record3.type === "account_bound").at(-1);
|
|
61521
62120
|
if (facts && lastBinding?.type === "account_bound") {
|
|
61522
62121
|
const bound = resolveBoundAccount(
|
|
@@ -61540,7 +62139,12 @@ ${blocks.join("\n\n")}`;
|
|
|
61540
62139
|
setMessages([
|
|
61541
62140
|
...projectConversation(restored, nextId, [], {
|
|
61542
62141
|
trail: trailFromRecords(journalOf(restored)),
|
|
61543
|
-
cwd: ctxRef.current.cwd
|
|
62142
|
+
cwd: ctxRef.current.cwd,
|
|
62143
|
+
attachmentDir: attachmentDirOf(sessions, asSessionId(requestedConversationId)),
|
|
62144
|
+
...cannotTellReasonRef.current ? { cannotTellReason: cannotTellReasonRef.current } : {},
|
|
62145
|
+
onTold: /* @__PURE__ */ __name((telling) => {
|
|
62146
|
+
outcomeToldRef.current = { id: requestedConversationId, telling };
|
|
62147
|
+
}, "onTold")
|
|
61544
62148
|
}),
|
|
61545
62149
|
...resumedTitle ? [
|
|
61546
62150
|
{
|
|
@@ -62759,7 +63363,7 @@ ${blocks.join("\n\n")}`;
|
|
|
62759
63363
|
doctorRunningRef.current = true;
|
|
62760
63364
|
const progressId = pushMessage("system", "Checking\u2026");
|
|
62761
63365
|
try {
|
|
62762
|
-
const { runLiveDoctor } = await import("./live-
|
|
63366
|
+
const { runLiveDoctor } = await import("./live-R457RDVD.js");
|
|
62763
63367
|
const { describePlainDoctor } = await import("./plain-report-XVPBQDLE.js");
|
|
62764
63368
|
const report = await runLiveDoctor({
|
|
62765
63369
|
...ctxRef.current.telemetry ? { telemetry: ctxRef.current.telemetry } : {}
|
|
@@ -63014,7 +63618,12 @@ ${blocks.join("\n\n")}`;
|
|
|
63014
63618
|
setPhase("ready");
|
|
63015
63619
|
const restored = projectConversation(msgs, nextId, [], {
|
|
63016
63620
|
trail: trailFromRecords(journalOf(msgs)),
|
|
63017
|
-
cwd: ctxRef.current.cwd
|
|
63621
|
+
cwd: ctxRef.current.cwd,
|
|
63622
|
+
attachmentDir: attachmentDirOf(sessions, conv.id),
|
|
63623
|
+
...cannotTellReasonRef.current ? { cannotTellReason: cannotTellReasonRef.current } : {},
|
|
63624
|
+
onTold: /* @__PURE__ */ __name((telling) => {
|
|
63625
|
+
outcomeToldRef.current = { id: conv.id, telling };
|
|
63626
|
+
}, "onTold")
|
|
63018
63627
|
});
|
|
63019
63628
|
const discardedQueued = roundQueueRef.current.items().length;
|
|
63020
63629
|
const interrupted = interruptTurn();
|
|
@@ -63931,9 +64540,11 @@ ${blocks.join("\n\n")}`;
|
|
|
63931
64540
|
const persistedOutput = latestAssistantOutput(forked.messages);
|
|
63932
64541
|
lastCompletedOutputRef.current = persistedOutput ? { text: persistedOutput, provenance: "persisted" } : null;
|
|
63933
64542
|
resetTranscript();
|
|
64543
|
+
outcomeToldRef.current = { id: void 0, telling: NOTHING_TOLD };
|
|
63934
64544
|
setMessages(
|
|
63935
64545
|
projectConversation(forked.messages, nextId, readablePrefix, {
|
|
63936
|
-
cwd: ctxRef.current.cwd
|
|
64546
|
+
cwd: ctxRef.current.cwd,
|
|
64547
|
+
attachmentDir: attachmentDirOf(sessions, forked.id)
|
|
63937
64548
|
})
|
|
63938
64549
|
);
|
|
63939
64550
|
composerDraftTokenRef.current += 1;
|
|
@@ -64019,9 +64630,11 @@ ${blocks.join("\n\n")}`;
|
|
|
64019
64630
|
const at = editList.indexOf(target);
|
|
64020
64631
|
const readable = option === "summarize" ? editList.slice(0, Math.max(0, at)).map((prompt) => prompt.displayText) : editList.slice(Math.max(0, at)).map((prompt) => prompt.displayText);
|
|
64021
64632
|
resetTranscript();
|
|
64633
|
+
outcomeToldRef.current = { id: void 0, telling: NOTHING_TOLD };
|
|
64022
64634
|
setMessages(
|
|
64023
64635
|
projectConversation(result.messages, nextId, readable, {
|
|
64024
|
-
cwd: ctxRef.current.cwd
|
|
64636
|
+
cwd: ctxRef.current.cwd,
|
|
64637
|
+
...sessionsRef.current && scopeRef.current ? { attachmentDir: attachmentDirOf(sessionsRef.current, scopeRef.current.sessionId) } : {}
|
|
64025
64638
|
})
|
|
64026
64639
|
);
|
|
64027
64640
|
if (option === "summarize") {
|
|
@@ -64134,7 +64747,7 @@ ${plain(err)}`
|
|
|
64134
64747
|
}
|
|
64135
64748
|
const summary2 = buildPermissionSummary(review.text, {
|
|
64136
64749
|
describeUiRef: /* @__PURE__ */ __name((ref) => reviewSessionRef.current?.describeComputerUseRef?.(ref), "describeUiRef"),
|
|
64137
|
-
fileExists: /* @__PURE__ */ __name((path) =>
|
|
64750
|
+
fileExists: /* @__PURE__ */ __name((path) => existsSync4(resolve8(ctxRef.current.cwd, path)), "fileExists"),
|
|
64138
64751
|
readText: /* @__PURE__ */ __name((path) => readReviewedFile(resolve8(ctxRef.current.cwd, path)), "readText"),
|
|
64139
64752
|
workflowLimits: resolveWorkflowLimits(ctxRef.current.workflow),
|
|
64140
64753
|
readWorkflowScript: /* @__PURE__ */ __name((path) => reviewSessionRef.current?.workflows?.readScript(path), "readWorkflowScript"),
|
|
@@ -64543,7 +65156,8 @@ ${plain(err)}`
|
|
|
64543
65156
|
closeAssistant();
|
|
64544
65157
|
if (event.fold)
|
|
64545
65158
|
readSearchGroup.start(`${event.turnId ?? ""}:${event.toolUseId}`, event.fold);
|
|
64546
|
-
else
|
|
65159
|
+
else if (!(event.toolName === "bash" && event.command !== void 0))
|
|
65160
|
+
readSearchGroup.close();
|
|
64547
65161
|
setThinking(null);
|
|
64548
65162
|
setState("tool");
|
|
64549
65163
|
const waitingAgent = event.toolName === "wait_for_task" && event.taskId ? subagentsRef.current.find(
|
|
@@ -64645,6 +65259,7 @@ ${plain(err)}`
|
|
|
64645
65259
|
setState(activeToolsRef.current.length > 0 ? "tool" : "thinking");
|
|
64646
65260
|
break;
|
|
64647
65261
|
}
|
|
65262
|
+
if (event.unknownTool) readSearchGroup.retract(`${event.turnId ?? ""}:${event.toolUseId}`);
|
|
64648
65263
|
const built = toolEndRows(event, done, {
|
|
64649
65264
|
...done ? { elapsedMs: Date.now() - done.startedAt } : {},
|
|
64650
65265
|
hasPlan: tasksRef.current.length > 0,
|
|
@@ -64655,7 +65270,21 @@ ${plain(err)}`
|
|
|
64655
65270
|
writeTaskBlock(st, null, tasksRef.current);
|
|
64656
65271
|
} else if (built.kind === "rows") {
|
|
64657
65272
|
const only = built.rows.length === 1 ? built.rows[0] : void 0;
|
|
64658
|
-
const
|
|
65273
|
+
const memberKey = `${event.turnId ?? ""}:${event.toolUseId}`;
|
|
65274
|
+
const command = only?.group?.commands[0];
|
|
65275
|
+
let kept = false;
|
|
65276
|
+
if (only?.group !== void 0) {
|
|
65277
|
+
if (command !== void 0) {
|
|
65278
|
+
readSearchGroup.start(
|
|
65279
|
+
memberKey,
|
|
65280
|
+
{ kind: "run", command, ...only.group.cell ? { cell: only.group.cell } : {} },
|
|
65281
|
+
only.detail ?? []
|
|
65282
|
+
);
|
|
65283
|
+
kept = true;
|
|
65284
|
+
} else {
|
|
65285
|
+
kept = readSearchGroup.finish(memberKey, only.detail ?? []);
|
|
65286
|
+
}
|
|
65287
|
+
}
|
|
64659
65288
|
if (!kept) for (const row2 of built.rows) pushRow(row2);
|
|
64660
65289
|
}
|
|
64661
65290
|
setState(activeToolsRef.current.length > 0 ? "tool" : "thinking");
|
|
@@ -64887,8 +65516,16 @@ ${plain(err)}`
|
|
|
64887
65516
|
}
|
|
64888
65517
|
const stopNotice = event.stopReason === "refused" && st.refusalRowShown ? void 0 : describeTurnStop(event.stopReason, event.budget);
|
|
64889
65518
|
if (stopNotice) pushSystem("warning", stopNotice);
|
|
64890
|
-
const
|
|
64891
|
-
if (
|
|
65519
|
+
const conversationId = scopeRef.current?.sessionId;
|
|
65520
|
+
if (outcomeToldRef.current.id !== conversationId)
|
|
65521
|
+
outcomeToldRef.current = { id: conversationId, telling: NOTHING_TOLD };
|
|
65522
|
+
const said = outcomeNotice(
|
|
65523
|
+
event.outcome,
|
|
65524
|
+
outcomeToldRef.current.telling,
|
|
65525
|
+
cannotTellReasonRef.current
|
|
65526
|
+
);
|
|
65527
|
+
outcomeToldRef.current.telling = said.telling;
|
|
65528
|
+
if (said.line) pushSystem("notice", said.line);
|
|
64892
65529
|
if (st.startedAt !== void 0) {
|
|
64893
65530
|
const since = st.startedAt;
|
|
64894
65531
|
const delegated = subagentsRef.current.filter(
|
|
@@ -65153,7 +65790,16 @@ ${jobLines.map(([, line]) => `- ${line}`).join("\n")}`] : []
|
|
|
65153
65790
|
void 0,
|
|
65154
65791
|
void 0,
|
|
65155
65792
|
void 0,
|
|
65156
|
-
humanPromptMeta(attached.length,
|
|
65793
|
+
humanPromptMeta(attached.length),
|
|
65794
|
+
void 0,
|
|
65795
|
+
void 0,
|
|
65796
|
+
void 0,
|
|
65797
|
+
void 0,
|
|
65798
|
+
void 0,
|
|
65799
|
+
attachmentRowsFor(
|
|
65800
|
+
prompt.kind === "human" ? prompt.recallText ?? text : text,
|
|
65801
|
+
attachments
|
|
65802
|
+
)
|
|
65157
65803
|
);
|
|
65158
65804
|
const tagLine = transcriptTagLine(turnTriggers, {
|
|
65159
65805
|
effort: pinnedEffort,
|
|
@@ -65340,7 +65986,16 @@ ${jobLines.map(([, line]) => `- ${line}`).join("\n")}`] : []
|
|
|
65340
65986
|
void 0,
|
|
65341
65987
|
void 0,
|
|
65342
65988
|
void 0,
|
|
65343
|
-
humanPromptMeta(input.attachedFiles,
|
|
65989
|
+
humanPromptMeta(input.attachedFiles, true),
|
|
65990
|
+
void 0,
|
|
65991
|
+
void 0,
|
|
65992
|
+
void 0,
|
|
65993
|
+
void 0,
|
|
65994
|
+
void 0,
|
|
65995
|
+
attachmentRowsFor(
|
|
65996
|
+
input.prompt.recallText ?? input.prompt.text,
|
|
65997
|
+
input.prompt.attachments
|
|
65998
|
+
)
|
|
65344
65999
|
);
|
|
65345
66000
|
}
|
|
65346
66001
|
setPendingSteers([]);
|
|
@@ -66205,7 +66860,7 @@ ${jobLines.map(([, line]) => `- ${line}`).join("\n")}`] : []
|
|
|
66205
66860
|
}
|
|
66206
66861
|
try {
|
|
66207
66862
|
const sameSignIn = accounts.registry.list("codex").find(
|
|
66208
|
-
(other) => other.source.kind === "codex-home" && readCodexCredentialFile(
|
|
66863
|
+
(other) => other.source.kind === "codex-home" && readCodexCredentialFile(join10(other.source.dir, "auth.json"))?.accountId === result.accountId
|
|
66209
66864
|
);
|
|
66210
66865
|
if (sameSignIn) {
|
|
66211
66866
|
rmSync2(dir, { recursive: true, force: true });
|
|
@@ -70216,6 +70871,7 @@ ${plugins.map((plugin) => {
|
|
|
70216
70871
|
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
70217
70872
|
Composer,
|
|
70218
70873
|
{
|
|
70874
|
+
attachmentFloor,
|
|
70219
70875
|
...viewingAgent ? {
|
|
70220
70876
|
placeholder: `Message @${[...viewingAgent.agentId].slice(0, 20).join("")}\u2026`
|
|
70221
70877
|
} : examplePrompts && history.length === 0 && !messages.some((message) => message.role === "user") ? {
|
|
@@ -71005,12 +71661,12 @@ var FULLSCREEN_PANIC_RESET = `${MOUSE_OFF}\x1B[?2004l\x1B[?25h`;
|
|
|
71005
71661
|
|
|
71006
71662
|
// src/tui/hint-counts.ts
|
|
71007
71663
|
import { randomUUID } from "node:crypto";
|
|
71008
|
-
import { mkdirSync as
|
|
71009
|
-
import { dirname as dirname2, join as
|
|
71664
|
+
import { mkdirSync as mkdirSync5, readFileSync as readFileSync8, renameSync as renameSync4, rmSync as rmSync3, writeFileSync as writeFileSync4 } from "node:fs";
|
|
71665
|
+
import { dirname as dirname2, join as join11 } from "node:path";
|
|
71010
71666
|
var FILE_MODE = 384;
|
|
71011
71667
|
var DIR_MODE = 448;
|
|
71012
71668
|
function hintCountsPath(home) {
|
|
71013
|
-
return
|
|
71669
|
+
return join11(namzuHomePath(home), "hint-counts.json");
|
|
71014
71670
|
}
|
|
71015
71671
|
__name(hintCountsPath, "hintCountsPath");
|
|
71016
71672
|
function readAll(path) {
|
|
@@ -71035,12 +71691,12 @@ function writeHintCount(name, count2, home) {
|
|
|
71035
71691
|
const path = hintCountsPath(home);
|
|
71036
71692
|
const temp = `${path}.${randomUUID()}.tmp`;
|
|
71037
71693
|
try {
|
|
71038
|
-
|
|
71039
|
-
|
|
71694
|
+
mkdirSync5(dirname2(path), { recursive: true, mode: DIR_MODE });
|
|
71695
|
+
writeFileSync4(temp, `${JSON.stringify({ ...readAll(path), [name]: count2 }, null, 2)}
|
|
71040
71696
|
`, {
|
|
71041
71697
|
mode: FILE_MODE
|
|
71042
71698
|
});
|
|
71043
|
-
|
|
71699
|
+
renameSync4(temp, path);
|
|
71044
71700
|
} catch {
|
|
71045
71701
|
rmSync3(temp, { force: true });
|
|
71046
71702
|
}
|
|
@@ -71249,13 +71905,13 @@ __name(askTerminal, "askTerminal");
|
|
|
71249
71905
|
|
|
71250
71906
|
// src/tui/tip-history.ts
|
|
71251
71907
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
71252
|
-
import { mkdirSync as
|
|
71253
|
-
import { dirname as dirname3, join as
|
|
71908
|
+
import { mkdirSync as mkdirSync6, readFileSync as readFileSync9, renameSync as renameSync5, rmSync as rmSync4, writeFileSync as writeFileSync5 } from "node:fs";
|
|
71909
|
+
import { dirname as dirname3, join as join12 } from "node:path";
|
|
71254
71910
|
var FILE_MODE2 = 384;
|
|
71255
71911
|
var DIR_MODE2 = 448;
|
|
71256
71912
|
var EMPTY_TIP_HISTORY = { launches: 0, shown: {}, used: {} };
|
|
71257
71913
|
function tipHistoryPath(home) {
|
|
71258
|
-
return
|
|
71914
|
+
return join12(namzuHomePath(home), "tip-history.json");
|
|
71259
71915
|
}
|
|
71260
71916
|
__name(tipHistoryPath, "tipHistoryPath");
|
|
71261
71917
|
function wholeNumber(value) {
|
|
@@ -71289,10 +71945,10 @@ __name(readTipHistory, "readTipHistory");
|
|
|
71289
71945
|
function writeTipHistory(path, history) {
|
|
71290
71946
|
const temp = `${path}.${randomUUID2()}.tmp`;
|
|
71291
71947
|
try {
|
|
71292
|
-
|
|
71293
|
-
|
|
71948
|
+
mkdirSync6(dirname3(path), { recursive: true, mode: DIR_MODE2 });
|
|
71949
|
+
writeFileSync5(temp, `${JSON.stringify(history, null, 2)}
|
|
71294
71950
|
`, { mode: FILE_MODE2 });
|
|
71295
|
-
|
|
71951
|
+
renameSync5(temp, path);
|
|
71296
71952
|
} catch {
|
|
71297
71953
|
try {
|
|
71298
71954
|
rmSync4(temp, { force: true });
|
|
@@ -71531,7 +72187,7 @@ async function launchTui(ctx, options = {}) {
|
|
|
71531
72187
|
current: null
|
|
71532
72188
|
};
|
|
71533
72189
|
const workspacesEntry = /* @__PURE__ */ __name(() => {
|
|
71534
|
-
workspaces.current ??= import("./entry-
|
|
72190
|
+
workspaces.current ??= import("./entry-EBSTYPZD.js").then(
|
|
71535
72191
|
(m) => m.createWorkspacesEntry({
|
|
71536
72192
|
proxy,
|
|
71537
72193
|
realOut: process.stdout,
|
|
@@ -71761,4 +72417,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
71761
72417
|
* LICENSE file in the root directory of this source tree.
|
|
71762
72418
|
*)
|
|
71763
72419
|
*/
|
|
71764
|
-
//# sourceMappingURL=tui-
|
|
72420
|
+
//# sourceMappingURL=tui-W7I4CLSF.js.map
|