nolo-cli 0.228.0-alpha.2 → 0.228.1
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/README.md +3 -5
- package/{_executeModel-VYCHHZVT.js → _executeModel-AKCTHGMP.js} +89 -83
- package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
- package/{action-GDZDXPMB.js → action-C6IQAKN4.js} +8 -5
- package/{addContentAction-7RO4AMRI.js → addContentAction-53364YDW.js} +13 -12
- package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-U5DD5EN5.js} +16 -15
- package/{agentDeleteCommand-QWQKT54A.js → agentDeleteCommand-2E5FAGUO.js} +128 -115
- package/{agentEmailCommands-EISMBIRE.js → agentEmailCommands-UGZZAH7E.js} +128 -111
- package/{agentListCommands-4WLG32IW.js → agentListCommands-JCTW3J2K.js} +398 -179
- package/{agentMachineCommands-DC6NKWTU.js → agentMachineCommands-QPG5ZXF4.js} +58 -47
- package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentPullCommand-KHV4EELF.js → agentPullCommand-2EYJ5ENC.js} +1 -1
- package/agentRecordCommands-4NTVR6MZ.js +194 -0
- package/agentRunCommand-VHF34PYC.js +232 -0
- package/{agentRunControl-MBG4U6SL.js → agentRunControl-QYTXUQGY.js} +14 -9
- package/{agentRuntimeLocal-HOXKWCYO.js → agentRuntimeLocal-U54AKHXH.js} +58 -43
- package/{agentSlice-UG76KEBH.js → agentSlice-4JGDEXWK.js} +14 -13
- package/{appDeleteCommands-WWCC6WA5.js → appDeleteCommands-XBE5QJ6P.js} +58 -47
- package/{appDeployCommands-AU4IUN33.js → appDeployCommands-QIYLXXGA.js} +58 -47
- package/{appDeployStatusCommands-STUW7WXL.js → appDeployStatusCommands-JXS6ZQZZ.js} +58 -47
- package/{appGetCommands-BGTLIQ4K.js → appGetCommands-SZS7SJPK.js} +58 -47
- package/{appListCommands-CUCPRUXW.js → appListCommands-B3GBJSNV.js} +58 -47
- package/{authCommand-OZ2KTP4Z.js → authCommand-V6EOMZX6.js} +25 -19
- package/{authCommands-55OGQGCR.js → authCommands-T5FODCEG.js} +12 -6
- package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-ZQC3IIO2.js} +8 -7
- package/{chromeCommands-G5UDKVSV.js → chromeCommands-O4IIKTBD.js} +384 -7
- package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-OFX7ZGKP.js} +3 -3
- package/{chunk-DBUR22G5.js → chunk-223KZUJ6.js} +19 -15
- package/{chunk-3U44JB3O.js → chunk-2C5VN7NH.js} +1 -1
- package/{chunk-PWTNI4N7.js → chunk-2E4BYAUE.js} +22 -0
- package/{chunk-L32W3PRP.js → chunk-2FZVXOFX.js} +234 -18
- package/{chunk-HBRDSQ3M.js → chunk-2JHGUL5K.js} +3 -2
- package/chunk-2SXN7LAY.js +15 -0
- package/chunk-3A5NNQCN.js +64 -0
- package/chunk-3F2FRLIO.js +372 -0
- package/{chunk-DEA37IUY.js → chunk-46FETNLF.js} +2 -2
- package/{chunk-ZEVQHCLM.js → chunk-4GYVS4PM.js} +8 -6
- package/{chunk-CBUZ6DKA.js → chunk-4YPH5KRA.js} +1 -1
- package/chunk-4ZCTKB27.js +31 -0
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-7FEP5USX.js → chunk-5AYP5QBB.js} +5 -5
- package/{chunk-XAG3FWBE.js → chunk-5ISNPTQH.js} +5 -5
- package/{chunk-EVGU5P4U.js → chunk-5P3PPQVP.js} +1 -1
- package/{chunk-XSW4EXQV.js → chunk-6BMTKYAO.js} +55 -18
- package/chunk-6PAHSSD2.js +33401 -0
- package/{chunk-ZOHO6MOF.js → chunk-6RSNVJGO.js} +2 -99
- package/{chunk-7JGMNKKG.js → chunk-6SOWMEAY.js} +30 -9
- package/{chunk-RG2DGNL6.js → chunk-6VEO7Z3Y.js} +3 -3
- package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-DGYCDA6W.js → chunk-7BIJFGKS.js} +36 -17
- package/{chunk-WFDNADFX.js → chunk-7OVOZRZF.js} +8 -8
- package/{chunk-WCFFRBL5.js → chunk-7PON4LBY.js} +45 -27
- package/{chunk-QRGDJA4B.js → chunk-7WHCIA5V.js} +33 -7
- package/{chunk-CMMI3DAT.js → chunk-ADYWV732.js} +59 -30
- package/{chunk-QYB23WUH.js → chunk-AIFQKNPP.js} +1 -1
- package/{chunk-HGDKT2D6.js → chunk-BPB3T5EU.js} +174 -1
- package/{chunk-DUUDXSLX.js → chunk-BZLGPM5B.js} +28 -4
- package/{chunk-ATEKLSLR.js → chunk-BZMDWGQQ.js} +14 -9
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-S6K5F3KP.js → chunk-CEKRIR22.js} +1 -1
- package/{chunk-42OKN2LI.js → chunk-D634SL2Y.js} +9 -107
- package/{chunk-DLXMMTGM.js → chunk-DHRPLRIR.js} +1283 -786
- package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
- package/{chunk-OBIC6EG7.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-X3E6EHJW.js → chunk-E3LSO6EI.js} +292 -207
- package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
- package/chunk-EHFBP6IK.js +791 -0
- package/chunk-EJQE5HB7.js +21 -0
- package/{chunk-VQ5N5GSV.js → chunk-EL5NRJHI.js} +4 -4
- package/chunk-EUGTFFO6.js +42 -0
- package/{chunk-7BCG67EI.js → chunk-EVHTYVD2.js} +1199 -442
- package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
- package/{chunk-262R3XNN.js → chunk-FEIVARWR.js} +377 -112
- package/{chunk-3VZLEKV2.js → chunk-FLBJ7IJI.js} +14 -14
- package/{chunk-EEOOBRA7.js → chunk-FXEPZKNJ.js} +13 -6
- package/{chunk-XTJKU3Z4.js → chunk-FYAMUU55.js} +677 -140
- package/{chunk-M3OZRQNH.js → chunk-FZANZZ63.js} +1 -1
- package/chunk-GAHJLSDO.js +107 -0
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-4N6G2CKP.js → chunk-HDKMVYNJ.js} +47 -1
- package/chunk-HEVRQGGH.js +106 -0
- package/{chunk-BIWI5M4E.js → chunk-HFHJPHFK.js} +1 -1
- package/{chunk-R6Z5S5GA.js → chunk-HPDLPEUG.js} +60 -17
- package/{chunk-YKY4OVOX.js → chunk-HQUGB2HM.js} +17 -170
- package/chunk-IIRJ4P4I.js +24 -0
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-ALAES342.js → chunk-IYLUK67R.js} +9 -5
- package/{chunk-N5Z2V73W.js → chunk-J55F3IEZ.js} +1 -1
- package/{chunk-S6FDXXZV.js → chunk-J7JRCOIW.js} +2 -2
- package/{chunk-OWKNSIXL.js → chunk-JAKRY74O.js} +470 -83
- package/{chunk-VS276URX.js → chunk-JCQ3WCQ3.js} +4 -2
- package/chunk-JLZJL3WC.js +988 -0
- package/{chunk-OBSEKCVK.js → chunk-JPXACKSW.js} +219 -52
- package/{chunk-OTKSESZR.js → chunk-KDBDOXOM.js} +138 -54
- package/{chunk-VP3BINY7.js → chunk-KDDHQMSH.js} +31 -1
- package/{chunk-RBPUNSG5.js → chunk-KG27JIG4.js} +18 -108
- package/{chunk-4WVJLODK.js → chunk-KHYSFS3W.js} +88 -7
- package/{chunk-TCZ2VJZQ.js → chunk-KKIQAVDR.js} +9 -9
- package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
- package/chunk-KXOPLLFP.js +190 -0
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-HYLRQDEE.js → chunk-LLUBUHNT.js} +6 -6
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-RTHFJZ6M.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-TI2EPRHE.js → chunk-MNFUKRRU.js} +3 -3
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-CNMY2XM6.js → chunk-O3A2CHAL.js} +6 -6
- package/{chunk-TSPMLCWI.js → chunk-OB4FBZXJ.js} +5 -5
- package/{chunk-LYD6C7OU.js → chunk-OJSJJKHF.js} +6 -6
- package/{chunk-M4SFKP5L.js → chunk-OKAXQFON.js} +3 -3
- package/{chunk-CD3RU7XL.js → chunk-OKH74FML.js} +121 -14
- package/{chunk-U2HBB7RS.js → chunk-OOV5JN25.js} +130 -30
- package/{chunk-ZH3KXFHS.js → chunk-OOVOAG4Q.js} +1 -1
- package/chunk-OQFOE4SJ.js +405 -0
- package/{chunk-M3JEW6N6.js → chunk-OYUMJMC5.js} +15 -0
- package/chunk-P27E22MA.js +203 -0
- package/{chunk-SRCCSTIM.js → chunk-P4R5KXU7.js} +4 -4
- package/{chunk-FJ23FZXF.js → chunk-PHREU2KZ.js} +5 -3
- package/{chunk-HSSBDZLD.js → chunk-PIVTQRX6.js} +43 -13
- package/{chunk-XFXFPUO7.js → chunk-PJL7OJRC.js} +13 -39
- package/{chunk-RRDRQOEC.js → chunk-PNLDLUMO.js} +276 -303
- package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
- package/{chunk-HHFGE2WF.js → chunk-QGFLVQ6E.js} +5 -5
- package/{chunk-EGHP7KOY.js → chunk-QONAOHVW.js} +38 -29
- package/chunk-R3FZHW4Q.js +103 -0
- package/{chunk-ZYKJBRZ3.js → chunk-R3MV2GII.js} +1 -47
- package/chunk-R72QWIFO.js +50 -0
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/{chunk-ILHQ2AXT.js → chunk-RIWKZT7E.js} +36 -8
- package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
- package/{chunk-45CAVC35.js → chunk-S7H4KTMB.js} +2568 -337
- package/{chunk-OJ45MEEI.js → chunk-SA356NGW.js} +1 -1
- package/{chunk-F6Z6ZCUV.js → chunk-SCAC3NM5.js} +3 -3
- package/{chunk-YVFH2MFB.js → chunk-SLUN7W6S.js} +7 -7
- package/chunk-SQL7YNED.js +650 -0
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-HF7BLF3F.js → chunk-SSOR2EDT.js} +107 -104
- package/chunk-TRRXYFTR.js +46 -0
- package/{chunk-3QIYD3VM.js → chunk-TUOHSUK5.js} +20068 -18402
- package/chunk-TYJCIA2O.js +835 -0
- package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
- package/{chunk-GAYNXB6T.js → chunk-U3BUWDUP.js} +1031 -2155
- package/{chunk-BP5ZJ6B4.js → chunk-U6QNVOR5.js} +1 -1
- package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
- package/chunk-UAF5VQCE.js +77 -0
- package/{chunk-TQEKUOTI.js → chunk-UFGUJ2IH.js} +12 -12
- package/{chunk-VMJVAJ6W.js → chunk-UP7KBWLE.js} +109 -33
- package/{chunk-2X7WFDT6.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-5YMA6DDZ.js → chunk-UZKBVQUX.js} +1 -1
- package/chunk-V5TI7HJH.js +133 -0
- package/{chunk-WFGNWWJI.js → chunk-VH7UO6E5.js} +252 -114
- package/{chunk-MNEZUL5S.js → chunk-VJFDG3ZG.js} +63 -94
- package/{chunk-G7IUT2V3.js → chunk-WC3J5SL2.js} +635 -350
- package/{chunk-HXB4VDGK.js → chunk-WD5547ZF.js} +33 -30
- package/chunk-WDWZPASX.js +29 -0
- package/{chunk-4ZGPHFLE.js → chunk-WS36XPJD.js} +2 -2
- package/{chunk-6QHKRARD.js → chunk-WSLL7VV4.js} +29 -5
- package/chunk-XRGBJHZX.js +136 -0
- package/{chunk-MZG5CETE.js → chunk-Y2KWJTOZ.js} +4 -4
- package/{dialogUsageCommand-W2WCSGKF.js → chunk-Y2TCTNUD.js} +27 -20
- package/chunk-YJPK35HB.js +175 -0
- package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
- package/{chunk-547ENH5T.js → chunk-YN23INFZ.js} +4 -4
- package/{chunk-4QYJPWHH.js → chunk-YXK3GJF5.js} +232 -10
- package/{chunk-MJI3UAXN.js → chunk-Z2OWAYMI.js} +77 -51
- package/{chunk-7Z6EW7AH.js → chunk-ZTHAJU3O.js} +106 -14
- package/{chunk-YFLVRVYK.js → chunk-ZYPXOQS2.js} +1 -1
- package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-BXHQ3PXP.js} +9 -9
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
- package/cliAuthorityBrokerProcess-5ZFBTHLB.js +22 -0
- package/cliLocalAgentRecordReader-47PXMHPH.js +104 -0
- package/{commandRegistry-FVYPE2IN.js → commandRegistry-CTMPAQH2.js} +111 -162
- package/{contentThunks-GNFPG32S.js → contentThunks-CAHIIZO5.js} +38 -36
- package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-WDOI5VD7.js} +3 -3
- package/{createAgentAutomationAction-PB4QIFQ4.js → createAgentAutomationAction-M25XZSPD.js} +38 -36
- package/{createDialogAction-EVTOPY7A.js → createDialogAction-4SN7FKI7.js} +39 -37
- package/{createPageAction-2UYF2IDZ.js → createPageAction-N7QPDN3M.js} +43 -41
- package/{db-M7FU2GNK.js → db-VR74ADGC.js} +7 -2
- package/{dbSlice-XRUZOGSU.js → dbSlice-RWPSVHBC.js} +12 -11
- package/{deleteFile-6URDHYRB.js → deleteFile-ECU6FU5C.js} +15 -7
- package/{dialogCommands-6SZD4TYP.js → dialogCommands-BBHWCKDP.js} +69 -53
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-IASQGEMW.js} +11 -11
- package/{dialogSlice-5EQ2A6LY.js → dialogSlice-JI3J22RV.js} +39 -37
- package/dialogTraceCommand-EW2KK6A4.js +961 -0
- package/dialogUsageCommand-WJ3U6KZU.js +27 -0
- package/{docCreateCommands-25E6PGN3.js → docCreateCommands-QSX3X5U4.js} +57 -46
- package/{docDeleteCommands-F7ZVGEHW.js → docDeleteCommands-63JBG2HQ.js} +59 -48
- package/{docReadCommands-JY2E5XEN.js → docReadCommands-CQFKRQUI.js} +57 -46
- package/{docStore-OKKIKLT3.js → docStore-XLBKGGNM.js} +14 -13
- package/{docUpdateCommands-OZ4CUSIQ.js → docUpdateCommands-534LUK25.js} +57 -46
- package/ebookDownloaderAgentCommand-DYSKF5ZY.js +677 -0
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-LF5C4XSI.js → getPricing-5BLZRPTM.js} +4 -4
- package/{handleSendMessageAction-LNT7SZND.js → handleSendMessageAction-Q2VMEVOR.js} +127 -81
- package/{hostCredentialCreate-XUU2CSHI.js → hostCredentialCreate-C57T7YPE.js} +127 -109
- package/index.js +23 -11
- package/{localDialogRead-CCOCVGAP.js → localDialogRead-BJJT3TF5.js} +1 -1
- package/{localRuntimeAdapter-IBSTMSX7.js → localRuntimeAdapter-OALZPFZU.js} +134 -115
- package/localRuntimeAuthority-UF2DAQ3F.js +28 -0
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-ZJFGNHML.js} +1 -1
- package/{machineCommands-HSQHDHOT.js → machineCommands-N6IVWRZT.js} +262 -325
- package/machineWsRunDispatch-PDWYB33B.js +209 -0
- package/markdownToSlate-PXYAIBVL.js +8 -0
- package/mcpLocalAuthorizeCommand-KYI4EGF5.js +110 -0
- package/{memberThunks-7Y3OYSJQ.js → memberThunks-43B7UYC5.js} +21 -16
- package/{models-H5NNZRLH.js → models-ZX2BYIMB.js} +2 -2
- package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
- package/package.json +2 -1
- package/{projectArchive-FQO654Z3.js → projectArchive-TJNW5DLM.js} +46 -44
- package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-NTJUINI6.js} +36 -17
- package/{providerRegistry-ZI2KORJ7.js → providerRegistry-W45SLUV6.js} +6 -6
- package/{read-TYMBGEXO.js → read-KG6INYUT.js} +13 -7
- package/{readDocTool-SKQVHBLO.js → readDocTool-N3GA52JR.js} +1 -1
- package/{readlineWorkspace-7U272DSA.js → readlineWorkspace-PJZJVGA5.js} +7486 -4492
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-EEVSOQOJ.js} +18 -17
- package/{runAgentClientLoop-AF4JQIJ7.js → runAgentClientLoop-3VC5TCDW.js} +107 -76
- package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-V3M3JTUV.js} +14 -11
- package/{secretCommands-KZWBZIYS.js → secretCommands-KVVZS7A6.js} +3 -3
- package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-DNO5POHA.js} +15 -14
- package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-QABBEO4C.js} +18 -17
- package/{settingThunks-ZRGWVGZD.js → settingThunks-DVKG4X4S.js} +181 -66
- package/{skillDiscovery-BHHPCUHZ.js → skillDiscovery-ZMJH36AK.js} +4 -3
- package/{spaceCommands-5VNWMDBE.js → spaceCommands-AGGZXPY3.js} +235 -87
- package/{streamAgentChatTurn-YSPEFY4K.js → streamAgentChatTurn-4GTLL2OF.js} +242 -169
- package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-KYWJSGOO.js} +16 -15
- package/{tableCommands-FTAOCBTX.js → tableCommands-EFA754RE.js} +7 -4
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
- package/{tools-M35PTIFB.js → tools-5AGPOPLW.js} +69 -65
- package/{tuiRestart-2IL37YIB.js → tuiRestart-77E7PL4R.js} +11 -10
- package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-HROLGN4F.js} +16 -15
- package/{updateCommands-CPATDG6J.js → updateCommands-GJGRS6JK.js} +3 -3
- package/{updateDialogTitleAction-IMIRJRQQ.js → updateDialogTitleAction-5OSEDGRK.js} +40 -38
- package/{usageCommand-2BF74MKF.js → usageCommand-WI6SQOPB.js} +2 -2
- package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-WQRLLZAT.js} +3 -3
- package/webapi-QVV65DQF.js +2487 -0
- package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-C7LGVWYX.js} +2 -2
- package/workContext-Y3ADAPZU.js +14 -0
- package/workContextAccess-VU5I4LKZ.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/{workloadLifecycle-HFJIN5IZ.js → workloadLifecycle-P2SJVV3S.js} +2 -2
- package/agentRecordCommands-IZYUVHME.js +0 -177
- package/agentRunCommand-QM7ETUTX.js +0 -209
- package/chunk-2YGBI2XB.js +0 -30
- package/chunk-5ZMIIR23.js +0 -265
- package/chunk-5ZUOVCKT.js +0 -32
- package/chunk-62HXNQVV.js +0 -134
- package/chunk-FJSNBZXR.js +0 -142
- package/chunk-FPBJM2BW.js +0 -689
- package/chunk-JQZRSXS5.js +0 -90
- package/chunk-P2ZLUIW2.js +0 -795
- package/chunk-PPJYZRSQ.js +0 -160
- package/chunk-TUSTONB3.js +0 -81
- package/chunk-ZXF6D3I6.js +0 -359
- package/cliLocalAgentRecordReader-H3HYQRRR.js +0 -91
- package/lib-OT5OTXRU.js +0 -21046
- package/localRuntimeAuthority-IBJAT62G.js +0 -16
- package/machineWsRunDispatch-L6H7J66T.js +0 -192
- package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import {
|
|
2
|
+
omitNullishAgentSummaryFields,
|
|
3
|
+
promoteSharedCredentialGroupQuota,
|
|
4
|
+
sortSafeAgentSummaries,
|
|
5
|
+
summarizeCredentialGroups,
|
|
6
|
+
toCompactAgentSummary,
|
|
7
|
+
toSafeAgentSummary,
|
|
8
|
+
toUltraCompactAgentSummary
|
|
9
|
+
} from "./chunk-PNLDLUMO.js";
|
|
10
|
+
import {
|
|
11
|
+
resolveAgentSelectionPriority
|
|
12
|
+
} from "./chunk-VJFDG3ZG.js";
|
|
13
|
+
import {
|
|
14
|
+
DEFAULT_PROVIDER_RETRY_MS,
|
|
15
|
+
isAgentUnavailableNow,
|
|
16
|
+
isSubscriptionPeriodWindow,
|
|
17
|
+
resolveAgentAvailability
|
|
18
|
+
} from "./chunk-LS5KAVFQ.js";
|
|
19
|
+
import {
|
|
20
|
+
DISPATCH_TIER_RANK,
|
|
21
|
+
resolveModelTier
|
|
22
|
+
} from "./chunk-HEVRQGGH.js";
|
|
23
|
+
|
|
24
|
+
// packages/ai/agent/agentDiscovery.ts
|
|
25
|
+
function isPreferredAgent(agent) {
|
|
26
|
+
return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
|
|
27
|
+
}
|
|
28
|
+
function isPublicDiscoveryAgent(agent) {
|
|
29
|
+
return agent.isPublic === true && !isPreferredAgent(agent);
|
|
30
|
+
}
|
|
31
|
+
function resolveDiscoveryScope(args) {
|
|
32
|
+
const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
|
|
33
|
+
const hasScope = rawScope !== void 0 && rawScope !== "";
|
|
34
|
+
const hasPublicOnly = typeof args?.publicOnly === "boolean";
|
|
35
|
+
const publicOnly = args?.publicOnly === true;
|
|
36
|
+
if (hasScope) {
|
|
37
|
+
if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
|
|
38
|
+
throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
|
|
39
|
+
}
|
|
40
|
+
const scope = rawScope;
|
|
41
|
+
if (hasPublicOnly) {
|
|
42
|
+
if (publicOnly && scope !== "public") {
|
|
43
|
+
throw new Error(
|
|
44
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
if (!publicOnly && scope === "public") {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return scope;
|
|
54
|
+
}
|
|
55
|
+
if (hasPublicOnly && publicOnly) {
|
|
56
|
+
return "public";
|
|
57
|
+
}
|
|
58
|
+
return "all";
|
|
59
|
+
}
|
|
60
|
+
function agentIdentityKeys(agent) {
|
|
61
|
+
return [agent.agentKey, agent.publicKey, agent.id].filter(
|
|
62
|
+
(key) => typeof key === "string" && key.length > 0
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
function deduplicateAgentSummaries(agents) {
|
|
66
|
+
const byIdentity = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const agent of agents) {
|
|
68
|
+
const keys = agentIdentityKeys(agent);
|
|
69
|
+
const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
|
|
70
|
+
if (!existing) {
|
|
71
|
+
for (const key of keys) byIdentity.set(key, agent);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
|
|
75
|
+
for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
|
|
76
|
+
}
|
|
77
|
+
return [...new Set(byIdentity.values())];
|
|
78
|
+
}
|
|
79
|
+
function filterAgentsByScope(agents, scope) {
|
|
80
|
+
const unique = deduplicateAgentSummaries(agents);
|
|
81
|
+
if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
|
|
82
|
+
if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
|
|
83
|
+
return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
|
|
84
|
+
}
|
|
85
|
+
function resolveCallerCredentialGroup(agents, caller) {
|
|
86
|
+
const explicit = caller?.credentialGroup;
|
|
87
|
+
if (typeof explicit === "string" && explicit.trim()) return explicit.trim();
|
|
88
|
+
const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
|
|
89
|
+
if (!callerKey) return void 0;
|
|
90
|
+
const own = agents.find((agent) => agent.agentKey === callerKey);
|
|
91
|
+
const group = own?.credentialGroup;
|
|
92
|
+
return typeof group === "string" && group.length > 0 ? group : void 0;
|
|
93
|
+
}
|
|
94
|
+
var asCallerModel = (caller) => typeof caller === "string" ? caller : caller?.model ?? null;
|
|
95
|
+
var asCallerAgentKey = (caller) => {
|
|
96
|
+
if (typeof caller === "string" || !caller) return "";
|
|
97
|
+
return typeof caller.agentKey === "string" ? caller.agentKey.trim() : "";
|
|
98
|
+
};
|
|
99
|
+
function isCallerAtFreePoolTop(caller, candidates) {
|
|
100
|
+
if (candidates.length === 0) return void 0;
|
|
101
|
+
const currentTier = resolveModelTier(asCallerModel(caller));
|
|
102
|
+
if (currentTier === "unknown") return void 0;
|
|
103
|
+
const currentRank = DISPATCH_TIER_RANK[currentTier];
|
|
104
|
+
const callerAgentKey = asCallerAgentKey(caller);
|
|
105
|
+
const external = candidates.filter(
|
|
106
|
+
(candidate) => !(typeof candidate.agentKey === "string" && candidate.agentKey && callerAgentKey && candidate.agentKey === callerAgentKey)
|
|
107
|
+
);
|
|
108
|
+
if (external.length === 0) return true;
|
|
109
|
+
const hasStrictlyHigherFree = external.some((candidate) => {
|
|
110
|
+
if (candidate.requiresPaidApproval !== false) return false;
|
|
111
|
+
const tier = resolveModelTier(candidate.model);
|
|
112
|
+
return tier !== "unknown" && DISPATCH_TIER_RANK[tier] > currentRank;
|
|
113
|
+
});
|
|
114
|
+
if (hasStrictlyHigherFree) return false;
|
|
115
|
+
const hasUnresolvableCandidate = external.some((candidate) => {
|
|
116
|
+
if (candidate.requiresPaidApproval === true) return false;
|
|
117
|
+
const tier = resolveModelTier(candidate.model);
|
|
118
|
+
if (tier === "unknown") return true;
|
|
119
|
+
if (candidate.requiresPaidApproval === void 0) {
|
|
120
|
+
return DISPATCH_TIER_RANK[tier] > currentRank;
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
});
|
|
124
|
+
if (hasUnresolvableCandidate) return void 0;
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
function recommendPlanning(agents, caller, poolComplete) {
|
|
128
|
+
const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
|
|
129
|
+
const current = callerKey ? agents.find((a) => a.agentKey === callerKey) : void 0;
|
|
130
|
+
const currentTier = callerKey ? resolveModelTier(caller?.effectiveModel ?? current?.model) : "unknown";
|
|
131
|
+
const base = {
|
|
132
|
+
condition: "when_planning_needed_and_candidate_suitable",
|
|
133
|
+
action: "self",
|
|
134
|
+
currentTier,
|
|
135
|
+
poolComplete,
|
|
136
|
+
requiresPaidApproval: false
|
|
137
|
+
};
|
|
138
|
+
if (caller?.runKind === "subtask") return { ...base, reason: "bounded_subtask" };
|
|
139
|
+
if (!callerKey) return { ...base, reason: "caller_unknown" };
|
|
140
|
+
if (currentTier === "unknown") return { ...base, reason: "caller_tier_unknown" };
|
|
141
|
+
if (!poolComplete) return { ...base, reason: "pool_incomplete" };
|
|
142
|
+
const higher = agents.filter((a) => a.agentKey && a.agentKey !== callerKey && a.modelTier !== "unknown" && DISPATCH_TIER_RANK[a.modelTier] > DISPATCH_TIER_RANK[currentTier]);
|
|
143
|
+
const free = higher.filter((a) => a.requiresPaidApproval === false);
|
|
144
|
+
free.sort((a, b) => DISPATCH_TIER_RANK[b.modelTier] - DISPATCH_TIER_RANK[a.modelTier]);
|
|
145
|
+
const best = free[0];
|
|
146
|
+
if (best) return {
|
|
147
|
+
...base,
|
|
148
|
+
action: "delegate",
|
|
149
|
+
reason: "higher_suitable_agent",
|
|
150
|
+
agentKey: best.agentKey,
|
|
151
|
+
recommendedTier: best.modelTier
|
|
152
|
+
};
|
|
153
|
+
if (higher.length) return { ...base, reason: "paid_approval_required", requiresPaidApproval: true };
|
|
154
|
+
return { ...base, reason: "no_higher_suitable_agent" };
|
|
155
|
+
}
|
|
156
|
+
function resolvePaginationArgs(args) {
|
|
157
|
+
let limit;
|
|
158
|
+
let offset;
|
|
159
|
+
if (args?.limit !== void 0 && args?.limit !== null) {
|
|
160
|
+
const raw = args.limit;
|
|
161
|
+
if (typeof raw === "boolean") {
|
|
162
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
163
|
+
}
|
|
164
|
+
if (typeof raw === "number") {
|
|
165
|
+
if (!Number.isInteger(raw) || raw <= 0) {
|
|
166
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
167
|
+
}
|
|
168
|
+
limit = Math.min(raw, 500);
|
|
169
|
+
} else if (typeof raw === "string") {
|
|
170
|
+
if (raw.trim() !== "") {
|
|
171
|
+
if (!/^\d+$/.test(raw.trim())) {
|
|
172
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
173
|
+
}
|
|
174
|
+
const parsed = Number(raw.trim());
|
|
175
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
176
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
177
|
+
}
|
|
178
|
+
limit = Math.min(parsed, 500);
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
throw new Error(`Invalid limit '${String(raw)}': must be a positive integer.`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (args?.offset !== void 0 && args?.offset !== null) {
|
|
185
|
+
const raw = args.offset;
|
|
186
|
+
if (typeof raw === "boolean") {
|
|
187
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
188
|
+
}
|
|
189
|
+
if (typeof raw === "number") {
|
|
190
|
+
if (!Number.isInteger(raw) || raw < 0) {
|
|
191
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
192
|
+
}
|
|
193
|
+
offset = raw;
|
|
194
|
+
} else if (typeof raw === "string") {
|
|
195
|
+
if (raw.trim() !== "") {
|
|
196
|
+
if (!/^\d+$/.test(raw.trim())) {
|
|
197
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
198
|
+
}
|
|
199
|
+
const parsed = Number(raw.trim());
|
|
200
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
201
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
202
|
+
}
|
|
203
|
+
offset = parsed;
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
throw new Error(`Invalid offset '${String(raw)}': must be a non-negative integer.`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return { limit, offset };
|
|
210
|
+
}
|
|
211
|
+
function matchesAgentQuery(agent, query) {
|
|
212
|
+
if (!query || typeof query !== "string") return true;
|
|
213
|
+
const q = query.trim().toLowerCase();
|
|
214
|
+
if (!q) return true;
|
|
215
|
+
const candidates = [
|
|
216
|
+
agent.name,
|
|
217
|
+
agent.model,
|
|
218
|
+
agent.provider,
|
|
219
|
+
agent.handle,
|
|
220
|
+
agent.agentKey,
|
|
221
|
+
agent.publicKey,
|
|
222
|
+
agent.id
|
|
223
|
+
];
|
|
224
|
+
return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
|
|
225
|
+
}
|
|
226
|
+
function nearestFundedSubscriptionReset(agent, now) {
|
|
227
|
+
let nearest = Infinity;
|
|
228
|
+
if (agent.billingSource !== "user_subscription") return nearest;
|
|
229
|
+
for (const window of agent.quota?.windows ?? []) {
|
|
230
|
+
const { resetAt, remaining, utilization } = window;
|
|
231
|
+
if (typeof resetAt === "number" && resetAt > now && resetAt < nearest && isSubscriptionPeriodWindow(window) && (typeof remaining === "number" && remaining > 0 || typeof utilization === "number" && utilization < 0.95)) {
|
|
232
|
+
nearest = resetAt;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return nearest;
|
|
236
|
+
}
|
|
237
|
+
function meteredUnitPrice(agent) {
|
|
238
|
+
if (agent.billingSource === "user_subscription" || agent.billingSource === "owner_subscription") return Infinity;
|
|
239
|
+
const input = agent.inputPrice !== null && Number.isFinite(agent.inputPrice) ? agent.inputPrice : 0;
|
|
240
|
+
const output = agent.outputPrice !== null && Number.isFinite(agent.outputPrice) ? agent.outputPrice : 0;
|
|
241
|
+
return input > 0 || output > 0 ? input + output : Infinity;
|
|
242
|
+
}
|
|
243
|
+
function buildAgentDiscoveryResult(options) {
|
|
244
|
+
const scope = resolveDiscoveryScope({
|
|
245
|
+
scope: options.scope,
|
|
246
|
+
publicOnly: options.publicOnly
|
|
247
|
+
});
|
|
248
|
+
const now = options.now ?? Date.now();
|
|
249
|
+
let scopedAgents = filterAgentsByScope(options.agents, scope);
|
|
250
|
+
if (options.query && typeof options.query === "string" && options.query.trim()) {
|
|
251
|
+
scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
|
|
252
|
+
}
|
|
253
|
+
scopedAgents = scopedAgents.map((agent) => {
|
|
254
|
+
const decision = resolveAgentAvailability(agent, now);
|
|
255
|
+
if (decision.status === "quota_exhausted") {
|
|
256
|
+
const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
|
|
257
|
+
const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
|
|
258
|
+
return {
|
|
259
|
+
...agent,
|
|
260
|
+
nextAvailableAt,
|
|
261
|
+
availableAt: nextAvailableAt,
|
|
262
|
+
availabilityStatus: decision.status,
|
|
263
|
+
availabilityReason: decision.reason
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
...agent,
|
|
268
|
+
availabilityStatus: decision.status,
|
|
269
|
+
availabilityReason: decision.reason
|
|
270
|
+
};
|
|
271
|
+
});
|
|
272
|
+
const unavailableCount = scopedAgents.filter((a) => isAgentUnavailableNow(a, now)).length;
|
|
273
|
+
const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
|
|
274
|
+
const pagination = resolvePaginationArgs({
|
|
275
|
+
limit: options.limit,
|
|
276
|
+
offset: options.offset
|
|
277
|
+
});
|
|
278
|
+
const offset = pagination.offset;
|
|
279
|
+
const limit = pagination.limit;
|
|
280
|
+
const sortedAgents = sortSafeAgentSummaries(scopedAgents);
|
|
281
|
+
const hasQuery = Boolean(options.query && typeof options.query === "string" && options.query.trim());
|
|
282
|
+
const hasFilteredCandidates = sortedAgents.length < options.agents.length;
|
|
283
|
+
let total;
|
|
284
|
+
if (hasQuery) {
|
|
285
|
+
total = sortedAgents.length;
|
|
286
|
+
} else if (hasFilteredCandidates) {
|
|
287
|
+
total = sortedAgents.length;
|
|
288
|
+
} else if (scope === "public") {
|
|
289
|
+
total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
|
|
290
|
+
} else if (scope === "all") {
|
|
291
|
+
const privateOnlyCount = scopedAgents.filter((a) => isPreferredAgent(a) && a.isPublic !== true).length;
|
|
292
|
+
const publicPulledCount = scopedAgents.filter((a) => a.isPublic === true).length;
|
|
293
|
+
const effectivePublicTotal = typeof options.upstreamTotal === "number" && options.upstreamTotal > publicPulledCount ? options.upstreamTotal : publicPulledCount;
|
|
294
|
+
total = options.upstreamTruncated === true ? privateOnlyCount + effectivePublicTotal : sortedAgents.length;
|
|
295
|
+
} else {
|
|
296
|
+
total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
|
|
297
|
+
}
|
|
298
|
+
const isTruncated = options.upstreamTruncated === true || !hasQuery && !hasFilteredCandidates && typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length;
|
|
299
|
+
const pagedAgents = typeof limit === "number" || typeof offset === "number" ? sortedAgents.slice(
|
|
300
|
+
offset ?? 0,
|
|
301
|
+
(offset ?? 0) + (limit ?? sortedAgents.length)
|
|
302
|
+
) : sortedAgents;
|
|
303
|
+
const projectedAgents = options.verbose === true ? pagedAgents.map(omitNullishAgentSummaryFields) : options.compact === true ? pagedAgents.map(toUltraCompactAgentSummary) : pagedAgents.map(toCompactAgentSummary);
|
|
304
|
+
const compacted = options.compact === true && options.verbose !== true ? promoteSharedCredentialGroupQuota(
|
|
305
|
+
projectedAgents,
|
|
306
|
+
credentialGroups
|
|
307
|
+
) : { agents: projectedAgents, groups: credentialGroups };
|
|
308
|
+
const tierHints = {};
|
|
309
|
+
const tierHintPreferences = /* @__PURE__ */ new Map();
|
|
310
|
+
const callerCredentialGroup = resolveCallerCredentialGroup(sortedAgents, options.caller);
|
|
311
|
+
for (const agent of sortedAgents) {
|
|
312
|
+
const { agentKey, name, model, modelTier, requiresPaidApproval, availabilityStatus } = agent;
|
|
313
|
+
if (!agentKey || requiresPaidApproval !== false || modelTier === "unknown" || availabilityStatus === "quota_exhausted" || availabilityStatus === "rate_limited") continue;
|
|
314
|
+
const priority = resolveAgentSelectionPriority(agent);
|
|
315
|
+
const current = tierHintPreferences.get(modelTier);
|
|
316
|
+
if (current && current.priority !== priority) continue;
|
|
317
|
+
const differentGroup = callerCredentialGroup !== void 0 && Boolean(agent.credentialGroup) && agent.credentialGroup !== callerCredentialGroup;
|
|
318
|
+
const resetAt = nearestFundedSubscriptionReset(agent, now);
|
|
319
|
+
const price = resetAt === Infinity ? meteredUnitPrice(agent) : Infinity;
|
|
320
|
+
if (current && current.differentGroup !== differentGroup) {
|
|
321
|
+
if (current.differentGroup) continue;
|
|
322
|
+
} else if (current && (resetAt > current.resetAt || resetAt === current.resetAt && price >= current.price)) {
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
tierHintPreferences.set(modelTier, { priority, differentGroup, resetAt, price });
|
|
326
|
+
tierHints[modelTier] = { agentKey, name, model };
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
total,
|
|
330
|
+
...typeof offset === "number" ? { offset } : {},
|
|
331
|
+
...typeof limit === "number" ? { limit } : {},
|
|
332
|
+
...isTruncated ? { truncated: true } : {},
|
|
333
|
+
unavailableCount,
|
|
334
|
+
availableCount: sortedAgents.length,
|
|
335
|
+
agents: compacted.agents,
|
|
336
|
+
planningRecommendation: recommendPlanning(
|
|
337
|
+
sortedAgents,
|
|
338
|
+
options.caller,
|
|
339
|
+
!isTruncated && scope === "all" && !hasQuery && !options.poolRestricted
|
|
340
|
+
),
|
|
341
|
+
...Object.keys(tierHints).length > 0 ? { tierHints } : {},
|
|
342
|
+
credentialGroups: compacted.groups
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function toDiscoverySafeAgentSummary(record2, options) {
|
|
346
|
+
const mergedOptions = record2?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
|
|
347
|
+
return toSafeAgentSummary(record2, mergedOptions);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// packages/ai/agent/dispatchSpeedProvenance.ts
|
|
351
|
+
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
352
|
+
function isServerDispatchSpeedSource(value, dialogId, userId) {
|
|
353
|
+
const dialog = record(value);
|
|
354
|
+
const proof = record(dialog.dispatchSpeedProvenance);
|
|
355
|
+
return proof.version === 1 && proof.source === "server-startAgentRun" && proof.userId === userId && record(dialog.runtimeBinding).tenantUserId === userId && dialog.id === dialogId;
|
|
356
|
+
}
|
|
357
|
+
function isLocalDispatchSpeedSource(value, dialogId, userId) {
|
|
358
|
+
const run = record(value);
|
|
359
|
+
const proof = record(run.dispatchSpeedProvenance);
|
|
360
|
+
return proof.version === 1 && proof.source === "cli-startAgentRun" && proof.userId === userId && typeof run.runId === "string" && run.runId.length > 0 && run.dialogId === dialogId && run.ephemeral !== true;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export {
|
|
364
|
+
resolveDiscoveryScope,
|
|
365
|
+
isCallerAtFreePoolTop,
|
|
366
|
+
resolvePaginationArgs,
|
|
367
|
+
matchesAgentQuery,
|
|
368
|
+
buildAgentDiscoveryResult,
|
|
369
|
+
toDiscoverySafeAgentSummary,
|
|
370
|
+
isServerDispatchSpeedSource,
|
|
371
|
+
isLocalDispatchSpeedSource
|
|
372
|
+
};
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
patch,
|
|
7
7
|
read
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ADYWV732.js";
|
|
9
9
|
import {
|
|
10
10
|
DEVICE_LOCAL_OWNER_ID,
|
|
11
11
|
isDeviceLocalSpaceBody
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HPDLPEUG.js";
|
|
13
13
|
import {
|
|
14
14
|
selectIdentityUserId
|
|
15
15
|
} from "./chunk-PXYBUFDB.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireTokenUser
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EL5NRJHI.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveServerUrl
|
|
6
6
|
} from "./chunk-BIDSIRTS.js";
|
|
7
7
|
import {
|
|
8
8
|
t
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FEIVARWR.js";
|
|
10
10
|
|
|
11
11
|
// packages/cli/cliApiClient.ts
|
|
12
12
|
var CliApiError = class extends Error {
|
|
@@ -33,9 +33,10 @@ async function cliApiRequest(args) {
|
|
|
33
33
|
if (args.body !== void 0 && args.body !== null && method !== "GET") {
|
|
34
34
|
init.body = JSON.stringify(args.body);
|
|
35
35
|
}
|
|
36
|
+
const fetchFn = args.fetchImpl ?? fetch;
|
|
36
37
|
let response;
|
|
37
38
|
try {
|
|
38
|
-
response = await
|
|
39
|
+
response = await fetchFn(url, init);
|
|
39
40
|
} catch (error) {
|
|
40
41
|
throw new CliApiError(t("api.requestFailed", error.message), "NETWORK_ERROR", 0);
|
|
41
42
|
}
|
|
@@ -49,9 +50,10 @@ async function cliApiRequest(args) {
|
|
|
49
50
|
response.status
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
53
|
+
const isSuccessEnvelope = data.success === true || data.ok === true;
|
|
54
|
+
if (!response.ok || !isSuccessEnvelope) {
|
|
55
|
+
const errorObj = typeof data.error === "object" && data.error !== null ? data.error : {};
|
|
56
|
+
const message = errorObj.message || (typeof data.error === "string" ? data.error : "") || data.message || t("api.requestFailedHttp", String(response.status));
|
|
55
57
|
const code = errorObj.code || `HTTP_${response.status}`;
|
|
56
58
|
throw new CliApiError(message, code, response.status);
|
|
57
59
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// packages/agent-runtime/dialogMessageRecord.ts
|
|
2
|
+
function dialogMessageRecordToAgentRuntimeMessage(record) {
|
|
3
|
+
if (!record || typeof record !== "object") return null;
|
|
4
|
+
if (record.role !== "user" && record.role !== "assistant" && record.role !== "tool") return null;
|
|
5
|
+
return {
|
|
6
|
+
...typeof record.id === "string" ? { id: record.id } : {},
|
|
7
|
+
role: record.role,
|
|
8
|
+
...Number.isFinite(record.metadata?.cliHistoryOrder) ? { cliHistoryOrder: record.metadata.cliHistoryOrder } : {},
|
|
9
|
+
content: record.content ?? "",
|
|
10
|
+
...record.contextReference !== void 0 ? { context_reference: record.contextReference } : {},
|
|
11
|
+
...typeof record.reasoning_content === "string" ? { reasoning_content: record.reasoning_content } : {},
|
|
12
|
+
...typeof record.toolCallId === "string" ? { tool_call_id: record.toolCallId } : {},
|
|
13
|
+
...Array.isArray(record.tool_calls) ? { tool_calls: record.tool_calls } : {},
|
|
14
|
+
...record.toolPayload !== void 0 ? { toolPayload: record.toolPayload } : {},
|
|
15
|
+
...typeof record.toolName === "string" ? { toolName: record.toolName } : {},
|
|
16
|
+
// 写侧(dialogWritePlan)把 tool_result_metadata 以 `metadata` 字段落库;
|
|
17
|
+
// 回读必须还原,否则跨 turn 投影丢失 metadata 后缀,同一 tool 消息的字节
|
|
18
|
+
// 在 turn 边界漂移 → provider 前缀缓存断裂(stable projection 契约,
|
|
19
|
+
// 见 docs/plans/2026-09-05-tool-output-cache-stability.md)。
|
|
20
|
+
...record.metadata && typeof record.metadata === "object" ? { tool_result_metadata: record.metadata } : {},
|
|
21
|
+
...(() => {
|
|
22
|
+
const raw = record.createdAt;
|
|
23
|
+
const ms = typeof raw === "number" ? raw : typeof raw === "string" ? Date.parse(raw) : NaN;
|
|
24
|
+
return Number.isFinite(ms) ? { createdAt: ms } : {};
|
|
25
|
+
})()
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
dialogMessageRecordToAgentRuntimeMessage
|
|
31
|
+
};
|