nolo-cli 0.259.0-alpha.1 → 0.260.0-alpha.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 +1 -1
- package/{_executeModel-MTM4BJK3.js → _executeModel-EO6JFCOF.js} +97 -83
- package/accountResolver-NGICIMEE.js +1 -1
- package/{action-C6IQAKN4.js → action-WIA56QT4.js} +12 -10
- package/{addContentAction-53364YDW.js → addContentAction-OCMWZLYG.js} +14 -13
- package/{addDialogAgentAction-U5DD5EN5.js → addDialogAgentAction-ER2NZ7BC.js} +20 -24
- package/{agentDeleteCommand-53NN3VSK.js → agentDeleteCommand-KSXSNPAU.js} +184 -146
- package/{agentEmailCommands-KOGGIT6I.js → agentEmailCommands-NXRWS7NS.js} +142 -126
- package/{agentGrantCommands-L6O2HVJI.js → agentGrantCommands-D2S7LCTU.js} +8 -5
- package/{agentListCommands-62UYUQDI.js → agentListCommands-PFXGZZ3Y.js} +87 -68
- package/{agentMachineCommands-W6TNJXEA.js → agentMachineCommands-2Q55CSL4.js} +68 -59
- package/{agentProviderCommands-QLTABYR7.js → agentProviderCommands-EUNS7Y2Z.js} +10 -7
- package/{agentPullCommand-2EYJ5ENC.js → agentPullCommand-S2VMPSWL.js} +9 -6
- package/agentRecordCommands-FUFI526H.js +210 -0
- package/agentRun-ZNMUPDHF.js +250 -0
- package/agentRunCommand-ISVQ2UYC.js +248 -0
- package/{agentRunControl-LXMADX3N.js → agentRunControl-NEK44LDM.js} +19 -12
- package/{agentRuntimeLocal-YGNJMQW3.js → agentRuntimeLocal-SST4EPLT.js} +62 -49
- package/{agentSlice-3HHYUQLM.js → agentSlice-4ZJJJN4M.js} +15 -18
- package/appConfigCommands-MPHS6FHD.js +417 -0
- package/{appDeleteCommands-5COJ6CSG.js → appDeleteCommands-W26WGENW.js} +68 -58
- package/{appDeployCommands-3JPAT3XO.js → appDeployCommands-ER7IOF5E.js} +74 -59
- package/{appDeployStatusCommands-RHZKF3G4.js → appDeployStatusCommands-VKLL3A77.js} +68 -58
- package/{appGetCommands-73DXOAQW.js → appGetCommands-P6GXJNUD.js} +74 -58
- package/{appListCommands-HD5LOQ3G.js → appListCommands-ACA2IZZM.js} +74 -58
- package/appMigrateCommands-OGF4E2W6.js +230 -0
- package/appSourceCommands-GAHVBRUM.js +279 -0
- package/{authCommand-V6EOMZX6.js → authCommand-PXE7NZTQ.js} +26 -40
- package/{authCommands-T5FODCEG.js → authCommands-AZPYXTUB.js} +20 -17
- package/{builtinSkillRegistry-EDHD2UHU.js → builtinSkillRegistry-6XUWMAV5.js} +8 -6
- package/{chromeOpsCommands-3SSTDFRF.js → chromeOpsCommands-7UKKUOBU.js} +68 -18
- package/{chunk-KLMBM6P6.js → chunk-2CKFROQS.js} +2454 -1115
- package/{chunk-MJBLXJMP.js → chunk-2I4R6ZRV.js} +12 -9
- package/{chunk-FXEPZKNJ.js → chunk-2MIZHEND.js} +506 -64
- package/{chunk-TLE77UJ5.js → chunk-2OROOEOQ.js} +0 -1
- package/{chunk-6RSNVJGO.js → chunk-2ZBPWX7N.js} +4 -4
- package/chunk-35JIFLIG.js +30 -0
- package/{chunk-ZYPXOQS2.js → chunk-3EPED3UO.js} +1 -1
- package/{chunk-DNNPARJK.js → chunk-3QMN3T6L.js} +50 -37
- package/{chunk-DMPZMYH4.js → chunk-3R4AYHJR.js} +13 -1
- package/{chunk-HPDLPEUG.js → chunk-42JZNSAY.js} +267 -234
- package/{chunk-223KZUJ6.js → chunk-4HZCBA4Q.js} +18 -15
- package/{chunk-C5A54QS7.js → chunk-4INJGWE3.js} +18 -5
- package/chunk-4IVMDQBA.js +261 -0
- package/chunk-4Y6CZ2N4.js +82 -0
- package/{chunk-OKAXQFON.js → chunk-52BNL6GP.js} +4 -4
- package/{chunk-KZ4A7EIV.js → chunk-56OAS5RZ.js} +1 -1
- package/{chunk-QGFLVQ6E.js → chunk-6KUTNAPU.js} +4 -14
- package/{chunk-MNFUKRRU.js → chunk-6XAAKRJB.js} +7 -7
- package/{chunk-P27E22MA.js → chunk-6Z6DGDPI.js} +1 -1
- package/chunk-72VWN4VK.js +51 -0
- package/{chunk-L4XST72F.js → chunk-75FZ2Z7C.js} +16027 -17392
- package/{chunk-ADYWV732.js → chunk-76B6YUQS.js} +264 -177
- package/{chunk-MXA54TQM.js → chunk-76K4GTY5.js} +1 -1
- package/{chunk-VNHZJEQN.js → chunk-7HUCUD2I.js} +3 -3
- package/chunk-7LR2IFUH.js +100 -0
- package/{chunk-S73EPYNC.js → chunk-7LS5ATRP.js} +20 -6
- package/{chunk-Y2TCTNUD.js → chunk-7QO6YSA4.js} +4 -4
- package/{chunk-DBJODIZ6.js → chunk-7RYH7YIY.js} +19 -27
- package/{chunk-KHYSFS3W.js → chunk-A454UXB6.js} +148 -73
- package/chunk-AMNZPQCY.js +635 -0
- package/chunk-AMTF6FJD.js +356 -0
- package/{chunk-4MXYCQBS.js → chunk-AQNWWJLH.js} +2 -56
- package/{chunk-WSLL7VV4.js → chunk-B4NA5UJR.js} +9 -9
- package/{chunk-LHCGKAFO.js → chunk-BKP325XS.js} +184 -112
- package/{chunk-PENRYZ4D.js → chunk-BPB3T5EU.js} +4 -7
- package/{chunk-46FETNLF.js → chunk-BTIFQBYW.js} +7 -6
- package/{chunk-2JHGUL5K.js → chunk-BVYHE6QD.js} +2 -2
- package/{chunk-KXOPLLFP.js → chunk-CA7LGAHV.js} +69 -9
- package/{chunk-2FZVXOFX.js → chunk-CEIWXKHP.js} +112 -200
- package/{chunk-AIFQKNPP.js → chunk-CL33RFD7.js} +1 -1
- package/{chunk-MPGR4ZNR.js → chunk-CRGPRAJ4.js} +46 -42
- package/{chunk-P4R5KXU7.js → chunk-CW6LRDSF.js} +5 -5
- package/{chunk-R3TUHCSJ.js → chunk-CZHIOBBK.js} +8 -3
- package/chunk-D3ONA3FP.js +762 -0
- package/chunk-D3SAQ6T7.js +1697 -0
- package/{chunk-PIVTQRX6.js → chunk-DDKA6V6X.js} +111 -12
- package/{chunk-KQHEGELM.js → chunk-DEAII55O.js} +16 -6
- package/{chunk-J55F3IEZ.js → chunk-DKJQEFNG.js} +1 -1
- package/chunk-DLXL4NSL.js +1179 -0
- package/{chunk-EJQE5HB7.js → chunk-DSBRIUX5.js} +4 -2
- package/{chunk-XRGBJHZX.js → chunk-E36V7MPY.js} +9 -5
- package/{chunk-4YPH5KRA.js → chunk-EDKMRDET.js} +1 -1
- package/chunk-EJHLDJWZ.js +58 -0
- package/{chunk-6B2OBX5B.js → chunk-EMFZXJTN.js} +15 -47
- package/chunk-ER6NTALN.js +34 -0
- package/chunk-EUHMI5KG.js +101 -0
- package/{chunk-YQLAFJRQ.js → chunk-FBNVJ2TO.js} +1 -1
- package/{chunk-Q2EERN52.js → chunk-FF5ZRKW7.js} +12 -7
- package/{chunk-YFEK7ACQ.js → chunk-FGD4NMTP.js} +4 -4
- package/{chunk-6XIE5ZGI.js → chunk-FGFJUFPS.js} +5 -6
- package/chunk-FI4DPLR7.js +902 -0
- package/chunk-FKVLQNGJ.js +25 -0
- package/{chunk-JCQ3WCQ3.js → chunk-FOC4TORM.js} +69 -3
- package/{chunk-JPXACKSW.js → chunk-G22P2J7O.js} +30 -81
- package/{chunk-7WHCIA5V.js → chunk-G5IAIGGD.js} +3 -8
- package/{chunk-5BIDJVNX.js → chunk-G5JGA5YM.js} +180 -31
- package/{chunk-57V4PADY.js → chunk-GMBWWBSJ.js} +781 -449
- package/{chunk-WS36XPJD.js → chunk-GYFKKTDI.js} +82 -6
- package/{chunk-KT7S7ANZ.js → chunk-GZ4I5EMM.js} +9 -9
- package/{chunk-324FWHUA.js → chunk-HHXF57CL.js} +12 -3
- package/chunk-HJTI7RZV.js +94 -0
- package/{chunk-QXTEEEIN.js → chunk-HPIY372N.js} +7 -7
- package/{chunk-Q2MPKE4B.js → chunk-HVRG27HI.js} +76 -26
- package/{chunk-HDKMVYNJ.js → chunk-I3NWAILT.js} +6 -4
- package/{chunk-JZO7KUF3.js → chunk-IM7HCFB4.js} +313 -275
- package/{chunk-UWWOWTW2.js → chunk-INN2PBW7.js} +1 -1
- package/chunk-IV6VUVLJ.js +88 -0
- package/chunk-J42X32PV.js +472 -0
- package/{chunk-UA3QTA2S.js → chunk-JHQNWV2C.js} +4441 -2569
- package/{chunk-R7XWZDOH.js → chunk-JUMQJSQF.js} +1423 -282
- package/{chunk-BIDSIRTS.js → chunk-JUNYPVL6.js} +10 -16
- package/chunk-JVEKCQAP.js +222 -0
- package/{chunk-KVMLM5VD.js → chunk-KAHYBAEN.js} +211 -472
- package/chunk-KDDXC2IH.js +148 -0
- package/chunk-KGKTN2NX.js +25 -0
- package/chunk-KGWE224L.js +246 -0
- package/chunk-L3UFGEDU.js +17157 -0
- package/{chunk-CBIGMWMI.js → chunk-LHJB4BXJ.js} +1 -1
- package/{chunk-7OVOZRZF.js → chunk-LIH7WSX5.js} +23 -379
- package/chunk-LJOPY4TL.js +443 -0
- package/{chunk-TRRXYFTR.js → chunk-LOFRSJX2.js} +1 -0
- package/{chunk-SQL7YNED.js → chunk-LPXBBC32.js} +71 -5
- package/chunk-LXP53WGF.js +168 -0
- package/chunk-MDAYRIP7.js +1889 -0
- package/chunk-MRACVEPZ.js +7 -0
- package/chunk-NHLLXINQ.js +8 -0
- package/{chunk-FP37ELBT.js → chunk-NTBTVKKB.js} +17 -25
- package/{chunk-LVZVSLKO.js → chunk-O7ZY6SUK.js} +5 -22
- package/{chunk-2C5VN7NH.js → chunk-P4XAHM4B.js} +1 -1
- package/chunk-PL5RKESU.js +40 -0
- package/{chunk-MHKPUGPD.js → chunk-PQ3QZMJK.js} +20 -4
- package/chunk-Q5FJJ6XI.js +103 -0
- package/{createAgentAutomationAction-GRZ6XY7Q.js → chunk-QKM55LP2.js} +3 -160
- package/{chunk-6YX2RAQN.js → chunk-QZCLCAYC.js} +89 -164
- package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
- package/{chunk-JLZJL3WC.js → chunk-RDZ5OIAT.js} +370 -39
- package/{chunk-5RGU3J7P.js → chunk-REAE2SZK.js} +0 -1
- package/chunk-RF576RYE.js +117 -0
- package/chunk-RI7SXDJW.js +1317 -0
- package/{chunk-FEIVARWR.js → chunk-RIOAPUGV.js} +238 -25
- package/{chunk-2CT2J3O6.js → chunk-RL6H2A2Z.js} +2493 -4055
- package/{chunk-BZLGPM5B.js → chunk-RNLKWUVY.js} +7 -12
- package/{chunk-J7JRCOIW.js → chunk-RWXHGPWJ.js} +1 -1
- package/chunk-S7BF2OGX.js +432 -0
- package/{chunk-6VEO7Z3Y.js → chunk-SD4MBKZ7.js} +6 -6
- package/{chunk-KWNVPY6M.js → chunk-SGEBRBF3.js} +7 -4
- package/{chunk-6SOWMEAY.js → chunk-SR57FDTX.js} +2 -258
- package/{chunk-CEKRIR22.js → chunk-SU4NCTW4.js} +1 -1
- package/{chunk-Y2GWUBNS.js → chunk-SX6PDLBZ.js} +279 -149
- package/{chunk-XNNBXUEM.js → chunk-T4WU747C.js} +5 -5
- package/{chunk-53W5BXLN.js → chunk-TCOHWKDM.js} +54 -55
- package/{chunk-QIGQFON2.js → chunk-TXMFSGRY.js} +1 -1
- package/{chunk-UUCYUN6Y.js → chunk-UB7NV7NN.js} +1 -1
- package/{chunk-NCFKHYDM.js → chunk-UOLGGEEC.js} +774 -119
- package/{chunk-4EACJPZI.js → chunk-USFG4EWQ.js} +51 -42
- package/{chunk-LLUBUHNT.js → chunk-UYZOBSSO.js} +5 -9
- package/{chunk-XPETQ4MR.js → chunk-VDC3BW24.js} +24 -10
- package/chunk-VH356OQ3.js +425 -0
- package/{chunk-U6QNVOR5.js → chunk-VKM7DOYB.js} +130 -6
- package/{chunk-CJOOF4L5.js → chunk-VPAO5WQX.js} +17 -14
- package/{chunk-OYUMJMC5.js → chunk-W2RQYNPI.js} +5 -0
- package/{chunk-6BMTKYAO.js → chunk-W2Z5E2R7.js} +126 -698
- package/{chunk-4ZCTKB27.js → chunk-W5GKF5ZW.js} +1 -0
- package/{chunk-NUHQO3RB.js → chunk-WIVVNJUS.js} +1 -1
- package/chunk-WLJNHFEB.js +1710 -0
- package/chunk-WMBJDXMY.js +408 -0
- package/chunk-WSQLCWLQ.js +201 -0
- package/{chunk-YN23INFZ.js → chunk-WXD6Y7DW.js} +23 -2
- package/{chunk-OOVOAG4Q.js → chunk-WY6DMHMG.js} +1 -1
- package/{chunk-6K32PBRY.js → chunk-XJW6SLBZ.js} +3 -3
- package/{chunk-7BIJFGKS.js → chunk-XQFDCRG3.js} +105 -51
- package/chunk-XT6C2QZW.js +46 -0
- package/{chunk-5YS6QHGT.js → chunk-Y7THFNVJ.js} +9 -9
- package/{chunk-ZEZC7IIM.js → chunk-YFSM2366.js} +35 -35
- package/{chunk-RD3QLZQV.js → chunk-YM5XULB2.js} +324 -2
- package/{chunk-FZENZCIA.js → chunk-YNP3ITPU.js} +19 -12
- package/{chunk-U35UUM5K.js → chunk-YOUSQIIK.js} +1 -1
- package/{chunk-RIWKZT7E.js → chunk-YRPIUIEQ.js} +11 -9
- package/{chunk-IYLUK67R.js → chunk-YU235GGN.js} +25 -8
- package/chunk-YWEZSBLL.js +790 -0
- package/chunk-Z3KTXWWB.js +76 -0
- package/{chunk-YLAHYLDQ.js → chunk-ZC3CMUKU.js} +2 -89
- package/chunk-ZD7OULYZ.js +368 -0
- package/{chunk-5P3PPQVP.js → chunk-ZQAADXSF.js} +1 -1
- package/{chunk-HQUGB2HM.js → chunk-ZTCMXPIS.js} +62 -50
- package/{cliAgentConfigHelpers-BXHQ3PXP.js → cliAgentConfigHelpers-KMXS7JP5.js} +20 -14
- package/{cliAuthorityBrokerClient-TFNXJLXL.js → cliAuthorityBrokerClient-3SKOA7OZ.js} +3 -1
- package/cliAuthorityBrokerProcess-DCCUT4YQ.js +34 -0
- package/{cliEnvHelpers-CNMP3RDX.js → cliEnvHelpers-YDGDHIEE.js} +5 -2
- package/{cliExecutor-K6FDZTQ2.js → cliExecutor-Z62UBJ5S.js} +12 -6
- package/cliLocalAgentRecordReader-X2YHEBWI.js +113 -0
- package/cloudAutomationCommands-C6Q3BFRB.js +310 -0
- package/{commandRegistry-IFYQLPGM.js → commandRegistry-TYYYTW5E.js} +260 -121
- package/{contentThunks-QCFCD2X3.js → contentThunks-E6BJ5YSX.js} +45 -43
- package/{cooldownCommands-WDOI5VD7.js → cooldownCommands-FPAFS7XG.js} +1 -1
- package/createAgentAutomationAction-L3NLCIIW.js +172 -0
- package/{createDialogAction-ZAJERW62.js → createDialogAction-QSWKRPWQ.js} +46 -42
- package/{createPageAction-QCVBMP4C.js → createPageAction-ZVVUT4CZ.js} +49 -45
- package/{db-VR74ADGC.js → db-KTQ3LL2Q.js} +3 -3
- package/{dbSlice-RWPSVHBC.js → dbSlice-SEVKNA7A.js} +21 -16
- package/deleteDbKey-43MTK2DI.js +86 -0
- package/{dialogCommands-4IEQUALS.js → dialogCommands-UVMTIFSA.js} +80 -66
- package/{dialogMessageRecord-OAV77LT7.js → dialogMessageRecord-2HJTEXQX.js} +1 -1
- package/{dialogNotifyCommand-IASQGEMW.js → dialogNotifyCommand-LMWF7EQI.js} +22 -14
- package/dialogPortabilityCommands-PAMLEBST.js +3036 -0
- package/{dialogSlice-XFYID6KE.js → dialogSlice-VHPXENDZ.js} +43 -42
- package/{dialogTraceCommand-Y67NRFCV.js → dialogTraceCommand-SO2WKAXW.js} +83 -69
- package/{dialogUsageCommand-WJ3U6KZU.js → dialogUsageCommand-EUO6JXTD.js} +6 -3
- package/{docCreateCommands-QLRIWRQE.js → docCreateCommands-H4RLIUNX.js} +68 -59
- package/{docDeleteCommands-XPRYA532.js → docDeleteCommands-OVAKCBMT.js} +68 -59
- package/{docReadCommands-EXQI7ETH.js → docReadCommands-KFISIUVA.js} +67 -58
- package/{docStore-MWFUKZL2.js → docStore-X7BEA735.js} +16 -17
- package/{docUpdateCommands-EFBFQV77.js → docUpdateCommands-VOEER36L.js} +68 -59
- package/{ebookDownloaderAgentCommand-DYSKF5ZY.js → ebookDownloaderAgentCommand-2DHPGEOQ.js} +14 -17
- package/{fetchMessages-TQEUZD7H.js → fetchMessages-RGPIYEPZ.js} +2 -2
- package/{getPricing-5BLZRPTM.js → getPricing-BK6CUBAE.js} +8 -4
- package/{handleSendMessageAction-GG3TR62X.js → handleSendMessageAction-GQ2KKOET.js} +265 -119
- package/{hostCredentialCreate-26S6DDJ5.js → hostCredentialCreate-PJAIKZQP.js} +138 -122
- package/index.js +35 -21
- package/{keys-RWF7UCB4.js → keys-FXEGMKSG.js} +2 -2
- package/localAutomationCommands-UU66LOWB.js +198 -0
- package/localAutomationRuntime-SW4R42SZ.js +60 -0
- package/{localDialogRead-BJJT3TF5.js → localDialogRead-W2EVXISA.js} +2 -2
- package/{localRuntimeAdapter-VREWZWPC.js → localRuntimeAdapter-WRBLXFUZ.js} +136 -119
- package/localRuntimeAuthority-3YDFZD3L.js +44 -0
- package/{localRuntimeDb-ZJFGNHML.js → localRuntimeDb-CJWJK47G.js} +1 -1
- package/{machineCommands-CL5XK5UC.js → machineCommands-JFYED66N.js} +251 -357
- package/{machineInfo-LWHTEBHJ.js → machineInfo-BJIU3WQ5.js} +4 -2
- package/machineWsRunDispatch-CZUV2FXE.js +227 -0
- package/{mcpLocalAuthorizeCommand-RBXJDE6J.js → mcpLocalAuthorizeCommand-HLU72QME.js} +40 -22
- package/mcpLocalManageCommands-OHHU6F5C.js +212 -0
- package/{memberThunks-43B7UYC5.js → memberThunks-FJW4GPM5.js} +102 -22
- package/{memoryCommands-BC6REPQB.js → memoryCommands-2RLHDMU2.js} +25 -34
- package/{models-ZX2BYIMB.js → models-TOXYINNM.js} +3 -2
- package/{offlineMarxistsAgentCommand-XVXUE6G5.js → offlineMarxistsAgentCommand-WZBJBCPZ.js} +16 -22
- package/package.json +3 -3
- package/parityCommands-7EWR34P3.js +613 -0
- package/{projectArchive-OC63TWTD.js → projectArchive-JIVRMXVV.js} +49 -45
- package/{providerPresetApply-NTJUINI6.js → providerPresetApply-IRJ56XIZ.js} +12 -16
- package/{providerRegistry-W45SLUV6.js → providerRegistry-26PAUYH2.js} +3 -13
- package/{read-KG6INYUT.js → read-6YR57D6V.js} +11 -10
- package/{readDocTool-N3GA52JR.js → readDocTool-NKOGL2MW.js} +5 -1
- package/{readlineWorkspace-2NO6D6IZ.js → readlineWorkspace-V26AN2FL.js} +926 -572
- package/{rememberExplicit-CPAPONSI.js → rememberExplicit-7KX4HXQC.js} +4 -4
- package/remove-BF33RCTH.js +32 -0
- package/{removeDialogAgentAction-EEVSOQOJ.js → removeDialogAgentAction-GWHBWF4W.js} +22 -26
- package/{runAgentClientLoop-U7V32UTD.js → runAgentClientLoop-EKD2EEEA.js} +117 -82
- package/{runtimeDoctorCommands-V3M3JTUV.js → runtimeDoctorCommands-IALUR5BZ.js} +23 -16
- package/{secretCommands-KVVZS7A6.js → secretCommands-CSTQYB6T.js} +2 -2
- package/{setDialogExtraReferencesAction-DNO5POHA.js → setDialogExtraReferencesAction-RL6FGO7T.js} +16 -17
- package/{setPrimaryDialogAgentAction-QABBEO4C.js → setPrimaryDialogAgentAction-XJASBB3K.js} +23 -27
- package/{settingThunks-DVKG4X4S.js → settingThunks-ZT7ZYXXL.js} +170 -497
- package/{skillDiscovery-5GEGWJ6N.js → skillDiscovery-IUEZZG2B.js} +3 -3
- package/{spaceCommands-7QKXKBDQ.js → spaceCommands-65WQHVOI.js} +68 -57
- package/spacePruneCommand-PTMRUWYJ.js +233 -0
- package/{store-Z53ICFL3.js → store-WSAVTR32.js} +3 -1
- package/{streamAgentChatTurn-UAGFOXNJ.js → streamAgentChatTurn-B5NICHZW.js} +225 -137
- package/{switchDialogAgentAction-KYWJSGOO.js → switchDialogAgentAction-X6DFOIAX.js} +19 -23
- package/{tableCommands-EFA754RE.js → tableCommands-6E77VD73.js} +28 -49
- package/{toolApiClient-N5PYW2R3.js → toolApiClient-GTTWEV6P.js} +15 -4
- package/{tools-2Q2LBDUC.js → tools-UMCPIQX6.js} +73 -63
- package/{tuiRestart-4QDWLHYZ.js → tuiRestart-O7UDLNQU.js} +20 -13
- package/tuiSummaryLlmCaller-7APIUIIV.js +52 -0
- package/{updateCommands-GJGRS6JK.js → updateCommands-DXDIAQFS.js} +12 -7
- package/{updateDialogTitleAction-GGNTTI5L.js → updateDialogTitleAction-HZLKWVKM.js} +57 -58
- package/{usageCommand-WI6SQOPB.js → usageCommand-WYLNBDHB.js} +6 -8
- package/{usageRebuildCommand-WQRLLZAT.js → usageRebuildCommand-AEUPY2PE.js} +11 -15
- package/{windowsSelfUpdate-C7LGVWYX.js → windowsSelfUpdate-SXSVXK4X.js} +2 -2
- package/workContext-ZAW6VXT7.js +18 -0
- package/workContextQueryProjection-CACY5VFE.js +23 -0
- package/{workloadLifecycle-DYX5ZMAT.js → workloadLifecycle-P2SJVV3S.js} +1 -1
- package/agentFavoriteCommands-7LOP3HUD.js +0 -186
- package/agentRecordCommands-TPE7NSZ6.js +0 -194
- package/agentRunCommand-DMVGBPLI.js +0 -232
- package/chunk-2MBTWINN.js +0 -89
- package/chunk-523DITKR.js +0 -32
- package/chunk-BUDVRYES.js +0 -2213
- package/chunk-BZMDWGQQ.js +0 -47
- package/chunk-GAHJLSDO.js +0 -107
- package/chunk-GYX6XTAI.js +0 -84
- package/chunk-HNUWUO75.js +0 -93
- package/chunk-HSBHS6KT.js +0 -33401
- package/chunk-KG27JIG4.js +0 -136
- package/chunk-OB4FBZXJ.js +0 -364
- package/chunk-OKH74FML.js +0 -3746
- package/chunk-OLZBQWZU.js +0 -6
- package/chunk-OOV5JN25.js +0 -1317
- package/chunk-OQFOE4SJ.js +0 -405
- package/chunk-PXYBUFDB.js +0 -53
- package/chunk-R3FZHW4Q.js +0 -103
- package/chunk-R3MV2GII.js +0 -106
- package/chunk-SCAC3NM5.js +0 -11751
- package/chunk-SR4FE5VD.js +0 -9
- package/chunk-SYTHYBMI.js +0 -3558
- package/chunk-UKZX3NHN.js +0 -48
- package/chunk-UVLYNWIE.js +0 -74
- package/chunk-VQX5JJNI.js +0 -861
- package/chunk-X4O7FJF5.js +0 -160
- package/chunk-YJPK35HB.js +0 -175
- package/chunk-YNIYE47Z.js +0 -105
- package/chunk-Z4PCXPUE.js +0 -127
- package/chunk-ZR5IVL4N.js +0 -862
- package/chunk-ZTHAJU3O.js +0 -2537
- package/cliAuthorityBrokerProcess-5ZFBTHLB.js +0 -22
- package/cliLocalAgentRecordReader-34UKRBLY.js +0 -104
- package/deleteFile-ECU6FU5C.js +0 -55
- package/localRuntimeAuthority-UF2DAQ3F.js +0 -28
- package/machineWsRunDispatch-TBVOYOAH.js +0 -209
- package/markdownToSlate-PXYAIBVL.js +0 -8
- package/tuiSummaryLlmCaller-HROLGN4F.js +0 -45
- package/webapi-QVV65DQF.js +0 -2487
- package/workContext-Y3ADAPZU.js +0 -14
- package/{chunk-USGHJSGO.js → chunk-GX2MFKF3.js} +3 -3
- package/{chunk-PHREU2KZ.js → chunk-WX266G2C.js} +0 -0
- package/{chunk-DXWGFL2Z.js → chunk-YY7IGJMN.js} +3 -3
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
builtinAgentCatalogEntryById,
|
|
13
13
|
catalogReleasedAtMs,
|
|
14
14
|
isRetiredCatalogEntry
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-YRPIUIEQ.js";
|
|
16
16
|
import {
|
|
17
17
|
parsePublicAgentId,
|
|
18
18
|
parseSystemAgentId,
|
|
@@ -20,17 +20,17 @@ import {
|
|
|
20
20
|
} from "./chunk-M2EJHDJP.js";
|
|
21
21
|
import {
|
|
22
22
|
getModelPricing
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CW6LRDSF.js";
|
|
24
24
|
import {
|
|
25
25
|
getModelConfig
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RI7SXDJW.js";
|
|
27
27
|
import {
|
|
28
28
|
isRecord
|
|
29
29
|
} from "./chunk-KUG52IAP.js";
|
|
30
30
|
import {
|
|
31
31
|
isNoloHostedProvider,
|
|
32
32
|
isPlatformHostedImageModel
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-G22P2J7O.js";
|
|
34
34
|
|
|
35
35
|
// packages/core/publicAgentSeeds.ts
|
|
36
36
|
var AGENT_SEED_DEFAULTS = {
|
|
@@ -251,17 +251,18 @@ var GPT_6_ASTRA_DEF = defineAgentSeed({
|
|
|
251
251
|
tags: ["openai", "gpt", "astra"]
|
|
252
252
|
});
|
|
253
253
|
var GPT_61_SOL_DEF = defineAgentSeed({
|
|
254
|
+
// presetKey / id / deterministicId 保持不变(硬 key 引用:收藏、Space contentKey、
|
|
255
|
+
// consultant 档位);2026-12-01 起模型换代为 GPT-6.2 Sol。
|
|
254
256
|
id: PUBLIC_GPT_61_SOL_AGENT_ID,
|
|
255
257
|
presetKey: "gpt-6-1-sol",
|
|
256
|
-
name: "GPT-6.
|
|
258
|
+
name: "GPT-6.2 Sol",
|
|
257
259
|
provider: "nolo",
|
|
258
|
-
model: "gpt-6.
|
|
260
|
+
model: "gpt-6.2-sol",
|
|
259
261
|
isPublic: true,
|
|
260
|
-
// 出自平台模型目录:gpt-6.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
greeting: "\u4F60\u597D\uFF0C\u6211\u662F GPT-6.1 Sol\u3002\u9002\u5408\u590D\u6742\u63A8\u7406\u3001\u4EE3\u7801\u5206\u6790\u548C\u957F\u6587\u6863\u5904\u7406\uFF1B\u4F7F\u7528\u524D\u8BF7\u786E\u4FDD\u8D26\u6237\u5F00\u901A\u9AD8\u9636\u6863\u4F4D\u6216\u6709\u5145\u8DB3\u53EF\u7528\u4F59\u989D\u3002",
|
|
262
|
+
// 出自平台模型目录:gpt-6.2-sol hasVision: true、supportsTool: true、128K 输出。
|
|
263
|
+
hasVision: true,
|
|
264
|
+
introduction: "GPT-6.2 Sol \u516C\u5F00\u52A9\u624B\uFF0C\u5F3A\u63A8\u7406\u5FEB\u6863\uFF0C\u9002\u5408\u590D\u6742\u5206\u6790\u3001\u4EE3\u7801\u4E0E\u957F\u6587\u6863\u4EFB\u52A1\u3002\u9700\u5F00\u901A 199 \u79EF\u5206\u6863\u4F4D\u6216\u8D26\u6237\u4FDD\u6301\u6709\u6548\u4F59\u989D\uFF08\u2265 19 \u79EF\u5206\uFF09\u3002",
|
|
265
|
+
greeting: "\u4F60\u597D\uFF0C\u6211\u662F GPT-6.2 Sol\u3002\u9002\u5408\u590D\u6742\u63A8\u7406\u3001\u4EE3\u7801\u5206\u6790\u548C\u957F\u6587\u6863\u5904\u7406\uFF1B\u4F7F\u7528\u524D\u8BF7\u786E\u4FDD\u8D26\u6237\u5F00\u901A\u9AD8\u9636\u6863\u4F4D\u6216\u6709\u5145\u8DB3\u53EF\u7528\u4F59\u989D\u3002",
|
|
265
266
|
prompt: "\u5148\u786E\u8BA4\u7528\u6237\u8981\u89E3\u51B3\u7684\u5177\u4F53\u95EE\u9898\u4E0E\u7EA6\u675F\uFF0C\u518D\u7ED9\u51FA\u53EF\u9760\u3001\u53EF\u6267\u884C\u7684\u7ED3\u679C\u3002\n\u6D89\u53CA\u4EE3\u7801\u65F6\u8BF4\u660E\u6539\u52A8\u70B9\u3001\u8FB9\u754C\u6761\u4EF6\u4E0E\u9A8C\u8BC1\u65B9\u5F0F\uFF1B\u6D89\u53CA\u957F\u6587\u6863\u65F6\u5148\u5B9A\u4F4D\u5173\u952E\u6BB5\u843D\u518D\u4E0B\u7ED3\u8BBA\u3002\n\u4E0D\u786E\u5B9A\u7684\u5185\u5BB9\u660E\u786E\u8BF4\u660E\uFF0C\u4E0D\u7F16\u9020\u3002",
|
|
266
267
|
tools: [],
|
|
267
268
|
tags: ["openai", "gpt", "sol"]
|
|
@@ -312,14 +313,16 @@ var GEMINI_3_8_FLASH_DEF = defineAgentSeed({
|
|
|
312
313
|
tags: ["google", "gemini"]
|
|
313
314
|
});
|
|
314
315
|
var GEMINI_4_ARGON_DEF = defineAgentSeed({
|
|
316
|
+
// presetKey / id / deterministicId 保持不变(硬 key 引用);2026-12-01 起
|
|
317
|
+
// 模型换代为 Gemini 4 Neon。
|
|
315
318
|
id: deterministicId("01GEM4ARGPB", "shared-space-google-gemini-4-argon"),
|
|
316
319
|
presetKey: "gemini-4-argon",
|
|
317
|
-
name: "Gemini 4
|
|
320
|
+
name: "Gemini 4 Neon",
|
|
318
321
|
provider: "nolo",
|
|
319
|
-
model: "gemini-4-
|
|
322
|
+
model: "gemini-4-neon",
|
|
320
323
|
isPublic: true,
|
|
321
|
-
introduction: "Gemini 4
|
|
322
|
-
greeting: "\u4F60\u597D\uFF0C\u6211\u662F Gemini 4
|
|
324
|
+
introduction: "Gemini 4 Neon \u516C\u5F00\u52A9\u624B\uFF0CGoogle \u65D7\u8230\u63A8\u7406\u6A21\u578B\uFF0C\u9002\u5408\u590D\u6742\u63A8\u7406\u3001\u4EE3\u7801\u3001\u591A\u6A21\u6001\u548C\u957F\u4E0A\u4E0B\u6587\u4EFB\u52A1\u3002",
|
|
325
|
+
greeting: "\u4F60\u597D\uFF0C\u6211\u662F Gemini 4 Neon\u3002\u9002\u5408\u5904\u7406\u590D\u6742\u63A8\u7406\u3001\u4EE3\u7801\u3001\u591A\u6A21\u6001\u548C\u957F\u4E0A\u4E0B\u6587\u4EFB\u52A1\u3002",
|
|
323
326
|
prompt: "\u4F18\u5148\u76F4\u63A5\u5B8C\u6210\u4EFB\u52A1\uFF1B\u9700\u8981\u63A8\u7406\u6216\u5199\u4EE3\u7801\u65F6\u4FDD\u6301\u6B65\u9AA4\u6E05\u6670\u3001\u7ED3\u8BBA\u53EF\u9760\u3002",
|
|
324
327
|
tools: [],
|
|
325
328
|
tags: ["google", "gemini"]
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyMemoryInterpreterMutation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2ZBPWX7N.js";
|
|
4
4
|
import {
|
|
5
5
|
getMemoryEvidenceVNextStrict,
|
|
6
6
|
listMemoryStatesForEntityVNext,
|
|
7
7
|
loadMemoryVNextCatalog
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HHXF57CL.js";
|
|
9
9
|
|
|
10
10
|
// packages/ai/memory/vnext/workContext.ts
|
|
11
11
|
import { createHash } from "crypto";
|
|
12
|
+
var isClosedWorkStatus = (status) => status === "completed" || status === "cancelled";
|
|
12
13
|
var facet = "work-context";
|
|
13
14
|
var statuses = ["active", "paused", "completed", "cancelled"];
|
|
14
15
|
var hash = (v) => createHash("sha256").update(JSON.stringify(v)).digest("hex");
|
|
@@ -22,19 +23,30 @@ var validScope = (s) => {
|
|
|
22
23
|
function validValue(v) {
|
|
23
24
|
return object(v) && v.version === 1 && Number.isSafeInteger(v.revision) && v.revision > 0 && statuses.includes(v.status) && bounded(v.goal, 4096) && list(v.constraints, 50, 2048) && list(v.openItems, 50, 2048) && (v.nextStep === void 0 || typeof v.nextStep === "string" && v.nextStep.length <= 4096) && list(v.latestSourceRefs, 20, 2048) && v.latestSourceRefs.length > 0 && (v.spaceId === null || bounded(v.spaceId, 256)) && list(v.dialogIds, 100, 512) && v.dialogIds.length > 0;
|
|
24
25
|
}
|
|
26
|
+
function workGoalError(code, message) {
|
|
27
|
+
return Object.assign(new Error(message), { code });
|
|
28
|
+
}
|
|
29
|
+
function validateWorkContextGoal(patch, creating) {
|
|
30
|
+
const goal = object(patch) ? patch.goal : void 0;
|
|
31
|
+
if (goal === void 0) {
|
|
32
|
+
if (creating) throw workGoalError("WORK_MEMORY_GOAL_REQUIRED", "goal required: new work needs a real patch.goal (nonblank, up to 4096 characters).");
|
|
33
|
+
} else if (!bounded(goal, 4096)) {
|
|
34
|
+
throw workGoalError("WORK_MEMORY_INVALID_GOAL", "invalid goal: patch.goal must be a nonblank string up to 4096 characters; omit it on update to keep the existing goal.");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
25
37
|
function validPatch(p) {
|
|
26
38
|
if (!object(p) || Object.keys(p).some((k) => !["status", "goal", "constraints", "openItems", "nextStep"].includes(k))) throw new Error("invalid patch");
|
|
27
39
|
if (p.status !== void 0 && !statuses.includes(p.status)) throw new Error("invalid status");
|
|
28
|
-
if (p.goal !== void 0 && !bounded(p.goal, 4096)) throw new Error("invalid goal");
|
|
29
40
|
if (p.nextStep !== void 0 && (typeof p.nextStep !== "string" || p.nextStep.length > 4096)) throw new Error("invalid nextStep");
|
|
30
41
|
for (const a of [p.constraints, p.openItems]) if (a !== void 0 && !list(a, 50, 2048)) throw new Error("invalid list");
|
|
31
42
|
}
|
|
32
43
|
async function updateWorkContext(db, scope, input) {
|
|
33
44
|
validScope(scope);
|
|
34
45
|
if (!object(input) || Object.keys(input).some((k) => !["activityId", "expectedRevision", "itemKey", "originRef", "changeId", "sourceRefs", "patch"].includes(k))) throw new Error("invalid input");
|
|
46
|
+
const creating = input.activityId === void 0;
|
|
47
|
+
validateWorkContextGoal(input.patch, creating);
|
|
35
48
|
validPatch(input.patch);
|
|
36
49
|
if (!bounded(input.changeId, 256) || !list(input.sourceRefs, 20, 2048) || !input.sourceRefs.length) throw new Error("source and changeId required");
|
|
37
|
-
const creating = input.activityId === void 0;
|
|
38
50
|
if (creating && (!bounded(input.itemKey, 256) || !bounded(input.originRef, 2048) || input.expectedRevision !== void 0)) throw new Error("origin and itemKey required");
|
|
39
51
|
if (!creating && (!bounded(input.activityId, 256) || !Number.isSafeInteger(input.expectedRevision) || input.expectedRevision < 1 || input.itemKey !== void 0 || input.originRef !== void 0)) throw new Error("activityId and revision required");
|
|
40
52
|
const activityId = creating ? `work-${hash([scope.ownerId, scope.spaceId, input.originRef, input.itemKey])}` : input.activityId;
|
|
@@ -63,7 +75,6 @@ async function updateWorkContext(db, scope, input) {
|
|
|
63
75
|
result = { activityId, revision: old?.revision ?? 0, outcome: "conflict" };
|
|
64
76
|
return { action: "no_op", reason: "revision conflict" };
|
|
65
77
|
}
|
|
66
|
-
if (!old && !input.patch.goal) throw new Error("goal required");
|
|
67
78
|
const status = input.patch.status ?? old?.status ?? "active";
|
|
68
79
|
const dialogIds = [.../* @__PURE__ */ new Set([...old?.dialogIds ?? [], scope.dialogId])];
|
|
69
80
|
if (dialogIds.length > 100) throw new Error("dialog association limit exceeded");
|
|
@@ -102,7 +113,9 @@ async function readWorkContexts(db, scope, query = {}) {
|
|
|
102
113
|
}
|
|
103
114
|
|
|
104
115
|
export {
|
|
116
|
+
isClosedWorkStatus,
|
|
105
117
|
isWorkContextState,
|
|
118
|
+
validateWorkContextGoal,
|
|
106
119
|
updateWorkContext,
|
|
107
120
|
readWorkContexts
|
|
108
121
|
};
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CAPABILITY_PACKS,
|
|
3
|
+
expandEnabledPacks
|
|
4
|
+
} from "./chunk-J42X32PV.js";
|
|
5
|
+
import {
|
|
6
|
+
isRecord
|
|
7
|
+
} from "./chunk-KUG52IAP.js";
|
|
8
|
+
|
|
9
|
+
// packages/agent-runtime/promptCacheKey.ts
|
|
10
|
+
function collectStablePromptPrefix(messages, fallbackPrompt) {
|
|
11
|
+
const systemTexts = [];
|
|
12
|
+
if (fallbackPrompt?.trim()) systemTexts.push(fallbackPrompt.trim());
|
|
13
|
+
for (const raw of messages) {
|
|
14
|
+
if (!raw || typeof raw !== "object") continue;
|
|
15
|
+
const message = raw;
|
|
16
|
+
const role = String(message.role ?? "");
|
|
17
|
+
if (role !== "system" && role !== "developer") continue;
|
|
18
|
+
if (typeof message.content === "string") {
|
|
19
|
+
const boundary = Number(message.stable_prefix_chars);
|
|
20
|
+
const text = Number.isFinite(boundary) && boundary > 0 ? message.content.slice(0, boundary) : message.content;
|
|
21
|
+
if (text.trim()) systemTexts.push(text.trim());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return systemTexts.join("\n\n");
|
|
25
|
+
}
|
|
26
|
+
function stablePromptCacheKey(parts, namespace) {
|
|
27
|
+
const value = JSON.stringify(parts);
|
|
28
|
+
let hash = 2166136261;
|
|
29
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
30
|
+
hash ^= value.charCodeAt(index);
|
|
31
|
+
hash = Math.imul(hash, 16777619) >>> 0;
|
|
32
|
+
}
|
|
33
|
+
return `${namespace}-${hash.toString(16).padStart(8, "0")}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// packages/agent-runtime/toolDiscovery.ts
|
|
37
|
+
var TOOL_DISCOVERY_CALL_NAME = "__nolo_tool_discovery";
|
|
38
|
+
var TOOL_DISCOVERY_ID_PREFIX = "nolo_discovery:";
|
|
39
|
+
function mcpDiscoveryEntry(tool) {
|
|
40
|
+
return {
|
|
41
|
+
name: JSON.stringify([tool.connectionId, tool.toolName]),
|
|
42
|
+
description: tool.description,
|
|
43
|
+
searchName: tool.toolName,
|
|
44
|
+
keywords: tool.keywords,
|
|
45
|
+
category: "mcp",
|
|
46
|
+
source: "mcp",
|
|
47
|
+
connectionId: tool.connectionId,
|
|
48
|
+
schemaVersion: tool.schemaVersion,
|
|
49
|
+
mcp: tool
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function toolDiscoveryReference(tool) {
|
|
53
|
+
return { name: tool.name, version: tool.schemaVersion ?? stablePromptCacheKey([tool], "schema") };
|
|
54
|
+
}
|
|
55
|
+
function keywords(value) {
|
|
56
|
+
return value.replace(/([a-z\d])([A-Z])/g, "$1 $2").toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [];
|
|
57
|
+
}
|
|
58
|
+
function discoverTools(catalog, query, unavailable = /* @__PURE__ */ new Set()) {
|
|
59
|
+
const terms = [...new Set(keywords(query))];
|
|
60
|
+
if (terms.length === 0) return [];
|
|
61
|
+
const exact = terms.join(" ");
|
|
62
|
+
return catalog.filter((tool) => !unavailable.has(tool.name)).map((tool) => {
|
|
63
|
+
const name = keywords(tool.searchName ?? tool.name);
|
|
64
|
+
const packs = CAPABILITY_PACKS.filter((pack) => pack.tools.includes(tool.name));
|
|
65
|
+
const tags = new Set(keywords([
|
|
66
|
+
tool.category,
|
|
67
|
+
tool.capabilityPackId,
|
|
68
|
+
...tool.keywords ?? [],
|
|
69
|
+
...packs.flatMap(({ id, description: description2 }) => [id, description2])
|
|
70
|
+
].filter(Boolean).join(" ")));
|
|
71
|
+
const description = new Set(keywords(tool.description ?? ""));
|
|
72
|
+
const score = name.join(" ") === exact ? 1e3 : terms.reduce((total, term) => total + (name.includes(term) ? 8 : tags.has(term) ? 4 : description.has(term) ? 1 : 0), 0);
|
|
73
|
+
return { tool, score };
|
|
74
|
+
}).filter(({ score }) => score > 0).sort((left, right) => right.score - left.score).slice(0, 5).map(({ tool }) => tool);
|
|
75
|
+
}
|
|
76
|
+
function resolveNativeToolDiscoveryProtocol(route) {
|
|
77
|
+
if (!route.optInFlag) return;
|
|
78
|
+
if (route.provider === "deepseek" && route.model === "deepseek-flash" && route.apiFormat === "responses" && route.endpoint === "https://api.deepseek.com/responses") return "deepseek-client";
|
|
79
|
+
if (route.provider === "openai" && route.apiFormat === "responses" && route.endpoint === "https://api.openai.com/v1/responses" && /^gpt-(?:5\.[4-9]|6(?:\.\d+)?)(?:-[a-z0-9]+)*$/.test(route.model)) {
|
|
80
|
+
return route.openAiSearchMode === "hosted" ? "openai-hosted" : "openai-client";
|
|
81
|
+
}
|
|
82
|
+
if (route.provider === "anthropic" && route.apiFormat === "anthropic-messages" && route.endpoint === "https://api.anthropic.com/v1/messages" && /^(?:claude-(?:opus-4-[5-8]|sonnet-4-[56]|haiku-4-5)(?:-\d{8})?|claude-(?:opus-5(?:-5)?|sonnet-5(?:-5)?|haiku-5-5|fable-5(?:-[12])?|mythos-(?:5(?:-[12])?|preview)))$/.test(route.model)) return "anthropic-hosted";
|
|
83
|
+
}
|
|
84
|
+
function readToolLoadingReferences(content) {
|
|
85
|
+
let value = content;
|
|
86
|
+
if (typeof content === "string") {
|
|
87
|
+
try {
|
|
88
|
+
value = JSON.parse(content);
|
|
89
|
+
} catch {
|
|
90
|
+
value = void 0;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const refs = (items) => Array.isArray(items) ? items.filter((ref) => isRecord(ref) && typeof ref.name === "string" && typeof ref.version === "string").map(({ name, version }) => ({ name, version })) : [];
|
|
94
|
+
return isRecord(value) ? { loaded: refs(value.loaded), packs: refs(value.packs) } : { loaded: [] };
|
|
95
|
+
}
|
|
96
|
+
function createToolLoadingState(authorized) {
|
|
97
|
+
const catalog = /* @__PURE__ */ new Map();
|
|
98
|
+
const ambiguous = /* @__PURE__ */ new Set();
|
|
99
|
+
for (const tool of authorized) {
|
|
100
|
+
if (catalog.delete(tool.name)) ambiguous.add(tool.name);
|
|
101
|
+
if (!ambiguous.has(tool.name)) catalog.set(tool.name, tool);
|
|
102
|
+
}
|
|
103
|
+
const loadedInContext = /* @__PURE__ */ new Set();
|
|
104
|
+
const loadedPacks = /* @__PURE__ */ new Set();
|
|
105
|
+
function executable(ref) {
|
|
106
|
+
const current = catalog.get(ref.name);
|
|
107
|
+
return current && toolDiscoveryReference(current).version === ref.version ? current : void 0;
|
|
108
|
+
}
|
|
109
|
+
function pack(id) {
|
|
110
|
+
const entry = CAPABILITY_PACKS.find((candidate) => candidate.id === id);
|
|
111
|
+
if (!entry) return void 0;
|
|
112
|
+
const names = new Set(expandEnabledPacks([id]));
|
|
113
|
+
const tools = [...catalog.values()].filter((tool) => names.has(tool.name));
|
|
114
|
+
if (!tools.length) return void 0;
|
|
115
|
+
const loaded = tools.map(toolDiscoveryReference);
|
|
116
|
+
const ref = { name: id, version: stablePromptCacheKey([entry.description, [...loaded].sort((a, b) => a.name.localeCompare(b.name))], "pack") };
|
|
117
|
+
return { ref, loaded, guidance: `${id}: ${entry.description} Use loadSkill for matching task guidance when available.` };
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
authorized: catalog,
|
|
121
|
+
loadedInContext,
|
|
122
|
+
executable,
|
|
123
|
+
search(query, unavailable) {
|
|
124
|
+
return discoverTools([...catalog.values()], query, unavailable);
|
|
125
|
+
},
|
|
126
|
+
activatePack(id) {
|
|
127
|
+
const selected = pack(id);
|
|
128
|
+
return selected ? { loaded: selected.loaded, packs: [selected.ref] } : { loaded: [] };
|
|
129
|
+
},
|
|
130
|
+
restore(refs, eager = /* @__PURE__ */ new Set()) {
|
|
131
|
+
const tools = [];
|
|
132
|
+
const guidance = [];
|
|
133
|
+
for (const ref of refs.loaded) {
|
|
134
|
+
const tool = executable(ref);
|
|
135
|
+
if (!tool || loadedInContext.has(ref.name) || eager.has(ref.name)) continue;
|
|
136
|
+
loadedInContext.add(ref.name);
|
|
137
|
+
tools.push(tool);
|
|
138
|
+
}
|
|
139
|
+
for (const ref of refs.packs ?? []) {
|
|
140
|
+
if (loadedPacks.has(ref.name)) continue;
|
|
141
|
+
const selected = pack(ref.name);
|
|
142
|
+
if (selected?.ref.version !== ref.version) continue;
|
|
143
|
+
if (!selected.loaded.every((tool) => loadedInContext.has(tool.name) || eager.has(tool.name))) continue;
|
|
144
|
+
loadedPacks.add(ref.name);
|
|
145
|
+
guidance.push(selected.guidance);
|
|
146
|
+
}
|
|
147
|
+
return { tools, guidance };
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
function collectToolLoadingReferences(history) {
|
|
152
|
+
const loaded = /* @__PURE__ */ new Map();
|
|
153
|
+
const packs = /* @__PURE__ */ new Map();
|
|
154
|
+
let paired = /* @__PURE__ */ new Set();
|
|
155
|
+
for (const message of history) {
|
|
156
|
+
if (message.role !== "tool") {
|
|
157
|
+
paired = new Set(message.tool_calls?.filter(isToolDiscoveryCall).map(({ id }) => id));
|
|
158
|
+
} else if (message.tool_call_id && paired.delete(message.tool_call_id)) {
|
|
159
|
+
const refs = readToolLoadingReferences(message.content);
|
|
160
|
+
for (const ref of refs.loaded) loaded.set(ref.name, ref);
|
|
161
|
+
for (const ref of refs.packs ?? []) packs.set(ref.name, ref);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return { loaded: [...loaded.values()], ...packs.size ? { packs: [...packs.values()] } : {} };
|
|
165
|
+
}
|
|
166
|
+
function projectStaticToolDiscoveryBody(body) {
|
|
167
|
+
const isNativeSearch = (item) => item?.type === "tool_search_call" || item?.type === "tool_search_output" || item?.type === "tool_reference";
|
|
168
|
+
let projected = body;
|
|
169
|
+
if (Array.isArray(body.input)) {
|
|
170
|
+
const bridgeIds = new Set(body.input.filter((item) => item?.type === "function_call" && item.name === TOOL_DISCOVERY_CALL_NAME).map((item) => item.call_id));
|
|
171
|
+
const input = body.input.filter((item) => !isNativeSearch(item) && !((item?.type === "function_call" || item?.type === "function_call_output") && bridgeIds.has(item.call_id)));
|
|
172
|
+
if (input.length !== body.input.length) projected = { ...projected, input };
|
|
173
|
+
}
|
|
174
|
+
if (Array.isArray(body.messages)) {
|
|
175
|
+
const messages = filterToolDiscoveryHistory(body.messages);
|
|
176
|
+
if (messages !== body.messages) projected = { ...projected, messages };
|
|
177
|
+
}
|
|
178
|
+
if (Array.isArray(body.tools)) {
|
|
179
|
+
const tools = body.tools.filter((tool) => tool?.type !== "tool_search" && !/^tool_search_tool_/.test(tool?.type ?? "") && (tool?.function?.name ?? tool?.name) !== TOOL_DISCOVERY_CALL_NAME);
|
|
180
|
+
if (tools.length !== body.tools.length) projected = { ...projected, tools };
|
|
181
|
+
}
|
|
182
|
+
const choice = body.tool_choice;
|
|
183
|
+
if (choice?.type === "tool_search" || (choice?.function?.name ?? choice?.name) === TOOL_DISCOVERY_CALL_NAME) {
|
|
184
|
+
projected = { ...projected, tool_choice: void 0 };
|
|
185
|
+
}
|
|
186
|
+
return projected;
|
|
187
|
+
}
|
|
188
|
+
function isToolDiscoveryCall(call) {
|
|
189
|
+
return call?.function?.name === TOOL_DISCOVERY_CALL_NAME;
|
|
190
|
+
}
|
|
191
|
+
function splitHostedToolDiscovery(calls, results) {
|
|
192
|
+
if (!results.length || calls.some((call) => !isToolDiscoveryCall(call))) return { calls, results };
|
|
193
|
+
const contentById = new Map(results.map(({ callId, content }) => [callId, content]));
|
|
194
|
+
const completed = calls.map((call) => {
|
|
195
|
+
const content = contentById.get(call.id);
|
|
196
|
+
if (content === void 0) throw new Error("Hosted tool discovery is missing its result.");
|
|
197
|
+
return { call, content };
|
|
198
|
+
});
|
|
199
|
+
return { calls: [], results: [], completed };
|
|
200
|
+
}
|
|
201
|
+
function filterToolDiscoveryHistory(messages, retainPaired = false) {
|
|
202
|
+
let changed = false;
|
|
203
|
+
const output = [];
|
|
204
|
+
let paired = /* @__PURE__ */ new Set();
|
|
205
|
+
let ordinaryPrefixedCalls = /* @__PURE__ */ new Set();
|
|
206
|
+
for (const [index, message] of messages.entries()) {
|
|
207
|
+
if (message.role === "tool") {
|
|
208
|
+
const id = message.tool_call_id;
|
|
209
|
+
if (typeof id === "string" && id.startsWith(TOOL_DISCOVERY_ID_PREFIX) && !paired.delete(id) && !ordinaryPrefixedCalls.has(id)) {
|
|
210
|
+
changed = true;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
paired = /* @__PURE__ */ new Set();
|
|
215
|
+
ordinaryPrefixedCalls = /* @__PURE__ */ new Set();
|
|
216
|
+
const calls = message.role === "assistant" && Array.isArray(message.tool_calls) ? message.tool_calls : [];
|
|
217
|
+
for (const call of calls) {
|
|
218
|
+
if (typeof call?.id === "string" && call.id.startsWith(TOOL_DISCOVERY_ID_PREFIX) && !isToolDiscoveryCall(call)) ordinaryPrefixedCalls.add(call.id);
|
|
219
|
+
}
|
|
220
|
+
if (calls.some(isToolDiscoveryCall)) {
|
|
221
|
+
if (retainPaired) {
|
|
222
|
+
const counts = /* @__PURE__ */ new Map();
|
|
223
|
+
for (const call of calls) {
|
|
224
|
+
if (typeof call?.id === "string") counts.set(call.id, (counts.get(call.id) ?? 0) + 1);
|
|
225
|
+
}
|
|
226
|
+
for (let next = index + 1; messages[next]?.role === "tool"; next++) {
|
|
227
|
+
const id = messages[next]?.tool_call_id;
|
|
228
|
+
if (typeof id === "string" && id.startsWith(TOOL_DISCOVERY_ID_PREFIX) && counts.get(id) === 1) paired.add(id);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
const remaining = calls.filter((call) => !isToolDiscoveryCall(call) || paired.has(call.id));
|
|
232
|
+
if (remaining.length !== calls.length) {
|
|
233
|
+
changed = true;
|
|
234
|
+
const { tool_calls, ...rest } = message;
|
|
235
|
+
if (remaining.length) output.push({ ...rest, tool_calls: remaining });
|
|
236
|
+
else if (message.content) output.push(rest);
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
output.push(message);
|
|
242
|
+
}
|
|
243
|
+
return changed ? output : messages;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export {
|
|
247
|
+
collectStablePromptPrefix,
|
|
248
|
+
stablePromptCacheKey,
|
|
249
|
+
TOOL_DISCOVERY_CALL_NAME,
|
|
250
|
+
TOOL_DISCOVERY_ID_PREFIX,
|
|
251
|
+
mcpDiscoveryEntry,
|
|
252
|
+
toolDiscoveryReference,
|
|
253
|
+
resolveNativeToolDiscoveryProtocol,
|
|
254
|
+
readToolLoadingReferences,
|
|
255
|
+
createToolLoadingState,
|
|
256
|
+
collectToolLoadingReferences,
|
|
257
|
+
projectStaticToolDiscoveryBody,
|
|
258
|
+
isToolDiscoveryCall,
|
|
259
|
+
splitHostedToolDiscovery,
|
|
260
|
+
filterToolDiscoveryHistory
|
|
261
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// packages/ai/agent/dispatchIntent.ts
|
|
2
|
+
var DISPATCH_INTENT_PATTERN = /(派发|派单|派个|派一|派两|派几|派人|子任务|子\s*[aA]gent|多\s*[aA]gent|多个\s*[aA]gent|并行处理|并行派发|并发派发|并行执行|并发执行|分头|会商|独立\s*review|派.{0,4}review|dispatch|delegat|sub[\s-]?agent|sub[\s-]?task|fan[\s-]?out|orchestrat|in parallel|paralleliz|background run)/i;
|
|
3
|
+
var MULTI_EXECUTOR_PATTERN = /(?:(?:两|二|三|四|五|六|七|八|九|十|几|多|数|若干|(?<![0-9])(?:[2-9]|[1-9][0-9]+))\s*(?:个|位|名)\s*(?:助手|agent|assistant|worker|reviewer|专家|子\s*agent)|(?:two|three|four|five|six|several|multiple|these|those|the following|(?<![0-9])(?:[2-9]|[1-9][0-9]+))\s+(?:agents?|assistants?|helpers?|reviewers?|workers?|tasks?|sub-?agents?|sub-?tasks?))/i;
|
|
4
|
+
var COLLAB_ACTION_PATTERN = /(?:分工|同时处理|同时做|同时推进|同时进行|并行|并发|分别|各自|协作|协同|代码审查|审查|review|concurrently|simultaneously|separately|respectively|in parallel)/i;
|
|
5
|
+
var DISPATCH_TOOL_NAMES = /* @__PURE__ */ new Set(["startAgentRun", "controlAgentRun"]);
|
|
6
|
+
var ROUND_BUDGET_WARNING_PREFIX = "[\u7CFB\u7EDF\u63D0\u793A] \u5F53\u524D\u5355\u6B21\u4EFB\u52A1\u7684\u8FDE\u7EED\u5DE5\u5177\u8C03\u7528\u5DF2\u8FBE";
|
|
7
|
+
var OFFLOAD_NUDGE_PREFIX = "[\u7CFB\u7EDF\u63D0\u793A\xB7\u5206\u5DE5\u62A4\u680F]";
|
|
8
|
+
var SUBTASK_SOFT_BUDGET_NOTICE_PREFIXES = [
|
|
9
|
+
"[\u7CFB\u7EDF\u63D0\u793A \xB7 \u5B50\u4EFB\u52A1\u8F6F\u9884\u7B97\u63D0\u9192]",
|
|
10
|
+
"[\u7CFB\u7EDF\u63D0\u793A \xB7 \u5B50\u4EFB\u52A1\u5F3A\u6536\u655B\u63D0\u9192]"
|
|
11
|
+
];
|
|
12
|
+
var INTERNAL_NOTICE_PREFIXES = [
|
|
13
|
+
ROUND_BUDGET_WARNING_PREFIX,
|
|
14
|
+
OFFLOAD_NUDGE_PREFIX,
|
|
15
|
+
...SUBTASK_SOFT_BUDGET_NOTICE_PREFIXES
|
|
16
|
+
];
|
|
17
|
+
function isInternalNoticeText(text) {
|
|
18
|
+
if (typeof text !== "string") return false;
|
|
19
|
+
const trimmed = text.trimStart();
|
|
20
|
+
return INTERNAL_NOTICE_PREFIXES.some((prefix) => trimmed.startsWith(prefix));
|
|
21
|
+
}
|
|
22
|
+
function detectDispatchIntent(text) {
|
|
23
|
+
if (typeof text !== "string" || !text.trim()) return false;
|
|
24
|
+
const intentText = text.replace(
|
|
25
|
+
/(^|[,,。.!!??;;::\n])\s*(?:请\s*)?(?:不要|别|禁止|无需|不需要)\s*(?:(?:并行|并发)?派发|派单|派给\s*(?:助手|agent))(?=\s*(?:[,,。.!!??;;::\n]|$))/gi,
|
|
26
|
+
"$1"
|
|
27
|
+
);
|
|
28
|
+
if (DISPATCH_INTENT_PATTERN.test(intentText)) return true;
|
|
29
|
+
if (/(^|[,,。.!!??;;::\n])\s*(?:(?:现在|改完后)\s*)?(?:请\s*)?派给\s*(?:助手|agent\b)/i.test(intentText)) return true;
|
|
30
|
+
return MULTI_EXECUTOR_PATTERN.test(intentText) && COLLAB_ACTION_PATTERN.test(intentText);
|
|
31
|
+
}
|
|
32
|
+
function isInternalNoticeMessage(msg) {
|
|
33
|
+
if (!msg) return false;
|
|
34
|
+
if (msg.internalNotice === true) return true;
|
|
35
|
+
return isInternalNoticeText(messageText(msg.content));
|
|
36
|
+
}
|
|
37
|
+
function messageText(content) {
|
|
38
|
+
if (typeof content === "string") return content;
|
|
39
|
+
if (Array.isArray(content)) {
|
|
40
|
+
return content.map((part) => typeof part?.text === "string" ? part.text : "").join("\n");
|
|
41
|
+
}
|
|
42
|
+
return "";
|
|
43
|
+
}
|
|
44
|
+
function toolCallName(call) {
|
|
45
|
+
const nested = call?.function?.name;
|
|
46
|
+
if (typeof nested === "string" && nested) return nested;
|
|
47
|
+
const flat = call?.name;
|
|
48
|
+
if (typeof flat === "string" && flat) return flat;
|
|
49
|
+
return "";
|
|
50
|
+
}
|
|
51
|
+
function hasDispatchToolCall(msg) {
|
|
52
|
+
const calls = Array.isArray(msg.tool_calls) ? msg.tool_calls : Array.isArray(msg.toolCalls) ? msg.toolCalls : [];
|
|
53
|
+
if (calls.some((call) => DISPATCH_TOOL_NAMES.has(toolCallName(call)))) {
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
for (const field of [msg.toolName, msg.name]) {
|
|
57
|
+
if (typeof field === "string" && DISPATCH_TOOL_NAMES.has(field)) return true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
function detectDispatchIntentFromMessages(messages) {
|
|
62
|
+
if (!Array.isArray(messages)) return false;
|
|
63
|
+
for (const msg of messages) {
|
|
64
|
+
if (!msg) continue;
|
|
65
|
+
const text = messageText(msg.content);
|
|
66
|
+
if (!isInternalNoticeMessage(msg)) {
|
|
67
|
+
if (msg.role === "user" && detectDispatchIntent(text)) return true;
|
|
68
|
+
}
|
|
69
|
+
if (hasDispatchToolCall(msg)) return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
ROUND_BUDGET_WARNING_PREFIX,
|
|
76
|
+
OFFLOAD_NUDGE_PREFIX,
|
|
77
|
+
SUBTASK_SOFT_BUDGET_NOTICE_PREFIXES,
|
|
78
|
+
isInternalNoticeText,
|
|
79
|
+
detectDispatchIntent,
|
|
80
|
+
isInternalNoticeMessage,
|
|
81
|
+
detectDispatchIntentFromMessages
|
|
82
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveNoloHome
|
|
3
3
|
} from "./chunk-GLKOYSRU.js";
|
|
4
|
+
import {
|
|
5
|
+
toErrorMessage
|
|
6
|
+
} from "./chunk-HNMXYYJR.js";
|
|
4
7
|
import {
|
|
5
8
|
isSupportedDialogId,
|
|
6
9
|
splitDialogKeyIdentity
|
|
7
10
|
} from "./chunk-YZMNK53S.js";
|
|
8
11
|
import {
|
|
9
12
|
resolveLocalUserId
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
toErrorMessage
|
|
13
|
-
} from "./chunk-HNMXYYJR.js";
|
|
13
|
+
} from "./chunk-6KUTNAPU.js";
|
|
14
14
|
|
|
15
15
|
// packages/cli/dialogNotifyCommand.ts
|
|
16
16
|
import { lstatSync as lstatSync2, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
} from "./chunk-BR3GT6MR.js";
|
|
5
5
|
import {
|
|
6
6
|
resolveRuntimeToolSurfaceForAgent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FOC4TORM.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveRuntimeAuthToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-UB7NV7NN.js";
|
|
11
11
|
import {
|
|
12
12
|
isSystemBuiltinTrustedAgentKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YRPIUIEQ.js";
|
|
14
14
|
import {
|
|
15
15
|
parseUserIdFromAuthToken
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-JUNYPVL6.js";
|
|
17
17
|
import {
|
|
18
18
|
asOptionalTrimmedString
|
|
19
19
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -60,15 +60,6 @@ function withResolvedRuntimeToolSurface(agentConfig, env) {
|
|
|
60
60
|
prompt: agentConfig.prompt
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
function extractLastUserText(messages) {
|
|
64
|
-
const lastUser = [...messages].reverse().find((m) => m.role === "user");
|
|
65
|
-
if (!lastUser) return "";
|
|
66
|
-
if (typeof lastUser.content === "string") return lastUser.content;
|
|
67
|
-
if (Array.isArray(lastUser.content)) {
|
|
68
|
-
return lastUser.content.filter((part) => part?.type === "text").map((part) => part.text ?? "").join(" ");
|
|
69
|
-
}
|
|
70
|
-
return "";
|
|
71
|
-
}
|
|
72
63
|
function localTurnHasSubjectRefs(input) {
|
|
73
64
|
return Array.isArray(input.runtimeContext?.subjectRefs) && input.runtimeContext.subjectRefs.length > 0;
|
|
74
65
|
}
|
|
@@ -79,6 +70,5 @@ export {
|
|
|
79
70
|
isBuiltinNoloAgentRef,
|
|
80
71
|
isBuiltinNoloAgentConfig,
|
|
81
72
|
withResolvedRuntimeToolSurface,
|
|
82
|
-
extractLastUserText,
|
|
83
73
|
localTurnHasSubjectRefs
|
|
84
74
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectCurrentServer,
|
|
3
3
|
selectRemoteServers
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FKVLQNGJ.js";
|
|
5
5
|
import {
|
|
6
6
|
noloDeleteRequest,
|
|
7
7
|
noloWriteRequest
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
normalizeTimeFields
|
|
11
|
-
} from "./chunk-HDKMVYNJ.js";
|
|
8
|
+
} from "./chunk-AMTF6FJD.js";
|
|
12
9
|
import {
|
|
13
10
|
selectIdentityUser,
|
|
14
11
|
selectIdentityUserId
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YM5XULB2.js";
|
|
13
|
+
import {
|
|
14
|
+
normalizeTimeFields
|
|
15
|
+
} from "./chunk-I3NWAILT.js";
|
|
16
16
|
import {
|
|
17
17
|
createUserKey,
|
|
18
18
|
extractAgentInfo,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
sanitizeShareData,
|
|
22
22
|
shareKey,
|
|
23
23
|
toNonEmptyString
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-DLXL4NSL.js";
|
|
25
25
|
|
|
26
26
|
// packages/share/action.ts
|
|
27
27
|
var generateToken = () => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Base64
|
|
3
|
+
} from "./chunk-IV6VUVLJ.js";
|
|
4
|
+
|
|
5
|
+
// packages/core/crypto.ts
|
|
6
|
+
import nacl from "tweetnacl";
|
|
7
|
+
|
|
8
|
+
// packages/core/authToken.ts
|
|
9
|
+
var parseToken = (token) => {
|
|
10
|
+
try {
|
|
11
|
+
const [payloadBase64] = token.split(".");
|
|
12
|
+
return JSON.parse(Base64.decode(payloadBase64));
|
|
13
|
+
} catch {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
function parseAuthTokenPayloads(token) {
|
|
18
|
+
const trimmed = token.trim();
|
|
19
|
+
if (!trimmed) return [];
|
|
20
|
+
const rawParts = trimmed.split(".");
|
|
21
|
+
const candidates = rawParts.length >= 3 ? [rawParts[1], rawParts[0]] : [rawParts[0]];
|
|
22
|
+
const out = [];
|
|
23
|
+
for (const part of candidates) {
|
|
24
|
+
if (!part) continue;
|
|
25
|
+
try {
|
|
26
|
+
const parsed = JSON.parse(Base64.decode(part));
|
|
27
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
28
|
+
out.push(parsed);
|
|
29
|
+
}
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
function parseAuthTokenUserId(token, options) {
|
|
36
|
+
for (const payload of parseAuthTokenPayloads(token)) {
|
|
37
|
+
if (typeof payload.userId === "string" && payload.userId.trim()) {
|
|
38
|
+
return payload.userId.trim();
|
|
39
|
+
}
|
|
40
|
+
if (options?.allowSub && typeof payload.sub === "string" && payload.sub.trim()) {
|
|
41
|
+
return payload.sub.trim();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
parseToken,
|
|
49
|
+
parseAuthTokenPayloads,
|
|
50
|
+
parseAuthTokenUserId
|
|
51
|
+
};
|