@namzu/cli 34.1.1 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +800 -0
- package/README.md +160 -394
- package/assets/pal-blender-mcp.py +123 -0
- package/assets/pal-godot-mcp-pin.json +135 -0
- package/assets/pal-godot-mcp.cjs +418 -0
- package/dist/bin-main.d.ts +3 -0
- package/dist/bin-main.d.ts.map +1 -0
- package/dist/bin.d.ts +2 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +85 -23
- package/dist/bin.js.map +6 -1
- package/dist/boot-narrative.d.ts +16 -0
- package/dist/boot-narrative.d.ts.map +1 -0
- package/dist/checkpoints/manifest.d.ts +107 -0
- package/dist/checkpoints/manifest.d.ts.map +1 -0
- package/dist/checkpoints/store.d.ts +280 -40
- package/dist/checkpoints/store.d.ts.map +1 -1
- package/dist/checkpoints/undo-plan.d.ts +83 -0
- package/dist/checkpoints/undo-plan.d.ts.map +1 -0
- package/dist/checkpoints/wrap.d.ts +4 -0
- package/dist/checkpoints/wrap.d.ts.map +1 -1
- package/dist/chunks/acp-BOSEA4R3.js +13448 -0
- package/dist/chunks/acp-BOSEA4R3.js.map +6 -0
- package/dist/chunks/activity-command-ACS7KL3C.js +262 -0
- package/dist/chunks/activity-command-ACS7KL3C.js.map +6 -0
- package/dist/chunks/add-DLS54YKS.js +712 -0
- package/dist/chunks/add-DLS54YKS.js.map +6 -0
- package/dist/chunks/agent-GV3DWYQC.js +87 -0
- package/dist/chunks/agent-GV3DWYQC.js.map +6 -0
- package/dist/chunks/agent-session-7VE6GJJH.js +46 -0
- package/dist/chunks/agent-session-7VE6GJJH.js.map +6 -0
- package/dist/chunks/archive-6ZENIEBP.js +84 -0
- package/dist/chunks/archive-6ZENIEBP.js.map +6 -0
- package/dist/chunks/bin-main-NFFT5ZIU.js +126 -0
- package/dist/chunks/bin-main-NFFT5ZIU.js.map +6 -0
- package/dist/chunks/browser-VT2U6NG2.js +31 -0
- package/dist/chunks/browser-VT2U6NG2.js.map +6 -0
- package/dist/chunks/chat-UNYVLDFL.js +101 -0
- package/dist/chunks/chat-UNYVLDFL.js.map +6 -0
- package/dist/chunks/chunk-2IL6OG3X.js +311 -0
- package/dist/chunks/chunk-2IL6OG3X.js.map +6 -0
- package/dist/chunks/chunk-2RBYHHLM.js +319 -0
- package/dist/chunks/chunk-2RBYHHLM.js.map +6 -0
- package/dist/chunks/chunk-42ZK2AH4.js +71 -0
- package/dist/chunks/chunk-42ZK2AH4.js.map +6 -0
- package/dist/chunks/chunk-5PQVJBIO.js +168 -0
- package/dist/chunks/chunk-5PQVJBIO.js.map +6 -0
- package/dist/chunks/chunk-6CPT2ZBS.js +75 -0
- package/dist/chunks/chunk-6CPT2ZBS.js.map +6 -0
- package/dist/chunks/chunk-6LLJQ3KY.js +225 -0
- package/dist/chunks/chunk-6LLJQ3KY.js.map +6 -0
- package/dist/chunks/chunk-6YFJDVGA.js +161 -0
- package/dist/chunks/chunk-6YFJDVGA.js.map +6 -0
- package/dist/chunks/chunk-6YG7D7U4.js +159 -0
- package/dist/chunks/chunk-6YG7D7U4.js.map +6 -0
- package/dist/chunks/chunk-6ZPODOJN.js +828 -0
- package/dist/chunks/chunk-6ZPODOJN.js.map +6 -0
- package/dist/chunks/chunk-76FLAFCG.js +51 -0
- package/dist/chunks/chunk-76FLAFCG.js.map +6 -0
- package/dist/chunks/chunk-7HCPD673.js +25326 -0
- package/dist/chunks/chunk-7HCPD673.js.map +6 -0
- package/dist/chunks/chunk-7KWGR2YA.js +257 -0
- package/dist/chunks/chunk-7KWGR2YA.js.map +6 -0
- package/dist/chunks/chunk-A22MBIYU.js +42 -0
- package/dist/chunks/chunk-A22MBIYU.js.map +6 -0
- package/dist/chunks/chunk-AHIDYIRB.js +329 -0
- package/dist/chunks/chunk-AHIDYIRB.js.map +6 -0
- package/dist/chunks/chunk-AK2U3N2A.js +31 -0
- package/dist/chunks/chunk-AK2U3N2A.js.map +6 -0
- package/dist/chunks/chunk-AKKRZTPB.js +283 -0
- package/dist/chunks/chunk-AKKRZTPB.js.map +6 -0
- package/dist/chunks/chunk-BCZR2B3Y.js +97 -0
- package/dist/chunks/chunk-BCZR2B3Y.js.map +6 -0
- package/dist/chunks/chunk-CHIEVVQ2.js +32 -0
- package/dist/chunks/chunk-CHIEVVQ2.js.map +6 -0
- package/dist/chunks/chunk-D67YBUO3.js +110 -0
- package/dist/chunks/chunk-D67YBUO3.js.map +6 -0
- package/dist/chunks/chunk-DIHEHK7K.js +765 -0
- package/dist/chunks/chunk-DIHEHK7K.js.map +6 -0
- package/dist/chunks/chunk-E5VLANCO.js +101 -0
- package/dist/chunks/chunk-E5VLANCO.js.map +6 -0
- package/dist/chunks/chunk-EEDZOGV4.js +47 -0
- package/dist/chunks/chunk-EEDZOGV4.js.map +6 -0
- package/dist/chunks/chunk-ENGNEELC.js +271 -0
- package/dist/chunks/chunk-ENGNEELC.js.map +6 -0
- package/dist/chunks/chunk-EVY4MVRE.js +74 -0
- package/dist/chunks/chunk-EVY4MVRE.js.map +6 -0
- package/dist/chunks/chunk-FJNDNNNQ.js +115 -0
- package/dist/chunks/chunk-FJNDNNNQ.js.map +6 -0
- package/dist/chunks/chunk-FOFGMP7O.js +20 -0
- package/dist/chunks/chunk-FOFGMP7O.js.map +6 -0
- package/dist/chunks/chunk-FTMTO72X.js +95 -0
- package/dist/chunks/chunk-FTMTO72X.js.map +6 -0
- package/dist/chunks/chunk-GIXSS6KW.js +2228 -0
- package/dist/chunks/chunk-GIXSS6KW.js.map +6 -0
- package/dist/chunks/chunk-GNBMKISG.js +19 -0
- package/dist/chunks/chunk-GNBMKISG.js.map +6 -0
- package/dist/chunks/chunk-GWQEMJFS.js +28 -0
- package/dist/chunks/chunk-GWQEMJFS.js.map +6 -0
- package/dist/chunks/chunk-H6B6AROX.js +151 -0
- package/dist/chunks/chunk-H6B6AROX.js.map +6 -0
- package/dist/chunks/chunk-HE7WUOX2.js +26 -0
- package/dist/chunks/chunk-HE7WUOX2.js.map +6 -0
- package/dist/chunks/chunk-HZBKWL42.js +303 -0
- package/dist/chunks/chunk-HZBKWL42.js.map +6 -0
- package/dist/chunks/chunk-I7HQR6ET.js +75 -0
- package/dist/chunks/chunk-I7HQR6ET.js.map +6 -0
- package/dist/chunks/chunk-IJEB77SH.js +648 -0
- package/dist/chunks/chunk-IJEB77SH.js.map +6 -0
- package/dist/chunks/chunk-JNPDWME5.js +675 -0
- package/dist/chunks/chunk-JNPDWME5.js.map +6 -0
- package/dist/chunks/chunk-JORONMD3.js +18 -0
- package/dist/chunks/chunk-JORONMD3.js.map +6 -0
- package/dist/chunks/chunk-JV3LONAU.js +76 -0
- package/dist/chunks/chunk-JV3LONAU.js.map +6 -0
- package/dist/chunks/chunk-K5HARZ7G.js +82516 -0
- package/dist/chunks/chunk-K5HARZ7G.js.map +6 -0
- package/dist/chunks/chunk-KONYGNG6.js +7661 -0
- package/dist/chunks/chunk-KONYGNG6.js.map +6 -0
- package/dist/chunks/chunk-LXB3S4IC.js +19 -0
- package/dist/chunks/chunk-LXB3S4IC.js.map +6 -0
- package/dist/chunks/chunk-M3IAMIBJ.js +661 -0
- package/dist/chunks/chunk-M3IAMIBJ.js.map +6 -0
- package/dist/chunks/chunk-MH6KUKVV.js +1142 -0
- package/dist/chunks/chunk-MH6KUKVV.js.map +6 -0
- package/dist/chunks/chunk-MS3IYQ72.js +1479 -0
- package/dist/chunks/chunk-MS3IYQ72.js.map +6 -0
- package/dist/chunks/chunk-MZP6SH3M.js +3497 -0
- package/dist/chunks/chunk-MZP6SH3M.js.map +6 -0
- package/dist/chunks/chunk-N3ZEXVSS.js +76 -0
- package/dist/chunks/chunk-N3ZEXVSS.js.map +6 -0
- package/dist/chunks/chunk-N6SR54VC.js +207 -0
- package/dist/chunks/chunk-N6SR54VC.js.map +6 -0
- package/dist/chunks/chunk-NADQQMMG.js +46 -0
- package/dist/chunks/chunk-NADQQMMG.js.map +6 -0
- package/dist/chunks/chunk-NBH52WHS.js +247 -0
- package/dist/chunks/chunk-NBH52WHS.js.map +6 -0
- package/dist/chunks/chunk-NICLKFBG.js +109 -0
- package/dist/chunks/chunk-NICLKFBG.js.map +6 -0
- package/dist/chunks/chunk-NIPHHZ5G.js +283 -0
- package/dist/chunks/chunk-NIPHHZ5G.js.map +6 -0
- package/dist/chunks/chunk-NQT244I2.js +517 -0
- package/dist/chunks/chunk-NQT244I2.js.map +6 -0
- package/dist/chunks/chunk-NUGPLXVK.js +228 -0
- package/dist/chunks/chunk-NUGPLXVK.js.map +6 -0
- package/dist/chunks/chunk-OEW7CJKK.js +140 -0
- package/dist/chunks/chunk-OEW7CJKK.js.map +6 -0
- package/dist/chunks/chunk-OH6TB27S.js +111 -0
- package/dist/chunks/chunk-OH6TB27S.js.map +6 -0
- package/dist/chunks/chunk-OWH6QQY2.js +1858 -0
- package/dist/chunks/chunk-OWH6QQY2.js.map +6 -0
- package/dist/chunks/chunk-OWXJOD4H.js +773 -0
- package/dist/chunks/chunk-OWXJOD4H.js.map +6 -0
- package/dist/chunks/chunk-PT537V7B.js +787 -0
- package/dist/chunks/chunk-PT537V7B.js.map +6 -0
- package/dist/chunks/chunk-QEQZFG2X.js +106 -0
- package/dist/chunks/chunk-QEQZFG2X.js.map +6 -0
- package/dist/chunks/chunk-QL4O4UGZ.js +245 -0
- package/dist/chunks/chunk-QL4O4UGZ.js.map +6 -0
- package/dist/chunks/chunk-QL54XCF4.js +73 -0
- package/dist/chunks/chunk-QL54XCF4.js.map +6 -0
- package/dist/chunks/chunk-SB6UD3ED.js +1355 -0
- package/dist/chunks/chunk-SB6UD3ED.js.map +6 -0
- package/dist/chunks/chunk-SGGRGKGV.js +34 -0
- package/dist/chunks/chunk-SGGRGKGV.js.map +6 -0
- package/dist/chunks/chunk-SKKWMMFP.js +474 -0
- package/dist/chunks/chunk-SKKWMMFP.js.map +6 -0
- package/dist/chunks/chunk-SMIDV4KH.js +171 -0
- package/dist/chunks/chunk-SMIDV4KH.js.map +6 -0
- package/dist/chunks/chunk-T2VUTAHB.js +46 -0
- package/dist/chunks/chunk-T2VUTAHB.js.map +6 -0
- package/dist/chunks/chunk-T4SB6AAF.js +134 -0
- package/dist/chunks/chunk-T4SB6AAF.js.map +6 -0
- package/dist/chunks/chunk-TBIX6JRE.js +24 -0
- package/dist/chunks/chunk-TBIX6JRE.js.map +6 -0
- package/dist/chunks/chunk-THNCQJ33.js +11265 -0
- package/dist/chunks/chunk-THNCQJ33.js.map +6 -0
- package/dist/chunks/chunk-U56QFYGA.js +818 -0
- package/dist/chunks/chunk-U56QFYGA.js.map +6 -0
- package/dist/chunks/chunk-U6GZ7EW4.js +106 -0
- package/dist/chunks/chunk-U6GZ7EW4.js.map +6 -0
- package/dist/chunks/chunk-UDDSFIMB.js +1373 -0
- package/dist/chunks/chunk-UDDSFIMB.js.map +6 -0
- package/dist/chunks/chunk-UFHNXZL2.js +399 -0
- package/dist/chunks/chunk-UFHNXZL2.js.map +6 -0
- package/dist/chunks/chunk-US5ZFPAU.js +400 -0
- package/dist/chunks/chunk-US5ZFPAU.js.map +6 -0
- package/dist/chunks/chunk-VRL2WNQN.js +7534 -0
- package/dist/chunks/chunk-VRL2WNQN.js.map +6 -0
- package/dist/chunks/chunk-W3UQMRYA.js +380 -0
- package/dist/chunks/chunk-W3UQMRYA.js.map +6 -0
- package/dist/chunks/chunk-W5KGCUP3.js +11111 -0
- package/dist/chunks/chunk-W5KGCUP3.js.map +6 -0
- package/dist/chunks/chunk-WHODOMXA.js +132 -0
- package/dist/chunks/chunk-WHODOMXA.js.map +6 -0
- package/dist/chunks/chunk-WT6TFCPV.js +154 -0
- package/dist/chunks/chunk-WT6TFCPV.js.map +6 -0
- package/dist/chunks/chunk-WY2WUTFR.js +164 -0
- package/dist/chunks/chunk-WY2WUTFR.js.map +6 -0
- package/dist/chunks/chunk-XEUQN4JC.js +54 -0
- package/dist/chunks/chunk-XEUQN4JC.js.map +6 -0
- package/dist/chunks/chunk-Y7B67G22.js +26 -0
- package/dist/chunks/chunk-Y7B67G22.js.map +6 -0
- package/dist/chunks/chunk-YEMJX2DS.js +69 -0
- package/dist/chunks/chunk-YEMJX2DS.js.map +6 -0
- package/dist/chunks/chunk-YKLKHDZU.js +2953 -0
- package/dist/chunks/chunk-YKLKHDZU.js.map +6 -0
- package/dist/chunks/chunk-YQEWD2EN.js +127 -0
- package/dist/chunks/chunk-YQEWD2EN.js.map +6 -0
- package/dist/chunks/chunk-YYQJIECC.js +1439 -0
- package/dist/chunks/chunk-YYQJIECC.js.map +6 -0
- package/dist/chunks/chunk-ZKVZNOUS.js +106 -0
- package/dist/chunks/chunk-ZKVZNOUS.js.map +6 -0
- package/dist/chunks/chunk-ZPR4IMRT.js +36 -0
- package/dist/chunks/chunk-ZPR4IMRT.js.map +6 -0
- package/dist/chunks/chunk-ZWA2JRJV.js +45 -0
- package/dist/chunks/chunk-ZWA2JRJV.js.map +6 -0
- package/dist/chunks/cli-runtime-F4MBZ2UQ.js +129 -0
- package/dist/chunks/cli-runtime-F4MBZ2UQ.js.map +6 -0
- package/dist/chunks/commands-GMQGFTIY.js +21 -0
- package/dist/chunks/commands-GMQGFTIY.js.map +6 -0
- package/dist/chunks/computer-GXDY4H35.js +493 -0
- package/dist/chunks/computer-GXDY4H35.js.map +6 -0
- package/dist/chunks/crash-report-STOHSORG.js +21 -0
- package/dist/chunks/crash-report-STOHSORG.js.map +6 -0
- package/dist/chunks/devtools-LBE4PAQN.js +3851 -0
- package/dist/chunks/devtools-LBE4PAQN.js.map +6 -0
- package/dist/chunks/dist-3AF2X4S5.js +1339 -0
- package/dist/chunks/dist-3AF2X4S5.js.map +6 -0
- package/dist/chunks/dist-AZIMHV2B.js +514 -0
- package/dist/chunks/dist-AZIMHV2B.js.map +6 -0
- package/dist/chunks/dist-BGYRQ5BC.js +555 -0
- package/dist/chunks/dist-BGYRQ5BC.js.map +6 -0
- package/dist/chunks/dist-OTTZ7WVD.js +1415 -0
- package/dist/chunks/dist-OTTZ7WVD.js.map +6 -0
- package/dist/chunks/dist-R3I3ATSG.js +1018 -0
- package/dist/chunks/dist-R3I3ATSG.js.map +6 -0
- package/dist/chunks/dist-TXEKDBQO.js +40642 -0
- package/dist/chunks/dist-TXEKDBQO.js.map +6 -0
- package/dist/chunks/dist-XTWYQHHN.js +520 -0
- package/dist/chunks/dist-XTWYQHHN.js.map +6 -0
- package/dist/chunks/doctor-VXSB4Y4P.js +28 -0
- package/dist/chunks/doctor-VXSB4Y4P.js.map +6 -0
- package/dist/chunks/drain-DXVICQBR.js +471 -0
- package/dist/chunks/drain-DXVICQBR.js.map +6 -0
- package/dist/chunks/endpoint-M2DDENPP.js +15 -0
- package/dist/chunks/endpoint-M2DDENPP.js.map +6 -0
- package/dist/chunks/eval-BMJQXDKA.js +187 -0
- package/dist/chunks/eval-BMJQXDKA.js.map +6 -0
- package/dist/chunks/exec-3T5ESZPH.js +1284 -0
- package/dist/chunks/exec-3T5ESZPH.js.map +6 -0
- package/dist/chunks/home-ILHA7B6Z.js +16 -0
- package/dist/chunks/home-ILHA7B6Z.js.map +6 -0
- package/dist/chunks/host-queries-QCMWDZGS.js +152 -0
- package/dist/chunks/host-queries-QCMWDZGS.js.map +6 -0
- package/dist/chunks/lib-KXZZJJG2.js +2657 -0
- package/dist/chunks/lib-KXZZJJG2.js.map +6 -0
- package/dist/chunks/lifecycle-CB23VJI7.js +63 -0
- package/dist/chunks/lifecycle-CB23VJI7.js.map +6 -0
- package/dist/chunks/list-N6WXZBMD.js +293 -0
- package/dist/chunks/list-N6WXZBMD.js.map +6 -0
- package/dist/chunks/login-26NCG6EQ.js +29 -0
- package/dist/chunks/login-26NCG6EQ.js.map +6 -0
- package/dist/chunks/logs-V7SNM7LA.js +116 -0
- package/dist/chunks/logs-V7SNM7LA.js.map +6 -0
- package/dist/chunks/mcp-BTHCU5ZC.js +763 -0
- package/dist/chunks/mcp-BTHCU5ZC.js.map +6 -0
- package/dist/chunks/message-command-HMIOR52C.js +170 -0
- package/dist/chunks/message-command-HMIOR52C.js.map +6 -0
- package/dist/chunks/node-QB2FA2ZB.js +916 -0
- package/dist/chunks/node-QB2FA2ZB.js.map +6 -0
- package/dist/chunks/operator-tools-7LMWOHSN.js +115 -0
- package/dist/chunks/operator-tools-7LMWOHSN.js.map +6 -0
- package/dist/chunks/output-schema-XCONYVZ7.js +11 -0
- package/dist/chunks/output-schema-XCONYVZ7.js.map +6 -0
- package/dist/chunks/pal-YEUKHA6F.js +200 -0
- package/dist/chunks/pal-YEUKHA6F.js.map +6 -0
- package/dist/chunks/paths-DXYFKIJU.js +10 -0
- package/dist/chunks/paths-DXYFKIJU.js.map +6 -0
- package/dist/chunks/pica-WNHDDIFX.js +1736 -0
- package/dist/chunks/pica-WNHDDIFX.js.map +6 -0
- package/dist/chunks/providers-EI3FAKYB.js +160 -0
- package/dist/chunks/providers-EI3FAKYB.js.map +6 -0
- package/dist/chunks/resident-5ZY6OG6B.js +1314 -0
- package/dist/chunks/resident-5ZY6OG6B.js.map +6 -0
- package/dist/chunks/resume-command-ONYRZIIA.js +22 -0
- package/dist/chunks/resume-command-ONYRZIIA.js.map +6 -0
- package/dist/chunks/schedule-6JPEO4NR.js +143 -0
- package/dist/chunks/schedule-6JPEO4NR.js.map +6 -0
- package/dist/chunks/serve-S7UWNIR3.js +21 -0
- package/dist/chunks/serve-S7UWNIR3.js.map +6 -0
- package/dist/chunks/service-WSW3M6K5.js +1633 -0
- package/dist/chunks/service-WSW3M6K5.js.map +6 -0
- package/dist/chunks/session-step-2VZM3CCA.js +26 -0
- package/dist/chunks/session-step-2VZM3CCA.js.map +6 -0
- package/dist/chunks/skills-KAZJYGX5.js +282 -0
- package/dist/chunks/skills-KAZJYGX5.js.map +6 -0
- package/dist/chunks/state-263OUKQA.js +717 -0
- package/dist/chunks/state-263OUKQA.js.map +6 -0
- package/dist/chunks/store-3XLCJ7EL.js +42 -0
- package/dist/chunks/store-3XLCJ7EL.js.map +6 -0
- package/dist/chunks/store-KN65QI2M.js +82 -0
- package/dist/chunks/store-KN65QI2M.js.map +6 -0
- package/dist/chunks/store-X3TESBIN.js +34 -0
- package/dist/chunks/store-X3TESBIN.js.map +6 -0
- package/dist/chunks/tui-5MU7JBXX.js +56703 -0
- package/dist/chunks/tui-5MU7JBXX.js.map +6 -0
- package/dist/chunks/upgrade-BYM4MWBC.js +315 -0
- package/dist/chunks/upgrade-BYM4MWBC.js.map +6 -0
- package/dist/chunks/webapi-6HUHZUAH.js +2715 -0
- package/dist/chunks/webapi-6HUHZUAH.js.map +6 -0
- package/dist/chunks/worktree-K3ZIPXRM.js +116 -0
- package/dist/chunks/worktree-K3ZIPXRM.js.map +6 -0
- package/dist/cli-runtime.d.ts +19 -0
- package/dist/cli-runtime.d.ts.map +1 -0
- package/dist/cli.d.ts +0 -15
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/acp-harness.d.ts +64 -0
- package/dist/commands/acp-harness.d.ts.map +1 -0
- package/dist/commands/acp-provider-retry.d.ts +27 -0
- package/dist/commands/acp-provider-retry.d.ts.map +1 -0
- package/dist/commands/acp.d.ts +134 -3
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/computer.d.ts +3 -0
- package/dist/commands/computer.d.ts.map +1 -0
- package/dist/commands/desktop-host-changes.d.ts +65 -0
- package/dist/commands/desktop-host-changes.d.ts.map +1 -0
- package/dist/commands/desktop-host-header.d.ts +30 -0
- package/dist/commands/desktop-host-header.d.ts.map +1 -0
- package/dist/commands/desktop-host.d.ts +354 -0
- package/dist/commands/desktop-host.d.ts.map +1 -0
- package/dist/commands/desktop-model-catalogue.d.ts +25 -0
- package/dist/commands/desktop-model-catalogue.d.ts.map +1 -0
- package/dist/commands/effort-levels.d.ts +3 -0
- package/dist/commands/effort-levels.d.ts.map +1 -0
- package/dist/commands/exec-flags.d.ts +4 -0
- package/dist/commands/exec-flags.d.ts.map +1 -1
- package/dist/commands/exec.d.ts.map +1 -1
- package/dist/commands/lazy.d.ts +20 -0
- package/dist/commands/lazy.d.ts.map +1 -0
- package/dist/commands/manifest.d.ts +33 -0
- package/dist/commands/manifest.d.ts.map +1 -0
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/pal.d.ts +5 -0
- package/dist/commands/pal.d.ts.map +1 -0
- package/dist/commands/permission-preview.d.ts +38 -0
- package/dist/commands/permission-preview.d.ts.map +1 -0
- package/dist/commands/registry.d.ts +10 -0
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/serve.d.ts +1 -12
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/stdin.d.ts.map +1 -1
- package/dist/commands/upgrade.d.ts +14 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/compile-cache-enable.d.ts +2 -0
- package/dist/compile-cache-enable.d.ts.map +1 -0
- package/dist/compile-cache.d.ts +53 -0
- package/dist/compile-cache.d.ts.map +1 -0
- package/dist/computer/bundle.d.ts +18 -0
- package/dist/computer/bundle.d.ts.map +1 -0
- package/dist/computer/run.d.ts +26 -0
- package/dist/computer/run.d.ts.map +1 -0
- package/dist/computer/sentences.d.ts +30 -0
- package/dist/computer/sentences.d.ts.map +1 -0
- package/dist/config/load.d.ts +10 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/context/capabilities.d.ts +25 -2
- package/dist/context/capabilities.d.ts.map +1 -1
- package/dist/context/runtime-message.d.ts.map +1 -1
- package/dist/crash-report.d.ts +22 -0
- package/dist/crash-report.d.ts.map +1 -0
- package/dist/debug-requested.d.ts +7 -0
- package/dist/debug-requested.d.ts.map +1 -0
- package/dist/doctor/checks/credentials.d.ts.map +1 -1
- package/dist/exit-codes.d.ts +9 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/index.js +105 -17
- package/dist/index.js.map +6 -1
- package/dist/integrations/harness/claude-adapter.d.ts +20 -0
- package/dist/integrations/harness/claude-adapter.d.ts.map +1 -0
- package/dist/integrations/harness/claude-protocol.d.ts +67 -0
- package/dist/integrations/harness/claude-protocol.d.ts.map +1 -0
- package/dist/integrations/harness/codex-adapter.d.ts +80 -0
- package/dist/integrations/harness/codex-adapter.d.ts.map +1 -0
- package/dist/integrations/harness/codex-protocol.d.ts +22 -0
- package/dist/integrations/harness/codex-protocol.d.ts.map +1 -0
- package/dist/integrations/harness/model-cache.d.ts +16 -0
- package/dist/integrations/harness/model-cache.d.ts.map +1 -0
- package/dist/integrations/harness/native-executable.d.ts +8 -0
- package/dist/integrations/harness/native-executable.d.ts.map +1 -0
- package/dist/integrations/harness/process.d.ts +25 -0
- package/dist/integrations/harness/process.d.ts.map +1 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/peers/runtime.d.ts +64 -0
- package/dist/integrations/peers/runtime.d.ts.map +1 -0
- package/dist/integrations/plugins/inventory.d.ts +27 -0
- package/dist/integrations/plugins/inventory.d.ts.map +1 -0
- package/dist/integrations/providers/composer-settings.d.ts +33 -0
- package/dist/integrations/providers/composer-settings.d.ts.map +1 -0
- package/dist/integrations/providers/connections.d.ts +37 -0
- package/dist/integrations/providers/connections.d.ts.map +1 -0
- package/dist/integrations/providers/credential-store.d.ts +35 -0
- package/dist/integrations/providers/credential-store.d.ts.map +1 -1
- package/dist/integrations/providers/discover.d.ts +27 -1
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/index.d.ts +2 -2
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/picker-operation.d.ts +6 -0
- package/dist/integrations/providers/picker-operation.d.ts.map +1 -0
- package/dist/integrations/providers/setup.d.ts +16 -1
- package/dist/integrations/providers/setup.d.ts.map +1 -1
- package/dist/integrations/resident/runner-worker.js +190 -161
- package/dist/integrations/resident/runner-worker.js.map +6 -1
- package/dist/integrations/resident/session-step.d.ts.map +1 -1
- package/dist/integrations/sessions/display-title.d.ts +8 -0
- package/dist/integrations/sessions/display-title.d.ts.map +1 -1
- package/dist/integrations/sessions/store.d.ts +23 -9
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/task-context.d.ts +1 -1
- package/dist/integrations/sessions/task-context.d.ts.map +1 -1
- package/dist/integrations/sessions/transcript-export.d.ts.map +1 -1
- package/dist/integrations/subagents/activity.d.ts +9 -6
- package/dist/integrations/subagents/activity.d.ts.map +1 -1
- package/dist/integrations/subagents/operator-journal.d.ts +20 -0
- package/dist/integrations/subagents/operator-journal.d.ts.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +11 -0
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/trust/store.d.ts +14 -0
- package/dist/integrations/trust/store.d.ts.map +1 -1
- package/dist/integrations/web/search.d.ts +1 -1
- package/dist/pals/actions.d.ts +57 -0
- package/dist/pals/actions.d.ts.map +1 -0
- package/dist/pals/activity-command.d.ts +3 -0
- package/dist/pals/activity-command.d.ts.map +1 -0
- package/dist/pals/activity.d.ts +18 -0
- package/dist/pals/activity.d.ts.map +1 -0
- package/dist/pals/agent-session.d.ts +19 -0
- package/dist/pals/agent-session.d.ts.map +1 -0
- package/dist/pals/channel-actions.d.ts +5 -0
- package/dist/pals/channel-actions.d.ts.map +1 -0
- package/dist/pals/channel-local.d.ts +7 -0
- package/dist/pals/channel-local.d.ts.map +1 -0
- package/dist/pals/channel.d.ts +20 -0
- package/dist/pals/channel.d.ts.map +1 -0
- package/dist/pals/chat.d.ts +6 -0
- package/dist/pals/chat.d.ts.map +1 -0
- package/dist/pals/communication.d.ts +47 -0
- package/dist/pals/communication.d.ts.map +1 -0
- package/dist/pals/conversations.d.ts +26 -0
- package/dist/pals/conversations.d.ts.map +1 -0
- package/dist/pals/desktop-communication.d.ts +111 -0
- package/dist/pals/desktop-communication.d.ts.map +1 -0
- package/dist/pals/dispatch.d.ts +13 -0
- package/dist/pals/dispatch.d.ts.map +1 -0
- package/dist/pals/environment.d.ts +103 -0
- package/dist/pals/environment.d.ts.map +1 -0
- package/dist/pals/guest-mcp-transport.d.ts +28 -0
- package/dist/pals/guest-mcp-transport.d.ts.map +1 -0
- package/dist/pals/guest-mcp.d.ts +22 -0
- package/dist/pals/guest-mcp.d.ts.map +1 -0
- package/dist/pals/inbox-start.d.ts +35 -0
- package/dist/pals/inbox-start.d.ts.map +1 -0
- package/dist/pals/message-command.d.ts +3 -0
- package/dist/pals/message-command.d.ts.map +1 -0
- package/dist/pals/operator-tools.d.ts +23 -0
- package/dist/pals/operator-tools.d.ts.map +1 -0
- package/dist/pals/public-transcript.d.ts +4 -0
- package/dist/pals/public-transcript.d.ts.map +1 -0
- package/dist/pals/review.d.ts +16 -0
- package/dist/pals/review.d.ts.map +1 -0
- package/dist/pals/store.d.ts +16 -0
- package/dist/pals/store.d.ts.map +1 -0
- package/dist/pals/tui-session.d.ts +11 -0
- package/dist/pals/tui-session.d.ts.map +1 -0
- package/dist/permissions/mode-names.d.ts +2 -0
- package/dist/permissions/mode-names.d.ts.map +1 -0
- package/dist/resume-invocation.d.ts +1 -1
- package/dist/resume-invocation.d.ts.map +1 -1
- package/dist/resume-shell.d.ts +8 -0
- package/dist/resume-shell.d.ts.map +1 -0
- package/dist/schedule/build.d.ts +12 -3
- package/dist/schedule/build.d.ts.map +1 -1
- package/dist/schedule/commands/add.d.ts +1 -1
- package/dist/schedule/commands/add.d.ts.map +1 -1
- package/dist/schedule/commands/lifecycle.d.ts.map +1 -1
- package/dist/schedule/commands/list.d.ts +3 -1
- package/dist/schedule/commands/list.d.ts.map +1 -1
- package/dist/schedule/daemon/daemon.d.ts +2 -0
- package/dist/schedule/daemon/daemon.d.ts.map +1 -1
- package/dist/schedule/delivery.d.ts +66 -0
- package/dist/schedule/delivery.d.ts.map +1 -0
- package/dist/schedule/fire/fire.d.ts +1 -1
- package/dist/schedule/fire/fire.d.ts.map +1 -1
- package/dist/schedule/fire/run-script.d.ts +2 -2
- package/dist/schedule/fire/run-script.d.ts.map +1 -1
- package/dist/schedule/fire/script-report.d.ts +31 -0
- package/dist/schedule/fire/script-report.d.ts.map +1 -0
- package/dist/schedule/floor.d.ts +1 -1
- package/dist/schedule/floor.d.ts.map +1 -1
- package/dist/schedule/folder.d.ts +6 -0
- package/dist/schedule/folder.d.ts.map +1 -1
- package/dist/schedule/resume-command.d.ts +3 -3
- package/dist/schedule/resume-command.d.ts.map +1 -1
- package/dist/schedule/store/history.d.ts.map +1 -1
- package/dist/schedule/store/jobs.d.ts +6 -6
- package/dist/schedule/store/jobs.d.ts.map +1 -1
- package/dist/schedule/store/script-state.d.ts +31 -0
- package/dist/schedule/store/script-state.d.ts.map +1 -0
- package/dist/schedule/store/state.d.ts +4 -2
- package/dist/schedule/store/state.d.ts.map +1 -1
- package/dist/schedule/types.d.ts +61 -16
- package/dist/schedule/types.d.ts.map +1 -1
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/terminal/host.d.ts +22 -0
- package/dist/terminal/host.d.ts.map +1 -0
- package/dist/terminal/manager.d.ts +124 -0
- package/dist/terminal/manager.d.ts.map +1 -0
- package/dist/terminal/protocol.d.ts +162 -0
- package/dist/terminal/protocol.d.ts.map +1 -0
- package/dist/terminal/pty.d.ts +85 -0
- package/dist/terminal/pty.d.ts.map +1 -0
- package/dist/terminal/ring.d.ts +23 -0
- package/dist/terminal/ring.d.ts.map +1 -0
- package/dist/terminal/screen.d.ts +31 -0
- package/dist/terminal/screen.d.ts.map +1 -0
- package/dist/termination-state.d.ts +19 -0
- package/dist/termination-state.d.ts.map +1 -0
- package/dist/termination.d.ts +2 -9
- package/dist/termination.d.ts.map +1 -1
- package/dist/tui/AgentExplorer.d.ts +4 -1
- package/dist/tui/AgentExplorer.d.ts.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/BackgroundJobsPanel.d.ts +26 -0
- package/dist/tui/BackgroundJobsPanel.d.ts.map +1 -0
- package/dist/tui/BrandHeader.d.ts.map +1 -1
- package/dist/tui/ChildComposer.d.ts +22 -0
- package/dist/tui/ChildComposer.d.ts.map +1 -0
- package/dist/tui/ChoicePicker.d.ts.map +1 -1
- package/dist/tui/Composer.d.ts +25 -4
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/ComposerFrame.d.ts.map +1 -1
- package/dist/tui/CopyPicker.d.ts.map +1 -1
- package/dist/tui/EditPromptPicker.d.ts.map +1 -1
- package/dist/tui/EffortSlider.d.ts.map +1 -1
- package/dist/tui/LiveActivity.d.ts +7 -1
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/PendingInputPanel.d.ts +34 -0
- package/dist/tui/PendingInputPanel.d.ts.map +1 -0
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/ProviderSetup.d.ts.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/SaveSkillOverlay.d.ts.map +1 -1
- package/dist/tui/ScheduleReviewOverlay.d.ts +1 -1
- package/dist/tui/ScheduleReviewOverlay.d.ts.map +1 -1
- package/dist/tui/StatusBar.d.ts +7 -1
- package/dist/tui/StatusBar.d.ts.map +1 -1
- package/dist/tui/StatusPanel.d.ts.map +1 -1
- package/dist/tui/TextPrompt.d.ts.map +1 -1
- package/dist/tui/ToolOutputViewer.d.ts.map +1 -1
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/TrustPrompt.d.ts +8 -0
- package/dist/tui/TrustPrompt.d.ts.map +1 -1
- package/dist/tui/agent.d.ts +135 -6
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/browser-notices.d.ts.map +1 -1
- package/dist/tui/capability-notice.d.ts +38 -0
- package/dist/tui/capability-notice.d.ts.map +1 -0
- package/dist/tui/console-input.d.ts +31 -0
- package/dist/tui/console-input.d.ts.map +1 -0
- package/dist/tui/conversation-evidence-view.d.ts.map +1 -1
- package/dist/tui/credential-entry.d.ts.map +1 -1
- package/dist/tui/exit-summary.d.ts +9 -1
- package/dist/tui/exit-summary.d.ts.map +1 -1
- package/dist/tui/external-editor.d.ts.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/key-hints.d.ts +51 -0
- package/dist/tui/key-hints.d.ts.map +1 -0
- package/dist/tui/launch-settings.d.ts +34 -0
- package/dist/tui/launch-settings.d.ts.map +1 -0
- package/dist/tui/log-pane.d.ts.map +1 -1
- package/dist/tui/model-choices.d.ts +39 -1
- package/dist/tui/model-choices.d.ts.map +1 -1
- package/dist/tui/model-search.d.ts +4 -1
- package/dist/tui/model-search.d.ts.map +1 -1
- package/dist/tui/output-size-watch.d.ts +32 -0
- package/dist/tui/output-size-watch.d.ts.map +1 -0
- package/dist/tui/permission-review.d.ts.map +1 -1
- package/dist/tui/person-terms.d.ts +58 -0
- package/dist/tui/person-terms.d.ts.map +1 -0
- package/dist/tui/plain-failure.d.ts +27 -0
- package/dist/tui/plain-failure.d.ts.map +1 -0
- package/dist/tui/plain-interruption.d.ts +46 -0
- package/dist/tui/plain-interruption.d.ts.map +1 -0
- package/dist/tui/provider-list.d.ts.map +1 -1
- package/dist/tui/render-mode.d.ts +19 -0
- package/dist/tui/render-mode.d.ts.map +1 -0
- package/dist/tui/schedule/host-commands.d.ts +2 -9
- package/dist/tui/schedule/host-commands.d.ts.map +1 -1
- package/dist/tui/schedule/integration.d.ts +8 -0
- package/dist/tui/schedule/integration.d.ts.map +1 -1
- package/dist/tui/schedule/source-deliveries.d.ts +37 -0
- package/dist/tui/schedule/source-deliveries.d.ts.map +1 -0
- package/dist/tui/schedule/startup.d.ts.map +1 -1
- package/dist/tui/schedule/tool-host.d.ts +3 -1
- package/dist/tui/schedule/tool-host.d.ts.map +1 -1
- package/dist/tui/setup-text.d.ts +14 -0
- package/dist/tui/setup-text.d.ts.map +1 -0
- package/dist/tui/shell-escape.d.ts.map +1 -1
- package/dist/tui/skills/suggest-setting.d.ts.map +1 -1
- package/dist/tui/slashCommands.d.ts +9 -2
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/terminal-choice-text.d.ts +7 -0
- package/dist/tui/terminal-choice-text.d.ts.map +1 -1
- package/dist/tui/tidy-tool-output.d.ts +83 -0
- package/dist/tui/tidy-tool-output.d.ts.map +1 -0
- package/dist/tui/tool-presentation.d.ts +6 -0
- package/dist/tui/tool-presentation.d.ts.map +1 -0
- package/dist/tui/triggers/copy.d.ts.map +1 -1
- package/dist/tui/triggers/setting.d.ts.map +1 -1
- package/dist/tui/turn-interruption.d.ts +1 -1
- package/dist/tui/turn-interruption.d.ts.map +1 -1
- package/dist/tui/turn-limits-settings.d.ts +4 -4
- package/dist/tui/turn-limits-settings.d.ts.map +1 -1
- package/dist/tui/types.d.ts +10 -0
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/web-activity.d.ts +3 -2
- package/dist/tui/web-activity.d.ts.map +1 -1
- package/dist/tui/zen-free-refusal.d.ts +17 -0
- package/dist/tui/zen-free-refusal.d.ts.map +1 -0
- package/dist/usage-error.d.ts +15 -0
- package/dist/usage-error.d.ts.map +1 -0
- package/dist/warning-filter.d.ts +30 -0
- package/dist/warning-filter.d.ts.map +1 -0
- package/package.json +22 -11
- package/skills/schedule-task/SKILL.md +74 -20
- package/dist/browser/commands.js +0 -365
- package/dist/browser/commands.js.map +0 -1
- package/dist/browser/control.js +0 -140
- package/dist/browser/control.js.map +0 -1
- package/dist/browser/describe.js +0 -27
- package/dist/browser/describe.js.map +0 -1
- package/dist/checkpoints/store.js +0 -192
- package/dist/checkpoints/store.js.map +0 -1
- package/dist/checkpoints/wrap.js +0 -37
- package/dist/checkpoints/wrap.js.map +0 -1
- package/dist/cli.js +0 -602
- package/dist/cli.js.map +0 -1
- package/dist/commands/acp.js +0 -388
- package/dist/commands/acp.js.map +0 -1
- package/dist/commands/archive.js +0 -65
- package/dist/commands/archive.js.map +0 -1
- package/dist/commands/browser.js +0 -16
- package/dist/commands/browser.js.map +0 -1
- package/dist/commands/doctor.js +0 -267
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drain.js +0 -498
- package/dist/commands/drain.js.map +0 -1
- package/dist/commands/eval.js +0 -237
- package/dist/commands/eval.js.map +0 -1
- package/dist/commands/exec-flags.js +0 -334
- package/dist/commands/exec-flags.js.map +0 -1
- package/dist/commands/exec-json.js +0 -497
- package/dist/commands/exec-json.js.map +0 -1
- package/dist/commands/exec.js +0 -688
- package/dist/commands/exec.js.map +0 -1
- package/dist/commands/host-queries.js +0 -156
- package/dist/commands/host-queries.js.map +0 -1
- package/dist/commands/login.js +0 -315
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/mcp-oauth-login.js +0 -213
- package/dist/commands/mcp-oauth-login.js.map +0 -1
- package/dist/commands/mcp.js +0 -288
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/prior-messages.js +0 -329
- package/dist/commands/prior-messages.js.map +0 -1
- package/dist/commands/provider-wait.js +0 -65
- package/dist/commands/provider-wait.js.map +0 -1
- package/dist/commands/registry.js +0 -40
- package/dist/commands/registry.js.map +0 -1
- package/dist/commands/resident-flags.js +0 -193
- package/dist/commands/resident-flags.js.map +0 -1
- package/dist/commands/resident-learning.js +0 -293
- package/dist/commands/resident-learning.js.map +0 -1
- package/dist/commands/resident.js +0 -419
- package/dist/commands/resident.js.map +0 -1
- package/dist/commands/resume.js +0 -109
- package/dist/commands/resume.js.map +0 -1
- package/dist/commands/schedule.js +0 -131
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/serve.js +0 -21
- package/dist/commands/serve.js.map +0 -1
- package/dist/commands/skills.js +0 -178
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/state.js +0 -110
- package/dist/commands/state.js.map +0 -1
- package/dist/commands/stdin.js +0 -69
- package/dist/commands/stdin.js.map +0 -1
- package/dist/commands/types.js +0 -2
- package/dist/commands/types.js.map +0 -1
- package/dist/commands/upgrade-progress.js +0 -54
- package/dist/commands/upgrade-progress.js.map +0 -1
- package/dist/commands/upgrade.js +0 -232
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/worktree.js +0 -86
- package/dist/commands/worktree.js.map +0 -1
- package/dist/config/composer-triggers.js +0 -80
- package/dist/config/composer-triggers.js.map +0 -1
- package/dist/config/debug.js +0 -126
- package/dist/config/debug.js.map +0 -1
- package/dist/config/load.js +0 -1208
- package/dist/config/load.js.map +0 -1
- package/dist/config/schema.js +0 -13
- package/dist/config/schema.js.map +0 -1
- package/dist/config/tool-result-screens.js +0 -104
- package/dist/config/tool-result-screens.js.map +0 -1
- package/dist/config/trusted-project-context.js +0 -28
- package/dist/config/trusted-project-context.js.map +0 -1
- package/dist/config/turn-guards.js +0 -46
- package/dist/config/turn-guards.js.map +0 -1
- package/dist/config/user-config.js +0 -118
- package/dist/config/user-config.js.map +0 -1
- package/dist/context/capabilities.js +0 -164
- package/dist/context/capabilities.js.map +0 -1
- package/dist/context/directories.js +0 -69
- package/dist/context/directories.js.map +0 -1
- package/dist/context/doctrine.js +0 -24
- package/dist/context/doctrine.js.map +0 -1
- package/dist/context/environment.js +0 -255
- package/dist/context/environment.js.map +0 -1
- package/dist/context/project-path.js +0 -16
- package/dist/context/project-path.js.map +0 -1
- package/dist/context/project-tracker.js +0 -217
- package/dist/context/project-tracker.js.map +0 -1
- package/dist/context/project.js +0 -256
- package/dist/context/project.js.map +0 -1
- package/dist/context/runtime-message.js +0 -30
- package/dist/context/runtime-message.js.map +0 -1
- package/dist/context/sandbox.js +0 -114
- package/dist/context/sandbox.js.map +0 -1
- package/dist/context/turn-snapshot.js +0 -122
- package/dist/context/turn-snapshot.js.map +0 -1
- package/dist/doctor/checks/browser.js +0 -63
- package/dist/doctor/checks/browser.js.map +0 -1
- package/dist/doctor/checks/chain.js +0 -211
- package/dist/doctor/checks/chain.js.map +0 -1
- package/dist/doctor/checks/credentials.js +0 -98
- package/dist/doctor/checks/credentials.js.map +0 -1
- package/dist/doctor/checks/index.js +0 -72
- package/dist/doctor/checks/index.js.map +0 -1
- package/dist/doctor/checks/invariants.js +0 -79
- package/dist/doctor/checks/invariants.js.map +0 -1
- package/dist/doctor/checks/logging.js +0 -69
- package/dist/doctor/checks/logging.js.map +0 -1
- package/dist/doctor/checks/providers.js +0 -30
- package/dist/doctor/checks/providers.js.map +0 -1
- package/dist/doctor/checks/runtime.js +0 -40
- package/dist/doctor/checks/runtime.js.map +0 -1
- package/dist/doctor/checks/sandbox.js +0 -76
- package/dist/doctor/checks/sandbox.js.map +0 -1
- package/dist/doctor/checks/scheduler.js +0 -74
- package/dist/doctor/checks/scheduler.js.map +0 -1
- package/dist/doctor/checks/session-export.js +0 -62
- package/dist/doctor/checks/session-export.js.map +0 -1
- package/dist/doctor/checks/telemetry.js +0 -58
- package/dist/doctor/checks/telemetry.js.map +0 -1
- package/dist/doctor/checks/vault.js +0 -67
- package/dist/doctor/checks/vault.js.map +0 -1
- package/dist/doctor/index.js +0 -3
- package/dist/doctor/index.js.map +0 -1
- package/dist/doctor/registry.js +0 -230
- package/dist/doctor/registry.js.map +0 -1
- package/dist/exit-codes.js +0 -62
- package/dist/exit-codes.js.map +0 -1
- package/dist/installation.js +0 -48
- package/dist/installation.js.map +0 -1
- package/dist/integrations/clipboard/image.js +0 -119
- package/dist/integrations/clipboard/image.js.map +0 -1
- package/dist/integrations/clipboard/text.js +0 -43
- package/dist/integrations/clipboard/text.js.map +0 -1
- package/dist/integrations/files/attachment-store.js +0 -86
- package/dist/integrations/files/attachment-store.js.map +0 -1
- package/dist/integrations/mcp/oauth-store.js +0 -549
- package/dist/integrations/mcp/oauth-store.js.map +0 -1
- package/dist/integrations/mcp/servers.js +0 -519
- package/dist/integrations/mcp/servers.js.map +0 -1
- package/dist/integrations/mcp/user-config.js +0 -92
- package/dist/integrations/mcp/user-config.js.map +0 -1
- package/dist/integrations/notifications/desktop/freedesktop.js +0 -33
- package/dist/integrations/notifications/desktop/freedesktop.js.map +0 -1
- package/dist/integrations/notifications/desktop/macos.js +0 -17
- package/dist/integrations/notifications/desktop/macos.js.map +0 -1
- package/dist/integrations/notifications/desktop/sanitize.js +0 -49
- package/dist/integrations/notifications/desktop/sanitize.js.map +0 -1
- package/dist/integrations/notifications/desktop/throttle.js +0 -39
- package/dist/integrations/notifications/desktop/throttle.js.map +0 -1
- package/dist/integrations/notifications/desktop/windows-toast.js +0 -56
- package/dist/integrations/notifications/desktop/windows-toast.js.map +0 -1
- package/dist/integrations/notifications/desktop.js +0 -199
- package/dist/integrations/notifications/desktop.js.map +0 -1
- package/dist/integrations/notifications/terminal.js +0 -46
- package/dist/integrations/notifications/terminal.js.map +0 -1
- package/dist/integrations/npm-invocation.js +0 -23
- package/dist/integrations/npm-invocation.js.map +0 -1
- package/dist/integrations/plugins/runtime.js +0 -189
- package/dist/integrations/plugins/runtime.js.map +0 -1
- package/dist/integrations/plugins/settings.js +0 -106
- package/dist/integrations/plugins/settings.js.map +0 -1
- package/dist/integrations/providers/access.js +0 -23
- package/dist/integrations/providers/access.js.map +0 -1
- package/dist/integrations/providers/chain-capabilities.js +0 -211
- package/dist/integrations/providers/chain-capabilities.js.map +0 -1
- package/dist/integrations/providers/codex-device-login.js +0 -195
- package/dist/integrations/providers/codex-device-login.js.map +0 -1
- package/dist/integrations/providers/codex-oauth.js +0 -95
- package/dist/integrations/providers/codex-oauth.js.map +0 -1
- package/dist/integrations/providers/credential-provider.js +0 -74
- package/dist/integrations/providers/credential-provider.js.map +0 -1
- package/dist/integrations/providers/credential-store.js +0 -657
- package/dist/integrations/providers/credential-store.js.map +0 -1
- package/dist/integrations/providers/current-credential.js +0 -45
- package/dist/integrations/providers/current-credential.js.map +0 -1
- package/dist/integrations/providers/discover.js +0 -313
- package/dist/integrations/providers/discover.js.map +0 -1
- package/dist/integrations/providers/gemini-credentials.js +0 -148
- package/dist/integrations/providers/gemini-credentials.js.map +0 -1
- package/dist/integrations/providers/harness-credentials.js +0 -344
- package/dist/integrations/providers/harness-credentials.js.map +0 -1
- package/dist/integrations/providers/identity.js +0 -64
- package/dist/integrations/providers/identity.js.map +0 -1
- package/dist/integrations/providers/index.js +0 -14
- package/dist/integrations/providers/index.js.map +0 -1
- package/dist/integrations/providers/keychain.js +0 -78
- package/dist/integrations/providers/keychain.js.map +0 -1
- package/dist/integrations/providers/model-reasoning.js +0 -51
- package/dist/integrations/providers/model-reasoning.js.map +0 -1
- package/dist/integrations/providers/oauth.js +0 -302
- package/dist/integrations/providers/oauth.js.map +0 -1
- package/dist/integrations/providers/preferences.js +0 -287
- package/dist/integrations/providers/preferences.js.map +0 -1
- package/dist/integrations/providers/register.js +0 -154
- package/dist/integrations/providers/register.js.map +0 -1
- package/dist/integrations/providers/registry.js +0 -289
- package/dist/integrations/providers/registry.js.map +0 -1
- package/dist/integrations/providers/setup.js +0 -158
- package/dist/integrations/providers/setup.js.map +0 -1
- package/dist/integrations/providers/subscription-login.js +0 -328
- package/dist/integrations/providers/subscription-login.js.map +0 -1
- package/dist/integrations/providers/zen-catalogue.js +0 -196
- package/dist/integrations/providers/zen-catalogue.js.map +0 -1
- package/dist/integrations/resident/foreground.js +0 -95
- package/dist/integrations/resident/foreground.js.map +0 -1
- package/dist/integrations/resident/inspection.js +0 -282
- package/dist/integrations/resident/inspection.js.map +0 -1
- package/dist/integrations/resident/learning-sources.js +0 -79
- package/dist/integrations/resident/learning-sources.js.map +0 -1
- package/dist/integrations/resident/learning-storage.js +0 -55
- package/dist/integrations/resident/learning-storage.js.map +0 -1
- package/dist/integrations/resident/lifecycle-errors.js +0 -15
- package/dist/integrations/resident/lifecycle-errors.js.map +0 -1
- package/dist/integrations/resident/owned-runner.js +0 -91
- package/dist/integrations/resident/owned-runner.js.map +0 -1
- package/dist/integrations/resident/runner-control.js +0 -238
- package/dist/integrations/resident/runner-control.js.map +0 -1
- package/dist/integrations/resident/runner-launch.js +0 -142
- package/dist/integrations/resident/runner-launch.js.map +0 -1
- package/dist/integrations/resident/runner-store.js +0 -284
- package/dist/integrations/resident/runner-store.js.map +0 -1
- package/dist/integrations/resident/session-log-reads.js +0 -125
- package/dist/integrations/resident/session-log-reads.js.map +0 -1
- package/dist/integrations/resident/session-step.js +0 -471
- package/dist/integrations/resident/session-step.js.map +0 -1
- package/dist/integrations/resident/storage.js +0 -183
- package/dist/integrations/resident/storage.js.map +0 -1
- package/dist/integrations/resident/tool-evidence.js +0 -123
- package/dist/integrations/resident/tool-evidence.js.map +0 -1
- package/dist/integrations/resident/verification.js +0 -109
- package/dist/integrations/resident/verification.js.map +0 -1
- package/dist/integrations/sessions/checkpoint-view.js +0 -48
- package/dist/integrations/sessions/checkpoint-view.js.map +0 -1
- package/dist/integrations/sessions/context-inventory.js +0 -44
- package/dist/integrations/sessions/context-inventory.js.map +0 -1
- package/dist/integrations/sessions/conversation-search.js +0 -572
- package/dist/integrations/sessions/conversation-search.js.map +0 -1
- package/dist/integrations/sessions/display-title.js +0 -5
- package/dist/integrations/sessions/display-title.js.map +0 -1
- package/dist/integrations/sessions/evidence-page-validation.js +0 -74
- package/dist/integrations/sessions/evidence-page-validation.js.map +0 -1
- package/dist/integrations/sessions/evidence-recall.js +0 -117
- package/dist/integrations/sessions/evidence-recall.js.map +0 -1
- package/dist/integrations/sessions/store.js +0 -780
- package/dist/integrations/sessions/store.js.map +0 -1
- package/dist/integrations/sessions/task-context.js +0 -96
- package/dist/integrations/sessions/task-context.js.map +0 -1
- package/dist/integrations/sessions/transcript-export.js +0 -342
- package/dist/integrations/sessions/transcript-export.js.map +0 -1
- package/dist/integrations/state/home.js +0 -17
- package/dist/integrations/state/home.js.map +0 -1
- package/dist/integrations/state/identity.js +0 -49
- package/dist/integrations/state/identity.js.map +0 -1
- package/dist/integrations/state/immutable-json.js +0 -38
- package/dist/integrations/state/immutable-json.js.map +0 -1
- package/dist/integrations/state/private-directory.js +0 -43
- package/dist/integrations/state/private-directory.js.map +0 -1
- package/dist/integrations/state/project.js +0 -13
- package/dist/integrations/state/project.js.map +0 -1
- package/dist/integrations/state/report.js +0 -626
- package/dist/integrations/state/report.js.map +0 -1
- package/dist/integrations/state/retention.js +0 -18
- package/dist/integrations/state/retention.js.map +0 -1
- package/dist/integrations/subagents/NamzuCliAgent.js +0 -9
- package/dist/integrations/subagents/NamzuCliAgent.js.map +0 -1
- package/dist/integrations/subagents/activity.js +0 -759
- package/dist/integrations/subagents/activity.js.map +0 -1
- package/dist/integrations/subagents/batches.js +0 -172
- package/dist/integrations/subagents/batches.js.map +0 -1
- package/dist/integrations/subagents/definitions.js +0 -26
- package/dist/integrations/subagents/definitions.js.map +0 -1
- package/dist/integrations/subagents/model-effort.js +0 -12
- package/dist/integrations/subagents/model-effort.js.map +0 -1
- package/dist/integrations/subagents/parent.js +0 -47
- package/dist/integrations/subagents/parent.js.map +0 -1
- package/dist/integrations/subagents/policy.js +0 -3
- package/dist/integrations/subagents/policy.js.map +0 -1
- package/dist/integrations/subagents/replay.js +0 -295
- package/dist/integrations/subagents/replay.js.map +0 -1
- package/dist/integrations/subagents/runtime.js +0 -1317
- package/dist/integrations/subagents/runtime.js.map +0 -1
- package/dist/integrations/subagents/saved-agents.js +0 -102
- package/dist/integrations/subagents/saved-agents.js.map +0 -1
- package/dist/integrations/subagents/slash.js +0 -45
- package/dist/integrations/subagents/slash.js.map +0 -1
- package/dist/integrations/subagents/worktree-driver.js +0 -72
- package/dist/integrations/subagents/worktree-driver.js.map +0 -1
- package/dist/integrations/telemetry/session-export.js +0 -119
- package/dist/integrations/telemetry/session-export.js.map +0 -1
- package/dist/integrations/trust/store.js +0 -73
- package/dist/integrations/trust/store.js.map +0 -1
- package/dist/integrations/updates.js +0 -115
- package/dist/integrations/updates.js.map +0 -1
- package/dist/integrations/web/exa-search.js +0 -154
- package/dist/integrations/web/exa-search.js.map +0 -1
- package/dist/integrations/web/open-url.js +0 -73
- package/dist/integrations/web/open-url.js.map +0 -1
- package/dist/integrations/web/search.js +0 -68
- package/dist/integrations/web/search.js.map +0 -1
- package/dist/integrations/worktrees/managed.js +0 -231
- package/dist/integrations/worktrees/managed.js.map +0 -1
- package/dist/logging.js +0 -115
- package/dist/logging.js.map +0 -1
- package/dist/memory/io.js +0 -177
- package/dist/memory/io.js.map +0 -1
- package/dist/memory/presentation.js +0 -76
- package/dist/memory/presentation.js.map +0 -1
- package/dist/memory/store.js +0 -180
- package/dist/memory/store.js.map +0 -1
- package/dist/memory/typed.js +0 -336
- package/dist/memory/typed.js.map +0 -1
- package/dist/output/formatter.js +0 -16
- package/dist/output/formatter.js.map +0 -1
- package/dist/output/index.js +0 -22
- package/dist/output/index.js.map +0 -1
- package/dist/output/json.js +0 -51
- package/dist/output/json.js.map +0 -1
- package/dist/output/text.js +0 -50
- package/dist/output/text.js.map +0 -1
- package/dist/output/yaml.js +0 -26
- package/dist/output/yaml.js.map +0 -1
- package/dist/output-schema.js +0 -18
- package/dist/output-schema.js.map +0 -1
- package/dist/permissions/browser-sites.js +0 -270
- package/dist/permissions/browser-sites.js.map +0 -1
- package/dist/permissions/canonical-project.js +0 -13
- package/dist/permissions/canonical-project.js.map +0 -1
- package/dist/permissions/checks.js +0 -128
- package/dist/permissions/checks.js.map +0 -1
- package/dist/permissions/headless-trust.js +0 -86
- package/dist/permissions/headless-trust.js.map +0 -1
- package/dist/permissions/live-mode.js +0 -62
- package/dist/permissions/live-mode.js.map +0 -1
- package/dist/permissions/mode.js +0 -65
- package/dist/permissions/mode.js.map +0 -1
- package/dist/permissions/rules.js +0 -358
- package/dist/permissions/rules.js.map +0 -1
- package/dist/release-notes.js +0 -64
- package/dist/release-notes.js.map +0 -1
- package/dist/resume-invocation.js +0 -24
- package/dist/resume-invocation.js.map +0 -1
- package/dist/schedule/build.js +0 -374
- package/dist/schedule/build.js.map +0 -1
- package/dist/schedule/changes.js +0 -78
- package/dist/schedule/changes.js.map +0 -1
- package/dist/schedule/commands/add.js +0 -603
- package/dist/schedule/commands/add.js.map +0 -1
- package/dist/schedule/commands/args.js +0 -80
- package/dist/schedule/commands/args.js.map +0 -1
- package/dist/schedule/commands/confirm-prompt.js +0 -21
- package/dist/schedule/commands/confirm-prompt.js.map +0 -1
- package/dist/schedule/commands/lifecycle.js +0 -586
- package/dist/schedule/commands/lifecycle.js.map +0 -1
- package/dist/schedule/commands/list.js +0 -260
- package/dist/schedule/commands/list.js.map +0 -1
- package/dist/schedule/commands/logs.js +0 -106
- package/dist/schedule/commands/logs.js.map +0 -1
- package/dist/schedule/commands/service.js +0 -458
- package/dist/schedule/commands/service.js.map +0 -1
- package/dist/schedule/daemon/daemon.js +0 -1265
- package/dist/schedule/daemon/daemon.js.map +0 -1
- package/dist/schedule/daemon/endpoint.js +0 -158
- package/dist/schedule/daemon/endpoint.js.map +0 -1
- package/dist/schedule/daemon/exit.js +0 -8
- package/dist/schedule/daemon/exit.js.map +0 -1
- package/dist/schedule/daemon/log.js +0 -53
- package/dist/schedule/daemon/log.js.map +0 -1
- package/dist/schedule/daemon/notify.js +0 -158
- package/dist/schedule/daemon/notify.js.map +0 -1
- package/dist/schedule/daemon/retention.js +0 -46
- package/dist/schedule/daemon/retention.js.map +0 -1
- package/dist/schedule/daemon/sessions.js +0 -52
- package/dist/schedule/daemon/sessions.js.map +0 -1
- package/dist/schedule/env.js +0 -106
- package/dist/schedule/env.js.map +0 -1
- package/dist/schedule/fire/browser-preflight.js +0 -73
- package/dist/schedule/fire/browser-preflight.js.map +0 -1
- package/dist/schedule/fire/calls.js +0 -114
- package/dist/schedule/fire/calls.js.map +0 -1
- package/dist/schedule/fire/fire.js +0 -681
- package/dist/schedule/fire/fire.js.map +0 -1
- package/dist/schedule/fire/result.js +0 -19
- package/dist/schedule/fire/result.js.map +0 -1
- package/dist/schedule/fire/run-script.js +0 -81
- package/dist/schedule/fire/run-script.js.map +0 -1
- package/dist/schedule/fire/unattended-note.js +0 -51
- package/dist/schedule/fire/unattended-note.js.map +0 -1
- package/dist/schedule/fire/wake-gate.js +0 -90
- package/dist/schedule/fire/wake-gate.js.map +0 -1
- package/dist/schedule/floor.js +0 -1561
- package/dist/schedule/floor.js.map +0 -1
- package/dist/schedule/folder.js +0 -84
- package/dist/schedule/folder.js.map +0 -1
- package/dist/schedule/paths.js +0 -53
- package/dist/schedule/paths.js.map +0 -1
- package/dist/schedule/policy.js +0 -414
- package/dist/schedule/policy.js.map +0 -1
- package/dist/schedule/resume-command.js +0 -72
- package/dist/schedule/resume-command.js.map +0 -1
- package/dist/schedule/script-check.js +0 -146
- package/dist/schedule/script-check.js.map +0 -1
- package/dist/schedule/script-shell.js +0 -5
- package/dist/schedule/script-shell.js.map +0 -1
- package/dist/schedule/service/detect.js +0 -29
- package/dist/schedule/service/detect.js.map +0 -1
- package/dist/schedule/service/index.js +0 -361
- package/dist/schedule/service/index.js.map +0 -1
- package/dist/schedule/service/launchd.js +0 -84
- package/dist/schedule/service/launchd.js.map +0 -1
- package/dist/schedule/service/manifest.js +0 -16
- package/dist/schedule/service/manifest.js.map +0 -1
- package/dist/schedule/service/names.js +0 -22
- package/dist/schedule/service/names.js.map +0 -1
- package/dist/schedule/service/quote.js +0 -64
- package/dist/schedule/service/quote.js.map +0 -1
- package/dist/schedule/service/runner.js +0 -31
- package/dist/schedule/service/runner.js.map +0 -1
- package/dist/schedule/service/systemd.js +0 -96
- package/dist/schedule/service/systemd.js.map +0 -1
- package/dist/schedule/service/windows-task.js +0 -199
- package/dist/schedule/service/windows-task.js.map +0 -1
- package/dist/schedule/service/wsl.js +0 -121
- package/dist/schedule/service/wsl.js.map +0 -1
- package/dist/schedule/store/atomic.js +0 -138
- package/dist/schedule/store/atomic.js.map +0 -1
- package/dist/schedule/store/claims.js +0 -57
- package/dist/schedule/store/claims.js.map +0 -1
- package/dist/schedule/store/digest.js +0 -139
- package/dist/schedule/store/digest.js.map +0 -1
- package/dist/schedule/store/history.js +0 -117
- package/dist/schedule/store/history.js.map +0 -1
- package/dist/schedule/store/jobs.js +0 -277
- package/dist/schedule/store/jobs.js.map +0 -1
- package/dist/schedule/store/state.js +0 -38
- package/dist/schedule/store/state.js.map +0 -1
- package/dist/schedule/types.js +0 -33
- package/dist/schedule/types.js.map +0 -1
- package/dist/schedule/visible-source.js +0 -59
- package/dist/schedule/visible-source.js.map +0 -1
- package/dist/skills/audit.js +0 -75
- package/dist/skills/audit.js.map +0 -1
- package/dist/skills/catalog.js +0 -226
- package/dist/skills/catalog.js.map +0 -1
- package/dist/skills/directory.js +0 -51
- package/dist/skills/directory.js.map +0 -1
- package/dist/skills/save.js +0 -344
- package/dist/skills/save.js.map +0 -1
- package/dist/skills/store.js +0 -351
- package/dist/skills/store.js.map +0 -1
- package/dist/termination.js +0 -143
- package/dist/termination.js.map +0 -1
- package/dist/test-support/toolset.js +0 -27
- package/dist/test-support/toolset.js.map +0 -1
- package/dist/tui/AgentExplorer.js +0 -789
- package/dist/tui/AgentExplorer.js.map +0 -1
- package/dist/tui/App.js +0 -8209
- package/dist/tui/App.js.map +0 -1
- package/dist/tui/BrandHeader.js +0 -14
- package/dist/tui/BrandHeader.js.map +0 -1
- package/dist/tui/Checklist.js +0 -90
- package/dist/tui/Checklist.js.map +0 -1
- package/dist/tui/ChoicePicker.js +0 -64
- package/dist/tui/ChoicePicker.js.map +0 -1
- package/dist/tui/Composer.js +0 -908
- package/dist/tui/Composer.js.map +0 -1
- package/dist/tui/ComposerFrame.js +0 -79
- package/dist/tui/ComposerFrame.js.map +0 -1
- package/dist/tui/CopyPicker.js +0 -19
- package/dist/tui/CopyPicker.js.map +0 -1
- package/dist/tui/EditPromptPicker.js +0 -17
- package/dist/tui/EditPromptPicker.js.map +0 -1
- package/dist/tui/EffortSlider.js +0 -134
- package/dist/tui/EffortSlider.js.map +0 -1
- package/dist/tui/LiveActivity.js +0 -89
- package/dist/tui/LiveActivity.js.map +0 -1
- package/dist/tui/Markdown.js +0 -137
- package/dist/tui/Markdown.js.map +0 -1
- package/dist/tui/PermissionOverlay.js +0 -278
- package/dist/tui/PermissionOverlay.js.map +0 -1
- package/dist/tui/Picker.js +0 -1310
- package/dist/tui/Picker.js.map +0 -1
- package/dist/tui/ProviderSetup.js +0 -125
- package/dist/tui/ProviderSetup.js.map +0 -1
- package/dist/tui/ResumePicker.js +0 -34
- package/dist/tui/ResumePicker.js.map +0 -1
- package/dist/tui/SaveSkillOverlay.js +0 -118
- package/dist/tui/SaveSkillOverlay.js.map +0 -1
- package/dist/tui/ScheduleReviewOverlay.js +0 -166
- package/dist/tui/ScheduleReviewOverlay.js.map +0 -1
- package/dist/tui/StatusBar.js +0 -182
- package/dist/tui/StatusBar.js.map +0 -1
- package/dist/tui/StatusPanel.js +0 -11
- package/dist/tui/StatusPanel.js.map +0 -1
- package/dist/tui/TaskList.js +0 -43
- package/dist/tui/TaskList.js.map +0 -1
- package/dist/tui/TextPrompt.js +0 -185
- package/dist/tui/TextPrompt.js.map +0 -1
- package/dist/tui/ToolOutputViewer.js +0 -39
- package/dist/tui/ToolOutputViewer.js.map +0 -1
- package/dist/tui/Transcript.js +0 -235
- package/dist/tui/Transcript.js.map +0 -1
- package/dist/tui/TrustPrompt.js +0 -13
- package/dist/tui/TrustPrompt.js.map +0 -1
- package/dist/tui/ViewportBound.js +0 -55
- package/dist/tui/ViewportBound.js.map +0 -1
- package/dist/tui/agent-transcript-rows.js +0 -115
- package/dist/tui/agent-transcript-rows.js.map +0 -1
- package/dist/tui/agent.js +0 -4235
- package/dist/tui/agent.js.map +0 -1
- package/dist/tui/browser-notices.js +0 -107
- package/dist/tui/browser-notices.js.map +0 -1
- package/dist/tui/choice-selection.js +0 -38
- package/dist/tui/choice-selection.js.map +0 -1
- package/dist/tui/compact-transcript.js +0 -46
- package/dist/tui/compact-transcript.js.map +0 -1
- package/dist/tui/consent-timing.js +0 -48
- package/dist/tui/consent-timing.js.map +0 -1
- package/dist/tui/conversation-evidence-view.js +0 -96
- package/dist/tui/conversation-evidence-view.js.map +0 -1
- package/dist/tui/conversation-history.js +0 -33
- package/dist/tui/conversation-history.js.map +0 -1
- package/dist/tui/copy-targets.js +0 -189
- package/dist/tui/copy-targets.js.map +0 -1
- package/dist/tui/credential-entry.js +0 -134
- package/dist/tui/credential-entry.js.map +0 -1
- package/dist/tui/edit-prompts.js +0 -35
- package/dist/tui/edit-prompts.js.map +0 -1
- package/dist/tui/exit-summary.js +0 -30
- package/dist/tui/exit-summary.js.map +0 -1
- package/dist/tui/external-editor.js +0 -169
- package/dist/tui/external-editor.js.map +0 -1
- package/dist/tui/hypermode.js +0 -58
- package/dist/tui/hypermode.js.map +0 -1
- package/dist/tui/index.js +0 -81
- package/dist/tui/index.js.map +0 -1
- package/dist/tui/live-window.js +0 -281
- package/dist/tui/live-window.js.map +0 -1
- package/dist/tui/log-pane.js +0 -100
- package/dist/tui/log-pane.js.map +0 -1
- package/dist/tui/login-prompt.js +0 -105
- package/dist/tui/login-prompt.js.map +0 -1
- package/dist/tui/logo.js +0 -9
- package/dist/tui/logo.js.map +0 -1
- package/dist/tui/markdown-block-cache.js +0 -76
- package/dist/tui/markdown-block-cache.js.map +0 -1
- package/dist/tui/markdown-table.js +0 -175
- package/dist/tui/markdown-table.js.map +0 -1
- package/dist/tui/markdown-wrap.js +0 -189
- package/dist/tui/markdown-wrap.js.map +0 -1
- package/dist/tui/markdownParser.js +0 -237
- package/dist/tui/markdownParser.js.map +0 -1
- package/dist/tui/mentions.js +0 -150
- package/dist/tui/mentions.js.map +0 -1
- package/dist/tui/model-catalogue-view.js +0 -75
- package/dist/tui/model-catalogue-view.js.map +0 -1
- package/dist/tui/model-choices.js +0 -157
- package/dist/tui/model-choices.js.map +0 -1
- package/dist/tui/model-search.js +0 -28
- package/dist/tui/model-search.js.map +0 -1
- package/dist/tui/model-selection-intent.js +0 -96
- package/dist/tui/model-selection-intent.js.map +0 -1
- package/dist/tui/model-switch-tool.js +0 -74
- package/dist/tui/model-switch-tool.js.map +0 -1
- package/dist/tui/model-switch.js +0 -106
- package/dist/tui/model-switch.js.map +0 -1
- package/dist/tui/notices.js +0 -27
- package/dist/tui/notices.js.map +0 -1
- package/dist/tui/open-browser.js +0 -147
- package/dist/tui/open-browser.js.map +0 -1
- package/dist/tui/permission-review.js +0 -858
- package/dist/tui/permission-review.js.map +0 -1
- package/dist/tui/plugin-view.js +0 -59
- package/dist/tui/plugin-view.js.map +0 -1
- package/dist/tui/provider-list.js +0 -327
- package/dist/tui/provider-list.js.map +0 -1
- package/dist/tui/provider-selection.js +0 -16
- package/dist/tui/provider-selection.js.map +0 -1
- package/dist/tui/schedule/host-commands.js +0 -428
- package/dist/tui/schedule/host-commands.js.map +0 -1
- package/dist/tui/schedule/integration.js +0 -150
- package/dist/tui/schedule/integration.js.map +0 -1
- package/dist/tui/schedule/loop-host.js +0 -153
- package/dist/tui/schedule/loop-host.js.map +0 -1
- package/dist/tui/schedule/resume.js +0 -333
- package/dist/tui/schedule/resume.js.map +0 -1
- package/dist/tui/schedule/startup.js +0 -121
- package/dist/tui/schedule/startup.js.map +0 -1
- package/dist/tui/schedule/tool-host.js +0 -619
- package/dist/tui/schedule/tool-host.js.map +0 -1
- package/dist/tui/selection-window.js +0 -37
- package/dist/tui/selection-window.js.map +0 -1
- package/dist/tui/shell-escape.js +0 -110
- package/dist/tui/shell-escape.js.map +0 -1
- package/dist/tui/skills/learning.js +0 -131
- package/dist/tui/skills/learning.js.map +0 -1
- package/dist/tui/skills/suggest-setting.js +0 -55
- package/dist/tui/skills/suggest-setting.js.map +0 -1
- package/dist/tui/skills/suggestion-ledger.js +0 -52
- package/dist/tui/skills/suggestion-ledger.js.map +0 -1
- package/dist/tui/slashCommands.js +0 -1587
- package/dist/tui/slashCommands.js.map +0 -1
- package/dist/tui/status-card.js +0 -30
- package/dist/tui/status-card.js.map +0 -1
- package/dist/tui/status-panel-layout.js +0 -42
- package/dist/tui/status-panel-layout.js.map +0 -1
- package/dist/tui/stream-blocks.js +0 -187
- package/dist/tui/stream-blocks.js.map +0 -1
- package/dist/tui/task-activity.js +0 -157
- package/dist/tui/task-activity.js.map +0 -1
- package/dist/tui/terminal-choice-text.js +0 -118
- package/dist/tui/terminal-choice-text.js.map +0 -1
- package/dist/tui/terminal-display.js +0 -65
- package/dist/tui/terminal-display.js.map +0 -1
- package/dist/tui/terminal-hyperlinks.js +0 -70
- package/dist/tui/terminal-hyperlinks.js.map +0 -1
- package/dist/tui/theme.js +0 -34
- package/dist/tui/theme.js.map +0 -1
- package/dist/tui/triggers/analyze.js +0 -221
- package/dist/tui/triggers/analyze.js.map +0 -1
- package/dist/tui/triggers/context-text.js +0 -44
- package/dist/tui/triggers/context-text.js.map +0 -1
- package/dist/tui/triggers/copy.js +0 -163
- package/dist/tui/triggers/copy.js.map +0 -1
- package/dist/tui/triggers/detect.js +0 -295
- package/dist/tui/triggers/detect.js.map +0 -1
- package/dist/tui/triggers/fold.js +0 -44
- package/dist/tui/triggers/fold.js.map +0 -1
- package/dist/tui/triggers/pattern.js +0 -243
- package/dist/tui/triggers/pattern.js.map +0 -1
- package/dist/tui/triggers/provenance.js +0 -98
- package/dist/tui/triggers/provenance.js.map +0 -1
- package/dist/tui/triggers/registry.js +0 -164
- package/dist/tui/triggers/registry.js.map +0 -1
- package/dist/tui/triggers/setting.js +0 -61
- package/dist/tui/triggers/setting.js.map +0 -1
- package/dist/tui/triggers/verbs.js +0 -140
- package/dist/tui/triggers/verbs.js.map +0 -1
- package/dist/tui/turn-interruption.js +0 -160
- package/dist/tui/turn-interruption.js.map +0 -1
- package/dist/tui/turn-limits-settings.js +0 -88
- package/dist/tui/turn-limits-settings.js.map +0 -1
- package/dist/tui/types.js +0 -7
- package/dist/tui/types.js.map +0 -1
- package/dist/tui/units.js +0 -20
- package/dist/tui/units.js.map +0 -1
- package/dist/tui/use-selection-index.js +0 -13
- package/dist/tui/use-selection-index.js.map +0 -1
- package/dist/tui/web-activity.js +0 -105
- package/dist/tui/web-activity.js.map +0 -1
- package/dist/tui/workspace-diff.js +0 -101
- package/dist/tui/workspace-diff.js.map +0 -1
- package/dist/tui/workspace-review.js +0 -67
- package/dist/tui/workspace-review.js.map +0 -1
- package/dist/user-commands/store.js +0 -235
- package/dist/user-commands/store.js.map +0 -1
- package/dist/version.js +0 -23
- package/dist/version.js.map +0 -1
|
@@ -0,0 +1,1373 @@
|
|
|
1
|
+
import { createRequire as __namzuCreateRequire } from 'node:module';
|
|
2
|
+
const require = __namzuCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
createCliPalMessagingContext
|
|
5
|
+
} from "./chunk-2RBYHHLM.js";
|
|
6
|
+
import {
|
|
7
|
+
palConversationBinding
|
|
8
|
+
} from "./chunk-WY2WUTFR.js";
|
|
9
|
+
import {
|
|
10
|
+
constructProvider,
|
|
11
|
+
createCurrentCredentialReader,
|
|
12
|
+
createLiveModeControl,
|
|
13
|
+
createTaskContextStep,
|
|
14
|
+
makeHoldingResumeHandler,
|
|
15
|
+
makeResumeHandler,
|
|
16
|
+
projectTurnConversation,
|
|
17
|
+
reviewExemptionFor,
|
|
18
|
+
toAgentEvent
|
|
19
|
+
} from "./chunk-W5KGCUP3.js";
|
|
20
|
+
import {
|
|
21
|
+
readStoredTurnGuards,
|
|
22
|
+
resolveTurnGuards
|
|
23
|
+
} from "./chunk-W3UQMRYA.js";
|
|
24
|
+
import {
|
|
25
|
+
ensureFreshStoredCodexCredential
|
|
26
|
+
} from "./chunk-OWXJOD4H.js";
|
|
27
|
+
import {
|
|
28
|
+
ensureRegistered,
|
|
29
|
+
findDetected,
|
|
30
|
+
primaryProvider,
|
|
31
|
+
readCodexCredentialFile
|
|
32
|
+
} from "./chunk-SB6UD3ED.js";
|
|
33
|
+
import {
|
|
34
|
+
PROVIDER_REGISTRY
|
|
35
|
+
} from "./chunk-6LLJQ3KY.js";
|
|
36
|
+
import {
|
|
37
|
+
BackgroundJobRegistry,
|
|
38
|
+
DiskSessionLog,
|
|
39
|
+
DiskTaskStore,
|
|
40
|
+
MCPClient,
|
|
41
|
+
PLAN_MODE_REFUSAL,
|
|
42
|
+
ToolManager,
|
|
43
|
+
abandonTurn,
|
|
44
|
+
asCheckpointId,
|
|
45
|
+
asTurnId,
|
|
46
|
+
bindOwner,
|
|
47
|
+
buildPalSystemPrompt,
|
|
48
|
+
buildTaskTools,
|
|
49
|
+
computerUseUnavailableReason,
|
|
50
|
+
createBrowserTools,
|
|
51
|
+
createComputerUseTool,
|
|
52
|
+
createPalReferenceImageTool,
|
|
53
|
+
createToolPresenter,
|
|
54
|
+
createViewImageTool,
|
|
55
|
+
getBuiltinTools,
|
|
56
|
+
mcpToolset,
|
|
57
|
+
palConversationGreeting,
|
|
58
|
+
query,
|
|
59
|
+
resumeSession,
|
|
60
|
+
toolset
|
|
61
|
+
} from "./chunk-K5HARZ7G.js";
|
|
62
|
+
import {
|
|
63
|
+
__name
|
|
64
|
+
} from "./chunk-76FLAFCG.js";
|
|
65
|
+
|
|
66
|
+
// src/pals/agent-session.ts
|
|
67
|
+
import { randomUUID } from "node:crypto";
|
|
68
|
+
|
|
69
|
+
// src/pals/guest-mcp.ts
|
|
70
|
+
import { posix } from "node:path";
|
|
71
|
+
|
|
72
|
+
// src/pals/guest-mcp-transport.ts
|
|
73
|
+
import { StringDecoder } from "node:string_decoder";
|
|
74
|
+
var MAX_MESSAGE_BYTES = 16 * 1024 * 1024;
|
|
75
|
+
var MAX_WRITE_BYTES = 1024 * 1024;
|
|
76
|
+
var PalGuestMcpTransport = class {
|
|
77
|
+
constructor(open) {
|
|
78
|
+
this.open = open;
|
|
79
|
+
}
|
|
80
|
+
open;
|
|
81
|
+
static {
|
|
82
|
+
__name(this, "PalGuestMcpTransport");
|
|
83
|
+
}
|
|
84
|
+
channel;
|
|
85
|
+
closing;
|
|
86
|
+
ended = false;
|
|
87
|
+
messageHandler;
|
|
88
|
+
closeHandler;
|
|
89
|
+
errorHandler;
|
|
90
|
+
pending = /* @__PURE__ */ new Map();
|
|
91
|
+
async connect() {
|
|
92
|
+
if (this.channel || this.ended) throw new Error("This guest MCP transport cannot reconnect.");
|
|
93
|
+
this.channel = await this.open();
|
|
94
|
+
void this.read(this.channel).catch((error) => {
|
|
95
|
+
this.fail(error instanceof Error ? error : new Error(String(error)));
|
|
96
|
+
});
|
|
97
|
+
void this.channel.closed.catch(
|
|
98
|
+
(error) => this.fail(error instanceof Error ? error : new Error(String(error)))
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
isConnected() {
|
|
102
|
+
return this.channel !== void 0 && !this.ended && !this.closing;
|
|
103
|
+
}
|
|
104
|
+
onMessage(handler) {
|
|
105
|
+
this.messageHandler = handler;
|
|
106
|
+
}
|
|
107
|
+
onClose(handler) {
|
|
108
|
+
this.closeHandler = handler;
|
|
109
|
+
}
|
|
110
|
+
onError(handler) {
|
|
111
|
+
this.errorHandler = handler;
|
|
112
|
+
}
|
|
113
|
+
async send(message, options) {
|
|
114
|
+
options?.signal?.throwIfAborted();
|
|
115
|
+
const channel = this.channel;
|
|
116
|
+
if (!channel || !this.isConnected()) throw new Error("This guest MCP channel is closed.");
|
|
117
|
+
const data = `${JSON.stringify(message)}
|
|
118
|
+
`;
|
|
119
|
+
if (Buffer.byteLength(data) > MAX_WRITE_BYTES)
|
|
120
|
+
throw new Error("This guest MCP request exceeds the 1 MiB write limit; nothing was sent.");
|
|
121
|
+
const request = message.method !== void 0 && message.id !== void 0;
|
|
122
|
+
if (!request) {
|
|
123
|
+
await channel.write(data, options?.signal);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const id = message.id;
|
|
127
|
+
if (this.pending.has(id)) throw new Error("This guest MCP request ID is already active.");
|
|
128
|
+
const operation = await channel.beginOperation(options?.signal);
|
|
129
|
+
if (options?.signal?.aborted || !this.isConnected()) {
|
|
130
|
+
operation.complete();
|
|
131
|
+
options?.signal?.throwIfAborted();
|
|
132
|
+
throw new Error("This guest MCP channel closed before dispatch.");
|
|
133
|
+
}
|
|
134
|
+
const onAbort = /* @__PURE__ */ __name(() => this.settle(id, false), "onAbort");
|
|
135
|
+
const entry = {
|
|
136
|
+
operation,
|
|
137
|
+
method: message.method,
|
|
138
|
+
removeAbort: /* @__PURE__ */ __name(() => options?.signal?.removeEventListener("abort", onAbort), "removeAbort")
|
|
139
|
+
};
|
|
140
|
+
this.pending.set(id, entry);
|
|
141
|
+
options?.signal?.addEventListener("abort", onAbort, { once: true });
|
|
142
|
+
try {
|
|
143
|
+
await channel.write(data, options?.signal);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
this.settle(id, false);
|
|
146
|
+
throw error;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
settle(id, confirmed) {
|
|
150
|
+
const entry = this.pending.get(id);
|
|
151
|
+
if (!entry) return;
|
|
152
|
+
this.pending.delete(id);
|
|
153
|
+
entry.removeAbort();
|
|
154
|
+
if (confirmed) entry.operation.complete();
|
|
155
|
+
else entry.operation.outcomeUnknown();
|
|
156
|
+
}
|
|
157
|
+
accept(line) {
|
|
158
|
+
if (Buffer.byteLength(line) > MAX_MESSAGE_BYTES)
|
|
159
|
+
throw new Error("This guest MCP reply exceeds the message limit.");
|
|
160
|
+
const message = JSON.parse(line);
|
|
161
|
+
if (!message || typeof message !== "object" || Array.isArray(message))
|
|
162
|
+
throw new Error("This guest MCP server returned an invalid JSON-RPC message.");
|
|
163
|
+
let rpc = message;
|
|
164
|
+
if (rpc.jsonrpc !== "2.0") throw new Error("This guest MCP server returned invalid JSON-RPC.");
|
|
165
|
+
if (rpc.method === void 0 && rpc.id !== void 0) {
|
|
166
|
+
if (Object.hasOwn(rpc, "result") === Object.hasOwn(rpc, "error"))
|
|
167
|
+
throw new Error("This guest MCP server returned an invalid reply.");
|
|
168
|
+
const entry = this.pending.get(rpc.id);
|
|
169
|
+
const result = rpc.result;
|
|
170
|
+
const metadata = result?._meta;
|
|
171
|
+
const outcome = metadata?.["namzu/outcome"];
|
|
172
|
+
const unknown = outcome === "unknown" || entry?.method === "tools/call" && (rpc.error !== void 0 || outcome !== "settled" && outcome !== "not_dispatched");
|
|
173
|
+
this.settle(rpc.id, !unknown);
|
|
174
|
+
if (unknown && entry?.method === "tools/call" && !rpc.error) {
|
|
175
|
+
rpc = {
|
|
176
|
+
...rpc,
|
|
177
|
+
result: {
|
|
178
|
+
...result,
|
|
179
|
+
isError: true,
|
|
180
|
+
_meta: { ...metadata, "namzu/outcome": "unknown" },
|
|
181
|
+
content: [
|
|
182
|
+
...Array.isArray(result?.content) ? result.content : [],
|
|
183
|
+
{
|
|
184
|
+
type: "text",
|
|
185
|
+
text: "The guest application did not confirm operation completion. Do not repeat the action or take over; stop and restart this computer before further work."
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
this.messageHandler?.(rpc);
|
|
193
|
+
}
|
|
194
|
+
async read(channel) {
|
|
195
|
+
const decoder = new StringDecoder("utf8");
|
|
196
|
+
let buffered = "";
|
|
197
|
+
for await (const event of channel.events) {
|
|
198
|
+
if (event.stream !== "stdout") continue;
|
|
199
|
+
buffered += decoder.write(Buffer.from(event.data));
|
|
200
|
+
for (; ; ) {
|
|
201
|
+
const end = buffered.indexOf("\n");
|
|
202
|
+
if (end < 0) break;
|
|
203
|
+
const line = buffered.slice(0, end).replace(/\r$/, "");
|
|
204
|
+
buffered = buffered.slice(end + 1);
|
|
205
|
+
if (line.trim()) this.accept(line);
|
|
206
|
+
}
|
|
207
|
+
if (Buffer.byteLength(buffered) > MAX_MESSAGE_BYTES)
|
|
208
|
+
throw new Error("This guest MCP reply exceeds the message limit.");
|
|
209
|
+
}
|
|
210
|
+
if (!this.closing) {
|
|
211
|
+
if (buffered.length || decoder.end())
|
|
212
|
+
throw new Error("This guest MCP server closed with an incomplete reply.");
|
|
213
|
+
this.end();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
end() {
|
|
217
|
+
if (this.ended) return;
|
|
218
|
+
this.ended = true;
|
|
219
|
+
for (const id of this.pending.keys()) this.settle(id, false);
|
|
220
|
+
this.closeHandler?.();
|
|
221
|
+
}
|
|
222
|
+
fail(error) {
|
|
223
|
+
if (this.ended) return;
|
|
224
|
+
this.errorHandler?.(error);
|
|
225
|
+
this.end();
|
|
226
|
+
void this.close().catch(() => void 0);
|
|
227
|
+
}
|
|
228
|
+
close() {
|
|
229
|
+
if (this.closing) return this.closing;
|
|
230
|
+
this.end();
|
|
231
|
+
this.closing = this.channel?.close() ?? Promise.resolve();
|
|
232
|
+
return this.closing;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// src/pals/guest-mcp.ts
|
|
237
|
+
var PAL_GUEST_MCP_MANIFEST = "/home/namzu/.config/namzu/mcp.json";
|
|
238
|
+
var MAX_MANIFEST_BYTES = 64 * 1024;
|
|
239
|
+
var DEFAULT_REQUEST_TIMEOUT_MS = 18e4;
|
|
240
|
+
function absoluteGuestPath(value) {
|
|
241
|
+
return typeof value === "string" && value.length <= 4096 && !value.includes("\0") && !value.includes("\\") && posix.isAbsolute(value) && posix.normalize(value) === value;
|
|
242
|
+
}
|
|
243
|
+
__name(absoluteGuestPath, "absoluteGuestPath");
|
|
244
|
+
function parsePalGuestMcpManifest(bytes) {
|
|
245
|
+
if (bytes.byteLength > MAX_MANIFEST_BYTES)
|
|
246
|
+
throw new Error("The guest MCP manifest exceeds 64 KiB.");
|
|
247
|
+
const value = JSON.parse(Buffer.from(bytes).toString("utf8"));
|
|
248
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
249
|
+
throw new Error("The guest MCP manifest must be an object.");
|
|
250
|
+
const manifest = value;
|
|
251
|
+
if (manifest.version !== 1 || Object.keys(manifest).some((key) => key !== "version" && key !== "servers") || !Array.isArray(manifest.servers) || manifest.servers.length > 16)
|
|
252
|
+
throw new Error("The guest MCP manifest requires version 1 and at most 16 servers.");
|
|
253
|
+
const names = /* @__PURE__ */ new Set();
|
|
254
|
+
return manifest.servers.map((value2) => {
|
|
255
|
+
if (!value2 || typeof value2 !== "object" || Array.isArray(value2))
|
|
256
|
+
throw new Error("A guest MCP server must be an object.");
|
|
257
|
+
const server = value2;
|
|
258
|
+
if (Object.keys(server).some(
|
|
259
|
+
(key) => ![
|
|
260
|
+
"name",
|
|
261
|
+
"outcomeProtocol",
|
|
262
|
+
"command",
|
|
263
|
+
"args",
|
|
264
|
+
"cwd",
|
|
265
|
+
"env",
|
|
266
|
+
"allow",
|
|
267
|
+
"requestTimeoutMs"
|
|
268
|
+
].includes(key)
|
|
269
|
+
))
|
|
270
|
+
throw new Error("A guest MCP server contains an unsupported field.");
|
|
271
|
+
if (typeof server.name !== "string" || !/^[a-z][a-z0-9_-]{0,47}$/.test(server.name))
|
|
272
|
+
throw new Error("A guest MCP server requires a lowercase name.");
|
|
273
|
+
if (names.has(server.name)) throw new Error(`Duplicate guest MCP server "${server.name}".`);
|
|
274
|
+
names.add(server.name);
|
|
275
|
+
if (server.outcomeProtocol !== "namzu-v1")
|
|
276
|
+
throw new Error(
|
|
277
|
+
`Guest MCP server "${server.name}" requires the reviewed namzu-v1 outcome bridge.`
|
|
278
|
+
);
|
|
279
|
+
if (!absoluteGuestPath(server.command))
|
|
280
|
+
throw new Error(`Guest MCP server "${server.name}" requires an absolute guest command.`);
|
|
281
|
+
if (server.cwd !== void 0 && !absoluteGuestPath(server.cwd))
|
|
282
|
+
throw new Error(`Guest MCP server "${server.name}" requires an absolute guest cwd.`);
|
|
283
|
+
if (server.args !== void 0 && (!Array.isArray(server.args) || server.args.length > 64 || !server.args.every(
|
|
284
|
+
(arg) => typeof arg === "string" && arg.length <= 4096 && !arg.includes("\0")
|
|
285
|
+
)))
|
|
286
|
+
throw new Error(`Guest MCP server "${server.name}" has invalid arguments.`);
|
|
287
|
+
if (!Array.isArray(server.allow) || server.allow.length === 0 || server.allow.length > 128 || !server.allow.every(
|
|
288
|
+
(name) => typeof name === "string" && /^[a-zA-Z0-9_.-]{1,128}$/.test(name)
|
|
289
|
+
))
|
|
290
|
+
throw new Error(`Guest MCP server "${server.name}" requires an explicit tool allowlist.`);
|
|
291
|
+
if (server.env !== void 0) {
|
|
292
|
+
if (!server.env || typeof server.env !== "object" || Array.isArray(server.env))
|
|
293
|
+
throw new Error(`Guest MCP server "${server.name}" has invalid environment values.`);
|
|
294
|
+
const entries = Object.entries(server.env);
|
|
295
|
+
if (entries.length > 64 || entries.some(
|
|
296
|
+
([key, value3]) => !/^[A-Za-z_][A-Za-z0-9_]*$/.test(key) || key.startsWith("NAMZU_SANDBOX_") || typeof value3 !== "string" || value3.length > 8192 || value3.includes("\0")
|
|
297
|
+
))
|
|
298
|
+
throw new Error(`Guest MCP server "${server.name}" has invalid environment values.`);
|
|
299
|
+
}
|
|
300
|
+
if (server.requestTimeoutMs !== void 0 && (typeof server.requestTimeoutMs !== "number" || !Number.isSafeInteger(server.requestTimeoutMs) || server.requestTimeoutMs < 1e3 || server.requestTimeoutMs > 3e5))
|
|
301
|
+
throw new Error(`Guest MCP server "${server.name}" requires a 1\u2013300 second request deadline.`);
|
|
302
|
+
return structuredClone(server);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
__name(parsePalGuestMcpManifest, "parsePalGuestMcpManifest");
|
|
306
|
+
async function connectPalGuestMcp(lease, assertExecutionAllowed, signal) {
|
|
307
|
+
const connected = [];
|
|
308
|
+
const failed = [];
|
|
309
|
+
const toolsets = [];
|
|
310
|
+
const openStdio = lease.sandbox.openStdio?.bind(lease.sandbox);
|
|
311
|
+
if (!openStdio) return { connected, failed, toolsets };
|
|
312
|
+
let servers;
|
|
313
|
+
try {
|
|
314
|
+
await assertExecutionAllowed();
|
|
315
|
+
signal?.throwIfAborted();
|
|
316
|
+
const exists = await lease.sandbox.exec(
|
|
317
|
+
"python3",
|
|
318
|
+
[
|
|
319
|
+
"-c",
|
|
320
|
+
"import os,sys; sys.exit(0 if os.path.isfile(sys.argv[1]) else 3)",
|
|
321
|
+
PAL_GUEST_MCP_MANIFEST
|
|
322
|
+
],
|
|
323
|
+
{ signal, timeout: 1e4 }
|
|
324
|
+
);
|
|
325
|
+
if (exists.exitCode === 3 && !exists.timedOut) return { connected, failed, toolsets };
|
|
326
|
+
if (exists.exitCode !== 0 || exists.timedOut)
|
|
327
|
+
throw new Error("The guest could not inspect its MCP installation manifest.");
|
|
328
|
+
await assertExecutionAllowed();
|
|
329
|
+
servers = parsePalGuestMcpManifest(
|
|
330
|
+
await lease.sandbox.readFile(PAL_GUEST_MCP_MANIFEST, {
|
|
331
|
+
length: MAX_MANIFEST_BYTES + 1,
|
|
332
|
+
signal
|
|
333
|
+
})
|
|
334
|
+
);
|
|
335
|
+
} catch (error) {
|
|
336
|
+
signal?.throwIfAborted();
|
|
337
|
+
await assertExecutionAllowed();
|
|
338
|
+
failed.push({
|
|
339
|
+
name: "guest-manifest",
|
|
340
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
341
|
+
});
|
|
342
|
+
return { connected, failed, toolsets };
|
|
343
|
+
}
|
|
344
|
+
try {
|
|
345
|
+
for (const server of servers) {
|
|
346
|
+
const setup = new AbortController();
|
|
347
|
+
const onAbort = /* @__PURE__ */ __name(() => setup.abort(signal?.reason), "onAbort");
|
|
348
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
349
|
+
if (signal?.aborted) onAbort();
|
|
350
|
+
const deadline = setTimeout(
|
|
351
|
+
() => setup.abort(new Error("Guest MCP setup exceeded 20 seconds.")),
|
|
352
|
+
2e4
|
|
353
|
+
);
|
|
354
|
+
deadline.unref();
|
|
355
|
+
const clearSetup = /* @__PURE__ */ __name(() => clearTimeout(deadline), "clearSetup");
|
|
356
|
+
const releaseSignal = /* @__PURE__ */ __name(() => {
|
|
357
|
+
clearSetup();
|
|
358
|
+
signal?.removeEventListener("abort", onAbort);
|
|
359
|
+
}, "releaseSignal");
|
|
360
|
+
const requestTimeoutMs = server.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
|
|
361
|
+
const client = new MCPClient({
|
|
362
|
+
serverName: server.name,
|
|
363
|
+
transport: {
|
|
364
|
+
type: "stdio",
|
|
365
|
+
command: server.command,
|
|
366
|
+
args: [...server.args ?? []]
|
|
367
|
+
},
|
|
368
|
+
transportFactory: /* @__PURE__ */ __name(() => new PalGuestMcpTransport(async () => {
|
|
369
|
+
await assertExecutionAllowed();
|
|
370
|
+
setup.signal.throwIfAborted();
|
|
371
|
+
return openStdio(server.command, server.args, {
|
|
372
|
+
cwd: server.cwd ?? lease.sandbox.rootDir,
|
|
373
|
+
env: server.env,
|
|
374
|
+
signal: setup.signal,
|
|
375
|
+
assertExecutionAllowed
|
|
376
|
+
});
|
|
377
|
+
}), "transportFactory"),
|
|
378
|
+
requestTimeoutMs
|
|
379
|
+
});
|
|
380
|
+
try {
|
|
381
|
+
await client.connect();
|
|
382
|
+
const sources = await mcpToolset(client, {
|
|
383
|
+
id: `pal:${lease.palId}/computer:${lease.environmentId}:${lease.generation}/mcp:${server.name}`,
|
|
384
|
+
allow: server.allow,
|
|
385
|
+
maxRetries: 0,
|
|
386
|
+
readOnlyHintTrusted: false,
|
|
387
|
+
reconnect: { enabled: false }
|
|
388
|
+
});
|
|
389
|
+
clearSetup();
|
|
390
|
+
let closing;
|
|
391
|
+
const close = /* @__PURE__ */ __name(() => {
|
|
392
|
+
closing ??= (async () => {
|
|
393
|
+
releaseSignal();
|
|
394
|
+
for (const source of sources) await source.close?.();
|
|
395
|
+
await client.disconnect();
|
|
396
|
+
})();
|
|
397
|
+
return closing;
|
|
398
|
+
}, "close");
|
|
399
|
+
for (const source of sources)
|
|
400
|
+
toolsets.push({
|
|
401
|
+
...source,
|
|
402
|
+
tools: /* @__PURE__ */ __name(() => source.tools().map((tool) => ({
|
|
403
|
+
...tool,
|
|
404
|
+
timeoutMs: requestTimeoutMs + 1e3,
|
|
405
|
+
isConcurrencySafe: /* @__PURE__ */ __name(() => false, "isConcurrencySafe")
|
|
406
|
+
})), "tools"),
|
|
407
|
+
close
|
|
408
|
+
});
|
|
409
|
+
const names = /* @__PURE__ */ __name(() => sources.flatMap((source) => source.tools().map((tool) => tool.name)), "names");
|
|
410
|
+
connected.push({
|
|
411
|
+
name: server.name,
|
|
412
|
+
get toolCount() {
|
|
413
|
+
return names().length;
|
|
414
|
+
},
|
|
415
|
+
get tools() {
|
|
416
|
+
return names();
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
} catch (error) {
|
|
420
|
+
releaseSignal();
|
|
421
|
+
await client.disconnect();
|
|
422
|
+
signal?.throwIfAborted();
|
|
423
|
+
await assertExecutionAllowed();
|
|
424
|
+
failed.push({
|
|
425
|
+
name: server.name,
|
|
426
|
+
reason: setup.signal.aborted && setup.signal.reason instanceof Error ? setup.signal.reason.message : error instanceof Error ? error.message : String(error)
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
} catch (error) {
|
|
431
|
+
const failures = [error];
|
|
432
|
+
for (const source of toolsets) {
|
|
433
|
+
try {
|
|
434
|
+
await source.close?.();
|
|
435
|
+
} catch (cleanup) {
|
|
436
|
+
failures.push(cleanup);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
throw failures.length === 1 ? error : new AggregateError(failures, "Guest MCP setup and cleanup were not confirmed.");
|
|
440
|
+
}
|
|
441
|
+
return { connected, failed, toolsets };
|
|
442
|
+
}
|
|
443
|
+
__name(connectPalGuestMcp, "connectPalGuestMcp");
|
|
444
|
+
|
|
445
|
+
// src/pals/review.ts
|
|
446
|
+
async function readPalWaitingReview(log, turnId, checkpointId, now = Date.now()) {
|
|
447
|
+
asTurnId(turnId);
|
|
448
|
+
if (checkpointId !== void 0) asCheckpointId(checkpointId);
|
|
449
|
+
const active = await log.activeTurn();
|
|
450
|
+
if (active?.turnId !== turnId) throw new Error("This Pal turn is no longer waiting or active.");
|
|
451
|
+
const documents = /* @__PURE__ */ new Map();
|
|
452
|
+
const parks = /* @__PURE__ */ new Map();
|
|
453
|
+
for await (const { record, pointer } of log.read({ mode: "strict" })) {
|
|
454
|
+
if (record.sessionId !== log.sessionId) throw new Error("Foreign Pal review journal.");
|
|
455
|
+
if (record.turnId !== turnId) continue;
|
|
456
|
+
if (record.type === "checkpoint_written") documents.set(record.checkpointId, record.docSha256);
|
|
457
|
+
else if (record.type === "decision_requested") {
|
|
458
|
+
const request = record.request;
|
|
459
|
+
if (request.sessionId !== log.sessionId || request.turnId !== turnId || request.checkpointId !== record.checkpointId || typeof record.decisionId !== "string" || !record.decisionId)
|
|
460
|
+
throw new Error("Invalid Pal decision attribution.");
|
|
461
|
+
asCheckpointId(record.checkpointId);
|
|
462
|
+
const hash = documents.get(record.checkpointId);
|
|
463
|
+
if (!hash) throw new Error("Pal decision has no committed checkpoint.");
|
|
464
|
+
validateRequest(request);
|
|
465
|
+
const deadline = record.deadlineAt === void 0 ? void 0 : Date.parse(record.deadlineAt);
|
|
466
|
+
if (deadline !== void 0 && !Number.isFinite(deadline))
|
|
467
|
+
throw new Error("Invalid Pal decision deadline.");
|
|
468
|
+
parks.set(record.decisionId, {
|
|
469
|
+
turnId: asTurnId(turnId),
|
|
470
|
+
checkpointId: record.checkpointId,
|
|
471
|
+
decisionId: record.decisionId,
|
|
472
|
+
request: structuredClone(request),
|
|
473
|
+
requestRecord: { ...pointer },
|
|
474
|
+
checkpointDocSha256: hash,
|
|
475
|
+
...deadline !== void 0 ? { deadlineAt: deadline } : {}
|
|
476
|
+
});
|
|
477
|
+
} else if (record.type === "decision_resolved" || record.type === "decision_expired")
|
|
478
|
+
parks.delete(record.decisionId);
|
|
479
|
+
}
|
|
480
|
+
const latest = [...parks.values()].at(-1);
|
|
481
|
+
if (!latest) return null;
|
|
482
|
+
if (checkpointId !== void 0 && latest.checkpointId !== checkpointId)
|
|
483
|
+
throw new Error("This Pal decision was replaced by a newer review.");
|
|
484
|
+
if (latest.deadlineAt !== void 0 && now >= latest.deadlineAt)
|
|
485
|
+
throw new Error("This Pal decision expired.");
|
|
486
|
+
return latest;
|
|
487
|
+
}
|
|
488
|
+
__name(readPalWaitingReview, "readPalWaitingReview");
|
|
489
|
+
function validateRequest(request) {
|
|
490
|
+
if (request.type === "tool_review") {
|
|
491
|
+
if (!Array.isArray(request.toolCalls) || request.toolCalls.length === 0 || request.toolCalls.some(
|
|
492
|
+
(call) => !call || typeof call.id !== "string" || !call.id || typeof call.name !== "string" || !call.name || typeof call.isDestructive !== "boolean" || !Object.hasOwn(call, "input")
|
|
493
|
+
) || new Set(request.toolCalls.map((call) => call.id)).size !== request.toolCalls.length)
|
|
494
|
+
throw new Error("Invalid Pal tool review.");
|
|
495
|
+
} else if (request.type === "user_question") {
|
|
496
|
+
const question = request.question;
|
|
497
|
+
if (!question || typeof question.questionId !== "string" || !question.questionId || !Array.isArray(question.options) || typeof question.multiSelect !== "boolean" || typeof question.allowFreeText !== "boolean" || question.options.some((option) => !option || typeof option.id !== "string" || !option.id) || new Set(question.options.map((option) => option.id)).size !== question.options.length)
|
|
498
|
+
throw new Error("Invalid Pal question review.");
|
|
499
|
+
} else if (request.type !== "iteration_checkpoint")
|
|
500
|
+
throw new Error("This Pal review kind cannot be resumed durably.");
|
|
501
|
+
}
|
|
502
|
+
__name(validateRequest, "validateRequest");
|
|
503
|
+
function assertPalReviewDecision(request, decision) {
|
|
504
|
+
if (decision.action === "abort" || decision.action === "pause") {
|
|
505
|
+
if (typeof decision.reason !== "string") throw new Error("A Pal decision needs its reason.");
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
if (request.type === "tool_review") {
|
|
509
|
+
if (!["approve_tools", "reject_tools", "modify_tools"].includes(decision.action))
|
|
510
|
+
throw new Error("This answer does not apply to the waiting Pal tool review.");
|
|
511
|
+
if (decision.action === "reject_tools" && typeof decision.feedback !== "string")
|
|
512
|
+
throw new Error("A rejected Pal review needs its feedback.");
|
|
513
|
+
} else if (request.type === "user_question") {
|
|
514
|
+
if (decision.action !== "answer_question" || decision.questionId !== request.question.questionId)
|
|
515
|
+
throw new Error("This answer does not apply to the waiting Pal question.");
|
|
516
|
+
const question = request.question;
|
|
517
|
+
if (!Array.isArray(decision.selectedOptionIds) || decision.selectedOptionIds.some(
|
|
518
|
+
(id) => !question.options.some((option) => option.id === id)
|
|
519
|
+
) || new Set(decision.selectedOptionIds).size !== decision.selectedOptionIds.length || !question.multiSelect && decision.selectedOptionIds.length > 1 || decision.freeText !== void 0 && (!question.allowFreeText || typeof decision.freeText !== "string"))
|
|
520
|
+
throw new Error("Invalid answer to the waiting Pal question.");
|
|
521
|
+
} else if (request.type !== "iteration_checkpoint" || decision.action !== "continue")
|
|
522
|
+
throw new Error("This answer does not apply to the waiting Pal review.");
|
|
523
|
+
}
|
|
524
|
+
__name(assertPalReviewDecision, "assertPalReviewDecision");
|
|
525
|
+
|
|
526
|
+
// src/pals/agent-session.ts
|
|
527
|
+
function palSessionEnvironment(runtime, definition, conversationId) {
|
|
528
|
+
const { id, revision } = definition;
|
|
529
|
+
const request = /* @__PURE__ */ __name((signal) => ({
|
|
530
|
+
palId: id,
|
|
531
|
+
revision,
|
|
532
|
+
conversationId,
|
|
533
|
+
...signal ? { signal } : {}
|
|
534
|
+
}), "request");
|
|
535
|
+
return {
|
|
536
|
+
definition: structuredClone(definition),
|
|
537
|
+
readyComputer: /* @__PURE__ */ __name(() => {
|
|
538
|
+
const lease = runtime.computer(id);
|
|
539
|
+
const control = runtime.computerControl(id);
|
|
540
|
+
return lease && (!control.supported || control.mode === "pal") ? lease : void 0;
|
|
541
|
+
}, "readyComputer"),
|
|
542
|
+
observeComputer: /* @__PURE__ */ __name(() => {
|
|
543
|
+
const lease = runtime.computer(id);
|
|
544
|
+
if (!lease) return void 0;
|
|
545
|
+
const control = runtime.computerControl(id);
|
|
546
|
+
if (runtime.computer(id) !== lease) return void 0;
|
|
547
|
+
return { status: "connected", control: control.mode };
|
|
548
|
+
}, "observeComputer"),
|
|
549
|
+
admit: /* @__PURE__ */ __name((signal) => runtime.admit(request(signal)), "admit"),
|
|
550
|
+
admitConversation: /* @__PURE__ */ __name((signal) => runtime.admitConversation(request(signal)), "admitConversation")
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
__name(palSessionEnvironment, "palSessionEnvironment");
|
|
554
|
+
function guardHost(host, assertActive, ignoreDestroy = false, current, beforeAsync) {
|
|
555
|
+
return new Proxy(host, {
|
|
556
|
+
get(target, key) {
|
|
557
|
+
const source = current?.() ?? target;
|
|
558
|
+
const value = Reflect.get(source, key, source);
|
|
559
|
+
if (ignoreDestroy && key === "destroy") return async () => {
|
|
560
|
+
};
|
|
561
|
+
if (typeof value !== "function") return value;
|
|
562
|
+
if (beforeAsync && key === "execStream")
|
|
563
|
+
return async function* (...args) {
|
|
564
|
+
await beforeAsync();
|
|
565
|
+
assertActive();
|
|
566
|
+
const actual = current?.() ?? target;
|
|
567
|
+
const method = Reflect.get(actual, key, actual);
|
|
568
|
+
if (typeof method !== "function")
|
|
569
|
+
throw new Error("This Pal computer lost its stream operation.");
|
|
570
|
+
yield* method.apply(actual, args);
|
|
571
|
+
};
|
|
572
|
+
if (beforeAsync && ["readFile", "writeFile", "listFiles", "exec", "execute", "getDisplayGeometry"].includes(
|
|
573
|
+
String(key)
|
|
574
|
+
))
|
|
575
|
+
return async (...args) => {
|
|
576
|
+
await beforeAsync();
|
|
577
|
+
assertActive();
|
|
578
|
+
const actual = current?.() ?? target;
|
|
579
|
+
const method = Reflect.get(actual, key, actual);
|
|
580
|
+
if (typeof method !== "function") throw new Error("This Pal computer lost its operation.");
|
|
581
|
+
return method.apply(actual, args);
|
|
582
|
+
};
|
|
583
|
+
return (...args) => {
|
|
584
|
+
assertActive();
|
|
585
|
+
const actual = current?.() ?? target;
|
|
586
|
+
const method = Reflect.get(actual, key, actual);
|
|
587
|
+
if (typeof method !== "function")
|
|
588
|
+
throw new Error("This Pal computer does not support that operation.");
|
|
589
|
+
return method.apply(actual, args);
|
|
590
|
+
};
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
__name(guardHost, "guardHost");
|
|
595
|
+
function guardProvider(provider, assertActive, assertExecutionAllowed) {
|
|
596
|
+
const guarded = guardHost(provider, assertActive);
|
|
597
|
+
return new Proxy(guarded, {
|
|
598
|
+
get(target, key) {
|
|
599
|
+
if (key === "chatStream")
|
|
600
|
+
return async function* (params) {
|
|
601
|
+
assertActive();
|
|
602
|
+
await assertExecutionAllowed();
|
|
603
|
+
assertActive();
|
|
604
|
+
yield* target.chatStream(params);
|
|
605
|
+
};
|
|
606
|
+
return Reflect.get(target, key, target);
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
}
|
|
610
|
+
__name(guardProvider, "guardProvider");
|
|
611
|
+
async function createPalAgentSession(prefs, detected, options) {
|
|
612
|
+
const suppliedBinding = options.palEnvironment;
|
|
613
|
+
const binding = suppliedBinding ? {
|
|
614
|
+
...suppliedBinding,
|
|
615
|
+
definition: structuredClone(suppliedBinding.definition),
|
|
616
|
+
admit: suppliedBinding.admit.bind(suppliedBinding),
|
|
617
|
+
admitConversation: suppliedBinding.admitConversation?.bind(suppliedBinding),
|
|
618
|
+
readyComputer: suppliedBinding.readyComputer?.bind(suppliedBinding)
|
|
619
|
+
} : void 0;
|
|
620
|
+
const scope = options.scope ? { ...options.scope } : void 0;
|
|
621
|
+
const conversations = options.conversationSessions;
|
|
622
|
+
if (!binding || !scope || !conversations)
|
|
623
|
+
throw new Error("Pal execution requires its owned computer and claimed conversation scope.");
|
|
624
|
+
if (options.cwd !== binding.definition.workspace || binding.lease && binding.lease.palId !== binding.definition.id || !binding.admitConversation && !binding.lease)
|
|
625
|
+
throw new Error("This Pal does not own the conversation or computer.");
|
|
626
|
+
const primary = { ...primaryProvider(prefs) };
|
|
627
|
+
const entry = PROVIDER_REGISTRY[primary.id];
|
|
628
|
+
if (!entry) throw new Error("Unknown Pal model provider.");
|
|
629
|
+
await ensureRegistered(primary.id);
|
|
630
|
+
const model = primary.model ?? entry.defaultModel;
|
|
631
|
+
let current = findDetected(detected, primary.id);
|
|
632
|
+
const refresh = createCurrentCredentialReader();
|
|
633
|
+
let provider = constructProvider(primary.id, current, model, {
|
|
634
|
+
sessionId: scope.sessionId
|
|
635
|
+
});
|
|
636
|
+
let admission;
|
|
637
|
+
let conversationAdmission;
|
|
638
|
+
let identity = {
|
|
639
|
+
name: binding.definition.name,
|
|
640
|
+
appearance: binding.definition.appearance
|
|
641
|
+
};
|
|
642
|
+
let writer;
|
|
643
|
+
let borrowedWriter;
|
|
644
|
+
let closed = false;
|
|
645
|
+
let cleaned = false;
|
|
646
|
+
let closing;
|
|
647
|
+
let activeAbort;
|
|
648
|
+
let settleSend;
|
|
649
|
+
let sendSettled = Promise.resolve();
|
|
650
|
+
const assertActive = /* @__PURE__ */ __name(() => {
|
|
651
|
+
if (closed || !conversationAdmission && !admission)
|
|
652
|
+
throw new Error("This Pal does not own an active conversation admission.");
|
|
653
|
+
if (conversationAdmission) conversationAdmission.assertActive();
|
|
654
|
+
else admission?.assertActive();
|
|
655
|
+
if (conversationAdmission && admission) admission.assertActive();
|
|
656
|
+
}, "assertActive");
|
|
657
|
+
const assertComputerActive = /* @__PURE__ */ __name(() => {
|
|
658
|
+
assertActive();
|
|
659
|
+
if (!admission) throw new Error("This Pal turn has no computer authority.");
|
|
660
|
+
admission.assertActive();
|
|
661
|
+
}, "assertComputerActive");
|
|
662
|
+
const releaseAdmission = /* @__PURE__ */ __name(async (workFailure) => {
|
|
663
|
+
try {
|
|
664
|
+
if (conversationAdmission) await conversationAdmission.release();
|
|
665
|
+
else await admission?.release();
|
|
666
|
+
admission = void 0;
|
|
667
|
+
conversationAdmission = void 0;
|
|
668
|
+
} catch (error) {
|
|
669
|
+
if (workFailure !== void 0)
|
|
670
|
+
throw new AggregateError([workFailure, error], "Pal work and admission cleanup failed.");
|
|
671
|
+
throw error;
|
|
672
|
+
}
|
|
673
|
+
}, "releaseAdmission");
|
|
674
|
+
let sandboxProvider;
|
|
675
|
+
let tools = [];
|
|
676
|
+
let sets = [];
|
|
677
|
+
let guestMcp = {
|
|
678
|
+
toolsets: [],
|
|
679
|
+
connected: [],
|
|
680
|
+
failed: []
|
|
681
|
+
};
|
|
682
|
+
let manager = new ToolManager({ toolsets: sets, messages: /* @__PURE__ */ __name(() => [], "messages") });
|
|
683
|
+
let selectedTaskStore;
|
|
684
|
+
let taskPresentationTurn;
|
|
685
|
+
let taskPresentationTools = [];
|
|
686
|
+
const taskToolOverrides = {
|
|
687
|
+
task_create: options.toolLoading === "deferred" ? "deferred" : "active",
|
|
688
|
+
task_update: options.toolLoading === "deferred" ? "deferred" : "active",
|
|
689
|
+
task_list: options.toolLoading === "deferred" ? "deferred" : "active"
|
|
690
|
+
};
|
|
691
|
+
const presenter = createToolPresenter({
|
|
692
|
+
get: /* @__PURE__ */ __name((name) => {
|
|
693
|
+
manager.refresh();
|
|
694
|
+
return manager.get(name) ?? taskPresentationTools.find((tool) => tool.name === name);
|
|
695
|
+
}, "get")
|
|
696
|
+
});
|
|
697
|
+
const observeSessionEvent = /* @__PURE__ */ __name((event) => {
|
|
698
|
+
if (selectedTaskStore && event.sessionId === scope.sessionId && event.turnId !== void 0 && event.turnId !== taskPresentationTurn) {
|
|
699
|
+
taskPresentationTools = buildTaskTools(selectedTaskStore, {
|
|
700
|
+
sessionId: event.sessionId,
|
|
701
|
+
turnId: event.turnId
|
|
702
|
+
});
|
|
703
|
+
taskPresentationTurn = event.turnId;
|
|
704
|
+
}
|
|
705
|
+
options.onSessionEvent?.(event);
|
|
706
|
+
}, "observeSessionEvent");
|
|
707
|
+
const messaging = createCliPalMessagingContext(binding.definition, scope, assertActive);
|
|
708
|
+
let assertExecutionAllowed;
|
|
709
|
+
let activePermissionMode;
|
|
710
|
+
let referenceAttachments = [];
|
|
711
|
+
const closeGuestMcp = /* @__PURE__ */ __name(async () => {
|
|
712
|
+
const failures = [];
|
|
713
|
+
for (const source of guestMcp.toolsets) {
|
|
714
|
+
try {
|
|
715
|
+
await source.close?.();
|
|
716
|
+
} catch (error) {
|
|
717
|
+
failures.push(error);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
if (failures.length)
|
|
721
|
+
throw new AggregateError(failures, "Pal application server cleanup was not confirmed.");
|
|
722
|
+
}, "closeGuestMcp");
|
|
723
|
+
const configureComputer = /* @__PURE__ */ __name(async (lease) => {
|
|
724
|
+
await manager.dispose();
|
|
725
|
+
await closeGuestMcp();
|
|
726
|
+
tools = [];
|
|
727
|
+
sets = [];
|
|
728
|
+
guestMcp = { toolsets: [], connected: [], failed: [] };
|
|
729
|
+
sandboxProvider = void 0;
|
|
730
|
+
if (lease) {
|
|
731
|
+
const guest = guardHost(
|
|
732
|
+
lease.sandbox,
|
|
733
|
+
assertComputerActive,
|
|
734
|
+
true,
|
|
735
|
+
() => admission?.lease.sandbox ?? lease.sandbox,
|
|
736
|
+
async () => {
|
|
737
|
+
await renewWriter();
|
|
738
|
+
await assertExecutionAllowed?.();
|
|
739
|
+
}
|
|
740
|
+
);
|
|
741
|
+
const computer = guardHost(
|
|
742
|
+
lease.computerUseHost,
|
|
743
|
+
assertComputerActive,
|
|
744
|
+
false,
|
|
745
|
+
() => admission?.lease.computerUseHost ?? lease.computerUseHost,
|
|
746
|
+
async () => {
|
|
747
|
+
await renewWriter();
|
|
748
|
+
await assertExecutionAllowed?.();
|
|
749
|
+
}
|
|
750
|
+
);
|
|
751
|
+
sandboxProvider = {
|
|
752
|
+
id: `pal:${binding.definition.id}`,
|
|
753
|
+
name: "Pal virtual computer",
|
|
754
|
+
environment: guest.environment,
|
|
755
|
+
workspaceModes: ["working-directory"],
|
|
756
|
+
create: /* @__PURE__ */ __name(async () => {
|
|
757
|
+
assertComputerActive();
|
|
758
|
+
return guest;
|
|
759
|
+
}, "create")
|
|
760
|
+
};
|
|
761
|
+
const allTools = getBuiltinTools();
|
|
762
|
+
const computerTool = createComputerUseTool(computer, {
|
|
763
|
+
unavailableReason: computerUseUnavailableReason(provider)
|
|
764
|
+
});
|
|
765
|
+
tools = [
|
|
766
|
+
...allTools,
|
|
767
|
+
createViewImageTool({
|
|
768
|
+
unavailableReason: computerUseUnavailableReason(provider)
|
|
769
|
+
}),
|
|
770
|
+
...messaging.tools,
|
|
771
|
+
createPalReferenceImageTool({
|
|
772
|
+
attachments: /* @__PURE__ */ __name(() => referenceAttachments, "attachments"),
|
|
773
|
+
assertCurrentAdmission: /* @__PURE__ */ __name(async () => {
|
|
774
|
+
assertComputerActive();
|
|
775
|
+
await renewWriter();
|
|
776
|
+
await assertExecutionAllowed?.();
|
|
777
|
+
assertComputerActive();
|
|
778
|
+
if (activePermissionMode?.() === "plan") throw new Error(PLAN_MODE_REFUSAL);
|
|
779
|
+
}, "assertCurrentAdmission")
|
|
780
|
+
}),
|
|
781
|
+
computerTool,
|
|
782
|
+
...lease.browserHost ? createBrowserTools(
|
|
783
|
+
guardHost(lease.browserHost, assertComputerActive, false, () => {
|
|
784
|
+
const browser = admission?.lease.browserHost ?? lease.browserHost;
|
|
785
|
+
if (!browser)
|
|
786
|
+
throw new Error("This Pal computer does not support browser operations.");
|
|
787
|
+
return browser;
|
|
788
|
+
})
|
|
789
|
+
) : []
|
|
790
|
+
];
|
|
791
|
+
const guardTool = /* @__PURE__ */ __name((tool) => ({
|
|
792
|
+
...tool,
|
|
793
|
+
async execute(input, context) {
|
|
794
|
+
assertComputerActive();
|
|
795
|
+
manager.refresh();
|
|
796
|
+
await renewWriter();
|
|
797
|
+
await assertExecutionAllowed?.();
|
|
798
|
+
assertComputerActive();
|
|
799
|
+
if (activePermissionMode?.() === "plan" && !reviewExemptionFor("plan", manager, () => false)(tool.name, input))
|
|
800
|
+
throw new Error(PLAN_MODE_REFUSAL);
|
|
801
|
+
return tool.execute(input, context);
|
|
802
|
+
}
|
|
803
|
+
}), "guardTool");
|
|
804
|
+
sets = [toolset("pal-computer", tools.map(guardTool))];
|
|
805
|
+
if (admission) {
|
|
806
|
+
const pinned = {
|
|
807
|
+
environmentId: lease.environmentId,
|
|
808
|
+
generation: lease.generation
|
|
809
|
+
};
|
|
810
|
+
guestMcp = await connectPalGuestMcp(
|
|
811
|
+
lease,
|
|
812
|
+
async () => {
|
|
813
|
+
assertComputerActive();
|
|
814
|
+
await renewWriter();
|
|
815
|
+
await assertExecutionAllowed?.();
|
|
816
|
+
assertComputerActive();
|
|
817
|
+
if (admission?.lease.environmentId !== pinned.environmentId || admission?.lease.generation !== pinned.generation)
|
|
818
|
+
throw new Error("This guest MCP server belongs to another Pal computer lifetime.");
|
|
819
|
+
},
|
|
820
|
+
activeAbort?.signal
|
|
821
|
+
);
|
|
822
|
+
sets.push(
|
|
823
|
+
...guestMcp.toolsets.map((source) => ({
|
|
824
|
+
...source,
|
|
825
|
+
tools: /* @__PURE__ */ __name(() => source.tools().map(guardTool), "tools")
|
|
826
|
+
}))
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
manager = new ToolManager({ toolsets: sets, messages: /* @__PURE__ */ __name(() => [], "messages") });
|
|
831
|
+
}, "configureComputer");
|
|
832
|
+
await configureComputer(binding.readyComputer?.() ?? binding.lease);
|
|
833
|
+
const jobs = new BackgroundJobRegistry();
|
|
834
|
+
const ownedJobs = bindOwner(jobs, scope.sessionId);
|
|
835
|
+
const approval = { all: false };
|
|
836
|
+
const permissionReader = /* @__PURE__ */ __name((opts) => {
|
|
837
|
+
const read = opts?.currentPermissionMode;
|
|
838
|
+
const fallback = opts?.permissionMode ?? options.permissionMode ?? // Supplying a review UI does not opt an owned guest into prompting.
|
|
839
|
+
// Explicit modes and a durable review hold still narrow this default.
|
|
840
|
+
(opts?.reviewHold ? "prompt" : "auto");
|
|
841
|
+
return () => read?.() ?? fallback;
|
|
842
|
+
}, "permissionReader");
|
|
843
|
+
const beginWork = /* @__PURE__ */ __name((signal, guard, mode) => {
|
|
844
|
+
if (closed) throw new Error("This Pal conversation is closed.");
|
|
845
|
+
if (activeAbort) throw new Error("This Pal conversation already has active work.");
|
|
846
|
+
if (admission || conversationAdmission || writer)
|
|
847
|
+
throw new Error("This Pal admission needs cleanup before further work.");
|
|
848
|
+
if (options.scope?.sessionId !== scope.sessionId)
|
|
849
|
+
throw new Error("Reopen this Pal conversation after switching its session.");
|
|
850
|
+
const controller = new AbortController();
|
|
851
|
+
const onAbort = /* @__PURE__ */ __name(() => controller.abort(signal?.reason), "onAbort");
|
|
852
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
853
|
+
if (signal?.aborted) onAbort();
|
|
854
|
+
activeAbort = controller;
|
|
855
|
+
selectedTaskStore = void 0;
|
|
856
|
+
taskPresentationTurn = void 0;
|
|
857
|
+
taskPresentationTools = [];
|
|
858
|
+
referenceAttachments = [];
|
|
859
|
+
assertExecutionAllowed = guard;
|
|
860
|
+
activePermissionMode = mode;
|
|
861
|
+
sendSettled = new Promise((done) => {
|
|
862
|
+
settleSend = done;
|
|
863
|
+
});
|
|
864
|
+
return { controller, signal, onAbort };
|
|
865
|
+
}, "beginWork");
|
|
866
|
+
const releaseWriter = /* @__PURE__ */ __name(async () => {
|
|
867
|
+
if (!writer) return;
|
|
868
|
+
writer.closing = true;
|
|
869
|
+
if (writer.heartbeat) {
|
|
870
|
+
clearInterval(writer.heartbeat);
|
|
871
|
+
writer.heartbeat = void 0;
|
|
872
|
+
}
|
|
873
|
+
await writer.renewing?.catch(() => void 0);
|
|
874
|
+
await writer.log.release(writer.lease);
|
|
875
|
+
writer = void 0;
|
|
876
|
+
}, "releaseWriter");
|
|
877
|
+
const renewWriter = /* @__PURE__ */ __name(async () => {
|
|
878
|
+
if (borrowedWriter) {
|
|
879
|
+
const current2 = await borrowedWriter.log.lease();
|
|
880
|
+
if (!current2 || current2.fence !== borrowedWriter.lease.fence || current2.holder !== borrowedWriter.lease.holder || current2.expiresAt <= Date.now())
|
|
881
|
+
throw new Error("This Pal resume lost its borrowed session writer lease.");
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const owned = writer;
|
|
885
|
+
if (!owned) return;
|
|
886
|
+
if (owned.closing) throw new Error("This Pal resume writer is closing.");
|
|
887
|
+
if (owned.renewing) return owned.renewing;
|
|
888
|
+
const renewal = (async () => {
|
|
889
|
+
const renewed = await owned.log.claim({
|
|
890
|
+
holder: owned.lease.holder,
|
|
891
|
+
ttlMs: 9e4,
|
|
892
|
+
repairTornTail: false
|
|
893
|
+
});
|
|
894
|
+
if (!renewed || renewed.fence !== owned.lease.fence)
|
|
895
|
+
throw new Error("This Pal resume lost its session writer lease.");
|
|
896
|
+
owned.lease = renewed;
|
|
897
|
+
})();
|
|
898
|
+
owned.renewing = renewal;
|
|
899
|
+
try {
|
|
900
|
+
await renewal;
|
|
901
|
+
} finally {
|
|
902
|
+
if (owned.renewing === renewal) owned.renewing = void 0;
|
|
903
|
+
}
|
|
904
|
+
}, "renewWriter");
|
|
905
|
+
const finishWork = /* @__PURE__ */ __name(async (work, failure) => {
|
|
906
|
+
try {
|
|
907
|
+
const failures = [];
|
|
908
|
+
try {
|
|
909
|
+
await releaseWriter();
|
|
910
|
+
} catch (error) {
|
|
911
|
+
failures.push(error);
|
|
912
|
+
}
|
|
913
|
+
try {
|
|
914
|
+
await releaseAdmission();
|
|
915
|
+
} catch (error) {
|
|
916
|
+
failures.push(error);
|
|
917
|
+
}
|
|
918
|
+
if (failures.length)
|
|
919
|
+
throw failures.length === 1 && failure === void 0 ? failures[0] : new AggregateError(
|
|
920
|
+
[...failure === void 0 ? [] : [failure], ...failures],
|
|
921
|
+
"Pal work cleanup was not confirmed."
|
|
922
|
+
);
|
|
923
|
+
} finally {
|
|
924
|
+
work.signal?.removeEventListener("abort", work.onAbort);
|
|
925
|
+
activeAbort = void 0;
|
|
926
|
+
assertExecutionAllowed = void 0;
|
|
927
|
+
activePermissionMode = void 0;
|
|
928
|
+
referenceAttachments = [];
|
|
929
|
+
borrowedWriter = void 0;
|
|
930
|
+
settleSend?.();
|
|
931
|
+
settleSend = void 0;
|
|
932
|
+
}
|
|
933
|
+
}, "finishWork");
|
|
934
|
+
const assertOwnedConversation = /* @__PURE__ */ __name(async () => {
|
|
935
|
+
const owner = await palConversationBinding(binding.definition.workspace, scope.sessionId);
|
|
936
|
+
if (!owner || owner.definition.id !== binding.definition.id || owner.definition.revision !== binding.definition.revision || owner.definition.workspace !== binding.definition.workspace)
|
|
937
|
+
throw new Error("This Pal does not own the pinned conversation revision.");
|
|
938
|
+
identity = { name: owner.pal.name, appearance: owner.pal.appearance };
|
|
939
|
+
}, "assertOwnedConversation");
|
|
940
|
+
const prepareProvider = /* @__PURE__ */ __name(async (controller) => {
|
|
941
|
+
if (current?.entry.id === "codex" && current.codex?.origin === "stored") {
|
|
942
|
+
const credential = await ensureFreshStoredCodexCredential(controller.signal);
|
|
943
|
+
current = {
|
|
944
|
+
...current,
|
|
945
|
+
apiKey: credential.accessToken,
|
|
946
|
+
codex: {
|
|
947
|
+
...current.codex,
|
|
948
|
+
accountId: credential.accountId,
|
|
949
|
+
expiresAt: credential.expiresAt
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
} else if (current?.entry.id === "codex" && current.source.kind === "codex-file") {
|
|
953
|
+
const credential = readCodexCredentialFile(current.source.path);
|
|
954
|
+
if (!credential || credential.expiresAt !== void 0 && credential.expiresAt <= Date.now())
|
|
955
|
+
throw new Error(
|
|
956
|
+
"The Codex credential is unavailable or expired; refresh it with its owner."
|
|
957
|
+
);
|
|
958
|
+
current = {
|
|
959
|
+
...current,
|
|
960
|
+
apiKey: credential.accessToken,
|
|
961
|
+
codex: {
|
|
962
|
+
...current.codex,
|
|
963
|
+
accountId: credential.accountId,
|
|
964
|
+
expiresAt: credential.expiresAt,
|
|
965
|
+
origin: "codex-file"
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
} else current = await refresh(current, controller.signal);
|
|
969
|
+
provider = guardProvider(
|
|
970
|
+
constructProvider(primary.id, current, model, {
|
|
971
|
+
sessionId: scope.sessionId
|
|
972
|
+
}),
|
|
973
|
+
assertActive,
|
|
974
|
+
async () => {
|
|
975
|
+
await renewWriter();
|
|
976
|
+
await assertExecutionAllowed?.();
|
|
977
|
+
}
|
|
978
|
+
);
|
|
979
|
+
}, "prepareProvider");
|
|
980
|
+
const enterConversation = /* @__PURE__ */ __name(async (controller, requireComputer = false) => {
|
|
981
|
+
controller.signal.throwIfAborted();
|
|
982
|
+
await assertExecutionAllowed?.();
|
|
983
|
+
controller.signal.throwIfAborted();
|
|
984
|
+
await assertOwnedConversation();
|
|
985
|
+
if (binding.admitConversation) {
|
|
986
|
+
conversationAdmission = await binding.admitConversation(controller.signal);
|
|
987
|
+
assertActive();
|
|
988
|
+
const ready = binding.readyComputer?.();
|
|
989
|
+
if (requireComputer || ready) {
|
|
990
|
+
admission = await conversationAdmission.acquireComputer();
|
|
991
|
+
if (ready && (admission.lease.environmentId !== ready.environmentId || admission.lease.generation !== ready.generation))
|
|
992
|
+
throw new Error("This Pal computer changed before its turn was admitted.");
|
|
993
|
+
}
|
|
994
|
+
} else admission = await binding.admit(controller.signal);
|
|
995
|
+
assertActive();
|
|
996
|
+
await configureComputer(admission?.lease);
|
|
997
|
+
await prepareProvider(controller);
|
|
998
|
+
}, "enterConversation");
|
|
999
|
+
const queryOptions = /* @__PURE__ */ __name((opts) => {
|
|
1000
|
+
const taskStore = admission ? new DiskTaskStore({
|
|
1001
|
+
paths: conversations.paths,
|
|
1002
|
+
session: { sessionId: scope.sessionId },
|
|
1003
|
+
tenantId: scope.tenantId
|
|
1004
|
+
}) : void 0;
|
|
1005
|
+
selectedTaskStore = taskStore;
|
|
1006
|
+
const read = activePermissionMode ?? permissionReader(opts);
|
|
1007
|
+
const modeControl = createLiveModeControl({
|
|
1008
|
+
initial: read(),
|
|
1009
|
+
read,
|
|
1010
|
+
handlerFor: /* @__PURE__ */ __name((mode) => {
|
|
1011
|
+
const exempt = reviewExemptionFor(mode, manager, () => false);
|
|
1012
|
+
return opts?.reviewHold ? makeHoldingResumeHandler(mode, exempt, {}, opts.reviewHold.reason) : makeResumeHandler(approval, opts?.onPermission, mode, exempt);
|
|
1013
|
+
}, "handlerFor")
|
|
1014
|
+
});
|
|
1015
|
+
return {
|
|
1016
|
+
provider,
|
|
1017
|
+
paths: conversations.paths,
|
|
1018
|
+
...scope,
|
|
1019
|
+
agentId: `pal:${binding.definition.id}`,
|
|
1020
|
+
agentName: identity.name,
|
|
1021
|
+
...admission ? { workingDirectory: admission.lease.sandbox.rootDir, sandboxProvider } : {},
|
|
1022
|
+
sandboxEscape: "refuse",
|
|
1023
|
+
outsideRootAccess: "refuse",
|
|
1024
|
+
toolsets: sets,
|
|
1025
|
+
...taskStore ? {
|
|
1026
|
+
taskStore,
|
|
1027
|
+
runtimeToolOverrides: taskToolOverrides,
|
|
1028
|
+
prepareStep: [createTaskContextStep(taskStore, scope.tenantId)]
|
|
1029
|
+
} : {},
|
|
1030
|
+
systemPrompt: [
|
|
1031
|
+
buildPalSystemPrompt(
|
|
1032
|
+
{ ...binding.definition, ...identity },
|
|
1033
|
+
{
|
|
1034
|
+
greeting: palConversationGreeting(binding.definition, scope.sessionId),
|
|
1035
|
+
computer: admission ? {
|
|
1036
|
+
status: "ready",
|
|
1037
|
+
workingDirectory: admission.lease.sandbox.rootDir
|
|
1038
|
+
} : binding.observeComputer?.() ?? { status: "unavailable" },
|
|
1039
|
+
...opts?.systemNote ? { systemNote: opts.systemNote } : {}
|
|
1040
|
+
}
|
|
1041
|
+
),
|
|
1042
|
+
taskStore ? "For genuinely multi-step work, use task_create to track meaningful steps and task_update as their progress changes; use task_list to inspect the plan. These are agent-maintained planning records, not evidence that work succeeded and not delegated agents. Do not create a task list for ordinary chat or a simple single-step request. Mark work complete only when the requested result has been verified." : void 0
|
|
1043
|
+
].filter(Boolean).join("\n\n"),
|
|
1044
|
+
beforeStep: /* @__PURE__ */ __name(async () => {
|
|
1045
|
+
assertActive();
|
|
1046
|
+
await renewWriter();
|
|
1047
|
+
await assertExecutionAllowed?.();
|
|
1048
|
+
assertActive();
|
|
1049
|
+
return void 0;
|
|
1050
|
+
}, "beforeStep"),
|
|
1051
|
+
authorizationGate: {
|
|
1052
|
+
enabled: true,
|
|
1053
|
+
allowReadOnlyTools: true,
|
|
1054
|
+
denyDangerousPatterns: true,
|
|
1055
|
+
logDecisions: false,
|
|
1056
|
+
rules: [...opts?.rules ?? options.rules ?? []]
|
|
1057
|
+
},
|
|
1058
|
+
resumeHandler: modeControl.handler,
|
|
1059
|
+
approvalPolicyName: modeControl.initialName,
|
|
1060
|
+
onApprovalPolicy: /* @__PURE__ */ __name((box) => modeControl.attach(box), "onApprovalPolicy"),
|
|
1061
|
+
reviewAllowedCalls: modeControl.reviewAllowedCalls,
|
|
1062
|
+
backgroundJobs: jobs,
|
|
1063
|
+
backgroundJobOwner: scope.sessionId
|
|
1064
|
+
};
|
|
1065
|
+
}, "queryOptions");
|
|
1066
|
+
const kernelResume = /* @__PURE__ */ __name(async (input) => {
|
|
1067
|
+
const params = {
|
|
1068
|
+
...input,
|
|
1069
|
+
entry: { ...input.entry },
|
|
1070
|
+
...input.pendingDecision ? { pendingDecision: structuredClone(input.pendingDecision) } : {},
|
|
1071
|
+
...input.model ? { model: { ...input.model } } : {}
|
|
1072
|
+
};
|
|
1073
|
+
const work = beginWork(params.signal, params.assertExecutionAllowed, permissionReader(params));
|
|
1074
|
+
let failure;
|
|
1075
|
+
try {
|
|
1076
|
+
const expected = DiskSessionLog.at(conversations.paths, {
|
|
1077
|
+
sessionId: scope.sessionId
|
|
1078
|
+
});
|
|
1079
|
+
if (params.entry.sessionId !== scope.sessionId || params.entry.tenantId !== scope.tenantId || params.entry.projectId !== scope.projectId || !(params.sessionLog instanceof DiskSessionLog) || params.sessionLog.file !== expected.file || params.sessionLog.sessionDir !== expected.sessionDir)
|
|
1080
|
+
throw new Error("A Pal can resume only its own original conversation journal.");
|
|
1081
|
+
const turnId = asTurnId(params.entry.turnId);
|
|
1082
|
+
const checkpointId = params.checkpointId === void 0 ? void 0 : asCheckpointId(params.checkpointId);
|
|
1083
|
+
if (params.model && (params.model.provider !== primary.id || (params.model.model ?? model) !== model))
|
|
1084
|
+
throw new Error("A Pal resume must retain its pinned model provider and model.");
|
|
1085
|
+
await assertExecutionAllowed?.();
|
|
1086
|
+
work.controller.signal.throwIfAborted();
|
|
1087
|
+
await assertOwnedConversation();
|
|
1088
|
+
const waiting = await readPalWaitingReview(params.sessionLog, turnId, checkpointId);
|
|
1089
|
+
if (params.pendingDecision) {
|
|
1090
|
+
if (!waiting) throw new Error("This Pal decision is no longer waiting.");
|
|
1091
|
+
assertPalReviewDecision(waiting.request, params.pendingDecision);
|
|
1092
|
+
}
|
|
1093
|
+
const limits = await readStoredTurnGuards(params.sessionLog, turnId);
|
|
1094
|
+
if (!limits) throw new Error("This Pal turn has no original recorded limits.");
|
|
1095
|
+
for await (const { record } of params.sessionLog.read({
|
|
1096
|
+
mode: "strict"
|
|
1097
|
+
})) {
|
|
1098
|
+
if (record.type === "turn_started" && record.turnId === turnId && record.config.model !== model)
|
|
1099
|
+
throw new Error("This Pal turn used another model.");
|
|
1100
|
+
if (record.type === "message" && record.turnId === turnId && record.content.role === "user" && !record.content.source)
|
|
1101
|
+
referenceAttachments = structuredClone(record.content.attachments ?? []);
|
|
1102
|
+
}
|
|
1103
|
+
const effort = params.model?.effort;
|
|
1104
|
+
if (effort !== void 0 && !["none", "minimal", "low", "medium", "high", "xhigh", "max", "ultra"].includes(effort))
|
|
1105
|
+
throw new Error("Invalid Pal resume reasoning effort.");
|
|
1106
|
+
if (params.lease) {
|
|
1107
|
+
borrowedWriter = { log: params.sessionLog, lease: { ...params.lease } };
|
|
1108
|
+
await renewWriter();
|
|
1109
|
+
} else {
|
|
1110
|
+
const lease = await params.sessionLog.claim({
|
|
1111
|
+
holder: `pal-resume:${randomUUID()}`,
|
|
1112
|
+
ttlMs: 9e4,
|
|
1113
|
+
repairTornTail: false
|
|
1114
|
+
});
|
|
1115
|
+
if (!lease) throw new Error("This Pal turn is leased by another writer.");
|
|
1116
|
+
writer = { log: params.sessionLog, lease };
|
|
1117
|
+
writer.heartbeat = setInterval(() => {
|
|
1118
|
+
void renewWriter().catch((error) => work.controller.abort(error));
|
|
1119
|
+
}, 3e4);
|
|
1120
|
+
writer.heartbeat.unref();
|
|
1121
|
+
}
|
|
1122
|
+
const lockedWaiting = await readPalWaitingReview(params.sessionLog, turnId, checkpointId);
|
|
1123
|
+
if (params.pendingDecision) {
|
|
1124
|
+
if (!lockedWaiting || lockedWaiting.decisionId !== waiting?.decisionId || lockedWaiting.requestRecord.sha256 !== waiting.requestRecord.sha256)
|
|
1125
|
+
throw new Error("This Pal decision changed before its writer was admitted.");
|
|
1126
|
+
assertPalReviewDecision(lockedWaiting.request, params.pendingDecision);
|
|
1127
|
+
}
|
|
1128
|
+
await enterConversation(work.controller, true);
|
|
1129
|
+
return await resumeSession({
|
|
1130
|
+
...queryOptions(params),
|
|
1131
|
+
scope: { ...scope, turnId },
|
|
1132
|
+
sessionLog: params.sessionLog,
|
|
1133
|
+
...params.checkpointStore ? { checkpointStore: params.checkpointStore } : {},
|
|
1134
|
+
lease: params.lease ?? writer?.lease,
|
|
1135
|
+
...checkpointId ? { checkpointId } : {},
|
|
1136
|
+
...params.pendingDecision ? { pendingDecision: params.pendingDecision } : {},
|
|
1137
|
+
turnConfig: {
|
|
1138
|
+
model,
|
|
1139
|
+
...limits,
|
|
1140
|
+
sandbox: { workspace: "working-directory" },
|
|
1141
|
+
permissionMode: "auto",
|
|
1142
|
+
...effort ? { effort } : {}
|
|
1143
|
+
},
|
|
1144
|
+
listener: /* @__PURE__ */ __name((event) => {
|
|
1145
|
+
observeSessionEvent(event);
|
|
1146
|
+
params.listener?.(event);
|
|
1147
|
+
}, "listener"),
|
|
1148
|
+
signal: work.controller.signal
|
|
1149
|
+
});
|
|
1150
|
+
} catch (error) {
|
|
1151
|
+
failure = error;
|
|
1152
|
+
throw error;
|
|
1153
|
+
} finally {
|
|
1154
|
+
await finishWork(work, failure);
|
|
1155
|
+
}
|
|
1156
|
+
}, "kernelResume");
|
|
1157
|
+
const resumePaused = /* @__PURE__ */ __name(async function* (params) {
|
|
1158
|
+
const turnId = asTurnId(params.turnId);
|
|
1159
|
+
const controller = new AbortController();
|
|
1160
|
+
const onAbort = /* @__PURE__ */ __name(() => controller.abort(params.signal?.reason), "onAbort");
|
|
1161
|
+
params.signal?.addEventListener("abort", onAbort, { once: true });
|
|
1162
|
+
if (params.signal?.aborted) onAbort();
|
|
1163
|
+
const queue = [];
|
|
1164
|
+
let wake;
|
|
1165
|
+
let settled = false;
|
|
1166
|
+
let failure;
|
|
1167
|
+
const completion = kernelResume({
|
|
1168
|
+
...params,
|
|
1169
|
+
signal: controller.signal,
|
|
1170
|
+
entry: {
|
|
1171
|
+
tenantId: scope.tenantId,
|
|
1172
|
+
projectId: scope.projectId,
|
|
1173
|
+
sessionId: scope.sessionId,
|
|
1174
|
+
turnId
|
|
1175
|
+
},
|
|
1176
|
+
sessionLog: DiskSessionLog.at(conversations.paths, {
|
|
1177
|
+
sessionId: scope.sessionId
|
|
1178
|
+
}),
|
|
1179
|
+
listener: /* @__PURE__ */ __name((event) => {
|
|
1180
|
+
queue.push(event);
|
|
1181
|
+
wake?.();
|
|
1182
|
+
}, "listener")
|
|
1183
|
+
}).then((result) => {
|
|
1184
|
+
if (!result.resumed)
|
|
1185
|
+
throw new Error(
|
|
1186
|
+
result.reason === "awaiting-decision" ? "This Pal turn is parked on a decision only a person can answer." : "This Pal turn has no recorded checkpoint."
|
|
1187
|
+
);
|
|
1188
|
+
}).catch((error) => {
|
|
1189
|
+
failure = error;
|
|
1190
|
+
}).finally(() => {
|
|
1191
|
+
settled = true;
|
|
1192
|
+
wake?.();
|
|
1193
|
+
});
|
|
1194
|
+
try {
|
|
1195
|
+
for (; ; ) {
|
|
1196
|
+
while (queue.length) {
|
|
1197
|
+
const event = queue.shift();
|
|
1198
|
+
if (!event) break;
|
|
1199
|
+
const mapped = toAgentEvent(event, presenter);
|
|
1200
|
+
if (mapped) yield mapped;
|
|
1201
|
+
}
|
|
1202
|
+
if (settled) break;
|
|
1203
|
+
await new Promise((resolve) => {
|
|
1204
|
+
wake = resolve;
|
|
1205
|
+
});
|
|
1206
|
+
wake = void 0;
|
|
1207
|
+
}
|
|
1208
|
+
await completion;
|
|
1209
|
+
if (failure) throw failure;
|
|
1210
|
+
} finally {
|
|
1211
|
+
controller.abort(new Error("Pal resume event stream closed."));
|
|
1212
|
+
params.signal?.removeEventListener("abort", onAbort);
|
|
1213
|
+
await completion;
|
|
1214
|
+
}
|
|
1215
|
+
}, "resumePaused");
|
|
1216
|
+
return {
|
|
1217
|
+
hasProvider: true,
|
|
1218
|
+
errorHint: null,
|
|
1219
|
+
errorKind: null,
|
|
1220
|
+
providerSummary: entry.label,
|
|
1221
|
+
modelSummary: model,
|
|
1222
|
+
imageAttachmentsSupported: provider.capabilities?.supportsVision,
|
|
1223
|
+
documentAttachmentsSupported: provider.capabilities?.supportsDocuments,
|
|
1224
|
+
reasoningEffortLevels: provider.reasoningEffortLevelsFor?.(model),
|
|
1225
|
+
reasoningEffortDefault: provider.reasoningEffortDefaultFor?.(model),
|
|
1226
|
+
get sandbox() {
|
|
1227
|
+
return sandboxProvider ? {
|
|
1228
|
+
unconfined: false,
|
|
1229
|
+
environment: sandboxProvider.environment,
|
|
1230
|
+
enforced: ["filesystem", "process"],
|
|
1231
|
+
required: ["filesystem", "process"],
|
|
1232
|
+
workspace: "working-directory"
|
|
1233
|
+
} : { unconfined: false, enforced: [], required: [] };
|
|
1234
|
+
},
|
|
1235
|
+
toolNames: /* @__PURE__ */ __name(() => {
|
|
1236
|
+
manager.refresh();
|
|
1237
|
+
return [...manager.listNames(), ...selectedTaskStore ? Object.keys(taskToolOverrides) : []];
|
|
1238
|
+
}, "toolNames"),
|
|
1239
|
+
currentTaskStore: /* @__PURE__ */ __name(() => closed ? void 0 : selectedTaskStore, "currentTaskStore"),
|
|
1240
|
+
resetTaskStore: /* @__PURE__ */ __name(() => {
|
|
1241
|
+
selectedTaskStore = void 0;
|
|
1242
|
+
taskPresentationTurn = void 0;
|
|
1243
|
+
taskPresentationTools = [];
|
|
1244
|
+
}, "resetTaskStore"),
|
|
1245
|
+
presenter,
|
|
1246
|
+
agentIds: [],
|
|
1247
|
+
instructionFiles: [],
|
|
1248
|
+
skippedInstructionFiles: [],
|
|
1249
|
+
get mcpConnected() {
|
|
1250
|
+
return guestMcp.connected;
|
|
1251
|
+
},
|
|
1252
|
+
get mcpFailed() {
|
|
1253
|
+
return guestMcp.failed;
|
|
1254
|
+
},
|
|
1255
|
+
configNotices: [
|
|
1256
|
+
"Pal tools run in its local virtual computer. Host plugins, MCP servers, browser accounts and filesystem are not inherited."
|
|
1257
|
+
],
|
|
1258
|
+
approvalLatched: /* @__PURE__ */ __name(() => approval.all, "approvalLatched"),
|
|
1259
|
+
resetApprovalLatch: /* @__PURE__ */ __name(() => {
|
|
1260
|
+
approval.all = false;
|
|
1261
|
+
}, "resetApprovalLatch"),
|
|
1262
|
+
promptExemptTools: /* @__PURE__ */ __name(() => [], "promptExemptTools"),
|
|
1263
|
+
jobs: /* @__PURE__ */ __name(() => jobs.list(scope.sessionId), "jobs"),
|
|
1264
|
+
readJob: /* @__PURE__ */ __name((id, fromOffset) => ownedJobs.read(id, { fromOffset }), "readJob"),
|
|
1265
|
+
stopJob: /* @__PURE__ */ __name((id) => ownedJobs.kill(id), "stopJob"),
|
|
1266
|
+
onJobExit: /* @__PURE__ */ __name((listener) => jobs.onExit((job) => {
|
|
1267
|
+
if (job.owner === scope.sessionId) listener(job);
|
|
1268
|
+
}), "onJobExit"),
|
|
1269
|
+
compact: /* @__PURE__ */ __name(async () => {
|
|
1270
|
+
throw new Error("Manual compaction is not available in a Pal conversation yet.");
|
|
1271
|
+
}, "compact"),
|
|
1272
|
+
resumeDurable: kernelResume,
|
|
1273
|
+
resumePaused,
|
|
1274
|
+
// A Pal's paused turn is closed the way any conversation's is: one append to the
|
|
1275
|
+
// conversation's own log, which needs no computer and runs nothing. Without it the host
|
|
1276
|
+
// could not offer "Continue without this reply" in a Pal.
|
|
1277
|
+
abandonTurn: /* @__PURE__ */ __name(async (turnId, reason, abandonOptions) => {
|
|
1278
|
+
if (closed) throw new Error("This Pal conversation is closed.");
|
|
1279
|
+
await assertOwnedConversation();
|
|
1280
|
+
await abandonTurn(scope.sessionId, turnId, reason, {
|
|
1281
|
+
log: DiskSessionLog.at(conversations.paths, { sessionId: scope.sessionId }),
|
|
1282
|
+
index: conversations.index,
|
|
1283
|
+
...abandonOptions?.withdrawMessages ? { withdrawMessages: true } : {}
|
|
1284
|
+
});
|
|
1285
|
+
}, "abandonTurn"),
|
|
1286
|
+
send: /* @__PURE__ */ __name(async function* (messages, opts) {
|
|
1287
|
+
const work = beginWork(opts?.signal, opts?.assertExecutionAllowed, permissionReader(opts));
|
|
1288
|
+
const { controller } = work;
|
|
1289
|
+
let sendFailure;
|
|
1290
|
+
try {
|
|
1291
|
+
for (let index = messages.length - 1; index >= 0; index--) {
|
|
1292
|
+
const message = messages[index];
|
|
1293
|
+
if (!message || message.role === "assistant" || message.role === "tool") break;
|
|
1294
|
+
if (message.role === "user" && !message.source && !message.id) {
|
|
1295
|
+
referenceAttachments = structuredClone(message.attachments ?? []);
|
|
1296
|
+
break;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
await enterConversation(controller);
|
|
1300
|
+
const events = query({
|
|
1301
|
+
...queryOptions(opts),
|
|
1302
|
+
sessionLog: DiskSessionLog.at(conversations.paths, {
|
|
1303
|
+
sessionId: scope.sessionId
|
|
1304
|
+
}),
|
|
1305
|
+
messages: [...messages],
|
|
1306
|
+
...opts?.turnId ? { turnId: opts.turnId } : {},
|
|
1307
|
+
...opts?.origin ? { origin: opts.origin } : {},
|
|
1308
|
+
turnConfig: {
|
|
1309
|
+
model,
|
|
1310
|
+
...resolveTurnGuards(options.limits, opts?.limits),
|
|
1311
|
+
...admission ? { sandbox: { workspace: "working-directory" } } : {},
|
|
1312
|
+
permissionMode: "auto",
|
|
1313
|
+
...opts?.effort ? { effort: opts.effort } : {}
|
|
1314
|
+
},
|
|
1315
|
+
backgroundJobs: jobs,
|
|
1316
|
+
backgroundJobOwner: scope.sessionId,
|
|
1317
|
+
durableInbound: opts?.durableInbound ?? messaging.durableInbound,
|
|
1318
|
+
...opts?.inboundMessages ? { inboundMessages: opts.inboundMessages } : {},
|
|
1319
|
+
...opts?.waitForInbound ? { waitForInbound: opts.waitForInbound } : {},
|
|
1320
|
+
...opts?.abandonInterrupted ? { abandonInterrupted: true } : {},
|
|
1321
|
+
signal: controller.signal
|
|
1322
|
+
});
|
|
1323
|
+
try {
|
|
1324
|
+
while (true) {
|
|
1325
|
+
const next = await events.next();
|
|
1326
|
+
if (next.done) {
|
|
1327
|
+
opts?.onConversationMessages?.(projectTurnConversation(next.value.messages));
|
|
1328
|
+
break;
|
|
1329
|
+
}
|
|
1330
|
+
observeSessionEvent(next.value);
|
|
1331
|
+
const mapped = toAgentEvent(next.value, presenter);
|
|
1332
|
+
if (mapped) yield mapped;
|
|
1333
|
+
}
|
|
1334
|
+
} finally {
|
|
1335
|
+
await events.return(void 0);
|
|
1336
|
+
}
|
|
1337
|
+
} catch (error) {
|
|
1338
|
+
sendFailure = error;
|
|
1339
|
+
throw error;
|
|
1340
|
+
} finally {
|
|
1341
|
+
await finishWork(work, sendFailure);
|
|
1342
|
+
}
|
|
1343
|
+
}, "send"),
|
|
1344
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
1345
|
+
if (cleaned) return;
|
|
1346
|
+
if (closing) return closing;
|
|
1347
|
+
closed = true;
|
|
1348
|
+
activeAbort?.abort(new Error("Pal conversation closed."));
|
|
1349
|
+
const cleanup = (async () => {
|
|
1350
|
+
await sendSettled;
|
|
1351
|
+
await releaseWriter();
|
|
1352
|
+
await releaseAdmission();
|
|
1353
|
+
await jobs.killOwner(scope.sessionId);
|
|
1354
|
+
await manager.dispose();
|
|
1355
|
+
await closeGuestMcp();
|
|
1356
|
+
cleaned = true;
|
|
1357
|
+
})();
|
|
1358
|
+
closing = cleanup;
|
|
1359
|
+
try {
|
|
1360
|
+
await cleanup;
|
|
1361
|
+
} finally {
|
|
1362
|
+
if (closing === cleanup) closing = void 0;
|
|
1363
|
+
}
|
|
1364
|
+
}, "close")
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
__name(createPalAgentSession, "createPalAgentSession");
|
|
1368
|
+
|
|
1369
|
+
export {
|
|
1370
|
+
palSessionEnvironment,
|
|
1371
|
+
createPalAgentSession
|
|
1372
|
+
};
|
|
1373
|
+
//# sourceMappingURL=chunk-UDDSFIMB.js.map
|