gerege-cli 0.26.6 → 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-QCIXIS4P.js → MaxSizedBox-LUINLOQW.js} +1 -1
- package/chunks/{StandaloneSessionPicker-BAFAIRT7.js → StandaloneSessionPicker-B7N4QO5D.js} +1 -1
- package/chunks/{acp-subagent-executor-TPVXURLW.js → acp-subagent-executor-J6H6FKUT.js} +1 -1
- package/chunks/{acpAgent-67UN66PB.js → acpAgent-XG6SM2VU.js} +3 -3
- package/chunks/{advisor-SAXMI4QZ.js → advisor-SZVPQNPA.js} +1 -1
- package/chunks/{agent-KV7BXY6C.js → agent-N7QF7BJS.js} +1 -1
- package/chunks/{agent-headless-FQX3JGG6.js → agent-headless-GLP5GUEX.js} +1 -1
- package/chunks/{agent-host-client-L5EHC4AC.js → agent-host-client-H4VOB3M6.js} +1 -1
- package/chunks/{agent-host-connections-EDBMCVQF.js → agent-host-connections-E4C3OC4M.js} +1 -1
- package/chunks/{anthropicContentGenerator-V7TX2NXP.js → anthropicContentGenerator-5VTWQLT5.js} +1 -1
- package/chunks/{autofix-pr-WP34NYHL.js → autofix-pr-HDYQDJS4.js} +1 -1
- package/chunks/{batch-XFVQ4BLM.js → batch-3CRVN5VJ.js} +1 -1
- package/chunks/{bridge-AE7AFEXB.js → bridge-NZ6WVBLQ.js} +1 -1
- package/chunks/{channel-settings-store-X63P5OVT.js → channel-settings-store-Z7I2JI6M.js} +1 -1
- package/chunks/{chunk-BCI62WSL.js → chunk-236DHGNH.js} +1 -1
- package/chunks/{chunk-JRTOPEM3.js → chunk-2M3ND5WN.js} +1 -1
- package/chunks/{chunk-LBLLWAKK.js → chunk-36A6EXHB.js} +1 -1
- package/chunks/{chunk-H3IR3GIE.js → chunk-3ANIQTDT.js} +1 -1
- package/chunks/{chunk-GSPGIGO5.js → chunk-3QTR2HAE.js} +3 -3
- package/chunks/{chunk-32XHDDIA.js → chunk-3TTHYXT3.js} +1 -1
- package/chunks/{chunk-MTDBCIDA.js → chunk-4CE4GMDL.js} +1 -1
- package/chunks/{chunk-T2YTHAJW.js → chunk-4FVT657Y.js} +1 -1
- package/chunks/{chunk-CGDFZEER.js → chunk-4HSISRRA.js} +1 -1
- package/chunks/{chunk-7453BHJO.js → chunk-4SZUJ5RT.js} +1 -1
- package/chunks/{chunk-B37YY4XU.js → chunk-57D2OB3I.js} +1 -1
- package/chunks/{chunk-WGFX3EL3.js → chunk-5FGBLIXB.js} +1 -1
- package/chunks/{chunk-I6PUY2T3.js → chunk-5HX2QGVR.js} +1 -1
- package/chunks/{chunk-BPFFRPWE.js → chunk-5ZNXAWOG.js} +6 -6
- package/chunks/{chunk-BHIDG6VZ.js → chunk-6CKX56LJ.js} +1 -1
- package/chunks/{chunk-GRAECADD.js → chunk-6NIQFWXP.js} +1 -1
- package/chunks/{chunk-ELDZ4MNL.js → chunk-6PC6MZHL.js} +1 -1
- package/chunks/{chunk-FEP6W4NJ.js → chunk-6VQKGKMJ.js} +1 -1
- package/chunks/{chunk-GBSRWT7J.js → chunk-6ZEMLEK2.js} +1 -1
- package/chunks/{chunk-4NDJKNN6.js → chunk-72VY2PJA.js} +1 -1
- package/chunks/{chunk-BAUMVH4Q.js → chunk-75I3NYBD.js} +1 -1
- package/chunks/{chunk-YH2XRWRF.js → chunk-76L7ZDEK.js} +1 -1
- package/chunks/{chunk-2JGTWRZJ.js → chunk-7XQ5D34E.js} +6 -6
- package/chunks/{chunk-DA6LOBSB.js → chunk-AYX75VXG.js} +1 -1
- package/chunks/{chunk-G6DALGGS.js → chunk-BBDFEMCF.js} +1 -1
- package/chunks/{chunk-VD2GSW64.js → chunk-BOTX7S66.js} +1 -1
- package/chunks/{chunk-M6KB5RVD.js → chunk-CY2QKKZA.js} +1 -1
- package/chunks/{chunk-HTAUIJB4.js → chunk-D5JWQUID.js} +1 -1
- package/chunks/{chunk-P3JEEDQZ.js → chunk-DMIPB7RZ.js} +1 -1
- package/chunks/{chunk-CF6SZJNP.js → chunk-DSKA3P2C.js} +1 -1
- package/chunks/{chunk-LTE4N6L3.js → chunk-DVC65H4X.js} +1 -1
- package/chunks/{chunk-W5Z4BWWA.js → chunk-DVJSDCMX.js} +1 -1
- package/chunks/{chunk-65ME4BOH.js → chunk-E6CPFQX2.js} +1 -1
- package/chunks/{chunk-JEDL4IKF.js → chunk-EIFBGEXJ.js} +1 -1
- package/chunks/{chunk-AYVCT5FF.js → chunk-EQOHDAYU.js} +1 -1
- package/chunks/{chunk-2TAJ5STJ.js → chunk-EZPM4DLR.js} +1 -1
- package/chunks/{chunk-JWNKPINR.js → chunk-F6U6T7QD.js} +1 -1
- package/chunks/{chunk-ET5M5WFN.js → chunk-FCGFBUHS.js} +1 -1
- package/chunks/{chunk-OU7CEG7Q.js → chunk-G2LTZU67.js} +1 -1
- package/chunks/{chunk-2N3NBTYJ.js → chunk-GMJSEK4V.js} +1 -1
- package/chunks/{chunk-NA4ZF2FE.js → chunk-HJMUBVXZ.js} +2 -2
- package/chunks/{chunk-AFO5ER23.js → chunk-HQZTAA2U.js} +1 -1
- package/chunks/{chunk-OK7LBM5G.js → chunk-I63TIQOI.js} +1 -1
- package/chunks/{chunk-OJ4K62S2.js → chunk-I65LBJN7.js} +1 -1
- package/chunks/{chunk-GHIFIXNX.js → chunk-IBDOC27R.js} +1 -1
- package/chunks/{chunk-2LWJGXTW.js → chunk-IKF2HWEV.js} +1 -1
- package/chunks/{chunk-AEZYXPFS.js → chunk-K6NS2HXT.js} +1 -1
- package/chunks/{chunk-T5DKF33F.js → chunk-KTRNYPQP.js} +1 -1
- package/chunks/{chunk-SKGJ26HQ.js → chunk-L3ANU5JZ.js} +1 -1
- package/chunks/{chunk-U3Q72OGV.js → chunk-LKPMADUO.js} +1 -1
- package/chunks/{chunk-MYV7GY3H.js → chunk-M56Y2B6N.js} +1 -1
- package/chunks/{chunk-34HC2AXI.js → chunk-N5KRBAK5.js} +2 -2
- package/chunks/{chunk-EXIFPXMB.js → chunk-NA2WJPOU.js} +1 -1
- package/chunks/{chunk-7RNOS7R4.js → chunk-NGOWLXYK.js} +1 -1
- package/chunks/{chunk-IZ5MWA6E.js → chunk-NL7P73ZP.js} +1 -1
- package/chunks/{chunk-FYBJGRX7.js → chunk-NS3QR7D3.js} +1 -1
- package/chunks/{chunk-XISR37DQ.js → chunk-O5JCCBMQ.js} +1 -1
- package/chunks/{chunk-FKL3V5BO.js → chunk-OOKFFZHF.js} +1 -1
- package/chunks/{chunk-VRKYBH5G.js → chunk-OTYPLLMT.js} +5 -5
- package/chunks/{chunk-W66WWTOP.js → chunk-P7NHWX27.js} +1 -1
- package/chunks/{chunk-AEKEZRIU.js → chunk-PC5QZUKR.js} +1 -1
- package/chunks/{chunk-NEKPQLFY.js → chunk-PS7MQL57.js} +2 -2
- package/chunks/{chunk-TB4AUC2L.js → chunk-PXWHOFAA.js} +1 -1
- package/chunks/{chunk-OOJ2AQT3.js → chunk-Q65LVCDR.js} +1 -1
- package/chunks/{chunk-EFIRES46.js → chunk-QDUDLELH.js} +1 -1
- package/chunks/{chunk-KZNYALFU.js → chunk-QF22ILPV.js} +1 -1
- package/chunks/{chunk-MGATL4OA.js → chunk-QW7MAG2E.js} +1 -1
- package/chunks/{chunk-KJGRCIVY.js → chunk-RXK6XD6F.js} +1 -1
- package/chunks/{chunk-W2RQIZ6B.js → chunk-SVDFCWS7.js} +1 -1
- package/chunks/{chunk-P62S5JGM.js → chunk-TKP3GAUI.js} +1 -1
- package/chunks/{chunk-BQZF3UKI.js → chunk-TUS74LFI.js} +1 -1
- package/chunks/{chunk-JH3V5SPA.js → chunk-U7YGHPSL.js} +1 -1
- package/chunks/{chunk-NONBHCXP.js → chunk-UB37RBSK.js} +1 -1
- package/chunks/{chunk-T53VMDXH.js → chunk-UK5SIRH4.js} +1 -1
- package/chunks/{chunk-3W32X2DH.js → chunk-UTTSBCFR.js} +1 -1
- package/chunks/{chunk-RSLTOIG5.js → chunk-UYV4ZVXY.js} +2 -2
- package/chunks/{chunk-FKZ46GKL.js → chunk-VC3JJL7E.js} +1 -1
- package/chunks/{chunk-SP6CQ3MO.js → chunk-VKWVIWLK.js} +1 -1
- package/chunks/{chunk-N7PWZBXV.js → chunk-VUI6STKU.js} +1 -1
- package/chunks/{chunk-5EXL4TKQ.js → chunk-W3YXE55M.js} +1 -1
- package/chunks/{chunk-NVOI6UDQ.js → chunk-WAIPC47V.js} +1 -1
- package/chunks/{chunk-QDCUR3JB.js → chunk-WMJ6UHDP.js} +1 -1
- package/chunks/{chunk-CBE6ZIHU.js → chunk-WZU2ECUD.js} +1 -1
- package/chunks/{chunk-ZENMAISJ.js → chunk-XAGIZY2Y.js} +1 -1
- package/chunks/{chunk-RXN7DUMP.js → chunk-XGZYVULJ.js} +2 -2
- package/chunks/{chunk-HOG66S6K.js → chunk-XJIHDVPX.js} +1 -1
- package/chunks/{chunk-UKLXKJKL.js → chunk-XVDIHFRH.js} +1 -1
- package/chunks/{chunk-76FSYQTG.js → chunk-YMEW4TTT.js} +1 -1
- package/chunks/{chunk-EYPLBTMI.js → chunk-Z32URWBG.js} +1 -1
- package/chunks/{chunk-CUP2TNJK.js → chunk-Z6HRXHJP.js} +1 -1
- package/chunks/{chunk-MPVQDYPH.js → chunk-ZO4F6ZWR.js} +1 -1
- package/chunks/{codex-subagent-executor-OLMGVPVS.js → codex-subagent-executor-DDKYNU42.js} +1 -1
- package/chunks/{config-utils-OWY5G5Y2.js → config-utils-S7Z2ZZ2E.js} +1 -1
- package/chunks/{contextCommand-IXFUZH65.js → contextCommand-7F4PGV2A.js} +1 -1
- package/chunks/{core-runtime-O4LC4NY3.js → core-runtime-LBH3U7ZF.js} +1 -1
- package/chunks/{create-sub-session-6F7C3TMT.js → create-sub-session-56DS2T6L.js} +1 -1
- package/chunks/{cron-create-2422NBSJ.js → cron-create-PBP3C46Q.js} +1 -1
- package/chunks/{daemon-git-worktree-guard-EWPQA6NO.js → daemon-git-worktree-guard-WJS6FBDA.js} +1 -1
- package/chunks/{daemon-status-provider-FAHOXNFW.js → daemon-status-provider-UPPAEHJ6.js} +1 -1
- package/chunks/{daemon-trust-policy-L3DM6AI5.js → daemon-trust-policy-4Z5HSNUX.js} +1 -1
- package/chunks/{daemon-trust-policy-monitor-HNPY5KJ4.js → daemon-trust-policy-monitor-WFWDOYX3.js} +1 -1
- package/chunks/{deferred-core-runtime-JF42NQJK.js → deferred-core-runtime-MJYNEA4N.js} +1 -1
- package/chunks/{edit-E5LEI2LL.js → edit-U7TGKKK3.js} +1 -1
- package/chunks/{enterPlanMode-3COTUV5V.js → enterPlanMode-27HC5AXN.js} +1 -1
- package/chunks/{environment-XBBIB3VA.js → environment-PHWY6C4P.js} +1 -1
- package/chunks/{errors-LNMQ7TUK.js → errors-F2EYYFI3.js} +1 -1
- package/chunks/{execution-tool-QDDKJD2K.js → execution-tool-O4KJ5SMM.js} +1 -1
- package/chunks/{execution-worker-TXGZRZXE.js → execution-worker-AMFXZ7JD.js} +1 -1
- package/chunks/{exitPlanMode-Z7QEMWPE.js → exitPlanMode-LDYL43PB.js} +1 -1
- package/chunks/{fast-path-M6K2RACY.js → fast-path-HTODEVOR.js} +1 -1
- package/chunks/{glob-N2QT4U7U.js → glob-NKQJJZND.js} +1 -1
- package/chunks/{goal-tools-CUSQD3DG.js → goal-tools-47I455VV.js} +1 -1
- package/chunks/{handleAutoUpdate-QF2YQHF6.js → handleAutoUpdate-MJKTDJUO.js} +1 -1
- package/chunks/{i18n-AGOA6MUI.js → i18n-TCOB4TC5.js} +1 -1
- package/chunks/{initializer-FRKYDUSX.js → initializer-NLYOGZZS.js} +1 -1
- package/chunks/{installationInfo-OKA4WXAS.js → installationInfo-TF2RSJOG.js} +1 -1
- package/chunks/{interactive-mod-session-MWYN5IFK.js → interactive-mod-session-5F7R3KSA.js} +1 -1
- package/chunks/{list-DE7VUIR2.js → list-U2AEVLFP.js} +1 -1
- package/chunks/{llm-N3JGJHYC.js → llm-EV2QTQBU.js} +4 -4
- package/chunks/{llm-content-generator-VMUBA7OJ.js → llm-content-generator-ZXUSPPG2.js} +1 -1
- package/chunks/{loadedSettingsAdapter-5C36OZ7N.js → loadedSettingsAdapter-TLRI22X7.js} +1 -1
- package/chunks/{local-BE624O3A.js → local-ZTSBSKWV.js} +1 -1
- package/chunks/{local-execution-environment-OPGM7Y6L.js → local-execution-environment-F263PSIM.js} +1 -1
- package/chunks/{loggingContentGenerator-2MHAI6JR.js → loggingContentGenerator-2XHSIJQD.js} +1 -1
- package/chunks/{loop-wakeup-BDLATBXH.js → loop-wakeup-5ET3JHUT.js} +1 -1
- package/chunks/{manage-memory-BBCEIIWB.js → manage-memory-MJEQ47H2.js} +1 -1
- package/chunks/{managed-execution-engine-SRFALTCX.js → managed-execution-engine-ODPR5OEH.js} +1 -1
- package/chunks/{managed-local-serve-ICNAS3E6.js → managed-local-serve-S5R4Z5OL.js} +1 -1
- package/chunks/managed-npm-update-BUI5APGY.js +8 -0
- package/chunks/{managed-runtime-attestation-worker-ZRDWKXCI.js → managed-runtime-attestation-worker-BQP4E7LQ.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-6NTGZXQL.js → managed-runtime-bootstrap-SRBDFSKK.js} +1 -1
- package/chunks/{managed-runtime-session-worker-RKQBBFR6.js → managed-runtime-session-worker-UI23BTYJ.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-FCGV6FSW.js → managed-runtime-ssh-worker-HU4CIJRK.js} +1 -1
- package/chunks/{managed-session-authority-C7IW6TJX.js → managed-session-authority-XSSTLAEY.js} +1 -1
- package/chunks/{mcp-VC4CJPE5.js → mcp-WLHDOKP7.js} +1 -1
- package/chunks/{memory-S6OJA3ZD.js → memory-OUUHPSDD.js} +1 -1
- package/chunks/{model-call-collection-MJZWRQSU.js → model-call-collection-4A2EB76B.js} +1 -1
- package/chunks/{model-configuration-SKU6L3QI.js → model-configuration-4CGUFKEP.js} +1 -1
- package/chunks/{modelConfigUtils-TJCB6NXT.js → modelConfigUtils-HUEERWBA.js} +1 -1
- package/chunks/{monitor-M3PNLCYP.js → monitor-FXL5UNMP.js} +1 -1
- package/chunks/{nonInteractiveCli-MR7JLAWU.js → nonInteractiveCli-W7M2O43W.js} +1 -1
- package/chunks/{nonInteractiveToolExecutor-YKA6JMTY.js → nonInteractiveToolExecutor-EMLI363Q.js} +1 -1
- package/chunks/{notebook-edit-ENTFB5D7.js → notebook-edit-R5RSLSSH.js} +1 -1
- package/chunks/{omni-6YBX4R6K.js → omni-DNZGITTE.js} +1 -1
- package/chunks/{openaiContentGenerator-XRXX33FY.js → openaiContentGenerator-PKOPYMHR.js} +1 -1
- package/chunks/{openaiResponsesContentGenerator-L6ONEHMR.js → openaiResponsesContentGenerator-MHH2MF3V.js} +1 -1
- package/chunks/{pidfile-XR4JF2Z6.js → pidfile-5ZNJWMKG.js} +1 -1
- package/chunks/{processUtils-GQYNJRBJ.js → processUtils-JIHQDASW.js} +1 -1
- package/chunks/{prompt-terminal-ledger-7BM7YDLG.js → prompt-terminal-ledger-L3LZ5SLR.js} +1 -1
- package/chunks/{qwenContentGenerator-QSA32XEL.js → qwenContentGenerator-QCZL7HJJ.js} +1 -1
- package/chunks/{reactive-degrade-TFNBAAPZ.js → reactive-degrade-YUXOUQG4.js} +1 -1
- package/chunks/{read-file-VD7OFO2E.js → read-file-FBNU3AVX.js} +1 -1
- package/chunks/{resumeHistoryUtils-2B4KPI7G.js → resumeHistoryUtils-5FPRTI4A.js} +1 -1
- package/chunks/{review-C365WGCW.js → review-NLFYSNM3.js} +1 -1
- package/chunks/{ripGrep-D7WPMBXR.js → ripGrep-JUAPC5LD.js} +1 -1
- package/chunks/{run-qwen-serve-NZWQHWQA.js → run-qwen-serve-JP64UQ3Y.js} +1 -1
- package/chunks/{runtime-J6SPBSCS.js → runtime-D2QUYM6U.js} +1 -1
- package/chunks/{sandboxConfig-QS2XBPZG.js → sandboxConfig-7VZJQV6H.js} +1 -1
- package/chunks/{scheduled-tasks-YNNIOOPM.js → scheduled-tasks-PC6EH75E.js} +1 -1
- package/chunks/{scheduler-KCMSPHON.js → scheduler-RUV2FNDR.js} +1 -1
- package/chunks/{search-memory-EUBJ7IAV.js → search-memory-YJTJ7BRU.js} +1 -1
- package/chunks/{send-message-CWWZUPSK.js → send-message-EEEFFTHX.js} +1 -1
- package/chunks/{serve-4CB4BWJ5.js → serve-KMIZDYON.js} +1 -1
- package/chunks/{server-JNANUIGC.js → server-DUPK3V7B.js} +3 -3
- package/chunks/{session-3LQLXPUA.js → session-CW5YMFMP.js} +1 -1
- package/chunks/{session-attachments-root-BWIVWFHJ.js → session-attachments-root-5H5GFHLI.js} +1 -1
- package/chunks/{session-execution-engine-selector-5OLRX57L.js → session-execution-engine-selector-MVXM2HZW.js} +1 -1
- package/chunks/{session-pr-refresh-RLF3EXS3.js → session-pr-refresh-4UPONX4L.js} +1 -1
- package/chunks/{sessionService-U7ACD2HP.js → sessionService-GGCYISSL.js} +1 -1
- package/chunks/{settings-FTGWYTUH.js → settings-AASJCESS.js} +1 -1
- package/chunks/{shell-E4RENYQC.js → shell-V4WWLW3Q.js} +1 -1
- package/chunks/{skill-OLNPHRWB.js → skill-NDEBB7VX.js} +1 -1
- package/chunks/{skill-settings-R2BV2GEK.js → skill-settings-YAI3GYU5.js} +1 -1
- package/chunks/{spawnChannel-LOPAR5T2.js → spawnChannel-6JKVJAXZ.js} +1 -1
- package/chunks/{standalone-update-IGDX2RGN.js → standalone-update-NJP5OCKJ.js} +1 -1
- package/chunks/{start-opentui-ui-33QLBNRC.js → start-opentui-ui-M4B4SXRM.js} +1 -1
- package/chunks/{startInteractiveUI-RQKHD7MM.js → startInteractiveUI-O4JUDEAU.js} +1 -1
- package/chunks/{team-create-HAVKHNU5.js → team-create-NLJ7QBLD.js} +1 -1
- package/chunks/{team-plan-approval-7MCQX67C.js → team-plan-approval-XKYPVWNG.js} +1 -1
- package/chunks/{terminal-image-renderer-XT5JVEO6.js → terminal-image-renderer-47TD747D.js} +1 -1
- package/chunks/{theme-manager-DR5EYGLT.js → theme-manager-AANEBPLJ.js} +1 -1
- package/chunks/{tool-call-LZHZ5RVH.js → tool-call-ETH3LS7Y.js} +1 -1
- package/chunks/{tool-result-media-XCXCF4YC.js → tool-result-media-EFOEPAF2.js} +1 -1
- package/chunks/{tool-search-K6S3ON7M.js → tool-search-J3CF5PRN.js} +1 -1
- package/chunks/{total-session-admission-LGSS2VWS.js → total-session-admission-3DC52PLQ.js} +1 -1
- package/chunks/{trustedFolders-IIR2UZRL.js → trustedFolders-4KPWZZKB.js} +1 -1
- package/chunks/{update-relaunch-WVIFX5CN.js → update-relaunch-A67BS7QS.js} +1 -1
- package/chunks/{updateCheck-CMEWLLZJ.js → updateCheck-X623JRSY.js} +1 -1
- package/chunks/{upload-config-TCCFCNCD.js → upload-config-X2CR3F26.js} +1 -1
- package/chunks/{useAutoAcceptIndicator-5RTTH3OW.js → useAutoAcceptIndicator-INIOQGJH.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-AO336KDX.js → validateNonInterActiveAuth-XJ2U5CLB.js} +1 -1
- package/chunks/{version-JYWKKMNP.js → version-MFHRMM7W.js} +1 -1
- package/chunks/{web-fetch-HWTAWXFM.js → web-fetch-3GEJ62DH.js} +1 -1
- package/chunks/{web-search-HAI5LW3G.js → web-search-WJZO3Q3A.js} +1 -1
- package/chunks/{workflow-BZ2YFGF6.js → workflow-ML7ITCMH.js} +1 -1
- package/chunks/{workflow-ancestor-trust-26TFXFPO.js → workflow-ancestor-trust-M3VFMS73.js} +1 -1
- package/chunks/{workspace-agents-DLI4JQJZ.js → workspace-agents-YFZMV7EF.js} +1 -1
- package/chunks/{workspace-providers-status-64C7DJZU.js → workspace-providers-status-3COKLBCI.js} +1 -1
- package/chunks/{workspace-recovery-worker-IFRT3KKP.js → workspace-recovery-worker-QURA3WFZ.js} +1 -1
- package/chunks/{workspace-registration-store-MYKJM2SK.js → workspace-registration-store-F3AGIOBW.js} +1 -1
- package/chunks/{workspace-registry-GZJRONAY.js → workspace-registry-QUBL3RW6.js} +1 -1
- package/chunks/{workspace-runtime-coordinator-44KW6HSN.js → workspace-runtime-coordinator-22TSDHXX.js} +1 -1
- package/chunks/{workspace-service-YHTSZYYD.js → workspace-service-UUENTHNO.js} +1 -1
- package/chunks/{workspace-skills-status-NEB62X24.js → workspace-skills-status-NNQQBBCJ.js} +1 -1
- package/chunks/{workspace-trust-reconciler-HZLOOZWM.js → workspace-trust-reconciler-3CMMNCGG.js} +1 -1
- package/chunks/{write-file-HD5LHXGL.js → write-file-DEAFIK4C.js} +1 -1
- package/chunks/{zoom-image-W4BMRC5T.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/gerege.mjs +11 -0
- package/package.json +2 -12
- package/chunks/managed-npm-update-CTL6LH5Z.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{ProcessRegistry}from"./chunk-ESSOEHTE.js";import{createStderrForwarder}from"./chunk-BC4C6F32.js";import{ClientSideConnection,PROTOCOL_VERSION,RequestError,ndJsonStream}from"./chunk-WSOEJTOC.js";import{AgentEventEmitter,renderSubagentSystemPrompt}from"./chunk-2JGTWRZJ.js";import{sanitizeChildEnv}from"./chunk-LMJPU2JM.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{spawn}from"node:child_process";import{Readable,Writable}from"node:stream";init_esbuild_shims();var INIT_TIMEOUT_MS=1e4;var debugLogger=createDebugLogger("EXTERNAL_AGENT");function externalModelLabel(command){return`external-acp:${command.split(/[\\/]/).pop()??command}`}__name(externalModelLabel,"externalModelLabel");function isRecord(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}__name(isRecord,"isRecord");var EXTERNAL_ACTION_PROMPT_MAX=300;function stripControlChars(value){let out="";for(const ch of value){const code=ch.codePointAt(0)??0;out+=code>=32&&code!==127&&!(code>=128&&code<=159)?ch:" "}return out}__name(stripControlChars,"stripControlChars");function describeExternalAction(toolCall){const title=stripControlChars(toolCall.title??toolCall.kind??"External action");const raw=toolCall.rawInput;if(!isRecord(raw))return title;const detail=stripControlChars(JSON.stringify(raw));const rendered=`${title}: ${detail}`;return rendered.length>EXTERNAL_ACTION_PROMPT_MAX?`${rendered.slice(0,EXTERNAL_ACTION_PROMPT_MAX)}\u2026`:rendered}__name(describeExternalAction,"describeExternalAction");function assertExternalAgentSpawnPlatformSupported(platform=process.platform){if(platform==="win32"){throw new Error("External agents are not supported on Windows in this release: the executor spawn is POSIX-only. An npm-installed adapter resolves to a `.cmd` launcher that cannot be spawned without a shell, and the process-tree reaping is POSIX-specific. Run the external agent on macOS/Linux (or WSL). Windows support is a tracked follow-up.")}}__name(assertExternalAgentSpawnPlatformSupported,"assertExternalAgentSpawnPlatformSupported");function resolvePermissionMode(permissionMode,approvalMode){switch((approvalMode??permissionMode??"").trim().toLowerCase()){case"auto":case"acceptedits":case"auto-edit":return"acceptEdits";case"plan":return"plan";case"bypasspermissions":case"bypass":case"yolo":return"bypass";default:return"default"}}__name(resolvePermissionMode,"resolvePermissionMode");var POLICY_MODE_ALIASES={bypass:["bypassPermissions","yolo"],acceptEdits:["acceptEdits","auto-edit","auto"],plan:["plan"],default:["default"]};function selectPeerModeId(policy,availableModeIds){return POLICY_MODE_ALIASES[policy].find(id=>availableModeIds.includes(id))}__name(selectPeerModeId,"selectPeerModeId");function optionKindForOutcome(outcome){switch(outcome){case"proceed_once":case"proceed_once_and_switch_to_default":return"allow_once";case"proceed_always":case"proceed_always_server":case"proceed_always_tool":case"proceed_always_project":case"proceed_always_user":return"allow_always";case"modify_with_editor":case"cancel":case"restore_previous":return"reject_once";default:{const exhaustive=outcome;void exhaustive;return"reject_once"}}}__name(optionKindForOutcome,"optionKindForOutcome");function selectPermissionOption(options,outcome){if(outcome==="cancel")return void 0;if(new Set(options.map(option=>option.optionId)).size!==options.length){return void 0}const kind=optionKindForOutcome(outcome);return(options.find(option=>option.kind===kind)??(kind==="allow_always"?options.find(option=>option.kind==="allow_once"):void 0)??options.find(option=>option.kind==="reject_once")??options.find(option=>option.kind==="reject_always"))?.optionId}__name(selectPermissionOption,"selectPermissionOption");function selectRejectOption(options){if(new Set(options.map(option=>option.optionId)).size!==options.length){return void 0}return(options.find(option=>option.kind==="reject_once")??options.find(option=>option.kind==="reject_always"))?.optionId}__name(selectRejectOption,"selectRejectOption");function isExpectedExternalAgentCleanupExit(error){return error instanceof Error&&/^ACP child pid=\d+ exited uncleanly during shutdown \(code=[^,]+, signal=[^)]+\)$/.test(error.message)}__name(isExpectedExternalAgentCleanupExit,"isExpectedExternalAgentCleanupExit");function isUnprovenExternalAgentTreeExit(error){return error instanceof Error&&/^ACP child pid=\d+ exited before its initial process-tree snapshot completed$/.test(error.message)}__name(isUnprovenExternalAgentTreeExit,"isUnprovenExternalAgentTreeExit");var ExternalAgentTimeoutError=class extends Error{static{__name(this,"ExternalAgentTimeoutError")}constructor(timeoutMs){super(`External ACP operation timed out after ${timeoutMs}ms`);this.name="ExternalAgentTimeoutError"}};var AcpSubagentExecutor=class _AcpSubagentExecutor{constructor(params,child,emitter){this.params=params;this.child=child;this.emitter=emitter;this.coreView={getEventEmitter:__name(()=>emitter,"getEventEmitter"),modelConfig:{...params.modelConfig,model:externalModelLabel(params.spec.command)}};void child.exited.then(()=>this.fail(new Error(`external agent "${params.name}" exited`)),error=>this.fail(error))}static{__name(this,"AcpSubagentExecutor")}connection;sessionId="";finalText="";thoughtText="";terminateMode="ERROR";round=0;durationMs=0;turnStartedAt=0;toolCalls=0;toolSucceeded=0;toolFailed=0;executing=false;started=false;disposed=false;cancelled=false;disposePromise;provider;pendingPermissions=new Map;tools=new Map;toolNames=new Map;finishedTools=new Set;failure=new AbortController;coreView;static async create(params){assertExternalAgentSpawnPlatformSupported();if(params.runConfig.max_turns!==void 0){throw new Error("External ACP agents cannot enforce max_turns.")}const minutes=params.runConfig.max_time_minutes;if(minutes!==void 0&&(!Number.isFinite(minutes)||minutes<=0||minutes*6e4>2147483647)){throw new Error("External ACP max_time_minutes must be positive, finite, and within the Node timer range.")}const child=spawn(params.spec.command,params.spec.args??[],{cwd:params.runtimeContext.getTargetDir(),stdio:["pipe","pipe","pipe"],detached:process.platform!=="win32",windowsHide:true,env:sanitizeChildEnv(process.env)});const tracked=new ProcessRegistry().reserve().attach(child,{ownsProcessTree:true});const executor=new _AcpSubagentExecutor(params,tracked,params.eventEmitter??new AgentEventEmitter);child.on("error",error=>executor.fail(error));child.stdin.on("error",error=>executor.fail(error));child.stdout.on("error",error=>executor.fail(error));const forwarder=createStderrForwarder({prefix:`[external-agent ${params.name}] `});child.stderr.setEncoding("utf8");child.stderr.on("data",forwarder.onData);child.stderr.on("end",forwarder.onEnd);child.stderr.on("error",()=>{});try{executor.connection=new ClientSideConnection(()=>executor.buildClient(),ndJsonStream(Writable.toWeb(child.stdin),Readable.toWeb(child.stdout)));void executor.connection.closed.then(()=>executor.fail(new Error("External ACP connection closed")));await executor.wait(executor.connect(),INIT_TIMEOUT_MS);return executor}catch(error){await executor.dispose();throw error}}buildClient(){return{sessionUpdate:__name(async params=>this.onSessionUpdate(params),"sessionUpdate"),requestPermission:__name(params=>this.onRequestPermission(params),"requestPermission"),readTextFile:__name(async()=>{throw RequestError.methodNotFound("fs/read_text_file")},"readTextFile"),writeTextFile:__name(async()=>{throw RequestError.methodNotFound("fs/write_text_file")},"writeTextFile"),extMethod:__name(async method=>{throw RequestError.methodNotFound(method)},"extMethod"),extNotification:__name(async()=>{},"extNotification")}}async connect(){const initialized=await this.connection.initialize({protocolVersion:PROTOCOL_VERSION,clientCapabilities:{fs:{readTextFile:false,writeTextFile:false}}});if(initialized.protocolVersion!==PROTOCOL_VERSION){throw new Error("Unsupported external ACP protocol version")}const session=await this.connection.newSession({cwd:this.params.runtimeContext.getTargetDir(),mcpServers:[]});if(!session.sessionId)throw new Error("External ACP agent returned no sessionId");this.sessionId=session.sessionId;const policy=resolvePermissionMode(this.params.permissionMode,this.params.approvalMode);const availableIds=session.modes?.availableModes.map(mode=>mode.id)??[];const modeId=selectPeerModeId(policy,availableIds);if(!modeId){throw new Error(`External ACP agent does not advertise any mode for the host's ${policy} approval policy (advertised: ${availableIds.join(", ")||"none"})`)}await this.connection.setSessionMode({sessionId:this.sessionId,modeId})}fail(error){this.failure.abort(error);this.drainPermissions()}async wait(operation,timeoutMs,signal){let timer;let onFailure=__name(()=>{},"onFailure");let onAbort=__name(()=>{},"onAbort");const stopped=new Promise((_resolve,reject)=>{onFailure=__name(()=>reject(this.failure.signal.reason),"onFailure");onAbort=__name(()=>reject(signal?.reason??new Error("External agent cancelled")),"onAbort");this.failure.signal.addEventListener("abort",onFailure,{once:true});signal?.addEventListener("abort",onAbort,{once:true});if(this.failure.signal.aborted)onFailure();if(signal?.aborted)onAbort();if(timeoutMs!==void 0){timer=setTimeout(()=>reject(new ExternalAgentTimeoutError(timeoutMs)),timeoutMs)}});try{return await Promise.race([operation,stopped])}finally{clearTimeout(timer);this.failure.signal.removeEventListener("abort",onFailure);signal?.removeEventListener("abort",onAbort)}}async execute(context,signal,options={}){if(context.get("initial_messages_override")!==void 0){throw new Error("External ACP agents cannot import in-process conversation history")}const continuation=this.started;const system=continuation?"":renderSubagentSystemPrompt(this.params.promptConfig,context,this.params.runtimeContext);const task=String(context.get("task_prompt")??"Get Started!");const catalog=system?this.params.runtimeContext.getAutoMemoryContext():"";await this.runTurn([...system?[{type:"text",text:system}]:[],{type:"text",text:task},...catalog?[{type:"text",text:catalog}]:[]],signal,options,continuation?[task]:void 0)}async executeExternalInputs(inputs,signal,options={}){if(inputs.length===0)return;await this.runTurn(this.inputPrompt(inputs),signal,options,inputs)}inputPrompt(inputs){return inputs.map(input=>({type:"text",text:typeof input==="string"?input:input.text}))}emitInputs(inputs){for(const input of inputs){this.emitter.emit("external_message",{subagentId:this.id,kind:typeof input==="string"?"message":input.kind,text:typeof input==="string"?input:input.text,timestamp:Date.now()})}}async runTurn(prompt,signal,options={},inputs){if(this.executing)throw new Error("External ACP agents do not support concurrent turns");if(this.disposed||this.failure.signal.aborted)throw new Error("External ACP agent is closed");this.executing=true;this.started=true;this.cancelled=false;this.finalText="";this.thoughtText="";this.terminateMode="ERROR";if(options.resetStats!==false){this.round=this.durationMs=this.toolCalls=this.toolSucceeded=this.toolFailed=0}this.tools.clear();this.toolNames.clear();this.finishedTools.clear();this.turnStartedAt=Date.now();const timeoutMs=this.params.runConfig.max_time_minutes===void 0?void 0:this.params.runConfig.max_time_minutes*6e4;const cancel=__name(()=>{this.cancelled=true;this.drainPermissions();void this.connection.cancel({sessionId:this.sessionId}).catch(()=>{})},"cancel");signal?.addEventListener("abort",cancel,{once:true});let timedOut=false;try{this.emitter.emit("start",{subagentId:this.id,name:this.params.name,model:this.coreView.modelConfig.model,tools:[],timestamp:Date.now()});if(signal?.aborted){this.terminateMode="CANCELLED";return}const entryRound=this.round;let next=prompt;do{this.round++;const remaining=timeoutMs===void 0?void 0:Math.max(0,timeoutMs-this.durationMs-(Date.now()-this.turnStartedAt));if(remaining!==void 0&&remaining<=0){this.terminateMode="TIMEOUT";break}if(inputs&&this.round===entryRound+1)this.emitInputs(inputs);const result=await this.wait(this.connection.prompt({sessionId:this.sessionId,prompt:next}),remaining,signal);this.terminateMode=this.stopMode(result.stopReason);if(this.terminateMode!=="GOAL")break;if(signal?.aborted){this.terminateMode="CANCELLED";break}const remainingNext=timeoutMs===void 0?void 0:Math.max(0,timeoutMs-this.durationMs-(Date.now()-this.turnStartedAt));if(remainingNext!==void 0&&remainingNext<=0){this.terminateMode="TIMEOUT";break}const queued=this.provider?.()??[];if(queued.length===0)break;this.emitter.emit("round_text",{subagentId:this.id,round:this.round,text:this.finalText,thoughtText:this.thoughtText,timestamp:Date.now()});this.finalText="";this.thoughtText="";this.emitInputs(queued);next=this.inputPrompt(queued)}while(!signal?.aborted);if(signal?.aborted)this.terminateMode="CANCELLED"}catch(error){timedOut=error instanceof ExternalAgentTimeoutError;this.terminateMode=signal?.aborted?"CANCELLED":timedOut?"TIMEOUT":"ERROR";if(this.emitter.rawListeners("error").length>0&&!signal?.aborted){this.emitter.emit("error",{subagentId:this.id,error:error instanceof Error?error.message:String(error),timestamp:Date.now()})}await this.dispose();if(!signal?.aborted&&!timedOut)throw error}finally{signal?.removeEventListener("abort",cancel);this.durationMs+=Date.now()-this.turnStartedAt;this.executing=false;this.drainPermissions();this.emitter.emit("round_text",{subagentId:this.id,round:this.round,text:this.finalText,thoughtText:this.thoughtText,timestamp:Date.now()});this.flushOpenTools();this.emitter.emit("finish",{subagentId:this.id,terminateReason:this.terminateMode,rounds:this.round,totalDurationMs:this.durationMs,totalToolCalls:this.toolCalls,successfulToolCalls:this.toolSucceeded,failedToolCalls:this.toolFailed,timestamp:Date.now()})}}stopMode(reason){switch(reason){case"end_turn":return"GOAL";case"max_turn_requests":return"MAX_TURNS";case"cancelled":return"CANCELLED";case"refusal":return"ERROR";default:return"ERROR"}}get id(){return this.params.subagentId??this.params.name}getFinalText(){return this.finalText}getTerminateMode(){return this.terminateMode}getCore(){return this.coreView}setExternalMessageProvider(provider){this.provider=provider}getExecutionSummary(){return{rounds:this.round,totalDurationMs:this.durationMs+(this.executing?Date.now()-this.turnStartedAt:0),totalToolCalls:this.toolCalls,successfulToolCalls:this.toolSucceeded,failedToolCalls:this.toolFailed,successRate:this.toolCalls?this.toolSucceeded/this.toolCalls*100:0,inputTokens:0,outputTokens:0,thoughtTokens:0,cachedTokens:0,totalTokens:0,toolUsage:[]}}dispose(){this.disposed=true;this.fail(new Error("External ACP agent disposed"));return this.disposePromise??=this.child.terminate().catch(error=>{if(isUnprovenExternalAgentTreeExit(error)){const detail=error instanceof Error?error.message:String(error);debugLogger.warn(`External ACP agent process tree was not proven gone after disposal: ${detail}`);if(this.emitter.rawListeners("error").length>0){this.emitter.emit("error",{subagentId:this.id,error:`External agent process tree not proven gone after disposal: ${detail}`,timestamp:Date.now()})}return}if(!isExpectedExternalAgentCleanupExit(error))throw error})}drainPermissions(){for(const cancel of this.pendingPermissions.values())cancel();this.pendingPermissions.clear()}onSessionUpdate({sessionId,update}){if(sessionId!==this.sessionId||!this.executing||this.cancelled||this.disposed||this.failure.signal.aborted)return;switch(update.sessionUpdate){case"agent_message_chunk":case"agent_thought_chunk":{const thought=update.sessionUpdate==="agent_thought_chunk";const text=update.content.type==="text"?update.content.text:JSON.stringify(update.content);if(thought)this.thoughtText+=text;else this.finalText+=text;this.emitter.emit("stream_text",{subagentId:this.id,round:this.round,text,thought,timestamp:Date.now()});break}case"tool_call":this.updateTool(update);break;case"tool_call_update":this.updateTool(update);break;default:break}}updateTool(update){if(update._meta?.["toolLifecycle"]!==void 0&&update.status===void 0&&update.content===void 0)return;const callId=update.toolCallId;if(this.finishedTools.has(callId))return;const previous=this.tools.get(callId);const tool={toolCallId:callId,title:previous?.title??"External tool",...previous,...Object.fromEntries(Object.entries(update).filter(([,value])=>value!==null&&value!==void 0))};this.tools.set(callId,tool);const meta=tool._meta?.["claudeCode"];const reportedName=isRecord(meta)&&typeof meta["toolName"]==="string"?meta["toolName"]:tool.kind??"external_tool";const name=this.toolNames.get(callId)??reportedName;if(!previous){this.toolNames.set(callId,name);this.toolCalls++;this.emitter.emit("tool_call",{subagentId:this.id,round:this.round,callId,name,args:isRecord(tool.rawInput)?tool.rawInput:{input:tool.rawInput},description:tool.title,timestamp:Date.now()})}if(tool.status!=="completed"&&tool.status!=="failed")return;this.finishedTools.add(callId);this.tools.delete(callId);const success=tool.status==="completed";if(success)this.toolSucceeded++;else this.toolFailed++;this.toolNames.delete(callId);const response={input:tool.rawInput??null,toolName:reportedName,output:tool.rawOutput??null,content:tool.content??null,status:tool.status};const responseParts=[{functionResponse:{id:callId,name,response}}];this.emitter.emit("tool_result",{subagentId:this.id,round:this.round,callId,name,success,responseParts,resultDisplay:JSON.stringify(tool.rawOutput??tool.content??null),timestamp:Date.now()});this.emitter.emit("tool_responses_finalized",{subagentId:this.id,round:this.round,responses:[{callId,responseParts}],timestamp:Date.now()})}flushOpenTools(){for(const[callId,tool]of this.tools){const meta=tool._meta?.["claudeCode"];const reportedName=isRecord(meta)&&typeof meta["toolName"]==="string"?meta["toolName"]:tool.kind??"external_tool";const name=this.toolNames.get(callId)??reportedName;this.toolFailed++;const response={input:tool.rawInput??null,toolName:reportedName,output:null,content:tool.content??null,status:"failed"};const responseParts=[{functionResponse:{id:callId,name,response}}];this.emitter.emit("tool_result",{subagentId:this.id,round:this.round,callId,name,success:false,responseParts,resultDisplay:JSON.stringify(tool.content??null),timestamp:Date.now()});this.emitter.emit("tool_responses_finalized",{subagentId:this.id,round:this.round,responses:[{callId,responseParts}],timestamp:Date.now()})}this.tools.clear();this.toolNames.clear()}async onRequestPermission(params){const cancelled={outcome:{outcome:"cancelled"}};const runtime=this.params.runtimeContext;const callId=params.toolCall.toolCallId;const meta=params.toolCall._meta?.["claudeCode"];const name=isRecord(meta)&&typeof meta["toolName"]==="string"?meta["toolName"]:params.toolCall.kind??"external_tool";if(params.sessionId!==this.sessionId||!this.executing||this.cancelled||this.disposed||this.failure.signal.aborted||this.pendingPermissions.has(callId)||params.options.length===0||new Set(params.options.map(option=>option.optionId)).size!==params.options.length)return cancelled;if(name.replaceAll("_","").toLowerCase()==="askuserquestion"||runtime.getShouldAvoidPermissionPrompts()||!runtime.isInteractive()&&!runtime.getExperimentalZedIntegration()&&runtime.getInputFormat()!=="stream-json"||this.emitter.rawListeners("tool_waiting_approval").length===0){const rejectOptionId=selectRejectOption(params.options);return rejectOptionId?{outcome:{outcome:"selected",optionId:rejectOptionId}}:cancelled}return new Promise(resolve=>{const finish=__name(optionId=>{if(this.pendingPermissions.get(callId)!==deny)return;this.pendingPermissions.delete(callId);resolve(optionId?{outcome:{outcome:"selected",optionId}}:cancelled)},"finish");const deny=__name(()=>finish(),"deny");this.pendingPermissions.set(callId,deny);try{this.emitter.emit("tool_waiting_approval",{subagentId:this.id,round:this.round,callId,name,args:isRecord(params.toolCall.rawInput)?params.toolCall.rawInput:{},description:params.toolCall.title??"External action",confirmationDetails:{type:"info",title:params.toolCall.title??"External action",prompt:describeExternalAction(params.toolCall),renderPromptAsPlainText:true,hideAlwaysAllow:true},respond:__name(async outcome=>finish(selectPermissionOption(params.options,outcome)??(outcome==="cancel"?selectRejectOption(params.options):void 0)),"respond"),timestamp:Date.now()})}catch{deny()}})}};var acpExternalAgentExecutor={create:__name(params=>AcpSubagentExecutor.create(params),"create")};export{externalModelLabel,describeExternalAction,assertExternalAgentSpawnPlatformSupported,resolvePermissionMode,selectPeerModeId,optionKindForOutcome,selectPermissionOption,selectRejectOption,isExpectedExternalAgentCleanupExit,isUnprovenExternalAgentTreeExit,acpExternalAgentExecutor};
|
|
3
|
+
import{ProcessRegistry}from"./chunk-ESSOEHTE.js";import{createStderrForwarder}from"./chunk-BC4C6F32.js";import{ClientSideConnection,PROTOCOL_VERSION,RequestError,ndJsonStream}from"./chunk-WSOEJTOC.js";import{AgentEventEmitter,renderSubagentSystemPrompt}from"./chunk-7XQ5D34E.js";import{sanitizeChildEnv}from"./chunk-LMJPU2JM.js";import{createDebugLogger}from"./chunk-JAUJI56S.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{spawn}from"node:child_process";import{Readable,Writable}from"node:stream";init_esbuild_shims();var INIT_TIMEOUT_MS=1e4;var debugLogger=createDebugLogger("EXTERNAL_AGENT");function externalModelLabel(command){return`external-acp:${command.split(/[\\/]/).pop()??command}`}__name(externalModelLabel,"externalModelLabel");function isRecord(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}__name(isRecord,"isRecord");var EXTERNAL_ACTION_PROMPT_MAX=300;function stripControlChars(value){let out="";for(const ch of value){const code=ch.codePointAt(0)??0;out+=code>=32&&code!==127&&!(code>=128&&code<=159)?ch:" "}return out}__name(stripControlChars,"stripControlChars");function describeExternalAction(toolCall){const title=stripControlChars(toolCall.title??toolCall.kind??"External action");const raw=toolCall.rawInput;if(!isRecord(raw))return title;const detail=stripControlChars(JSON.stringify(raw));const rendered=`${title}: ${detail}`;return rendered.length>EXTERNAL_ACTION_PROMPT_MAX?`${rendered.slice(0,EXTERNAL_ACTION_PROMPT_MAX)}\u2026`:rendered}__name(describeExternalAction,"describeExternalAction");function assertExternalAgentSpawnPlatformSupported(platform=process.platform){if(platform==="win32"){throw new Error("External agents are not supported on Windows in this release: the executor spawn is POSIX-only. An npm-installed adapter resolves to a `.cmd` launcher that cannot be spawned without a shell, and the process-tree reaping is POSIX-specific. Run the external agent on macOS/Linux (or WSL). Windows support is a tracked follow-up.")}}__name(assertExternalAgentSpawnPlatformSupported,"assertExternalAgentSpawnPlatformSupported");function resolvePermissionMode(permissionMode,approvalMode){switch((approvalMode??permissionMode??"").trim().toLowerCase()){case"auto":case"acceptedits":case"auto-edit":return"acceptEdits";case"plan":return"plan";case"bypasspermissions":case"bypass":case"yolo":return"bypass";default:return"default"}}__name(resolvePermissionMode,"resolvePermissionMode");var POLICY_MODE_ALIASES={bypass:["bypassPermissions","yolo"],acceptEdits:["acceptEdits","auto-edit","auto"],plan:["plan"],default:["default"]};function selectPeerModeId(policy,availableModeIds){return POLICY_MODE_ALIASES[policy].find(id=>availableModeIds.includes(id))}__name(selectPeerModeId,"selectPeerModeId");function optionKindForOutcome(outcome){switch(outcome){case"proceed_once":case"proceed_once_and_switch_to_default":return"allow_once";case"proceed_always":case"proceed_always_server":case"proceed_always_tool":case"proceed_always_project":case"proceed_always_user":return"allow_always";case"modify_with_editor":case"cancel":case"restore_previous":return"reject_once";default:{const exhaustive=outcome;void exhaustive;return"reject_once"}}}__name(optionKindForOutcome,"optionKindForOutcome");function selectPermissionOption(options,outcome){if(outcome==="cancel")return void 0;if(new Set(options.map(option=>option.optionId)).size!==options.length){return void 0}const kind=optionKindForOutcome(outcome);return(options.find(option=>option.kind===kind)??(kind==="allow_always"?options.find(option=>option.kind==="allow_once"):void 0)??options.find(option=>option.kind==="reject_once")??options.find(option=>option.kind==="reject_always"))?.optionId}__name(selectPermissionOption,"selectPermissionOption");function selectRejectOption(options){if(new Set(options.map(option=>option.optionId)).size!==options.length){return void 0}return(options.find(option=>option.kind==="reject_once")??options.find(option=>option.kind==="reject_always"))?.optionId}__name(selectRejectOption,"selectRejectOption");function isExpectedExternalAgentCleanupExit(error){return error instanceof Error&&/^ACP child pid=\d+ exited uncleanly during shutdown \(code=[^,]+, signal=[^)]+\)$/.test(error.message)}__name(isExpectedExternalAgentCleanupExit,"isExpectedExternalAgentCleanupExit");function isUnprovenExternalAgentTreeExit(error){return error instanceof Error&&/^ACP child pid=\d+ exited before its initial process-tree snapshot completed$/.test(error.message)}__name(isUnprovenExternalAgentTreeExit,"isUnprovenExternalAgentTreeExit");var ExternalAgentTimeoutError=class extends Error{static{__name(this,"ExternalAgentTimeoutError")}constructor(timeoutMs){super(`External ACP operation timed out after ${timeoutMs}ms`);this.name="ExternalAgentTimeoutError"}};var AcpSubagentExecutor=class _AcpSubagentExecutor{constructor(params,child,emitter){this.params=params;this.child=child;this.emitter=emitter;this.coreView={getEventEmitter:__name(()=>emitter,"getEventEmitter"),modelConfig:{...params.modelConfig,model:externalModelLabel(params.spec.command)}};void child.exited.then(()=>this.fail(new Error(`external agent "${params.name}" exited`)),error=>this.fail(error))}static{__name(this,"AcpSubagentExecutor")}connection;sessionId="";finalText="";thoughtText="";terminateMode="ERROR";round=0;durationMs=0;turnStartedAt=0;toolCalls=0;toolSucceeded=0;toolFailed=0;executing=false;started=false;disposed=false;cancelled=false;disposePromise;provider;pendingPermissions=new Map;tools=new Map;toolNames=new Map;finishedTools=new Set;failure=new AbortController;coreView;static async create(params){assertExternalAgentSpawnPlatformSupported();if(params.runConfig.max_turns!==void 0){throw new Error("External ACP agents cannot enforce max_turns.")}const minutes=params.runConfig.max_time_minutes;if(minutes!==void 0&&(!Number.isFinite(minutes)||minutes<=0||minutes*6e4>2147483647)){throw new Error("External ACP max_time_minutes must be positive, finite, and within the Node timer range.")}const child=spawn(params.spec.command,params.spec.args??[],{cwd:params.runtimeContext.getTargetDir(),stdio:["pipe","pipe","pipe"],detached:process.platform!=="win32",windowsHide:true,env:sanitizeChildEnv(process.env)});const tracked=new ProcessRegistry().reserve().attach(child,{ownsProcessTree:true});const executor=new _AcpSubagentExecutor(params,tracked,params.eventEmitter??new AgentEventEmitter);child.on("error",error=>executor.fail(error));child.stdin.on("error",error=>executor.fail(error));child.stdout.on("error",error=>executor.fail(error));const forwarder=createStderrForwarder({prefix:`[external-agent ${params.name}] `});child.stderr.setEncoding("utf8");child.stderr.on("data",forwarder.onData);child.stderr.on("end",forwarder.onEnd);child.stderr.on("error",()=>{});try{executor.connection=new ClientSideConnection(()=>executor.buildClient(),ndJsonStream(Writable.toWeb(child.stdin),Readable.toWeb(child.stdout)));void executor.connection.closed.then(()=>executor.fail(new Error("External ACP connection closed")));await executor.wait(executor.connect(),INIT_TIMEOUT_MS);return executor}catch(error){await executor.dispose();throw error}}buildClient(){return{sessionUpdate:__name(async params=>this.onSessionUpdate(params),"sessionUpdate"),requestPermission:__name(params=>this.onRequestPermission(params),"requestPermission"),readTextFile:__name(async()=>{throw RequestError.methodNotFound("fs/read_text_file")},"readTextFile"),writeTextFile:__name(async()=>{throw RequestError.methodNotFound("fs/write_text_file")},"writeTextFile"),extMethod:__name(async method=>{throw RequestError.methodNotFound(method)},"extMethod"),extNotification:__name(async()=>{},"extNotification")}}async connect(){const initialized=await this.connection.initialize({protocolVersion:PROTOCOL_VERSION,clientCapabilities:{fs:{readTextFile:false,writeTextFile:false}}});if(initialized.protocolVersion!==PROTOCOL_VERSION){throw new Error("Unsupported external ACP protocol version")}const session=await this.connection.newSession({cwd:this.params.runtimeContext.getTargetDir(),mcpServers:[]});if(!session.sessionId)throw new Error("External ACP agent returned no sessionId");this.sessionId=session.sessionId;const policy=resolvePermissionMode(this.params.permissionMode,this.params.approvalMode);const availableIds=session.modes?.availableModes.map(mode=>mode.id)??[];const modeId=selectPeerModeId(policy,availableIds);if(!modeId){throw new Error(`External ACP agent does not advertise any mode for the host's ${policy} approval policy (advertised: ${availableIds.join(", ")||"none"})`)}await this.connection.setSessionMode({sessionId:this.sessionId,modeId})}fail(error){this.failure.abort(error);this.drainPermissions()}async wait(operation,timeoutMs,signal){let timer;let onFailure=__name(()=>{},"onFailure");let onAbort=__name(()=>{},"onAbort");const stopped=new Promise((_resolve,reject)=>{onFailure=__name(()=>reject(this.failure.signal.reason),"onFailure");onAbort=__name(()=>reject(signal?.reason??new Error("External agent cancelled")),"onAbort");this.failure.signal.addEventListener("abort",onFailure,{once:true});signal?.addEventListener("abort",onAbort,{once:true});if(this.failure.signal.aborted)onFailure();if(signal?.aborted)onAbort();if(timeoutMs!==void 0){timer=setTimeout(()=>reject(new ExternalAgentTimeoutError(timeoutMs)),timeoutMs)}});try{return await Promise.race([operation,stopped])}finally{clearTimeout(timer);this.failure.signal.removeEventListener("abort",onFailure);signal?.removeEventListener("abort",onAbort)}}async execute(context,signal,options={}){if(context.get("initial_messages_override")!==void 0){throw new Error("External ACP agents cannot import in-process conversation history")}const continuation=this.started;const system=continuation?"":renderSubagentSystemPrompt(this.params.promptConfig,context,this.params.runtimeContext);const task=String(context.get("task_prompt")??"Get Started!");const catalog=system?this.params.runtimeContext.getAutoMemoryContext():"";await this.runTurn([...system?[{type:"text",text:system}]:[],{type:"text",text:task},...catalog?[{type:"text",text:catalog}]:[]],signal,options,continuation?[task]:void 0)}async executeExternalInputs(inputs,signal,options={}){if(inputs.length===0)return;await this.runTurn(this.inputPrompt(inputs),signal,options,inputs)}inputPrompt(inputs){return inputs.map(input=>({type:"text",text:typeof input==="string"?input:input.text}))}emitInputs(inputs){for(const input of inputs){this.emitter.emit("external_message",{subagentId:this.id,kind:typeof input==="string"?"message":input.kind,text:typeof input==="string"?input:input.text,timestamp:Date.now()})}}async runTurn(prompt,signal,options={},inputs){if(this.executing)throw new Error("External ACP agents do not support concurrent turns");if(this.disposed||this.failure.signal.aborted)throw new Error("External ACP agent is closed");this.executing=true;this.started=true;this.cancelled=false;this.finalText="";this.thoughtText="";this.terminateMode="ERROR";if(options.resetStats!==false){this.round=this.durationMs=this.toolCalls=this.toolSucceeded=this.toolFailed=0}this.tools.clear();this.toolNames.clear();this.finishedTools.clear();this.turnStartedAt=Date.now();const timeoutMs=this.params.runConfig.max_time_minutes===void 0?void 0:this.params.runConfig.max_time_minutes*6e4;const cancel=__name(()=>{this.cancelled=true;this.drainPermissions();void this.connection.cancel({sessionId:this.sessionId}).catch(()=>{})},"cancel");signal?.addEventListener("abort",cancel,{once:true});let timedOut=false;try{this.emitter.emit("start",{subagentId:this.id,name:this.params.name,model:this.coreView.modelConfig.model,tools:[],timestamp:Date.now()});if(signal?.aborted){this.terminateMode="CANCELLED";return}const entryRound=this.round;let next=prompt;do{this.round++;const remaining=timeoutMs===void 0?void 0:Math.max(0,timeoutMs-this.durationMs-(Date.now()-this.turnStartedAt));if(remaining!==void 0&&remaining<=0){this.terminateMode="TIMEOUT";break}if(inputs&&this.round===entryRound+1)this.emitInputs(inputs);const result=await this.wait(this.connection.prompt({sessionId:this.sessionId,prompt:next}),remaining,signal);this.terminateMode=this.stopMode(result.stopReason);if(this.terminateMode!=="GOAL")break;if(signal?.aborted){this.terminateMode="CANCELLED";break}const remainingNext=timeoutMs===void 0?void 0:Math.max(0,timeoutMs-this.durationMs-(Date.now()-this.turnStartedAt));if(remainingNext!==void 0&&remainingNext<=0){this.terminateMode="TIMEOUT";break}const queued=this.provider?.()??[];if(queued.length===0)break;this.emitter.emit("round_text",{subagentId:this.id,round:this.round,text:this.finalText,thoughtText:this.thoughtText,timestamp:Date.now()});this.finalText="";this.thoughtText="";this.emitInputs(queued);next=this.inputPrompt(queued)}while(!signal?.aborted);if(signal?.aborted)this.terminateMode="CANCELLED"}catch(error){timedOut=error instanceof ExternalAgentTimeoutError;this.terminateMode=signal?.aborted?"CANCELLED":timedOut?"TIMEOUT":"ERROR";if(this.emitter.rawListeners("error").length>0&&!signal?.aborted){this.emitter.emit("error",{subagentId:this.id,error:error instanceof Error?error.message:String(error),timestamp:Date.now()})}await this.dispose();if(!signal?.aborted&&!timedOut)throw error}finally{signal?.removeEventListener("abort",cancel);this.durationMs+=Date.now()-this.turnStartedAt;this.executing=false;this.drainPermissions();this.emitter.emit("round_text",{subagentId:this.id,round:this.round,text:this.finalText,thoughtText:this.thoughtText,timestamp:Date.now()});this.flushOpenTools();this.emitter.emit("finish",{subagentId:this.id,terminateReason:this.terminateMode,rounds:this.round,totalDurationMs:this.durationMs,totalToolCalls:this.toolCalls,successfulToolCalls:this.toolSucceeded,failedToolCalls:this.toolFailed,timestamp:Date.now()})}}stopMode(reason){switch(reason){case"end_turn":return"GOAL";case"max_turn_requests":return"MAX_TURNS";case"cancelled":return"CANCELLED";case"refusal":return"ERROR";default:return"ERROR"}}get id(){return this.params.subagentId??this.params.name}getFinalText(){return this.finalText}getTerminateMode(){return this.terminateMode}getCore(){return this.coreView}setExternalMessageProvider(provider){this.provider=provider}getExecutionSummary(){return{rounds:this.round,totalDurationMs:this.durationMs+(this.executing?Date.now()-this.turnStartedAt:0),totalToolCalls:this.toolCalls,successfulToolCalls:this.toolSucceeded,failedToolCalls:this.toolFailed,successRate:this.toolCalls?this.toolSucceeded/this.toolCalls*100:0,inputTokens:0,outputTokens:0,thoughtTokens:0,cachedTokens:0,totalTokens:0,toolUsage:[]}}dispose(){this.disposed=true;this.fail(new Error("External ACP agent disposed"));return this.disposePromise??=this.child.terminate().catch(error=>{if(isUnprovenExternalAgentTreeExit(error)){const detail=error instanceof Error?error.message:String(error);debugLogger.warn(`External ACP agent process tree was not proven gone after disposal: ${detail}`);if(this.emitter.rawListeners("error").length>0){this.emitter.emit("error",{subagentId:this.id,error:`External agent process tree not proven gone after disposal: ${detail}`,timestamp:Date.now()})}return}if(!isExpectedExternalAgentCleanupExit(error))throw error})}drainPermissions(){for(const cancel of this.pendingPermissions.values())cancel();this.pendingPermissions.clear()}onSessionUpdate({sessionId,update}){if(sessionId!==this.sessionId||!this.executing||this.cancelled||this.disposed||this.failure.signal.aborted)return;switch(update.sessionUpdate){case"agent_message_chunk":case"agent_thought_chunk":{const thought=update.sessionUpdate==="agent_thought_chunk";const text=update.content.type==="text"?update.content.text:JSON.stringify(update.content);if(thought)this.thoughtText+=text;else this.finalText+=text;this.emitter.emit("stream_text",{subagentId:this.id,round:this.round,text,thought,timestamp:Date.now()});break}case"tool_call":this.updateTool(update);break;case"tool_call_update":this.updateTool(update);break;default:break}}updateTool(update){if(update._meta?.["toolLifecycle"]!==void 0&&update.status===void 0&&update.content===void 0)return;const callId=update.toolCallId;if(this.finishedTools.has(callId))return;const previous=this.tools.get(callId);const tool={toolCallId:callId,title:previous?.title??"External tool",...previous,...Object.fromEntries(Object.entries(update).filter(([,value])=>value!==null&&value!==void 0))};this.tools.set(callId,tool);const meta=tool._meta?.["claudeCode"];const reportedName=isRecord(meta)&&typeof meta["toolName"]==="string"?meta["toolName"]:tool.kind??"external_tool";const name=this.toolNames.get(callId)??reportedName;if(!previous){this.toolNames.set(callId,name);this.toolCalls++;this.emitter.emit("tool_call",{subagentId:this.id,round:this.round,callId,name,args:isRecord(tool.rawInput)?tool.rawInput:{input:tool.rawInput},description:tool.title,timestamp:Date.now()})}if(tool.status!=="completed"&&tool.status!=="failed")return;this.finishedTools.add(callId);this.tools.delete(callId);const success=tool.status==="completed";if(success)this.toolSucceeded++;else this.toolFailed++;this.toolNames.delete(callId);const response={input:tool.rawInput??null,toolName:reportedName,output:tool.rawOutput??null,content:tool.content??null,status:tool.status};const responseParts=[{functionResponse:{id:callId,name,response}}];this.emitter.emit("tool_result",{subagentId:this.id,round:this.round,callId,name,success,responseParts,resultDisplay:JSON.stringify(tool.rawOutput??tool.content??null),timestamp:Date.now()});this.emitter.emit("tool_responses_finalized",{subagentId:this.id,round:this.round,responses:[{callId,responseParts}],timestamp:Date.now()})}flushOpenTools(){for(const[callId,tool]of this.tools){const meta=tool._meta?.["claudeCode"];const reportedName=isRecord(meta)&&typeof meta["toolName"]==="string"?meta["toolName"]:tool.kind??"external_tool";const name=this.toolNames.get(callId)??reportedName;this.toolFailed++;const response={input:tool.rawInput??null,toolName:reportedName,output:null,content:tool.content??null,status:"failed"};const responseParts=[{functionResponse:{id:callId,name,response}}];this.emitter.emit("tool_result",{subagentId:this.id,round:this.round,callId,name,success:false,responseParts,resultDisplay:JSON.stringify(tool.content??null),timestamp:Date.now()});this.emitter.emit("tool_responses_finalized",{subagentId:this.id,round:this.round,responses:[{callId,responseParts}],timestamp:Date.now()})}this.tools.clear();this.toolNames.clear()}async onRequestPermission(params){const cancelled={outcome:{outcome:"cancelled"}};const runtime=this.params.runtimeContext;const callId=params.toolCall.toolCallId;const meta=params.toolCall._meta?.["claudeCode"];const name=isRecord(meta)&&typeof meta["toolName"]==="string"?meta["toolName"]:params.toolCall.kind??"external_tool";if(params.sessionId!==this.sessionId||!this.executing||this.cancelled||this.disposed||this.failure.signal.aborted||this.pendingPermissions.has(callId)||params.options.length===0||new Set(params.options.map(option=>option.optionId)).size!==params.options.length)return cancelled;if(name.replaceAll("_","").toLowerCase()==="askuserquestion"||runtime.getShouldAvoidPermissionPrompts()||!runtime.isInteractive()&&!runtime.getExperimentalZedIntegration()&&runtime.getInputFormat()!=="stream-json"||this.emitter.rawListeners("tool_waiting_approval").length===0){const rejectOptionId=selectRejectOption(params.options);return rejectOptionId?{outcome:{outcome:"selected",optionId:rejectOptionId}}:cancelled}return new Promise(resolve=>{const finish=__name(optionId=>{if(this.pendingPermissions.get(callId)!==deny)return;this.pendingPermissions.delete(callId);resolve(optionId?{outcome:{outcome:"selected",optionId}}:cancelled)},"finish");const deny=__name(()=>finish(),"deny");this.pendingPermissions.set(callId,deny);try{this.emitter.emit("tool_waiting_approval",{subagentId:this.id,round:this.round,callId,name,args:isRecord(params.toolCall.rawInput)?params.toolCall.rawInput:{},description:params.toolCall.title??"External action",confirmationDetails:{type:"info",title:params.toolCall.title??"External action",prompt:describeExternalAction(params.toolCall),renderPromptAsPlainText:true,hideAlwaysAllow:true},respond:__name(async outcome=>finish(selectPermissionOption(params.options,outcome)??(outcome==="cancel"?selectRejectOption(params.options):void 0)),"respond"),timestamp:Date.now()})}catch{deny()}})}};var acpExternalAgentExecutor={create:__name(params=>AcpSubagentExecutor.create(params),"create")};export{externalModelLabel,describeExternalAction,assertExternalAgentSpawnPlatformSupported,resolvePermissionMode,selectPeerModeId,optionKindForOutcome,selectPermissionOption,selectRejectOption,isExpectedExternalAgentCleanupExit,isUnprovenExternalAgentTreeExit,acpExternalAgentExecutor};
|
|
4
4
|
/**
|
|
5
5
|
* @license
|
|
6
6
|
* Copyright 2025 Qwen
|