@namzu/cli 48.0.0 → 49.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/dist/bin.js +1 -1
- package/dist/chunks/{acp-QUCU36XL.js → acp-YPJ27JQK.js} +53 -47
- package/dist/chunks/{acp-QUCU36XL.js.map → acp-YPJ27JQK.js.map} +1 -1
- package/dist/chunks/{activity-command-W6575T4W.js → activity-command-5XZJLJH5.js} +12 -12
- package/dist/chunks/{add-GLFGOQVN.js → add-37AHNBYS.js} +19 -19
- package/dist/chunks/{agent-VBCJRRQU.js → agent-PNIZE5HR.js} +35 -35
- package/dist/chunks/agent-session-ONKOQQ5Y.js +69 -0
- package/dist/chunks/{archive-QEPJAF7T.js → archive-A7SSRR76.js} +10 -10
- package/dist/chunks/{bin-main-D4Q3AFND.js → bin-main-G4E4SR4J.js} +7 -7
- package/dist/chunks/{binding-CEZSAC3K.js → binding-AIMTFLZW.js} +3 -3
- package/dist/chunks/{browser-XZZSBZG7.js → browser-F5Y3IT6U.js} +6 -6
- package/dist/chunks/{chat-ESJVUJKJ.js → chat-DIF26XMR.js} +15 -15
- package/dist/chunks/{chunk-BYQSDH2F.js → chunk-2LZA3UMD.js} +2 -2
- package/dist/chunks/{chunk-YRBLDFMI.js → chunk-2PMNQ6HR.js} +788 -230
- package/dist/chunks/chunk-2PMNQ6HR.js.map +6 -0
- package/dist/chunks/{chunk-QKE5HLHV.js → chunk-2WJQTSRQ.js} +12 -12
- package/dist/chunks/{chunk-WUSDW5Z5.js → chunk-37AR6YJQ.js} +2 -2
- package/dist/chunks/{chunk-YVV5ZHID.js → chunk-4AZTZXPQ.js} +4 -4
- package/dist/chunks/{chunk-MHF4AD7R.js → chunk-4IOUN4SV.js} +5 -5
- package/dist/chunks/{chunk-E7STKX6D.js → chunk-4L3LPJ4M.js} +2 -2
- package/dist/chunks/{chunk-5BA47MKJ.js → chunk-4PF6DIYU.js} +2 -2
- package/dist/chunks/{chunk-QSIMY7WM.js → chunk-4Z5ONGFB.js} +2 -2
- package/dist/chunks/{chunk-5NOMF3HN.js → chunk-5I4QGJER.js} +9 -9
- package/dist/chunks/{chunk-K5IWQLOE.js → chunk-6COUMXPW.js} +3 -3
- package/dist/chunks/{chunk-HF22LWEO.js → chunk-6KBZJBBN.js} +6 -6
- package/dist/chunks/{chunk-RXUDOOPL.js → chunk-6MEYPHDQ.js} +954 -172
- package/dist/chunks/chunk-6MEYPHDQ.js.map +6 -0
- package/dist/chunks/{chunk-HAYKZJ4W.js → chunk-6PURQMHH.js} +3 -3
- package/dist/chunks/{chunk-IQCUP4GF.js → chunk-6QOP2PHC.js} +2 -2
- package/dist/chunks/{chunk-ZKBZZ4SV.js → chunk-7HU7BYTT.js} +3 -3
- package/dist/chunks/{chunk-SJTDYH2Q.js → chunk-7TWA4BQX.js} +1897 -1667
- package/dist/chunks/chunk-7TWA4BQX.js.map +6 -0
- package/dist/chunks/{chunk-6EP5UWMA.js → chunk-7VF7HGMF.js} +3 -3
- package/dist/chunks/{chunk-CKAVXPSD.js → chunk-7X2NHTHU.js} +3 -3
- package/dist/chunks/{chunk-XD26GMKP.js → chunk-A425M7RP.js} +2 -2
- package/dist/chunks/{chunk-A3H6DYWZ.js → chunk-AHM54PGY.js} +3 -3
- package/dist/chunks/{chunk-FXPGZQWX.js → chunk-BERMCELL.js} +2 -2
- package/dist/chunks/{chunk-HLJHOUY5.js → chunk-BWOSM4EO.js} +3 -3
- package/dist/chunks/{chunk-UXYOP32R.js → chunk-C4C4Y2VT.js} +2 -2
- package/dist/chunks/{chunk-XRNUFV7Q.js → chunk-C5YVEX36.js} +2 -2
- package/dist/chunks/{chunk-A7RJ323Z.js → chunk-CBIXPHOV.js} +4 -4
- package/dist/chunks/{chunk-X4XZVFAV.js → chunk-D4DY4FZX.js} +4 -4
- package/dist/chunks/{chunk-JIUBDOX4.js → chunk-DJZ5W4ML.js} +2 -2
- package/dist/chunks/{chunk-VRO3BSVC.js → chunk-DLPWM4YC.js} +9 -9
- package/dist/chunks/{chunk-5EIUKBFJ.js → chunk-DXEAJL7W.js} +5 -2
- package/dist/chunks/chunk-DXEAJL7W.js.map +6 -0
- package/dist/chunks/{chunk-2FHIHK3T.js → chunk-EGPWQL55.js} +3 -3
- package/dist/chunks/{chunk-BFBE2M7Q.js → chunk-ESHBGSXA.js} +3 -3
- package/dist/chunks/{chunk-6YIA342V.js → chunk-GKPKHFMK.js} +4 -4
- package/dist/chunks/{chunk-7M3ACGKA.js → chunk-HD74DQ3Z.js} +2 -2
- package/dist/chunks/{chunk-QQM7JSEY.js → chunk-HREKLDJP.js} +4 -4
- package/dist/chunks/{chunk-C3F76W74.js → chunk-HYF3OKB7.js} +4 -4
- package/dist/chunks/{chunk-AHSWXUMT.js → chunk-IDJTFYNK.js} +12 -110
- package/dist/chunks/chunk-IDJTFYNK.js.map +6 -0
- package/dist/chunks/{chunk-UT5XJ2JQ.js → chunk-J65SOO5P.js} +3 -3
- package/dist/chunks/chunk-JBBB5EG2.js +3039 -0
- package/dist/chunks/chunk-JBBB5EG2.js.map +6 -0
- package/dist/chunks/{chunk-V3MC2IFR.js → chunk-JDUZFFX3.js} +2 -2
- package/dist/chunks/{chunk-UVR7C4T5.js → chunk-JRX5IIMR.js} +5 -5
- package/dist/chunks/{chunk-ZSJUNNOB.js → chunk-KEMOXQGR.js} +10 -10
- package/dist/chunks/{chunk-X3YRAYJU.js → chunk-KMTM4NNH.js} +4 -4
- package/dist/chunks/{chunk-66YF5N2J.js → chunk-NPH7ZTH4.js} +2 -2
- package/dist/chunks/{chunk-HZU57YBL.js → chunk-NQSEDCTH.js} +114 -2
- package/dist/chunks/{chunk-HZU57YBL.js.map → chunk-NQSEDCTH.js.map} +2 -2
- package/dist/chunks/{chunk-26JTVEWV.js → chunk-O6DNY5EM.js} +3 -3
- package/dist/chunks/{chunk-N47CNO6M.js → chunk-OBDGNMPB.js} +7 -7
- package/dist/chunks/{chunk-LHCRLCMO.js → chunk-PPVNYNKK.js} +2 -2
- package/dist/chunks/{chunk-HMAF5UAO.js → chunk-QIVWFRYO.js} +4 -4
- package/dist/chunks/{chunk-MGLG65W5.js → chunk-QSGYZU46.js} +10 -10
- package/dist/chunks/{chunk-F3ZHJSWR.js → chunk-RAPB7HY3.js} +6 -6
- package/dist/chunks/{chunk-ONLVC5X5.js → chunk-RNMU75CI.js} +2 -2
- package/dist/chunks/{chunk-JHDNGNQT.js → chunk-SF5VE66A.js} +2 -2
- package/dist/chunks/{chunk-GYIRPQFB.js → chunk-SIYXJ6PT.js} +2 -2
- package/dist/chunks/{chunk-SPLCWH4W.js → chunk-STEWNJWS.js} +42 -11
- package/dist/chunks/chunk-STEWNJWS.js.map +6 -0
- package/dist/chunks/{chunk-AWRDGYDV.js → chunk-SVH5P7TU.js} +13 -13
- package/dist/chunks/{chunk-7R42TMRR.js → chunk-SY2AJ6LM.js} +2 -2
- package/dist/chunks/{chunk-QROBMHWX.js → chunk-TVBD2LZV.js} +3 -3
- package/dist/chunks/{chunk-YJV5ARUB.js → chunk-TWEFDQ7C.js} +2 -2
- package/dist/chunks/{chunk-6E63NHFK.js → chunk-TWZ5PJH2.js} +5 -5
- package/dist/chunks/{chunk-6DTG2DJM.js → chunk-UANL44QG.js} +2 -2
- package/dist/chunks/{chunk-ESXU3WTP.js → chunk-UH7EP7TA.js} +2 -2
- package/dist/chunks/{chunk-NLVUDQEQ.js → chunk-USTCATWP.js} +4 -4
- package/dist/chunks/{chunk-2EPEWMI7.js → chunk-UXFW6KD7.js} +2 -2
- package/dist/chunks/{chunk-U6LKWLSO.js → chunk-VIBYGZFX.js} +2 -2
- package/dist/chunks/{chunk-RBH5ZABR.js → chunk-W27IOJQ5.js} +6 -6
- package/dist/chunks/{chunk-XX6ZE5ZO.js → chunk-WCJBKSGT.js} +2 -2
- package/dist/chunks/{chunk-UYP5QIPH.js → chunk-WVLBFEBP.js} +3 -3
- package/dist/chunks/{chunk-WYT7R7OV.js → chunk-XPW3PSVI.js} +3 -3
- package/dist/chunks/{chunk-JHGICKYH.js → chunk-Y2RIV5UX.js} +225 -16
- package/dist/chunks/chunk-Y2RIV5UX.js.map +6 -0
- package/dist/chunks/{chunk-JWMBGGFY.js → chunk-Y67ML2IN.js} +2 -2
- package/dist/chunks/{chunk-ZEHU7KPN.js → chunk-YWZ3IMAS.js} +2 -2
- package/dist/chunks/{chunk-DDXZZ7TR.js → chunk-Z43EXCUP.js} +3 -3
- package/dist/chunks/{chunk-KCVKLMKN.js → chunk-ZKLDG2CM.js} +3 -3
- package/dist/chunks/{chunk-LE4QZ6HS.js → chunk-ZWJPQH5F.js} +3 -3
- package/dist/chunks/{chunk-T5MEHPLZ.js → chunk-ZYIPLUWS.js} +41 -34
- package/dist/chunks/chunk-ZYIPLUWS.js.map +6 -0
- package/dist/chunks/{cli-runtime-YLIWHNME.js → cli-runtime-KHIX5OG4.js} +11 -10
- package/dist/chunks/cli-runtime-KHIX5OG4.js.map +6 -0
- package/dist/chunks/{commands-WT4OLTGL.js → commands-OGOMUDPT.js} +5 -5
- package/dist/chunks/{crash-report-BTL3U5HH.js → crash-report-VXC7CJDY.js} +6 -6
- package/dist/chunks/{dist-4TCR3HDF.js → dist-AA4JNWT2.js} +2 -2
- package/dist/chunks/{dist-3R6SQ3VB.js → dist-EL2RMYNK.js} +4 -2
- package/dist/chunks/{dist-X7K5G5NH.js → dist-LUUDW6KE.js} +2 -2
- package/dist/chunks/{dist-LRK6JYLM.js → dist-O4Y5VCRK.js} +2 -2
- package/dist/chunks/{dist-3PNUHQCO.js → dist-POXH7TX7.js} +2 -2
- package/dist/chunks/{dist-N4TBL3SN.js → dist-Q5YPDPOH.js} +2 -2
- package/dist/chunks/{dist-2NYSROLX.js → dist-Q7Z5SE4S.js} +294 -40
- package/dist/chunks/dist-Q7Z5SE4S.js.map +6 -0
- package/dist/chunks/{dist-OHQWXZ7N.js → dist-Z62XBGQ7.js} +2 -2
- package/dist/chunks/{doctor-5JQK6UNK.js → doctor-5IRXJ7DK.js} +17 -17
- package/dist/chunks/{drain-EHO3BUHW.js → drain-A44YWORN.js} +9 -9
- package/dist/chunks/{entry-F2EIOWAT.js → entry-ODCHCJ3O.js} +6 -6
- package/dist/chunks/{eval-7YEMHHIB.js → eval-35ZBHZLK.js} +2 -2
- package/dist/chunks/{exec-WV7BS5UD.js → exec-TPOW33QE.js} +34 -34
- package/dist/chunks/{home-GOMDEEXP.js → home-F4YAXKWJ.js} +3 -3
- package/dist/chunks/{host-MNPHBQWG.js → host-V7LVA7QU.js} +10 -10
- package/dist/chunks/{host-queries-SKWE7PF5.js → host-queries-2HRJZ2TH.js} +15 -15
- package/dist/chunks/{install-LVQAT4QP.js → install-F6PU4SYH.js} +2 -2
- package/dist/chunks/{learn-BUEAUHTD.js → learn-NLECFL5B.js} +11 -11
- package/dist/chunks/{learn-builtin-XZFBPA3W.js → learn-builtin-XLID77I3.js} +14 -14
- package/dist/chunks/{lifecycle-HMSOBI6F.js → lifecycle-UQL62JPO.js} +28 -28
- package/dist/chunks/{list-HNSWMLVN.js → list-4PS7WAPI.js} +11 -10
- package/dist/chunks/list-4PS7WAPI.js.map +6 -0
- package/dist/chunks/{live-ER3OZKC6.js → live-GBK7RIX2.js} +16 -16
- package/dist/chunks/{login-EBEFMEA2.js → login-7LGGUBI5.js} +13 -13
- package/dist/chunks/{logs-5UJZYNN2.js → logs-VYY2CWAN.js} +4 -4
- package/dist/chunks/{mcp-BLERKK2H.js → mcp-QL4TOTV5.js} +33 -22
- package/dist/chunks/mcp-QL4TOTV5.js.map +6 -0
- package/dist/chunks/{message-command-XH2M4BTB.js → message-command-SCSTDFSA.js} +41 -41
- package/dist/chunks/{open-ZYWPDOR6.js → open-QSZFHDIW.js} +8 -8
- package/dist/chunks/{operator-tools-CZ2SXR3G.js → operator-tools-WF2UGZ5G.js} +13 -13
- package/dist/chunks/{output-schema-MFZZP7GF.js → output-schema-P3WXODDE.js} +3 -3
- package/dist/chunks/{pal-7OYQHUKF.js → pal-JLSBOTEO.js} +16 -16
- package/dist/chunks/{peers-V3Z3ZQSN.js → peers-HDPCIVBY.js} +7 -7
- package/dist/chunks/{peers-FCVTBNI5.js → peers-IMCPUY6R.js} +6 -6
- package/dist/chunks/{providers-43RE2SWA.js → providers-YXH2C5HE.js} +11 -11
- package/dist/chunks/{pty-QSS3UQ7C.js → pty-74F5BMD3.js} +3 -3
- package/dist/chunks/resume-M63SJGJ4.js +23 -0
- package/dist/chunks/{resume-command-WZY42BAB.js → resume-command-LFK2PQYH.js} +4 -4
- package/dist/chunks/{schedule-LHXNUQHJ.js → schedule-5ZYAZJIM.js} +8 -8
- package/dist/chunks/{service-ZU5YIBW4.js → service-LTYPMKWG.js} +28 -28
- package/dist/chunks/{skills-K2MFIY4H.js → skills-KUT4QD3K.js} +8 -8
- package/dist/chunks/{start-check-AODGFYJD.js → start-check-SYGALC5U.js} +2 -2
- package/dist/chunks/{startup-failure-B6ESBTLZ.js → startup-failure-YKREQTPO.js} +2 -2
- package/dist/chunks/{state-ZWXVSLS2.js → state-MQXTG6O3.js} +2 -2
- package/dist/chunks/{store-JAI2RWQT.js → store-EO3HNNFC.js} +3 -3
- package/dist/chunks/{store-NKISDMPC.js → store-J4UP5MJ3.js} +10 -10
- package/dist/chunks/{store-MNI5IJHC.js → store-KC43NWR4.js} +6 -6
- package/dist/chunks/{store-U6SG2CON.js → store-KW3NJHWV.js} +4 -4
- package/dist/chunks/{tui-TM5QW6KY.js → tui-DPTVVKBE.js} +3009 -1199
- package/dist/chunks/tui-DPTVVKBE.js.map +6 -0
- package/dist/chunks/{undici-LWANNIOV.js → undici-RMBWH37N.js} +999 -445
- package/dist/chunks/undici-RMBWH37N.js.map +6 -0
- package/dist/chunks/{upgrade-27ZDBTX7.js → upgrade-WI5CFBGG.js} +7 -7
- package/dist/chunks/{workspaces-X7W7ZQU3.js → workspaces-VQ7VHN7N.js} +16 -16
- package/dist/chunks/{worktree-SIA6C5NS.js → worktree-KSDU4MTM.js} +12 -12
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/acp.d.ts +10 -1
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/mcp-oauth-login.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/index.js +20 -20
- package/dist/integrations/decision/connection.d.ts +89 -0
- package/dist/integrations/decision/connection.d.ts.map +1 -0
- package/dist/integrations/decision/model.d.ts +21 -8
- package/dist/integrations/decision/model.d.ts.map +1 -1
- package/dist/integrations/decision/openrouter.d.ts +68 -0
- package/dist/integrations/decision/openrouter.d.ts.map +1 -0
- package/dist/integrations/decision/paste.d.ts +19 -0
- package/dist/integrations/decision/paste.d.ts.map +1 -0
- package/dist/integrations/decision/setup.d.ts +62 -0
- package/dist/integrations/decision/setup.d.ts.map +1 -0
- package/dist/integrations/decision/token.d.ts +34 -0
- package/dist/integrations/decision/token.d.ts.map +1 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/memory/curation-runtime.d.ts +8 -1
- package/dist/memory/curation-runtime.d.ts.map +1 -1
- package/dist/memory/lifecycle.d.ts +62 -0
- package/dist/memory/lifecycle.d.ts.map +1 -0
- package/dist/memory/manage.d.ts +37 -2
- package/dist/memory/manage.d.ts.map +1 -1
- package/dist/memory/sweep.d.ts +66 -0
- package/dist/memory/sweep.d.ts.map +1 -0
- package/dist/memory/usage.d.ts +79 -0
- package/dist/memory/usage.d.ts.map +1 -0
- package/dist/tui/App.d.ts +28 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/StatusBar.d.ts +5 -1
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +15 -2
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/decision-setup-flow.d.ts +57 -0
- package/dist/tui/decision-setup-flow.d.ts.map +1 -0
- package/dist/tui/fast-mode.d.ts +24 -0
- package/dist/tui/fast-mode.d.ts.map +1 -0
- package/dist/tui/fullscreen/FullscreenTranscript.d.ts +30 -2
- package/dist/tui/fullscreen/FullscreenTranscript.d.ts.map +1 -1
- package/dist/tui/fullscreen/cells.d.ts +26 -0
- package/dist/tui/fullscreen/cells.d.ts.map +1 -0
- package/dist/tui/fullscreen/joiners.d.ts +17 -0
- package/dist/tui/fullscreen/joiners.d.ts.map +1 -0
- package/dist/tui/fullscreen/layout.d.ts +16 -3
- package/dist/tui/fullscreen/layout.d.ts.map +1 -1
- package/dist/tui/fullscreen/markdown-rows.d.ts +24 -0
- package/dist/tui/fullscreen/markdown-rows.d.ts.map +1 -0
- package/dist/tui/fullscreen/mouse-wheel.d.ts +16 -7
- package/dist/tui/fullscreen/mouse-wheel.d.ts.map +1 -1
- package/dist/tui/fullscreen/paint.d.ts +19 -0
- package/dist/tui/fullscreen/paint.d.ts.map +1 -0
- package/dist/tui/fullscreen/rows.d.ts +35 -0
- package/dist/tui/fullscreen/rows.d.ts.map +1 -0
- package/dist/tui/fullscreen/search.d.ts +69 -0
- package/dist/tui/fullscreen/search.d.ts.map +1 -0
- package/dist/tui/fullscreen/selection.d.ts +66 -0
- package/dist/tui/fullscreen/selection.d.ts.map +1 -0
- package/dist/tui/fullscreen/viewport.d.ts +5 -0
- package/dist/tui/fullscreen/viewport.d.ts.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/keymap.d.ts +2 -0
- package/dist/tui/keymap.d.ts.map +1 -1
- package/dist/tui/launch-settings.d.ts +2 -0
- package/dist/tui/launch-settings.d.ts.map +1 -1
- package/dist/tui/model-refusal.d.ts +3 -1
- package/dist/tui/model-refusal.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +9 -0
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/transcript-scroll.d.ts +2 -0
- package/dist/tui/transcript-scroll.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/chunks/agent-session-FZI6GVBH.js +0 -69
- package/dist/chunks/chunk-5EIUKBFJ.js.map +0 -6
- package/dist/chunks/chunk-AHSWXUMT.js.map +0 -6
- package/dist/chunks/chunk-JHGICKYH.js.map +0 -6
- package/dist/chunks/chunk-RXUDOOPL.js.map +0 -6
- package/dist/chunks/chunk-SJTDYH2Q.js.map +0 -6
- package/dist/chunks/chunk-SPLCWH4W.js.map +0 -6
- package/dist/chunks/chunk-T5MEHPLZ.js.map +0 -6
- package/dist/chunks/chunk-YBRLTSWM.js +0 -680
- package/dist/chunks/chunk-YBRLTSWM.js.map +0 -6
- package/dist/chunks/chunk-YRBLDFMI.js.map +0 -6
- package/dist/chunks/cli-runtime-YLIWHNME.js.map +0 -6
- package/dist/chunks/dist-2NYSROLX.js.map +0 -6
- package/dist/chunks/list-HNSWMLVN.js.map +0 -6
- package/dist/chunks/mcp-BLERKK2H.js.map +0 -6
- package/dist/chunks/resume-WN2TIOQK.js +0 -23
- package/dist/chunks/tui-TM5QW6KY.js.map +0 -6
- package/dist/chunks/undici-LWANNIOV.js.map +0 -6
- /package/dist/chunks/{activity-command-W6575T4W.js.map → activity-command-5XZJLJH5.js.map} +0 -0
- /package/dist/chunks/{add-GLFGOQVN.js.map → add-37AHNBYS.js.map} +0 -0
- /package/dist/chunks/{agent-VBCJRRQU.js.map → agent-PNIZE5HR.js.map} +0 -0
- /package/dist/chunks/{agent-session-FZI6GVBH.js.map → agent-session-ONKOQQ5Y.js.map} +0 -0
- /package/dist/chunks/{archive-QEPJAF7T.js.map → archive-A7SSRR76.js.map} +0 -0
- /package/dist/chunks/{bin-main-D4Q3AFND.js.map → bin-main-G4E4SR4J.js.map} +0 -0
- /package/dist/chunks/{binding-CEZSAC3K.js.map → binding-AIMTFLZW.js.map} +0 -0
- /package/dist/chunks/{browser-XZZSBZG7.js.map → browser-F5Y3IT6U.js.map} +0 -0
- /package/dist/chunks/{chat-ESJVUJKJ.js.map → chat-DIF26XMR.js.map} +0 -0
- /package/dist/chunks/{chunk-BYQSDH2F.js.map → chunk-2LZA3UMD.js.map} +0 -0
- /package/dist/chunks/{chunk-QKE5HLHV.js.map → chunk-2WJQTSRQ.js.map} +0 -0
- /package/dist/chunks/{chunk-WUSDW5Z5.js.map → chunk-37AR6YJQ.js.map} +0 -0
- /package/dist/chunks/{chunk-YVV5ZHID.js.map → chunk-4AZTZXPQ.js.map} +0 -0
- /package/dist/chunks/{chunk-MHF4AD7R.js.map → chunk-4IOUN4SV.js.map} +0 -0
- /package/dist/chunks/{chunk-E7STKX6D.js.map → chunk-4L3LPJ4M.js.map} +0 -0
- /package/dist/chunks/{chunk-5BA47MKJ.js.map → chunk-4PF6DIYU.js.map} +0 -0
- /package/dist/chunks/{chunk-QSIMY7WM.js.map → chunk-4Z5ONGFB.js.map} +0 -0
- /package/dist/chunks/{chunk-5NOMF3HN.js.map → chunk-5I4QGJER.js.map} +0 -0
- /package/dist/chunks/{chunk-K5IWQLOE.js.map → chunk-6COUMXPW.js.map} +0 -0
- /package/dist/chunks/{chunk-HF22LWEO.js.map → chunk-6KBZJBBN.js.map} +0 -0
- /package/dist/chunks/{chunk-HAYKZJ4W.js.map → chunk-6PURQMHH.js.map} +0 -0
- /package/dist/chunks/{chunk-IQCUP4GF.js.map → chunk-6QOP2PHC.js.map} +0 -0
- /package/dist/chunks/{chunk-ZKBZZ4SV.js.map → chunk-7HU7BYTT.js.map} +0 -0
- /package/dist/chunks/{chunk-6EP5UWMA.js.map → chunk-7VF7HGMF.js.map} +0 -0
- /package/dist/chunks/{chunk-CKAVXPSD.js.map → chunk-7X2NHTHU.js.map} +0 -0
- /package/dist/chunks/{chunk-XD26GMKP.js.map → chunk-A425M7RP.js.map} +0 -0
- /package/dist/chunks/{chunk-A3H6DYWZ.js.map → chunk-AHM54PGY.js.map} +0 -0
- /package/dist/chunks/{chunk-FXPGZQWX.js.map → chunk-BERMCELL.js.map} +0 -0
- /package/dist/chunks/{chunk-HLJHOUY5.js.map → chunk-BWOSM4EO.js.map} +0 -0
- /package/dist/chunks/{chunk-UXYOP32R.js.map → chunk-C4C4Y2VT.js.map} +0 -0
- /package/dist/chunks/{chunk-XRNUFV7Q.js.map → chunk-C5YVEX36.js.map} +0 -0
- /package/dist/chunks/{chunk-A7RJ323Z.js.map → chunk-CBIXPHOV.js.map} +0 -0
- /package/dist/chunks/{chunk-X4XZVFAV.js.map → chunk-D4DY4FZX.js.map} +0 -0
- /package/dist/chunks/{chunk-JIUBDOX4.js.map → chunk-DJZ5W4ML.js.map} +0 -0
- /package/dist/chunks/{chunk-VRO3BSVC.js.map → chunk-DLPWM4YC.js.map} +0 -0
- /package/dist/chunks/{chunk-2FHIHK3T.js.map → chunk-EGPWQL55.js.map} +0 -0
- /package/dist/chunks/{chunk-BFBE2M7Q.js.map → chunk-ESHBGSXA.js.map} +0 -0
- /package/dist/chunks/{chunk-6YIA342V.js.map → chunk-GKPKHFMK.js.map} +0 -0
- /package/dist/chunks/{chunk-7M3ACGKA.js.map → chunk-HD74DQ3Z.js.map} +0 -0
- /package/dist/chunks/{chunk-QQM7JSEY.js.map → chunk-HREKLDJP.js.map} +0 -0
- /package/dist/chunks/{chunk-C3F76W74.js.map → chunk-HYF3OKB7.js.map} +0 -0
- /package/dist/chunks/{chunk-UT5XJ2JQ.js.map → chunk-J65SOO5P.js.map} +0 -0
- /package/dist/chunks/{chunk-V3MC2IFR.js.map → chunk-JDUZFFX3.js.map} +0 -0
- /package/dist/chunks/{chunk-UVR7C4T5.js.map → chunk-JRX5IIMR.js.map} +0 -0
- /package/dist/chunks/{chunk-ZSJUNNOB.js.map → chunk-KEMOXQGR.js.map} +0 -0
- /package/dist/chunks/{chunk-X3YRAYJU.js.map → chunk-KMTM4NNH.js.map} +0 -0
- /package/dist/chunks/{chunk-66YF5N2J.js.map → chunk-NPH7ZTH4.js.map} +0 -0
- /package/dist/chunks/{chunk-26JTVEWV.js.map → chunk-O6DNY5EM.js.map} +0 -0
- /package/dist/chunks/{chunk-N47CNO6M.js.map → chunk-OBDGNMPB.js.map} +0 -0
- /package/dist/chunks/{chunk-LHCRLCMO.js.map → chunk-PPVNYNKK.js.map} +0 -0
- /package/dist/chunks/{chunk-HMAF5UAO.js.map → chunk-QIVWFRYO.js.map} +0 -0
- /package/dist/chunks/{chunk-MGLG65W5.js.map → chunk-QSGYZU46.js.map} +0 -0
- /package/dist/chunks/{chunk-F3ZHJSWR.js.map → chunk-RAPB7HY3.js.map} +0 -0
- /package/dist/chunks/{chunk-ONLVC5X5.js.map → chunk-RNMU75CI.js.map} +0 -0
- /package/dist/chunks/{chunk-JHDNGNQT.js.map → chunk-SF5VE66A.js.map} +0 -0
- /package/dist/chunks/{chunk-GYIRPQFB.js.map → chunk-SIYXJ6PT.js.map} +0 -0
- /package/dist/chunks/{chunk-AWRDGYDV.js.map → chunk-SVH5P7TU.js.map} +0 -0
- /package/dist/chunks/{chunk-7R42TMRR.js.map → chunk-SY2AJ6LM.js.map} +0 -0
- /package/dist/chunks/{chunk-QROBMHWX.js.map → chunk-TVBD2LZV.js.map} +0 -0
- /package/dist/chunks/{chunk-YJV5ARUB.js.map → chunk-TWEFDQ7C.js.map} +0 -0
- /package/dist/chunks/{chunk-6E63NHFK.js.map → chunk-TWZ5PJH2.js.map} +0 -0
- /package/dist/chunks/{chunk-6DTG2DJM.js.map → chunk-UANL44QG.js.map} +0 -0
- /package/dist/chunks/{chunk-ESXU3WTP.js.map → chunk-UH7EP7TA.js.map} +0 -0
- /package/dist/chunks/{chunk-NLVUDQEQ.js.map → chunk-USTCATWP.js.map} +0 -0
- /package/dist/chunks/{chunk-2EPEWMI7.js.map → chunk-UXFW6KD7.js.map} +0 -0
- /package/dist/chunks/{chunk-U6LKWLSO.js.map → chunk-VIBYGZFX.js.map} +0 -0
- /package/dist/chunks/{chunk-RBH5ZABR.js.map → chunk-W27IOJQ5.js.map} +0 -0
- /package/dist/chunks/{chunk-XX6ZE5ZO.js.map → chunk-WCJBKSGT.js.map} +0 -0
- /package/dist/chunks/{chunk-UYP5QIPH.js.map → chunk-WVLBFEBP.js.map} +0 -0
- /package/dist/chunks/{chunk-WYT7R7OV.js.map → chunk-XPW3PSVI.js.map} +0 -0
- /package/dist/chunks/{chunk-JWMBGGFY.js.map → chunk-Y67ML2IN.js.map} +0 -0
- /package/dist/chunks/{chunk-ZEHU7KPN.js.map → chunk-YWZ3IMAS.js.map} +0 -0
- /package/dist/chunks/{chunk-DDXZZ7TR.js.map → chunk-Z43EXCUP.js.map} +0 -0
- /package/dist/chunks/{chunk-KCVKLMKN.js.map → chunk-ZKLDG2CM.js.map} +0 -0
- /package/dist/chunks/{chunk-LE4QZ6HS.js.map → chunk-ZWJPQH5F.js.map} +0 -0
- /package/dist/chunks/{commands-WT4OLTGL.js.map → commands-OGOMUDPT.js.map} +0 -0
- /package/dist/chunks/{crash-report-BTL3U5HH.js.map → crash-report-VXC7CJDY.js.map} +0 -0
- /package/dist/chunks/{dist-4TCR3HDF.js.map → dist-AA4JNWT2.js.map} +0 -0
- /package/dist/chunks/{dist-3R6SQ3VB.js.map → dist-EL2RMYNK.js.map} +0 -0
- /package/dist/chunks/{dist-X7K5G5NH.js.map → dist-LUUDW6KE.js.map} +0 -0
- /package/dist/chunks/{dist-LRK6JYLM.js.map → dist-O4Y5VCRK.js.map} +0 -0
- /package/dist/chunks/{dist-3PNUHQCO.js.map → dist-POXH7TX7.js.map} +0 -0
- /package/dist/chunks/{dist-N4TBL3SN.js.map → dist-Q5YPDPOH.js.map} +0 -0
- /package/dist/chunks/{dist-OHQWXZ7N.js.map → dist-Z62XBGQ7.js.map} +0 -0
- /package/dist/chunks/{doctor-5JQK6UNK.js.map → doctor-5IRXJ7DK.js.map} +0 -0
- /package/dist/chunks/{drain-EHO3BUHW.js.map → drain-A44YWORN.js.map} +0 -0
- /package/dist/chunks/{entry-F2EIOWAT.js.map → entry-ODCHCJ3O.js.map} +0 -0
- /package/dist/chunks/{eval-7YEMHHIB.js.map → eval-35ZBHZLK.js.map} +0 -0
- /package/dist/chunks/{exec-WV7BS5UD.js.map → exec-TPOW33QE.js.map} +0 -0
- /package/dist/chunks/{home-GOMDEEXP.js.map → home-F4YAXKWJ.js.map} +0 -0
- /package/dist/chunks/{host-MNPHBQWG.js.map → host-V7LVA7QU.js.map} +0 -0
- /package/dist/chunks/{host-queries-SKWE7PF5.js.map → host-queries-2HRJZ2TH.js.map} +0 -0
- /package/dist/chunks/{install-LVQAT4QP.js.map → install-F6PU4SYH.js.map} +0 -0
- /package/dist/chunks/{learn-BUEAUHTD.js.map → learn-NLECFL5B.js.map} +0 -0
- /package/dist/chunks/{learn-builtin-XZFBPA3W.js.map → learn-builtin-XLID77I3.js.map} +0 -0
- /package/dist/chunks/{lifecycle-HMSOBI6F.js.map → lifecycle-UQL62JPO.js.map} +0 -0
- /package/dist/chunks/{live-ER3OZKC6.js.map → live-GBK7RIX2.js.map} +0 -0
- /package/dist/chunks/{login-EBEFMEA2.js.map → login-7LGGUBI5.js.map} +0 -0
- /package/dist/chunks/{logs-5UJZYNN2.js.map → logs-VYY2CWAN.js.map} +0 -0
- /package/dist/chunks/{message-command-XH2M4BTB.js.map → message-command-SCSTDFSA.js.map} +0 -0
- /package/dist/chunks/{open-ZYWPDOR6.js.map → open-QSZFHDIW.js.map} +0 -0
- /package/dist/chunks/{operator-tools-CZ2SXR3G.js.map → operator-tools-WF2UGZ5G.js.map} +0 -0
- /package/dist/chunks/{output-schema-MFZZP7GF.js.map → output-schema-P3WXODDE.js.map} +0 -0
- /package/dist/chunks/{pal-7OYQHUKF.js.map → pal-JLSBOTEO.js.map} +0 -0
- /package/dist/chunks/{peers-V3Z3ZQSN.js.map → peers-HDPCIVBY.js.map} +0 -0
- /package/dist/chunks/{peers-FCVTBNI5.js.map → peers-IMCPUY6R.js.map} +0 -0
- /package/dist/chunks/{providers-43RE2SWA.js.map → providers-YXH2C5HE.js.map} +0 -0
- /package/dist/chunks/{pty-QSS3UQ7C.js.map → pty-74F5BMD3.js.map} +0 -0
- /package/dist/chunks/{resume-WN2TIOQK.js.map → resume-M63SJGJ4.js.map} +0 -0
- /package/dist/chunks/{resume-command-WZY42BAB.js.map → resume-command-LFK2PQYH.js.map} +0 -0
- /package/dist/chunks/{schedule-LHXNUQHJ.js.map → schedule-5ZYAZJIM.js.map} +0 -0
- /package/dist/chunks/{service-ZU5YIBW4.js.map → service-LTYPMKWG.js.map} +0 -0
- /package/dist/chunks/{skills-K2MFIY4H.js.map → skills-KUT4QD3K.js.map} +0 -0
- /package/dist/chunks/{start-check-AODGFYJD.js.map → start-check-SYGALC5U.js.map} +0 -0
- /package/dist/chunks/{startup-failure-B6ESBTLZ.js.map → startup-failure-YKREQTPO.js.map} +0 -0
- /package/dist/chunks/{state-ZWXVSLS2.js.map → state-MQXTG6O3.js.map} +0 -0
- /package/dist/chunks/{store-JAI2RWQT.js.map → store-EO3HNNFC.js.map} +0 -0
- /package/dist/chunks/{store-MNI5IJHC.js.map → store-J4UP5MJ3.js.map} +0 -0
- /package/dist/chunks/{store-NKISDMPC.js.map → store-KC43NWR4.js.map} +0 -0
- /package/dist/chunks/{store-U6SG2CON.js.map → store-KW3NJHWV.js.map} +0 -0
- /package/dist/chunks/{upgrade-27ZDBTX7.js.map → upgrade-WI5CFBGG.js.map} +0 -0
- /package/dist/chunks/{workspaces-X7W7ZQU3.js.map → workspaces-VQ7VHN7N.js.map} +0 -0
- /package/dist/chunks/{worktree-SIA6C5NS.js.map → worktree-KSDU4MTM.js.map} +0 -0
|
@@ -2,10 +2,10 @@ import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __namzuCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
openManagedWorktrees
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HREKLDJP.js";
|
|
6
6
|
import {
|
|
7
7
|
createSessionSkillCatalog
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7X2NHTHU.js";
|
|
9
9
|
import {
|
|
10
10
|
KEY_MISMATCH_MESSAGE,
|
|
11
11
|
MAX_SCRIPT_BYTES,
|
|
@@ -36,32 +36,32 @@ import {
|
|
|
36
36
|
workflowJournalKey,
|
|
37
37
|
workingDirectoryProblem,
|
|
38
38
|
writeEditableCopy
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-J65SOO5P.js";
|
|
40
40
|
import {
|
|
41
41
|
runGeneratorCycle
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-7HU7BYTT.js";
|
|
43
43
|
import {
|
|
44
44
|
createSessionLearningFeed,
|
|
45
45
|
openLearningTarget,
|
|
46
46
|
readProjectGuidance,
|
|
47
47
|
withSessionLearningFeed
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-4AZTZXPQ.js";
|
|
49
49
|
import {
|
|
50
50
|
connectMcpServers,
|
|
51
51
|
startMcpServers
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-2PMNQ6HR.js";
|
|
53
53
|
import {
|
|
54
54
|
openInBrowser
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-UH7EP7TA.js";
|
|
56
56
|
import {
|
|
57
57
|
conversationInUseSentence,
|
|
58
58
|
minutesUntilFree
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-ZWJPQH5F.js";
|
|
60
60
|
import {
|
|
61
61
|
ensureLocalConfigIgnored,
|
|
62
62
|
logIgnoreOutcome,
|
|
63
63
|
writeLocalAllows
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-QIVWFRYO.js";
|
|
65
65
|
import {
|
|
66
66
|
createBrowserControl
|
|
67
67
|
} from "./chunk-WHODOMXA.js";
|
|
@@ -75,17 +75,17 @@ import {
|
|
|
75
75
|
import {
|
|
76
76
|
isPermissionMode,
|
|
77
77
|
permissionModeLabel
|
|
78
|
-
} from "./chunk-
|
|
78
|
+
} from "./chunk-VIBYGZFX.js";
|
|
79
79
|
import {
|
|
80
80
|
discoverSkills,
|
|
81
81
|
loadSkillBody
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-EGPWQL55.js";
|
|
83
83
|
import {
|
|
84
84
|
migrateAccountKeys
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-JRX5IIMR.js";
|
|
86
86
|
import {
|
|
87
87
|
openCliAccounts
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-4IOUN4SV.js";
|
|
89
89
|
import {
|
|
90
90
|
CredentialRefreshRejectedError,
|
|
91
91
|
CredentialWithdrawnError as CredentialWithdrawnError2,
|
|
@@ -93,16 +93,16 @@ import {
|
|
|
93
93
|
ensureFreshStoredCodexCredential,
|
|
94
94
|
readSubscriptionCredential,
|
|
95
95
|
sameOAuthCredential
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-GKPKHFMK.js";
|
|
97
97
|
import {
|
|
98
98
|
conversationLogPath,
|
|
99
99
|
ensureSessionStarted,
|
|
100
100
|
openConversationLog,
|
|
101
101
|
recordAccountBound
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-W27IOJQ5.js";
|
|
103
103
|
import {
|
|
104
104
|
readIdentity
|
|
105
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-BWOSM4EO.js";
|
|
106
106
|
import {
|
|
107
107
|
INSTRUCTIONS_FILENAME,
|
|
108
108
|
MAX_CHARS_PER_FILE,
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
} from "./chunk-JQIBPPOL.js";
|
|
114
114
|
import {
|
|
115
115
|
isDefaultAccountId
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-DJZ5W4ML.js";
|
|
117
117
|
import {
|
|
118
118
|
debugRequested
|
|
119
119
|
} from "./chunk-GNBMKISG.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
createLazyCodeAnalysis,
|
|
122
122
|
promptCacheTtl,
|
|
123
123
|
setPromptCacheTtl
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-TVBD2LZV.js";
|
|
125
125
|
import {
|
|
126
126
|
probeCapabilities
|
|
127
127
|
} from "./chunk-OH6TB27S.js";
|
|
@@ -129,12 +129,13 @@ import {
|
|
|
129
129
|
LOCAL_CONFIG_FILE,
|
|
130
130
|
configuredPassthroughTools,
|
|
131
131
|
parseTokenTarget,
|
|
132
|
+
readBoundDecisionKey,
|
|
132
133
|
resolveToolResultScreens,
|
|
133
134
|
sessionWorkflowSizeAdvice,
|
|
134
135
|
takeConfigWarnings,
|
|
135
136
|
unmatchedPassthroughTools,
|
|
136
137
|
workflowTokenCeiling
|
|
137
|
-
} from "./chunk-
|
|
138
|
+
} from "./chunk-Y2RIV5UX.js";
|
|
138
139
|
import {
|
|
139
140
|
require_dist
|
|
140
141
|
} from "./chunk-KONYGNG6.js";
|
|
@@ -143,10 +144,10 @@ import {
|
|
|
143
144
|
} from "./chunk-LCGXWCVU.js";
|
|
144
145
|
import {
|
|
145
146
|
compilePermissions
|
|
146
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-JBBB5EG2.js";
|
|
147
148
|
import {
|
|
148
149
|
cliLogger
|
|
149
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-JDUZFFX3.js";
|
|
150
151
|
import {
|
|
151
152
|
readModelLaunchEnvironment
|
|
152
153
|
} from "./chunk-LVVD32KJ.js";
|
|
@@ -173,7 +174,7 @@ import {
|
|
|
173
174
|
readPreferences,
|
|
174
175
|
resolveChainCapabilities,
|
|
175
176
|
unresolvedMembers
|
|
176
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-2WJQTSRQ.js";
|
|
177
178
|
import {
|
|
178
179
|
canSelectModel,
|
|
179
180
|
createGeminiAccessTokenResolver,
|
|
@@ -181,7 +182,7 @@ import {
|
|
|
181
182
|
findDetected,
|
|
182
183
|
hasApiCredential,
|
|
183
184
|
requiresCredentialForModel
|
|
184
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-KMTM4NNH.js";
|
|
185
186
|
import {
|
|
186
187
|
activeZenCatalogue,
|
|
187
188
|
isOfferableModel
|
|
@@ -194,23 +195,23 @@ import {
|
|
|
194
195
|
import {
|
|
195
196
|
isAnthropicOAuthToken,
|
|
196
197
|
readCodexCredentialFile
|
|
197
|
-
} from "./chunk-
|
|
198
|
+
} from "./chunk-2LZA3UMD.js";
|
|
198
199
|
import {
|
|
199
200
|
composeEnvironmentPrompt,
|
|
200
201
|
detectWsl,
|
|
201
202
|
environmentFactLines,
|
|
202
203
|
permissionSentence,
|
|
203
204
|
readEnvironmentFacts
|
|
204
|
-
} from "./chunk-
|
|
205
|
+
} from "./chunk-6QOP2PHC.js";
|
|
205
206
|
import {
|
|
206
207
|
ensurePrivateStateDirectory
|
|
207
|
-
} from "./chunk-
|
|
208
|
+
} from "./chunk-UANL44QG.js";
|
|
208
209
|
import {
|
|
209
210
|
restrictToOwner
|
|
210
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-BERMCELL.js";
|
|
211
212
|
import {
|
|
212
213
|
namzuHomePath
|
|
213
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-TWEFDQ7C.js";
|
|
214
215
|
import {
|
|
215
216
|
AgentManager,
|
|
216
217
|
AgentRegistry,
|
|
@@ -396,7 +397,7 @@ import {
|
|
|
396
397
|
withModelWindowSuffixStripped,
|
|
397
398
|
withProviderFallback,
|
|
398
399
|
wrapUntrusted
|
|
399
|
-
} from "./chunk-
|
|
400
|
+
} from "./chunk-7TWA4BQX.js";
|
|
400
401
|
import {
|
|
401
402
|
__name,
|
|
402
403
|
__toESM
|
|
@@ -903,8 +904,8 @@ function describeCapabilityNotice(input) {
|
|
|
903
904
|
__name(describeCapabilityNotice, "describeCapabilityNotice");
|
|
904
905
|
function describeHistoryRepairNotice(input) {
|
|
905
906
|
if (input.source === "provider-rejected-image") {
|
|
906
|
-
const
|
|
907
|
-
const what =
|
|
907
|
+
const count2 = input.rejectedImages ?? 0;
|
|
908
|
+
const what = count2 > 1 ? `${count2.toLocaleString("en-US")} pictures you attached` : "a picture you attached";
|
|
908
909
|
const name = productName(input.providerId);
|
|
909
910
|
return name ? `${name} didn\u2019t accept ${what}. Namzu kept the file but will leave it out of later messages. Attach a corrected copy to try again.` : `${what.charAt(0).toUpperCase()}${what.slice(1)} wasn\u2019t accepted. Namzu kept the file but will leave it out of later messages. Attach a corrected copy to try again.`;
|
|
910
911
|
}
|
|
@@ -1372,7 +1373,7 @@ function diffViewBody(info, options) {
|
|
|
1372
1373
|
const limit = options.expanded || info.preview === void 0 ? all.length : info.preview;
|
|
1373
1374
|
const shown = all.slice(0, limit);
|
|
1374
1375
|
const carried = info.hunks.reduce(
|
|
1375
|
-
(
|
|
1376
|
+
(count2, hunk) => count2 + hunk.lines.filter((line) => line.startsWith("+")).length,
|
|
1376
1377
|
0
|
|
1377
1378
|
);
|
|
1378
1379
|
const missing2 = info.mode === "file" && info.truncated && info.added !== void 0 ? Math.max(0, info.added - carried) : 0;
|
|
@@ -1422,12 +1423,12 @@ function plainDiffRows(info) {
|
|
|
1422
1423
|
return rows;
|
|
1423
1424
|
}
|
|
1424
1425
|
__name(plainDiffRows, "plainDiffRows");
|
|
1425
|
-
function plural2(
|
|
1426
|
-
return
|
|
1426
|
+
function plural2(count2, one, many) {
|
|
1427
|
+
return count2 === 1 ? one : many;
|
|
1427
1428
|
}
|
|
1428
1429
|
__name(plural2, "plural");
|
|
1429
|
-
function bold(
|
|
1430
|
-
return { text:
|
|
1430
|
+
function bold(count2) {
|
|
1431
|
+
return { text: count2.toLocaleString("en-US"), bold: true };
|
|
1431
1432
|
}
|
|
1432
1433
|
__name(bold, "bold");
|
|
1433
1434
|
function editSummary(added, removed) {
|
|
@@ -1912,8 +1913,8 @@ function countListedResults(output) {
|
|
|
1912
1913
|
const lines = output.split("\n");
|
|
1913
1914
|
const numbered = lines.filter((line) => /^\s{0,3}\d+\.\s+\S/.test(line)).length;
|
|
1914
1915
|
const addressed = lines.filter((line) => /^\s*URL:\s*\S/.test(line)).length;
|
|
1915
|
-
const
|
|
1916
|
-
return
|
|
1916
|
+
const count2 = Math.max(numbered, addressed);
|
|
1917
|
+
return count2 > 0 ? count2 : void 0;
|
|
1917
1918
|
}
|
|
1918
1919
|
__name(countListedResults, "countListedResults");
|
|
1919
1920
|
var formatBytes = formatSize;
|
|
@@ -1966,7 +1967,7 @@ __name(screenApprover, "screenApprover");
|
|
|
1966
1967
|
|
|
1967
1968
|
// src/tui/agent.ts
|
|
1968
1969
|
import { realpath as realpath4, stat as stat6 } from "node:fs/promises";
|
|
1969
|
-
import { join as
|
|
1970
|
+
import { join as join21, parse as parse2, resolve as resolve13 } from "node:path";
|
|
1970
1971
|
|
|
1971
1972
|
// src/checkpoints/store.ts
|
|
1972
1973
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -5687,22 +5688,151 @@ function createDecisionTool(model, options = {}) {
|
|
|
5687
5688
|
}
|
|
5688
5689
|
__name(createDecisionTool, "createDecisionTool");
|
|
5689
5690
|
|
|
5691
|
+
// src/integrations/decision/token.ts
|
|
5692
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
5693
|
+
import { existsSync } from "node:fs";
|
|
5694
|
+
import { delimiter, join as join6 } from "node:path";
|
|
5695
|
+
var AZURE_TOKEN_RESOURCE = "https://cognitiveservices.azure.com";
|
|
5696
|
+
var DEFAULT_TOKEN_ENV = "AZURE_FOUNDRY_TOKEN";
|
|
5697
|
+
var TOKEN_EARLY_EXPIRY_MS = 5 * 60 * 1e3;
|
|
5698
|
+
var AZ_TIMEOUT_MS = 15e3;
|
|
5699
|
+
function findAzOnPath(env) {
|
|
5700
|
+
const path = env.PATH ?? env.Path ?? "";
|
|
5701
|
+
const names = process.platform === "win32" ? ["az.cmd", "az.exe", "az.bat"] : ["az"];
|
|
5702
|
+
for (const dir of path.split(delimiter)) {
|
|
5703
|
+
if (!dir) continue;
|
|
5704
|
+
for (const name of names) {
|
|
5705
|
+
const candidate = join6(dir, name);
|
|
5706
|
+
if (existsSync(candidate)) return candidate;
|
|
5707
|
+
}
|
|
5708
|
+
}
|
|
5709
|
+
return void 0;
|
|
5710
|
+
}
|
|
5711
|
+
__name(findAzOnPath, "findAzOnPath");
|
|
5712
|
+
var defaultRunAz = /* @__PURE__ */ __name((command, args) => new Promise((resolve14, reject) => {
|
|
5713
|
+
execFile2(
|
|
5714
|
+
command,
|
|
5715
|
+
[...args],
|
|
5716
|
+
{ timeout: AZ_TIMEOUT_MS, windowsHide: true, shell: process.platform === "win32" },
|
|
5717
|
+
(error, stdout) => error ? reject(error) : resolve14(stdout)
|
|
5718
|
+
);
|
|
5719
|
+
}), "defaultRunAz");
|
|
5720
|
+
function parseAzTokenOutput(output) {
|
|
5721
|
+
try {
|
|
5722
|
+
const parsed = JSON.parse(output);
|
|
5723
|
+
const token = parsed.accessToken;
|
|
5724
|
+
if (typeof token !== "string" || token.length === 0) return void 0;
|
|
5725
|
+
const epoch = parsed.expires_on;
|
|
5726
|
+
let expiresAt;
|
|
5727
|
+
if (typeof epoch === "number") expiresAt = epoch * 1e3;
|
|
5728
|
+
else if (typeof epoch === "string" && /^\d+$/.test(epoch)) expiresAt = Number(epoch) * 1e3;
|
|
5729
|
+
else if (typeof parsed.expiresOn === "string") {
|
|
5730
|
+
const ms = Date.parse(parsed.expiresOn.replace(" ", "T"));
|
|
5731
|
+
if (!Number.isNaN(ms)) expiresAt = ms;
|
|
5732
|
+
}
|
|
5733
|
+
return expiresAt === void 0 ? void 0 : { token, expiresAt };
|
|
5734
|
+
} catch {
|
|
5735
|
+
return void 0;
|
|
5736
|
+
}
|
|
5737
|
+
}
|
|
5738
|
+
__name(parseAzTokenOutput, "parseAzTokenOutput");
|
|
5739
|
+
function createAzureTokenSource(tokenEnv, deps) {
|
|
5740
|
+
const now = deps.now ?? Date.now;
|
|
5741
|
+
const runAz = deps.runAz ?? defaultRunAz;
|
|
5742
|
+
const findAz = deps.findAz ?? findAzOnPath;
|
|
5743
|
+
let cached;
|
|
5744
|
+
let inflight;
|
|
5745
|
+
const fromAz = /* @__PURE__ */ __name(async () => {
|
|
5746
|
+
const az = findAz(deps.env);
|
|
5747
|
+
if (!az) return "";
|
|
5748
|
+
try {
|
|
5749
|
+
const output = await runAz(az, [
|
|
5750
|
+
"account",
|
|
5751
|
+
"get-access-token",
|
|
5752
|
+
"--resource",
|
|
5753
|
+
AZURE_TOKEN_RESOURCE,
|
|
5754
|
+
"--output",
|
|
5755
|
+
"json"
|
|
5756
|
+
]);
|
|
5757
|
+
const parsed = parseAzTokenOutput(output);
|
|
5758
|
+
if (!parsed) return "";
|
|
5759
|
+
cached = parsed;
|
|
5760
|
+
return parsed.token;
|
|
5761
|
+
} catch {
|
|
5762
|
+
return "";
|
|
5763
|
+
}
|
|
5764
|
+
}, "fromAz");
|
|
5765
|
+
return async () => {
|
|
5766
|
+
const fromEnv = deps.env[tokenEnv ?? DEFAULT_TOKEN_ENV];
|
|
5767
|
+
if (fromEnv) return fromEnv;
|
|
5768
|
+
if (tokenEnv !== void 0) return "";
|
|
5769
|
+
if (cached && now() < cached.expiresAt - TOKEN_EARLY_EXPIRY_MS) return cached.token;
|
|
5770
|
+
inflight ??= fromAz().finally(() => {
|
|
5771
|
+
inflight = void 0;
|
|
5772
|
+
});
|
|
5773
|
+
return inflight;
|
|
5774
|
+
};
|
|
5775
|
+
}
|
|
5776
|
+
__name(createAzureTokenSource, "createAzureTokenSource");
|
|
5777
|
+
|
|
5690
5778
|
// src/integrations/decision/model.ts
|
|
5691
|
-
function buildDecisionProviderConfig(cfg, env) {
|
|
5779
|
+
function buildDecisionProviderConfig(cfg, env, deps = {}) {
|
|
5780
|
+
const address = cfg.provider === "azure" ? cfg.endpoint : cfg.url;
|
|
5781
|
+
const readStored2 = deps.readStoredKey ?? readBoundDecisionKey;
|
|
5782
|
+
const read2 = /* @__PURE__ */ __name(() => readStored2(address), "read");
|
|
5783
|
+
let stored;
|
|
5784
|
+
const storedKey = /* @__PURE__ */ __name(() => {
|
|
5785
|
+
if (stored === void 0) {
|
|
5786
|
+
try {
|
|
5787
|
+
stored = read2();
|
|
5788
|
+
} catch {
|
|
5789
|
+
stored = null;
|
|
5790
|
+
}
|
|
5791
|
+
}
|
|
5792
|
+
return stored;
|
|
5793
|
+
}, "storedKey");
|
|
5794
|
+
const fetchPart = deps.fetch ? { fetch: deps.fetch } : {};
|
|
5692
5795
|
if (cfg.provider === "azure") {
|
|
5796
|
+
const named2 = cfg.apiKeyEnv;
|
|
5797
|
+
const keyed = named2 !== void 0 || cfg.tokenEnv === void 0 && storedKey() !== null;
|
|
5693
5798
|
return {
|
|
5694
5799
|
provider: "azure",
|
|
5695
5800
|
endpoint: cfg.endpoint,
|
|
5696
5801
|
deployment: cfg.deployment,
|
|
5802
|
+
...fetchPart,
|
|
5697
5803
|
// A key, read at each call, or a bearer token; never both (the loader refuses a config naming both).
|
|
5698
|
-
...
|
|
5804
|
+
...keyed ? { getApiKey: /* @__PURE__ */ __name(() => named2 ? env[named2] ?? "" : storedKey() ?? "", "getApiKey") } : {
|
|
5805
|
+
getToken: createAzureTokenSource(cfg.tokenEnv, {
|
|
5806
|
+
env,
|
|
5807
|
+
...deps.now ? { now: deps.now } : {},
|
|
5808
|
+
...deps.runAz ? { runAz: deps.runAz } : {},
|
|
5809
|
+
...deps.findAz ? { findAz: deps.findAz } : {}
|
|
5810
|
+
})
|
|
5811
|
+
}
|
|
5812
|
+
};
|
|
5813
|
+
}
|
|
5814
|
+
const named = cfg.apiKeyEnv;
|
|
5815
|
+
if (named) {
|
|
5816
|
+
return {
|
|
5817
|
+
provider: "http",
|
|
5818
|
+
url: cfg.url,
|
|
5819
|
+
...cfg.model !== void 0 ? { model: cfg.model } : {},
|
|
5820
|
+
...fetchPart,
|
|
5821
|
+
apiKey: env[named]
|
|
5699
5822
|
};
|
|
5700
5823
|
}
|
|
5824
|
+
const baseFetch = deps.fetch ?? ((input, init) => globalThis.fetch(input, init));
|
|
5701
5825
|
return {
|
|
5702
5826
|
provider: "http",
|
|
5703
5827
|
url: cfg.url,
|
|
5704
5828
|
...cfg.model !== void 0 ? { model: cfg.model } : {},
|
|
5705
|
-
|
|
5829
|
+
fetch: /* @__PURE__ */ __name((input, init) => {
|
|
5830
|
+
const key = storedKey();
|
|
5831
|
+
if (!key) return baseFetch(input, init);
|
|
5832
|
+
const headers = new Headers(init?.headers);
|
|
5833
|
+
headers.set("Authorization", `Bearer ${key}`);
|
|
5834
|
+
return baseFetch(input, { ...init, headers });
|
|
5835
|
+
}, "fetch")
|
|
5706
5836
|
};
|
|
5707
5837
|
}
|
|
5708
5838
|
__name(buildDecisionProviderConfig, "buildDecisionProviderConfig");
|
|
@@ -5711,14 +5841,14 @@ function decisionSwitchedOff(env) {
|
|
|
5711
5841
|
return env[DECISION_KILL_SWITCH] === "1";
|
|
5712
5842
|
}
|
|
5713
5843
|
__name(decisionSwitchedOff, "decisionSwitchedOff");
|
|
5714
|
-
function maybeCreateDecisionTool(cfg, env) {
|
|
5844
|
+
function maybeCreateDecisionTool(cfg, env, deps = {}) {
|
|
5715
5845
|
if (!cfg || decisionSwitchedOff(env)) return void 0;
|
|
5716
|
-
return createDecisionTool(createDecisionModel(buildDecisionProviderConfig(cfg, env)));
|
|
5846
|
+
return createDecisionTool(createDecisionModel(buildDecisionProviderConfig(cfg, env, deps)));
|
|
5717
5847
|
}
|
|
5718
5848
|
__name(maybeCreateDecisionTool, "maybeCreateDecisionTool");
|
|
5719
|
-
function maybeCreateDecisionModel(cfg, env) {
|
|
5849
|
+
function maybeCreateDecisionModel(cfg, env, deps = {}) {
|
|
5720
5850
|
if (!cfg || decisionSwitchedOff(env)) return void 0;
|
|
5721
|
-
return createDecisionModel(buildDecisionProviderConfig(cfg, env));
|
|
5851
|
+
return createDecisionModel(buildDecisionProviderConfig(cfg, env, deps));
|
|
5722
5852
|
}
|
|
5723
5853
|
__name(maybeCreateDecisionModel, "maybeCreateDecisionModel");
|
|
5724
5854
|
|
|
@@ -6989,7 +7119,7 @@ __name(readWorkStatus, "readWorkStatus");
|
|
|
6989
7119
|
|
|
6990
7120
|
// src/integrations/plugins/files.ts
|
|
6991
7121
|
import { readdirSync as readdirSync2, realpathSync as realpathSync3 } from "node:fs";
|
|
6992
|
-
import { isAbsolute as isAbsolute6, join as
|
|
7122
|
+
import { isAbsolute as isAbsolute6, join as join8, relative as relative6, sep as sep4 } from "node:path";
|
|
6993
7123
|
|
|
6994
7124
|
// src/integrations/plugins/settings.ts
|
|
6995
7125
|
import { createHash as createHash3, randomUUID as randomUUID4 } from "node:crypto";
|
|
@@ -7005,12 +7135,12 @@ import {
|
|
|
7005
7135
|
unlinkSync,
|
|
7006
7136
|
writeFileSync
|
|
7007
7137
|
} from "node:fs";
|
|
7008
|
-
import { join as
|
|
7138
|
+
import { join as join7 } from "node:path";
|
|
7009
7139
|
var MAX_RECORD_BYTES = 64 * 1024;
|
|
7010
7140
|
var PluginSettingsStore = class {
|
|
7011
7141
|
constructor(home) {
|
|
7012
7142
|
this.home = home;
|
|
7013
|
-
this.directory =
|
|
7143
|
+
this.directory = join7(home, "plugin-settings");
|
|
7014
7144
|
}
|
|
7015
7145
|
home;
|
|
7016
7146
|
static {
|
|
@@ -7019,7 +7149,7 @@ var PluginSettingsStore = class {
|
|
|
7019
7149
|
directory;
|
|
7020
7150
|
path(plugin) {
|
|
7021
7151
|
const key = createHash3("sha256").update(JSON.stringify([plugin.rootDir, plugin.name])).digest("hex");
|
|
7022
|
-
return
|
|
7152
|
+
return join7(this.directory, `${key}.json`);
|
|
7023
7153
|
}
|
|
7024
7154
|
read(plugin) {
|
|
7025
7155
|
const path = this.path(plugin);
|
|
@@ -7101,7 +7231,7 @@ function resolvePluginFileDirs(plugin, rootDir, declared) {
|
|
|
7101
7231
|
const problems = [];
|
|
7102
7232
|
for (const rel of declared ?? []) {
|
|
7103
7233
|
try {
|
|
7104
|
-
const real = realpathSync3(
|
|
7234
|
+
const real = realpathSync3(join8(rootDir, rel));
|
|
7105
7235
|
const within2 = relative6(realpathSync3(rootDir), real);
|
|
7106
7236
|
if (within2 === ".." || within2.startsWith(`..${sep4}`) || isAbsolute6(within2)) {
|
|
7107
7237
|
problems.push(
|
|
@@ -7993,13 +8123,13 @@ __name(createSideModel, "createSideModel");
|
|
|
7993
8123
|
var CLI_CHECKPOINT_RETENTION = 10;
|
|
7994
8124
|
|
|
7995
8125
|
// src/integrations/subagents/definitions.ts
|
|
7996
|
-
import { join as
|
|
8126
|
+
import { join as join9 } from "node:path";
|
|
7997
8127
|
function userAgentsDir(home) {
|
|
7998
|
-
return
|
|
8128
|
+
return join9(namzuHomePath(home), "agents");
|
|
7999
8129
|
}
|
|
8000
8130
|
__name(userAgentsDir, "userAgentsDir");
|
|
8001
8131
|
function projectAgentsDir(cwd) {
|
|
8002
|
-
return
|
|
8132
|
+
return join9(cwd, ".namzu", "agents");
|
|
8003
8133
|
}
|
|
8004
8134
|
__name(projectAgentsDir, "projectAgentsDir");
|
|
8005
8135
|
var AGENT_FILE_PERMISSION_MODES = /* @__PURE__ */ new Set([
|
|
@@ -8098,7 +8228,7 @@ __name(prepareDelegatedEffort, "prepareDelegatedEffort");
|
|
|
8098
8228
|
|
|
8099
8229
|
// src/integrations/subagents/operator-journal.ts
|
|
8100
8230
|
import { appendFile, open as open2 } from "node:fs/promises";
|
|
8101
|
-
import { join as
|
|
8231
|
+
import { join as join10 } from "node:path";
|
|
8102
8232
|
var MAX_READ_BYTES = 256 * 1024;
|
|
8103
8233
|
var MAX_CONTEXT_CHARACTERS = 32e3;
|
|
8104
8234
|
function formatChildOperatorAdmission(input) {
|
|
@@ -8108,7 +8238,7 @@ function formatChildOperatorAdmission(input) {
|
|
|
8108
8238
|
}
|
|
8109
8239
|
__name(formatChildOperatorAdmission, "formatChildOperatorAdmission");
|
|
8110
8240
|
async function readChildOperatorNotices(paths, sessionId) {
|
|
8111
|
-
const path =
|
|
8241
|
+
const path = join10(paths.sessionDir({ sessionId }), "child-operator-messages.jsonl");
|
|
8112
8242
|
let file;
|
|
8113
8243
|
try {
|
|
8114
8244
|
file = await open2(path, "r");
|
|
@@ -8179,7 +8309,7 @@ async function acknowledgeChildOperatorNotices(paths, sessionId, notices) {
|
|
|
8179
8309
|
})
|
|
8180
8310
|
).join("\n");
|
|
8181
8311
|
await appendFile(
|
|
8182
|
-
|
|
8312
|
+
join10(paths.sessionDir({ sessionId }), "child-operator-messages.jsonl"),
|
|
8183
8313
|
`${lines}
|
|
8184
8314
|
`,
|
|
8185
8315
|
{ mode: 384 }
|
|
@@ -8188,7 +8318,7 @@ async function acknowledgeChildOperatorNotices(paths, sessionId, notices) {
|
|
|
8188
8318
|
__name(acknowledgeChildOperatorNotices, "acknowledgeChildOperatorNotices");
|
|
8189
8319
|
async function recordChildOperatorReport(paths, sessionId, notice2) {
|
|
8190
8320
|
await appendFile(
|
|
8191
|
-
|
|
8321
|
+
join10(paths.sessionDir({ sessionId }), "child-operator-messages.jsonl"),
|
|
8192
8322
|
`${JSON.stringify({ ...notice2, status: "child-report", source: "host", at: (/* @__PURE__ */ new Date()).toISOString() })}
|
|
8193
8323
|
`,
|
|
8194
8324
|
{ mode: 384 }
|
|
@@ -9213,9 +9343,9 @@ __name(errorMessage2, "errorMessage");
|
|
|
9213
9343
|
|
|
9214
9344
|
// src/integrations/subagents/runtime.ts
|
|
9215
9345
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
9216
|
-
import { existsSync } from "node:fs";
|
|
9346
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
9217
9347
|
import { appendFile as appendFile2, mkdir as mkdir4 } from "node:fs/promises";
|
|
9218
|
-
import { join as
|
|
9348
|
+
import { join as join14 } from "node:path";
|
|
9219
9349
|
|
|
9220
9350
|
// src/integrations/subagents/fork.ts
|
|
9221
9351
|
var FORK_SUBAGENT = "fork";
|
|
@@ -9329,7 +9459,7 @@ __name(describeQuietTask, "describeQuietTask");
|
|
|
9329
9459
|
// src/memory/typed.ts
|
|
9330
9460
|
import { createHash as createHash4 } from "node:crypto";
|
|
9331
9461
|
import { access, readFile as readFile3, rename as rename3, writeFile as writeFile2 } from "node:fs/promises";
|
|
9332
|
-
import { join as
|
|
9462
|
+
import { join as join13 } from "node:path";
|
|
9333
9463
|
|
|
9334
9464
|
// src/memory/io.ts
|
|
9335
9465
|
import {
|
|
@@ -9343,7 +9473,7 @@ import {
|
|
|
9343
9473
|
realpathSync as realpathSync4,
|
|
9344
9474
|
writeSync
|
|
9345
9475
|
} from "node:fs";
|
|
9346
|
-
import { isAbsolute as isAbsolute7, join as
|
|
9476
|
+
import { isAbsolute as isAbsolute7, join as join11, relative as relative7, resolve as resolve8, sep as sep5 } from "node:path";
|
|
9347
9477
|
var MEMORY_FILE_MAX_BYTES = 1024 * 1024;
|
|
9348
9478
|
function missing(error) {
|
|
9349
9479
|
return error.code === "ENOENT";
|
|
@@ -9376,7 +9506,7 @@ function resolveMemoryPath(location, createParents = false) {
|
|
|
9376
9506
|
for (let i = 0; i < parts.length; i += 1) {
|
|
9377
9507
|
const part = parts[i];
|
|
9378
9508
|
if (part === void 0) throw new Error("Memory path has an invalid segment.");
|
|
9379
|
-
candidate =
|
|
9509
|
+
candidate = join11(candidate, part);
|
|
9380
9510
|
const leaf = i === parts.length - 1;
|
|
9381
9511
|
let stat7;
|
|
9382
9512
|
try {
|
|
@@ -9417,12 +9547,12 @@ function readBounded(fd) {
|
|
|
9417
9547
|
let total = 0;
|
|
9418
9548
|
while (total <= MEMORY_FILE_MAX_BYTES) {
|
|
9419
9549
|
const chunk = Buffer.allocUnsafe(Math.min(64 * 1024, MEMORY_FILE_MAX_BYTES + 1 - total));
|
|
9420
|
-
const
|
|
9421
|
-
if (
|
|
9422
|
-
total +=
|
|
9550
|
+
const count2 = readSync2(fd, chunk, 0, chunk.length, total);
|
|
9551
|
+
if (count2 === 0) break;
|
|
9552
|
+
total += count2;
|
|
9423
9553
|
if (total > MEMORY_FILE_MAX_BYTES)
|
|
9424
9554
|
throw new Error(`Memory exceeds the ${MEMORY_FILE_MAX_BYTES}-byte file limit.`);
|
|
9425
|
-
chunks.push(chunk.subarray(0,
|
|
9555
|
+
chunks.push(chunk.subarray(0, count2));
|
|
9426
9556
|
}
|
|
9427
9557
|
let text2;
|
|
9428
9558
|
try {
|
|
@@ -9501,18 +9631,18 @@ __name(appendMemoryFile, "appendMemoryFile");
|
|
|
9501
9631
|
|
|
9502
9632
|
// src/memory/store.ts
|
|
9503
9633
|
import { realpathSync as realpathSync5 } from "node:fs";
|
|
9504
|
-
import { join as
|
|
9634
|
+
import { join as join12, resolve as resolve9 } from "node:path";
|
|
9505
9635
|
var MEMORY_SECTION_MAX_CHARS = 8e3;
|
|
9506
9636
|
function memoryDir(home) {
|
|
9507
9637
|
return namzuHomePath(home);
|
|
9508
9638
|
}
|
|
9509
9639
|
__name(memoryDir, "memoryDir");
|
|
9510
9640
|
function userFilePath(home) {
|
|
9511
|
-
return
|
|
9641
|
+
return join12(memoryDir(home), "USER.md");
|
|
9512
9642
|
}
|
|
9513
9643
|
__name(userFilePath, "userFilePath");
|
|
9514
9644
|
function memoryFilePath(home) {
|
|
9515
|
-
return
|
|
9645
|
+
return join12(memoryDir(home), "MEMORY.md");
|
|
9516
9646
|
}
|
|
9517
9647
|
__name(memoryFilePath, "memoryFilePath");
|
|
9518
9648
|
function projectMemoryFilePath(cwd) {
|
|
@@ -9523,9 +9653,9 @@ function projectMemoryFilePath(cwd) {
|
|
|
9523
9653
|
if (error.code !== "ENOENT") throw error;
|
|
9524
9654
|
}
|
|
9525
9655
|
const root = cliProjectRoot(directory);
|
|
9526
|
-
const local =
|
|
9656
|
+
const local = join12(directory, ".namzu", "MEMORY.md");
|
|
9527
9657
|
if (resolveMemoryPath({ path: local, root }) !== null) return local;
|
|
9528
|
-
return
|
|
9658
|
+
return join12(root, ".namzu", "MEMORY.md");
|
|
9529
9659
|
}
|
|
9530
9660
|
__name(projectMemoryFilePath, "projectMemoryFilePath");
|
|
9531
9661
|
function projectMemoryLocation(cwd) {
|
|
@@ -9555,15 +9685,15 @@ function readMemory(home, cwd) {
|
|
|
9555
9685
|
}
|
|
9556
9686
|
}, "read");
|
|
9557
9687
|
const userRoot = memoryDir(home);
|
|
9558
|
-
const user = read2(
|
|
9688
|
+
const user = read2(join12(userRoot, "USER.md"), () => ({
|
|
9559
9689
|
root: userRoot,
|
|
9560
|
-
path:
|
|
9690
|
+
path: join12(userRoot, "USER.md")
|
|
9561
9691
|
}));
|
|
9562
|
-
const memory = read2(
|
|
9692
|
+
const memory = read2(join12(userRoot, "MEMORY.md"), () => ({
|
|
9563
9693
|
root: userRoot,
|
|
9564
|
-
path:
|
|
9694
|
+
path: join12(userRoot, "MEMORY.md")
|
|
9565
9695
|
}));
|
|
9566
|
-
const project = cwd && !isUserMemoryFile(
|
|
9696
|
+
const project = cwd && !isUserMemoryFile(join12(resolve9(cwd), ".namzu", "MEMORY.md"), userRoot) ? read2(join12(resolve9(cwd), ".namzu", "MEMORY.md"), () => projectLocation(cwd)) : null;
|
|
9567
9697
|
return { user, memory, project, ...diagnostics.length > 0 ? { diagnostics } : {} };
|
|
9568
9698
|
}
|
|
9569
9699
|
__name(readMemory, "readMemory");
|
|
@@ -9575,7 +9705,7 @@ function isUserMemoryFile(projectPath, userRoot) {
|
|
|
9575
9705
|
return resolve9(path);
|
|
9576
9706
|
}
|
|
9577
9707
|
}, "canonical");
|
|
9578
|
-
return canonical(projectPath) === canonical(
|
|
9708
|
+
return canonical(projectPath) === canonical(join12(userRoot, "MEMORY.md"));
|
|
9579
9709
|
}
|
|
9580
9710
|
__name(isUserMemoryFile, "isUserMemoryFile");
|
|
9581
9711
|
function capped(text2, file) {
|
|
@@ -9667,7 +9797,7 @@ async function saveTypedNote(store, text2, type = "project") {
|
|
|
9667
9797
|
saved: false,
|
|
9668
9798
|
duplicate: true,
|
|
9669
9799
|
type: record.entry.type ?? type,
|
|
9670
|
-
...record.entry.name ? { name: record.entry.name, path:
|
|
9800
|
+
...record.entry.name ? { name: record.entry.name, path: join13(store.path, `${record.entry.name}.md`) } : {}
|
|
9671
9801
|
};
|
|
9672
9802
|
}
|
|
9673
9803
|
}
|
|
@@ -9682,7 +9812,7 @@ async function saveTypedNote(store, text2, type = "project") {
|
|
|
9682
9812
|
return {
|
|
9683
9813
|
saved: true,
|
|
9684
9814
|
type,
|
|
9685
|
-
...entry.name ? { name: entry.name, path:
|
|
9815
|
+
...entry.name ? { name: entry.name, path: join13(store.path, `${entry.name}.md`) } : {}
|
|
9686
9816
|
};
|
|
9687
9817
|
}
|
|
9688
9818
|
__name(saveTypedNote, "saveTypedNote");
|
|
@@ -9725,7 +9855,7 @@ __name(composeMemoryGuidance, "composeMemoryGuidance");
|
|
|
9725
9855
|
var MARKER2 = "migration.json";
|
|
9726
9856
|
async function readMarker(directory) {
|
|
9727
9857
|
try {
|
|
9728
|
-
const parsed = JSON.parse(await readFile3(
|
|
9858
|
+
const parsed = JSON.parse(await readFile3(join13(directory, MARKER2), "utf8"));
|
|
9729
9859
|
return parsed !== null && typeof parsed === "object" ? parsed : {};
|
|
9730
9860
|
} catch (error) {
|
|
9731
9861
|
if (error.code === "ENOENT") return {};
|
|
@@ -9738,7 +9868,7 @@ async function markCuratedFile(directory, path, state) {
|
|
|
9738
9868
|
const files = { ...marker.curatedFiles ?? {} };
|
|
9739
9869
|
files[path] = { ...files[path] ?? {}, ...state };
|
|
9740
9870
|
await writeFile2(
|
|
9741
|
-
|
|
9871
|
+
join13(directory, MARKER2),
|
|
9742
9872
|
`${JSON.stringify({ ...marker, curatedFiles: files }, null, 2)}
|
|
9743
9873
|
`,
|
|
9744
9874
|
{ mode: 384 }
|
|
@@ -9805,7 +9935,7 @@ async function migrateMemoryOnce(options) {
|
|
|
9805
9935
|
const skippedRecords = [];
|
|
9806
9936
|
let importedRecords = 0;
|
|
9807
9937
|
let notesOffer;
|
|
9808
|
-
const indexPath =
|
|
9938
|
+
const indexPath = join13(directory, "index.json");
|
|
9809
9939
|
if (await exists(indexPath)) {
|
|
9810
9940
|
try {
|
|
9811
9941
|
const disk = new DiskMemoryStore({ baseDir: directory, directory });
|
|
@@ -9828,11 +9958,11 @@ async function migrateMemoryOnce(options) {
|
|
|
9828
9958
|
}
|
|
9829
9959
|
}
|
|
9830
9960
|
await retire(indexPath);
|
|
9831
|
-
const content =
|
|
9961
|
+
const content = join13(directory, "content");
|
|
9832
9962
|
const retiredContent = await exists(content) ? await retire(content) : content;
|
|
9833
9963
|
for (const record of refused) {
|
|
9834
9964
|
skippedRecords.push(
|
|
9835
|
-
`"${record.title}" (${record.id}) was not moved: ${record.reason} It is kept in ${
|
|
9965
|
+
`"${record.title}" (${record.id}) was not moved: ${record.reason} It is kept in ${join13(retiredContent, `${record.id}.json`)}.`
|
|
9836
9966
|
);
|
|
9837
9967
|
}
|
|
9838
9968
|
} catch (error) {
|
|
@@ -9907,9 +10037,9 @@ function describeMemoryMigration(report, directory) {
|
|
|
9907
10037
|
}
|
|
9908
10038
|
for (const skipped of report.skippedRecords) notices.push(`Stored memory: ${skipped}`);
|
|
9909
10039
|
if (report.notesOffer) {
|
|
9910
|
-
const { path, count } = report.notesOffer;
|
|
10040
|
+
const { path, count: count2 } = report.notesOffer;
|
|
9911
10041
|
notices.push(
|
|
9912
|
-
`Stored memory: ${path} has ${
|
|
10042
|
+
`Stored memory: ${path} has ${count2} top-level bullet${count2 === 1 ? "" : "s"}, some perhaps notes #note saved before notes became typed memory files. They stay curated and still reach every turn. Run /memory import-notes to copy them into ${directory} as typed memories; the curated file is never changed. New #note and /memory add notes are saved there already.`
|
|
9913
10043
|
);
|
|
9914
10044
|
}
|
|
9915
10045
|
notices.push(...report.problems);
|
|
@@ -10308,11 +10438,11 @@ function taskActivityOutput(activity, settled) {
|
|
|
10308
10438
|
__name(taskActivityOutput, "taskActivityOutput");
|
|
10309
10439
|
|
|
10310
10440
|
// src/integrations/subagents/worktree-driver.ts
|
|
10311
|
-
import { execFile as
|
|
10441
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
10312
10442
|
import { mkdir as mkdir3, realpath as realpath3 } from "node:fs/promises";
|
|
10313
10443
|
import { isAbsolute as isAbsolute8, relative as relative8, resolve as resolve10, sep as sep6 } from "node:path";
|
|
10314
10444
|
import { promisify as promisify2 } from "node:util";
|
|
10315
|
-
var runFile = promisify2(
|
|
10445
|
+
var runFile = promisify2(execFile3);
|
|
10316
10446
|
var DelegatedWorktreeDriver = class {
|
|
10317
10447
|
constructor(cwd, stateRoot) {
|
|
10318
10448
|
this.cwd = cwd;
|
|
@@ -12243,7 +12373,7 @@ ${step}`;
|
|
|
12243
12373
|
sessionId: parent.sessionId
|
|
12244
12374
|
});
|
|
12245
12375
|
await mkdir4(directory, { recursive: true, mode: 448 });
|
|
12246
|
-
journal =
|
|
12376
|
+
journal = join14(directory, "child-operator-messages.jsonl");
|
|
12247
12377
|
}
|
|
12248
12378
|
await audit("submitted");
|
|
12249
12379
|
signal.throwIfAborted();
|
|
@@ -12547,12 +12677,12 @@ function agentTaskOutcome(task) {
|
|
|
12547
12677
|
__name(agentTaskOutcome, "agentTaskOutcome");
|
|
12548
12678
|
function workspaceData(task) {
|
|
12549
12679
|
const meta = task.workspace?.meta;
|
|
12550
|
-
return meta?.backend === "git-worktree" &&
|
|
12680
|
+
return meta?.backend === "git-worktree" && existsSync2(meta.worktreePath) ? { workspace_path: meta.worktreePath, workspace_branch: meta.branch } : {};
|
|
12551
12681
|
}
|
|
12552
12682
|
__name(workspaceData, "workspaceData");
|
|
12553
12683
|
function workspaceRemoved(task) {
|
|
12554
12684
|
const meta = task.workspace?.meta;
|
|
12555
|
-
return meta?.backend === "git-worktree" && !
|
|
12685
|
+
return meta?.backend === "git-worktree" && !existsSync2(meta.worktreePath);
|
|
12556
12686
|
}
|
|
12557
12687
|
__name(workspaceRemoved, "workspaceRemoved");
|
|
12558
12688
|
function workspaceNote(task) {
|
|
@@ -12702,7 +12832,7 @@ __name(buildDefinition, "buildDefinition");
|
|
|
12702
12832
|
|
|
12703
12833
|
// src/integrations/workflows/history.ts
|
|
12704
12834
|
import { readFile as readFile4, readdir as readdir2 } from "node:fs/promises";
|
|
12705
|
-
import { join as
|
|
12835
|
+
import { join as join15 } from "node:path";
|
|
12706
12836
|
var RUN_ID = /^w[0-9a-z]{8}$/;
|
|
12707
12837
|
async function readWorkflowJournal(file) {
|
|
12708
12838
|
let text2;
|
|
@@ -12728,7 +12858,7 @@ async function readWorkflowJournal(file) {
|
|
|
12728
12858
|
__name(readWorkflowJournal, "readWorkflowJournal");
|
|
12729
12859
|
async function readWorkflowRun(runsDirectory, runId) {
|
|
12730
12860
|
if (!RUN_ID.test(runId)) return void 0;
|
|
12731
|
-
const records = await readWorkflowJournal(
|
|
12861
|
+
const records = await readWorkflowJournal(join15(runsDirectory, runId, "workflow", "journal.jsonl"));
|
|
12732
12862
|
return viewFromJournal(records);
|
|
12733
12863
|
}
|
|
12734
12864
|
__name(readWorkflowRun, "readWorkflowRun");
|
|
@@ -12749,9 +12879,9 @@ __name(listWorkflowRuns, "listWorkflowRuns");
|
|
|
12749
12879
|
|
|
12750
12880
|
// src/integrations/workflows/host.ts
|
|
12751
12881
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
12752
|
-
import { existsSync as
|
|
12882
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
12753
12883
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
12754
|
-
import { join as
|
|
12884
|
+
import { join as join16 } from "node:path";
|
|
12755
12885
|
|
|
12756
12886
|
// src/integrations/workflows/offering.ts
|
|
12757
12887
|
var WORKFLOW_TOOL_NAME = "workflow";
|
|
@@ -13201,7 +13331,7 @@ function createWorkflowHost(options) {
|
|
|
13201
13331
|
}
|
|
13202
13332
|
let checked;
|
|
13203
13333
|
try {
|
|
13204
|
-
checked = await new FileWorkflowJournal(
|
|
13334
|
+
checked = await new FileWorkflowJournal(join16(runs, runId, "workflow"), {
|
|
13205
13335
|
runId,
|
|
13206
13336
|
...key !== void 0 ? { key } : {}
|
|
13207
13337
|
}).read();
|
|
@@ -13221,7 +13351,7 @@ function createWorkflowHost(options) {
|
|
|
13221
13351
|
}
|
|
13222
13352
|
resumeState = loadWorkflowResume(checked);
|
|
13223
13353
|
if (!resumeState.resumable) {
|
|
13224
|
-
const mismatch = key !== void 0 && await readFile5(
|
|
13354
|
+
const mismatch = key !== void 0 && await readFile5(join16(runs, runId, "workflow", "journal.jsonl"), "utf8").then(
|
|
13225
13355
|
(text2) => journalKeyMismatch(text2, runId, key),
|
|
13226
13356
|
() => false
|
|
13227
13357
|
);
|
|
@@ -13241,12 +13371,12 @@ function createWorkflowHost(options) {
|
|
|
13241
13371
|
if (state === "ended") registry.discard(runId);
|
|
13242
13372
|
} else {
|
|
13243
13373
|
runId = createWorkflowRunId(
|
|
13244
|
-
(id) => registry.get(id) !== void 0 || runs !== void 0 &&
|
|
13374
|
+
(id) => registry.get(id) !== void 0 || runs !== void 0 && existsSync3(join16(runs, id))
|
|
13245
13375
|
);
|
|
13246
13376
|
}
|
|
13247
13377
|
const turn = options.openRunTurn(context.turnId, runId);
|
|
13248
13378
|
const limits = options.limitsFor?.(context.turnId);
|
|
13249
|
-
const journalDirectory = runs === void 0 ? void 0 :
|
|
13379
|
+
const journalDirectory = runs === void 0 ? void 0 : join16(runs, runId, "workflow");
|
|
13250
13380
|
const journal = journalDirectory === void 0 ? void 0 : new FileWorkflowJournal(journalDirectory, {
|
|
13251
13381
|
runId,
|
|
13252
13382
|
...key !== void 0 ? { key } : {}
|
|
@@ -13280,7 +13410,7 @@ function createWorkflowHost(options) {
|
|
|
13280
13410
|
...journal ? { journal } : {},
|
|
13281
13411
|
...resumeState ? { resume: resumeState } : {},
|
|
13282
13412
|
...editable !== void 0 ? { scriptPath: editable } : {},
|
|
13283
|
-
...journalDirectory !== void 0 ? { journalPath:
|
|
13413
|
+
...journalDirectory !== void 0 ? { journalPath: join16(journalDirectory, "journal.jsonl") } : {},
|
|
13284
13414
|
spawn: /* @__PURE__ */ __name(async (request, signal, viewed) => {
|
|
13285
13415
|
const detail = phaseDetail(request.phaseTitle);
|
|
13286
13416
|
const outcome2 = await options.subagents.launchWorkflowAgent({
|
|
@@ -13363,9 +13493,9 @@ function createWorkflowHost(options) {
|
|
|
13363
13493
|
__name(createWorkflowHost, "createWorkflowHost");
|
|
13364
13494
|
|
|
13365
13495
|
// src/integrations/workflows/orphans.ts
|
|
13366
|
-
import { existsSync as
|
|
13496
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
13367
13497
|
import { readFile as readFile6, readdir as readdir3, writeFile as writeFile3 } from "node:fs/promises";
|
|
13368
|
-
import { join as
|
|
13498
|
+
import { join as join17 } from "node:path";
|
|
13369
13499
|
var NOTICE_FILE = "orphan-notice.json";
|
|
13370
13500
|
var MAX_ORPHAN_NOTICES = 20;
|
|
13371
13501
|
var NO_USAGE = {
|
|
@@ -13384,7 +13514,7 @@ function quotedName(name) {
|
|
|
13384
13514
|
}
|
|
13385
13515
|
__name(quotedName, "quotedName");
|
|
13386
13516
|
function noticePath(runsDirectory, runId) {
|
|
13387
|
-
return
|
|
13517
|
+
return join17(runsDirectory, runId, "workflow", NOTICE_FILE);
|
|
13388
13518
|
}
|
|
13389
13519
|
__name(noticePath, "noticePath");
|
|
13390
13520
|
async function readStored(runsDirectory, runId) {
|
|
@@ -13400,8 +13530,8 @@ async function readStored(runsDirectory, runId) {
|
|
|
13400
13530
|
return void 0;
|
|
13401
13531
|
}
|
|
13402
13532
|
__name(readStored, "readStored");
|
|
13403
|
-
function words(
|
|
13404
|
-
return `${
|
|
13533
|
+
function words(count2, noun) {
|
|
13534
|
+
return `${count2} ${noun}${count2 === 1 ? "" : "s"}`;
|
|
13405
13535
|
}
|
|
13406
13536
|
__name(words, "words");
|
|
13407
13537
|
async function recoverUnfinishedWorkflows(options) {
|
|
@@ -13416,7 +13546,7 @@ async function recoverUnfinishedWorkflows(options) {
|
|
|
13416
13546
|
for (const runId of entries.filter((name) => RUN_ID_PATTERN.test(name)).sort()) {
|
|
13417
13547
|
if (options.liveRunIds.has(runId)) continue;
|
|
13418
13548
|
const stored = await readStored(options.runsDirectory, runId);
|
|
13419
|
-
const dir =
|
|
13549
|
+
const dir = join17(options.runsDirectory, runId, "workflow");
|
|
13420
13550
|
const journal = new FileWorkflowJournal(dir, {
|
|
13421
13551
|
runId,
|
|
13422
13552
|
...options.key !== void 0 ? { key: options.key } : {}
|
|
@@ -13467,7 +13597,7 @@ async function recoverUnfinishedWorkflows(options) {
|
|
|
13467
13597
|
(key) => !state.results.has(key) && !state.failed.has(key)
|
|
13468
13598
|
).length;
|
|
13469
13599
|
const copy = editableCopyPath(options.runsDirectory, name, runId);
|
|
13470
|
-
const script = started.scriptPath ?? (
|
|
13600
|
+
const script = started.scriptPath ?? (existsSync4(copy) ? copy : void 0);
|
|
13471
13601
|
text2 = [
|
|
13472
13602
|
`Background workflow ${quotedName(name)} (run ${runId}) didn't finish before the previous session ended.`,
|
|
13473
13603
|
`No finish record was found for it, so the process most likely exited while it ran. ${words(state.results.size, "agent")} had finished and saved their results; ${unfinished} had started and not finished.`,
|
|
@@ -13525,7 +13655,7 @@ __name(recoverUnfinishedWorkflows, "recoverUnfinishedWorkflows");
|
|
|
13525
13655
|
async function keyMismatchOf(dir, runId, key) {
|
|
13526
13656
|
if (key === void 0) return false;
|
|
13527
13657
|
try {
|
|
13528
|
-
return journalKeyMismatch(await readFile6(
|
|
13658
|
+
return journalKeyMismatch(await readFile6(join17(dir, "journal.jsonl"), "utf8"), runId, key);
|
|
13529
13659
|
} catch {
|
|
13530
13660
|
return false;
|
|
13531
13661
|
}
|
|
@@ -13566,7 +13696,7 @@ import { dirname as dirname4 } from "node:path";
|
|
|
13566
13696
|
import { createHash as createHash5 } from "node:crypto";
|
|
13567
13697
|
|
|
13568
13698
|
// src/memory/manage.ts
|
|
13569
|
-
import { join as
|
|
13699
|
+
import { join as join18 } from "node:path";
|
|
13570
13700
|
|
|
13571
13701
|
// src/memory/presentation.ts
|
|
13572
13702
|
var MEMORY_PREVIEW_MAX_CHARS = 2e3;
|
|
@@ -13647,32 +13777,178 @@ ${preview(derived.text, directory)}`
|
|
|
13647
13777
|
}
|
|
13648
13778
|
__name(renderStoredMemorySection, "renderStoredMemorySection");
|
|
13649
13779
|
|
|
13650
|
-
// src/memory/
|
|
13780
|
+
// src/memory/sweep.ts
|
|
13781
|
+
var DEFAULT_RETIRE_AFTER_DAYS = 21;
|
|
13782
|
+
var RETIRED_UNUSED = "unused";
|
|
13783
|
+
var RETIRED_DUPLICATE = "duplicate";
|
|
13651
13784
|
var DAY_MS = 864e5;
|
|
13652
|
-
|
|
13785
|
+
var normalize = /* @__PURE__ */ __name((text2) => text2.normalize("NFKC").replace(/\s+/gu, " ").trim().toLowerCase(), "normalize");
|
|
13786
|
+
function retiredReasonOf(metadata) {
|
|
13787
|
+
const reason = metadata?.retiredReason;
|
|
13788
|
+
return typeof reason === "string" && typeof metadata?.retiredAt === "number" ? reason : void 0;
|
|
13789
|
+
}
|
|
13790
|
+
__name(retiredReasonOf, "retiredReasonOf");
|
|
13791
|
+
function isUnused(input) {
|
|
13792
|
+
const counters = input.usage.get(input.id);
|
|
13793
|
+
const reference = Math.max(input.touchedAt, counters?.lastRecalledAt ?? 0, input.usage.since);
|
|
13794
|
+
return input.at - reference >= input.retireAfterDays * DAY_MS;
|
|
13795
|
+
}
|
|
13796
|
+
__name(isUnused, "isUnused");
|
|
13797
|
+
async function sweepMemory(deps) {
|
|
13798
|
+
const { store, usage, now, retireAfterDays, shouldStop } = deps;
|
|
13799
|
+
const at = now();
|
|
13653
13800
|
const { entries } = await store.list({ status: "active" });
|
|
13654
|
-
const
|
|
13801
|
+
const archived = [];
|
|
13802
|
+
const possiblyStale = [];
|
|
13803
|
+
let kept = 0;
|
|
13804
|
+
const unusedSkipped = retireAfterDays <= 0 ? "off" : usage.state === "unknown" ? "unknown" : void 0;
|
|
13805
|
+
const derived = [];
|
|
13806
|
+
const unusedRow = /* @__PURE__ */ __name((row) => {
|
|
13807
|
+
if (unusedSkipped) return false;
|
|
13808
|
+
return isUnused({
|
|
13809
|
+
usage,
|
|
13810
|
+
id: row.id,
|
|
13811
|
+
touchedAt: row.record.entry.updatedAt,
|
|
13812
|
+
at,
|
|
13813
|
+
retireAfterDays
|
|
13814
|
+
});
|
|
13815
|
+
}, "unusedRow");
|
|
13655
13816
|
for (const entry of entries) {
|
|
13656
13817
|
const record = await store.getVersionedRecord(entry.id);
|
|
13657
13818
|
if (!record || record.entry.status !== "active") continue;
|
|
13658
|
-
const
|
|
13659
|
-
|
|
13660
|
-
|
|
13661
|
-
|
|
13662
|
-
|
|
13663
|
-
|
|
13664
|
-
|
|
13665
|
-
|
|
13666
|
-
|
|
13667
|
-
|
|
13668
|
-
|
|
13669
|
-
|
|
13670
|
-
|
|
13671
|
-
|
|
13819
|
+
const row = { id: entry.id, record };
|
|
13820
|
+
if (memoryOrigin(record.content.metadata) === "derived") derived.push(row);
|
|
13821
|
+
else if (unusedRow(row)) possiblyStale.push(entry.id);
|
|
13822
|
+
}
|
|
13823
|
+
const archive = /* @__PURE__ */ __name(async (row, reason, extra = {}) => {
|
|
13824
|
+
if (shouldStop?.() === true) return;
|
|
13825
|
+
try {
|
|
13826
|
+
await store.updateIfRevision(
|
|
13827
|
+
row.id,
|
|
13828
|
+
{
|
|
13829
|
+
status: "archived",
|
|
13830
|
+
metadata: {
|
|
13831
|
+
...row.record.content.metadata,
|
|
13832
|
+
retiredAt: at,
|
|
13833
|
+
retiredReason: reason,
|
|
13834
|
+
...extra
|
|
13835
|
+
}
|
|
13836
|
+
},
|
|
13837
|
+
row.record.revision
|
|
13838
|
+
);
|
|
13839
|
+
archived.push({ id: row.id, title: row.record.entry.title, reason });
|
|
13840
|
+
} catch (error) {
|
|
13841
|
+
if (!(error instanceof MemoryRevisionConflictError)) throw error;
|
|
13842
|
+
kept += 1;
|
|
13843
|
+
}
|
|
13844
|
+
}, "archive");
|
|
13845
|
+
const groups = /* @__PURE__ */ new Map();
|
|
13846
|
+
for (const row of derived) {
|
|
13847
|
+
const key = [
|
|
13848
|
+
row.record.entry.type ?? "",
|
|
13849
|
+
normalize(row.record.entry.title),
|
|
13850
|
+
normalize(row.record.content.content)
|
|
13851
|
+
].join("\0");
|
|
13852
|
+
groups.set(key, [...groups.get(key) ?? [], row]);
|
|
13853
|
+
}
|
|
13854
|
+
const settled = /* @__PURE__ */ new Set();
|
|
13855
|
+
for (const group of groups.values()) {
|
|
13856
|
+
if (group.length < 2) continue;
|
|
13857
|
+
const [newest, ...older] = [...group].sort(
|
|
13858
|
+
(a, b) => b.record.entry.updatedAt - a.record.entry.updatedAt || b.record.entry.createdAt - a.record.entry.createdAt || (a.id < b.id ? -1 : 1)
|
|
13859
|
+
);
|
|
13860
|
+
if (!newest) continue;
|
|
13861
|
+
for (const row of older) {
|
|
13862
|
+
settled.add(row.id);
|
|
13863
|
+
await archive(row, RETIRED_DUPLICATE, { supersededBy: newest.id });
|
|
13864
|
+
}
|
|
13865
|
+
}
|
|
13866
|
+
for (const row of derived) {
|
|
13867
|
+
if (settled.has(row.id) || !unusedRow(row)) continue;
|
|
13868
|
+
await archive(row, RETIRED_UNUSED);
|
|
13869
|
+
}
|
|
13870
|
+
return {
|
|
13871
|
+
archived,
|
|
13872
|
+
possiblyStale,
|
|
13873
|
+
kept,
|
|
13874
|
+
...unusedSkipped ? { unusedSkipped } : {}
|
|
13875
|
+
};
|
|
13876
|
+
}
|
|
13877
|
+
__name(sweepMemory, "sweepMemory");
|
|
13878
|
+
function describeSweep(report, retireAfterDays) {
|
|
13879
|
+
const lines = [];
|
|
13880
|
+
if (report.archived.length === 0) lines.push("Nothing to tidy: no memory was set aside.");
|
|
13881
|
+
else {
|
|
13882
|
+
lines.push(
|
|
13883
|
+
`Retired ${report.archived.length} ${report.archived.length === 1 ? "memory" : "memories"}. /memory restores them.`
|
|
13884
|
+
);
|
|
13885
|
+
for (const item of report.archived)
|
|
13886
|
+
lines.push(
|
|
13887
|
+
` ${item.title.replace(/\s+/gu, " ").trim()} \xB7 ${item.reason === RETIRED_DUPLICATE ? "a newer copy exists" : `not recalled for ${retireAfterDays} days`}`
|
|
13888
|
+
);
|
|
13889
|
+
}
|
|
13890
|
+
if (report.unusedSkipped === "unknown")
|
|
13891
|
+
lines.push(
|
|
13892
|
+
"Use counts are not known yet, so no memory was retired for being unused. They start counting now."
|
|
13893
|
+
);
|
|
13894
|
+
if (report.unusedSkipped === "off")
|
|
13895
|
+
lines.push("memory.retireAfterDays is 0, so no memory is retired for being unused.");
|
|
13896
|
+
if (report.possiblyStale.length > 0)
|
|
13897
|
+
lines.push(
|
|
13898
|
+
`${report.possiblyStale.length} you or Namzu saved ${report.possiblyStale.length === 1 ? "has" : "have"} not been recalled for ${retireAfterDays} days. They stay; /memory marks them.`
|
|
13899
|
+
);
|
|
13900
|
+
if (report.kept > 0) lines.push(`${report.kept} changed while tidying and stayed.`);
|
|
13901
|
+
return lines.join("\n");
|
|
13902
|
+
}
|
|
13903
|
+
__name(describeSweep, "describeSweep");
|
|
13904
|
+
|
|
13905
|
+
// src/memory/manage.ts
|
|
13906
|
+
var DAY_MS2 = 864e5;
|
|
13907
|
+
async function loadManagedMemories(store, directory, lookups = {}) {
|
|
13908
|
+
const items = [];
|
|
13909
|
+
const { usage } = lookups;
|
|
13910
|
+
const at = lookups.now ?? Date.now();
|
|
13911
|
+
for (const status of ["active", "archived"]) {
|
|
13912
|
+
const { entries } = await store.list({ status });
|
|
13913
|
+
for (const entry of entries) {
|
|
13914
|
+
const record = await store.getVersionedRecord(entry.id);
|
|
13915
|
+
if (!record || record.entry.status !== status) continue;
|
|
13916
|
+
const metadata = record.content.metadata;
|
|
13917
|
+
const retiredReason = status === "archived" ? retiredReasonOf(metadata) : void 0;
|
|
13918
|
+
if (status === "archived" && retiredReason === void 0) continue;
|
|
13919
|
+
const origin = memoryOrigin(metadata);
|
|
13920
|
+
const supersedes = metadata?.supersedes;
|
|
13921
|
+
const replaced = typeof supersedes === "string" ? (await store.getRecord(supersedes))?.entry.title : void 0;
|
|
13922
|
+
const state = status === "archived" ? "retired" : usage?.isSetAside(entry.id) ? "set-aside" : "active";
|
|
13923
|
+
const stale = status === "active" && origin !== "derived" && usage !== void 0 && lookups.retireAfterDays !== void 0 && lookups.retireAfterDays > 0 && usage.state === "known" && isUnused({
|
|
13924
|
+
usage,
|
|
13925
|
+
id: entry.id,
|
|
13926
|
+
touchedAt: record.entry.updatedAt,
|
|
13927
|
+
at,
|
|
13928
|
+
retireAfterDays: lookups.retireAfterDays
|
|
13929
|
+
});
|
|
13930
|
+
items.push({
|
|
13931
|
+
id: record.entry.id,
|
|
13932
|
+
name: record.entry.name,
|
|
13933
|
+
title: record.entry.title,
|
|
13934
|
+
type: record.entry.type,
|
|
13935
|
+
origin,
|
|
13936
|
+
createdAt: record.entry.createdAt,
|
|
13937
|
+
updatedAt: record.entry.updatedAt,
|
|
13938
|
+
revision: record.revision,
|
|
13939
|
+
path: record.entry.name ? join18(directory, `${record.entry.name}.md`) : directory,
|
|
13940
|
+
...replaced ? { replaces: replaced } : {},
|
|
13941
|
+
...state !== "active" ? { state } : {},
|
|
13942
|
+
...retiredReason !== void 0 ? { retiredReason } : {},
|
|
13943
|
+
...state === "retired" && usage?.isSetAside(entry.id) ? { alsoSetAside: true } : {},
|
|
13944
|
+
...stale ? { possiblyStale: true } : {}
|
|
13945
|
+
});
|
|
13946
|
+
}
|
|
13672
13947
|
}
|
|
13673
13948
|
return sortManagedMemories(items);
|
|
13674
13949
|
}
|
|
13675
13950
|
__name(loadManagedMemories, "loadManagedMemories");
|
|
13951
|
+
var STATE_RANK = { active: 0, "set-aside": 1, retired: 2 };
|
|
13676
13952
|
var ORIGIN_RANK = {
|
|
13677
13953
|
operator: 0,
|
|
13678
13954
|
model: 1,
|
|
@@ -13680,7 +13956,7 @@ var ORIGIN_RANK = {
|
|
|
13680
13956
|
};
|
|
13681
13957
|
function sortManagedMemories(items) {
|
|
13682
13958
|
return [...items].sort(
|
|
13683
|
-
(a, b) => ORIGIN_RANK[a.origin] - ORIGIN_RANK[b.origin] || b.updatedAt - a.updatedAt || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)
|
|
13959
|
+
(a, b) => STATE_RANK[a.state ?? "active"] - STATE_RANK[b.state ?? "active"] || ORIGIN_RANK[a.origin] - ORIGIN_RANK[b.origin] || b.updatedAt - a.updatedAt || (a.id < b.id ? -1 : a.id > b.id ? 1 : 0)
|
|
13684
13960
|
);
|
|
13685
13961
|
}
|
|
13686
13962
|
__name(sortManagedMemories, "sortManagedMemories");
|
|
@@ -13689,7 +13965,7 @@ function originLabel(origin) {
|
|
|
13689
13965
|
}
|
|
13690
13966
|
__name(originLabel, "originLabel");
|
|
13691
13967
|
function ageLabel(updatedAt, now = Date.now()) {
|
|
13692
|
-
const days = Math.max(0, Math.floor((now - updatedAt) /
|
|
13968
|
+
const days = Math.max(0, Math.floor((now - updatedAt) / DAY_MS2));
|
|
13693
13969
|
if (days === 0) return "today";
|
|
13694
13970
|
return `${days} day${days === 1 ? "" : "s"} ago`;
|
|
13695
13971
|
}
|
|
@@ -13699,8 +13975,17 @@ function memoryLabel(item) {
|
|
|
13699
13975
|
return line;
|
|
13700
13976
|
}
|
|
13701
13977
|
__name(memoryLabel, "memoryLabel");
|
|
13978
|
+
function stateLabel(item) {
|
|
13979
|
+
if (item.state === "set-aside") return "set aside: a refused request carried it";
|
|
13980
|
+
if (item.state === "retired") {
|
|
13981
|
+
const why = item.retiredReason === RETIRED_DUPLICATE ? "a newer copy exists" : "not recalled for a while";
|
|
13982
|
+
return item.alsoSetAside ? `retired and set aside: ${why}` : `retired: ${why}`;
|
|
13983
|
+
}
|
|
13984
|
+
return item.possiblyStale ? "possibly stale: not recalled for a while" : void 0;
|
|
13985
|
+
}
|
|
13986
|
+
__name(stateLabel, "stateLabel");
|
|
13702
13987
|
function memoryDescription(item, now = Date.now()) {
|
|
13703
|
-
return [originLabel(item.origin), item.type, ageLabel(item.updatedAt, now)].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
13988
|
+
return [stateLabel(item), originLabel(item.origin), item.type, ageLabel(item.updatedAt, now)].filter((part) => Boolean(part)).join(" \xB7 ");
|
|
13704
13989
|
}
|
|
13705
13990
|
__name(memoryDescription, "memoryDescription");
|
|
13706
13991
|
var DELETE_ALL_RECORDED = "__delete-all-recorded__";
|
|
@@ -13754,6 +14039,7 @@ function renderMemoryDetail(item, body2) {
|
|
|
13754
14039
|
return [
|
|
13755
14040
|
memoryLabel(item),
|
|
13756
14041
|
`Written by: ${originLabel(item.origin)}`,
|
|
14042
|
+
...stateLabel(item) ? [`State: ${stateLabel(item)}`] : [],
|
|
13757
14043
|
...item.replaces ? [`Replaced: ${item.replaces.replace(/\s+/g, " ").trim()}`] : [],
|
|
13758
14044
|
...item.type ? [`Type: ${item.type}`] : [],
|
|
13759
14045
|
`Created: ${stamp(item.createdAt)}`,
|
|
@@ -13778,6 +14064,33 @@ async function deleteManagedMemory(store, item) {
|
|
|
13778
14064
|
}
|
|
13779
14065
|
}
|
|
13780
14066
|
__name(deleteManagedMemory, "deleteManagedMemory");
|
|
14067
|
+
async function restoreManagedMemory(store, item, liftSetAside) {
|
|
14068
|
+
if (item.state === "set-aside") {
|
|
14069
|
+
await liftSetAside(item.id);
|
|
14070
|
+
return "restored";
|
|
14071
|
+
}
|
|
14072
|
+
if (item.state !== "retired") return "not-needed";
|
|
14073
|
+
try {
|
|
14074
|
+
const record = await store.getVersionedRecord(item.id);
|
|
14075
|
+
if (!record) return "gone";
|
|
14076
|
+
const { retiredAt: _at, retiredReason: _reason, ...rest } = record.content.metadata ?? {};
|
|
14077
|
+
await store.updateIfRevision(item.id, { status: "active", metadata: rest }, item.revision);
|
|
14078
|
+
await liftSetAside(item.id);
|
|
14079
|
+
return "restored";
|
|
14080
|
+
} catch (error) {
|
|
14081
|
+
if (!(error instanceof MemoryRevisionConflictError)) throw error;
|
|
14082
|
+
return await store.getRecord(item.id) ? "changed" : "gone";
|
|
14083
|
+
}
|
|
14084
|
+
}
|
|
14085
|
+
__name(restoreManagedMemory, "restoreManagedMemory");
|
|
14086
|
+
function restoreOutcomeLine(item, outcome) {
|
|
14087
|
+
if (outcome === "restored") return `Restored \u201C${memoryLabel(item)}\u201D. Namzu may recall it again.`;
|
|
14088
|
+
if (outcome === "changed")
|
|
14089
|
+
return `\u201C${memoryLabel(item)}\u201D changed since it was listed, so it was left as it was. /memory lists it again.`;
|
|
14090
|
+
if (outcome === "gone") return `\u201C${memoryLabel(item)}\u201D was already gone.`;
|
|
14091
|
+
return `\u201C${memoryLabel(item)}\u201D needs no restoring.`;
|
|
14092
|
+
}
|
|
14093
|
+
__name(restoreOutcomeLine, "restoreOutcomeLine");
|
|
13781
14094
|
async function deleteMemories(store, items) {
|
|
13782
14095
|
let deleted = 0;
|
|
13783
14096
|
let kept = 0;
|
|
@@ -14048,10 +14361,10 @@ __name(screenCandidate, "screenCandidate");
|
|
|
14048
14361
|
function screenMemoryPromotion(promote, log) {
|
|
14049
14362
|
return (candidate) => {
|
|
14050
14363
|
const { candidate: screened, dropped } = screenCandidate(candidate);
|
|
14051
|
-
for (const [reason,
|
|
14364
|
+
for (const [reason, count2] of Object.entries(dropped)) {
|
|
14052
14365
|
log.info("memory claims dropped", {
|
|
14053
14366
|
"namzu.memory.screen.reason": reason,
|
|
14054
|
-
"namzu.memory.screen.dropped_count":
|
|
14367
|
+
"namzu.memory.screen.dropped_count": count2
|
|
14055
14368
|
});
|
|
14056
14369
|
}
|
|
14057
14370
|
return promote(screened);
|
|
@@ -14180,9 +14493,9 @@ function parseOps(reply, candidateCount) {
|
|
|
14180
14493
|
const o = raw;
|
|
14181
14494
|
const candidate = typeof o.candidate === "number" ? Math.trunc(o.candidate) - 1 : Number.NaN;
|
|
14182
14495
|
if (!Number.isInteger(candidate) || candidate < 0 || candidate >= candidateCount) continue;
|
|
14183
|
-
const
|
|
14184
|
-
perCandidate.set(candidate,
|
|
14185
|
-
if (
|
|
14496
|
+
const count2 = (perCandidate.get(candidate) ?? 0) + 1;
|
|
14497
|
+
perCandidate.set(candidate, count2);
|
|
14498
|
+
if (count2 > OPS_PER_CANDIDATE) continue;
|
|
14186
14499
|
const op = OPS.find((kind) => kind === o.op);
|
|
14187
14500
|
if (op === void 0) {
|
|
14188
14501
|
out.push({ candidate, invalid: true });
|
|
@@ -14595,9 +14908,14 @@ var CurationRuntime = class {
|
|
|
14595
14908
|
#deps;
|
|
14596
14909
|
#timer = null;
|
|
14597
14910
|
#disposed = false;
|
|
14911
|
+
#draining = 0;
|
|
14598
14912
|
constructor(deps) {
|
|
14599
14913
|
this.#deps = deps;
|
|
14600
14914
|
}
|
|
14915
|
+
/** Whether a drain is in flight right now. */
|
|
14916
|
+
get draining() {
|
|
14917
|
+
return this.#draining > 0;
|
|
14918
|
+
}
|
|
14601
14919
|
#cancel() {
|
|
14602
14920
|
if (this.#timer === null) return;
|
|
14603
14921
|
this.#deps.clearTimer(this.#timer);
|
|
@@ -14651,6 +14969,7 @@ var CurationRuntime = class {
|
|
|
14651
14969
|
this.#deps.report?.(reason, "skipped");
|
|
14652
14970
|
return void 0;
|
|
14653
14971
|
}
|
|
14972
|
+
this.#draining += 1;
|
|
14654
14973
|
try {
|
|
14655
14974
|
const lines = [];
|
|
14656
14975
|
const result = await inbox.drain(async (entries) => {
|
|
@@ -14671,18 +14990,24 @@ var CurationRuntime = class {
|
|
|
14671
14990
|
} catch {
|
|
14672
14991
|
this.#deps.report?.(reason, "failed");
|
|
14673
14992
|
return void 0;
|
|
14993
|
+
} finally {
|
|
14994
|
+
this.#draining -= 1;
|
|
14674
14995
|
}
|
|
14675
14996
|
}
|
|
14676
14997
|
};
|
|
14677
14998
|
function createCurationLog(file) {
|
|
14678
|
-
let
|
|
14679
|
-
|
|
14680
|
-
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
|
|
14999
|
+
let tail2;
|
|
15000
|
+
const write = /* @__PURE__ */ __name((entry) => {
|
|
15001
|
+
const line = `${JSON.stringify(entry)}
|
|
15002
|
+
`;
|
|
15003
|
+
tail2 ??= mkdir5(dirname4(file), { recursive: true, mode: 448 }).then(
|
|
15004
|
+
() => void 0,
|
|
15005
|
+
() => void 0
|
|
15006
|
+
);
|
|
15007
|
+
tail2 = tail2.then(() => appendFile3(file, line, { mode: 384 })).catch(() => {
|
|
14684
15008
|
});
|
|
14685
|
-
};
|
|
15009
|
+
}, "write");
|
|
15010
|
+
return Object.assign(write, { settled: /* @__PURE__ */ __name(() => tail2 ?? Promise.resolve(), "settled") });
|
|
14686
15011
|
}
|
|
14687
15012
|
__name(createCurationLog, "createCurationLog");
|
|
14688
15013
|
function inboxPromotion(options) {
|
|
@@ -14726,7 +15051,7 @@ import {
|
|
|
14726
15051
|
unlink as unlink3,
|
|
14727
15052
|
writeFile as writeFile4
|
|
14728
15053
|
} from "node:fs/promises";
|
|
14729
|
-
import { basename as basename3, dirname as dirname5, join as
|
|
15054
|
+
import { basename as basename3, dirname as dirname5, join as join19 } from "node:path";
|
|
14730
15055
|
var INBOX_BATCH_SIZE = 8;
|
|
14731
15056
|
var INBOX_MAX_BATCHES = 3;
|
|
14732
15057
|
var INBOX_CLAIM_STALE_MS = 12e4;
|
|
@@ -14821,7 +15146,7 @@ var MemoryInbox = class {
|
|
|
14821
15146
|
return dedupe(texts.flatMap((text2) => text2 === void 0 ? [] : parseLines(text2)));
|
|
14822
15147
|
}
|
|
14823
15148
|
#newClaimPath(now) {
|
|
14824
|
-
return
|
|
15149
|
+
return join19(
|
|
14825
15150
|
dirname5(this.#file),
|
|
14826
15151
|
`${basename3(this.#file, ".jsonl")}.claim-${now}-${this.#newId()}.jsonl`
|
|
14827
15152
|
);
|
|
@@ -14840,7 +15165,7 @@ var MemoryInbox = class {
|
|
|
14840
15165
|
if (!name.startsWith(prefix)) continue;
|
|
14841
15166
|
const match = CLAIM_PATTERN.exec(name);
|
|
14842
15167
|
if (!match) continue;
|
|
14843
|
-
out.push({ path:
|
|
15168
|
+
out.push({ path: join19(dirname5(this.#file), name), at: Number(match[1]) });
|
|
14844
15169
|
}
|
|
14845
15170
|
return out.sort((a, b) => a.at - b.at);
|
|
14846
15171
|
}
|
|
@@ -14950,9 +15275,169 @@ async function atomicWrite(path, text2) {
|
|
|
14950
15275
|
}
|
|
14951
15276
|
__name(atomicWrite, "atomicWrite");
|
|
14952
15277
|
|
|
15278
|
+
// src/memory/lifecycle.ts
|
|
15279
|
+
var SWEEP_IDLE_MS = 15e3;
|
|
15280
|
+
var SWEEP_MIN_GAP_MS = 6 * 36e5;
|
|
15281
|
+
var MemoryLifecycle = class {
|
|
15282
|
+
static {
|
|
15283
|
+
__name(this, "MemoryLifecycle");
|
|
15284
|
+
}
|
|
15285
|
+
#deps;
|
|
15286
|
+
#timer = null;
|
|
15287
|
+
#turnRunning = false;
|
|
15288
|
+
/** The sweep in flight, so a second one queues behind it. */
|
|
15289
|
+
#inflight;
|
|
15290
|
+
#lastSweepAt;
|
|
15291
|
+
#disposed = false;
|
|
15292
|
+
/** A refused request was retried without the memories it carried. */
|
|
15293
|
+
#withheld = false;
|
|
15294
|
+
constructor(deps) {
|
|
15295
|
+
this.#deps = deps;
|
|
15296
|
+
}
|
|
15297
|
+
/** The keys a refused request is retried without. */
|
|
15298
|
+
withholdOnRefusal = [RECALLED_MEMORY_KEY];
|
|
15299
|
+
/** Keys withheld from every request of the session once one refusal was retried without them. */
|
|
15300
|
+
withheldKeys() {
|
|
15301
|
+
return this.#withheld ? [RECALLED_MEMORY_KEY] : [];
|
|
15302
|
+
}
|
|
15303
|
+
/** The ids recall must not offer. */
|
|
15304
|
+
excluded = /* @__PURE__ */ __name(() => this.#deps.usage.setAsideIds(), "excluded");
|
|
15305
|
+
/** Read the usage file and arm the first idle sweep. */
|
|
15306
|
+
async start() {
|
|
15307
|
+
await this.#deps.usage.load();
|
|
15308
|
+
this.#arm();
|
|
15309
|
+
}
|
|
15310
|
+
/** Every session event of a turn. */
|
|
15311
|
+
observe(event) {
|
|
15312
|
+
switch (event.type) {
|
|
15313
|
+
case "memory_recalled": {
|
|
15314
|
+
const ids = event.memories.map((memory) => memory.id);
|
|
15315
|
+
const chosen = event.memories.filter((memory) => memory.reason !== void 0 && memory.reason !== "matched words").map((memory) => memory.id);
|
|
15316
|
+
this.#deps.usage.recalled(ids, chosen);
|
|
15317
|
+
return;
|
|
15318
|
+
}
|
|
15319
|
+
case "model_refusal":
|
|
15320
|
+
if (event.outcome === "withheld") {
|
|
15321
|
+
this.#withheld = true;
|
|
15322
|
+
const ids = event.withheldMemoryIds ?? [];
|
|
15323
|
+
this.#deps.usage.setAside(ids);
|
|
15324
|
+
this.#deps.log?.("memory set aside after a refusal", {
|
|
15325
|
+
"namzu.memory.lifecycle.set_aside_count": ids.length
|
|
15326
|
+
});
|
|
15327
|
+
void this.#deps.usage.flush();
|
|
15328
|
+
}
|
|
15329
|
+
return;
|
|
15330
|
+
case "turn_completed":
|
|
15331
|
+
case "turn_failed":
|
|
15332
|
+
this.turnSettled();
|
|
15333
|
+
return;
|
|
15334
|
+
default:
|
|
15335
|
+
}
|
|
15336
|
+
}
|
|
15337
|
+
/** A turn is starting: the idle sweep is off. */
|
|
15338
|
+
turnStarted() {
|
|
15339
|
+
if (this.#disposed) return;
|
|
15340
|
+
this.#turnRunning = true;
|
|
15341
|
+
this.#cancel();
|
|
15342
|
+
}
|
|
15343
|
+
/** A turn released: write the counts, then wait for quiet. */
|
|
15344
|
+
turnSettled() {
|
|
15345
|
+
if (this.#disposed) return;
|
|
15346
|
+
this.#turnRunning = false;
|
|
15347
|
+
void this.#deps.usage.flush();
|
|
15348
|
+
this.#arm();
|
|
15349
|
+
}
|
|
15350
|
+
/** Lift the set-aside of one record and write it. */
|
|
15351
|
+
async restore(id) {
|
|
15352
|
+
this.#deps.usage.restore(id);
|
|
15353
|
+
await this.#deps.usage.flush();
|
|
15354
|
+
}
|
|
15355
|
+
/** The sweep, now. Never waits for quiet. */
|
|
15356
|
+
async tidy() {
|
|
15357
|
+
await this.#deps.usage.flush();
|
|
15358
|
+
const report = await this.#serial(() => this.#sweep());
|
|
15359
|
+
this.#lastSweepAt = this.#deps.now();
|
|
15360
|
+
return report;
|
|
15361
|
+
}
|
|
15362
|
+
/** One sweep at a time: a run waits for the one in flight. */
|
|
15363
|
+
async #serial(run2) {
|
|
15364
|
+
const behind = this.#inflight;
|
|
15365
|
+
const current = (async () => {
|
|
15366
|
+
if (behind) await behind.catch(() => void 0);
|
|
15367
|
+
return run2();
|
|
15368
|
+
})();
|
|
15369
|
+
this.#inflight = current;
|
|
15370
|
+
try {
|
|
15371
|
+
return await current;
|
|
15372
|
+
} finally {
|
|
15373
|
+
if (this.#inflight === current) this.#inflight = void 0;
|
|
15374
|
+
}
|
|
15375
|
+
}
|
|
15376
|
+
async #sweep(shouldStop) {
|
|
15377
|
+
const report = await sweepMemory({
|
|
15378
|
+
store: this.#deps.store,
|
|
15379
|
+
usage: this.#deps.usage,
|
|
15380
|
+
now: this.#deps.now,
|
|
15381
|
+
retireAfterDays: this.#deps.retireAfterDays,
|
|
15382
|
+
...shouldStop ? { shouldStop } : {}
|
|
15383
|
+
});
|
|
15384
|
+
this.#deps.log?.("memory sweep finished", {
|
|
15385
|
+
"namzu.memory.sweep.archived_count": report.archived.length,
|
|
15386
|
+
"namzu.memory.sweep.unused_count": report.archived.filter((item) => item.reason === "unused").length,
|
|
15387
|
+
"namzu.memory.sweep.duplicate_count": report.archived.filter(
|
|
15388
|
+
(item) => item.reason === "duplicate"
|
|
15389
|
+
).length,
|
|
15390
|
+
"namzu.memory.sweep.possibly_stale_count": report.possiblyStale.length,
|
|
15391
|
+
"namzu.memory.sweep.kept_count": report.kept
|
|
15392
|
+
});
|
|
15393
|
+
return report;
|
|
15394
|
+
}
|
|
15395
|
+
#cancel() {
|
|
15396
|
+
if (this.#timer === null) return;
|
|
15397
|
+
this.#deps.clearTimer(this.#timer);
|
|
15398
|
+
this.#timer = null;
|
|
15399
|
+
}
|
|
15400
|
+
#arm() {
|
|
15401
|
+
if (this.#disposed || this.#turnRunning) return;
|
|
15402
|
+
this.#cancel();
|
|
15403
|
+
this.#timer = this.#deps.setTimer(() => {
|
|
15404
|
+
this.#timer = null;
|
|
15405
|
+
return this.#idle();
|
|
15406
|
+
}, SWEEP_IDLE_MS);
|
|
15407
|
+
}
|
|
15408
|
+
async #idle() {
|
|
15409
|
+
if (this.#disposed || this.#turnRunning || this.#inflight) return;
|
|
15410
|
+
if (this.#deps.isBusy?.() === true || this.#deps.isDraining?.() === true) {
|
|
15411
|
+
this.#arm();
|
|
15412
|
+
return;
|
|
15413
|
+
}
|
|
15414
|
+
const last = this.#lastSweepAt;
|
|
15415
|
+
if (last !== void 0 && this.#deps.now() - last < SWEEP_MIN_GAP_MS) return;
|
|
15416
|
+
try {
|
|
15417
|
+
await this.#deps.usage.flush();
|
|
15418
|
+
const report = await this.#serial(
|
|
15419
|
+
() => this.#sweep(
|
|
15420
|
+
() => this.#turnRunning || this.#disposed || this.#deps.isDraining?.() === true
|
|
15421
|
+
)
|
|
15422
|
+
);
|
|
15423
|
+
this.#lastSweepAt = this.#deps.now();
|
|
15424
|
+
if (report.archived.length > 0) this.#deps.onSwept?.(report);
|
|
15425
|
+
} catch {
|
|
15426
|
+
this.#deps.log?.("memory sweep failed", { "namzu.memory.sweep.reason": "store" });
|
|
15427
|
+
}
|
|
15428
|
+
}
|
|
15429
|
+
/** Write what is pending and stop arming. */
|
|
15430
|
+
async dispose() {
|
|
15431
|
+
if (this.#disposed) return;
|
|
15432
|
+
this.#disposed = true;
|
|
15433
|
+
this.#cancel();
|
|
15434
|
+
await this.#deps.usage.flush();
|
|
15435
|
+
}
|
|
15436
|
+
};
|
|
15437
|
+
|
|
14953
15438
|
// src/memory/screen-archive.ts
|
|
14954
15439
|
import { access as access2, writeFile as writeFile5 } from "node:fs/promises";
|
|
14955
|
-
import { join as
|
|
15440
|
+
import { join as join20 } from "node:path";
|
|
14956
15441
|
var SCREEN_MARKER_FILE = ".derived-screen-v1";
|
|
14957
15442
|
var HEADINGS = {
|
|
14958
15443
|
"What the user requires": "userRequirements",
|
|
@@ -15011,7 +15496,7 @@ ${body2}`) !== void 0) return true;
|
|
|
15011
15496
|
__name(wouldNotBeWritten, "wouldNotBeWritten");
|
|
15012
15497
|
async function archiveUnscreenedRecords(options) {
|
|
15013
15498
|
const { store, directory, log } = options;
|
|
15014
|
-
const marker =
|
|
15499
|
+
const marker = join20(directory, SCREEN_MARKER_FILE);
|
|
15015
15500
|
try {
|
|
15016
15501
|
if (await access2(marker).then(
|
|
15017
15502
|
() => true,
|
|
@@ -15191,6 +15676,250 @@ function memorySelectionOptions(setting, deps) {
|
|
|
15191
15676
|
}
|
|
15192
15677
|
__name(memorySelectionOptions, "memorySelectionOptions");
|
|
15193
15678
|
|
|
15679
|
+
// src/memory/usage.ts
|
|
15680
|
+
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
15681
|
+
import { mkdir as mkdir7, readFile as readFile8, rename as rename5, rm as rm3, writeFile as writeFile6 } from "node:fs/promises";
|
|
15682
|
+
import { dirname as dirname6 } from "node:path";
|
|
15683
|
+
var VERSION = 1;
|
|
15684
|
+
var nodeUsageFs = {
|
|
15685
|
+
readFile: /* @__PURE__ */ __name((path) => readFile8(path, "utf8"), "readFile"),
|
|
15686
|
+
writeFile: /* @__PURE__ */ __name((path, data) => writeFile6(path, data, { mode: 384 }), "writeFile"),
|
|
15687
|
+
rename: rename5,
|
|
15688
|
+
mkdir: /* @__PURE__ */ __name(async (path) => {
|
|
15689
|
+
await mkdir7(path, { recursive: true, mode: 448 });
|
|
15690
|
+
}, "mkdir"),
|
|
15691
|
+
rm: /* @__PURE__ */ __name((path) => rm3(path, { force: true }), "rm")
|
|
15692
|
+
};
|
|
15693
|
+
function isRecord3(value) {
|
|
15694
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15695
|
+
}
|
|
15696
|
+
__name(isRecord3, "isRecord");
|
|
15697
|
+
function count(value) {
|
|
15698
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
15699
|
+
}
|
|
15700
|
+
__name(count, "count");
|
|
15701
|
+
function parse(text2) {
|
|
15702
|
+
let raw;
|
|
15703
|
+
try {
|
|
15704
|
+
raw = JSON.parse(text2);
|
|
15705
|
+
} catch {
|
|
15706
|
+
return void 0;
|
|
15707
|
+
}
|
|
15708
|
+
if (!isRecord3(raw) || raw.version !== VERSION) return void 0;
|
|
15709
|
+
const since = count(raw.since);
|
|
15710
|
+
if (since === void 0 || !isRecord3(raw.records) || !isRecord3(raw.setAside)) return void 0;
|
|
15711
|
+
const records = {};
|
|
15712
|
+
for (const [id, value] of Object.entries(raw.records)) {
|
|
15713
|
+
if (!isRecord3(value)) return void 0;
|
|
15714
|
+
const recalls = count(value.recalls);
|
|
15715
|
+
const selected = count(value.selected);
|
|
15716
|
+
const lastRecalledAt = count(value.lastRecalledAt);
|
|
15717
|
+
if (recalls === void 0 || selected === void 0 || lastRecalledAt === void 0)
|
|
15718
|
+
return void 0;
|
|
15719
|
+
records[id] = { recalls, selected, lastRecalledAt };
|
|
15720
|
+
}
|
|
15721
|
+
const setAside = {};
|
|
15722
|
+
for (const [id, value] of Object.entries(raw.setAside)) {
|
|
15723
|
+
if (!isRecord3(value)) return void 0;
|
|
15724
|
+
const at = count(value.at);
|
|
15725
|
+
if (at === void 0) return void 0;
|
|
15726
|
+
setAside[id] = { at, reason: "refused" };
|
|
15727
|
+
}
|
|
15728
|
+
return { version: VERSION, since, records, setAside };
|
|
15729
|
+
}
|
|
15730
|
+
__name(parse, "parse");
|
|
15731
|
+
var MemoryUsage = class {
|
|
15732
|
+
static {
|
|
15733
|
+
__name(this, "MemoryUsage");
|
|
15734
|
+
}
|
|
15735
|
+
#file;
|
|
15736
|
+
#now;
|
|
15737
|
+
#fs;
|
|
15738
|
+
#log;
|
|
15739
|
+
#state = "unknown";
|
|
15740
|
+
#since = 0;
|
|
15741
|
+
#baseRecords = {};
|
|
15742
|
+
#baseAside = {};
|
|
15743
|
+
#records = /* @__PURE__ */ new Map();
|
|
15744
|
+
#setAside = /* @__PURE__ */ new Map();
|
|
15745
|
+
#deltas = /* @__PURE__ */ new Map();
|
|
15746
|
+
#asideAdded = /* @__PURE__ */ new Map();
|
|
15747
|
+
#asideLifted = /* @__PURE__ */ new Set();
|
|
15748
|
+
#flushing = Promise.resolve();
|
|
15749
|
+
constructor(deps) {
|
|
15750
|
+
this.#file = deps.file;
|
|
15751
|
+
this.#now = deps.now;
|
|
15752
|
+
this.#fs = deps.fs ?? nodeUsageFs;
|
|
15753
|
+
this.#log = deps.log;
|
|
15754
|
+
}
|
|
15755
|
+
/** Whether the counters can be trusted. Before `load`, and after a read that failed, `unknown`. */
|
|
15756
|
+
get state() {
|
|
15757
|
+
return this.#state;
|
|
15758
|
+
}
|
|
15759
|
+
/** When this file began counting; 0 while `unknown`. */
|
|
15760
|
+
get since() {
|
|
15761
|
+
return this.#since;
|
|
15762
|
+
}
|
|
15763
|
+
/** Read the file. Never rejects: a file that cannot be read leaves the state `unknown`. */
|
|
15764
|
+
async load() {
|
|
15765
|
+
const read2 = await this.#read();
|
|
15766
|
+
if (read2 === "missing" || read2 === "unreadable" || read2 === "blocked") {
|
|
15767
|
+
this.#state = "unknown";
|
|
15768
|
+
this.#merge(void 0);
|
|
15769
|
+
return;
|
|
15770
|
+
}
|
|
15771
|
+
this.#state = "known";
|
|
15772
|
+
this.#since = read2.since;
|
|
15773
|
+
this.#baseRecords = read2.records;
|
|
15774
|
+
this.#baseAside = read2.setAside;
|
|
15775
|
+
this.#merge(read2);
|
|
15776
|
+
}
|
|
15777
|
+
/**
|
|
15778
|
+
* The file as it is now: 'missing', 'unreadable' (bad content, moved aside),
|
|
15779
|
+
* 'blocked' (there, but neither readable nor movable: never overwritten),
|
|
15780
|
+
* or its content.
|
|
15781
|
+
*/
|
|
15782
|
+
async #read() {
|
|
15783
|
+
let text2;
|
|
15784
|
+
try {
|
|
15785
|
+
text2 = await this.#fs.readFile(this.#file);
|
|
15786
|
+
} catch (error) {
|
|
15787
|
+
if (error.code === "ENOENT") return "missing";
|
|
15788
|
+
this.#log?.("memory usage unreadable", { "namzu.memory.usage.reason": "read" });
|
|
15789
|
+
return "blocked";
|
|
15790
|
+
}
|
|
15791
|
+
const parsed = parse(text2);
|
|
15792
|
+
if (parsed) return parsed;
|
|
15793
|
+
this.#log?.("memory usage unreadable", { "namzu.memory.usage.reason": "corrupt" });
|
|
15794
|
+
try {
|
|
15795
|
+
await this.#fs.rename(this.#file, `${this.#file}.corrupt`);
|
|
15796
|
+
} catch {
|
|
15797
|
+
return "blocked";
|
|
15798
|
+
}
|
|
15799
|
+
return "unreadable";
|
|
15800
|
+
}
|
|
15801
|
+
/** The file's content with this process's pending changes laid over it. */
|
|
15802
|
+
#merge(file) {
|
|
15803
|
+
const records = new Map(Object.entries(file?.records ?? {}));
|
|
15804
|
+
for (const [id, delta] of this.#deltas) {
|
|
15805
|
+
const base = records.get(id);
|
|
15806
|
+
records.set(id, {
|
|
15807
|
+
recalls: (base?.recalls ?? 0) + delta.recalls,
|
|
15808
|
+
selected: (base?.selected ?? 0) + delta.selected,
|
|
15809
|
+
lastRecalledAt: Math.max(base?.lastRecalledAt ?? 0, delta.lastRecalledAt)
|
|
15810
|
+
});
|
|
15811
|
+
}
|
|
15812
|
+
const aside = new Map(Object.entries(file?.setAside ?? {}));
|
|
15813
|
+
for (const [id, entry] of this.#asideAdded) aside.set(id, entry);
|
|
15814
|
+
for (const id of this.#asideLifted) aside.delete(id);
|
|
15815
|
+
this.#records = records;
|
|
15816
|
+
this.#setAside = aside;
|
|
15817
|
+
}
|
|
15818
|
+
/** The counters of one record, or undefined when nothing was counted for it. */
|
|
15819
|
+
get(id) {
|
|
15820
|
+
return this.#records.get(id);
|
|
15821
|
+
}
|
|
15822
|
+
/** Recall put these records in front of the model. `selected` are those a selector chose. */
|
|
15823
|
+
recalled(ids, selected = []) {
|
|
15824
|
+
if (ids.length === 0) return;
|
|
15825
|
+
const at = this.#now();
|
|
15826
|
+
const chosen = new Set(selected);
|
|
15827
|
+
for (const id of new Set(ids)) {
|
|
15828
|
+
const delta = this.#deltas.get(id) ?? { recalls: 0, selected: 0, lastRecalledAt: 0 };
|
|
15829
|
+
delta.recalls += 1;
|
|
15830
|
+
if (chosen.has(id)) delta.selected += 1;
|
|
15831
|
+
delta.lastRecalledAt = at;
|
|
15832
|
+
this.#deltas.set(id, delta);
|
|
15833
|
+
}
|
|
15834
|
+
this.#merge(this.#base());
|
|
15835
|
+
}
|
|
15836
|
+
/** Set records aside: recall does not offer them again until `restore`. */
|
|
15837
|
+
setAside(ids) {
|
|
15838
|
+
const at = this.#now();
|
|
15839
|
+
for (const id of ids) {
|
|
15840
|
+
this.#asideLifted.delete(id);
|
|
15841
|
+
this.#asideAdded.set(id, { at, reason: "refused" });
|
|
15842
|
+
}
|
|
15843
|
+
this.#merge(this.#base());
|
|
15844
|
+
}
|
|
15845
|
+
/** Lift the set-aside of one record. */
|
|
15846
|
+
restore(id) {
|
|
15847
|
+
this.#asideAdded.delete(id);
|
|
15848
|
+
this.#asideLifted.add(id);
|
|
15849
|
+
this.#merge(this.#base());
|
|
15850
|
+
}
|
|
15851
|
+
isSetAside(id) {
|
|
15852
|
+
return this.#setAside.has(id);
|
|
15853
|
+
}
|
|
15854
|
+
/** The ids recall must skip. A fresh set each call. */
|
|
15855
|
+
setAsideIds() {
|
|
15856
|
+
return new Set(this.#setAside.keys());
|
|
15857
|
+
}
|
|
15858
|
+
/** What the file held when last read, without pending changes. */
|
|
15859
|
+
#base() {
|
|
15860
|
+
return {
|
|
15861
|
+
version: VERSION,
|
|
15862
|
+
since: this.#since,
|
|
15863
|
+
records: this.#baseRecords,
|
|
15864
|
+
setAside: this.#baseAside
|
|
15865
|
+
};
|
|
15866
|
+
}
|
|
15867
|
+
/** Whether anything waits to be written. */
|
|
15868
|
+
get dirty() {
|
|
15869
|
+
return this.#deltas.size > 0 || this.#asideAdded.size > 0 || this.#asideLifted.size > 0;
|
|
15870
|
+
}
|
|
15871
|
+
/** Write what is pending. Never rejects; calls queue behind one another. */
|
|
15872
|
+
flush() {
|
|
15873
|
+
this.#flushing = this.#flushing.then(() => this.#write());
|
|
15874
|
+
return this.#flushing;
|
|
15875
|
+
}
|
|
15876
|
+
async #write() {
|
|
15877
|
+
if (!this.dirty) return;
|
|
15878
|
+
try {
|
|
15879
|
+
const read2 = await this.#read();
|
|
15880
|
+
if (read2 === "blocked") {
|
|
15881
|
+
this.#log?.("memory usage not written", { "namzu.memory.usage.reason": "blocked" });
|
|
15882
|
+
return;
|
|
15883
|
+
}
|
|
15884
|
+
const current = read2 === "missing" || read2 === "unreadable" ? void 0 : read2;
|
|
15885
|
+
const since = current?.since ?? this.#since;
|
|
15886
|
+
const startedAt = since > 0 ? since : this.#now();
|
|
15887
|
+
this.#since = startedAt;
|
|
15888
|
+
this.#baseRecords = current?.records ?? {};
|
|
15889
|
+
this.#baseAside = current?.setAside ?? {};
|
|
15890
|
+
this.#merge(current ?? { version: VERSION, since: startedAt, records: {}, setAside: {} });
|
|
15891
|
+
const body2 = {
|
|
15892
|
+
version: VERSION,
|
|
15893
|
+
since: startedAt,
|
|
15894
|
+
records: Object.fromEntries(this.#records),
|
|
15895
|
+
setAside: Object.fromEntries(this.#setAside)
|
|
15896
|
+
};
|
|
15897
|
+
await this.#fs.mkdir(dirname6(this.#file));
|
|
15898
|
+
const temporary = `${this.#file}.${randomUUID7()}.tmp`;
|
|
15899
|
+
try {
|
|
15900
|
+
await this.#fs.writeFile(temporary, `${JSON.stringify(body2)}
|
|
15901
|
+
`);
|
|
15902
|
+
await this.#fs.rename(temporary, this.#file);
|
|
15903
|
+
} catch (error) {
|
|
15904
|
+
await this.#fs.rm(temporary).catch(() => void 0);
|
|
15905
|
+
throw error;
|
|
15906
|
+
}
|
|
15907
|
+
this.#deltas.clear();
|
|
15908
|
+
this.#asideAdded.clear();
|
|
15909
|
+
this.#asideLifted.clear();
|
|
15910
|
+
this.#baseRecords = body2.records;
|
|
15911
|
+
this.#baseAside = body2.setAside;
|
|
15912
|
+
this.#state = "known";
|
|
15913
|
+
this.#log?.("memory usage written", {
|
|
15914
|
+
"namzu.memory.usage.records": Object.keys(body2.records).length,
|
|
15915
|
+
"namzu.memory.usage.set_aside": Object.keys(body2.setAside).length
|
|
15916
|
+
});
|
|
15917
|
+
} catch {
|
|
15918
|
+
this.#log?.("memory usage not written", { "namzu.memory.usage.reason": "write" });
|
|
15919
|
+
}
|
|
15920
|
+
}
|
|
15921
|
+
};
|
|
15922
|
+
|
|
15194
15923
|
// src/permissions/auto-classifier.ts
|
|
15195
15924
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15196
15925
|
var SMALL_MODEL_KEYWORD = "smallModel";
|
|
@@ -15405,10 +16134,10 @@ __name(cliGate, "cliGate");
|
|
|
15405
16134
|
var WEB_FETCH_TOOL = "web_fetch";
|
|
15406
16135
|
var MAX_LABEL_COMMAND = 60;
|
|
15407
16136
|
var MAX_RULES_PER_ANSWER = 5;
|
|
15408
|
-
function
|
|
16137
|
+
function isRecord4(value) {
|
|
15409
16138
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
15410
16139
|
}
|
|
15411
|
-
__name(
|
|
16140
|
+
__name(isRecord4, "isRecord");
|
|
15412
16141
|
function alwaysAsked(call) {
|
|
15413
16142
|
return mustAskPerson(call) || call.isDestructive === true;
|
|
15414
16143
|
}
|
|
@@ -15493,7 +16222,7 @@ function plainCommands(line) {
|
|
|
15493
16222
|
__name(plainCommands, "plainCommands");
|
|
15494
16223
|
function allowsFor(call, commands) {
|
|
15495
16224
|
if (alwaysAsked(call)) return void 0;
|
|
15496
|
-
const input =
|
|
16225
|
+
const input = isRecord4(call.input) ? call.input : void 0;
|
|
15497
16226
|
const commandArgument = commands.get(call.name);
|
|
15498
16227
|
if (commandArgument !== void 0) {
|
|
15499
16228
|
const line = input?.[commandArgument];
|
|
@@ -15611,7 +16340,7 @@ function createSessionAllows(_commands, options = {}) {
|
|
|
15611
16340
|
);
|
|
15612
16341
|
}, "rebuild");
|
|
15613
16342
|
const allowed = /* @__PURE__ */ __name((call) => {
|
|
15614
|
-
if (
|
|
16343
|
+
if (isRecord4(call.toolInput) && call.toolInput.dangerously_disable_sandbox === true)
|
|
15615
16344
|
return false;
|
|
15616
16345
|
const result = gate?.evaluate(call);
|
|
15617
16346
|
return result !== void 0 && result.matchedRule !== null && result.decision === "allow";
|
|
@@ -15790,7 +16519,7 @@ function buildEnterPlanModeTool(host) {
|
|
|
15790
16519
|
__name(buildEnterPlanModeTool, "buildEnterPlanModeTool");
|
|
15791
16520
|
|
|
15792
16521
|
// src/plan/plan-file.ts
|
|
15793
|
-
import { readFile as
|
|
16522
|
+
import { readFile as readFile9 } from "node:fs/promises";
|
|
15794
16523
|
import { isAbsolute as isAbsolute9, resolve as resolve11 } from "node:path";
|
|
15795
16524
|
var WRITERS = /* @__PURE__ */ new Set(["write", "edit"]);
|
|
15796
16525
|
function isPlanFileWrite(planPath, cwd) {
|
|
@@ -15807,7 +16536,7 @@ function isPlanFileWrite(planPath, cwd) {
|
|
|
15807
16536
|
__name(isPlanFileWrite, "isPlanFileWrite");
|
|
15808
16537
|
async function readPlan(planPath) {
|
|
15809
16538
|
try {
|
|
15810
|
-
const text2 = await
|
|
16539
|
+
const text2 = await readFile9(planPath, "utf8");
|
|
15811
16540
|
return text2.trim().length > 0 ? text2 : void 0;
|
|
15812
16541
|
} catch {
|
|
15813
16542
|
return void 0;
|
|
@@ -15948,7 +16677,7 @@ function terminalProviderRetry(restartableOutput) {
|
|
|
15948
16677
|
__name(terminalProviderRetry, "terminalProviderRetry");
|
|
15949
16678
|
|
|
15950
16679
|
// src/reminders/index.ts
|
|
15951
|
-
import { existsSync as
|
|
16680
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
15952
16681
|
|
|
15953
16682
|
// src/reminders/changed-files.ts
|
|
15954
16683
|
import { open as open4, stat as stat5 } from "node:fs/promises";
|
|
@@ -16577,7 +17306,7 @@ function createCliReminderSource(options) {
|
|
|
16577
17306
|
messages,
|
|
16578
17307
|
mode: options.mode(),
|
|
16579
17308
|
planPath,
|
|
16580
|
-
planExists: (options.planExists ??
|
|
17309
|
+
planExists: (options.planExists ?? existsSync5)(planPath),
|
|
16581
17310
|
canAsk: options.canAsk === true
|
|
16582
17311
|
})
|
|
16583
17312
|
);
|
|
@@ -17486,11 +18215,11 @@ __name(clipRequestContext, "clipRequestContext");
|
|
|
17486
18215
|
async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
17487
18216
|
const modelEnvironment = readModelLaunchEnvironment();
|
|
17488
18217
|
if (options.palEnvironment) {
|
|
17489
|
-
const { createPalAgentSession } = await import("./agent-session-
|
|
18218
|
+
const { createPalAgentSession } = await import("./agent-session-ONKOQQ5Y.js");
|
|
17490
18219
|
return createPalAgentSession(prefs, detectedProviders, options);
|
|
17491
18220
|
}
|
|
17492
18221
|
let detected = detectedProviders;
|
|
17493
|
-
const { palAtWorkspace } = await import("./store-
|
|
18222
|
+
const { palAtWorkspace } = await import("./store-KC43NWR4.js");
|
|
17494
18223
|
if (palAtWorkspace(options.cwd ?? process.cwd()))
|
|
17495
18224
|
throw new Error("This Pal requires its owned virtual computer. Open it with namzu pal chat.");
|
|
17496
18225
|
const commandArguments = builtinCommandArguments();
|
|
@@ -17546,7 +18275,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
17546
18275
|
);
|
|
17547
18276
|
}
|
|
17548
18277
|
const sandboxWorkspace = options.sandbox?.workspace ?? "working-directory";
|
|
17549
|
-
if (options.sandbox?.enabled !== false && sandboxWorkspace === "working-directory" && cwd ===
|
|
18278
|
+
if (options.sandbox?.enabled !== false && sandboxWorkspace === "working-directory" && cwd === parse2(cwd).root) {
|
|
17550
18279
|
return emptySession(
|
|
17551
18280
|
"Namzu will not run in the top-level folder of the disk with the sandbox on. Choose a project folder, or use a temporary workspace.",
|
|
17552
18281
|
"invocation"
|
|
@@ -18520,7 +19249,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
18520
19249
|
runsDirectory: /* @__PURE__ */ __name((turnId) => {
|
|
18521
19250
|
if (options.ephemeral) return void 0;
|
|
18522
19251
|
const owner = delegationScopes.get(turnId) ?? scope2;
|
|
18523
|
-
return
|
|
19252
|
+
return join21(paths.sessionDir({ sessionId: owner.sessionId }), "runs");
|
|
18524
19253
|
}, "runsDirectory"),
|
|
18525
19254
|
refusal: /* @__PURE__ */ __name((turnId) => {
|
|
18526
19255
|
const auth = delegatedWorkflowAuth.get(turnId);
|
|
@@ -18756,7 +19485,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
18756
19485
|
);
|
|
18757
19486
|
toolsets.push(options.toolLoading === "eager" ? monitorToolset : deferred(monitorToolset));
|
|
18758
19487
|
}
|
|
18759
|
-
const operatorPals = await import("./operator-tools-
|
|
19488
|
+
const operatorPals = await import("./operator-tools-WF2UGZ5G.js");
|
|
18760
19489
|
toolsets.push(
|
|
18761
19490
|
readyWhen(
|
|
18762
19491
|
toolset(
|
|
@@ -18811,7 +19540,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
18811
19540
|
);
|
|
18812
19541
|
const curationListeners = /* @__PURE__ */ new Set();
|
|
18813
19542
|
const memoryInbox = new MemoryInbox({
|
|
18814
|
-
file:
|
|
19543
|
+
file: join21(paths.home, "memory-inbox", `${paths.slug}.jsonl`),
|
|
18815
19544
|
now: Date.now
|
|
18816
19545
|
});
|
|
18817
19546
|
const curation = options.memory?.curation === "off" || options.compaction?.consolidate ? void 0 : new CurationRuntime({
|
|
@@ -18820,7 +19549,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
18820
19549
|
store: memoryStore,
|
|
18821
19550
|
sideModel: /* @__PURE__ */ __name(() => sideModel, "sideModel"),
|
|
18822
19551
|
fallback: screenedPromoter,
|
|
18823
|
-
log: createCurationLog(
|
|
19552
|
+
log: createCurationLog(join21(paths.home, "memory", "curation.jsonl"))
|
|
18824
19553
|
}),
|
|
18825
19554
|
setTimer: /* @__PURE__ */ __name((run2, ms) => {
|
|
18826
19555
|
const handle = setTimeout(run2, ms);
|
|
@@ -18838,6 +19567,31 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
18838
19567
|
"namzu.memory.curation.result": typeof result === "string" ? result : `${result.applied}/${result.kept}/${result.dropped}`
|
|
18839
19568
|
}), "report")
|
|
18840
19569
|
});
|
|
19570
|
+
const memoryUsage = new MemoryUsage({
|
|
19571
|
+
file: join21(paths.home, "memory-usage", `${paths.slug}.json`),
|
|
19572
|
+
now: Date.now,
|
|
19573
|
+
log: /* @__PURE__ */ __name((message2, fields) => cliLogger().debug(message2, fields), "log")
|
|
19574
|
+
});
|
|
19575
|
+
const memoryLifecycle = new MemoryLifecycle({
|
|
19576
|
+
store: memoryStore,
|
|
19577
|
+
usage: memoryUsage,
|
|
19578
|
+
now: Date.now,
|
|
19579
|
+
retireAfterDays: options.memory?.retireAfterDays ?? DEFAULT_RETIRE_AFTER_DAYS,
|
|
19580
|
+
isDraining: /* @__PURE__ */ __name(() => curation?.draining === true, "isDraining"),
|
|
19581
|
+
setTimer: /* @__PURE__ */ __name((run2, ms) => {
|
|
19582
|
+
const handle = setTimeout(run2, ms);
|
|
19583
|
+
handle.unref?.();
|
|
19584
|
+
return handle;
|
|
19585
|
+
}, "setTimer"),
|
|
19586
|
+
clearTimer: /* @__PURE__ */ __name((handle) => clearTimeout(handle), "clearTimer"),
|
|
19587
|
+
log: /* @__PURE__ */ __name((message2, fields) => cliLogger().info(message2, fields), "log"),
|
|
19588
|
+
onSwept: /* @__PURE__ */ __name((report) => {
|
|
19589
|
+
const lines = [
|
|
19590
|
+
`Retired ${report.archived.length} ${report.archived.length === 1 ? "memory" : "memories"} that were not used. /memory restores ${report.archived.length === 1 ? "it" : "them"}.`
|
|
19591
|
+
];
|
|
19592
|
+
for (const listener of curationListeners) listener(lines);
|
|
19593
|
+
}, "onSwept")
|
|
19594
|
+
});
|
|
18841
19595
|
const promoteMemory = composeMemoryPromotion({
|
|
18842
19596
|
curation,
|
|
18843
19597
|
inbox: memoryInbox,
|
|
@@ -18967,12 +19721,14 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
18967
19721
|
[EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.BOOT_READY
|
|
18968
19722
|
});
|
|
18969
19723
|
curation?.start();
|
|
19724
|
+
void memoryLifecycle.start();
|
|
18970
19725
|
const reasoningLookup = new AbortController();
|
|
18971
19726
|
const ephemeralLogs = /* @__PURE__ */ new Map();
|
|
18972
19727
|
const ephemeralScopeKey = /* @__PURE__ */ __name((value) => JSON.stringify([value.tenantId, value.projectId, value.topicId, value.sessionId]), "ephemeralScopeKey");
|
|
18973
19728
|
const operations = new SessionOperationOwner(async () => {
|
|
18974
19729
|
reasoningLookup.abort();
|
|
18975
19730
|
await curation?.dispose();
|
|
19731
|
+
await memoryLifecycle.dispose();
|
|
18976
19732
|
workflowHost?.registry.close();
|
|
18977
19733
|
const results = await Promise.allSettled([
|
|
18978
19734
|
Promise.resolve().then(() => manager.dispose()),
|
|
@@ -19208,6 +19964,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19208
19964
|
delegationScopes.set(entry2.turnId, turnScope);
|
|
19209
19965
|
latestTurn = { sessionId: turnScope.sessionId, turnId: entry2.turnId };
|
|
19210
19966
|
curation?.turnStarted();
|
|
19967
|
+
memoryLifecycle.turnStarted();
|
|
19211
19968
|
delegationLimits.set(entry2.turnId, resumedLimits);
|
|
19212
19969
|
if (route && pinned)
|
|
19213
19970
|
delegationModels.set(entry2.turnId, {
|
|
@@ -19252,6 +20009,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19252
20009
|
store: memoryStore,
|
|
19253
20010
|
identifierGrounding: options.memory?.identifierGrounding,
|
|
19254
20011
|
record: true,
|
|
20012
|
+
excluded: memoryLifecycle.excluded,
|
|
19255
20013
|
...memorySelection
|
|
19256
20014
|
})
|
|
19257
20015
|
],
|
|
@@ -19454,6 +20212,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19454
20212
|
},
|
|
19455
20213
|
providerSummary: entry.id === "anthropic" ? withEndpointHost(entry.label) : entry.label,
|
|
19456
20214
|
modelSummary: model,
|
|
20215
|
+
providerId: entry.id,
|
|
19457
20216
|
get autoRoute() {
|
|
19458
20217
|
return lastAutoRoute;
|
|
19459
20218
|
},
|
|
@@ -19654,7 +20413,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19654
20413
|
const live = host.registry.list();
|
|
19655
20414
|
const known = new Set(live.map((view) => view.runId));
|
|
19656
20415
|
const saved = options.ephemeral ? [] : await listWorkflowRuns(
|
|
19657
|
-
|
|
20416
|
+
join21(paths.sessionDir({ sessionId: scope2.sessionId }), "runs")
|
|
19658
20417
|
).catch(() => []);
|
|
19659
20418
|
return [
|
|
19660
20419
|
...[...live].sort((a, b) => b.startedAt - a.startedAt),
|
|
@@ -19664,14 +20423,14 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19664
20423
|
readScript: /* @__PURE__ */ __name((path) => {
|
|
19665
20424
|
const saved = readSavedScript(
|
|
19666
20425
|
path,
|
|
19667
|
-
scriptsDirectory(
|
|
20426
|
+
scriptsDirectory(join21(paths.sessionDir({ sessionId: scope2.sessionId }), "runs"))
|
|
19668
20427
|
);
|
|
19669
20428
|
if (!saved.ok) return void 0;
|
|
19670
20429
|
reviewedScripts.record(saved.path, saved.text);
|
|
19671
20430
|
return saved.text;
|
|
19672
20431
|
}, "readScript"),
|
|
19673
20432
|
describeResume: /* @__PURE__ */ __name((runId, script) => describeResume(
|
|
19674
|
-
|
|
20433
|
+
join21(paths.sessionDir({ sessionId: scope2.sessionId }), "runs"),
|
|
19675
20434
|
runId,
|
|
19676
20435
|
script,
|
|
19677
20436
|
options.ephemeral ? void 0 : workflowJournalKey(paths.home)
|
|
@@ -19679,13 +20438,13 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19679
20438
|
recoverUnfinished: /* @__PURE__ */ __name(async () => {
|
|
19680
20439
|
if (options.ephemeral) return [];
|
|
19681
20440
|
return recoverUnfinishedWorkflows({
|
|
19682
|
-
runsDirectory:
|
|
20441
|
+
runsDirectory: join21(paths.sessionDir({ sessionId: scope2.sessionId }), "runs"),
|
|
19683
20442
|
liveRunIds: new Set(host.registry.list().map((view) => view.runId)),
|
|
19684
20443
|
...workflowJournalKey(paths.home) !== void 0 ? { key: workflowJournalKey(paths.home) } : {}
|
|
19685
20444
|
});
|
|
19686
20445
|
}, "recoverUnfinished"),
|
|
19687
20446
|
noticesDelivered: /* @__PURE__ */ __name((runIds) => markOrphanNoticesDelivered(
|
|
19688
|
-
|
|
20447
|
+
join21(paths.sessionDir({ sessionId: scope2.sessionId }), "runs"),
|
|
19689
20448
|
runIds
|
|
19690
20449
|
), "noticesDelivered"),
|
|
19691
20450
|
onEnd: /* @__PURE__ */ __name((listener) => {
|
|
@@ -19751,6 +20510,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19751
20510
|
delegationScopes.set(turnId, turnScope);
|
|
19752
20511
|
latestTurn = { sessionId: turnScope.sessionId, turnId };
|
|
19753
20512
|
curation?.turnStarted();
|
|
20513
|
+
memoryLifecycle.turnStarted();
|
|
19754
20514
|
delegationLimits.set(turnId, resolveTurnGuards(options.limits, opts?.limits));
|
|
19755
20515
|
delegatedResumeHandlers.set(turnId, control.handler);
|
|
19756
20516
|
delegatedReviewAllowedCalls.set(turnId, control.reviewAllowedCalls);
|
|
@@ -19942,7 +20702,15 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
19942
20702
|
})
|
|
19943
20703
|
}), "storedMemoryIndex"),
|
|
19944
20704
|
storedMemories: {
|
|
19945
|
-
load: /* @__PURE__ */ __name(() => loadManagedMemories(memoryStore, memoryDirectory
|
|
20705
|
+
load: /* @__PURE__ */ __name(() => loadManagedMemories(memoryStore, memoryDirectory, {
|
|
20706
|
+
usage: memoryUsage,
|
|
20707
|
+
retireAfterDays: options.memory?.retireAfterDays ?? DEFAULT_RETIRE_AFTER_DAYS
|
|
20708
|
+
}), "load"),
|
|
20709
|
+
restore: /* @__PURE__ */ __name((item) => restoreManagedMemory(memoryStore, item, (id) => memoryLifecycle.restore(id)), "restore"),
|
|
20710
|
+
tidy: /* @__PURE__ */ __name(async () => {
|
|
20711
|
+
const retireAfterDays = options.memory?.retireAfterDays ?? DEFAULT_RETIRE_AFTER_DAYS;
|
|
20712
|
+
return describeSweep(await memoryLifecycle.tidy(), retireAfterDays);
|
|
20713
|
+
}, "tidy"),
|
|
19946
20714
|
read: /* @__PURE__ */ __name((item) => readMemoryBody(memoryStore, item.id), "read"),
|
|
19947
20715
|
remove: /* @__PURE__ */ __name((item) => deleteManagedMemory(memoryStore, item), "remove"),
|
|
19948
20716
|
removeRecorded: /* @__PURE__ */ __name((items) => deleteRecordedMemories(memoryStore, items), "removeRecorded"),
|
|
@@ -20042,6 +20810,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
20042
20810
|
delegationScopes.set(turnId2, turnScope);
|
|
20043
20811
|
latestTurn = { sessionId: turnScope.sessionId, turnId: turnId2 };
|
|
20044
20812
|
curation?.turnStarted();
|
|
20813
|
+
memoryLifecycle.turnStarted();
|
|
20045
20814
|
delegationLimits.set(turnId2, turnLimits);
|
|
20046
20815
|
const typedTarget = parseTokenTarget(opts?.typedInput ?? "");
|
|
20047
20816
|
if (typedTarget !== void 0) workflowTokenTargets.set(turnId2, typedTarget);
|
|
@@ -20372,6 +21141,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
20372
21141
|
reviewAnswer: options.reviewAnswer,
|
|
20373
21142
|
maxAnswerReviews: options.maxAnswerReviews,
|
|
20374
21143
|
promoteMemory: options.compaction?.consolidate ? void 0 : promoteMemory,
|
|
21144
|
+
...options.memory?.recall === false ? {} : { memoryLifecycle },
|
|
20375
21145
|
prepareStep: [
|
|
20376
21146
|
createTaskContextStep(turnTaskStore, turnScope.tenantId),
|
|
20377
21147
|
outstandingWorkStep,
|
|
@@ -20383,6 +21153,7 @@ async function createAgentSession(prefs, detectedProviders, options = {}) {
|
|
|
20383
21153
|
query: lastPromptText(messages),
|
|
20384
21154
|
identifierGrounding: options.memory?.identifierGrounding,
|
|
20385
21155
|
record: true,
|
|
21156
|
+
excluded: memoryLifecycle.excluded,
|
|
20386
21157
|
...memorySelection
|
|
20387
21158
|
})
|
|
20388
21159
|
],
|
|
@@ -20985,6 +21756,7 @@ async function* runTurn({
|
|
|
20985
21756
|
reviewAnswer,
|
|
20986
21757
|
maxAnswerReviews,
|
|
20987
21758
|
promoteMemory,
|
|
21759
|
+
memoryLifecycle,
|
|
20988
21760
|
prepareStep,
|
|
20989
21761
|
resumeHandler,
|
|
20990
21762
|
approvalPolicyName,
|
|
@@ -21020,6 +21792,10 @@ async function* runTurn({
|
|
|
21020
21792
|
const events = query({
|
|
21021
21793
|
maxOutputContinuations: MAX_OUTPUT_CONTINUATIONS,
|
|
21022
21794
|
...opts?.refusalFallback ? { refusalFallback: opts.refusalFallback } : {},
|
|
21795
|
+
...memoryLifecycle ? {
|
|
21796
|
+
withholdOnRefusal: memoryLifecycle.withholdOnRefusal,
|
|
21797
|
+
withheldKeys: memoryLifecycle.withheldKeys()
|
|
21798
|
+
} : {},
|
|
21023
21799
|
...retainedToolPreviewChars !== void 0 ? { retainedToolPreviewChars } : {},
|
|
21024
21800
|
...fileReadTracker ? { fileReadTracker } : {},
|
|
21025
21801
|
...structuredOutput ? { structuredOutput } : {},
|
|
@@ -21073,6 +21849,7 @@ async function* runTurn({
|
|
|
21073
21849
|
model,
|
|
21074
21850
|
...sandboxProvider ? { sandbox: { workspace: sandboxWorkspace } } : {},
|
|
21075
21851
|
...opts?.effort !== void 0 ? { effort: opts.effort } : {},
|
|
21852
|
+
...opts?.speed === "fast" ? { speed: opts.speed } : {},
|
|
21076
21853
|
...webSearch ? { webSearch } : {},
|
|
21077
21854
|
...turnConfigFields(resolveTurnGuards(limits), { completionAudit: true }),
|
|
21078
21855
|
maxResponseTokens: limits?.maxResponseTokens ?? 8192,
|
|
@@ -21136,6 +21913,7 @@ async function* runTurn({
|
|
|
21136
21913
|
claimTurn(event.turnId);
|
|
21137
21914
|
}
|
|
21138
21915
|
onSessionEvent?.(event);
|
|
21916
|
+
memoryLifecycle?.observe(event);
|
|
21139
21917
|
if (signal?.aborted) {
|
|
21140
21918
|
if (!abortReported) {
|
|
21141
21919
|
abortReported = true;
|
|
@@ -21487,6 +22265,7 @@ function toAgentEvent(event, presenter, readsOnly, cwd) {
|
|
|
21487
22265
|
totalTokens: event.usage.totalTokens,
|
|
21488
22266
|
outputTokens: event.usage.completionTokens,
|
|
21489
22267
|
...event.cache ? { cache: event.cache } : {},
|
|
22268
|
+
...event.cacheMiss ? { cacheMiss: event.cacheMiss } : {},
|
|
21490
22269
|
...event.budget ? { budget: event.budget } : {},
|
|
21491
22270
|
cost: event.cost,
|
|
21492
22271
|
...event.contextTokens !== void 0 ? { contextTokens: event.contextTokens } : {},
|
|
@@ -21536,15 +22315,15 @@ function toAgentEvent(event, presenter, readsOnly, cwd) {
|
|
|
21536
22315
|
};
|
|
21537
22316
|
case "message_history_repaired": {
|
|
21538
22317
|
if (event.source === "provider-rejected-image") {
|
|
21539
|
-
const
|
|
22318
|
+
const count2 = event.providerRejectedImagesSuppressed ?? 0;
|
|
21540
22319
|
return {
|
|
21541
22320
|
kind: "history-repair",
|
|
21542
22321
|
source: event.source,
|
|
21543
22322
|
duplicateResults: event.duplicateToolResultsRemoved,
|
|
21544
22323
|
orphanedResults: event.orphanedToolResultsRemoved,
|
|
21545
22324
|
interruptedCalls: event.syntheticToolResultsInserted,
|
|
21546
|
-
rejectedImages:
|
|
21547
|
-
text: `The provider rejected ${
|
|
22325
|
+
rejectedImages: count2,
|
|
22326
|
+
text: `The provider rejected ${count2} image occurrence${count2 === 1 ? "" : "s"}. The original attachment bytes were kept, but that image will be omitted from later model requests; attach a corrected copy to try again.`
|
|
21548
22327
|
};
|
|
21549
22328
|
}
|
|
21550
22329
|
const changes = [
|
|
@@ -21923,6 +22702,7 @@ export {
|
|
|
21923
22702
|
renderRestoreNote,
|
|
21924
22703
|
PluginSettingsStore,
|
|
21925
22704
|
validateComposerSendSettings,
|
|
22705
|
+
DecisionError,
|
|
21926
22706
|
maybeCreateDecisionTool,
|
|
21927
22707
|
maybeCreateDecisionModel,
|
|
21928
22708
|
resolveAutoDefault,
|
|
@@ -21975,6 +22755,7 @@ export {
|
|
|
21975
22755
|
PROGRESS_LOOK_MIN_GAP_MS,
|
|
21976
22756
|
PHASE_NOTE_KEY_PREFIX,
|
|
21977
22757
|
describePendingWorkflowNotices,
|
|
22758
|
+
thirdPartyHost,
|
|
21978
22759
|
sessionLogCheckpointView,
|
|
21979
22760
|
discoverAgentDefinitions2 as discoverAgentDefinitions,
|
|
21980
22761
|
DEFAULT_AGENT_WORKFLOW,
|
|
@@ -21999,6 +22780,7 @@ export {
|
|
|
21999
22780
|
matchMemories,
|
|
22000
22781
|
listMatches,
|
|
22001
22782
|
renderMemoryDetail,
|
|
22783
|
+
restoreOutcomeLine,
|
|
22002
22784
|
RECALLED_MEMORY_KEY,
|
|
22003
22785
|
historyHoldsAnyMemory,
|
|
22004
22786
|
deleteOutcomeLine,
|
|
@@ -22048,4 +22830,4 @@ export {
|
|
|
22048
22830
|
RESULT_SUMMARY_WHOLE_MAX,
|
|
22049
22831
|
resultSummaryLine
|
|
22050
22832
|
};
|
|
22051
|
-
//# sourceMappingURL=chunk-
|
|
22833
|
+
//# sourceMappingURL=chunk-6MEYPHDQ.js.map
|