nolo-cli 0.228.0-alpha.1 → 0.228.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/README.md +3 -5
- package/{_executeModel-WZKT6XEU.js → _executeModel-GIFVXKDT.js} +89 -82
- package/{accountResolver-QETKNC7T.js → accountResolver-NGICIMEE.js} +1 -1
- package/{action-GDZDXPMB.js → action-WZTKEF5H.js} +9 -6
- package/{addContentAction-7RO4AMRI.js → addContentAction-MLI6GOBV.js} +14 -13
- package/{addDialogAgentAction-EVYBGTXB.js → addDialogAgentAction-ARGQM22H.js} +17 -16
- package/{agentDeleteCommand-PZWRHNXY.js → agentDeleteCommand-UF7XVELS.js} +120 -111
- package/{agentEmailCommands-QTKMEICX.js → agentEmailCommands-SFHRPQYC.js} +120 -107
- package/agentListCommands-IXKBP3W5.js +644 -0
- package/{agentMachineCommands-7QGICJLM.js → agentMachineCommands-7NX6PWQ6.js} +56 -48
- package/{agentProviderCommands-STI3DQ6A.js → agentProviderCommands-C5T7C5KZ.js} +2 -2
- package/{agentPullCommand-KHV4EELF.js → agentPullCommand-4EQZYHU4.js} +1 -1
- package/agentRecordCommands-IUNX6XD6.js +188 -0
- package/{agentRunCommand-OFQLOF5Y.js → agentRunCommand-LCR4XADM.js} +127 -111
- package/{agentRunControl-MBG4U6SL.js → agentRunControl-RN2P6AOD.js} +11 -9
- package/{agentRuntimeLocal-TU4LA353.js → agentRuntimeLocal-LVXPQ7QA.js} +57 -43
- package/{agentSlice-L4SBGWTB.js → agentSlice-ZGMOH6TE.js} +15 -14
- package/{appDeleteCommands-JWP3XPUA.js → appDeleteCommands-BESCJOQM.js} +56 -48
- package/{appDeployCommands-6E4TQCWI.js → appDeployCommands-LPTR6IOX.js} +56 -48
- package/{appDeployStatusCommands-ALU4SADG.js → appDeployStatusCommands-BZ7KZ5RD.js} +56 -48
- package/{appGetCommands-JEY4L6L4.js → appGetCommands-EDWGJV4S.js} +56 -48
- package/{appListCommands-PCAVHU7M.js → appListCommands-OPRWYPM6.js} +56 -48
- package/{authCommand-CGRIIOOV.js → authCommand-3C3RN4OU.js} +25 -19
- package/{authCommands-55OGQGCR.js → authCommands-ZMVEDCQD.js} +12 -6
- package/{builtinSkillRegistry-BAE2LDXF.js → builtinSkillRegistry-VRCMQ77Q.js} +7 -7
- package/{chromeCommands-G5UDKVSV.js → chromeCommands-O4IIKTBD.js} +384 -7
- package/{chromeOpsCommands-WAA45NCS.js → chromeOpsCommands-NZITLHWO.js} +3 -3
- package/{chunk-AUAJTAFM.js → chunk-2BKNICGK.js} +4 -4
- package/{chunk-QYB23WUH.js → chunk-2FK2KZSL.js} +1 -1
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-H6L2NFHY.js → chunk-3DJJ4CFG.js} +11 -11
- package/{chunk-TSPMLCWI.js → chunk-4IQN6FWY.js} +5 -5
- package/{chunk-GUXZK7SE.js → chunk-4OXPN3WC.js} +17 -6
- package/chunk-4ZCTKB27.js +31 -0
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-3P54D2E4.js → chunk-5HUO7SEX.js} +9 -107
- package/chunk-6ASGEP5D.js +21 -0
- package/{chunk-DDC6P6EH.js → chunk-6CXQ3YNJ.js} +68 -40
- package/{chunk-G7IUT2V3.js → chunk-6MTVACLN.js} +365 -64
- package/{chunk-ZOHO6MOF.js → chunk-6RSNVJGO.js} +2 -99
- package/{chunk-XSW4EXQV.js → chunk-6TVYUQRM.js} +55 -18
- package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-7Z6EW7AH.js → chunk-6XVPMGXK.js} +97 -11
- package/{chunk-ALAES342.js → chunk-73PZD7JZ.js} +9 -5
- package/{chunk-2MCB7CD7.js → chunk-7UVVLYKC.js} +9 -9
- package/{chunk-S6FDXXZV.js → chunk-ADOOL3PG.js} +2 -2
- package/{chunk-OWKNSIXL.js → chunk-AEZBAFC6.js} +334 -77
- package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
- package/{chunk-RG2DGNL6.js → chunk-ARFCL53U.js} +5 -5
- package/{chunk-SRCCSTIM.js → chunk-AS6L5KSD.js} +4 -4
- package/{chunk-GPOV42YM.js → chunk-BAH3BAUZ.js} +8 -8
- package/{chunk-N5Z2V73W.js → chunk-BFKJ2RS3.js} +1 -1
- package/{chunk-F6Z6ZCUV.js → chunk-BVEDT6DM.js} +3 -3
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-CD3RU7XL.js → chunk-CD2DK5JA.js} +120 -14
- package/{chunk-BP5ZJ6B4.js → chunk-CD64YXRB.js} +1 -1
- package/{chunk-VP3BINY7.js → chunk-CIGCTSBF.js} +31 -1
- package/{chunk-D6YNCNM6.js → chunk-CIUZXD5D.js} +12 -12
- package/{chunk-EVGU5P4U.js → chunk-CO6E7YK6.js} +1 -1
- package/{chunk-VMJVAJ6W.js → chunk-CTIEJRTP.js} +28 -4
- package/{chunk-7JGMNKKG.js → chunk-CTWCZKNS.js} +29 -8
- package/{chunk-YFLVRVYK.js → chunk-D25ONVOH.js} +1 -1
- package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
- package/{chunk-262R3XNN.js → chunk-E5RYFR7E.js} +334 -103
- package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
- package/{chunk-HSSBDZLD.js → chunk-EDT65EUE.js} +6 -6
- package/{chunk-IAAIUH64.js → chunk-EQZQUQ33.js} +7 -7
- package/{chunk-HBRDSQ3M.js → chunk-ESN4WNWU.js} +3 -2
- package/{chunk-2YGBI2XB.js → chunk-FE7G6DSP.js} +11 -1
- package/{chunk-547ENH5T.js → chunk-FFFKAOJN.js} +4 -4
- package/{chunk-5ZUOVCKT.js → chunk-FGHEF6WI.js} +3 -1
- package/{chunk-IXG6YXQM.js → chunk-FTWAOKFU.js} +795 -361
- package/chunk-GAHJLSDO.js +107 -0
- package/{chunk-2X7WFDT6.js → chunk-GX6DITLQ.js} +1 -1
- package/{chunk-GYS5FUYR.js → chunk-HCCQEMTK.js} +28 -28
- package/{chunk-CMMI3DAT.js → chunk-HZDK56EK.js} +33 -26
- package/{chunk-UE2EVEYS.js → chunk-IIOSZAJX.js} +4 -4
- package/chunk-IIRJ4P4I.js +24 -0
- package/{chunk-QCB42576.js → chunk-IJZC2KIJ.js} +1 -1
- package/{chunk-RYOLWYBK.js → chunk-ITBX27W6.js} +97 -21
- package/{chunk-VSYTM22R.js → chunk-J2VIGDJN.js} +6 -6
- package/{chunk-QBZCGP34.js → chunk-JEWMQR6J.js} +1 -1
- package/{chunk-6QHKRARD.js → chunk-JFRJEPFI.js} +29 -5
- package/{chunk-S6K5F3KP.js → chunk-JP2BH4NC.js} +1 -1
- package/{chunk-MDZWUD3R.js → chunk-JU7VN4LF.js} +38 -29
- package/{chunk-RTHFJZ6M.js → chunk-K26XPZRB.js} +2 -2
- package/{chunk-ZYKJBRZ3.js → chunk-K7VIXYTZ.js} +1 -3
- package/chunk-KK3FCYZM.js +647 -0
- package/chunk-KLAMJNKQ.js +33394 -0
- package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
- package/chunk-KXOPLLFP.js +190 -0
- package/{chunk-GOCSSER3.js → chunk-KZ5OD2MO.js} +4 -4
- package/{chunk-ILHQ2AXT.js → chunk-KZAT2M2V.js} +14 -8
- package/chunk-LHCGKAFO.js +739 -0
- package/{chunk-XJPLSAPJ.js → chunk-LMGFVH65.js} +107 -104
- package/{chunk-QRGDJA4B.js → chunk-LTVEOOZL.js} +19 -6
- package/{chunk-L32W3PRP.js → chunk-MAA42MMV.js} +233 -17
- package/{chunk-ATEKLSLR.js → chunk-MTM4LRVG.js} +14 -9
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-2NPD3FTX.js → chunk-MYYNZG2M.js} +139 -39
- package/{chunk-DBUR22G5.js → chunk-MZVCFV3T.js} +19 -15
- package/{chunk-K67C2JUC.js → chunk-N74XL3NI.js} +9 -9
- package/{chunk-VS276URX.js → chunk-NEG5LYK5.js} +1 -1
- package/{chunk-RBPUNSG5.js → chunk-OAZP4TSA.js} +18 -108
- package/{chunk-SMJEXX2S.js → chunk-ODBYGVO2.js} +232 -10
- package/{chunk-M4SFKP5L.js → chunk-OHUYN3YU.js} +3 -3
- package/{chunk-HYLRQDEE.js → chunk-OLGFIQN2.js} +6 -6
- package/{chunk-M3JEW6N6.js → chunk-OYUMJMC5.js} +15 -0
- package/chunk-P27E22MA.js +203 -0
- package/{chunk-BIWI5M4E.js → chunk-PBPXXMWZ.js} +1 -1
- package/{chunk-OBSEKCVK.js → chunk-PQ63BDV3.js} +210 -51
- package/{chunk-4I2MXV5Q.js → chunk-PVFYPUIM.js} +2 -0
- package/{chunk-OG6MQOQG.js → chunk-QMNVV3YM.js} +10 -37
- package/{chunk-GACR7H6T.js → chunk-R5NRFXGD.js} +5 -5
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/{chunk-4WVJLODK.js → chunk-RHBD22LV.js} +9 -4
- package/{chunk-EXJK7TQO.js → chunk-RMWDKLBE.js} +1520 -562
- package/{chunk-TGNIKIHR.js → chunk-RR3MB26M.js} +2 -2
- package/{chunk-OOJNQK6V.js → chunk-S25VJYXV.js} +8 -2
- package/{chunk-STJ6LSQE.js → chunk-SCMYAGQE.js} +1135 -712
- package/{chunk-YKY4OVOX.js → chunk-SPU3L3OR.js} +17 -170
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-DUUDXSLX.js → chunk-SX6AWTNK.js} +28 -4
- package/{chunk-ZH3KXFHS.js → chunk-TMRJGSK2.js} +1 -1
- package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
- package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
- package/{chunk-UAIHKQIA.js → chunk-U6RD332P.js} +18 -2
- package/{chunk-3U44JB3O.js → chunk-UF6J7NXV.js} +1 -1
- package/{chunk-Q3IVPFVO.js → chunk-UHW6SCVK.js} +1 -1
- package/chunk-UOUMPHS5.js +103 -0
- package/{chunk-HHFGE2WF.js → chunk-UPOW5HTG.js} +5 -5
- package/{chunk-DEA37IUY.js → chunk-V4IYI3SB.js} +2 -2
- package/{chunk-UWAIJOF2.js → chunk-VKCPKCSS.js} +66 -92
- package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
- package/{chunk-OBIC6EG7.js → chunk-VUHKG4KS.js} +3 -3
- package/{chunk-EEOOBRA7.js → chunk-W3HSD32M.js} +13 -6
- package/{chunk-P2ZLUIW2.js → chunk-W6T4FNZP.js} +351 -26
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-R6Z5S5GA.js → chunk-WQDTSK5U.js} +51 -14
- package/{chunk-OYU2MA5S.js → chunk-X22AUZKL.js} +152 -167
- package/{chunk-4ZGPHFLE.js → chunk-X3OZ655T.js} +2 -2
- package/{chunk-NHY322ZU.js → chunk-XCA4WHX5.js} +588 -64
- package/{chunk-TI2EPRHE.js → chunk-XJSEST7D.js} +3 -3
- package/{chunk-JUSHVFNF.js → chunk-XNTZD4AE.js} +1230 -1356
- package/chunk-XSRSAU3O.js +133 -0
- package/{chunk-CYWNWA77.js → chunk-Y4NPF2UN.js} +6 -3
- package/{chunk-FJSNBZXR.js → chunk-YDRRGVT5.js} +1 -1
- package/{chunk-R3NEQZ53.js → chunk-YFW4H6DL.js} +405 -338
- package/{chunk-BNMPUQW6.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-4N6G2CKP.js → chunk-YHNUDTU4.js} +49 -3
- package/chunk-YJPK35HB.js +175 -0
- package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
- package/{chunk-AGYPUBFW.js → chunk-Z7KE4K3H.js} +195 -123
- package/{chunk-DGYCDA6W.js → chunk-ZM5AZTQG.js} +20 -13
- package/{chunk-CBUZ6DKA.js → chunk-ZQ6K57FJ.js} +1 -1
- package/{cliAgentConfigHelpers-BTRHMPW2.js → cliAgentConfigHelpers-37ZNEY5Y.js} +9 -9
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliLocalAgentRecordReader-M3F76NIP.js → cliLocalAgentRecordReader-MCQVRWBR.js} +59 -47
- package/{commandRegistry-ZLWHQVAI.js → commandRegistry-NTH5IAN5.js} +104 -92
- package/{contentThunks-4ZX2TO7C.js → contentThunks-SPXTX5U2.js} +38 -36
- package/{cooldownCommands-YB5H5BBK.js → cooldownCommands-TIFCHCUN.js} +1 -1
- package/{createAgentAutomationAction-L4CYUZJG.js → createAgentAutomationAction-KUQKCOXB.js} +38 -36
- package/{createDialogAction-QTU2R2Q3.js → createDialogAction-HJN5U3XS.js} +39 -37
- package/{createPageAction-F3GJTHW2.js → createPageAction-ZAHRDOAU.js} +43 -41
- package/{db-M7FU2GNK.js → db-CMUTP3W5.js} +2 -2
- package/{dbSlice-XRUZOGSU.js → dbSlice-656PMWR2.js} +13 -12
- package/{deleteFile-6URDHYRB.js → deleteFile-ZCQESEEQ.js} +10 -7
- package/{dialogCommands-NRLCOPJR.js → dialogCommands-KZTZLWPZ.js} +61 -54
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-SHGPCU22.js → dialogNotifyCommand-PST75COP.js} +11 -11
- package/{dialogSlice-P2S4LXQD.js → dialogSlice-BXIERQHO.js} +39 -37
- package/{dialogUsageCommand-W2WCSGKF.js → dialogUsageCommand-6RW2FY6K.js} +5 -5
- package/{docCreateCommands-YJRDA3RX.js → docCreateCommands-26HJ5NAY.js} +55 -47
- package/{docDeleteCommands-A5QIHZNF.js → docDeleteCommands-UAOHH5XK.js} +57 -49
- package/{docReadCommands-CF2LTMYH.js → docReadCommands-4ADG7YE6.js} +55 -47
- package/{docStore-6O7NYL6A.js → docStore-FZ75HWP2.js} +15 -14
- package/{docUpdateCommands-QRKV4ZXE.js → docUpdateCommands-OGFJZENF.js} +55 -47
- package/fetchMessages-TQEUZD7H.js +1 -1
- package/{getPricing-LF5C4XSI.js → getPricing-FCHYVRJU.js} +4 -4
- package/{handleSendMessageAction-7IHLR37A.js → handleSendMessageAction-KP6GGBFY.js} +84 -79
- package/{hostCredentialCreate-VNCQUAFT.js → hostCredentialCreate-23TX56G7.js} +119 -105
- package/index.js +8 -8
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-CCOCVGAP.js → localDialogRead-CIOTQM5T.js} +1 -1
- package/{localRuntimeAdapter-FOWVNMIK.js → localRuntimeAdapter-MTUWOYPN.js} +126 -111
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-TYHQCTZN.js} +5 -3
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-BO7IVWAZ.js} +1 -1
- package/{machineCommands-ZGC3J4JB.js → machineCommands-4WJUJQHW.js} +260 -323
- package/{machineWsRunDispatch-KK5U4M3G.js → machineWsRunDispatch-V3U4JM67.js} +115 -102
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/mcpLocalAuthorizeCommand-TI656UWC.js +106 -0
- package/{memberThunks-7Y3OYSJQ.js → memberThunks-JFYC4Z5L.js} +20 -15
- package/{models-H5NNZRLH.js → models-EP7VG6N2.js} +2 -2
- package/{overlay-BBQZXGYI.js → overlay-JA3SPVUS.js} +5 -3
- package/package.json +1 -1
- package/{projectArchive-7ZDYBXAX.js → projectArchive-NU2Z5HOR.js} +45 -43
- package/{providerPresetApply-WHAMP2D5.js → providerPresetApply-4H7YP5D7.js} +6 -6
- package/{providerRegistry-ZI2KORJ7.js → providerRegistry-F3UPOTIY.js} +6 -6
- package/{read-TYMBGEXO.js → read-BRZHXUJ6.js} +9 -8
- package/{readDocTool-SKQVHBLO.js → readDocTool-N7RVFQEE.js} +1 -1
- package/{readlineWorkspace-YHT4SX2C.js → readlineWorkspace-T56MRMS5.js} +6426 -3669
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-F5QE2O2B.js → removeDialogAgentAction-J7XU7OUX.js} +19 -18
- package/{runAgentClientLoop-H4ED5V3K.js → runAgentClientLoop-O2GRCGRZ.js} +97 -75
- package/{runtimeDoctorCommands-RRKPBGVO.js → runtimeDoctorCommands-RDRJXMXC.js} +8 -8
- package/{secretCommands-KZWBZIYS.js → secretCommands-2FEMRUFM.js} +3 -3
- package/{setDialogExtraReferencesAction-72L27ERM.js → setDialogExtraReferencesAction-Q4V2ZZW2.js} +16 -15
- package/{setPrimaryDialogAgentAction-GJJDUSGJ.js → setPrimaryDialogAgentAction-742H5S6T.js} +19 -18
- package/{settingThunks-ZRGWVGZD.js → settingThunks-T4FXSV6M.js} +185 -66
- package/{skillDiscovery-I37M5KJC.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-MEH3HJBC.js → spaceCommands-W5TAVFDT.js} +59 -51
- package/{streamAgentChatTurn-ZXPOXU33.js → streamAgentChatTurn-OWDJMU5E.js} +238 -178
- package/{switchDialogAgentAction-IIJBPND3.js → switchDialogAgentAction-HLDLHRRA.js} +17 -16
- package/{tableCommands-FTAOCBTX.js → tableCommands-44GC4N6J.js} +8 -5
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
- package/{tools-2MRWA2PP.js → tools-O7SGGVA3.js} +67 -62
- package/{tuiRestart-2IL37YIB.js → tuiRestart-EOGC2BYY.js} +10 -10
- package/{tuiSummaryLlmCaller-W2QN4VAC.js → tuiSummaryLlmCaller-TM5BU73J.js} +16 -15
- package/{updateCommands-CPATDG6J.js → updateCommands-FBYA5WVG.js} +3 -3
- package/{updateDialogTitleAction-RZ3KZSGQ.js → updateDialogTitleAction-EXSZGTLL.js} +40 -38
- package/{usageCommand-2BF74MKF.js → usageCommand-L4OFWXEU.js} +2 -2
- package/{usageRebuildCommand-UHB55BQM.js → usageRebuildCommand-7JR33UHS.js} +3 -3
- package/webapi-QVV65DQF.js +2487 -0
- package/{windowsSelfUpdate-ZFD6J5HF.js → windowsSelfUpdate-M4V77OUB.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-ZCSQCHG3.js} +2 -2
- package/agentListCommands-GUGMORTK.js +0 -1005
- package/agentRecordCommands-SLLADS5C.js +0 -175
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-5ZMIIR23.js +0 -265
- package/chunk-62HXNQVV.js +0 -134
- package/chunk-TUSTONB3.js +0 -81
- package/chunk-ZXF6D3I6.js +0 -359
- package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
- /package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
|
@@ -1,57 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_AUTO_APPROVED_SELF_UPDATE_FIELDS,
|
|
3
|
-
DEFAULT_USER_PREFERENCE_PROFILE,
|
|
4
|
-
normalizeAgentUpdateFieldList,
|
|
5
|
-
normalizePolicyLevelSetting,
|
|
6
|
-
normalizeSystemBuiltinSkills,
|
|
7
|
-
normalizeTonePresetSetting,
|
|
8
|
-
resolveUserEnabledSkills
|
|
9
|
-
} from "./chunk-RBPUNSG5.js";
|
|
10
|
-
import {
|
|
11
|
-
setDialogExtraReferencesAction
|
|
12
|
-
} from "./chunk-HYLRQDEE.js";
|
|
13
1
|
import {
|
|
14
2
|
isSkillSummaryMarker
|
|
15
3
|
} from "./chunk-VF4K2QE6.js";
|
|
4
|
+
import {
|
|
5
|
+
setDialogExtraReferencesAction
|
|
6
|
+
} from "./chunk-OLGFIQN2.js";
|
|
16
7
|
import {
|
|
17
8
|
fetchAndCacheTableRows
|
|
18
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HCCQEMTK.js";
|
|
19
10
|
import {
|
|
20
|
-
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
require_react
|
|
24
|
-
} from "./chunk-5FUN7EG4.js";
|
|
11
|
+
resolveDialogRuntimeAgentKey
|
|
12
|
+
} from "./chunk-YFW4H6DL.js";
|
|
25
13
|
import {
|
|
26
14
|
createSpaceKey
|
|
27
15
|
} from "./chunk-UAD2WT54.js";
|
|
28
16
|
import {
|
|
29
17
|
selectById
|
|
30
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HZDK56EK.js";
|
|
19
|
+
import {
|
|
20
|
+
require_react
|
|
21
|
+
} from "./chunk-RD3QLZQV.js";
|
|
31
22
|
import {
|
|
32
23
|
selectRuntimeSnapshot
|
|
33
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WQDTSK5U.js";
|
|
34
25
|
import {
|
|
35
|
-
createAsyncThunk
|
|
36
|
-
|
|
37
|
-
} from "./chunk-7Z6EW7AH.js";
|
|
26
|
+
createAsyncThunk
|
|
27
|
+
} from "./chunk-6XVPMGXK.js";
|
|
38
28
|
import {
|
|
39
29
|
selectIdentityUserId
|
|
40
30
|
} from "./chunk-PXYBUFDB.js";
|
|
41
31
|
import {
|
|
42
32
|
isAgentSkillDisabled
|
|
43
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-YDRRGVT5.js";
|
|
44
34
|
import {
|
|
45
|
-
DEFAULT_SYSTEM_AGENT_CAPABILITIES,
|
|
46
35
|
listBuiltinSkills,
|
|
47
36
|
resolveBuiltinSkillByName
|
|
48
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-6MTVACLN.js";
|
|
49
38
|
import {
|
|
50
39
|
parseSkillDocProtocol
|
|
51
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-AETZ7AD6.js";
|
|
52
41
|
import {
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
isDialogRecordKeyForId,
|
|
43
|
+
parseDialogKey
|
|
44
|
+
} from "./chunk-OJKUU3LP.js";
|
|
55
45
|
import {
|
|
56
46
|
toErrorMessage
|
|
57
47
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -150,46 +140,73 @@ function waitForAbortableDelay(ms, signal) {
|
|
|
150
140
|
});
|
|
151
141
|
}
|
|
152
142
|
|
|
153
|
-
// packages/
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
[
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
)
|
|
161
|
-
|
|
162
|
-
(
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
const preferences = hasOwnEnabledSkills ? { enabledSkills, enabledPromptSkills } : { enabledPromptSkills };
|
|
166
|
-
return resolveUserEnabledSkills(preferences);
|
|
143
|
+
// packages/ai/tools/memoryToolContext.ts
|
|
144
|
+
var trimmed = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
145
|
+
function findLoadedDialogs(state, dialogId, exactKey) {
|
|
146
|
+
const entities = state?.db?.entities;
|
|
147
|
+
if (!entities || typeof entities !== "object") return [];
|
|
148
|
+
const matches = [];
|
|
149
|
+
for (const key of Object.keys(entities)) {
|
|
150
|
+
if (!isDialogRecordKeyForId(key, dialogId)) continue;
|
|
151
|
+
const record = entities[key];
|
|
152
|
+
if (!record || trimmed(record.id) !== dialogId) continue;
|
|
153
|
+
if (exactKey && key !== exactKey) continue;
|
|
154
|
+
matches.push({ key, record });
|
|
167
155
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
state
|
|
172
|
-
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
);
|
|
156
|
+
return matches;
|
|
157
|
+
}
|
|
158
|
+
function resolveMemoryToolContext(state, context) {
|
|
159
|
+
return resolveToolAttributionContext(state, context);
|
|
160
|
+
}
|
|
161
|
+
function resolveToolAttributionContext(state, context, options) {
|
|
162
|
+
const UNRESOLVED = options?.errorLabel ?? "\u65E0\u6CD5\u786E\u5B9A\u8BB0\u5FC6\u5F52\u5C5E";
|
|
163
|
+
const agentKey = trimmed(context?.agentKey);
|
|
164
|
+
if (options?.requireAgentKey && !agentKey) {
|
|
165
|
+
throw new Error(`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u7F3A\u5C11 agentKey\uFF0C\u4E0D\u4F1A\u4ECE\u5F53\u524D\u5BF9\u8BDD\u63A8\u65AD\u3002`);
|
|
166
|
+
}
|
|
167
|
+
const contextDialogId = trimmed(context?.dialogId);
|
|
168
|
+
const contextDialogKey = trimmed(context?.dialogKey);
|
|
169
|
+
let keyIdentity = null;
|
|
170
|
+
if (contextDialogKey) {
|
|
171
|
+
keyIdentity = parseDialogKey(contextDialogKey);
|
|
172
|
+
if (!keyIdentity) {
|
|
173
|
+
throw new Error(
|
|
174
|
+
`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u91CC\u7684\u5BF9\u8BDD\u952E ${contextDialogKey} \u4E0D\u662F\u53EF\u89E3\u6790\u7684 dialog-<owner>-<id>\uFF0C\u4E0D\u4F1A\u6309 id \u731C\u5F52\u5C5E\u3002`
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
if (contextDialogId && keyIdentity.dialogId !== contextDialogId) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
`${UNRESOLVED}\uFF1A\u6267\u884C\u4E0A\u4E0B\u6587\u81EA\u76F8\u77DB\u76FE\u2014\u2014\u5BF9\u8BDD\u952E ${contextDialogKey} \u6307\u5411 ${keyIdentity.dialogId}\uFF0C\u4F46 dialogId \u662F ${contextDialogId}\u3002`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const dialogId = keyIdentity?.dialogId ?? contextDialogId;
|
|
184
|
+
if (!dialogId) {
|
|
185
|
+
throw new Error(
|
|
186
|
+
`${UNRESOLVED}\uFF1A\u672C\u6B21\u5DE5\u5177\u8C03\u7528\u7F3A\u5C11\u6240\u5C5E\u5BF9\u8BDD\uFF08dialogId\uFF09\uFF0C\u4E0D\u4F1A\u6539\u7528\u5F53\u524D\u6253\u5F00\u7684\u5BF9\u8BDD\u6216\u89C6\u56FE Space\u3002`
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
const matches = findLoadedDialogs(state, dialogId, contextDialogKey);
|
|
190
|
+
if (matches.length === 0) {
|
|
191
|
+
throw new Error(
|
|
192
|
+
`${UNRESOLVED}\uFF1A\u5BF9\u8BDD ${dialogId} \u672A\u52A0\u8F7D\uFF0C\u65E0\u6CD5\u786E\u8BA4\u5B83\u7684 Space \u5F52\u5C5E\u3002`
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
if (matches.length > 1) {
|
|
196
|
+
throw new Error(
|
|
197
|
+
`${UNRESOLVED}\uFF1A\u52A0\u8F7D\u4E2D\u6709 ${matches.length} \u4E2A\u540C id \u7684\u5BF9\u8BDD\uFF08${matches.map((m) => m.key).join(" / ")}\uFF09\uFF0C\u4EC5\u51ED dialogId \u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E\uFF1B\u6267\u884C\u4E0A\u4E0B\u6587\u9700\u8981\u63D0\u4F9B\u5B8C\u6574\u5BF9\u8BDD\u952E\u3002`
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
const [dialog] = matches;
|
|
201
|
+
return {
|
|
202
|
+
dialogId,
|
|
203
|
+
agentKey: resolveDialogRuntimeAgentKey(
|
|
204
|
+
dialog.record,
|
|
205
|
+
agentKey
|
|
206
|
+
),
|
|
207
|
+
spaceId: trimmed(dialog.record.spaceId)
|
|
208
|
+
};
|
|
209
|
+
}
|
|
193
210
|
|
|
194
211
|
// packages/ai/tools/loadSkillTool.ts
|
|
195
212
|
var loadSkillFunctionSchema = {
|
|
@@ -323,23 +340,7 @@ async function listSkillCandidates(thunkApi) {
|
|
|
323
340
|
}
|
|
324
341
|
return candidates;
|
|
325
342
|
}
|
|
326
|
-
var
|
|
327
|
-
try {
|
|
328
|
-
const state = thunkApi?.getState?.();
|
|
329
|
-
if (!state) return null;
|
|
330
|
-
const currentDialogKey = getActiveDialogKey();
|
|
331
|
-
if (!currentDialogKey) return null;
|
|
332
|
-
const dialogConfig = selectById(
|
|
333
|
-
state,
|
|
334
|
-
currentDialogKey
|
|
335
|
-
);
|
|
336
|
-
return asTrimmedNonEmptyStringArray(dialogConfig?.cybots)[0] ?? null;
|
|
337
|
-
} catch {
|
|
338
|
-
return null;
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
var readCurrentAgentSkillSource = async (thunkApi) => {
|
|
342
|
-
const agentKey = resolveCurrentAgentKeyForSkillGate(thunkApi);
|
|
343
|
+
var readCurrentAgentSkillSource = async (thunkApi, agentKey) => {
|
|
343
344
|
if (!agentKey) return null;
|
|
344
345
|
const db = thunkApi?.extra?.db;
|
|
345
346
|
if (!db) return null;
|
|
@@ -364,6 +365,14 @@ async function loadSkillFunc(args, thunkApi, context) {
|
|
|
364
365
|
}
|
|
365
366
|
let requestedName = asTrimmedString(exact ? source === "space" ? args.dbKey : args.slug : args?.name);
|
|
366
367
|
if (!requestedName) throw new Error("loadSkill \u9700\u8981\u63D0\u4F9B name\u3002");
|
|
368
|
+
const state = thunkApi.getState();
|
|
369
|
+
const attribution = resolveToolAttributionContext(state, context, {
|
|
370
|
+
requireAgentKey: false,
|
|
371
|
+
errorLabel: "loadSkill: \u65E0\u6CD5\u786E\u5B9A\u5F52\u5C5E"
|
|
372
|
+
});
|
|
373
|
+
const dialogKey = context?.dialogKey?.trim() || Object.keys(state.db.entities).find(
|
|
374
|
+
(key) => isDialogRecordKeyForId(key, attribution.dialogId) && state.db.entities[key]?.id?.trim() === attribution.dialogId
|
|
375
|
+
);
|
|
367
376
|
const candidates = await listSkillCandidates(thunkApi);
|
|
368
377
|
let resolution;
|
|
369
378
|
if (!exact) {
|
|
@@ -380,7 +389,7 @@ async function loadSkillFunc(args, thunkApi, context) {
|
|
|
380
389
|
const builtinEntry = resolution?.kind === "builtin" ? resolution.entry : null;
|
|
381
390
|
const resolvedSlug = builtinEntry?.slug ?? matched?.skillId ?? null;
|
|
382
391
|
if (resolvedSlug) {
|
|
383
|
-
const agentSkillSource = await readCurrentAgentSkillSource(thunkApi);
|
|
392
|
+
const agentSkillSource = await readCurrentAgentSkillSource(thunkApi, attribution.agentKey);
|
|
384
393
|
if (agentSkillSource && isAgentSkillDisabled(agentSkillSource, resolvedSlug)) {
|
|
385
394
|
return {
|
|
386
395
|
rawData: {
|
|
@@ -397,7 +406,7 @@ async function loadSkillFunc(args, thunkApi, context) {
|
|
|
397
406
|
const body2 = builtinEntry.content;
|
|
398
407
|
const dbKey = builtinEntry.slug;
|
|
399
408
|
if (context?.skipSkillReferencePersist !== true) {
|
|
400
|
-
await persistLoadedSkillReference(thunkApi, dbKey, requestedName);
|
|
409
|
+
await persistLoadedSkillReference(thunkApi, dialogKey, dbKey, requestedName);
|
|
401
410
|
}
|
|
402
411
|
return {
|
|
403
412
|
rawData: {
|
|
@@ -437,7 +446,7 @@ ${body2}`
|
|
|
437
446
|
}
|
|
438
447
|
const body = extractSkillBody(page);
|
|
439
448
|
if (context?.skipSkillReferencePersist !== true) {
|
|
440
|
-
await persistLoadedSkillReference(thunkApi, matched.dbKey, requestedName);
|
|
449
|
+
await persistLoadedSkillReference(thunkApi, dialogKey, matched.dbKey, requestedName);
|
|
441
450
|
}
|
|
442
451
|
return {
|
|
443
452
|
rawData: {
|
|
@@ -451,10 +460,9 @@ ${body2}`
|
|
|
451
460
|
${body}`
|
|
452
461
|
};
|
|
453
462
|
}
|
|
454
|
-
async function persistLoadedSkillReference(thunkApi, dbKey, name) {
|
|
463
|
+
async function persistLoadedSkillReference(thunkApi, currentDialogKey, dbKey, name) {
|
|
455
464
|
try {
|
|
456
465
|
const state = thunkApi?.getState?.();
|
|
457
|
-
const currentDialogKey = getActiveDialogKey();
|
|
458
466
|
if (!state || !currentDialogKey) return;
|
|
459
467
|
const dialogConfig = selectById(
|
|
460
468
|
state,
|
|
@@ -468,7 +476,7 @@ async function persistLoadedSkillReference(thunkApi, dbKey, name) {
|
|
|
468
476
|
title: name,
|
|
469
477
|
type: "instruction"
|
|
470
478
|
};
|
|
471
|
-
await setDialogExtraReferencesAction([...existing, newRef], thunkApi);
|
|
479
|
+
await setDialogExtraReferencesAction([...existing, newRef], thunkApi, currentDialogKey);
|
|
472
480
|
} catch {
|
|
473
481
|
}
|
|
474
482
|
}
|
|
@@ -607,10 +615,10 @@ ${block.question.choices.map((item) => `- ${item.label}${item.detail ? ` \u2014
|
|
|
607
615
|
|
|
608
616
|
// packages/core/clipMultilineText.ts
|
|
609
617
|
function clipMultilineText(value, max) {
|
|
610
|
-
const
|
|
611
|
-
if (
|
|
612
|
-
return `${
|
|
613
|
-
...[truncated ${
|
|
618
|
+
const trimmed2 = value.trim();
|
|
619
|
+
if (trimmed2.length <= max) return trimmed2;
|
|
620
|
+
return `${trimmed2.slice(0, max)}
|
|
621
|
+
...[truncated ${trimmed2.length - max} chars]`;
|
|
614
622
|
}
|
|
615
623
|
|
|
616
624
|
// packages/render/table/utils/tableSerialization.ts
|
|
@@ -783,7 +791,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
783
791
|
if (!executionInput) {
|
|
784
792
|
throw new Error(`ToolRun ${id} has no input to execute with.`);
|
|
785
793
|
}
|
|
786
|
-
const { findToolExecutor } = await import("./tools-
|
|
794
|
+
const { findToolExecutor } = await import("./tools-O7SGGVA3.js");
|
|
787
795
|
const { executor } = findToolExecutor(run.toolName);
|
|
788
796
|
toolRunStarted({
|
|
789
797
|
id: run.id,
|
|
@@ -807,7 +815,7 @@ var executeToolRun = createAsyncThunk(
|
|
|
807
815
|
const latestState = thunkApi.getState();
|
|
808
816
|
const userId = selectIdentityUserId(latestState);
|
|
809
817
|
if (userId) {
|
|
810
|
-
const { fetchUserSpaceMemberships } = await import("./memberThunks-
|
|
818
|
+
const { fetchUserSpaceMemberships } = await import("./memberThunks-JFYC4Z5L.js");
|
|
811
819
|
await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
|
|
812
820
|
}
|
|
813
821
|
}
|
|
@@ -837,13 +845,6 @@ export {
|
|
|
837
845
|
waitForAbortableDelay,
|
|
838
846
|
clipMultilineText,
|
|
839
847
|
fetchAndSerializeTable,
|
|
840
|
-
selectMaxExecutionTime,
|
|
841
|
-
selectGlobalPrompt,
|
|
842
|
-
selectUserTonePreset,
|
|
843
|
-
selectKnowledgeCaptureLevel,
|
|
844
|
-
selectSpaceContextLevel,
|
|
845
|
-
selectAutoApproveSelfUpdateFields,
|
|
846
|
-
selectAiRecentContentLimit,
|
|
847
848
|
ToolResultError,
|
|
848
849
|
getToolResultErrorData,
|
|
849
850
|
createToolRunId,
|
|
@@ -853,6 +854,8 @@ export {
|
|
|
853
854
|
toolRunUpdated,
|
|
854
855
|
toolRunFailed,
|
|
855
856
|
getAllToolRuns,
|
|
857
|
+
resolveMemoryToolContext,
|
|
858
|
+
resolveToolAttributionContext,
|
|
856
859
|
loadSkillFunctionSchema,
|
|
857
860
|
loadSkillFunc
|
|
858
861
|
};
|
|
@@ -3,10 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-5ZUL4CUO.js";
|
|
4
4
|
import {
|
|
5
5
|
getModelContextWindow
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
BUILTIN_NOLO_AGENT_KEY
|
|
9
|
-
} from "./chunk-ILHQ2AXT.js";
|
|
6
|
+
} from "./chunk-MAA42MMV.js";
|
|
10
7
|
import {
|
|
11
8
|
isPageKey,
|
|
12
9
|
isTableMetaKey
|
|
@@ -14,6 +11,9 @@ import {
|
|
|
14
11
|
import {
|
|
15
12
|
isDialogRecordKey
|
|
16
13
|
} from "./chunk-OJKUU3LP.js";
|
|
14
|
+
import {
|
|
15
|
+
BUILTIN_NOLO_AGENT_KEY
|
|
16
|
+
} from "./chunk-KZAT2M2V.js";
|
|
17
17
|
import {
|
|
18
18
|
asTrimmedString
|
|
19
19
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -453,11 +453,24 @@ function resolveEmptyAssistantFallbackMessage(reason) {
|
|
|
453
453
|
if (reason === "stagnant_tool_calls") return STAGNANT_TOOL_CALLS_FALLBACK_MESSAGE;
|
|
454
454
|
return EMPTY_ASSISTANT_FALLBACK_MESSAGE;
|
|
455
455
|
}
|
|
456
|
+
var DEGENERATE_CLOSING_BRACKET_FRAGMENT_RE = /^[}\])]+$/;
|
|
457
|
+
var MAX_DEGENERATE_FRAGMENT_CHARS = 4;
|
|
458
|
+
function isDegenerateClosingBracketFragment(text) {
|
|
459
|
+
if (typeof text !== "string") return false;
|
|
460
|
+
const compact = text.replace(/\s+/g, "");
|
|
461
|
+
return compact.length >= 1 && compact.length <= MAX_DEGENERATE_FRAGMENT_CHARS && DEGENERATE_CLOSING_BRACKET_FRAGMENT_RE.test(compact);
|
|
462
|
+
}
|
|
456
463
|
function hasAssistantVisibleOutput(content) {
|
|
457
|
-
if (typeof content === "string")
|
|
464
|
+
if (typeof content === "string") {
|
|
465
|
+
const trimmed = content.trim();
|
|
466
|
+
return trimmed.length > 0 && !isDegenerateClosingBracketFragment(trimmed);
|
|
467
|
+
}
|
|
458
468
|
if (!Array.isArray(content)) return false;
|
|
459
469
|
return content.some((part) => {
|
|
460
|
-
if (part?.type === "text"
|
|
470
|
+
if (part?.type === "text") {
|
|
471
|
+
const text = String(part.text ?? "").trim();
|
|
472
|
+
return text.length > 0 && !isDegenerateClosingBracketFragment(text);
|
|
473
|
+
}
|
|
461
474
|
if (part?.type === "image_url") {
|
|
462
475
|
const url = part?.image_url?.url;
|
|
463
476
|
return typeof url === "string" && url.trim().length > 0;
|
|
@@ -2,23 +2,26 @@ import {
|
|
|
2
2
|
normalizeTimingMs
|
|
3
3
|
} from "./chunk-H57T64RA.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
sha256Hex
|
|
6
|
+
} from "./chunk-SR4FE5VD.js";
|
|
7
7
|
import {
|
|
8
8
|
estimateTokenCount
|
|
9
9
|
} from "./chunk-PSCNXBYA.js";
|
|
10
|
+
import {
|
|
11
|
+
isAbortError
|
|
12
|
+
} from "./chunk-7DPNBQSV.js";
|
|
10
13
|
import {
|
|
11
14
|
asTrimmedNonEmptyStringArray
|
|
12
15
|
} from "./chunk-I42VC5KR.js";
|
|
13
16
|
import {
|
|
14
17
|
ALL_MODELS
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
MODEL_LOOKUP_MAP
|
|
18
|
-
} from "./chunk-CD3RU7XL.js";
|
|
18
|
+
} from "./chunk-6ASGEP5D.js";
|
|
19
19
|
import {
|
|
20
20
|
asOptionalFiniteNumber
|
|
21
21
|
} from "./chunk-WWC7I6TA.js";
|
|
22
|
+
import {
|
|
23
|
+
MODEL_LOOKUP_MAP
|
|
24
|
+
} from "./chunk-CD2DK5JA.js";
|
|
22
25
|
import {
|
|
23
26
|
asOptionalTrimmedString
|
|
24
27
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -26,7 +29,7 @@ import {
|
|
|
26
29
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_MODEL,
|
|
27
30
|
isPlatformManagedProvider,
|
|
28
31
|
resolvePlatformEffectiveModel
|
|
29
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-PQ63BDV3.js";
|
|
30
33
|
|
|
31
34
|
// packages/core/chat/messageContentSerialize.ts
|
|
32
35
|
var serializeMessageContent = (content, imagePlaceholder = "[\u56FE\u7247]") => {
|
|
@@ -321,12 +324,6 @@ async function runSummaryWithContract(args) {
|
|
|
321
324
|
return execute("current");
|
|
322
325
|
}
|
|
323
326
|
|
|
324
|
-
// packages/core/sha256.ts
|
|
325
|
-
import SHA256 from "crypto-js/sha256.js";
|
|
326
|
-
function sha256Hex(text) {
|
|
327
|
-
return SHA256(text).toString();
|
|
328
|
-
}
|
|
329
|
-
|
|
330
327
|
// packages/ai/context/toolOutputCap.ts
|
|
331
328
|
var TOOL_OUTPUT_CAP_WINDOW_RATIO = 0.12;
|
|
332
329
|
var TOOL_OUTPUT_CAP_MIN_TOKENS = 4e3;
|
|
@@ -753,6 +750,73 @@ var DECLARATION_RESERVE = 40;
|
|
|
753
750
|
var USER_MESSAGE_MAX_DEMAND = 600;
|
|
754
751
|
var SUMMARY_USER_SHARE = 0.2;
|
|
755
752
|
var DECLARATION_SPLIT_COST = 20;
|
|
753
|
+
function interruptedBatchMarker(declared, returned) {
|
|
754
|
+
const scope = "[\u672C\u6BB5\u5386\u53F2\u8303\u56F4\u5185";
|
|
755
|
+
return returned === 0 ? `${scope}\uFF0C\u8BE5\u5DE5\u5177\u6279\u6B21\u5728\u540E\u7EED\u7528\u6237\u6D88\u606F\u524D\u6CA1\u6709\u8BB0\u5F55\u5230\u7ED3\u679C\uFF0C\u6309\u4E2D\u65AD\u5904\u7406\uFF1A\u58F0\u660E\u8FC7\u7684\u8C03\u7528\u4E0D\u8BA1\u4E3A\u5DF2\u5B8C\u6210\u3002]` : `${scope}\uFF0C\u8BE5\u5DE5\u5177\u6279\u6B21\u58F0\u660E\u4E86 ${declared} \u4E2A\u8C03\u7528\uFF0C\u53EA\u8BB0\u5F55\u4E86 ${returned} \u4E2A\u7ED3\u679C\uFF1B\u672A\u8BB0\u5F55\u7ED3\u679C\u7684\u8C03\u7528\u6309\u4E2D\u65AD\u5904\u7406\uFF0C\u4E0D\u8BA1\u4E3A\u5DF2\u5B8C\u6210\u3002]`;
|
|
756
|
+
}
|
|
757
|
+
function projectInterruptedHistoricalBatches(source) {
|
|
758
|
+
const resultIndices = /* @__PURE__ */ new Map();
|
|
759
|
+
source.forEach((msg, index) => {
|
|
760
|
+
const resultId = msg.role === "tool" ? msg.tool_call_id : void 0;
|
|
761
|
+
if (typeof resultId !== "string" || !resultId) return;
|
|
762
|
+
const existing = resultIndices.get(resultId);
|
|
763
|
+
if (existing) existing.push(index);
|
|
764
|
+
else resultIndices.set(resultId, [index]);
|
|
765
|
+
});
|
|
766
|
+
return source.map((msg, index) => {
|
|
767
|
+
if (msg.role !== "assistant" || !msg.tool_calls?.length) return msg;
|
|
768
|
+
const declared = msg.tool_calls.map((call) => call?.id);
|
|
769
|
+
if (declared.some((id) => typeof id !== "string" || !id) || new Set(declared).size !== declared.length) return msg;
|
|
770
|
+
const declaredIds = declared;
|
|
771
|
+
let cursor = index + 1;
|
|
772
|
+
const returned = [];
|
|
773
|
+
while (cursor < source.length && source[cursor].role === "tool") {
|
|
774
|
+
const resultId = source[cursor].tool_call_id;
|
|
775
|
+
if (typeof resultId !== "string" || !resultId || !declaredIds.includes(resultId) || returned.includes(resultId)) return msg;
|
|
776
|
+
returned.push(resultId);
|
|
777
|
+
cursor++;
|
|
778
|
+
}
|
|
779
|
+
if (source[cursor]?.role !== "user") return msg;
|
|
780
|
+
if (returned.length === declaredIds.length) return msg;
|
|
781
|
+
const returnedSet = new Set(returned);
|
|
782
|
+
const ambiguous = declaredIds.some((id) => !returnedSet.has(id) && (resultIndices.get(id) ?? []).some((at) => at < index + 1 || at > cursor - 1));
|
|
783
|
+
if (ambiguous) return msg;
|
|
784
|
+
const keptCalls = msg.tool_calls.filter((call) => returnedSet.has(call.id));
|
|
785
|
+
const { tool_calls: _declaredCalls, ...rest } = msg;
|
|
786
|
+
const text = serializeMessageContent(msg.content);
|
|
787
|
+
const marker = interruptedBatchMarker(declaredIds.length, returned.length);
|
|
788
|
+
return {
|
|
789
|
+
...rest,
|
|
790
|
+
...keptCalls.length ? { tool_calls: keptCalls } : {},
|
|
791
|
+
content: text ? `${text}
|
|
792
|
+
${marker}` : marker
|
|
793
|
+
};
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
function buildHistoricalCompactionRequest(args) {
|
|
797
|
+
const source = args.msgsToCompress;
|
|
798
|
+
const projected = projectInterruptedHistoricalBatches(source);
|
|
799
|
+
const bounded = buildBoundedCompactionRequest({ ...args, msgsToCompress: projected });
|
|
800
|
+
if (bounded.status !== "ready") return bounded;
|
|
801
|
+
const sourceIndexById = /* @__PURE__ */ new Map();
|
|
802
|
+
source.forEach((msg, index) => {
|
|
803
|
+
if (!sourceIndexById.has(msg.id)) sourceIndexById.set(msg.id, index);
|
|
804
|
+
});
|
|
805
|
+
const coveredMessages = bounded.coveredMessages.map((msg) => {
|
|
806
|
+
const index = sourceIndexById.get(msg.id);
|
|
807
|
+
if (index === void 0) {
|
|
808
|
+
throw new Error(`historical compaction coverage returned an unknown message id: ${msg.id}`);
|
|
809
|
+
}
|
|
810
|
+
return source[index];
|
|
811
|
+
});
|
|
812
|
+
const isOrderedPrefix = !bounded.partial && coveredMessages.length === source.length && coveredMessages.every((msg, position) => msg === source[position]);
|
|
813
|
+
if (!isOrderedPrefix) {
|
|
814
|
+
throw new Error(
|
|
815
|
+
`historical compaction coverage is no longer an ordered 1:1 prefix of the source (covered ${coveredMessages.length} of ${source.length}, partial=${bounded.partial})`
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
return { ...bounded, coveredMessages };
|
|
819
|
+
}
|
|
756
820
|
function buildBoundedCompactionRequest(args) {
|
|
757
821
|
const { msgsToCompress: msgs, previousSummary, contextWindow } = args;
|
|
758
822
|
const windowValid = Number.isFinite(contextWindow) && contextWindow > 0;
|
|
@@ -1174,6 +1238,156 @@ function buildSummarySourceDiagnostics(messages, anchor) {
|
|
|
1174
1238
|
}
|
|
1175
1239
|
return rows;
|
|
1176
1240
|
}
|
|
1241
|
+
var MAX_SUMMARY_SOURCE_SEGMENTS = 16;
|
|
1242
|
+
function buildSummarySourceSegments(messages, anchor) {
|
|
1243
|
+
if (!anchor) return [];
|
|
1244
|
+
let end = messages.findIndex((message) => message.id === anchor);
|
|
1245
|
+
if (end === -1) {
|
|
1246
|
+
const legacy = /^local-(0|[1-9]\d*)$/.exec(anchor);
|
|
1247
|
+
if (legacy) {
|
|
1248
|
+
const index = Number(legacy[1]);
|
|
1249
|
+
if (Number.isSafeInteger(index) && index < messages.length) {
|
|
1250
|
+
end = index;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
if (end < 0) return [];
|
|
1255
|
+
const totalCount = end + 1;
|
|
1256
|
+
const width = Math.max(1, Math.ceil(totalCount / MAX_SUMMARY_SOURCE_SEGMENTS));
|
|
1257
|
+
const segments = [];
|
|
1258
|
+
for (let start = 0; start < totalCount; start += width) {
|
|
1259
|
+
const segEnd = Math.min(end, start + width - 1);
|
|
1260
|
+
const group = messages.slice(start, segEnd + 1);
|
|
1261
|
+
const roleCounts = /* @__PURE__ */ new Map();
|
|
1262
|
+
for (const message of group) {
|
|
1263
|
+
const role = typeof message.role === "string" && message.role ? message.role : "unknown";
|
|
1264
|
+
roleCounts.set(role, (roleCounts.get(role) ?? 0) + 1);
|
|
1265
|
+
}
|
|
1266
|
+
const roles = Array.from(roleCounts.entries()).map(([role, count]) => `${role}:${count}`).join(",");
|
|
1267
|
+
const canonical = group.map((message, offset) => ({
|
|
1268
|
+
id: `local-${start + offset}`,
|
|
1269
|
+
role: message.role,
|
|
1270
|
+
content: message.content ?? "",
|
|
1271
|
+
...Array.isArray(message.tool_calls) ? { tool_calls: message.tool_calls } : {}
|
|
1272
|
+
}));
|
|
1273
|
+
const hash = sha256Hex(JSON.stringify(canonical)).slice(0, 16);
|
|
1274
|
+
segments.push({
|
|
1275
|
+
start,
|
|
1276
|
+
end: segEnd,
|
|
1277
|
+
count: group.length,
|
|
1278
|
+
roles,
|
|
1279
|
+
hash
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1282
|
+
return segments;
|
|
1283
|
+
}
|
|
1284
|
+
function diffSummarySourceSegments(savedSegments, currentSegments) {
|
|
1285
|
+
const saved = Array.isArray(savedSegments) ? savedSegments : [];
|
|
1286
|
+
const current = Array.isArray(currentSegments) ? currentSegments : [];
|
|
1287
|
+
const savedTotalCount = saved.reduce(
|
|
1288
|
+
(sum, seg) => sum + (typeof seg?.count === "number" && Number.isFinite(seg.count) ? seg.count : 0),
|
|
1289
|
+
0
|
|
1290
|
+
);
|
|
1291
|
+
const currentTotalCount = current.reduce(
|
|
1292
|
+
(sum, seg) => sum + (typeof seg?.count === "number" && Number.isFinite(seg.count) ? seg.count : 0),
|
|
1293
|
+
0
|
|
1294
|
+
);
|
|
1295
|
+
if (saved.length === 0) {
|
|
1296
|
+
return {
|
|
1297
|
+
matched: false,
|
|
1298
|
+
reason: "legacy_no_segments",
|
|
1299
|
+
firstMismatchIndex: null,
|
|
1300
|
+
savedSegmentCount: 0,
|
|
1301
|
+
currentSegmentCount: current.length,
|
|
1302
|
+
savedTotalCount: 0,
|
|
1303
|
+
currentTotalCount,
|
|
1304
|
+
savedSegment: null,
|
|
1305
|
+
currentSegment: null
|
|
1306
|
+
};
|
|
1307
|
+
}
|
|
1308
|
+
if (current.length === 0) {
|
|
1309
|
+
return {
|
|
1310
|
+
matched: false,
|
|
1311
|
+
reason: "anchor_missing",
|
|
1312
|
+
firstMismatchIndex: null,
|
|
1313
|
+
savedSegmentCount: saved.length,
|
|
1314
|
+
currentSegmentCount: 0,
|
|
1315
|
+
savedTotalCount,
|
|
1316
|
+
currentTotalCount: 0,
|
|
1317
|
+
savedSegment: saved[0] ?? null,
|
|
1318
|
+
currentSegment: null
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
const minLen = Math.min(saved.length, current.length);
|
|
1322
|
+
let firstDiff = null;
|
|
1323
|
+
for (let i = 0; i < minLen; i++) {
|
|
1324
|
+
const s = saved[i];
|
|
1325
|
+
const c = current[i];
|
|
1326
|
+
if (!s || !c || s.start !== c.start || s.end !== c.end || s.count !== c.count || s.roles !== c.roles || s.hash !== c.hash) {
|
|
1327
|
+
firstDiff = i;
|
|
1328
|
+
break;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
if (savedTotalCount !== currentTotalCount || saved.length !== current.length) {
|
|
1332
|
+
const idx = firstDiff ?? minLen;
|
|
1333
|
+
return {
|
|
1334
|
+
matched: false,
|
|
1335
|
+
reason: "count_changed",
|
|
1336
|
+
firstMismatchIndex: idx,
|
|
1337
|
+
savedSegmentCount: saved.length,
|
|
1338
|
+
currentSegmentCount: current.length,
|
|
1339
|
+
savedTotalCount,
|
|
1340
|
+
currentTotalCount,
|
|
1341
|
+
savedSegment: saved[idx] ?? null,
|
|
1342
|
+
currentSegment: current[idx] ?? null
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
if (firstDiff !== null) {
|
|
1346
|
+
const s = saved[firstDiff] ?? null;
|
|
1347
|
+
const c = current[firstDiff] ?? null;
|
|
1348
|
+
const boundsChanged = !s || !c || s.start !== c.start || s.end !== c.end || s.count !== c.count;
|
|
1349
|
+
return {
|
|
1350
|
+
matched: false,
|
|
1351
|
+
reason: boundsChanged ? "count_changed" : "segment_hash_changed",
|
|
1352
|
+
firstMismatchIndex: firstDiff,
|
|
1353
|
+
savedSegmentCount: saved.length,
|
|
1354
|
+
currentSegmentCount: current.length,
|
|
1355
|
+
savedTotalCount,
|
|
1356
|
+
currentTotalCount,
|
|
1357
|
+
savedSegment: s,
|
|
1358
|
+
currentSegment: c
|
|
1359
|
+
};
|
|
1360
|
+
}
|
|
1361
|
+
return {
|
|
1362
|
+
matched: true,
|
|
1363
|
+
reason: "matched",
|
|
1364
|
+
firstMismatchIndex: null,
|
|
1365
|
+
savedSegmentCount: saved.length,
|
|
1366
|
+
currentSegmentCount: current.length,
|
|
1367
|
+
savedTotalCount,
|
|
1368
|
+
currentTotalCount,
|
|
1369
|
+
savedSegment: null,
|
|
1370
|
+
currentSegment: null
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
function sanitizeSummarySourceSegments(raw) {
|
|
1374
|
+
if (!Array.isArray(raw) || raw.length === 0) return void 0;
|
|
1375
|
+
const sanitized = [];
|
|
1376
|
+
for (const item of raw.slice(0, MAX_SUMMARY_SOURCE_SEGMENTS)) {
|
|
1377
|
+
if (!item || typeof item !== "object") continue;
|
|
1378
|
+
const candidate = item;
|
|
1379
|
+
const start = candidate.start;
|
|
1380
|
+
const end = candidate.end;
|
|
1381
|
+
const count = candidate.count;
|
|
1382
|
+
const roles = candidate.roles;
|
|
1383
|
+
const hash = candidate.hash;
|
|
1384
|
+
if (typeof start !== "number" || !Number.isSafeInteger(start) || start < 0 || typeof end !== "number" || !Number.isSafeInteger(end) || end < start || typeof count !== "number" || !Number.isSafeInteger(count) || count < 1 || typeof roles !== "string" || roles.length === 0 || roles.length > 128 || /[\r\n\0]/.test(roles) || typeof hash !== "string" || !/^[0-9a-f]{16}$/.test(hash)) {
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
sanitized.push({ start, end, count, roles, hash });
|
|
1388
|
+
}
|
|
1389
|
+
return sanitized.length > 0 ? sanitized : void 0;
|
|
1390
|
+
}
|
|
1177
1391
|
|
|
1178
1392
|
// packages/ai/llm/getModelContextWindow.ts
|
|
1179
1393
|
var DEFAULT_CONTEXT_WINDOW = 256e3;
|
|
@@ -1181,7 +1395,7 @@ var QWEN_3_6_CONTEXT_WINDOW = 262144;
|
|
|
1181
1395
|
var GLM_5_2_CONTEXT_WINDOW = 1e6;
|
|
1182
1396
|
var GPT_6_1_SOL_CONTEXT_WINDOW = 5e5;
|
|
1183
1397
|
var GPT_6_1_SOL_PATTERN = /(^|\/)gpt-6\.1[- ]sol(?![a-z])/;
|
|
1184
|
-
var GPT_6_1_PINNED_PATTERN = /(^|\/)gpt-6\.1[- ](sol|terra)(?![a-z0-9])/;
|
|
1398
|
+
var GPT_6_1_PINNED_PATTERN = /(^|\/)gpt-(?:6\.1[- ](sol|terra)|6\.2[- ](sol|astra))(?![a-z0-9])/;
|
|
1185
1399
|
var GPT_272K_PINNED_PATTERN = /(^|\/)(gpt-6[- ](astra|luna|sol)|gpt-5\.6[- ](sol|terra|luna))(?![a-z0-9])/;
|
|
1186
1400
|
var GPT_272K_CONTEXT_WINDOW = 272e3;
|
|
1187
1401
|
function channelPinnedContextWindow(normalizedName) {
|
|
@@ -1401,12 +1615,14 @@ export {
|
|
|
1401
1615
|
summaryCompletionTokens,
|
|
1402
1616
|
selectSummaryRoute,
|
|
1403
1617
|
runSummaryWithContract,
|
|
1404
|
-
sha256Hex,
|
|
1405
1618
|
COMPACTION_SUMMARY_SCHEMA_VERSION,
|
|
1406
1619
|
COMPACTION_SUMMARY_SYSTEM_PROMPT,
|
|
1407
|
-
|
|
1620
|
+
buildHistoricalCompactionRequest,
|
|
1408
1621
|
buildCompactionMetricsFromPlan,
|
|
1409
1622
|
formatCompactionMetricsLog,
|
|
1410
1623
|
computeSummarySourceMetadata,
|
|
1411
|
-
buildSummarySourceDiagnostics
|
|
1624
|
+
buildSummarySourceDiagnostics,
|
|
1625
|
+
buildSummarySourceSegments,
|
|
1626
|
+
diffSummarySourceSegments,
|
|
1627
|
+
sanitizeSummarySourceSegments
|
|
1412
1628
|
};
|