gerege-cli 0.26.7 → 0.26.8
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/bundled/gerege-video/SKILL.md +22 -0
- package/bundled/gerege-video/scripts/video.js +137 -0
- package/chunks/{MaxSizedBox-LSNOJEKM.js → MaxSizedBox-LUINLOQW.js} +1 -1
- package/chunks/{StandaloneSessionPicker-KSYGPMEV.js → StandaloneSessionPicker-B7N4QO5D.js} +1 -1
- package/chunks/{acp-subagent-executor-NSW2MFUI.js → acp-subagent-executor-J6H6FKUT.js} +1 -1
- package/chunks/{acpAgent-3DTOHTDM.js → acpAgent-XG6SM2VU.js} +3 -3
- package/chunks/{advisor-7JGQPS7X.js → advisor-SZVPQNPA.js} +1 -1
- package/chunks/{agent-PNKQJGDO.js → agent-N7QF7BJS.js} +1 -1
- package/chunks/{agent-headless-7D33X7QQ.js → agent-headless-GLP5GUEX.js} +1 -1
- package/chunks/{agent-host-client-3R2MAUVE.js → agent-host-client-H4VOB3M6.js} +1 -1
- package/chunks/{agent-host-connections-2D7DECAE.js → agent-host-connections-E4C3OC4M.js} +1 -1
- package/chunks/{anthropicContentGenerator-MGTJJGEQ.js → anthropicContentGenerator-5VTWQLT5.js} +1 -1
- package/chunks/{autofix-pr-OIHHZSPQ.js → autofix-pr-HDYQDJS4.js} +1 -1
- package/chunks/{batch-6UDAMPAA.js → batch-3CRVN5VJ.js} +1 -1
- package/chunks/{bridge-QXVXPNJ6.js → bridge-NZ6WVBLQ.js} +1 -1
- package/chunks/{channel-settings-store-P4W4R5SJ.js → channel-settings-store-Z7I2JI6M.js} +1 -1
- package/chunks/{chunk-HVP4UF2Q.js → chunk-236DHGNH.js} +1 -1
- package/chunks/{chunk-GA35LMSX.js → chunk-2M3ND5WN.js} +1 -1
- package/chunks/{chunk-IZXHCHJD.js → chunk-36A6EXHB.js} +1 -1
- package/chunks/{chunk-QHYSRPQR.js → chunk-3ANIQTDT.js} +1 -1
- package/chunks/{chunk-WK666FGZ.js → chunk-3QTR2HAE.js} +3 -3
- package/chunks/{chunk-3EZ5GCUT.js → chunk-3TTHYXT3.js} +1 -1
- package/chunks/{chunk-YWK3E4WJ.js → chunk-4CE4GMDL.js} +1 -1
- package/chunks/{chunk-VUNHJ74J.js → chunk-4FVT657Y.js} +1 -1
- package/chunks/{chunk-BY46PCWY.js → chunk-4HSISRRA.js} +1 -1
- package/chunks/{chunk-2LMSDH6P.js → chunk-4SZUJ5RT.js} +1 -1
- package/chunks/{chunk-53IB4U4E.js → chunk-57D2OB3I.js} +1 -1
- package/chunks/{chunk-QTKPC24L.js → chunk-5FGBLIXB.js} +1 -1
- package/chunks/{chunk-5TWAP4OG.js → chunk-5HX2QGVR.js} +1 -1
- package/chunks/{chunk-K7GN4CMV.js → chunk-5ZNXAWOG.js} +6 -6
- package/chunks/{chunk-QTVSPQZQ.js → chunk-6CKX56LJ.js} +1 -1
- package/chunks/{chunk-4W27Z3OL.js → chunk-6NIQFWXP.js} +1 -1
- package/chunks/{chunk-6YFNUVJR.js → chunk-6PC6MZHL.js} +1 -1
- package/chunks/{chunk-DQQN2HOP.js → chunk-6VQKGKMJ.js} +1 -1
- package/chunks/{chunk-MXZXQUVP.js → chunk-6ZEMLEK2.js} +1 -1
- package/chunks/{chunk-RT6J7PV4.js → chunk-72VY2PJA.js} +1 -1
- package/chunks/{chunk-EEPNACXJ.js → chunk-75I3NYBD.js} +1 -1
- package/chunks/{chunk-ATTJQLQV.js → chunk-76L7ZDEK.js} +1 -1
- package/chunks/{chunk-T3CQ72HC.js → chunk-7XQ5D34E.js} +6 -6
- package/chunks/{chunk-4AKTP4MM.js → chunk-AYX75VXG.js} +1 -1
- package/chunks/{chunk-MDCA4I63.js → chunk-BBDFEMCF.js} +1 -1
- package/chunks/{chunk-N4ZQC5HB.js → chunk-BOTX7S66.js} +1 -1
- package/chunks/{chunk-UVMLWDRU.js → chunk-CY2QKKZA.js} +1 -1
- package/chunks/{chunk-W2CV36HT.js → chunk-D5JWQUID.js} +1 -1
- package/chunks/{chunk-WEPC42YR.js → chunk-DMIPB7RZ.js} +1 -1
- package/chunks/{chunk-BVV7UXES.js → chunk-DSKA3P2C.js} +1 -1
- package/chunks/{chunk-SAVYMUU3.js → chunk-DVC65H4X.js} +1 -1
- package/chunks/{chunk-MS2XCBPP.js → chunk-DVJSDCMX.js} +1 -1
- package/chunks/{chunk-4QOVM2LL.js → chunk-E6CPFQX2.js} +1 -1
- package/chunks/{chunk-LYFRGP42.js → chunk-EIFBGEXJ.js} +1 -1
- package/chunks/{chunk-3ICJI5KW.js → chunk-EQOHDAYU.js} +1 -1
- package/chunks/{chunk-Q5RRVBTY.js → chunk-EZPM4DLR.js} +1 -1
- package/chunks/{chunk-ISQMHOCC.js → chunk-F6U6T7QD.js} +1 -1
- package/chunks/{chunk-WCI33URB.js → chunk-FCGFBUHS.js} +1 -1
- package/chunks/{chunk-CK3OKTTL.js → chunk-G2LTZU67.js} +1 -1
- package/chunks/{chunk-WSI4G7XC.js → chunk-GMJSEK4V.js} +1 -1
- package/chunks/{chunk-QONPET6Y.js → chunk-HJMUBVXZ.js} +2 -2
- package/chunks/{chunk-H5EXNXGW.js → chunk-HQZTAA2U.js} +1 -1
- package/chunks/{chunk-5R2JIZID.js → chunk-I63TIQOI.js} +1 -1
- package/chunks/{chunk-IY7M5HKF.js → chunk-I65LBJN7.js} +1 -1
- package/chunks/{chunk-H34KVVI4.js → chunk-IBDOC27R.js} +1 -1
- package/chunks/{chunk-N6EFYQ7M.js → chunk-IKF2HWEV.js} +1 -1
- package/chunks/{chunk-CDKBM72V.js → chunk-K6NS2HXT.js} +1 -1
- package/chunks/{chunk-BIPPD7W6.js → chunk-KTRNYPQP.js} +1 -1
- package/chunks/{chunk-DTX2OVQW.js → chunk-L3ANU5JZ.js} +1 -1
- package/chunks/{chunk-WXK7Z45R.js → chunk-LKPMADUO.js} +1 -1
- package/chunks/{chunk-4VR4DUUD.js → chunk-M56Y2B6N.js} +1 -1
- package/chunks/{chunk-YY4GWNTU.js → chunk-N5KRBAK5.js} +2 -2
- package/chunks/{chunk-DVUKYOCJ.js → chunk-NA2WJPOU.js} +1 -1
- package/chunks/{chunk-O3TUZQP4.js → chunk-NGOWLXYK.js} +1 -1
- package/chunks/{chunk-F7622ZRQ.js → chunk-NL7P73ZP.js} +1 -1
- package/chunks/{chunk-U5YOAOU3.js → chunk-NS3QR7D3.js} +1 -1
- package/chunks/{chunk-FTF2NFLB.js → chunk-O5JCCBMQ.js} +1 -1
- package/chunks/{chunk-DEJ47KJE.js → chunk-OOKFFZHF.js} +1 -1
- package/chunks/{chunk-4A663FE6.js → chunk-OTYPLLMT.js} +5 -5
- package/chunks/{chunk-NPAENNRO.js → chunk-P7NHWX27.js} +1 -1
- package/chunks/{chunk-HXTYFGSQ.js → chunk-PC5QZUKR.js} +1 -1
- package/chunks/{chunk-RULGA7WE.js → chunk-PS7MQL57.js} +2 -2
- package/chunks/{chunk-FKUDVIME.js → chunk-PXWHOFAA.js} +1 -1
- package/chunks/{chunk-6WV5RKYB.js → chunk-Q65LVCDR.js} +1 -1
- package/chunks/{chunk-ULLW2AYD.js → chunk-QDUDLELH.js} +1 -1
- package/chunks/{chunk-PMBI46K4.js → chunk-QF22ILPV.js} +1 -1
- package/chunks/{chunk-LY4XTBL4.js → chunk-QW7MAG2E.js} +1 -1
- package/chunks/{chunk-IIHUDJX7.js → chunk-RXK6XD6F.js} +1 -1
- package/chunks/{chunk-QSPXKBUX.js → chunk-SVDFCWS7.js} +1 -1
- package/chunks/{chunk-NHPKD7LY.js → chunk-TKP3GAUI.js} +1 -1
- package/chunks/{chunk-WF7Q3ZSQ.js → chunk-TUS74LFI.js} +1 -1
- package/chunks/{chunk-OZFZBGZG.js → chunk-U7YGHPSL.js} +1 -1
- package/chunks/{chunk-G4MWPXNY.js → chunk-UB37RBSK.js} +1 -1
- package/chunks/{chunk-4LC4INFI.js → chunk-UK5SIRH4.js} +1 -1
- package/chunks/{chunk-7HFFTOAD.js → chunk-UTTSBCFR.js} +1 -1
- package/chunks/{chunk-IQMKQKKD.js → chunk-UYV4ZVXY.js} +2 -2
- package/chunks/{chunk-E3KWSRJN.js → chunk-VC3JJL7E.js} +1 -1
- package/chunks/{chunk-FRVXSKL4.js → chunk-VKWVIWLK.js} +1 -1
- package/chunks/{chunk-L7LO3YRT.js → chunk-VUI6STKU.js} +1 -1
- package/chunks/{chunk-VK7LOUOJ.js → chunk-W3YXE55M.js} +1 -1
- package/chunks/{chunk-JHC22BZH.js → chunk-WAIPC47V.js} +1 -1
- package/chunks/{chunk-P2MZZMCS.js → chunk-WMJ6UHDP.js} +1 -1
- package/chunks/{chunk-6JAXAFX7.js → chunk-WZU2ECUD.js} +1 -1
- package/chunks/{chunk-HJLRKM3W.js → chunk-XAGIZY2Y.js} +1 -1
- package/chunks/{chunk-2J2BQ3PL.js → chunk-XGZYVULJ.js} +2 -2
- package/chunks/{chunk-QVHDM6N7.js → chunk-XJIHDVPX.js} +1 -1
- package/chunks/{chunk-ZFOEVHWG.js → chunk-XVDIHFRH.js} +1 -1
- package/chunks/{chunk-F5SLLEJY.js → chunk-YMEW4TTT.js} +1 -1
- package/chunks/{chunk-NYBYDW6R.js → chunk-Z32URWBG.js} +1 -1
- package/chunks/{chunk-WMLYHZZX.js → chunk-Z6HRXHJP.js} +1 -1
- package/chunks/{chunk-UM5KBBYP.js → chunk-ZO4F6ZWR.js} +1 -1
- package/chunks/{codex-subagent-executor-GPTKVP7H.js → codex-subagent-executor-DDKYNU42.js} +1 -1
- package/chunks/{config-utils-6B5FHBSF.js → config-utils-S7Z2ZZ2E.js} +1 -1
- package/chunks/{contextCommand-FGRDE3GA.js → contextCommand-7F4PGV2A.js} +1 -1
- package/chunks/{core-runtime-OFEHSKDB.js → core-runtime-LBH3U7ZF.js} +1 -1
- package/chunks/{create-sub-session-D2KEWVHQ.js → create-sub-session-56DS2T6L.js} +1 -1
- package/chunks/{cron-create-RFGGKTL7.js → cron-create-PBP3C46Q.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-AV752IOZ.js → daemon-git-worktree-guard-WJS6FBDA.js} +1 -1
- package/chunks/{daemon-status-provider-GHQBRDMC.js → daemon-status-provider-UPPAEHJ6.js} +1 -1
- package/chunks/{daemon-trust-policy-24ENJNTQ.js → daemon-trust-policy-4Z5HSNUX.js} +1 -1
- package/chunks/{daemon-trust-policy-monitor-NMSQAGWV.js → daemon-trust-policy-monitor-WFWDOYX3.js} +1 -1
- package/chunks/{deferred-core-runtime-5BAMFFOI.js → deferred-core-runtime-MJYNEA4N.js} +1 -1
- package/chunks/{edit-XCECLEH3.js → edit-U7TGKKK3.js} +1 -1
- package/chunks/{enterPlanMode-SEN2PMRM.js → enterPlanMode-27HC5AXN.js} +1 -1
- package/chunks/{environment-CCPQJYKS.js → environment-PHWY6C4P.js} +1 -1
- package/chunks/{errors-Y6HHUTGK.js → errors-F2EYYFI3.js} +1 -1
- package/chunks/{execution-tool-HADWGMIG.js → execution-tool-O4KJ5SMM.js} +1 -1
- package/chunks/{execution-worker-GZS7WOQL.js → execution-worker-AMFXZ7JD.js} +1 -1
- package/chunks/{exitPlanMode-76B5HDLT.js → exitPlanMode-LDYL43PB.js} +1 -1
- package/chunks/{fast-path-OEV7LQYV.js → fast-path-HTODEVOR.js} +1 -1
- package/chunks/{glob-NLWCQRMS.js → glob-NKQJJZND.js} +1 -1
- package/chunks/{goal-tools-43XV33BT.js → goal-tools-47I455VV.js} +1 -1
- package/chunks/{handleAutoUpdate-JDQWGSSP.js → handleAutoUpdate-MJKTDJUO.js} +1 -1
- package/chunks/{i18n-JW6BVEGF.js → i18n-TCOB4TC5.js} +1 -1
- package/chunks/{initializer-UT6JLZ3O.js → initializer-NLYOGZZS.js} +1 -1
- package/chunks/{installationInfo-LKWDV3S2.js → installationInfo-TF2RSJOG.js} +1 -1
- package/chunks/{interactive-mod-session-2KWKYVPC.js → interactive-mod-session-5F7R3KSA.js} +1 -1
- package/chunks/{list-BKINK3S2.js → list-U2AEVLFP.js} +1 -1
- package/chunks/{llm-3RWXAVM2.js → llm-EV2QTQBU.js} +4 -4
- package/chunks/{llm-content-generator-MDRBSH73.js → llm-content-generator-ZXUSPPG2.js} +1 -1
- package/chunks/{loadedSettingsAdapter-WWJUKWUN.js → loadedSettingsAdapter-TLRI22X7.js} +1 -1
- package/chunks/{local-TT4FLCTR.js → local-ZTSBSKWV.js} +1 -1
- package/chunks/{local-execution-environment-OBA6VWYL.js → local-execution-environment-F263PSIM.js} +1 -1
- package/chunks/{loggingContentGenerator-CK7IKYQH.js → loggingContentGenerator-2XHSIJQD.js} +1 -1
- package/chunks/{loop-wakeup-4MSRX3DY.js → loop-wakeup-5ET3JHUT.js} +1 -1
- package/chunks/{manage-memory-PX5PZJKZ.js → manage-memory-MJEQ47H2.js} +1 -1
- package/chunks/{managed-execution-engine-WMAUR3ZK.js → managed-execution-engine-ODPR5OEH.js} +1 -1
- package/chunks/{managed-local-serve-X7REHGB4.js → managed-local-serve-S5R4Z5OL.js} +1 -1
- package/chunks/managed-npm-update-BUI5APGY.js +8 -0
- package/chunks/{managed-runtime-attestation-worker-F4AT53M5.js → managed-runtime-attestation-worker-BQP4E7LQ.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-3BP5JRJX.js → managed-runtime-bootstrap-SRBDFSKK.js} +1 -1
- package/chunks/{managed-runtime-session-worker-2PO7J5UK.js → managed-runtime-session-worker-UI23BTYJ.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-4N7EMRSV.js → managed-runtime-ssh-worker-HU4CIJRK.js} +1 -1
- package/chunks/{managed-session-authority-MYOYTUM2.js → managed-session-authority-XSSTLAEY.js} +1 -1
- package/chunks/{mcp-5OTEMZ7P.js → mcp-WLHDOKP7.js} +1 -1
- package/chunks/{memory-TNW7RSAV.js → memory-OUUHPSDD.js} +1 -1
- package/chunks/{model-call-collection-KNTWFZQS.js → model-call-collection-4A2EB76B.js} +1 -1
- package/chunks/{model-configuration-U5C5P5UQ.js → model-configuration-4CGUFKEP.js} +1 -1
- package/chunks/{modelConfigUtils-R4KFI2WK.js → modelConfigUtils-HUEERWBA.js} +1 -1
- package/chunks/{monitor-RD2PFK42.js → monitor-FXL5UNMP.js} +1 -1
- package/chunks/{nonInteractiveCli-QQ72HZSH.js → nonInteractiveCli-W7M2O43W.js} +1 -1
- package/chunks/{nonInteractiveToolExecutor-QPQYR6IS.js → nonInteractiveToolExecutor-EMLI363Q.js} +1 -1
- package/chunks/{notebook-edit-YLRN3UZT.js → notebook-edit-R5RSLSSH.js} +1 -1
- package/chunks/{omni-CUJ52EW5.js → omni-DNZGITTE.js} +1 -1
- package/chunks/{openaiContentGenerator-6B5MAU54.js → openaiContentGenerator-PKOPYMHR.js} +1 -1
- package/chunks/{openaiResponsesContentGenerator-I245I3R7.js → openaiResponsesContentGenerator-MHH2MF3V.js} +1 -1
- package/chunks/{pidfile-P2HIGAUA.js → pidfile-5ZNJWMKG.js} +1 -1
- package/chunks/{processUtils-JSKN5UGS.js → processUtils-JIHQDASW.js} +1 -1
- package/chunks/{prompt-terminal-ledger-F5TSXVGU.js → prompt-terminal-ledger-L3LZ5SLR.js} +1 -1
- package/chunks/{qwenContentGenerator-IEDZONWG.js → qwenContentGenerator-QCZL7HJJ.js} +1 -1
- package/chunks/{reactive-degrade-FYZBJCF6.js → reactive-degrade-YUXOUQG4.js} +1 -1
- package/chunks/{read-file-VNZNSD6X.js → read-file-FBNU3AVX.js} +1 -1
- package/chunks/{resumeHistoryUtils-IDPE6N2N.js → resumeHistoryUtils-5FPRTI4A.js} +1 -1
- package/chunks/{review-TBJRZWTD.js → review-NLFYSNM3.js} +1 -1
- package/chunks/{ripGrep-4W5B5FOE.js → ripGrep-JUAPC5LD.js} +1 -1
- package/chunks/{run-qwen-serve-44X262G5.js → run-qwen-serve-JP64UQ3Y.js} +1 -1
- package/chunks/{runtime-6H6LKD73.js → runtime-D2QUYM6U.js} +1 -1
- package/chunks/{sandboxConfig-SQXDRGVN.js → sandboxConfig-7VZJQV6H.js} +1 -1
- package/chunks/{scheduled-tasks-62IZKHJG.js → scheduled-tasks-PC6EH75E.js} +1 -1
- package/chunks/{scheduler-QUCXJYRL.js → scheduler-RUV2FNDR.js} +1 -1
- package/chunks/{search-memory-TC2Z34QN.js → search-memory-YJTJ7BRU.js} +1 -1
- package/chunks/{send-message-TFZX7KI7.js → send-message-EEEFFTHX.js} +1 -1
- package/chunks/{serve-WSICDFGG.js → serve-KMIZDYON.js} +1 -1
- package/chunks/{server-GYYVTNGY.js → server-DUPK3V7B.js} +3 -3
- package/chunks/{session-KF3O23ZJ.js → session-CW5YMFMP.js} +1 -1
- package/chunks/{session-attachments-root-7HFUSONH.js → session-attachments-root-5H5GFHLI.js} +1 -1
- package/chunks/{session-execution-engine-selector-NVILT6BR.js → session-execution-engine-selector-MVXM2HZW.js} +1 -1
- package/chunks/{session-pr-refresh-3KDFTDEV.js → session-pr-refresh-4UPONX4L.js} +1 -1
- package/chunks/{sessionService-XRTFLPDW.js → sessionService-GGCYISSL.js} +1 -1
- package/chunks/{settings-QPPK6WXE.js → settings-AASJCESS.js} +1 -1
- package/chunks/{shell-WYQDZWL7.js → shell-V4WWLW3Q.js} +1 -1
- package/chunks/{skill-FYPT6AU7.js → skill-NDEBB7VX.js} +1 -1
- package/chunks/{skill-settings-OGFI5KZF.js → skill-settings-YAI3GYU5.js} +1 -1
- package/chunks/{spawnChannel-ANOOVPG7.js → spawnChannel-6JKVJAXZ.js} +1 -1
- package/chunks/{standalone-update-45WTDY4E.js → standalone-update-NJP5OCKJ.js} +1 -1
- package/chunks/{start-opentui-ui-TL5WK33V.js → start-opentui-ui-M4B4SXRM.js} +1 -1
- package/chunks/{startInteractiveUI-N2IREVBM.js → startInteractiveUI-O4JUDEAU.js} +1 -1
- package/chunks/{team-create-R77PRZ5U.js → team-create-NLJ7QBLD.js} +1 -1
- package/chunks/{team-plan-approval-6DCRKB5I.js → team-plan-approval-XKYPVWNG.js} +1 -1
- package/chunks/{terminal-image-renderer-TB7EX2WW.js → terminal-image-renderer-47TD747D.js} +1 -1
- package/chunks/{theme-manager-RQDXJGVR.js → theme-manager-AANEBPLJ.js} +1 -1
- package/chunks/{tool-call-LVB4NCDT.js → tool-call-ETH3LS7Y.js} +1 -1
- package/chunks/{tool-result-media-LRBB2KS6.js → tool-result-media-EFOEPAF2.js} +1 -1
- package/chunks/{tool-search-OG73QAQZ.js → tool-search-J3CF5PRN.js} +1 -1
- package/chunks/{total-session-admission-A4CUF6AD.js → total-session-admission-3DC52PLQ.js} +1 -1
- package/chunks/{trustedFolders-LSGOYTU2.js → trustedFolders-4KPWZZKB.js} +1 -1
- package/chunks/{update-relaunch-OGC6BZO7.js → update-relaunch-A67BS7QS.js} +1 -1
- package/chunks/{updateCheck-7J3GXTER.js → updateCheck-X623JRSY.js} +1 -1
- package/chunks/{upload-config-ML5XEJIF.js → upload-config-X2CR3F26.js} +1 -1
- package/chunks/{useAutoAcceptIndicator-6DH6GQ2X.js → useAutoAcceptIndicator-INIOQGJH.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-KJDAGZCM.js → validateNonInterActiveAuth-XJ2U5CLB.js} +1 -1
- package/chunks/{version-7JN2YXL2.js → version-MFHRMM7W.js} +1 -1
- package/chunks/{web-fetch-42ZR4FEZ.js → web-fetch-3GEJ62DH.js} +1 -1
- package/chunks/{web-search-74NLPMZJ.js → web-search-WJZO3Q3A.js} +1 -1
- package/chunks/{workflow-WNPHX42I.js → workflow-ML7ITCMH.js} +1 -1
- package/chunks/{workflow-ancestor-trust-HGF6G7LQ.js → workflow-ancestor-trust-M3VFMS73.js} +1 -1
- package/chunks/{workspace-agents-3YFBFAK3.js → workspace-agents-YFZMV7EF.js} +1 -1
- package/chunks/{workspace-providers-status-EPJI6KRV.js → workspace-providers-status-3COKLBCI.js} +1 -1
- package/chunks/{workspace-recovery-worker-T3FK5YOD.js → workspace-recovery-worker-QURA3WFZ.js} +1 -1
- package/chunks/{workspace-registration-store-VEXYBDMA.js → workspace-registration-store-F3AGIOBW.js} +1 -1
- package/chunks/{workspace-registry-NRZYTP2X.js → workspace-registry-QUBL3RW6.js} +1 -1
- package/chunks/{workspace-runtime-coordinator-USNSTP2V.js → workspace-runtime-coordinator-22TSDHXX.js} +1 -1
- package/chunks/{workspace-service-USATWO56.js → workspace-service-UUENTHNO.js} +1 -1
- package/chunks/{workspace-skills-status-M5JTSFDL.js → workspace-skills-status-NNQQBBCJ.js} +1 -1
- package/chunks/{workspace-trust-reconciler-ZUZ2O5WC.js → workspace-trust-reconciler-3CMMNCGG.js} +1 -1
- package/chunks/{write-file-UMJVKE4S.js → write-file-DEAFIK4C.js} +1 -1
- package/chunks/{zoom-image-76XYHQ3Z.js → zoom-image-YYO22PQG.js} +1 -1
- package/cli-entry.js +2 -3
- package/cli.js +2 -2
- package/execution-worker.js +1 -1
- package/export-transcript-document.js +1 -1
- package/package.json +2 -12
- package/chunks/managed-npm-update-6HUVAJH7.js +0 -8
- package/opentui-assets/@opentui/core/assets/javascript/highlights.scm +0 -205
- package/opentui-assets/@opentui/core/assets/javascript/tree-sitter-javascript.wasm +0 -0
- package/opentui-assets/@opentui/core/assets/markdown/highlights.scm +0 -150
- package/opentui-assets/@opentui/core/assets/markdown/injections.scm +0 -27
- package/opentui-assets/@opentui/core/assets/markdown/tree-sitter-markdown.wasm +0 -0
- package/opentui-assets/@opentui/core/assets/markdown_inline/highlights.scm +0 -115
- package/opentui-assets/@opentui/core/assets/markdown_inline/tree-sitter-markdown_inline.wasm +0 -0
- package/opentui-assets/@opentui/core/assets/typescript/highlights.scm +0 -604
- package/opentui-assets/@opentui/core/assets/typescript/tree-sitter-typescript.wasm +0 -0
- package/opentui-assets/@opentui/core/assets/zig/highlights.scm +0 -284
- package/opentui-assets/@opentui/core/assets/zig/tree-sitter-zig.wasm +0 -0
- package/opentui-assets/@opentui/core/parser.worker.js +0 -4566
- package/opentui-assets/@opentui/core-darwin-arm64/libopentui.dylib +0 -0
- package/opentui-assets/@opentui/core-darwin-x64/libopentui.dylib +0 -0
- package/opentui-assets/@opentui/core-linux-arm64/libopentui.so +0 -0
- package/opentui-assets/@opentui/core-linux-x64/libopentui.so +0 -0
- package/opentui-assets/web-tree-sitter/tree-sitter.wasm +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{performStandaloneUpdate}from"./chunk-
|
|
3
|
+
import{performStandaloneUpdate}from"./chunk-DMIPB7RZ.js";import{updateEventEmitter}from"./chunk-VDUNIK4I.js";import{require_semver}from"./chunk-YZUKMJW7.js";import{getHomebrewLatestVersion,getInstallationInfo,getNpmNodePath,resolveUpdateCommand}from"./chunk-26MNTKT2.js";import{t}from"./chunk-NO7VTKRL.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();var import_semver=__toESM(require_semver(),1);init_esbuild_shims();import{spawn}from"node:child_process";var spawnWrapper=spawn;import os from"node:os";var debugLogger=createDebugLogger("AUTO_UPDATE");var UPDATE_SUCCESS_MESSAGE="Update successful! The new version will be used on your next run.";var UPDATE_FAILED_MESSAGE="Automatic update failed. Please try updating manually.";async function handleAutoUpdate(info,settings,projectRoot,spawnFn=spawnWrapper){if(!info){return}const isAutoUpdateEnabled=settings.merged.general?.enableAutoUpdate!==false;const installationInfo=getInstallationInfo(projectRoot,isAutoUpdateEnabled);if(installationInfo.packageManager==="homebrew"){const installedVersion=import_semver.default.coerce(info.update.current)?.version;const brewLatestVersion=import_semver.default.coerce(await getHomebrewLatestVersion()??void 0)?.version;if(installedVersion&&brewLatestVersion&&!import_semver.default.gt(brewLatestVersion,installedVersion)){return}}let combinedMessage=info.message;if(installationInfo.updateMessage){combinedMessage+=`
|
|
4
4
|
${t(installationInfo.updateMessage)}`}updateEventEmitter.emit("update-received",{message:combinedMessage});if(installationInfo.isStandalone&&installationInfo.standaloneDir&&isAutoUpdateEnabled){performStandaloneUpdate(installationInfo.standaloneDir,info.update.latest).then(result=>{const message=result==="deferred"?t("Update downloaded. It will be applied after you exit this session."):t("Update successful! The new version will be used on your next run.");updateEventEmitter.emit("update-success",{message})}).catch(err=>{updateEventEmitter.emit("update-failed",{message:t("Automatic update failed: {{error}}. Re-run the installer to update manually.",{error:err.message})})});return}if(!installationInfo.updateCommand||!isAutoUpdateEnabled){return}const updateCommand=resolveUpdateCommand(installationInfo.updateCommand,info.update.latest);const platform=os.platform();const isWindows=platform==="win32";const isManagedNpmUpdate=installationInfo.packageManager==="npm";const command=isManagedNpmUpdate?getNpmNodePath():isWindows?"cmd.exe":"bash";const commandArgs=isManagedNpmUpdate?[process.argv[1]]:isWindows?["/c",updateCommand]:["-c",updateCommand];const updateProcess=spawnFn(command,commandArgs,{...isManagedNpmUpdate?{detached:true,env:{...process.env,QWEN_CODE_MANAGED_NPM_UPDATE_VERSION:info.update.latest},stdio:["ignore","ignore","pipe"],windowsHide:true}:{stdio:["pipe","ignore","pipe"]}});let errorOutput="";updateProcess.stderr?.on("data",data=>{errorOutput+=data.toString()});return new Promise(resolve=>{let settled=false;const finish=__name(error=>{if(settled)return;settled=true;try{if(error)throw error;updateEventEmitter.emit("update-success",{message:t(UPDATE_SUCCESS_MESSAGE)});resolve(true)}catch(error2){debugLogger.warn("Automatic update failed:",error2);updateEventEmitter.emit("update-failed",{message:t(UPDATE_FAILED_MESSAGE)});resolve(false)}},"finish");updateProcess.once("close",code=>{finish(code===0?void 0:new Error(`Command failed: ${updateCommand}; stderr: ${errorOutput.trim()}`))});updateProcess.once("error",error=>{finish(error)})})}__name(handleAutoUpdate,"handleAutoUpdate");function setUpdateHandler(addItem,setUpdateInfo,isIdleRef={current:true}){let successfullyInstalled=false;const pendingNotifications=[];const addItemOrDefer=__name(item=>{if(isIdleRef.current){addItem(item,Date.now())}else{pendingNotifications.push(item)}},"addItemOrDefer");const handleUpdateReceived=__name(info=>{setUpdateInfo(info);const savedMessage=info.message;setTimeout(()=>{if(!successfullyInstalled){addItemOrDefer({type:"info",text:savedMessage})}setUpdateInfo(null)},6e4)},"handleUpdateReceived");const handleUpdateFailed=__name(data=>{setUpdateInfo(null);addItemOrDefer({type:data?.severity==="warning"?"warning":"error",text:data?.message??t(UPDATE_FAILED_MESSAGE)})},"handleUpdateFailed");const handleUpdateSuccess=__name(data=>{successfullyInstalled=true;setUpdateInfo(null);addItemOrDefer({type:"info",text:data?.message??t(UPDATE_SUCCESS_MESSAGE)})},"handleUpdateSuccess");const handleUpdateInfo=__name(data=>{addItemOrDefer({type:"info",text:data.message})},"handleUpdateInfo");updateEventEmitter.on("update-received",handleUpdateReceived);updateEventEmitter.on("update-failed",handleUpdateFailed);updateEventEmitter.on("update-success",handleUpdateSuccess);updateEventEmitter.on("update-info",handleUpdateInfo);const cleanup=__name(()=>{updateEventEmitter.off("update-received",handleUpdateReceived);updateEventEmitter.off("update-failed",handleUpdateFailed);updateEventEmitter.off("update-success",handleUpdateSuccess);updateEventEmitter.off("update-info",handleUpdateInfo);pendingNotifications.length=0},"cleanup");const flush=__name(()=>{while(pendingNotifications.length>0){const item=pendingNotifications.shift();addItem(item,Date.now())}},"flush");return{cleanup,flush}}__name(setUpdateHandler,"setUpdateHandler");export{handleAutoUpdate,setUpdateHandler};
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{normalizeWorkspaceRelativePath}from"./chunk-YJ6APXNB.js";import{MAX_SNAPSHOTS,ManagedToolProtocolError,managedToolDigest}from"./chunk-T3CQ72HC.js";import{MANAGED_SESSION_LIMITS,assertManagedSessionDurableRef,assertManagedSessionKey,assertManagedSessionSequence,assertManagedSessionStableId}from"./chunk-OMSVOFTC.js";import{getMemoryBaseDir}from"./chunk-KVA6DHHF.js";import{normalizeQwenCustomIgnoreFileNames}from"./chunk-5DTFN37U.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as path from"node:path";var MANAGED_TOOL_FILE_HISTORY_MAX_BYTES=8*1024*1024;function captureManagedToolExecutionContext(config){const filtering=config.getFileFilteringOptions();return{workspaceDirectories:[...config.getWorkspaceContext().getDirectories()],memoryBaseDir:getMemoryBaseDir(),lsToolEnabled:config.isLsToolEnabled(),grepOptions:{useRipgrep:config.getUseRipgrep(),useBuiltinRipgrep:config.getUseBuiltinRipgrep()},outputLimits:{chars:encodeOutputLimit(config.getTruncateToolOutputThreshold()),lines:encodeOutputLimit(config.getTruncateToolOutputLines()),charsExplicit:config.isTruncateToolOutputThresholdExplicit()},fileFilteringOptions:{respectGitIgnore:filtering.respectGitIgnore,respectQwenIgnore:filtering.respectQwenIgnore,customIgnoreFiles:normalizeQwenCustomIgnoreFileNames(filtering.customIgnoreFiles)}}}__name(captureManagedToolExecutionContext,"captureManagedToolExecutionContext");function record(value,keys){if(!value||typeof value!=="object"||Array.isArray(value))throw new ManagedToolProtocolError;const result=value;if(keys&&Object.keys(result).some(key=>!keys.includes(key)))throw new ManagedToolProtocolError;return result}__name(record,"record");function text(value,limit){if(typeof value!=="string"||!value.length||value.length>limit||value.includes("\0"))throw new ManagedToolProtocolError;return value}__name(text,"text");function uuid(value){const result=text(value,256);if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(result))throw new ManagedToolProtocolError;return result}__name(uuid,"uuid");function integer(value){if(typeof value!=="number"||!Number.isSafeInteger(value)||value<0)throw new ManagedToolProtocolError;return value}__name(integer,"integer");function timestamp(value){const result=text(value,32);const date=new Date(result);if(!Number.isFinite(date.getTime())||date.toISOString()!==result)throw new ManagedToolProtocolError;return result}__name(timestamp,"timestamp");function parseManagedToolFileHistoryPromptId(value){return text(value,128)}__name(parseManagedToolFileHistoryPromptId,"parseManagedToolFileHistoryPromptId");function snapshots(value){if(!Array.isArray(value)||value.length>MAX_SNAPSHOTS)throw new ManagedToolProtocolError;const prompts=new Set;return value.map(item=>{const snapshot=record(item,["promptId","timestamp","trackedFileBackups"]);const promptId=parseManagedToolFileHistoryPromptId(snapshot["promptId"]);if(prompts.has(promptId))throw new ManagedToolProtocolError;prompts.add(promptId);return{promptId,timestamp:timestamp(snapshot["timestamp"]),trackedFileBackups:Object.fromEntries(Object.entries(record(snapshot["trackedFileBackups"])).map(([filePath,value2])=>{text(filePath,4096);if(filePath.split(/[/\\]/).includes(".."))throw new ManagedToolProtocolError;const backup=record(value2,["backupFileName","version","backupTime","failed"]);const backupFileName=backup["backupFileName"]===null?null:text(backup["backupFileName"],256);if(backupFileName!==null&&(backupFileName==="."||backupFileName===".."||/[/\\]/.test(backupFileName)))throw new ManagedToolProtocolError;if("failed"in backup&&typeof backup["failed"]!=="boolean")throw new ManagedToolProtocolError;return[filePath,{backupFileName,version:integer(backup["version"]),backupTime:timestamp(backup["backupTime"]),..."failed"in backup?{failed:backup["failed"]}:{}}]}))}})}__name(snapshots,"snapshots");function absolutePath(value){const result=text(value,4096);if(!path.isAbsolute(result)||path.normalize(result)!==result)throw new ManagedToolProtocolError;return result}__name(absolutePath,"absolutePath");function encodeOutputLimit(value){return value===Number.POSITIVE_INFINITY?null:value}__name(encodeOutputLimit,"encodeOutputLimit");function outputLimit(value){if(value===null)return null;if(typeof value!=="number"||!Number.isFinite(value)||value<=0)throw new ManagedToolProtocolError;return value}__name(outputLimit,"outputLimit");function grepOptions(value){const input=record(value,["useRipgrep","useBuiltinRipgrep"]);if(typeof input["useRipgrep"]!=="boolean"||typeof input["useBuiltinRipgrep"]!=="boolean")throw new ManagedToolProtocolError;return{useRipgrep:input["useRipgrep"],useBuiltinRipgrep:input["useBuiltinRipgrep"]}}__name(grepOptions,"grepOptions");function outputLimits(value){const input=record(value,["chars","lines","charsExplicit"]);if(typeof input["charsExplicit"]!=="boolean")throw new ManagedToolProtocolError;return{chars:outputLimit(input["chars"]),lines:outputLimit(input["lines"]),charsExplicit:input["charsExplicit"]}}__name(outputLimits,"outputLimits");function executionContext(value){const input=record(value,["workspaceDirectories","memoryBaseDir","fileFilteringOptions","lsToolEnabled","grepOptions","outputLimits"]);const filtering=record(input["fileFilteringOptions"],["respectGitIgnore","respectQwenIgnore","customIgnoreFiles"]);if(!Array.isArray(input["workspaceDirectories"])||!Array.isArray(filtering["customIgnoreFiles"])||typeof filtering["respectGitIgnore"]!=="boolean"||typeof filtering["respectQwenIgnore"]!=="boolean"||typeof input["lsToolEnabled"]!=="boolean")throw new ManagedToolProtocolError;const directories=input["workspaceDirectories"].map(absolutePath);if(new Set(directories).size!==directories.length)throw new ManagedToolProtocolError;const customIgnoreFiles=filtering["customIgnoreFiles"].map(value2=>text(value2,4096));if(JSON.stringify(normalizeQwenCustomIgnoreFileNames(customIgnoreFiles))!==JSON.stringify(customIgnoreFiles))throw new ManagedToolProtocolError;return{workspaceDirectories:directories,memoryBaseDir:absolutePath(input["memoryBaseDir"]),lsToolEnabled:input["lsToolEnabled"],..."grepOptions"in input?{grepOptions:grepOptions(input["grepOptions"])}:{},..."outputLimits"in input?{outputLimits:outputLimits(input["outputLimits"])}:{},fileFilteringOptions:{respectGitIgnore:filtering["respectGitIgnore"],respectQwenIgnore:filtering["respectQwenIgnore"],customIgnoreFiles}}}__name(executionContext,"executionContext");function parseManagedToolFileHistoryBinding(value){managedToolDigest(value,MANAGED_TOOL_FILE_HISTORY_MAX_BYTES);const input=record(value,["ownerSessionId","ownerRuntimeSessionId","executionCwd","executionContext","snapshots"]);const executionCwd=text(input["executionCwd"],4096);if(!path.isAbsolute(executionCwd)||path.normalize(executionCwd)!==executionCwd)throw new ManagedToolProtocolError;return{ownerSessionId:uuid(input["ownerSessionId"]),ownerRuntimeSessionId:uuid(input["ownerRuntimeSessionId"]),executionCwd,..."executionContext"in input?{executionContext:executionContext(input["executionContext"])}:{},snapshots:snapshots(input["snapshots"])}}__name(parseManagedToolFileHistoryBinding,"parseManagedToolFileHistoryBinding");function parseManagedToolFileHistoryState(value){managedToolDigest(value,MANAGED_TOOL_FILE_HISTORY_MAX_BYTES);const input=record(value,["ownerSessionId","revision","snapshots"]);return{ownerSessionId:uuid(input["ownerSessionId"]),revision:integer(input["revision"]),snapshots:snapshots(input["snapshots"])}}__name(parseManagedToolFileHistoryState,"parseManagedToolFileHistoryState");init_esbuild_shims();function historyPath(value){if(typeof value!=="string"||value==="."||normalizeWorkspaceRelativePath(value)!==value)throw new Error("Invalid Hosted file history path.");return value}__name(historyPath,"historyPath");function parseHostedFileHistoryState(value,owner){if(!value||typeof value!=="object"||Array.isArray(value))throw new Error("Invalid Hosted file history state.");const state=value;if(Object.keys(state).sort().join(",")!=="files,ownerSessionId,snapshots"||state["ownerSessionId"]!==owner)throw new Error("Hosted file history owner conflicts.");const{snapshots:snapshots2}=parseManagedToolFileHistoryState({ownerSessionId:owner,revision:0,snapshots:state["snapshots"]});const paths=new Set(snapshots2.flatMap(s=>Object.keys(s.trackedFileBackups).map(historyPath)));const files=state["files"];if(!files||typeof files!=="object"||Array.isArray(files)||Object.keys(files).length!==paths.size)throw new Error("Hosted file history files conflict.");for(const[file,expected]of Object.entries(files)){if(!paths.has(historyPath(file)))throw new Error("Hosted file history file is untracked.");if(expected!==null&&(typeof expected!=="object"||Array.isArray(expected)||Object.keys(expected).sort().join(",")!=="digest,mode"||!/^sha256:[a-f0-9]{64}$/.test(expected.digest)||!Number.isSafeInteger(expected.mode)||expected.mode<0||expected.mode>4095))throw new Error("Invalid Hosted file history file state.")}return structuredClone({ownerSessionId:owner,snapshots:snapshots2,files})}__name(parseHostedFileHistoryState,"parseHostedFileHistoryState");var HOSTED_UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;function parseHostedFileHistoryRecord(value,owner){const record2=value;if(!record2||typeof record2!=="object"||Array.isArray(record2)||record2.schemaVersion!==1||!(record2.pendingTurn===null||typeof record2.pendingTurn==="string")||record2.pendingMessageId!==void 0&&(typeof record2.pendingMessageId!=="string"||!record2.pendingTurn)||!(record2.pendingUndo===null||typeof record2.pendingUndo?.requestId==="string"&&typeof record2.pendingUndo.promptId==="string"))throw new Error("Invalid Hosted file history record.");const state=parseHostedFileHistoryState(record2.state,owner);const undoReceipts=record2.undoReceipts===void 0?[]:record2.undoReceipts;if(!Array.isArray(undoReceipts))throw new Error("Invalid Hosted file history undo receipts: expected an array.");const requests=new Set;const prompts=new Set(state.snapshots.map(snapshot=>snapshot.promptId));for(const[index,receipt]of undoReceipts.entries()){const invalid=__name(reason=>{throw new Error(`Invalid Hosted file history undo receipt ${index}: ${reason}.`)},"invalid");if(!receipt||typeof receipt!=="object"||Array.isArray(receipt)||Object.keys(receipt).sort().join(",")!=="conflict,filesChanged,promptId,requestId")invalid("expected exactly requestId, promptId, filesChanged and conflict");if(typeof receipt.requestId!=="string"||!HOSTED_UUID.test(receipt.requestId))invalid("requestId must be a lowercase UUID v1-v5");if(typeof receipt.promptId!=="string"||!HOSTED_UUID.test(receipt.promptId))invalid("promptId must be a lowercase UUID v1-v5");if(!prompts.has(receipt.promptId))invalid("promptId is not a retained snapshot");if(requests.has(receipt.requestId))invalid("requestId is duplicated");if(typeof receipt.conflict!=="boolean")invalid("conflict must be a boolean");if(!Array.isArray(receipt.filesChanged))invalid("filesChanged must be an array");if(receipt.filesChanged.some(file=>typeof file!=="string"||!Object.hasOwn(state.files,file)))invalid("filesChanged must contain only tracked paths");if(new Set(receipt.filesChanged).size!==receipt.filesChanged.length)invalid("filesChanged contains duplicate paths");if(receipt.conflict&&receipt.filesChanged.length!==0)invalid("conflict must have no changed paths");if(record2.pendingUndo?.requestId===receipt.requestId&&record2.pendingUndo.promptId!==receipt.promptId)invalid("promptId does not match pendingUndo");requests.add(receipt.requestId)}return{schemaVersion:1,state,pendingTurn:record2.pendingTurn,...record2.pendingMessageId!==void 0?{pendingMessageId:record2.pendingMessageId}:{},pendingUndo:record2.pendingUndo,undoReceipts}}__name(parseHostedFileHistoryRecord,"parseHostedFileHistoryRecord");init_esbuild_shims();import{createHash,randomBytes}from"node:crypto";var TOOL_PUBLICATION_PROTOCOL="managed-tool-publication/1";var TOOL_PUBLICATION_LIMITS=Object.freeze({maxBodyBytes:64*1024,maxCaptureBytes:2**41,producerBytes:2*1024*1024+64*1024+2*256*1024,admissionBytes:2*1024*1024});var BINDING_KEYS=["publication","publicationId","sessionKey","turnId","executionCallId","modelCallId","runtimeBindingId","reference","bindingGeneration","captureId","revision","captureScope","capturePolicy","argsRef","requestDigest","writerId","writerGeneration","activationId","activationEpoch","intentSequence","checkpointRef"];function requireValue(condition){if(!condition)throw new Error("Invalid managed tool publication.")}__name(requireValue,"requireValue");function closed(value,keys){requireValue(value!==null&&typeof value==="object");requireValue(Object.getPrototypeOf(value)===Object.prototype||Object.getPrototypeOf(value)===null);const present=Object.keys(value);requireValue(present.length===keys.length&&present.every(key=>keys.includes(key)));return Object.fromEntries(present.map(key=>[key,value[key]]))}__name(closed,"closed");function id(value){return assertManagedSessionStableId(value,"publication id")}__name(id,"id");function token(value){const text2=id(value);requireValue(/^[a-z0-9_-]{1,128}$/.test(text2));return text2}__name(token,"token");function count(value,max=Number.MAX_SAFE_INTEGER-1){const result=assertManagedSessionSequence(value,"publication count");requireValue(result>0&&result<=max);return result}__name(count,"count");function wireDigest(value){requireValue(typeof value==="string"&&/^sha256:[0-9a-f]{64}$/.test(value));return value}__name(wireDigest,"wireDigest");function ref(value,kind){const result=assertManagedSessionDurableRef(value,"publication ref");requireValue(result.kind===kind&&result.schemaVersion===1&&result.byteLength>0&&result.byteLength<=(kind==="managed-checkpoint"?MANAGED_SESSION_LIMITS.maxEventBytes:TOOL_PUBLICATION_LIMITS.maxBodyBytes));return Object.freeze(result)}__name(ref,"ref");function bounded(value){requireValue(Buffer.byteLength(JSON.stringify(value))<=TOOL_PUBLICATION_LIMITS.maxBodyBytes);return Object.freeze(value)}__name(bounded,"bounded");function parseToolPublicationBinding(value){const r=closed(value,BINDING_KEYS);requireValue(r["publication"]===TOOL_PUBLICATION_PROTOCOL&&r["revision"]===1&&r["captureScope"]==="process_pipes"&&r["capturePolicy"]==="complete_required");const generation=id(r["bindingGeneration"]);requireValue(/^[1-9][0-9]{0,18}$/.test(generation)&&BigInt(generation)<=9223372036854775807n);const reference=closed(r["reference"],["sessionId","promptId","callId","argsDigest"]);return bounded({publication:TOOL_PUBLICATION_PROTOCOL,publicationId:token(r["publicationId"]),sessionKey:Object.freeze(assertManagedSessionKey(r["sessionKey"])),turnId:id(r["turnId"]),executionCallId:id(r["executionCallId"]),modelCallId:id(r["modelCallId"]),runtimeBindingId:id(r["runtimeBindingId"]),reference:Object.freeze({sessionId:id(reference["sessionId"]),promptId:id(reference["promptId"]),callId:id(reference["callId"]),argsDigest:wireDigest(reference["argsDigest"])}),bindingGeneration:generation,captureId:token(r["captureId"]),revision:1,captureScope:"process_pipes",capturePolicy:"complete_required",argsRef:ref(r["argsRef"],"managed-tool-input"),requestDigest:wireDigest(r["requestDigest"]),writerId:id(r["writerId"]),writerGeneration:count(r["writerGeneration"]),activationId:id(r["activationId"]),activationEpoch:count(r["activationEpoch"]),intentSequence:count(r["intentSequence"]),checkpointRef:ref(r["checkpointRef"],"managed-checkpoint")})}__name(parseToolPublicationBinding,"parseToolPublicationBinding");function toolPublicationManifestIdentity(binding){const b=parseToolPublicationBinding(binding);return{tenantId:b.sessionKey.tenantId,sessionId:b.sessionKey.sessionId,turnId:b.turnId,executionCallId:b.executionCallId,callId:b.reference.callId,invocationDigest:b.reference.argsDigest,bindingGeneration:b.bindingGeneration,captureId:b.captureId,revision:b.revision}}__name(toolPublicationManifestIdentity,"toolPublicationManifestIdentity");function createToolPublicationToken(){return randomBytes(32).toString("base64url")}__name(createToolPublicationToken,"createToolPublicationToken");export{MANAGED_TOOL_FILE_HISTORY_MAX_BYTES,captureManagedToolExecutionContext,parseManagedToolFileHistoryPromptId,parseManagedToolFileHistoryBinding,parseManagedToolFileHistoryState,historyPath,parseHostedFileHistoryState,HOSTED_UUID,parseHostedFileHistoryRecord,parseToolPublicationBinding,toolPublicationManifestIdentity,createToolPublicationToken};
|
|
3
|
+
import{normalizeWorkspaceRelativePath}from"./chunk-YJ6APXNB.js";import{MAX_SNAPSHOTS,ManagedToolProtocolError,managedToolDigest}from"./chunk-7XQ5D34E.js";import{MANAGED_SESSION_LIMITS,assertManagedSessionDurableRef,assertManagedSessionKey,assertManagedSessionSequence,assertManagedSessionStableId}from"./chunk-OMSVOFTC.js";import{getMemoryBaseDir}from"./chunk-KVA6DHHF.js";import{normalizeQwenCustomIgnoreFileNames}from"./chunk-5DTFN37U.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as path from"node:path";var MANAGED_TOOL_FILE_HISTORY_MAX_BYTES=8*1024*1024;function captureManagedToolExecutionContext(config){const filtering=config.getFileFilteringOptions();return{workspaceDirectories:[...config.getWorkspaceContext().getDirectories()],memoryBaseDir:getMemoryBaseDir(),lsToolEnabled:config.isLsToolEnabled(),grepOptions:{useRipgrep:config.getUseRipgrep(),useBuiltinRipgrep:config.getUseBuiltinRipgrep()},outputLimits:{chars:encodeOutputLimit(config.getTruncateToolOutputThreshold()),lines:encodeOutputLimit(config.getTruncateToolOutputLines()),charsExplicit:config.isTruncateToolOutputThresholdExplicit()},fileFilteringOptions:{respectGitIgnore:filtering.respectGitIgnore,respectQwenIgnore:filtering.respectQwenIgnore,customIgnoreFiles:normalizeQwenCustomIgnoreFileNames(filtering.customIgnoreFiles)}}}__name(captureManagedToolExecutionContext,"captureManagedToolExecutionContext");function record(value,keys){if(!value||typeof value!=="object"||Array.isArray(value))throw new ManagedToolProtocolError;const result=value;if(keys&&Object.keys(result).some(key=>!keys.includes(key)))throw new ManagedToolProtocolError;return result}__name(record,"record");function text(value,limit){if(typeof value!=="string"||!value.length||value.length>limit||value.includes("\0"))throw new ManagedToolProtocolError;return value}__name(text,"text");function uuid(value){const result=text(value,256);if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(result))throw new ManagedToolProtocolError;return result}__name(uuid,"uuid");function integer(value){if(typeof value!=="number"||!Number.isSafeInteger(value)||value<0)throw new ManagedToolProtocolError;return value}__name(integer,"integer");function timestamp(value){const result=text(value,32);const date=new Date(result);if(!Number.isFinite(date.getTime())||date.toISOString()!==result)throw new ManagedToolProtocolError;return result}__name(timestamp,"timestamp");function parseManagedToolFileHistoryPromptId(value){return text(value,128)}__name(parseManagedToolFileHistoryPromptId,"parseManagedToolFileHistoryPromptId");function snapshots(value){if(!Array.isArray(value)||value.length>MAX_SNAPSHOTS)throw new ManagedToolProtocolError;const prompts=new Set;return value.map(item=>{const snapshot=record(item,["promptId","timestamp","trackedFileBackups"]);const promptId=parseManagedToolFileHistoryPromptId(snapshot["promptId"]);if(prompts.has(promptId))throw new ManagedToolProtocolError;prompts.add(promptId);return{promptId,timestamp:timestamp(snapshot["timestamp"]),trackedFileBackups:Object.fromEntries(Object.entries(record(snapshot["trackedFileBackups"])).map(([filePath,value2])=>{text(filePath,4096);if(filePath.split(/[/\\]/).includes(".."))throw new ManagedToolProtocolError;const backup=record(value2,["backupFileName","version","backupTime","failed"]);const backupFileName=backup["backupFileName"]===null?null:text(backup["backupFileName"],256);if(backupFileName!==null&&(backupFileName==="."||backupFileName===".."||/[/\\]/.test(backupFileName)))throw new ManagedToolProtocolError;if("failed"in backup&&typeof backup["failed"]!=="boolean")throw new ManagedToolProtocolError;return[filePath,{backupFileName,version:integer(backup["version"]),backupTime:timestamp(backup["backupTime"]),..."failed"in backup?{failed:backup["failed"]}:{}}]}))}})}__name(snapshots,"snapshots");function absolutePath(value){const result=text(value,4096);if(!path.isAbsolute(result)||path.normalize(result)!==result)throw new ManagedToolProtocolError;return result}__name(absolutePath,"absolutePath");function encodeOutputLimit(value){return value===Number.POSITIVE_INFINITY?null:value}__name(encodeOutputLimit,"encodeOutputLimit");function outputLimit(value){if(value===null)return null;if(typeof value!=="number"||!Number.isFinite(value)||value<=0)throw new ManagedToolProtocolError;return value}__name(outputLimit,"outputLimit");function grepOptions(value){const input=record(value,["useRipgrep","useBuiltinRipgrep"]);if(typeof input["useRipgrep"]!=="boolean"||typeof input["useBuiltinRipgrep"]!=="boolean")throw new ManagedToolProtocolError;return{useRipgrep:input["useRipgrep"],useBuiltinRipgrep:input["useBuiltinRipgrep"]}}__name(grepOptions,"grepOptions");function outputLimits(value){const input=record(value,["chars","lines","charsExplicit"]);if(typeof input["charsExplicit"]!=="boolean")throw new ManagedToolProtocolError;return{chars:outputLimit(input["chars"]),lines:outputLimit(input["lines"]),charsExplicit:input["charsExplicit"]}}__name(outputLimits,"outputLimits");function executionContext(value){const input=record(value,["workspaceDirectories","memoryBaseDir","fileFilteringOptions","lsToolEnabled","grepOptions","outputLimits"]);const filtering=record(input["fileFilteringOptions"],["respectGitIgnore","respectQwenIgnore","customIgnoreFiles"]);if(!Array.isArray(input["workspaceDirectories"])||!Array.isArray(filtering["customIgnoreFiles"])||typeof filtering["respectGitIgnore"]!=="boolean"||typeof filtering["respectQwenIgnore"]!=="boolean"||typeof input["lsToolEnabled"]!=="boolean")throw new ManagedToolProtocolError;const directories=input["workspaceDirectories"].map(absolutePath);if(new Set(directories).size!==directories.length)throw new ManagedToolProtocolError;const customIgnoreFiles=filtering["customIgnoreFiles"].map(value2=>text(value2,4096));if(JSON.stringify(normalizeQwenCustomIgnoreFileNames(customIgnoreFiles))!==JSON.stringify(customIgnoreFiles))throw new ManagedToolProtocolError;return{workspaceDirectories:directories,memoryBaseDir:absolutePath(input["memoryBaseDir"]),lsToolEnabled:input["lsToolEnabled"],..."grepOptions"in input?{grepOptions:grepOptions(input["grepOptions"])}:{},..."outputLimits"in input?{outputLimits:outputLimits(input["outputLimits"])}:{},fileFilteringOptions:{respectGitIgnore:filtering["respectGitIgnore"],respectQwenIgnore:filtering["respectQwenIgnore"],customIgnoreFiles}}}__name(executionContext,"executionContext");function parseManagedToolFileHistoryBinding(value){managedToolDigest(value,MANAGED_TOOL_FILE_HISTORY_MAX_BYTES);const input=record(value,["ownerSessionId","ownerRuntimeSessionId","executionCwd","executionContext","snapshots"]);const executionCwd=text(input["executionCwd"],4096);if(!path.isAbsolute(executionCwd)||path.normalize(executionCwd)!==executionCwd)throw new ManagedToolProtocolError;return{ownerSessionId:uuid(input["ownerSessionId"]),ownerRuntimeSessionId:uuid(input["ownerRuntimeSessionId"]),executionCwd,..."executionContext"in input?{executionContext:executionContext(input["executionContext"])}:{},snapshots:snapshots(input["snapshots"])}}__name(parseManagedToolFileHistoryBinding,"parseManagedToolFileHistoryBinding");function parseManagedToolFileHistoryState(value){managedToolDigest(value,MANAGED_TOOL_FILE_HISTORY_MAX_BYTES);const input=record(value,["ownerSessionId","revision","snapshots"]);return{ownerSessionId:uuid(input["ownerSessionId"]),revision:integer(input["revision"]),snapshots:snapshots(input["snapshots"])}}__name(parseManagedToolFileHistoryState,"parseManagedToolFileHistoryState");init_esbuild_shims();function historyPath(value){if(typeof value!=="string"||value==="."||normalizeWorkspaceRelativePath(value)!==value)throw new Error("Invalid Hosted file history path.");return value}__name(historyPath,"historyPath");function parseHostedFileHistoryState(value,owner){if(!value||typeof value!=="object"||Array.isArray(value))throw new Error("Invalid Hosted file history state.");const state=value;if(Object.keys(state).sort().join(",")!=="files,ownerSessionId,snapshots"||state["ownerSessionId"]!==owner)throw new Error("Hosted file history owner conflicts.");const{snapshots:snapshots2}=parseManagedToolFileHistoryState({ownerSessionId:owner,revision:0,snapshots:state["snapshots"]});const paths=new Set(snapshots2.flatMap(s=>Object.keys(s.trackedFileBackups).map(historyPath)));const files=state["files"];if(!files||typeof files!=="object"||Array.isArray(files)||Object.keys(files).length!==paths.size)throw new Error("Hosted file history files conflict.");for(const[file,expected]of Object.entries(files)){if(!paths.has(historyPath(file)))throw new Error("Hosted file history file is untracked.");if(expected!==null&&(typeof expected!=="object"||Array.isArray(expected)||Object.keys(expected).sort().join(",")!=="digest,mode"||!/^sha256:[a-f0-9]{64}$/.test(expected.digest)||!Number.isSafeInteger(expected.mode)||expected.mode<0||expected.mode>4095))throw new Error("Invalid Hosted file history file state.")}return structuredClone({ownerSessionId:owner,snapshots:snapshots2,files})}__name(parseHostedFileHistoryState,"parseHostedFileHistoryState");var HOSTED_UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;function parseHostedFileHistoryRecord(value,owner){const record2=value;if(!record2||typeof record2!=="object"||Array.isArray(record2)||record2.schemaVersion!==1||!(record2.pendingTurn===null||typeof record2.pendingTurn==="string")||record2.pendingMessageId!==void 0&&(typeof record2.pendingMessageId!=="string"||!record2.pendingTurn)||!(record2.pendingUndo===null||typeof record2.pendingUndo?.requestId==="string"&&typeof record2.pendingUndo.promptId==="string"))throw new Error("Invalid Hosted file history record.");const state=parseHostedFileHistoryState(record2.state,owner);const undoReceipts=record2.undoReceipts===void 0?[]:record2.undoReceipts;if(!Array.isArray(undoReceipts))throw new Error("Invalid Hosted file history undo receipts: expected an array.");const requests=new Set;const prompts=new Set(state.snapshots.map(snapshot=>snapshot.promptId));for(const[index,receipt]of undoReceipts.entries()){const invalid=__name(reason=>{throw new Error(`Invalid Hosted file history undo receipt ${index}: ${reason}.`)},"invalid");if(!receipt||typeof receipt!=="object"||Array.isArray(receipt)||Object.keys(receipt).sort().join(",")!=="conflict,filesChanged,promptId,requestId")invalid("expected exactly requestId, promptId, filesChanged and conflict");if(typeof receipt.requestId!=="string"||!HOSTED_UUID.test(receipt.requestId))invalid("requestId must be a lowercase UUID v1-v5");if(typeof receipt.promptId!=="string"||!HOSTED_UUID.test(receipt.promptId))invalid("promptId must be a lowercase UUID v1-v5");if(!prompts.has(receipt.promptId))invalid("promptId is not a retained snapshot");if(requests.has(receipt.requestId))invalid("requestId is duplicated");if(typeof receipt.conflict!=="boolean")invalid("conflict must be a boolean");if(!Array.isArray(receipt.filesChanged))invalid("filesChanged must be an array");if(receipt.filesChanged.some(file=>typeof file!=="string"||!Object.hasOwn(state.files,file)))invalid("filesChanged must contain only tracked paths");if(new Set(receipt.filesChanged).size!==receipt.filesChanged.length)invalid("filesChanged contains duplicate paths");if(receipt.conflict&&receipt.filesChanged.length!==0)invalid("conflict must have no changed paths");if(record2.pendingUndo?.requestId===receipt.requestId&&record2.pendingUndo.promptId!==receipt.promptId)invalid("promptId does not match pendingUndo");requests.add(receipt.requestId)}return{schemaVersion:1,state,pendingTurn:record2.pendingTurn,...record2.pendingMessageId!==void 0?{pendingMessageId:record2.pendingMessageId}:{},pendingUndo:record2.pendingUndo,undoReceipts}}__name(parseHostedFileHistoryRecord,"parseHostedFileHistoryRecord");init_esbuild_shims();import{createHash,randomBytes}from"node:crypto";var TOOL_PUBLICATION_PROTOCOL="managed-tool-publication/1";var TOOL_PUBLICATION_LIMITS=Object.freeze({maxBodyBytes:64*1024,maxCaptureBytes:2**41,producerBytes:2*1024*1024+64*1024+2*256*1024,admissionBytes:2*1024*1024});var BINDING_KEYS=["publication","publicationId","sessionKey","turnId","executionCallId","modelCallId","runtimeBindingId","reference","bindingGeneration","captureId","revision","captureScope","capturePolicy","argsRef","requestDigest","writerId","writerGeneration","activationId","activationEpoch","intentSequence","checkpointRef"];function requireValue(condition){if(!condition)throw new Error("Invalid managed tool publication.")}__name(requireValue,"requireValue");function closed(value,keys){requireValue(value!==null&&typeof value==="object");requireValue(Object.getPrototypeOf(value)===Object.prototype||Object.getPrototypeOf(value)===null);const present=Object.keys(value);requireValue(present.length===keys.length&&present.every(key=>keys.includes(key)));return Object.fromEntries(present.map(key=>[key,value[key]]))}__name(closed,"closed");function id(value){return assertManagedSessionStableId(value,"publication id")}__name(id,"id");function token(value){const text2=id(value);requireValue(/^[a-z0-9_-]{1,128}$/.test(text2));return text2}__name(token,"token");function count(value,max=Number.MAX_SAFE_INTEGER-1){const result=assertManagedSessionSequence(value,"publication count");requireValue(result>0&&result<=max);return result}__name(count,"count");function wireDigest(value){requireValue(typeof value==="string"&&/^sha256:[0-9a-f]{64}$/.test(value));return value}__name(wireDigest,"wireDigest");function ref(value,kind){const result=assertManagedSessionDurableRef(value,"publication ref");requireValue(result.kind===kind&&result.schemaVersion===1&&result.byteLength>0&&result.byteLength<=(kind==="managed-checkpoint"?MANAGED_SESSION_LIMITS.maxEventBytes:TOOL_PUBLICATION_LIMITS.maxBodyBytes));return Object.freeze(result)}__name(ref,"ref");function bounded(value){requireValue(Buffer.byteLength(JSON.stringify(value))<=TOOL_PUBLICATION_LIMITS.maxBodyBytes);return Object.freeze(value)}__name(bounded,"bounded");function parseToolPublicationBinding(value){const r=closed(value,BINDING_KEYS);requireValue(r["publication"]===TOOL_PUBLICATION_PROTOCOL&&r["revision"]===1&&r["captureScope"]==="process_pipes"&&r["capturePolicy"]==="complete_required");const generation=id(r["bindingGeneration"]);requireValue(/^[1-9][0-9]{0,18}$/.test(generation)&&BigInt(generation)<=9223372036854775807n);const reference=closed(r["reference"],["sessionId","promptId","callId","argsDigest"]);return bounded({publication:TOOL_PUBLICATION_PROTOCOL,publicationId:token(r["publicationId"]),sessionKey:Object.freeze(assertManagedSessionKey(r["sessionKey"])),turnId:id(r["turnId"]),executionCallId:id(r["executionCallId"]),modelCallId:id(r["modelCallId"]),runtimeBindingId:id(r["runtimeBindingId"]),reference:Object.freeze({sessionId:id(reference["sessionId"]),promptId:id(reference["promptId"]),callId:id(reference["callId"]),argsDigest:wireDigest(reference["argsDigest"])}),bindingGeneration:generation,captureId:token(r["captureId"]),revision:1,captureScope:"process_pipes",capturePolicy:"complete_required",argsRef:ref(r["argsRef"],"managed-tool-input"),requestDigest:wireDigest(r["requestDigest"]),writerId:id(r["writerId"]),writerGeneration:count(r["writerGeneration"]),activationId:id(r["activationId"]),activationEpoch:count(r["activationEpoch"]),intentSequence:count(r["intentSequence"]),checkpointRef:ref(r["checkpointRef"],"managed-checkpoint")})}__name(parseToolPublicationBinding,"parseToolPublicationBinding");function toolPublicationManifestIdentity(binding){const b=parseToolPublicationBinding(binding);return{tenantId:b.sessionKey.tenantId,sessionId:b.sessionKey.sessionId,turnId:b.turnId,executionCallId:b.executionCallId,callId:b.reference.callId,invocationDigest:b.reference.argsDigest,bindingGeneration:b.bindingGeneration,captureId:b.captureId,revision:b.revision}}__name(toolPublicationManifestIdentity,"toolPublicationManifestIdentity");function createToolPublicationToken(){return randomBytes(32).toString("base64url")}__name(createToolPublicationToken,"createToolPublicationToken");export{MANAGED_TOOL_FILE_HISTORY_MAX_BYTES,captureManagedToolExecutionContext,parseManagedToolFileHistoryPromptId,parseManagedToolFileHistoryBinding,parseManagedToolFileHistoryState,historyPath,parseHostedFileHistoryState,HOSTED_UUID,parseHostedFileHistoryRecord,parseToolPublicationBinding,toolPublicationManifestIdentity,createToolPublicationToken};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2026 Qwen Team
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{checkTeamMemorySecrets}from"./chunk-UJP2MPBI.js";import{buildWorkspaceArtifactCandidate,formatRecordArtifactReminder}from"./chunk-AKWYMQKU.js";import{CommitAttributionService,createPatchSmart,detectLineEnding,getDiffStat}from"./chunk-T3CQ72HC.js";import{backgroundFixHolding}from"./chunk-YVD4O5ZB.js";import{getCurrentAgentId}from"./chunk-YZFNBUKG.js";import{FileOperationEvent,logFileOperation}from"./chunk-ZWPSBU7K.js";import{findCellIndex,getCellDisplayId,getNotebookLanguage,getSpecificMimeType,hasStableCellIds,inferInsertedCellSourceArrayStyle,inferNotebookJsonFormat,isAmbiguousCellId,makeCellId,normalizeEditedCell,normalizeSource,parseNotebook,serializeNotebook,toNotebookSource}from"./chunk-Y6HHV4LC.js";import{BaseDeclarativeTool,BaseToolInvocation,StructuredToolError}from"./chunk-O5EKX7LG.js";import{ToolDisplayNames,ToolNames}from"./chunk-SBZFGYYS.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{makeRelative,shortenPath,unescapePath}from"./chunk-OKN3Z5C5.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs";import*as path from"node:path";var debugLogger=createDebugLogger("NOTEBOOK_EDIT");function rejectNotebookPriorRead(notebookPath,reason,decision){debugLogger.debug("prior-read-rejected",{path:notebookPath,reason,type:decision.type,displayMessage:decision.displayMessage});return decision}__name(rejectNotebookPriorRead,"rejectNotebookPriorRead");var NotebookEditError=class extends Error{constructor(message,type){super(message);this.type=type;this.name="NotebookEditError"}static{__name(this,"NotebookEditError")}};function requireNotebookSource(source,mode){if(mode==="delete"){return""}if(typeof source!=="string"){throw new NotebookEditError(`new_source is required when edit_mode is "${mode}".`,"invalid_tool_params")}return source}__name(requireNotebookSource,"requireNotebookSource");function displayCellId(cell,index){return cell?getCellDisplayId(cell,index):`cell-${index}`}__name(displayCellId,"displayCellId");function resolveTargetIndex(notebook,cellId,mode){if(!cellId){if(mode==="insert"){return-1}throw new NotebookEditError("cell_id is required for replace and delete operations.","invalid_tool_params")}if(isAmbiguousCellId(notebook,cellId)){throw new NotebookEditError(`Cell ID "${cellId}" is ambiguous in the rendered notebook. Re-read the notebook and target a stable real cell ID before editing.`,"invalid_tool_params")}const index=findCellIndex(notebook,cellId);if(index===-1){throw new NotebookEditError(`Cell with ID "${cellId}" not found in notebook.`,"notebook_cell_not_found")}return index}__name(resolveTargetIndex,"resolveTargetIndex");function createNotebookCell(notebook,cellType,source,preferSourceArray){const cell={cell_type:cellType,metadata:{},source:toNotebookSource(source,preferSourceArray)};const id=makeCellId(notebook);if(id){cell.id=id}normalizeEditedCell(cell,cellType);return cell}__name(createNotebookCell,"createNotebookCell");function applyNotebookEdit(rawContent,params){let notebook;try{notebook=parseNotebook(rawContent)}catch(error){throw new NotebookEditError(error instanceof Error?error.message:String(error),"notebook_invalid_json")}const mode=params.edit_mode??"replace";const source=requireNotebookSource(params.new_source,mode);const originalHasStableCellIds=hasStableCellIds(notebook);const targetIndex=resolveTargetIndex(notebook,params.cell_id,mode);const language=getNotebookLanguage(notebook);const jsonFormat=inferNotebookJsonFormat(rawContent);const buildResult=__name((updatedNotebook,result)=>{const structuralEdit=mode==="insert"||mode==="delete";return{...result,updatedContent:serializeNotebook(updatedNotebook,jsonFormat),requiresReadAfterWrite:structuralEdit&&!(originalHasStableCellIds&&hasStableCellIds(updatedNotebook))}},"buildResult");switch(mode){case"insert":{const cellType=params.cell_type??"code";const insertAt=targetIndex===-1?0:targetIndex+1;const newCell=createNotebookCell(notebook,cellType,source,inferInsertedCellSourceArrayStyle(notebook,insertAt));notebook.cells.splice(insertAt,0,newCell);return buildResult(notebook,{editedCellId:displayCellId(newCell,insertAt),editedCellType:cellType,language,mode})}case"delete":{const[removed]=notebook.cells.splice(targetIndex,1);return buildResult(notebook,{editedCellId:displayCellId(removed,targetIndex),editedCellType:removed?.cell_type,language,mode})}case"replace":{const target=notebook.cells[targetIndex];if(!target){throw new NotebookEditError(`Cell index ${targetIndex} is out of range.`,"notebook_cell_not_found")}const finalType=params.cell_type??target.cell_type;target.source=toNotebookSource(source,Array.isArray(target.source));normalizeEditedCell(target,finalType);return buildResult(notebook,{editedCellId:displayCellId(target,targetIndex),editedCellType:finalType,language,mode})}default:throw new NotebookEditError(`Unsupported notebook edit mode: ${mode}`,"invalid_tool_params")}}__name(applyNotebookEdit,"applyNotebookEdit");function prepareModifiedNotebookContent(originalContent,modifiedContent,params){let notebook;let originalNotebook;try{notebook=parseNotebook(modifiedContent);originalNotebook=parseNotebook(originalContent)}catch(error){throw new NotebookEditError(error instanceof Error?error.message:String(error),"notebook_invalid_json")}return{updatedContent:modifiedContent,editedCellId:params.cell_id??"user-modified-notebook",editedCellType:void 0,language:getNotebookLanguage(notebook),mode:params.edit_mode??"replace",requiresReadAfterWrite:!hasStableCellIds(originalNotebook)||!hasStableCellIds(notebook)}}__name(prepareModifiedNotebookContent,"prepareModifiedNotebookContent");async function checkPriorNotebookRead(config,notebookPath,options={}){if(config.getFileReadCacheDisabled()){return{ok:true}}let stats;try{stats=await fs.promises.stat(notebookPath)}catch(error){const code=error?.code;if(code==="ENOENT"){if(options.expectExisting){return rejectNotebookPriorRead(notebookPath,"missing-after-read",{ok:false,type:"file_changed_since_read",rawMessage:`Notebook ${notebookPath} disappeared after it was read. Re-read it with the ${ToolNames.READ_FILE} tool before editing it.`,displayMessage:`notebook disappeared after last read; re-run ${ToolNames.READ_FILE} first.`})}return{ok:true}}return rejectNotebookPriorRead(notebookPath,"stat-failed",{ok:false,type:"prior_read_verification_failed",rawMessage:`Could not stat ${notebookPath} to verify prior notebook read (${code??"unknown error"}). Re-read it with the ${ToolNames.READ_FILE} tool before editing it.`,displayMessage:`cannot verify prior read of ${notebookPath}; re-run ${ToolNames.READ_FILE} before editing this notebook.`})}if(stats.isDirectory()){return rejectNotebookPriorRead(notebookPath,"target-is-directory",{ok:false,type:"target_is_directory",rawMessage:`${notebookPath} is a directory. The NotebookEdit tool only operates on .ipynb files.`,displayMessage:"path is a directory; cannot edit as a notebook."})}if(!stats.isFile()){return rejectNotebookPriorRead(notebookPath,"target-not-regular-file",{ok:false,type:"target_not_regular_file",rawMessage:`${notebookPath} is not a regular file. The NotebookEdit tool only operates on .ipynb files.`,displayMessage:"special file; cannot edit as a notebook."})}const status=config.getFileReadCache().check(stats);if(status.state==="fresh"&&status.entry.lastReadAt!==void 0&&status.entry.lastReadWasFull){return{ok:true}}if(status.state==="fresh"&&status.entry.lastReadAt!==void 0&&!status.entry.lastReadWasFull){return rejectNotebookPriorRead(notebookPath,"truncated-cache-entry",{ok:false,type:"edit_requires_prior_read",rawMessage:`Notebook ${notebookPath} is too large for cell-level editing because its rendered output was truncated when read. Reduce the notebook output size or split the notebook before editing cells.`,displayMessage:"notebook too large for cell-level editing."})}if(status.state==="stale"){return rejectNotebookPriorRead(notebookPath,"stale-cache-entry",{ok:false,type:"file_changed_since_read",rawMessage:`Notebook ${notebookPath} has been modified since you last read it. Re-read it with the ${ToolNames.READ_FILE} tool before editing it.`,displayMessage:`notebook changed since last read; re-run ${ToolNames.READ_FILE} first.`})}if(status.state==="unverifiable"){return rejectNotebookPriorRead(notebookPath,"unverifiable-cache-entry",{ok:false,type:"prior_read_verification_failed",rawMessage:`Notebook ${notebookPath} is on a filesystem that does not provide a verifiable inode identity (ino=0), so NotebookEdit cannot safely confirm a prior read. Use a different mechanism to edit this notebook.`,displayMessage:`cannot verify prior read of ${notebookPath}; use a different mechanism to edit it.`})}return rejectNotebookPriorRead(notebookPath,`cache-${status.state}`,{ok:false,type:"edit_requires_prior_read",rawMessage:`Notebook ${notebookPath} has not been fully read in this session. Use the ${ToolNames.READ_FILE} tool first, without offset or limit, before editing cells.`,displayMessage:`${ToolNames.READ_FILE} required before editing this notebook.`})}__name(checkPriorNotebookRead,"checkPriorNotebookRead");var NotebookEditInvocation=class extends BaseToolInvocation{constructor(config,params,modifyMetadata){super(params);this.config=config;this.modifyMetadata=modifyMetadata}static{__name(this,"NotebookEditInvocation")}toolLocations(){return[{path:this.params.notebook_path}]}getDescription(){const relativePath=makeRelative(this.params.notebook_path,this.config.getTargetDir());const mode=this.params.edit_mode??"replace";const cell=this.params.cell_id??"beginning";return`${mode} notebook cell ${cell} in ${shortenPath(relativePath)}`}async getDefaultPermission(){return"ask"}requiresUserInteraction(){return backgroundFixHolding(this.params.notebook_path,getCurrentAgentId())!==void 0}async getConfirmationDetails(abortSignal){const prepared=await this.prepareEdit(abortSignal);const fileName=path.basename(this.params.notebook_path);const fileDiff=createPatchSmart(fileName,prepared.originalContent,prepared.updatedContent,"Current","Proposed");const confirmationDetails={type:"edit",title:`Confirm Notebook Edit: ${shortenPath(makeRelative(this.params.notebook_path,this.config.getTargetDir()))}`,fileName,filePath:this.params.notebook_path,fileDiff,originalContent:prepared.originalContent,newContent:prepared.updatedContent,onConfirm:__name(async outcome=>{if(outcome==="proceed_always"){this.config.setApprovalMode("auto-edit")}},"onConfirm")};return confirmationDetails}async prepareEdit(abortSignal){const preDecision=await checkPriorNotebookRead(this.config,this.params.notebook_path);if(!preDecision.ok){throw new StructuredToolError(preDecision.rawMessage,preDecision.type)}let originalContent;let bom=false;let encoding;let lineEnding="lf";try{const fileInfo=await this.config.getFileSystemService().readTextFile({path:this.params.notebook_path});originalContent=fileInfo.content;bom=fileInfo._meta?.bom??false;encoding=fileInfo._meta?.encoding;lineEnding=fileInfo._meta?.lineEnding??detectLineEnding(fileInfo.content)}catch(error){if(abortSignal.aborted){throw error}const code=error?.code;if(code==="ENOENT"){throw new StructuredToolError(`Notebook file not found: ${this.params.notebook_path}`,"file_not_found")}throw new StructuredToolError(`Error reading notebook: ${error instanceof Error?error.message:String(error)}`,"read_content_failure")}const postDecision=await checkPriorNotebookRead(this.config,this.params.notebook_path,{expectExisting:true});if(!postDecision.ok){throw new StructuredToolError(postDecision.rawMessage,postDecision.type)}try{if(this.modifyMetadata?.modifiedNotebookContent!==void 0){return{...prepareModifiedNotebookContent(originalContent,this.modifyMetadata.modifiedNotebookContent,this.params),originalContent,bom,encoding,lineEnding}}return{...applyNotebookEdit(originalContent,this.params),originalContent,bom,encoding,lineEnding}}catch(error){if(error instanceof NotebookEditError){throw new StructuredToolError(error.message,error.type)}throw error}}async execute(signal){let prepared;try{prepared=await this.prepareEdit(signal)}catch(error){if(signal.aborted){throw error}const errorType=error instanceof StructuredToolError?error.errorType:"notebook_edit_failure";const message=error instanceof Error?error.message:String(error);return{llmContent:message,returnDisplay:`Error: ${message}`,error:{message,type:errorType}}}const teamMemoryError=checkTeamMemorySecrets(this.params.notebook_path,prepared.updatedContent,this.config.getProjectRoot());if(teamMemoryError){return{llmContent:`[ERROR: ${teamMemoryError}]`,returnDisplay:teamMemoryError,error:{message:teamMemoryError,type:"invalid_tool_params"}}}try{try{await this.config.getFileHistoryService().trackEdit(this.params.notebook_path)}catch{}const writeDecision=await checkPriorNotebookRead(this.config,this.params.notebook_path,{expectExisting:true});if(!writeDecision.ok){return{llmContent:writeDecision.rawMessage,returnDisplay:`Error: ${writeDecision.displayMessage}`,error:{message:writeDecision.rawMessage,type:writeDecision.type}}}await this.config.getFileSystemService().writeTextFile({path:this.params.notebook_path,content:prepared.updatedContent,toolWriteOrigin:"notebook_edit",_meta:{bom:prepared.bom,encoding:prepared.encoding,lineEnding:prepared.lineEnding}});if(!this.modifyMetadata?.modifiedByUser){CommitAttributionService.getInstance().recordEdit(this.params.notebook_path,prepared.originalContent,prepared.updatedContent)}let postWriteSizeBytes;try{const postWriteStats=fs.statSync(this.params.notebook_path);postWriteSizeBytes=postWriteStats.size;const cache=this.config.getFileReadCache();if(prepared.requiresReadAfterWrite){cache.invalidate(postWriteStats)}else{cache.recordWrite(this.params.notebook_path,postWriteStats,{cacheable:false})}}catch(error){debugLogger.warn(`[NotebookEdit] post-write cache update failed for ${this.params.notebook_path}: ${error instanceof Error?error.message:String(error)}`)}const fileName=path.basename(this.params.notebook_path);const fileDiff=createPatchSmart(fileName,prepared.originalContent,prepared.updatedContent,"Current","Proposed");const diffStat=getDiffStat(fileName,prepared.originalContent,this.modifyMetadata?.aiProposedContent??prepared.updatedContent,prepared.updatedContent);logFileOperation(this.config,new FileOperationEvent(NotebookEditTool.Name,"update",prepared.updatedContent.split("\n").length,getSpecificMimeType(this.params.notebook_path),".ipynb",prepared.language));const displayResult={fileDiff,fileName,filePath:this.params.notebook_path,originalContent:prepared.originalContent,newContent:prepared.updatedContent,diffStat};const artifact=buildWorkspaceArtifactCandidate(this.config,this.params.notebook_path,{recordAsArtifact:this.params.record_as_artifact,sizeBytes:postWriteSizeBytes});const reminder=artifact&&!artifact.updateOnly?` ${formatRecordArtifactReminder(artifact.workspacePath)}`:"";const llmContent=this.modifyMetadata?.modifiedNotebookContent!==void 0?`Notebook ${this.params.notebook_path} has been updated.${reminder} Notebook content was modified by the user before approval; the final saved notebook may differ from the original ${prepared.mode} cell ${prepared.editedCellId} proposal.`:`Notebook ${this.params.notebook_path} has been updated.${reminder} ${prepared.mode} cell ${prepared.editedCellId}.${prepared.mode==="delete"?"":`
|
|
3
|
+
import{checkTeamMemorySecrets}from"./chunk-UJP2MPBI.js";import{buildWorkspaceArtifactCandidate,formatRecordArtifactReminder}from"./chunk-AKWYMQKU.js";import{CommitAttributionService,createPatchSmart,detectLineEnding,getDiffStat}from"./chunk-7XQ5D34E.js";import{backgroundFixHolding}from"./chunk-YVD4O5ZB.js";import{getCurrentAgentId}from"./chunk-YZFNBUKG.js";import{FileOperationEvent,logFileOperation}from"./chunk-ZWPSBU7K.js";import{findCellIndex,getCellDisplayId,getNotebookLanguage,getSpecificMimeType,hasStableCellIds,inferInsertedCellSourceArrayStyle,inferNotebookJsonFormat,isAmbiguousCellId,makeCellId,normalizeEditedCell,normalizeSource,parseNotebook,serializeNotebook,toNotebookSource}from"./chunk-Y6HHV4LC.js";import{BaseDeclarativeTool,BaseToolInvocation,StructuredToolError}from"./chunk-O5EKX7LG.js";import{ToolDisplayNames,ToolNames}from"./chunk-SBZFGYYS.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{makeRelative,shortenPath,unescapePath}from"./chunk-OKN3Z5C5.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs";import*as path from"node:path";var debugLogger=createDebugLogger("NOTEBOOK_EDIT");function rejectNotebookPriorRead(notebookPath,reason,decision){debugLogger.debug("prior-read-rejected",{path:notebookPath,reason,type:decision.type,displayMessage:decision.displayMessage});return decision}__name(rejectNotebookPriorRead,"rejectNotebookPriorRead");var NotebookEditError=class extends Error{constructor(message,type){super(message);this.type=type;this.name="NotebookEditError"}static{__name(this,"NotebookEditError")}};function requireNotebookSource(source,mode){if(mode==="delete"){return""}if(typeof source!=="string"){throw new NotebookEditError(`new_source is required when edit_mode is "${mode}".`,"invalid_tool_params")}return source}__name(requireNotebookSource,"requireNotebookSource");function displayCellId(cell,index){return cell?getCellDisplayId(cell,index):`cell-${index}`}__name(displayCellId,"displayCellId");function resolveTargetIndex(notebook,cellId,mode){if(!cellId){if(mode==="insert"){return-1}throw new NotebookEditError("cell_id is required for replace and delete operations.","invalid_tool_params")}if(isAmbiguousCellId(notebook,cellId)){throw new NotebookEditError(`Cell ID "${cellId}" is ambiguous in the rendered notebook. Re-read the notebook and target a stable real cell ID before editing.`,"invalid_tool_params")}const index=findCellIndex(notebook,cellId);if(index===-1){throw new NotebookEditError(`Cell with ID "${cellId}" not found in notebook.`,"notebook_cell_not_found")}return index}__name(resolveTargetIndex,"resolveTargetIndex");function createNotebookCell(notebook,cellType,source,preferSourceArray){const cell={cell_type:cellType,metadata:{},source:toNotebookSource(source,preferSourceArray)};const id=makeCellId(notebook);if(id){cell.id=id}normalizeEditedCell(cell,cellType);return cell}__name(createNotebookCell,"createNotebookCell");function applyNotebookEdit(rawContent,params){let notebook;try{notebook=parseNotebook(rawContent)}catch(error){throw new NotebookEditError(error instanceof Error?error.message:String(error),"notebook_invalid_json")}const mode=params.edit_mode??"replace";const source=requireNotebookSource(params.new_source,mode);const originalHasStableCellIds=hasStableCellIds(notebook);const targetIndex=resolveTargetIndex(notebook,params.cell_id,mode);const language=getNotebookLanguage(notebook);const jsonFormat=inferNotebookJsonFormat(rawContent);const buildResult=__name((updatedNotebook,result)=>{const structuralEdit=mode==="insert"||mode==="delete";return{...result,updatedContent:serializeNotebook(updatedNotebook,jsonFormat),requiresReadAfterWrite:structuralEdit&&!(originalHasStableCellIds&&hasStableCellIds(updatedNotebook))}},"buildResult");switch(mode){case"insert":{const cellType=params.cell_type??"code";const insertAt=targetIndex===-1?0:targetIndex+1;const newCell=createNotebookCell(notebook,cellType,source,inferInsertedCellSourceArrayStyle(notebook,insertAt));notebook.cells.splice(insertAt,0,newCell);return buildResult(notebook,{editedCellId:displayCellId(newCell,insertAt),editedCellType:cellType,language,mode})}case"delete":{const[removed]=notebook.cells.splice(targetIndex,1);return buildResult(notebook,{editedCellId:displayCellId(removed,targetIndex),editedCellType:removed?.cell_type,language,mode})}case"replace":{const target=notebook.cells[targetIndex];if(!target){throw new NotebookEditError(`Cell index ${targetIndex} is out of range.`,"notebook_cell_not_found")}const finalType=params.cell_type??target.cell_type;target.source=toNotebookSource(source,Array.isArray(target.source));normalizeEditedCell(target,finalType);return buildResult(notebook,{editedCellId:displayCellId(target,targetIndex),editedCellType:finalType,language,mode})}default:throw new NotebookEditError(`Unsupported notebook edit mode: ${mode}`,"invalid_tool_params")}}__name(applyNotebookEdit,"applyNotebookEdit");function prepareModifiedNotebookContent(originalContent,modifiedContent,params){let notebook;let originalNotebook;try{notebook=parseNotebook(modifiedContent);originalNotebook=parseNotebook(originalContent)}catch(error){throw new NotebookEditError(error instanceof Error?error.message:String(error),"notebook_invalid_json")}return{updatedContent:modifiedContent,editedCellId:params.cell_id??"user-modified-notebook",editedCellType:void 0,language:getNotebookLanguage(notebook),mode:params.edit_mode??"replace",requiresReadAfterWrite:!hasStableCellIds(originalNotebook)||!hasStableCellIds(notebook)}}__name(prepareModifiedNotebookContent,"prepareModifiedNotebookContent");async function checkPriorNotebookRead(config,notebookPath,options={}){if(config.getFileReadCacheDisabled()){return{ok:true}}let stats;try{stats=await fs.promises.stat(notebookPath)}catch(error){const code=error?.code;if(code==="ENOENT"){if(options.expectExisting){return rejectNotebookPriorRead(notebookPath,"missing-after-read",{ok:false,type:"file_changed_since_read",rawMessage:`Notebook ${notebookPath} disappeared after it was read. Re-read it with the ${ToolNames.READ_FILE} tool before editing it.`,displayMessage:`notebook disappeared after last read; re-run ${ToolNames.READ_FILE} first.`})}return{ok:true}}return rejectNotebookPriorRead(notebookPath,"stat-failed",{ok:false,type:"prior_read_verification_failed",rawMessage:`Could not stat ${notebookPath} to verify prior notebook read (${code??"unknown error"}). Re-read it with the ${ToolNames.READ_FILE} tool before editing it.`,displayMessage:`cannot verify prior read of ${notebookPath}; re-run ${ToolNames.READ_FILE} before editing this notebook.`})}if(stats.isDirectory()){return rejectNotebookPriorRead(notebookPath,"target-is-directory",{ok:false,type:"target_is_directory",rawMessage:`${notebookPath} is a directory. The NotebookEdit tool only operates on .ipynb files.`,displayMessage:"path is a directory; cannot edit as a notebook."})}if(!stats.isFile()){return rejectNotebookPriorRead(notebookPath,"target-not-regular-file",{ok:false,type:"target_not_regular_file",rawMessage:`${notebookPath} is not a regular file. The NotebookEdit tool only operates on .ipynb files.`,displayMessage:"special file; cannot edit as a notebook."})}const status=config.getFileReadCache().check(stats);if(status.state==="fresh"&&status.entry.lastReadAt!==void 0&&status.entry.lastReadWasFull){return{ok:true}}if(status.state==="fresh"&&status.entry.lastReadAt!==void 0&&!status.entry.lastReadWasFull){return rejectNotebookPriorRead(notebookPath,"truncated-cache-entry",{ok:false,type:"edit_requires_prior_read",rawMessage:`Notebook ${notebookPath} is too large for cell-level editing because its rendered output was truncated when read. Reduce the notebook output size or split the notebook before editing cells.`,displayMessage:"notebook too large for cell-level editing."})}if(status.state==="stale"){return rejectNotebookPriorRead(notebookPath,"stale-cache-entry",{ok:false,type:"file_changed_since_read",rawMessage:`Notebook ${notebookPath} has been modified since you last read it. Re-read it with the ${ToolNames.READ_FILE} tool before editing it.`,displayMessage:`notebook changed since last read; re-run ${ToolNames.READ_FILE} first.`})}if(status.state==="unverifiable"){return rejectNotebookPriorRead(notebookPath,"unverifiable-cache-entry",{ok:false,type:"prior_read_verification_failed",rawMessage:`Notebook ${notebookPath} is on a filesystem that does not provide a verifiable inode identity (ino=0), so NotebookEdit cannot safely confirm a prior read. Use a different mechanism to edit this notebook.`,displayMessage:`cannot verify prior read of ${notebookPath}; use a different mechanism to edit it.`})}return rejectNotebookPriorRead(notebookPath,`cache-${status.state}`,{ok:false,type:"edit_requires_prior_read",rawMessage:`Notebook ${notebookPath} has not been fully read in this session. Use the ${ToolNames.READ_FILE} tool first, without offset or limit, before editing cells.`,displayMessage:`${ToolNames.READ_FILE} required before editing this notebook.`})}__name(checkPriorNotebookRead,"checkPriorNotebookRead");var NotebookEditInvocation=class extends BaseToolInvocation{constructor(config,params,modifyMetadata){super(params);this.config=config;this.modifyMetadata=modifyMetadata}static{__name(this,"NotebookEditInvocation")}toolLocations(){return[{path:this.params.notebook_path}]}getDescription(){const relativePath=makeRelative(this.params.notebook_path,this.config.getTargetDir());const mode=this.params.edit_mode??"replace";const cell=this.params.cell_id??"beginning";return`${mode} notebook cell ${cell} in ${shortenPath(relativePath)}`}async getDefaultPermission(){return"ask"}requiresUserInteraction(){return backgroundFixHolding(this.params.notebook_path,getCurrentAgentId())!==void 0}async getConfirmationDetails(abortSignal){const prepared=await this.prepareEdit(abortSignal);const fileName=path.basename(this.params.notebook_path);const fileDiff=createPatchSmart(fileName,prepared.originalContent,prepared.updatedContent,"Current","Proposed");const confirmationDetails={type:"edit",title:`Confirm Notebook Edit: ${shortenPath(makeRelative(this.params.notebook_path,this.config.getTargetDir()))}`,fileName,filePath:this.params.notebook_path,fileDiff,originalContent:prepared.originalContent,newContent:prepared.updatedContent,onConfirm:__name(async outcome=>{if(outcome==="proceed_always"){this.config.setApprovalMode("auto-edit")}},"onConfirm")};return confirmationDetails}async prepareEdit(abortSignal){const preDecision=await checkPriorNotebookRead(this.config,this.params.notebook_path);if(!preDecision.ok){throw new StructuredToolError(preDecision.rawMessage,preDecision.type)}let originalContent;let bom=false;let encoding;let lineEnding="lf";try{const fileInfo=await this.config.getFileSystemService().readTextFile({path:this.params.notebook_path});originalContent=fileInfo.content;bom=fileInfo._meta?.bom??false;encoding=fileInfo._meta?.encoding;lineEnding=fileInfo._meta?.lineEnding??detectLineEnding(fileInfo.content)}catch(error){if(abortSignal.aborted){throw error}const code=error?.code;if(code==="ENOENT"){throw new StructuredToolError(`Notebook file not found: ${this.params.notebook_path}`,"file_not_found")}throw new StructuredToolError(`Error reading notebook: ${error instanceof Error?error.message:String(error)}`,"read_content_failure")}const postDecision=await checkPriorNotebookRead(this.config,this.params.notebook_path,{expectExisting:true});if(!postDecision.ok){throw new StructuredToolError(postDecision.rawMessage,postDecision.type)}try{if(this.modifyMetadata?.modifiedNotebookContent!==void 0){return{...prepareModifiedNotebookContent(originalContent,this.modifyMetadata.modifiedNotebookContent,this.params),originalContent,bom,encoding,lineEnding}}return{...applyNotebookEdit(originalContent,this.params),originalContent,bom,encoding,lineEnding}}catch(error){if(error instanceof NotebookEditError){throw new StructuredToolError(error.message,error.type)}throw error}}async execute(signal){let prepared;try{prepared=await this.prepareEdit(signal)}catch(error){if(signal.aborted){throw error}const errorType=error instanceof StructuredToolError?error.errorType:"notebook_edit_failure";const message=error instanceof Error?error.message:String(error);return{llmContent:message,returnDisplay:`Error: ${message}`,error:{message,type:errorType}}}const teamMemoryError=checkTeamMemorySecrets(this.params.notebook_path,prepared.updatedContent,this.config.getProjectRoot());if(teamMemoryError){return{llmContent:`[ERROR: ${teamMemoryError}]`,returnDisplay:teamMemoryError,error:{message:teamMemoryError,type:"invalid_tool_params"}}}try{try{await this.config.getFileHistoryService().trackEdit(this.params.notebook_path)}catch{}const writeDecision=await checkPriorNotebookRead(this.config,this.params.notebook_path,{expectExisting:true});if(!writeDecision.ok){return{llmContent:writeDecision.rawMessage,returnDisplay:`Error: ${writeDecision.displayMessage}`,error:{message:writeDecision.rawMessage,type:writeDecision.type}}}await this.config.getFileSystemService().writeTextFile({path:this.params.notebook_path,content:prepared.updatedContent,toolWriteOrigin:"notebook_edit",_meta:{bom:prepared.bom,encoding:prepared.encoding,lineEnding:prepared.lineEnding}});if(!this.modifyMetadata?.modifiedByUser){CommitAttributionService.getInstance().recordEdit(this.params.notebook_path,prepared.originalContent,prepared.updatedContent)}let postWriteSizeBytes;try{const postWriteStats=fs.statSync(this.params.notebook_path);postWriteSizeBytes=postWriteStats.size;const cache=this.config.getFileReadCache();if(prepared.requiresReadAfterWrite){cache.invalidate(postWriteStats)}else{cache.recordWrite(this.params.notebook_path,postWriteStats,{cacheable:false})}}catch(error){debugLogger.warn(`[NotebookEdit] post-write cache update failed for ${this.params.notebook_path}: ${error instanceof Error?error.message:String(error)}`)}const fileName=path.basename(this.params.notebook_path);const fileDiff=createPatchSmart(fileName,prepared.originalContent,prepared.updatedContent,"Current","Proposed");const diffStat=getDiffStat(fileName,prepared.originalContent,this.modifyMetadata?.aiProposedContent??prepared.updatedContent,prepared.updatedContent);logFileOperation(this.config,new FileOperationEvent(NotebookEditTool.Name,"update",prepared.updatedContent.split("\n").length,getSpecificMimeType(this.params.notebook_path),".ipynb",prepared.language));const displayResult={fileDiff,fileName,filePath:this.params.notebook_path,originalContent:prepared.originalContent,newContent:prepared.updatedContent,diffStat};const artifact=buildWorkspaceArtifactCandidate(this.config,this.params.notebook_path,{recordAsArtifact:this.params.record_as_artifact,sizeBytes:postWriteSizeBytes});const reminder=artifact&&!artifact.updateOnly?` ${formatRecordArtifactReminder(artifact.workspacePath)}`:"";const llmContent=this.modifyMetadata?.modifiedNotebookContent!==void 0?`Notebook ${this.params.notebook_path} has been updated.${reminder} Notebook content was modified by the user before approval; the final saved notebook may differ from the original ${prepared.mode} cell ${prepared.editedCellId} proposal.`:`Notebook ${this.params.notebook_path} has been updated.${reminder} ${prepared.mode} cell ${prepared.editedCellId}.${prepared.mode==="delete"?"":`
|
|
4
4
|
|
|
5
5
|
Updated source:
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Force strict mode and setup for ESM
|
|
2
2
|
"use strict";
|
|
3
|
-
import{require_source}from"./chunk-D2NY7HVY.js";import{loadSettings}from"./chunk-
|
|
3
|
+
import{require_source}from"./chunk-D2NY7HVY.js";import{loadSettings}from"./chunk-EZPM4DLR.js";import{getCurrentLanguage,t}from"./chunk-NO7VTKRL.js";import{isWorkspaceTrusted}from"./chunk-4CE4GMDL.js";import{ExtensionManager,getExtensionDescription,getExtensionDisplayName,require_prompts}from"./chunk-7XQ5D34E.js";import{resolveExtensionTelemetryProxy,resolveUsageStatisticsEnabled}from"./chunk-HW6AWS7W.js";import{stripAnsi}from"./chunk-YGLM5XPP.js";import{redactUrlCredentials}from"./chunk-3XVPZY7X.js";import{writeStdoutLine}from"./chunk-M4ECEHLX.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();var import_chalk=__toESM(require_source(),1);var import_prompts=__toESM(require_prompts(),1);async function requestConsentNonInteractive(consentDescription){writeStdoutLine(consentDescription);const result=await promptForConsentNonInteractive(t("Do you want to continue? [Y/n]: "));return result}__name(requestConsentNonInteractive,"requestConsentNonInteractive");async function requestChoicePluginNonInteractive(marketplace){const plugins=marketplace.plugins;if(plugins.length===0){throw new Error(t("No plugins available in this marketplace."))}const choices=plugins.map(plugin=>({title:import_chalk.default.green(import_chalk.default.bold(`[${plugin.name}]`)),value:plugin.name}));const response=await(0,import_prompts.default)({type:"select",name:"plugin",message:t('Select a plugin to install from marketplace "{{name}}":',{name:marketplace.name}),choices,initial:0});if(response.plugin===void 0){throw new Error(t("Plugin selection cancelled."))}return response.plugin}__name(requestChoicePluginNonInteractive,"requestChoicePluginNonInteractive");async function requestConsentInteractive(consentDescription,addExtensionUpdateConfirmationRequest){return promptForConsentInteractive(consentDescription+"\n\n"+t("Do you want to continue?"),addExtensionUpdateConfirmationRequest)}__name(requestConsentInteractive,"requestConsentInteractive");async function promptForConsentNonInteractive(prompt){const readline=await import("node:readline");const rl=readline.createInterface({input:process.stdin,output:process.stdout});return new Promise(resolve=>{rl.question(prompt,answer=>{rl.close();resolve(["y",""].includes(answer.trim().toLowerCase()))})})}__name(promptForConsentNonInteractive,"promptForConsentNonInteractive");async function promptForConsentInteractive(prompt,addExtensionUpdateConfirmationRequest){return new Promise(resolve=>{addExtensionUpdateConfirmationRequest({prompt,onConfirm:__name(resolvedConfirmed=>{resolve(resolvedConfirmed)},"onConfirm")})})}__name(promptForConsentInteractive,"promptForConsentInteractive");function extensionConsentString(extensionConfig,commands=[],skills=[],subagents=[],originSource="QwenCode",workflows=[]){const output=[];if(originSource!=="QwenCode"&&originSource!=="AgentPlugins"){output.push(t("You are installing an extension from {{originSource}}. Some features may not work perfectly with Qwen Code.",{originSource}))}const mcpServerEntries=Object.entries(extensionConfig.mcpServers||{});const displayLabel=extensionConfig.displayName??extensionConfig.name;output.push(t('Installing extension "{{name}}".',{name:displayLabel}));if(typeof extensionConfig.description==="string"&&extensionConfig.description){output.push(stripAnsi(extensionConfig.description))}output.push(t("**Extensions may introduce unexpected behavior. Ensure you have investigated the extension source and trust the author.**"));if(mcpServerEntries.length){output.push(t("This extension will run the following MCP servers:"));for(const[key,mcpServer]of mcpServerEntries){const isLocal=!!mcpServer.command;const source=mcpServer.httpUrl??`${mcpServer.command||""}${mcpServer.args?" "+mcpServer.args.join(" "):""}`;output.push(` * ${key} (${isLocal?t("local"):t("remote")}): ${source}`)}}if(commands&&commands.length>0){output.push(t("This extension will add the following commands: {{commands}}.",{commands:commands.join(", ")}))}if(extensionConfig.contextFileName){const fileName=Array.isArray(extensionConfig.contextFileName)?extensionConfig.contextFileName.join(", "):extensionConfig.contextFileName;output.push(t("This extension will append info to your QWEN.md context using {{fileName}}",{fileName}))}if(skills.length>0){output.push(t("This extension will install the following skills:"));for(const skill of skills){output.push(` * ${import_chalk.default.bold(skill.name)}: ${skill.description}`)}}if(subagents.length>0){output.push(t("This extension will install the following subagents:"));for(const subagent of subagents){output.push(` * ${import_chalk.default.bold(subagent.name)}: ${subagent.description}`)}}if(workflows.length>0){output.push(t("This extension will install the following workflows (JavaScript scripts that can start subagents):"));for(const workflow of workflows){const description=stripAnsi(workflow.description).replace(/\s+/g," ");output.push(` * ${import_chalk.default.bold(workflow.name)}: ${description}`)}}return output.join("\n")}__name(extensionConsentString,"extensionConsentString");function changedWorkflowScripts(workflows,previousWorkflows){const previousDigests=new Map(previousWorkflows.map(workflow=>[workflow.name,workflow.contentDigest]));return workflows.filter(workflow=>{const previous=previousDigests.get(workflow.name);return previous!==void 0&&previous!==workflow.contentDigest}).map(workflow=>workflow.name)}__name(changedWorkflowScripts,"changedWorkflowScripts");var requestConsentOrFail=__name(async(requestConsent,options)=>{if(!options)return;const{extensionConfig,originSource="QwenCode",commands=[],skills=[],subagents=[],workflows=[],previousExtensionConfig,previousCommands=[],previousSkills=[],previousSubagents=[],previousWorkflows=[]}=options;const extensionConsent=extensionConsentString(extensionConfig,commands,skills,subagents,originSource,workflows);const changedScripts=previousExtensionConfig?changedWorkflowScripts(workflows,previousWorkflows):[];if(previousExtensionConfig){const previousExtensionConsent=extensionConsentString(previousExtensionConfig,previousCommands,previousSkills,previousSubagents,originSource,previousWorkflows);if(previousExtensionConsent===extensionConsent&&changedScripts.length===0){return}}const consent=changedScripts.length>0?`${extensionConsent}
|
|
4
4
|
${t("These workflow scripts changed since the installed version: {{names}}.",{names:changedScripts.join(", ")})}`:extensionConsent;if(!await requestConsent(consent)){throw new Error(t('Installation cancelled for "{{name}}".',{name:extensionConfig.name}))}},"requestConsentOrFail");var import_chalk2=__toESM(require_source(),1);import*as os from"node:os";async function getExtensionManager(){const workspaceDir=process.cwd();const settings=loadSettings(workspaceDir).merged;const extensionManager=new ExtensionManager({workspaceDir,locale:getCurrentLanguage(),requestConsent:requestConsentOrFail.bind(null,requestConsentNonInteractive),requestChoicePlugin:requestChoicePluginNonInteractive,isWorkspaceTrusted:isWorkspaceTrusted(settings).isTrusted??true,usageStatisticsEnabled:resolveUsageStatisticsEnabled(settings.privacy?.usageStatisticsEnabled),proxy:resolveExtensionTelemetryProxy(settings.proxy)});await extensionManager.refreshCache();return extensionManager}__name(getExtensionManager,"getExtensionManager");var EXTENSION_COMMAND_SCOPES=["User","Workspace"];function extensionCommandScopesList(){return EXTENSION_COMMAND_SCOPES.map(s=>s.toLowerCase()).join(", ")}__name(extensionCommandScopesList,"extensionCommandScopesList");function resolveExtensionCommandScope(scope){if(!scope){return"User"}const normalized=scope.toLowerCase();const matched=EXTENSION_COMMAND_SCOPES.find(candidate=>candidate.toLowerCase()===normalized);if(matched){return matched}throw new Error(t("Invalid scope: {{scope}}. Please use one of {{scopes}}.",{scope,scopes:extensionCommandScopesList()}))}__name(resolveExtensionCommandScope,"resolveExtensionCommandScope");function extensionToOutputString(extension,extensionManager,workspaceDir,inline=false){const cwd=workspaceDir;const userEnabled=extensionManager.isEnabled(extension.config.name,os.homedir());const workspaceEnabled=extensionManager.isEnabled(extension.config.name,cwd);const status=workspaceEnabled?import_chalk2.default.green("\u2713"):import_chalk2.default.red("\u2717");const locale=getCurrentLanguage();const displayLabel=getExtensionDisplayName(extension,locale);let output=`${inline?"":status} ${displayLabel} (${extension.config.version})`;const desc=getExtensionDescription(extension,locale);if(desc){output+=`
|
|
5
5
|
${t("Description:")} ${stripAnsi(desc)}`}output+=`
|
|
6
6
|
${t("Path:")} ${extension.path}`;if(extension.installMetadata){output+=`
|