nolo-cli 0.226.0-alpha.1 → 0.226.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-UE2NJPZD.js → _executeModel-IZ2MCXHO.js} +89 -83
- package/{action-CK64LS6S.js → action-VDEW6WLI.js} +9 -6
- package/{addContentAction-EQXMFNPR.js → addContentAction-7YVXHIPQ.js} +15 -14
- package/{addDialogAgentAction-RSDZDASD.js → addDialogAgentAction-BX7B47HF.js} +18 -17
- package/{agentDeleteCommand-SOI25WK7.js → agentDeleteCommand-N7ELXPLD.js} +145 -138
- package/{agentEmailCommands-UGWQQNKM.js → agentEmailCommands-OFS477PV.js} +144 -133
- package/{agentFavoriteCommands-2LKGKSUD.js → agentFavoriteCommands-7LOP3HUD.js} +5 -5
- package/{agentGrantCommands-QQV4N4JW.js → agentGrantCommands-L6O2HVJI.js} +5 -5
- package/agentListCommands-IQQHJSXP.js +644 -0
- package/{agentMachineCommands-M6IKO7XE.js → agentMachineCommands-NS65BEW7.js} +75 -66
- package/{agentProviderCommands-7BSJH7TO.js → agentProviderCommands-SS6M6VGY.js} +6 -6
- package/{agentPullCommand-XN6ZPBUW.js → agentPullCommand-QQQZSC6S.js} +6 -6
- package/agentRecordCommands-4VE7CNLC.js +188 -0
- package/agentRunCommand-2MUXHKNW.js +223 -0
- package/{agentRunControl-DFEEOFC7.js → agentRunControl-55GL6Q3M.js} +23 -15
- package/{agentRuntimeLocal-GSTYFEX4.js → agentRuntimeLocal-5DB2P4MU.js} +63 -49
- package/{agentSlice-7PTNWEED.js → agentSlice-5VTAFG43.js} +19 -18
- package/{appDeleteCommands-L7HL4AWF.js → appDeleteCommands-EDKUPHJM.js} +67 -58
- package/{appDeployCommands-SGSUNFZR.js → appDeployCommands-JO74GW4L.js} +67 -58
- package/{appDeployStatusCommands-AAA3XD54.js → appDeployStatusCommands-U77ZUHX7.js} +67 -58
- package/{appGetCommands-LN72GAOA.js → appGetCommands-QCMHBYPX.js} +67 -58
- package/{appListCommands-IJQQ3VND.js → appListCommands-ZQJYEXI6.js} +67 -58
- package/{authCommand-7JXW54U4.js → authCommand-W4KXRZLI.js} +33 -28
- package/{authCommands-YDNAIDEY.js → authCommands-6AUYO65N.js} +15 -10
- package/{builtinSkillRegistry-PXH7EGQB.js → builtinSkillRegistry-GHE3RD3V.js} +8 -8
- package/{chromeCommands-G5UDKVSV.js → chromeCommands-S7AW3AOD.js} +383 -6
- package/{chromeOpsCommands-YKX2QX3A.js → chromeOpsCommands-TBPM6MR4.js} +6 -6
- package/{chunk-7Z6EW7AH.js → chunk-247AAJRK.js} +13 -6
- package/{chunk-P2ZLUIW2.js → chunk-2BSLGODA.js} +350 -25
- package/{chunk-4HFTBHBF.js → chunk-2N4UBHUU.js} +8 -8
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-GSAS72AN.js → chunk-2T5BHLID.js} +2871 -1565
- package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
- package/{chunk-VFBVA3U2.js → chunk-3OQFXODL.js} +131 -40
- package/{chunk-BGGHA5DV.js → chunk-3ORFJP2Z.js} +1 -1
- package/{chunk-OWH2BLNU.js → chunk-3UNAGTBW.js} +32 -95
- package/{chunk-LM2PS3YS.js → chunk-4F7SWSWO.js} +26 -13
- package/{chunk-SBVTHMEG.js → chunk-4FE3IWRE.js} +1 -1
- package/{chunk-GOAPXKQU.js → chunk-4UK6UBXF.js} +4 -4
- package/{chunk-4JVNURX4.js → chunk-4YFC3DWW.js} +68 -16
- package/chunk-4ZCTKB27.js +31 -0
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-TD6QCQ5G.js → chunk-5GRWWUB4.js} +4 -4
- package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-ZH6MUQEO.js → chunk-6326DRQY.js} +1 -1
- package/{chunk-AVHRSJUH.js → chunk-6MQWGA5F.js} +31 -24
- package/{chunk-67BE44IS.js → chunk-6MX6S6TE.js} +3 -3
- package/chunk-6RSNVJGO.js +279 -0
- package/{chunk-BRW24CTE.js → chunk-6S6CZUXK.js} +42 -33
- package/{chunk-PDCV7P5W.js → chunk-6XIE5ZGI.js} +1 -1
- package/{chunk-CVS5IMJ5.js → chunk-6XLWUNZB.js} +25 -25
- package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
- package/{chunk-62HXNQVV.js → chunk-776CXKMX.js} +1 -1
- package/{chunk-6J4TTPS2.js → chunk-7AWKDRXG.js} +5 -5
- package/{chunk-3KNEE64G.js → chunk-7GTXPS3D.js} +16 -16
- package/{chunk-FS3RA7D2.js → chunk-7HUHOCIY.js} +147 -162
- package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
- package/chunk-BEM6LPD2.js +734 -0
- package/{chunk-AGP3YSEC.js → chunk-BH7CEVOH.js} +46 -1
- package/chunk-BIDSIRTS.js +307 -0
- package/{chunk-VTW7VKZX.js → chunk-C4KX626C.js} +15 -15
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-4PMZVBDU.js → chunk-CHYYSFFM.js} +6 -6
- package/{chunk-VREDDN25.js → chunk-CJTB3OYB.js} +14 -9
- package/{chunk-YFLVRVYK.js → chunk-DLT2DN4M.js} +1 -1
- package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
- package/{chunk-EOWLBDY6.js → chunk-DOK7GDRU.js} +1 -1
- package/{chunk-5NC6A2RZ.js → chunk-DPAIQLAL.js} +105 -102
- package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
- package/{chunk-XN23AUVU.js → chunk-EKXPHL7M.js} +8 -5
- package/{chunk-DISQCYPE.js → chunk-ENYTIRIO.js} +6 -6
- package/{chunk-2TIQO6TC.js → chunk-ER3P6MBT.js} +206 -308
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-JM5C4EUA.js → chunk-F4MCAOWN.js} +6 -6
- package/chunk-FDZ2GBWO.js +166 -0
- package/{chunk-PMDVQBGA.js → chunk-GAHJLSDO.js} +14 -7
- package/{chunk-N5PQJKCY.js → chunk-GES5GIAU.js} +14 -13
- package/{chunk-HYHIAM6T.js → chunk-HQVNO7FH.js} +66 -35
- package/chunk-HSWEFHFS.js +103 -0
- package/{chunk-S2NTVGA2.js → chunk-I2OYPD3Y.js} +1 -1
- package/{chunk-F7DU25CE.js → chunk-IIG3TT73.js} +460 -123
- package/{chunk-AK5O76CC.js → chunk-IZJFTY4R.js} +3 -3
- package/{chunk-2VA6TU4I.js → chunk-J25ESVUW.js} +22 -19
- package/{chunk-TUIWP2LF.js → chunk-J2XZZXIH.js} +4 -4
- package/{chunk-JVRQ6YVK.js → chunk-JBWXPACD.js} +1 -1
- package/{chunk-D726I5AZ.js → chunk-JVJ53XCH.js} +2 -2
- package/{chunk-TXGQ4O5S.js → chunk-KC2QVCI7.js} +20 -174
- package/{chunk-UKS7D2NL.js → chunk-KF2DWSAH.js} +113 -28
- package/chunk-KK3FCYZM.js +647 -0
- package/{chunk-ZZ4M2I3R.js → chunk-KLD7K5FD.js} +349 -16
- package/{chunk-JIADJPUV.js → chunk-KMW5CRRM.js} +1564 -2955
- package/{chunk-N5Z2V73W.js → chunk-LELADM5Q.js} +1 -1
- package/{chunk-4NA3YTBC.js → chunk-LMFMV5UC.js} +8 -8
- package/{chunk-KZU52OJ5.js → chunk-LZOOUQAZ.js} +6 -6
- package/{chunk-VV7TXWOC.js → chunk-M5EA44QU.js} +6 -6
- package/{chunk-UYOICCYG.js → chunk-MEDPR36J.js} +64 -89
- package/chunk-MFXJY44K.js +133 -0
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-3QFLXA24.js → chunk-N6EN3HK3.js} +3 -3
- package/{chunk-SOF4OWDM.js → chunk-NEG5LYK5.js} +1 -3
- package/{chunk-HJAO2NAL.js → chunk-ODGSLWLO.js} +593 -370
- package/{chunk-OB6DVWPF.js → chunk-OGZE6BZG.js} +331 -99
- package/{chunk-KYH7XW3K.js → chunk-OJRTTERA.js} +77 -2
- package/{chunk-2VUZSVAS.js → chunk-OKPC4QNX.js} +57 -20
- package/{chunk-SOG7OEXX.js → chunk-ONFFUQYM.js} +1 -1
- package/{chunk-KNIIRXHF.js → chunk-P244EH4W.js} +46 -8
- package/chunk-P27E22MA.js +203 -0
- package/{chunk-YDBMZ7FV.js → chunk-PK7VT4ZU.js} +3 -3
- package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
- package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
- package/{chunk-5RKUPJYL.js → chunk-QLUYDJST.js} +11 -3
- package/{chunk-EVPIBQ5I.js → chunk-QUJKDFZW.js} +17 -17
- package/{chunk-C4VAR65S.js → chunk-QXUVCIPB.js} +204 -124
- package/{chunk-X4OVEYPX.js → chunk-QYNABNNQ.js} +13 -13
- package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/{chunk-KC4SCKXO.js → chunk-RGUWOMXU.js} +1234 -1451
- package/{chunk-IZIN2UNJ.js → chunk-RH44TIHX.js} +206 -27
- package/{chunk-GNHMRBYZ.js → chunk-RIMFTQMC.js} +282 -58
- package/{chunk-VQUWV3YR.js → chunk-S25VJYXV.js} +9 -3
- package/{chunk-X7YC2OHB.js → chunk-SBRJOYND.js} +723 -355
- package/{chunk-UEKXWO7A.js → chunk-SBRSXY67.js} +18 -7
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
- package/chunk-T3WSFTBS.js +62 -0
- package/{chunk-KEN3N2TN.js → chunk-TB5KTLNB.js} +15 -12
- package/{chunk-VP3BINY7.js → chunk-TOK555CQ.js} +31 -1
- package/{chunk-OBSEKCVK.js → chunk-U4VSBDO5.js} +88 -0
- package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
- package/{chunk-GGKNJ42M.js → chunk-UDT4SI37.js} +18 -108
- package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
- package/{chunk-GVGOEMNV.js → chunk-UQXOORR3.js} +5 -5
- package/{chunk-GS4OTYCH.js → chunk-UR7555FE.js} +9 -9
- package/{chunk-QLFCTYRH.js → chunk-UWOCASVL.js} +20 -13
- package/{chunk-C4WTX5TU.js → chunk-V2V5Q6DU.js} +2 -2
- package/{chunk-2ZKFCIJJ.js → chunk-VCU5GV42.js} +1 -1
- package/{chunk-FTQWYWUI.js → chunk-VMWY7TUA.js} +1 -1
- package/chunk-VNALJT32.js +33394 -0
- package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
- package/chunk-WBSJAIZP.js +170 -0
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-UJKTI5PG.js → chunk-WRKMXMU7.js} +2 -1
- package/chunk-WVOZ35E4.js +1438 -0
- package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
- package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
- package/{chunk-GIABSSWQ.js → chunk-XDNXKFWF.js} +6 -6
- package/{chunk-GBZ4YKEO.js → chunk-XLN2GD6Z.js} +7 -7
- package/{chunk-45LZIYXB.js → chunk-XNEDFWT4.js} +2 -2
- package/{chunk-EWPDMS4N.js → chunk-Y22P6ASC.js} +32 -17
- package/{chunk-LJSNEV7M.js → chunk-Y3DOUQQQ.js} +8 -8
- package/{chunk-KOXKKHFE.js → chunk-Y5EBOURK.js} +10 -5
- package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
- package/{chunk-PVZY6P3S.js → chunk-YTEY27GN.js} +2 -2
- package/chunk-YUZ2DAIH.js +34 -0
- package/chunk-Z6YTCDU4.js +24 -0
- package/{chunk-MOMR7NMG.js → chunk-ZCVBIIUE.js} +4 -4
- package/{chunk-AZQZ5XPM.js → chunk-ZCZLTJEW.js} +98 -57
- package/{chunk-KN3HEZIQ.js → chunk-ZVOL2MAJ.js} +1 -1
- package/{cliAgentConfigHelpers-KICKKNYQ.js → cliAgentConfigHelpers-6OFDHJFT.js} +13 -13
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliEnvHelpers-VPSJ4XWC.js → cliEnvHelpers-CNMP3RDX.js} +1 -1
- package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
- package/cliLocalAgentRecordReader-FHIMCBUK.js +102 -0
- package/{commandRegistry-XSMTI5PG.js → commandRegistry-OKIWAJIS.js} +113 -101
- package/{contentThunks-S4NNC7R2.js → contentThunks-VF2DCU46.js} +41 -38
- package/{cooldownCommands-X7P5M2V5.js → cooldownCommands-QL6DWGVU.js} +4 -4
- package/{createAgentAutomationAction-TH7ZEACJ.js → createAgentAutomationAction-BGET7Q6K.js} +41 -38
- package/{createDialogAction-SYZAYIIQ.js → createDialogAction-XYDQZETK.js} +42 -40
- package/{createPageAction-7Y4U6TXO.js → createPageAction-74S5RO7U.js} +46 -43
- package/{db-CS4ZJQKV.js → db-6NRZLEW2.js} +10 -7
- package/{dbSlice-ZJPDIFER.js → dbSlice-FI7VNDR5.js} +14 -13
- package/{deleteFile-Q3YDB4ML.js → deleteFile-GD62MPZW.js} +10 -7
- package/{dialogCommands-V5IYEOQP.js → dialogCommands-Y6DHZUAM.js} +71 -64
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-77B57PL6.js → dialogNotifyCommand-MKXL4NGL.js} +15 -15
- package/{dialogSlice-O3RHDAWK.js → dialogSlice-XAUKSWZ4.js} +41 -38
- package/{dialogUsageCommand-HTVPR2CX.js → dialogUsageCommand-BZPKR3DW.js} +6 -6
- package/{docCreateCommands-36WS33BK.js → docCreateCommands-PHDFOQBM.js} +66 -57
- package/{docDeleteCommands-C4CS4XLF.js → docDeleteCommands-OSHJM67Y.js} +69 -60
- package/{docReadCommands-QZMSFMPN.js → docReadCommands-E6QYCFMS.js} +66 -57
- package/{docStore-PYNEODAH.js → docStore-ZZT2BEBU.js} +16 -15
- package/{docUpdateCommands-BYI64HVV.js → docUpdateCommands-DHIOPK2C.js} +66 -57
- package/fetchMessages-TQEUZD7H.js +2 -2
- package/{getPricing-VNGFM4PN.js → getPricing-RNRITFOP.js} +6 -6
- package/{handleSendMessageAction-Z43FP2E2.js → handleSendMessageAction-ARUU6CNF.js} +83 -78
- package/{hostCredentialCreate-Y7YIGKP4.js → hostCredentialCreate-SNQT73H4.js} +131 -119
- package/index.js +56 -18
- package/keys-RWF7UCB4.js +1 -1
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-SVTPA5GY.js → localDialogRead-3T2KMCRC.js} +1 -1
- package/{localRuntimeAdapter-ZLJONQZS.js → localRuntimeAdapter-MHI6Y2IZ.js} +143 -130
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-7DKIT7UH.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
- package/{machineCommands-4ZLMRIA3.js → machineCommands-3O6Y27R4.js} +283 -348
- package/machineWsRunDispatch-5PFLR5XC.js +203 -0
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/mcpLocalAuthorizeCommand-BQCQ2KRJ.js +106 -0
- package/{memberThunks-JRYNONYV.js → memberThunks-TU6A6OBV.js} +24 -19
- package/{memoryCommands-5WC3T66U.js → memoryCommands-BC6REPQB.js} +4 -4
- package/{models-H5NNZRLH.js → models-CINY5UZR.js} +2 -2
- package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
- package/package.json +1 -1
- package/{projectArchive-JBX6HNK6.js → projectArchive-X2EVXU3N.js} +47 -44
- package/{providerPresetApply-J3WMRPD2.js → providerPresetApply-HUWNV2NI.js} +7 -7
- package/{providerRegistry-KJGB5XWS.js → providerRegistry-7FWKDKZJ.js} +7 -7
- package/{read-Q7GOHGNP.js → read-QAHEQID5.js} +9 -8
- package/{readDocTool-Z5OQ6422.js → readDocTool-KG5DP6EM.js} +1 -1
- package/{readlineWorkspace-WFPIAAAT.js → readlineWorkspace-SO3APHVP.js} +8125 -6196
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-U3F2MNAY.js → removeDialogAgentAction-QZCCVK2G.js} +20 -19
- package/{runAgentClientLoop-STI5TKDJ.js → runAgentClientLoop-FLHHCOVH.js} +106 -81
- package/{runtimeDoctorCommands-UXKXYBW6.js → runtimeDoctorCommands-DN3I52C6.js} +17 -17
- package/{secretCommands-LJXOOYA7.js → secretCommands-36BCE3UE.js} +4 -4
- package/{setDialogExtraReferencesAction-G3WSJ7EM.js → setDialogExtraReferencesAction-PDPTYSEW.js} +17 -16
- package/{setPrimaryDialogAgentAction-6FHAHZBB.js → setPrimaryDialogAgentAction-DOUIPR66.js} +20 -19
- package/{settingThunks-AXTBX3Q5.js → settingThunks-MHGGP6UE.js} +186 -67
- package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-GUKMDRWN.js → spaceCommands-JH7UYE3K.js} +70 -61
- package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
- package/{streamAgentChatTurn-A2WL5OOF.js → streamAgentChatTurn-VDDA2TX6.js} +200 -195
- package/{switchDialogAgentAction-UOFIAGPL.js → switchDialogAgentAction-7USK3DAP.js} +18 -17
- package/{tableCommands-HITDSLHS.js → tableCommands-UONBFC7L.js} +15 -12
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-53YMJ2G6.js} +8 -6
- package/{tools-6NU5E6BN.js → tools-MIOCXKMG.js} +72 -68
- package/tuiRestart-ET3QISZ5.js +41 -0
- package/{tuiSummaryLlmCaller-7WLUKNP2.js → tuiSummaryLlmCaller-MSINBP3M.js} +21 -20
- package/{updateCommands-RJVCRSBP.js → updateCommands-5OYND6EF.js} +8 -6
- package/{updateDialogTitleAction-VMKU2Y67.js → updateDialogTitleAction-2L4CC4YO.js} +43 -40
- package/{usageCommand-YPJ2ZI2F.js → usageCommand-JTKDAG6I.js} +3 -3
- package/{usageRebuildCommand-FERQO74C.js → usageRebuildCommand-4TFZCKXM.js} +4 -4
- package/webapi-24RZDIIQ.js +2488 -0
- package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-HIYNL3VR.js} +2 -2
- package/workContext-Y3ADAPZU.js +14 -0
- package/workContextAccess-UZHDLBUR.js +11 -0
- package/workContextWriteNotice-YCSSMHN4.js +7 -0
- package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-ZCSQCHG3.js} +9 -9
- package/agentListCommands-YBNOQ5T3.js +0 -991
- package/agentRecordCommands-3HL7Z4X6.js +0 -177
- package/agentRunCommand-C64A6MPL.js +0 -208
- package/chunk-2THCNKE4.js +0 -147
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-5ZMIIR23.js +0 -265
- package/chunk-652XYZGP.js +0 -352
- package/chunk-BJF2MHJ3.js +0 -118
- package/chunk-KEPOVMF4.js +0 -91
- package/chunk-QVBXJNZ2.js +0 -81
- package/chunk-QZI44GWV.js +0 -776
- package/cliLocalAgentRecordReader-6FXGFBI3.js +0 -90
- package/machineWsRunDispatch-L7Z3ULDF.js +0 -192
- package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +3 -3
- package/{chunk-W6RFEDN4.js → chunk-AETZ7AD6.js} +3 -3
- package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
- package/{chunk-SNBZZPYH.js → chunk-OQHIVPG4.js} +3 -3
- package/{chunk-47ITIXO7.js → chunk-USGHJSGO.js} +3 -3
- package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
- package/{offlineMarxistsAgentCommand-4IC3Y4C6.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +3 -3
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
MEMORY_USE_GUIDANCE
|
|
2
|
+
MEMORY_USE_GUIDANCE
|
|
3
|
+
} from "./chunk-YGDYYFRX.js";
|
|
4
|
+
import {
|
|
3
5
|
wrapHistoricalSummaryWithReplayGuard
|
|
4
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2SXN7LAY.js";
|
|
5
7
|
|
|
6
8
|
// packages/agent-runtime/skillCatalog.ts
|
|
7
9
|
var SKILL_CATALOG_PRIORITY = Object.freeze([
|
|
@@ -190,79 +192,8 @@ function resolveSkillCatalogSync(sources, query = {}, budget = DEFAULT_SKILL_CAT
|
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
// packages/agent-runtime/turnContext.ts
|
|
193
|
-
var DEFAULT_RECENT_CONTENT_LIMIT = 10;
|
|
194
195
|
var asTrimmed = (value) => typeof value === "string" ? value.trim() : "";
|
|
195
|
-
var asFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
196
|
-
var spaceRecordKey = (spaceId) => spaceId.startsWith("space-") ? spaceId : `space-${spaceId}`;
|
|
197
196
|
var makeLayer = (id, content, cacheScope = "turn") => ({ id, owner: "runtime", cacheScope, content });
|
|
198
|
-
var renderSpaceStructure = (spaceRecord, recentLimit) => {
|
|
199
|
-
const categories = spaceRecord.categories ?? {};
|
|
200
|
-
const validCategories = Object.entries(categories).filter((entry) => entry[1] !== null).sort(
|
|
201
|
-
(a, b) => asFiniteNumber(a[1].order) - asFiniteNumber(b[1].order)
|
|
202
|
-
);
|
|
203
|
-
const categoryNameById = /* @__PURE__ */ new Map();
|
|
204
|
-
let struct = "Directory Structure (Categories):\n";
|
|
205
|
-
if (validCategories.length === 0) struct += "(No categories defined)\n";
|
|
206
|
-
validCategories.forEach(([id, category]) => {
|
|
207
|
-
const name = asTrimmed(category.name) || id;
|
|
208
|
-
categoryNameById.set(id, name);
|
|
209
|
-
struct += `- ${name} (ID: ${id})
|
|
210
|
-
`;
|
|
211
|
-
});
|
|
212
|
-
const contents = spaceRecord.contents ?? {};
|
|
213
|
-
const recentContents = recentLimit > 0 ? Object.values(contents).filter((content) => content !== null).sort(
|
|
214
|
-
(a, b) => asFiniteNumber(b.updatedAt) - asFiniteNumber(a.updatedAt)
|
|
215
|
-
).slice(0, recentLimit) : [];
|
|
216
|
-
if (recentContents.length > 0) {
|
|
217
|
-
struct += `
|
|
218
|
-
Recent Contents (Top ${recentLimit}):
|
|
219
|
-
`;
|
|
220
|
-
recentContents.forEach((content) => {
|
|
221
|
-
const categoryId = asTrimmed(content.categoryId);
|
|
222
|
-
const categoryName = categoryId ? categoryNameById.get(categoryId) || "Unknown" : "Uncategorized";
|
|
223
|
-
struct += `- [${asTrimmed(content.type) || "content"}] ${asTrimmed(content.title)} (Category: ${categoryName}, dbKey: ${asTrimmed(content.contentKey)})
|
|
224
|
-
`;
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
return struct;
|
|
228
|
-
};
|
|
229
|
-
var buildSpaceContextLayer = async (args) => {
|
|
230
|
-
const spaceId = asTrimmed(args.spaceId);
|
|
231
|
-
if (!spaceId) return null;
|
|
232
|
-
const recentLimit = args.recentContentLimit ?? DEFAULT_RECENT_CONTENT_LIMIT;
|
|
233
|
-
let spaceRecord = null;
|
|
234
|
-
let readError = null;
|
|
235
|
-
try {
|
|
236
|
-
spaceRecord = await args.source.readRecord(spaceRecordKey(spaceId));
|
|
237
|
-
} catch (error) {
|
|
238
|
-
readError = error instanceof Error ? error.message : String(error);
|
|
239
|
-
}
|
|
240
|
-
if (!spaceRecord) {
|
|
241
|
-
return makeLayer(
|
|
242
|
-
"space-context",
|
|
243
|
-
[
|
|
244
|
-
"--- \u5F53\u524D\u7A7A\u95F4\uFF08Space\uFF09---",
|
|
245
|
-
`\u672C\u5BF9\u8BDD\u8BB0\u5F55\u58F0\u660E\u5C5E\u4E8E Space ${spaceId}\uFF0C\u4F46\u5F53\u524D\u65E0\u6CD5\u8BFB\u53D6\u8BE5 Space \u7684\u6570\u636E${readError ? `\uFF08${readError}\uFF09` : "\uFF08\u8BB0\u5F55\u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u8FBE\uFF09"}\u3002`,
|
|
246
|
-
"\u5982\u88AB\u95EE\u53CA\uFF0C\u8BF7\u5982\u5B9E\u8BF4\u660E\u300C\u5BF9\u8BDD\u5C5E\u4E8E\u8BE5 Space \u4F46\u6682\u65F6\u8BFB\u4E0D\u5230\u7A7A\u95F4\u8BE6\u60C5\u300D\uFF0C\u4E0D\u8981\u58F0\u79F0\u5BF9\u8BDD\u4E0D\u5C5E\u4E8E\u4EFB\u4F55\u7A7A\u95F4\u3002"
|
|
247
|
-
].join("\n")
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
const name = asTrimmed(spaceRecord.name);
|
|
251
|
-
const description = asTrimmed(spaceRecord.description);
|
|
252
|
-
const structure = renderSpaceStructure(spaceRecord, recentLimit);
|
|
253
|
-
return makeLayer(
|
|
254
|
-
"space-context",
|
|
255
|
-
[
|
|
256
|
-
"--- \u5F53\u524D\u7A7A\u95F4\uFF08Space\uFF09---",
|
|
257
|
-
"\u672C\u5BF9\u8BDD\u5C5E\u4E8E\u4EE5\u4E0B Space\uFF1A",
|
|
258
|
-
`Space Title: ${name || spaceId}`,
|
|
259
|
-
`Space ID: ${spaceId}`,
|
|
260
|
-
`Description: ${description || "N/A"}`,
|
|
261
|
-
"",
|
|
262
|
-
structure.trimEnd()
|
|
263
|
-
].join("\n")
|
|
264
|
-
);
|
|
265
|
-
};
|
|
266
197
|
var buildSkillDiscoveryCatalogLayer = (catalog) => {
|
|
267
198
|
if (catalog.entries.length === 0) return null;
|
|
268
199
|
const sources = catalog.entries.map((entry) => entry.source).filter((source, index, all) => all.indexOf(source) === index);
|
|
@@ -311,37 +242,6 @@ var buildAgentsMdLayer = (content, fileName = "AGENTS.md") => {
|
|
|
311
242
|
"session"
|
|
312
243
|
);
|
|
313
244
|
};
|
|
314
|
-
var buildLinkedSpacesSection = async (args) => {
|
|
315
|
-
const ids = (args.linkedSpaceIds ?? []).filter(
|
|
316
|
-
(id) => typeof id === "string" && id.trim() !== ""
|
|
317
|
-
);
|
|
318
|
-
if (ids.length === 0) return null;
|
|
319
|
-
const lines = [];
|
|
320
|
-
for (const rawId of ids) {
|
|
321
|
-
const spaceId = asTrimmed(rawId);
|
|
322
|
-
let spaceData = null;
|
|
323
|
-
try {
|
|
324
|
-
spaceData = await args.source.readRecord(spaceRecordKey(spaceId));
|
|
325
|
-
} catch {
|
|
326
|
-
spaceData = null;
|
|
327
|
-
}
|
|
328
|
-
if (spaceData) {
|
|
329
|
-
const name = asTrimmed(spaceData.name) || spaceId;
|
|
330
|
-
const desc = asTrimmed(spaceData.description);
|
|
331
|
-
lines.push(`- ${name} (ID: ${spaceId})${desc ? `: ${desc}` : ""}`);
|
|
332
|
-
} else {
|
|
333
|
-
lines.push(`- [\u65E0\u6CD5\u8BBF\u95EE] ${spaceId}`);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
if (lines.length === 0) return null;
|
|
337
|
-
return [
|
|
338
|
-
"--- \u5173\u8054\u7A7A\u95F4 (Linked Spaces) ---",
|
|
339
|
-
"\u4EE5\u4E0B\u662F Agent \u53EF\u8BBF\u95EE\u7684\u5176\u4ED6\u5DE5\u4F5C\u7A7A\u95F4\uFF08\u7C97\u7565\u4E0A\u4E0B\u6587\uFF09\uFF1A",
|
|
340
|
-
lines.join("\n"),
|
|
341
|
-
"",
|
|
342
|
-
"\u63D0\u793A\uFF1A\u5982\u9700\u67E5\u8BE2\u8FD9\u4E9B\u7A7A\u95F4\u7684\u8BE6\u7EC6\u5185\u5BB9\uFF0C\u53EF\u4F7F\u7528 read \u5DE5\u5177\u914D\u5408\u5BF9\u5E94\u7684 dbKey\u3002"
|
|
343
|
-
].join("\n");
|
|
344
|
-
};
|
|
345
245
|
var renderTurnContextBlocksWithScope = (layers) => layers.filter((layer) => Boolean(layer?.content?.trim())).map((layer) => ({
|
|
346
246
|
content: layer.content.trim(),
|
|
347
247
|
cacheScope: layer.cacheScope
|
|
@@ -358,6 +258,9 @@ var buildDialogSummaryLayer = (args) => {
|
|
|
358
258
|
return makeLayer("dialog-summary", `--- \u5386\u53F2\u5BF9\u8BDD\u6458\u8981 ---
|
|
359
259
|
${historical}`);
|
|
360
260
|
};
|
|
261
|
+
var hasMemoryTools = (toolNames) => Array.isArray(toolNames) ? toolNames.some(
|
|
262
|
+
(name) => typeof name === "string" && /memory/i.test(name)
|
|
263
|
+
) : false;
|
|
361
264
|
var buildMemoryOverlayLayer = (args) => {
|
|
362
265
|
const promptBlock = asTrimmed(args.promptBlock);
|
|
363
266
|
if (!promptBlock) return null;
|
|
@@ -365,7 +268,7 @@ var buildMemoryOverlayLayer = (args) => {
|
|
|
365
268
|
};
|
|
366
269
|
var buildMemoryUseGuidanceLayer = (args) => {
|
|
367
270
|
const promptBlock = asTrimmed(args.promptBlock);
|
|
368
|
-
if (!promptBlock) return null;
|
|
271
|
+
if (!promptBlock && args.hasMemoryTools !== true) return null;
|
|
369
272
|
return makeLayer(
|
|
370
273
|
"memory-use-guidance",
|
|
371
274
|
MEMORY_USE_GUIDANCE,
|
|
@@ -379,14 +282,13 @@ export {
|
|
|
379
282
|
mapDiscoveredSkillsToCatalogEntries,
|
|
380
283
|
resolveSkillCatalog,
|
|
381
284
|
resolveSkillCatalogSync,
|
|
382
|
-
buildSpaceContextLayer,
|
|
383
285
|
buildSkillDiscoveryCatalogLayer,
|
|
384
286
|
buildAgentsMdLayerHeader,
|
|
385
287
|
buildAgentsMdLayer,
|
|
386
|
-
buildLinkedSpacesSection,
|
|
387
288
|
renderTurnContextBlocksWithScope,
|
|
388
289
|
partitionScopedBlocks,
|
|
389
290
|
buildDialogSummaryLayer,
|
|
291
|
+
hasMemoryTools,
|
|
390
292
|
buildMemoryOverlayLayer,
|
|
391
293
|
buildMemoryUseGuidanceLayer
|
|
392
294
|
};
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
loadFileFromIndexedDb,
|
|
7
7
|
removeAction,
|
|
8
8
|
saveFileToIndexedDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-V2V5Q6DU.js";
|
|
10
10
|
import {
|
|
11
11
|
readAction,
|
|
12
12
|
readRequestManager,
|
|
13
13
|
resolveAgentReadServers
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UWOCASVL.js";
|
|
15
15
|
import {
|
|
16
16
|
beginWriteAck,
|
|
17
17
|
compareRemoteRecordsByComparableTime,
|
|
@@ -29,19 +29,22 @@ import {
|
|
|
29
29
|
shouldReplaceLocalWithRemoteRecord,
|
|
30
30
|
shouldReplicateLocalRecord,
|
|
31
31
|
uploadToCurrentServer
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-OKPC4QNX.js";
|
|
33
33
|
import {
|
|
34
34
|
asyncThunkCreator,
|
|
35
35
|
buildCreateSlice,
|
|
36
36
|
createEntityAdapter,
|
|
37
37
|
noloDeleteRequest
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-247AAJRK.js";
|
|
39
39
|
import {
|
|
40
40
|
fetchFromClientDb,
|
|
41
41
|
fetchFromServer,
|
|
42
|
+
googleSessionRequestToken,
|
|
43
|
+
googleSessionServer,
|
|
42
44
|
logger,
|
|
43
|
-
normalizeTimeFields
|
|
44
|
-
|
|
45
|
+
normalizeTimeFields,
|
|
46
|
+
scopeGoogleSessionServers
|
|
47
|
+
} from "./chunk-BH7CEVOH.js";
|
|
45
48
|
import {
|
|
46
49
|
isTombstoneRecord
|
|
47
50
|
} from "./chunk-BV3FLP2L.js";
|
|
@@ -53,11 +56,14 @@ import {
|
|
|
53
56
|
ulid
|
|
54
57
|
} from "./chunk-OJKUU3LP.js";
|
|
55
58
|
import {
|
|
56
|
-
|
|
57
|
-
} from "./chunk-
|
|
59
|
+
isPublicBuiltinPlatformAgentKey
|
|
60
|
+
} from "./chunk-WRKMXMU7.js";
|
|
58
61
|
import {
|
|
59
62
|
API_ENDPOINTS
|
|
60
63
|
} from "./chunk-LCBAMY2M.js";
|
|
64
|
+
import {
|
|
65
|
+
isRecord
|
|
66
|
+
} from "./chunk-KUG52IAP.js";
|
|
61
67
|
|
|
62
68
|
// packages/database/protectedRecordProtocol.ts
|
|
63
69
|
var PROTECTED_RECORD_PROTOCOL_VERSION = 1;
|
|
@@ -643,14 +649,14 @@ async function getPageReadBaseline(db, actorId, dbKey) {
|
|
|
643
649
|
async function readProtectedPage(options) {
|
|
644
650
|
const { db, actorId, dbKey } = options;
|
|
645
651
|
const assertAccess = (origin) => {
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
652
|
+
const access2 = options.getCurrentAccess?.() ?? options;
|
|
653
|
+
if (access2.actorId !== actorId || !access2.token?.trim()) {
|
|
648
654
|
throw Error("\u6587\u6863\u8BFB\u53D6\u8EAB\u4EFD\u5DF2\u53D8\u5316\u6216\u8BA4\u8BC1\u5DF2\u64A4\u9500\uFF0C\u5DF2\u505C\u6B62\u8BFB\u53D6");
|
|
649
655
|
}
|
|
650
|
-
if (origin && !
|
|
656
|
+
if (origin && !access2.servers.some((server) => originOf(server) === origin)) {
|
|
651
657
|
throw Error("\u6587\u6863\u5F52\u5C5E\u670D\u52A1\u5668\u4E0D\u5728\u5DF2\u914D\u7F6E\u670D\u52A1\u5668\u4E2D\u6216\u5DF2\u79FB\u9664\uFF0C\u672A\u53D1\u9001\u8BA4\u8BC1\u4FE1\u606F\uFF0C\u672A\u8F6C\u53D1\u8BA4\u8BC1\u4FE1\u606F");
|
|
652
658
|
}
|
|
653
|
-
return
|
|
659
|
+
return origin ? googleSessionRequestToken(access2.token, origin) : access2.token;
|
|
654
660
|
};
|
|
655
661
|
assertAccess();
|
|
656
662
|
const sync = options.sync ?? createProtectedRecordSync({ db });
|
|
@@ -664,13 +670,10 @@ async function readProtectedPage(options) {
|
|
|
664
670
|
sync,
|
|
665
671
|
fetch: options.fetch,
|
|
666
672
|
isAuthorityAllowed: (origin) => {
|
|
667
|
-
const
|
|
668
|
-
return
|
|
673
|
+
const access2 = options.getCurrentAccess();
|
|
674
|
+
return access2.actorId === actorId && access2.servers.some((server) => originOf(server) === origin);
|
|
669
675
|
},
|
|
670
|
-
getToken: async () =>
|
|
671
|
-
const access = options.getCurrentAccess();
|
|
672
|
-
return access.actorId === actorId ? access.token ?? null : null;
|
|
673
|
-
}
|
|
676
|
+
getToken: async ({ authorityServer }) => assertAccess(authorityServer)
|
|
674
677
|
});
|
|
675
678
|
for (let count = 0; count < state.outbox.length; count++) {
|
|
676
679
|
if ((await transport.sendNext({ actorId, dbKey })).outcome !== "acked") break;
|
|
@@ -683,7 +686,9 @@ async function readProtectedPage(options) {
|
|
|
683
686
|
return state.workingCopy.data;
|
|
684
687
|
}
|
|
685
688
|
}
|
|
686
|
-
const
|
|
689
|
+
const access = options.getCurrentAccess?.() ?? options;
|
|
690
|
+
const googleAuthority = googleSessionServer(access.token);
|
|
691
|
+
const servers = saved ? [saved.authorityServer] : options.servers.filter((server) => access.servers.some((candidate) => originOf(candidate) === originOf(server)) && (!googleAuthority || originOf(server) === googleAuthority));
|
|
687
692
|
for (const server of servers) {
|
|
688
693
|
const origin = originOf(server);
|
|
689
694
|
if (!origin) continue;
|
|
@@ -832,6 +837,7 @@ var readAndWaitAction = async (payload, thunkApi) => {
|
|
|
832
837
|
userAuthorityRegistry
|
|
833
838
|
} = getRuntimeServerContext(state, preferredServerOrigin);
|
|
834
839
|
const allServers = resolveAgentReadServers({ dbKey, configuredServers });
|
|
840
|
+
const fetchScopedFromServer = (server, key, token, signal) => signal === void 0 ? fetchFromServer(server, key, googleSessionRequestToken(token, server, isPublicBuiltinPlatformAgentKey(key))) : fetchFromServer(server, key, googleSessionRequestToken(token, server, isPublicBuiltinPlatformAgentKey(key)), signal);
|
|
835
841
|
const isLoggedIn = !!currentToken;
|
|
836
842
|
const executeReadAndWait = async () => {
|
|
837
843
|
if (dbKey.startsWith("page-") && currentUserId && currentToken && typeof db.batch === "function") {
|
|
@@ -857,11 +863,12 @@ var readAndWaitAction = async (payload, thunkApi) => {
|
|
|
857
863
|
currentServer,
|
|
858
864
|
userAuthorityRegistry
|
|
859
865
|
});
|
|
860
|
-
|
|
866
|
+
let readServers = planAuthorityReadServers({
|
|
861
867
|
allServers,
|
|
862
868
|
authorityServer: preferredServerOrigin ?? authority.authorityServer,
|
|
863
869
|
serverOrigin: authority.serverOrigin
|
|
864
870
|
});
|
|
871
|
+
if (!isPublicBuiltinPlatformAgentKey(dbKey)) readServers = scopeGoogleSessionServers(currentToken, currentServer, readServers);
|
|
865
872
|
const hasPreferredAuthorityServer = !!preferredServerOrigin || !!authority.authorityServer;
|
|
866
873
|
const preferredAuthorityServer = hasPreferredAuthorityServer ? readServers[0] : null;
|
|
867
874
|
if (readServers.length === 0) {
|
|
@@ -874,7 +881,7 @@ var readAndWaitAction = async (payload, thunkApi) => {
|
|
|
874
881
|
}
|
|
875
882
|
if (preferredAuthorityServer) {
|
|
876
883
|
try {
|
|
877
|
-
const preferredRemoteData = await
|
|
884
|
+
const preferredRemoteData = await fetchScopedFromServer(
|
|
878
885
|
preferredAuthorityServer,
|
|
879
886
|
dbKey,
|
|
880
887
|
isLoggedIn ? currentToken : void 0
|
|
@@ -888,7 +895,7 @@ var readAndWaitAction = async (payload, thunkApi) => {
|
|
|
888
895
|
}
|
|
889
896
|
const remainingReadServers = preferredAuthorityServer ? readServers.filter((server) => server !== preferredAuthorityServer) : readServers;
|
|
890
897
|
const remotePromises = remainingReadServers.map(
|
|
891
|
-
(server) =>
|
|
898
|
+
(server) => fetchScopedFromServer(server, dbKey, isLoggedIn ? currentToken : void 0)
|
|
892
899
|
);
|
|
893
900
|
const chosenData = await processRemoteData(
|
|
894
901
|
db,
|
|
@@ -1487,7 +1494,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
1487
1494
|
// 动态 import 在调用期解析,避开 TDZ/求值顺序问题(同下方 share)。
|
|
1488
1495
|
read: create.asyncThunk(
|
|
1489
1496
|
async (payload, thunkApi) => {
|
|
1490
|
-
const { readAction: readAction2 } = await import("./read-
|
|
1497
|
+
const { readAction: readAction2 } = await import("./read-QAHEQID5.js");
|
|
1491
1498
|
return readAction2(payload, thunkApi);
|
|
1492
1499
|
},
|
|
1493
1500
|
{
|
|
@@ -1561,7 +1568,7 @@ var dbSlice = createSliceWithThunks({
|
|
|
1561
1568
|
// 这里改成动态 import,运行期才解析,彻底断开这条边。
|
|
1562
1569
|
share: create.asyncThunk(
|
|
1563
1570
|
async (config, thunkApi) => {
|
|
1564
|
-
const { shareResourceAction } = await import("./action-
|
|
1571
|
+
const { shareResourceAction } = await import("./action-VDEW6WLI.js");
|
|
1565
1572
|
return shareResourceAction(config, thunkApi);
|
|
1566
1573
|
}
|
|
1567
1574
|
),
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveLocalUserId
|
|
3
|
-
} from "./chunk-KZU52OJ5.js";
|
|
4
1
|
import {
|
|
5
2
|
resolveNoloHome
|
|
6
3
|
} from "./chunk-GLKOYSRU.js";
|
|
@@ -8,6 +5,9 @@ import {
|
|
|
8
5
|
isSupportedDialogId,
|
|
9
6
|
splitDialogKeyIdentity
|
|
10
7
|
} from "./chunk-YZMNK53S.js";
|
|
8
|
+
import {
|
|
9
|
+
resolveLocalUserId
|
|
10
|
+
} from "./chunk-LZOOUQAZ.js";
|
|
11
11
|
import {
|
|
12
12
|
toErrorMessage
|
|
13
13
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import {
|
|
2
|
+
_appendEntityBatch,
|
|
3
|
+
_appendEvidenceBatch,
|
|
4
|
+
_appendRelationBatch,
|
|
5
|
+
_appendRetiredStateBatch,
|
|
6
|
+
_appendStateBatch,
|
|
7
|
+
getMemoryEntityVNext,
|
|
8
|
+
getMemoryEvidenceVNext,
|
|
9
|
+
getMemoryEvidenceVNextStrict,
|
|
10
|
+
getMemoryStateVNext,
|
|
11
|
+
listMemoryStatesForEntityVNext
|
|
12
|
+
} from "./chunk-324FWHUA.js";
|
|
13
|
+
|
|
14
|
+
// packages/ai/memory/vnext/applyMutation.ts
|
|
15
|
+
async function validateMutation(db, ownerId, mutation) {
|
|
16
|
+
const pending = {
|
|
17
|
+
evidenceIds: /* @__PURE__ */ new Set(),
|
|
18
|
+
entityIds: /* @__PURE__ */ new Set(),
|
|
19
|
+
stateIds: /* @__PURE__ */ new Set(),
|
|
20
|
+
relationIds: /* @__PURE__ */ new Set()
|
|
21
|
+
};
|
|
22
|
+
for (const ev of mutation.evidence ?? []) {
|
|
23
|
+
if (!ev.id || typeof ev.id !== "string") {
|
|
24
|
+
throw new Error("evidence id must be a non-empty string");
|
|
25
|
+
}
|
|
26
|
+
if (pending.evidenceIds.has(ev.id)) {
|
|
27
|
+
throw new Error(`duplicate evidence id in mutation: ${ev.id}`);
|
|
28
|
+
}
|
|
29
|
+
pending.evidenceIds.add(ev.id);
|
|
30
|
+
}
|
|
31
|
+
for (const ent of mutation.entities ?? []) {
|
|
32
|
+
if (!ent.id || typeof ent.id !== "string") {
|
|
33
|
+
throw new Error("entity id must be a non-empty string");
|
|
34
|
+
}
|
|
35
|
+
if (pending.entityIds.has(ent.id)) {
|
|
36
|
+
throw new Error(`duplicate entity id in mutation: ${ent.id}`);
|
|
37
|
+
}
|
|
38
|
+
pending.entityIds.add(ent.id);
|
|
39
|
+
}
|
|
40
|
+
for (const st of mutation.states ?? []) {
|
|
41
|
+
if (!st.id || typeof st.id !== "string") {
|
|
42
|
+
throw new Error("state id must be a non-empty string");
|
|
43
|
+
}
|
|
44
|
+
if (pending.stateIds.has(st.id)) {
|
|
45
|
+
throw new Error(`duplicate state id in mutation: ${st.id}`);
|
|
46
|
+
}
|
|
47
|
+
pending.stateIds.add(st.id);
|
|
48
|
+
}
|
|
49
|
+
for (const rel of mutation.relations ?? []) {
|
|
50
|
+
if (!rel.id || typeof rel.id !== "string") {
|
|
51
|
+
throw new Error("relation id must be a non-empty string");
|
|
52
|
+
}
|
|
53
|
+
if (pending.relationIds.has(rel.id)) {
|
|
54
|
+
throw new Error(`duplicate relation id in mutation: ${rel.id}`);
|
|
55
|
+
}
|
|
56
|
+
pending.relationIds.add(rel.id);
|
|
57
|
+
}
|
|
58
|
+
const supersededIds = /* @__PURE__ */ new Set();
|
|
59
|
+
for (const sid of mutation.supersededStateIds ?? []) {
|
|
60
|
+
if (supersededIds.has(sid)) {
|
|
61
|
+
throw new Error(`duplicate supersededStateId in mutation: ${sid}`);
|
|
62
|
+
}
|
|
63
|
+
supersededIds.add(sid);
|
|
64
|
+
}
|
|
65
|
+
for (const ev of mutation.evidence ?? []) {
|
|
66
|
+
if (ev.ownerId !== ownerId) {
|
|
67
|
+
throw new Error(
|
|
68
|
+
`evidence ${ev.id} has ownerId ${ev.ownerId}, expected ${ownerId}`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (const ent of mutation.entities ?? []) {
|
|
73
|
+
if (ent.ownerId !== ownerId) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
`entity ${ent.id} has ownerId ${ent.ownerId}, expected ${ownerId}`
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const st of mutation.states ?? []) {
|
|
80
|
+
if (st.ownerId !== ownerId) {
|
|
81
|
+
throw new Error(
|
|
82
|
+
`state ${st.id} has ownerId ${st.ownerId}, expected ${ownerId}`
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
for (const rel of mutation.relations ?? []) {
|
|
87
|
+
if (rel.ownerId !== ownerId) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
`relation ${rel.id} has ownerId ${rel.ownerId}, expected ${ownerId}`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const st of mutation.states ?? []) {
|
|
94
|
+
if (supersededIds.has(st.id)) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`state ${st.id} appears in both states and supersededStateIds; a record cannot be created and retired in the same mutation`
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const facetSlots = /* @__PURE__ */ new Set();
|
|
101
|
+
for (const st of mutation.states ?? []) {
|
|
102
|
+
const slot = `${st.entityId} ${st.facet}`;
|
|
103
|
+
if (facetSlots.has(slot)) {
|
|
104
|
+
throw new Error(
|
|
105
|
+
`mutation writes parallel current states for entity ${st.entityId} facet ${st.facet}`
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
facetSlots.add(slot);
|
|
109
|
+
}
|
|
110
|
+
for (const ev of mutation.evidence ?? []) {
|
|
111
|
+
const existing = await getMemoryEvidenceVNext(db, ownerId, ev.id);
|
|
112
|
+
if (existing) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
`evidence ${ev.id} already exists (owner ${ownerId}); use a unique id`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (const ent of mutation.entities ?? []) {
|
|
119
|
+
const existing = await getMemoryEntityVNext(db, ownerId, ent.id);
|
|
120
|
+
if (existing) {
|
|
121
|
+
throw new Error(
|
|
122
|
+
`entity ${ent.id} already exists (owner ${ownerId}); use a unique id`
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
for (const st of mutation.states ?? []) {
|
|
127
|
+
if (!pending.entityIds.has(st.entityId)) {
|
|
128
|
+
const entity = await getMemoryEntityVNext(db, ownerId, st.entityId);
|
|
129
|
+
if (!entity) {
|
|
130
|
+
throw new Error(
|
|
131
|
+
`memory state ${st.id} references missing entity ${st.entityId} (owner ${ownerId})`
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
for (const evidenceId of st.evidenceIds) {
|
|
136
|
+
if (!pending.evidenceIds.has(evidenceId)) {
|
|
137
|
+
const ev = await getMemoryEvidenceVNext(db, ownerId, evidenceId);
|
|
138
|
+
if (!ev) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
`memory state ${st.id} references missing evidence ${evidenceId} (owner ${ownerId})`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const existing = await getMemoryStateVNext(db, ownerId, st.id);
|
|
146
|
+
if (existing) {
|
|
147
|
+
if (existing.retiredAt) {
|
|
148
|
+
throw new Error(
|
|
149
|
+
`cannot update retired memory state ${st.id} (owner ${ownerId})`
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
if (existing.entityId !== st.entityId || existing.facet !== st.facet) {
|
|
153
|
+
throw new Error(
|
|
154
|
+
`state ${st.id} already exists with different entity/facet (${existing.entityId}/${existing.facet} vs ${st.entityId}/${st.facet}); use supersede instead`
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (!existing) {
|
|
159
|
+
const existingStates = await listMemoryStatesForEntityVNext(db, ownerId, st.entityId);
|
|
160
|
+
for (const es of existingStates) {
|
|
161
|
+
if (es.facet === st.facet && !es.retiredAt) {
|
|
162
|
+
if (!supersededIds.has(es.id)) {
|
|
163
|
+
throw new Error(
|
|
164
|
+
`entity ${st.entityId} facet ${st.facet} already has current state ${es.id}; supersede it or use a different facet`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
for (const sid of mutation.supersededStateIds ?? []) {
|
|
172
|
+
const existing = await getMemoryStateVNext(db, ownerId, sid);
|
|
173
|
+
if (!existing) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
`cannot supersede missing memory state: ${sid} (owner ${ownerId})`
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
if (existing.retiredAt) {
|
|
179
|
+
throw new Error(
|
|
180
|
+
`cannot supersede already retired memory state: ${sid} (owner ${ownerId})`
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
const replacement = (mutation.states ?? []).find(
|
|
184
|
+
(st) => st.entityId === existing.entityId && st.facet === existing.facet
|
|
185
|
+
);
|
|
186
|
+
if (!replacement) {
|
|
187
|
+
throw new Error(
|
|
188
|
+
`superseded state ${sid} (entity ${existing.entityId} facet ${existing.facet}) has no replacement in this mutation`
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (const rel of mutation.relations ?? []) {
|
|
193
|
+
for (const [side, ref] of [
|
|
194
|
+
["from", rel.from],
|
|
195
|
+
["to", rel.to]
|
|
196
|
+
]) {
|
|
197
|
+
if (pending.entityIds.has(ref) || pending.stateIds.has(ref) || pending.evidenceIds.has(ref)) {
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
const resolved = await getMemoryEntityVNext(db, ownerId, ref) ?? await getMemoryStateVNext(db, ownerId, ref) ?? await getMemoryEvidenceVNext(db, ownerId, ref);
|
|
201
|
+
if (!resolved) {
|
|
202
|
+
throw new Error(
|
|
203
|
+
`memory relation ${rel.id} references missing ${side} ${ref} (owner ${ownerId})`
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
var applyMutationWithoutCoordination = async (db, ownerId, mutation) => {
|
|
210
|
+
await validateMutation(db, ownerId, mutation);
|
|
211
|
+
const completion = mutation.nativeCaptureCompletion;
|
|
212
|
+
if (completion) {
|
|
213
|
+
const prior = await getMemoryEvidenceVNextStrict(db, ownerId, completion.id);
|
|
214
|
+
const withoutOutcome = (ev) => ({
|
|
215
|
+
...ev,
|
|
216
|
+
nativeCapture: ev.nativeCapture && { ...ev.nativeCapture, outcome: void 0 }
|
|
217
|
+
});
|
|
218
|
+
if (!prior?.nativeCapture || prior.nativeCapture.outcome || completion.ownerId !== ownerId || !["applied", "no_op"].includes(completion.nativeCapture?.outcome ?? "") || completion.nativeCapture?.outcome === "applied" && (["no_op", "ambiguous"].includes(mutation.action) || !mutation.states?.length || mutation.states.some((st) => !st.evidenceIds.includes(completion.id))) || completion.nativeCapture?.outcome === "no_op" && (mutation.action !== "no_op" || !!(mutation.entities?.length || mutation.states?.length || mutation.relations?.length || mutation.evidence?.length || mutation.supersededStateIds?.length)) || JSON.stringify(withoutOutcome(prior)) !== JSON.stringify(withoutOutcome(completion)) || mutation.evidence?.some((ev) => ev.id === completion.id)) {
|
|
219
|
+
throw new Error("invalid native capture completion");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const batch = db.batch();
|
|
223
|
+
if (completion) _appendEvidenceBatch(batch, completion);
|
|
224
|
+
for (const ev of mutation.evidence ?? []) {
|
|
225
|
+
_appendEvidenceBatch(batch, ev);
|
|
226
|
+
}
|
|
227
|
+
for (const ent of mutation.entities ?? []) {
|
|
228
|
+
_appendEntityBatch(batch, ent);
|
|
229
|
+
}
|
|
230
|
+
for (const st of mutation.states ?? []) {
|
|
231
|
+
_appendStateBatch(batch, st);
|
|
232
|
+
}
|
|
233
|
+
for (const sid of mutation.supersededStateIds ?? []) {
|
|
234
|
+
const existing = await getMemoryStateVNext(db, ownerId, sid);
|
|
235
|
+
if (!existing) {
|
|
236
|
+
throw new Error(
|
|
237
|
+
`cannot supersede missing memory state: ${sid} (owner ${ownerId})`
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
const replacement = (mutation.states ?? []).find(
|
|
241
|
+
(st) => st.entityId === existing.entityId && st.facet === existing.facet
|
|
242
|
+
);
|
|
243
|
+
const retired = {
|
|
244
|
+
...existing,
|
|
245
|
+
retiredAt: replacement?.updatedAt ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
246
|
+
};
|
|
247
|
+
_appendRetiredStateBatch(batch, retired);
|
|
248
|
+
}
|
|
249
|
+
for (const rel of mutation.relations ?? []) {
|
|
250
|
+
_appendRelationBatch(batch, rel);
|
|
251
|
+
}
|
|
252
|
+
await batch.write();
|
|
253
|
+
};
|
|
254
|
+
var pendingByDb = /* @__PURE__ */ new WeakMap();
|
|
255
|
+
var applyMemoryInterpreterMutation = async (db, ownerId, mutation) => {
|
|
256
|
+
let owners = pendingByDb.get(db);
|
|
257
|
+
if (!owners) {
|
|
258
|
+
owners = /* @__PURE__ */ new Map();
|
|
259
|
+
pendingByDb.set(db, owners);
|
|
260
|
+
}
|
|
261
|
+
const previous = owners.get(ownerId) ?? Promise.resolve();
|
|
262
|
+
const operation = previous.then(async () => {
|
|
263
|
+
const resolved = typeof mutation === "function" ? await mutation() : mutation;
|
|
264
|
+
await applyMutationWithoutCoordination(db, ownerId, resolved);
|
|
265
|
+
});
|
|
266
|
+
const settled = operation.then(() => {
|
|
267
|
+
}, () => {
|
|
268
|
+
});
|
|
269
|
+
owners.set(ownerId, settled);
|
|
270
|
+
try {
|
|
271
|
+
await operation;
|
|
272
|
+
} finally {
|
|
273
|
+
if (owners.get(ownerId) === settled) owners.delete(ownerId);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
export {
|
|
278
|
+
applyMemoryInterpreterMutation
|
|
279
|
+
};
|