nolo-cli 0.227.0-alpha.1 → 0.227.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -5
- package/{_executeModel-JKQGZ3HU.js → _executeModel-CXOFYVHC.js} +93 -87
- package/{action-CK64LS6S.js → action-R2EIXR7I.js} +11 -8
- package/{addContentAction-CARFID6E.js → addContentAction-W6JVLQ6H.js} +17 -16
- package/{addDialogAgentAction-APLZLFW5.js → addDialogAgentAction-LVNKMXKZ.js} +20 -19
- package/{agentDeleteCommand-NVR2V2HH.js → agentDeleteCommand-VFSZPEQ5.js} +145 -137
- package/{agentEmailCommands-UCVOWD3S.js → agentEmailCommands-KRUIF4EH.js} +149 -137
- package/{agentFavoriteCommands-4PDOP3GW.js → agentFavoriteCommands-7LOP3HUD.js} +6 -6
- package/{agentGrantCommands-FLCEXLUH.js → agentGrantCommands-L6O2HVJI.js} +7 -7
- package/agentListCommands-TDFOLWN3.js +644 -0
- package/{agentMachineCommands-V3DGEJU4.js → agentMachineCommands-PSH7Q5PF.js} +76 -67
- package/{agentProviderCommands-7QBFRFRK.js → agentProviderCommands-C5T7C5KZ.js} +7 -7
- package/{agentPullCommand-E6JBGBVG.js → agentPullCommand-QQQZSC6S.js} +7 -7
- package/agentRecordCommands-KCKCW2QU.js +188 -0
- package/agentRunCommand-EF2T2QWD.js +223 -0
- package/{agentRunControl-SNZZ5XP4.js → agentRunControl-CSMSJFFB.js} +25 -17
- package/{agentRuntimeLocal-GOX2DIY7.js → agentRuntimeLocal-6QXQS3TS.js} +64 -50
- package/{agentSlice-N7H2FRJA.js → agentSlice-IZ5ANAF7.js} +19 -18
- package/{appDeleteCommands-LZDN26FU.js → appDeleteCommands-4M7ETEEG.js} +68 -59
- package/{appDeployCommands-6IO6TTZH.js → appDeployCommands-2VJ2NDW5.js} +68 -59
- package/{appDeployStatusCommands-FG3LX24J.js → appDeployStatusCommands-LDFSWOPQ.js} +68 -59
- package/{appGetCommands-NAKVDVD4.js → appGetCommands-RHVNOPT4.js} +68 -59
- package/{appListCommands-KL56RN73.js → appListCommands-U3XEVTL4.js} +68 -59
- package/{authCommand-AUN5MXV2.js → authCommand-PVZ45QRO.js} +36 -31
- package/{authCommands-D2IPS6ES.js → authCommands-6AUYO65N.js} +18 -13
- package/{builtinSkillRegistry-UQGLKRYP.js → builtinSkillRegistry-LRVAQCPW.js} +6 -6
- package/{chromeCommands-G5UDKVSV.js → chromeCommands-S7AW3AOD.js} +383 -6
- package/{chromeOpsCommands-UJWN5HWH.js → chromeOpsCommands-TBPM6MR4.js} +8 -8
- package/{chunk-ABGULE7H.js → chunk-22YUCKMK.js} +16 -16
- package/{chunk-P2ZLUIW2.js → chunk-2BSLGODA.js} +350 -25
- package/{chunk-GOLPOTG5.js → chunk-2COM7SAH.js} +4 -4
- package/{chunk-ULAQPRHX.js → chunk-2FK2KZSL.js} +1 -1
- package/{chunk-PLPLH2XZ.js → chunk-2IPR4PBB.js} +2 -2
- package/chunk-2SXN7LAY.js +15 -0
- package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
- package/{chunk-7Z3WUZ4Q.js → chunk-3YYFU6H7.js} +74 -46
- package/{chunk-C2B7M567.js → chunk-4OXPN3WC.js} +17 -6
- package/chunk-4TVOZGOS.js +62 -0
- package/chunk-4ZCTKB27.js +31 -0
- package/chunk-53AEDFBL.js +33394 -0
- package/chunk-53W5BXLN.js +340 -0
- package/{chunk-OXA5GWHU.js → chunk-56O2J2Y4.js} +3 -3
- package/{chunk-IAJJYHIB.js → chunk-56PB7FEN.js} +8 -8
- package/{chunk-JWXITTQB.js → chunk-5HUO7SEX.js} +9 -107
- package/{chunk-AGP3YSEC.js → chunk-5PASH2MB.js} +46 -1
- package/{chunk-PHOSZT3E.js → chunk-5UAKGCQG.js} +1 -1
- package/{chunk-5RKRXQ2H.js → chunk-5VVP7DW3.js} +20 -13
- package/chunk-6ASGEP5D.js +21 -0
- package/chunk-6PXFEPHL.js +103 -0
- package/chunk-6RSNVJGO.js +279 -0
- package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
- package/{chunk-KMRKZNGT.js → chunk-6YYTTLJV.js} +14 -13
- package/{chunk-VREDDN25.js → chunk-76HAJUOJ.js} +14 -9
- package/{chunk-FKEZOMIF.js → chunk-7DXFOL5B.js} +1410 -768
- package/{chunk-LA7JYAKF.js → chunk-AKPKOI5Z.js} +6 -6
- package/{chunk-PWTNI4N7.js → chunk-ANUP75N2.js} +22 -0
- package/{chunk-F5AY2UZL.js → chunk-AO6T7U62.js} +592 -68
- package/{chunk-LJSNEV7M.js → chunk-AS6L5KSD.js} +8 -8
- package/{chunk-GOQ6ZVTN.js → chunk-AVSZ6PBM.js} +5 -5
- package/chunk-BIDSIRTS.js +307 -0
- package/chunk-C5A54QS7.js +108 -0
- package/{chunk-KYH7XW3K.js → chunk-CD2DK5JA.js} +135 -14
- package/{chunk-G6HJUMST.js → chunk-CJQBWHNM.js} +2 -2
- package/{chunk-EVGU5P4U.js → chunk-CO6E7YK6.js} +1 -1
- package/{chunk-ZYA2YDB6.js → chunk-CT5JXREL.js} +17 -17
- package/{chunk-VPAZ6BEN.js → chunk-CTWCZKNS.js} +42 -17
- package/{chunk-4OKTPFNX.js → chunk-CX2LYFZQ.js} +107 -66
- package/{chunk-YFLVRVYK.js → chunk-DLT2DN4M.js} +1 -1
- package/{chunk-LKA64WH4.js → chunk-DMPZMYH4.js} +37 -1
- package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
- package/{chunk-OQHIVPG4.js → chunk-E6A5NHDH.js} +4 -1
- package/{chunk-IX2BXN2K.js → chunk-EDT65EUE.js} +6 -6
- package/{chunk-VP3BINY7.js → chunk-EQZZASCD.js} +31 -1
- package/{chunk-45LZIYXB.js → chunk-ESN4WNWU.js} +3 -2
- package/{chunk-M3JEW6N6.js → chunk-F26GAEH3.js} +10 -0
- package/{chunk-CVERLOJM.js → chunk-F4XIS5DL.js} +1215 -1431
- package/chunk-FDZ2GBWO.js +166 -0
- package/chunk-FGHEF6WI.js +34 -0
- package/{chunk-CSW7IPVD.js → chunk-FMYNIAI6.js} +61 -24
- package/{chunk-VIHDJ3FK.js → chunk-FNT5VENS.js} +15 -15
- package/{chunk-PMDVQBGA.js → chunk-GAHJLSDO.js} +14 -7
- package/{chunk-GRXSJR2Z.js → chunk-GVTFSLNI.js} +112 -109
- package/{chunk-UN7HIYMH.js → chunk-GX6DITLQ.js} +1 -1
- package/{chunk-3VFYQH3I.js → chunk-HIDVLMZC.js} +203 -156
- package/{chunk-5LQDHFBN.js → chunk-IDFGIROZ.js} +20 -17
- package/{chunk-UCFPVYP7.js → chunk-IFWXH7LH.js} +1 -1
- package/{chunk-LXTC53TN.js → chunk-J45ACAOQ.js} +815 -361
- package/{chunk-S6K5F3KP.js → chunk-JP2BH4NC.js} +1 -1
- package/{chunk-X2KRQP7V.js → chunk-JV5FHHF7.js} +1 -1
- package/{chunk-6EDAMVG6.js → chunk-K26XPZRB.js} +11 -11
- package/{chunk-RU6DULV4.js → chunk-KB5RQRSJ.js} +1 -1
- package/{chunk-T43K75CK.js → chunk-KC2QVCI7.js} +24 -178
- package/chunk-KK3FCYZM.js +647 -0
- package/{chunk-XZODOEKU.js → chunk-KMDHRVS7.js} +29 -5
- package/{chunk-4JVNURX4.js → chunk-KQHEGELM.js} +68 -16
- package/{chunk-UAPNPNSG.js → chunk-KW72WVHO.js} +2085 -1046
- package/{chunk-ILHQ2AXT.js → chunk-KZAT2M2V.js} +14 -8
- package/{chunk-L42CBKBZ.js → chunk-KZKMH374.js} +3 -3
- package/{chunk-ZI5SZ3MV.js → chunk-L6BLA6BT.js} +40 -31
- package/{chunk-AK5O76CC.js → chunk-LC5CVWP2.js} +3 -3
- package/{chunk-N5Z2V73W.js → chunk-LELADM5Q.js} +1 -1
- package/chunk-LHCGKAFO.js +739 -0
- package/{chunk-YOT437BH.js → chunk-LOF2EFUE.js} +203 -123
- package/{chunk-YQETUZ5V.js → chunk-LTVEOOZL.js} +29 -16
- package/{chunk-T2BEPTAG.js → chunk-MAA42MMV.js} +272 -26
- package/{chunk-NAOO4PVX.js → chunk-MECW2HJG.js} +16 -16
- package/{chunk-5HL4KC4A.js → chunk-MEDPR36J.js} +62 -87
- package/chunk-MVOZ22RZ.js +26 -0
- package/{chunk-YPPKC6FL.js → chunk-MYYNZG2M.js} +140 -40
- package/{chunk-UVUVQVZ6.js → chunk-MZVCFV3T.js} +19 -15
- package/{chunk-CQVGR3MX.js → chunk-N7MXFYLU.js} +7 -7
- package/{chunk-IC2I373Q.js → chunk-NEG5LYK5.js} +4 -4
- package/chunk-NJJK3PDA.js +133 -0
- package/{chunk-OB6DVWPF.js → chunk-OGZE6BZG.js} +331 -99
- package/{chunk-M3Y4IBIR.js → chunk-OHUYN3YU.js} +6 -6
- package/chunk-P27E22MA.js +203 -0
- package/{chunk-SFTTXGPM.js → chunk-PDAXMBLW.js} +35 -28
- package/{chunk-OBSEKCVK.js → chunk-PQ63BDV3.js} +210 -51
- package/{chunk-EUCFKKDM.js → chunk-PVFYPUIM.js} +40 -10
- package/{chunk-SRG5CNLC.js → chunk-QIVE5WJE.js} +8 -8
- package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
- package/{chunk-5RKUPJYL.js → chunk-QLUYDJST.js} +11 -3
- package/{chunk-7Z6EW7AH.js → chunk-QOURTDZL.js} +97 -11
- package/{chunk-VZW34YUL.js → chunk-QWSH3UAQ.js} +8 -5
- package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
- package/{chunk-5FUN7EG4.js → chunk-RD3QLZQV.js} +83 -47
- package/{chunk-SW6OD4KE.js → chunk-RDPAIR67.js} +351 -18
- package/{chunk-NO3VBWTL.js → chunk-RXTZB2DH.js} +4 -4
- package/{chunk-AXYH4734.js → chunk-S25VJYXV.js} +21 -15
- package/{chunk-MWHOH4RJ.js → chunk-SESKIWB4.js} +6 -6
- package/{chunk-GUVXQSFZ.js → chunk-SF4GMDZO.js} +18 -108
- package/{chunk-TINJKQSO.js → chunk-SQRKAYQW.js} +25 -25
- package/chunk-SR4FE5VD.js +9 -0
- package/{chunk-3HTP4WZQ.js → chunk-SX6AWTNK.js} +46 -8
- package/{chunk-4WVJLODK.js → chunk-T23G6PXQ.js} +8 -3
- package/{chunk-CLCXHIBS.js → chunk-T4QY3HZ5.js} +1 -1
- package/{chunk-HVUDBOQG.js → chunk-TB5KTLNB.js} +9 -6
- package/{chunk-KRRE4A7D.js → chunk-TKE4OJ4B.js} +280 -56
- package/{chunk-S2NTVGA2.js → chunk-U35UUM5K.js} +2 -1
- package/{chunk-PPJYZRSQ.js → chunk-U5LOKQ2R.js} +30 -14
- package/{chunk-CKT6QUE2.js → chunk-UHW6SCVK.js} +1 -1
- package/{chunk-T5N6NHAT.js → chunk-UPOW5HTG.js} +6 -6
- package/{chunk-WJP4TH6U.js → chunk-VEVLLBFK.js} +2 -2
- package/{chunk-HGDKT2D6.js → chunk-VTHWBTRE.js} +177 -1
- package/{chunk-KJAAPGBE.js → chunk-VUHKG4KS.js} +6 -6
- package/{chunk-TOKPHZ55.js → chunk-W3HSD32M.js} +17 -10
- package/{chunk-2SKTCNWO.js → chunk-W5OJBZLZ.js} +4 -4
- package/chunk-WBSJAIZP.js +170 -0
- package/chunk-WDWZPASX.js +29 -0
- package/chunk-WFGNWWJI.js +326 -0
- package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
- package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
- package/{chunk-HYKGIXNO.js → chunk-XGWRH3OF.js} +114 -29
- package/{chunk-XIEYGCN6.js → chunk-XKV53E4E.js} +460 -117
- package/{chunk-JHF6VLVL.js → chunk-XYRTC2Y3.js} +155 -170
- package/{chunk-L5I543VB.js → chunk-YGDYYFRX.js} +20 -24
- package/{chunk-ZADGPNTV.js → chunk-YHWMKGOX.js} +77 -103
- package/{chunk-6OVNSQHN.js → chunk-YLAHYLDQ.js} +5 -0
- package/chunk-Z6YTCDU4.js +24 -0
- package/{chunk-PVAWNHP5.js → chunk-ZP26NIZE.js} +647 -387
- package/{chunk-2G3YSVO6.js → chunk-ZQ6K57FJ.js} +3 -3
- package/{cliAgentConfigHelpers-QVSQYTKC.js → cliAgentConfigHelpers-37ZNEY5Y.js} +16 -16
- package/{cliAuthorityBrokerClient-XHH7MH2P.js → cliAuthorityBrokerClient-SFPC3WVK.js} +1 -1
- package/{cliEnvHelpers-D6HMC46Z.js → cliEnvHelpers-CNMP3RDX.js} +2 -2
- package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
- package/cliLocalAgentRecordReader-53773JID.js +102 -0
- package/{commandRegistry-TKR6OWXP.js → commandRegistry-RJUO2VOD.js} +113 -101
- package/{contentThunks-BQWRPCTM.js → contentThunks-4EFHLUTB.js} +44 -41
- package/{cooldownCommands-FZYQOWI5.js → cooldownCommands-QL6DWGVU.js} +3 -3
- package/{createAgentAutomationAction-GFI6SJZV.js → createAgentAutomationAction-ZFFGJ7CZ.js} +44 -41
- package/{createDialogAction-MMBIHFFU.js → createDialogAction-SDUGVTPS.js} +45 -43
- package/{createPageAction-EEYUE5FB.js → createPageAction-NNM3OFLY.js} +49 -46
- package/{db-CS4ZJQKV.js → db-6NRZLEW2.js} +10 -7
- package/{dbSlice-X4Z4E4QU.js → dbSlice-5MQ3ELID.js} +16 -15
- package/{deleteFile-QOOP2UK7.js → deleteFile-VCCHS72Y.js} +12 -9
- package/{dialogCommands-OXBQ73DD.js → dialogCommands-SJK5KWXU.js} +73 -66
- package/dialogMessageRecord-OAV77LT7.js +7 -0
- package/{dialogNotifyCommand-VWS5G4OO.js → dialogNotifyCommand-PST75COP.js} +19 -19
- package/{dialogSlice-KGYIABDY.js → dialogSlice-2KLMHECR.js} +44 -41
- package/{dialogUsageCommand-FEWCN7IA.js → dialogUsageCommand-BZPKR3DW.js} +8 -8
- package/{docCreateCommands-LS32VKY3.js → docCreateCommands-K7CDL2HY.js} +66 -57
- package/{docDeleteCommands-JTYR5RPH.js → docDeleteCommands-ZEY5YCSP.js} +69 -60
- package/{docReadCommands-E5LTVKWN.js → docReadCommands-A4ROLIQG.js} +66 -57
- package/{docStore-TVS2FNER.js → docStore-A4O6YJAM.js} +19 -18
- package/{docUpdateCommands-I3J3JDZ2.js → docUpdateCommands-6HTFQY4O.js} +66 -57
- package/{fetchMessages-Q3INLN5F.js → fetchMessages-TQEUZD7H.js} +3 -3
- package/{getPricing-VNGFM4PN.js → getPricing-FCHYVRJU.js} +6 -6
- package/{handleSendMessageAction-SSON36TJ.js → handleSendMessageAction-6WEFYBUC.js} +87 -82
- package/{hostCredentialCreate-WTW4THJF.js → hostCredentialCreate-WOWCNOYM.js} +136 -123
- package/index.js +54 -16
- package/keys-RWF7UCB4.js +1 -1
- package/{lib-OT5OTXRU.js → lib-62SWPXNF.js} +3 -7
- package/{localDialogRead-V36DX2Q2.js → localDialogRead-3T2KMCRC.js} +2 -2
- package/{localRuntimeAdapter-MI2JGXSF.js → localRuntimeAdapter-7EDBDRYW.js} +147 -133
- package/{localRuntimeAuthority-IBJAT62G.js → localRuntimeAuthority-7DKIT7UH.js} +4 -2
- package/{localRuntimeDb-N7KHDXS2.js → localRuntimeDb-5WZ4RJJO.js} +1 -1
- package/{machineCommands-3LROJZDK.js → machineCommands-XRPC67LL.js} +290 -354
- package/machineWsRunDispatch-SOGFW472.js +203 -0
- package/markdownToSlate-KIYM7B3P.js +8 -0
- package/mcpLocalAuthorizeCommand-VOJARP3M.js +106 -0
- package/{memberThunks-CFEPHAND.js → memberThunks-KC3WJGL3.js} +26 -21
- package/{memoryCommands-JQMEJO7J.js → memoryCommands-BC6REPQB.js} +6 -6
- package/{models-H5NNZRLH.js → models-EP7VG6N2.js} +2 -2
- package/{overlay-THLKYIWY.js → overlay-JA3SPVUS.js} +7 -3
- package/package.json +1 -1
- package/{projectArchive-3X54XFVN.js → projectArchive-GDVPIZX2.js} +50 -47
- package/{providerPresetApply-FO36N5TX.js → providerPresetApply-4H7YP5D7.js} +9 -9
- package/{providerRegistry-U2BSFE6K.js → providerRegistry-F3UPOTIY.js} +9 -9
- package/{read-KA3L2V7O.js → read-T7VU2IMO.js} +11 -10
- package/{readDocTool-AMAZAPAW.js → readDocTool-BPQ3QJSD.js} +1 -1
- package/{readlineWorkspace-Z3YUH4SX.js → readlineWorkspace-OWQIIUGH.js} +9406 -6791
- package/rememberExplicit-CPAPONSI.js +15 -0
- package/{removeDialogAgentAction-JQOJSUM7.js → removeDialogAgentAction-FEUUVMYC.js} +23 -22
- package/{runAgentClientLoop-4FCFLMDJ.js → runAgentClientLoop-SJREK2B7.js} +107 -86
- package/{runtimeDoctorCommands-CXOCVDPU.js → runtimeDoctorCommands-XQD4MN4I.js} +19 -19
- package/{secretCommands-GGUAWAE7.js → secretCommands-LH7QTJO2.js} +3 -3
- package/{setDialogExtraReferencesAction-YXQTGXIN.js → setDialogExtraReferencesAction-JSTQJPXL.js} +19 -18
- package/{setPrimaryDialogAgentAction-YNLB66WE.js → setPrimaryDialogAgentAction-Z2BQE3IY.js} +23 -22
- package/{settingThunks-E6N7RSSS.js → settingThunks-C2YWCNYI.js} +186 -67
- package/{skillDiscovery-B5V23AXP.js → skillDiscovery-MDDKPTW3.js} +4 -3
- package/{spaceCommands-DB5DKC2J.js → spaceCommands-YRBQ52PG.js} +71 -62
- package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
- package/{streamAgentChatTurn-FCBGMD4D.js → streamAgentChatTurn-NCA4BKDZ.js} +244 -185
- package/{switchDialogAgentAction-LAHLUECU.js → switchDialogAgentAction-G7XVAOGH.js} +20 -19
- package/{tableCommands-VNSXHAMG.js → tableCommands-UHEA5QNL.js} +14 -11
- package/{toolApiClient-OGQEBQVX.js → toolApiClient-N5PYW2R3.js} +8 -6
- package/{tools-6JD36D6K.js → tools-6WQVUGKV.js} +74 -70
- package/tuiRestart-3J7LRMPR.js +41 -0
- package/{tuiSummaryLlmCaller-UHZIPGAX.js → tuiSummaryLlmCaller-2J6NG53N.js} +24 -23
- package/{updateCommands-KZ54HCU5.js → updateCommands-5OYND6EF.js} +8 -6
- package/{updateDialogTitleAction-RV3EUEN3.js → updateDialogTitleAction-QCSN3RYO.js} +46 -43
- package/{usageCommand-KFVV6UL3.js → usageCommand-SK7JTEPC.js} +3 -3
- package/{usageRebuildCommand-HHFSNK46.js → usageRebuildCommand-DF3HUP6F.js} +4 -4
- package/webapi-QVV65DQF.js +2487 -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-C65UESYM.js +0 -1004
- package/agentRecordCommands-6RCJS2EY.js +0 -176
- package/agentRunCommand-P3GRKXKS.js +0 -208
- package/chunk-2WZXXAQD.js +0 -57
- package/chunk-5ZMIIR23.js +0 -265
- package/chunk-62HXNQVV.js +0 -134
- package/chunk-BJF2MHJ3.js +0 -118
- package/chunk-KEPOVMF4.js +0 -91
- package/chunk-PXKF5CV4.js +0 -357
- package/chunk-WACI5I6V.js +0 -147
- package/chunk-YGILMZ7N.js +0 -81
- package/cliLocalAgentRecordReader-SPKAJYME.js +0 -90
- package/machineWsRunDispatch-BUUJRUUB.js +0 -191
- package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +4 -4
- package/{chunk-VXL2FZTP.js → chunk-HXER7YJF.js} +3 -3
- package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
- package/{chunk-SSGTV4FC.js → chunk-USGHJSGO.js} +5 -5
- package/{chunk-FJ23FZXF.js → chunk-VIYVRPMJ.js} +0 -0
- package/{offlineMarxistsAgentCommand-AGA2X5E4.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +5 -5
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getApproxPricePerImage
|
|
6
6
|
} from "./chunk-4JH2UMJR.js";
|
|
7
|
-
import {
|
|
8
|
-
getModelConfig
|
|
9
|
-
} from "./chunk-KYH7XW3K.js";
|
|
10
|
-
import {
|
|
11
|
-
isPlatformHostedImageModel,
|
|
12
|
-
isPlatformManagedProvider,
|
|
13
|
-
resolvePlatformEffectiveModel
|
|
14
|
-
} from "./chunk-OBSEKCVK.js";
|
|
15
7
|
import {
|
|
16
8
|
asOptionalPositiveFiniteNumber
|
|
17
9
|
} from "./chunk-U6VC4MU4.js";
|
|
18
10
|
import {
|
|
19
11
|
asOptionalFiniteNumber
|
|
20
12
|
} from "./chunk-WWC7I6TA.js";
|
|
13
|
+
import {
|
|
14
|
+
getModelConfig
|
|
15
|
+
} from "./chunk-CD2DK5JA.js";
|
|
16
|
+
import {
|
|
17
|
+
isPlatformHostedImageModel,
|
|
18
|
+
isPlatformManagedProvider,
|
|
19
|
+
resolvePlatformEffectiveModel
|
|
20
|
+
} from "./chunk-PQ63BDV3.js";
|
|
21
21
|
|
|
22
22
|
// packages/ai/llm/getPricing.ts
|
|
23
23
|
var MAX_OUTPUT_TOKENS = 8192;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
selectCurrentServer
|
|
3
|
-
} from "./chunk-VREDDN25.js";
|
|
4
1
|
import {
|
|
5
2
|
patch
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PDAXMBLW.js";
|
|
4
|
+
import {
|
|
5
|
+
selectCurrentServer
|
|
6
|
+
} from "./chunk-76HAJUOJ.js";
|
|
7
7
|
import {
|
|
8
8
|
getIsDesktopApp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5PASH2MB.js";
|
|
10
10
|
import {
|
|
11
11
|
selectIdentityToken
|
|
12
12
|
} from "./chunk-PXYBUFDB.js";
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_NOLO_SERVER_URL
|
|
3
|
+
} from "./chunk-OLZBQWZU.js";
|
|
4
|
+
import {
|
|
5
|
+
NOLO_CLUSTER_SERVERS
|
|
6
|
+
} from "./chunk-LCBAMY2M.js";
|
|
7
|
+
import {
|
|
8
|
+
asOptionalTrimmedString
|
|
9
|
+
} from "./chunk-G3SUCT4W.js";
|
|
10
|
+
import {
|
|
11
|
+
DEFAULT_LOCAL_API_ORIGIN
|
|
12
|
+
} from "./chunk-4SN6J65J.js";
|
|
13
|
+
import {
|
|
14
|
+
normalizeServerOrigin
|
|
15
|
+
} from "./chunk-CF7PE763.js";
|
|
16
|
+
|
|
17
|
+
// packages/cli/agentRunProtocol.ts
|
|
18
|
+
import { createHash } from "node:crypto";
|
|
19
|
+
import { existsSync, lstatSync, statSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
20
|
+
import { dirname, extname, join, relative } from "node:path";
|
|
21
|
+
import { fileURLToPath } from "node:url";
|
|
22
|
+
var AGENT_RUN_PROTOCOL = "nolo-agent-run/2";
|
|
23
|
+
var RuntimeProtocolMismatchError = class extends Error {
|
|
24
|
+
code = "runtime_protocol_mismatch";
|
|
25
|
+
constructor() {
|
|
26
|
+
super("runtime_protocol_mismatch: parent and child agent-run protocols differ");
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function validateAgentRunProtocol(expected) {
|
|
30
|
+
if (expected !== AGENT_RUN_PROTOCOL) throw new RuntimeProtocolMismatchError();
|
|
31
|
+
}
|
|
32
|
+
var RuntimeVersionMismatchError = class extends Error {
|
|
33
|
+
code = "runtime_version_mismatch";
|
|
34
|
+
constructor(detail) {
|
|
35
|
+
super(`runtime_version_mismatch: ${detail}; restart CLI/desktop before retrying`);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var ignoredDirectories = /* @__PURE__ */ new Set([
|
|
39
|
+
"node_modules",
|
|
40
|
+
".git",
|
|
41
|
+
".nolo",
|
|
42
|
+
".worktrees",
|
|
43
|
+
"data",
|
|
44
|
+
"nolodata",
|
|
45
|
+
"credentials",
|
|
46
|
+
"dist",
|
|
47
|
+
"build",
|
|
48
|
+
"public",
|
|
49
|
+
"assets",
|
|
50
|
+
"docs",
|
|
51
|
+
"logs",
|
|
52
|
+
"artifacts",
|
|
53
|
+
"coverage",
|
|
54
|
+
"__tests__",
|
|
55
|
+
"__fixtures__",
|
|
56
|
+
"fixtures",
|
|
57
|
+
"testHelpers",
|
|
58
|
+
"test-helpers"
|
|
59
|
+
]);
|
|
60
|
+
var codeFile = /\.[cm]?[jt]sx?$/;
|
|
61
|
+
var testFile = /(?:\.(?:test|spec)\.[^.]+$|^tsconfig\.)/;
|
|
62
|
+
function captureRuntimeContent(root, source) {
|
|
63
|
+
const hash = createHash("sha256");
|
|
64
|
+
const active = /* @__PURE__ */ new Set();
|
|
65
|
+
const visit = (directory) => {
|
|
66
|
+
const canonical = realpathSync(directory);
|
|
67
|
+
if (active.has(canonical)) throw new RuntimeVersionMismatchError("runtime code contains a symlink cycle");
|
|
68
|
+
active.add(canonical);
|
|
69
|
+
for (const name of readdirSync(directory).sort()) {
|
|
70
|
+
if (name.startsWith(".") || ignoredDirectories.has(name)) continue;
|
|
71
|
+
const path = join(directory, name);
|
|
72
|
+
let stat = lstatSync(path);
|
|
73
|
+
if (stat.isSymbolicLink()) {
|
|
74
|
+
try {
|
|
75
|
+
stat = statSync(path);
|
|
76
|
+
} catch {
|
|
77
|
+
if (codeFile.test(name) || name === "package.json") throw new RuntimeVersionMismatchError("runtime code link is unreadable");
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (stat.isDirectory()) visit(path);
|
|
82
|
+
else if (codeFile.test(name) && !testFile.test(name) || name === "package.json") {
|
|
83
|
+
const bytes = readFileSync(path);
|
|
84
|
+
hash.update(JSON.stringify([relative(root, path), bytes.length]));
|
|
85
|
+
hash.update(bytes);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
active.delete(canonical);
|
|
89
|
+
};
|
|
90
|
+
if (source) {
|
|
91
|
+
visit(join(root, "packages"));
|
|
92
|
+
for (const name of ["package.json", "bun.lock", "bun.lockb", "bunfig.toml", "tsconfig.json"]) {
|
|
93
|
+
hash.update(name);
|
|
94
|
+
const path = join(root, name);
|
|
95
|
+
hash.update(existsSync(path) ? readFileSync(path) : "<absent>");
|
|
96
|
+
}
|
|
97
|
+
} else visit(root);
|
|
98
|
+
return hash.digest("hex");
|
|
99
|
+
}
|
|
100
|
+
function createRuntimeContentGuard(root, source) {
|
|
101
|
+
const canonical = realpathSync(root);
|
|
102
|
+
const startupContent = captureRuntimeContent(canonical, source);
|
|
103
|
+
return Object.assign(() => {
|
|
104
|
+
try {
|
|
105
|
+
if (captureRuntimeContent(canonical, source) !== startupContent) {
|
|
106
|
+
throw new RuntimeVersionMismatchError("runtime content changed since host startup");
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof RuntimeVersionMismatchError) throw error;
|
|
110
|
+
throw new RuntimeVersionMismatchError("startup runtime content is no longer readable");
|
|
111
|
+
}
|
|
112
|
+
}, { identity: startupContent });
|
|
113
|
+
}
|
|
114
|
+
function captureHostRuntimeGuard() {
|
|
115
|
+
try {
|
|
116
|
+
const url = import.meta.url;
|
|
117
|
+
if (url.includes("/$bunfs/")) {
|
|
118
|
+
const executable = getHostRuntimeExecutable();
|
|
119
|
+
const digest = createHash("sha256").update(readFileSync(executable)).digest("hex");
|
|
120
|
+
return Object.assign(() => {
|
|
121
|
+
try {
|
|
122
|
+
if (createHash("sha256").update(readFileSync(executable)).digest("hex") !== digest) {
|
|
123
|
+
throw new RuntimeVersionMismatchError("host executable changed since startup");
|
|
124
|
+
}
|
|
125
|
+
} catch (error) {
|
|
126
|
+
if (error instanceof RuntimeVersionMismatchError) throw error;
|
|
127
|
+
throw new RuntimeVersionMismatchError("startup executable is no longer readable");
|
|
128
|
+
}
|
|
129
|
+
}, { identity: digest });
|
|
130
|
+
}
|
|
131
|
+
const modulePath = fileURLToPath(url);
|
|
132
|
+
const source = extname(modulePath) === ".ts";
|
|
133
|
+
return createRuntimeContentGuard(source ? dirname(dirname(dirname(modulePath))) : dirname(modulePath), source);
|
|
134
|
+
} catch {
|
|
135
|
+
return Object.assign(() => {
|
|
136
|
+
throw new RuntimeVersionMismatchError("host startup identity unavailable");
|
|
137
|
+
}, { identity: "unavailable" });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
var hostExecutable;
|
|
141
|
+
function getHostRuntimeExecutable() {
|
|
142
|
+
return hostExecutable ?? realpathSync(process.execPath);
|
|
143
|
+
}
|
|
144
|
+
var hostGuard;
|
|
145
|
+
var HOST_RUNTIME_CONTENT_IDENTITY = "uninitialized";
|
|
146
|
+
function initializeHostRuntimeIdentity() {
|
|
147
|
+
if (hostGuard) return;
|
|
148
|
+
hostExecutable = realpathSync(process.execPath);
|
|
149
|
+
hostGuard = captureHostRuntimeGuard();
|
|
150
|
+
HOST_RUNTIME_CONTENT_IDENTITY = hostGuard.identity;
|
|
151
|
+
}
|
|
152
|
+
function isAgentRuntimeHostCommand(args, interactive) {
|
|
153
|
+
if (args.some((arg) => ["--help", "-h", "--version", "-v"].includes(arg))) return false;
|
|
154
|
+
if (!args.length) return interactive;
|
|
155
|
+
return args[0] === "chat" || args[0] === "tui" || args[0] === "connect" || args[0] === "agent" && ["run", "continue", "smoke-current"].includes(args[1]);
|
|
156
|
+
}
|
|
157
|
+
function resolveExactRuntimeEntrypoint(path) {
|
|
158
|
+
try {
|
|
159
|
+
if (!existsSync(path)) throw new Error("missing");
|
|
160
|
+
return realpathSync(path);
|
|
161
|
+
} catch {
|
|
162
|
+
throw new RuntimeVersionMismatchError("explicit runtime entrypoint is missing or unreadable");
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// packages/cli/cliEnvHelpers.ts
|
|
167
|
+
import { dirname as dirname2, extname as extname2, join as join2 } from "node:path";
|
|
168
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
169
|
+
import { existsSync as existsSync2, realpathSync as realpathSync2 } from "node:fs";
|
|
170
|
+
function resolveServerUrlFromEnv(env) {
|
|
171
|
+
return normalizeServerOrigin(
|
|
172
|
+
env.NOLO_SERVER || env.BASE_URL || DEFAULT_NOLO_SERVER_URL
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function isCliArgs(value) {
|
|
176
|
+
return Array.isArray(value);
|
|
177
|
+
}
|
|
178
|
+
function buildServerCandidates(values) {
|
|
179
|
+
return [...new Set(
|
|
180
|
+
values.filter((value) => typeof value === "string" && value.trim().length > 0).map((value) => normalizeServerOrigin(value))
|
|
181
|
+
)];
|
|
182
|
+
}
|
|
183
|
+
function resolveServerUrl(input, env) {
|
|
184
|
+
if (isCliArgs(input)) {
|
|
185
|
+
const explicit = readOption(input, "--server-url") || readOption(input, "--server");
|
|
186
|
+
return normalizeServerOrigin(explicit) || resolveServerUrlFromEnv(env ?? {});
|
|
187
|
+
}
|
|
188
|
+
return resolveServerUrlFromEnv(input);
|
|
189
|
+
}
|
|
190
|
+
function resolveServerCandidates(input, envOrPreferred, preferred) {
|
|
191
|
+
if (isCliArgs(input)) {
|
|
192
|
+
const env2 = envOrPreferred ?? {};
|
|
193
|
+
const explicitServer = resolveServerUrl(input, env2);
|
|
194
|
+
return buildServerCandidates([
|
|
195
|
+
explicitServer,
|
|
196
|
+
preferred?.trim(),
|
|
197
|
+
env2.NOLO_SERVER,
|
|
198
|
+
env2.BASE_URL,
|
|
199
|
+
env2.NOLO_SERVER_URL,
|
|
200
|
+
DEFAULT_NOLO_SERVER_URL,
|
|
201
|
+
...NOLO_CLUSTER_SERVERS
|
|
202
|
+
]);
|
|
203
|
+
}
|
|
204
|
+
const env = input;
|
|
205
|
+
return buildServerCandidates([
|
|
206
|
+
asOptionalTrimmedString(envOrPreferred),
|
|
207
|
+
env.NOLO_SERVER,
|
|
208
|
+
env.BASE_URL,
|
|
209
|
+
env.NOLO_SERVER_URL,
|
|
210
|
+
DEFAULT_NOLO_SERVER_URL,
|
|
211
|
+
...NOLO_CLUSTER_SERVERS
|
|
212
|
+
]);
|
|
213
|
+
}
|
|
214
|
+
function resolveDeleteServerCandidatesFromEnv(env, ...preferredValues) {
|
|
215
|
+
return buildServerCandidates([
|
|
216
|
+
...preferredValues,
|
|
217
|
+
env.NOLO_SERVER,
|
|
218
|
+
env.BASE_URL,
|
|
219
|
+
env.NOLO_SERVER_URL,
|
|
220
|
+
env.READ_DIALOG_BASE,
|
|
221
|
+
DEFAULT_NOLO_SERVER_URL,
|
|
222
|
+
...NOLO_CLUSTER_SERVERS,
|
|
223
|
+
DEFAULT_LOCAL_API_ORIGIN
|
|
224
|
+
]);
|
|
225
|
+
}
|
|
226
|
+
function resolveDeleteServerCandidates(input, envOrPreferred, preferred) {
|
|
227
|
+
if (isCliArgs(input)) {
|
|
228
|
+
const env2 = envOrPreferred ?? {};
|
|
229
|
+
const explicitServer = resolveServerUrl(input, env2);
|
|
230
|
+
return resolveDeleteServerCandidatesFromEnv(env2, explicitServer, preferred?.trim());
|
|
231
|
+
}
|
|
232
|
+
const env = input;
|
|
233
|
+
return resolveDeleteServerCandidatesFromEnv(
|
|
234
|
+
env,
|
|
235
|
+
asOptionalTrimmedString(envOrPreferred)
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
function resolveAuthTokenFromEnv(env, extraEnvKeys = []) {
|
|
239
|
+
for (const key of ["AUTH_TOKEN", "AUTH", "NOLO_MACHINE_API_KEY", ...extraEnvKeys]) {
|
|
240
|
+
const value = env[key];
|
|
241
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
242
|
+
}
|
|
243
|
+
return "";
|
|
244
|
+
}
|
|
245
|
+
function resolveAuthToken(input, envOrExtraEnvKeys, extraEnvKeys = []) {
|
|
246
|
+
if (isCliArgs(input)) {
|
|
247
|
+
const env = envOrExtraEnvKeys ?? {};
|
|
248
|
+
return readOption(input, "--token") || readOption(input, "--machine-key") || resolveAuthTokenFromEnv(env, extraEnvKeys);
|
|
249
|
+
}
|
|
250
|
+
return resolveAuthTokenFromEnv(input, envOrExtraEnvKeys ?? []);
|
|
251
|
+
}
|
|
252
|
+
function parseUserIdFromAuthToken(token) {
|
|
253
|
+
const parts = token.trim().split(".").filter(Boolean);
|
|
254
|
+
const payloadCandidates = parts.length >= 3 ? [parts[1], parts[0]] : [parts[0]];
|
|
255
|
+
for (const payload of payloadCandidates) {
|
|
256
|
+
if (!payload) continue;
|
|
257
|
+
try {
|
|
258
|
+
const parsed = JSON.parse(Buffer.from(payload, "base64").toString("utf8"));
|
|
259
|
+
if (typeof parsed?.userId === "string") return parsed.userId;
|
|
260
|
+
} catch {
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
return "";
|
|
264
|
+
}
|
|
265
|
+
function readOption(args, flag) {
|
|
266
|
+
const index = args.indexOf(flag);
|
|
267
|
+
return index >= 0 ? args[index + 1] : void 0;
|
|
268
|
+
}
|
|
269
|
+
function isCompiledBinary() {
|
|
270
|
+
try {
|
|
271
|
+
const url = import.meta.url;
|
|
272
|
+
return url.startsWith("file:///$bunfs/root/") || url.startsWith("/$bunfs/root/");
|
|
273
|
+
} catch {
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function resolveCliEntrypointPath(fromModuleUrl = import.meta.url) {
|
|
278
|
+
if (isCompiledBinary()) {
|
|
279
|
+
return getHostRuntimeExecutable();
|
|
280
|
+
}
|
|
281
|
+
const modulePath = fileURLToPath2(fromModuleUrl);
|
|
282
|
+
const sourcePath = existsSync2(modulePath) ? realpathSync2(modulePath) : modulePath;
|
|
283
|
+
const ext = extname2(sourcePath) || ".ts";
|
|
284
|
+
return join2(dirname2(sourcePath), `index${ext}`);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export {
|
|
288
|
+
AGENT_RUN_PROTOCOL,
|
|
289
|
+
RuntimeProtocolMismatchError,
|
|
290
|
+
validateAgentRunProtocol,
|
|
291
|
+
RuntimeVersionMismatchError,
|
|
292
|
+
getHostRuntimeExecutable,
|
|
293
|
+
HOST_RUNTIME_CONTENT_IDENTITY,
|
|
294
|
+
initializeHostRuntimeIdentity,
|
|
295
|
+
isAgentRuntimeHostCommand,
|
|
296
|
+
resolveExactRuntimeEntrypoint,
|
|
297
|
+
resolveServerUrlFromEnv,
|
|
298
|
+
resolveServerUrl,
|
|
299
|
+
resolveServerCandidates,
|
|
300
|
+
resolveDeleteServerCandidates,
|
|
301
|
+
resolveAuthTokenFromEnv,
|
|
302
|
+
resolveAuthToken,
|
|
303
|
+
parseUserIdFromAuthToken,
|
|
304
|
+
readOption,
|
|
305
|
+
isCompiledBinary,
|
|
306
|
+
resolveCliEntrypointPath
|
|
307
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applyMemoryInterpreterMutation
|
|
3
|
+
} from "./chunk-6RSNVJGO.js";
|
|
4
|
+
import {
|
|
5
|
+
getMemoryEvidenceVNextStrict,
|
|
6
|
+
listMemoryStatesForEntityVNext,
|
|
7
|
+
loadMemoryVNextCatalog
|
|
8
|
+
} from "./chunk-324FWHUA.js";
|
|
9
|
+
|
|
10
|
+
// packages/ai/memory/vnext/workContext.ts
|
|
11
|
+
import { createHash } from "crypto";
|
|
12
|
+
var facet = "work-context";
|
|
13
|
+
var statuses = ["active", "paused", "completed", "cancelled"];
|
|
14
|
+
var hash = (v) => createHash("sha256").update(JSON.stringify(v)).digest("hex");
|
|
15
|
+
var isWorkContextState = (state) => state.facet === facet;
|
|
16
|
+
var bounded = (s, max) => typeof s === "string" && s.trim().length > 0 && s.length <= max;
|
|
17
|
+
var list = (x, maxCount, maxLength) => Array.isArray(x) && x.length <= maxCount && x.every((v) => bounded(v, maxLength));
|
|
18
|
+
var object = (x) => !!x && typeof x === "object" && !Array.isArray(x);
|
|
19
|
+
var validScope = (s) => {
|
|
20
|
+
if (!s || !bounded(s.ownerId, 256) || !bounded(s.dialogId, 512) || !(s.spaceId === null || bounded(s.spaceId, 256))) throw new Error("invalid authorized scope");
|
|
21
|
+
};
|
|
22
|
+
function validValue(v) {
|
|
23
|
+
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
|
+
function validPatch(p) {
|
|
26
|
+
if (!object(p) || Object.keys(p).some((k) => !["status", "goal", "constraints", "openItems", "nextStep"].includes(k))) throw new Error("invalid patch");
|
|
27
|
+
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
|
+
if (p.nextStep !== void 0 && (typeof p.nextStep !== "string" || p.nextStep.length > 4096)) throw new Error("invalid nextStep");
|
|
30
|
+
for (const a of [p.constraints, p.openItems]) if (a !== void 0 && !list(a, 50, 2048)) throw new Error("invalid list");
|
|
31
|
+
}
|
|
32
|
+
async function updateWorkContext(db, scope, input) {
|
|
33
|
+
validScope(scope);
|
|
34
|
+
if (!object(input) || Object.keys(input).some((k) => !["activityId", "expectedRevision", "itemKey", "originRef", "changeId", "sourceRefs", "patch"].includes(k))) throw new Error("invalid input");
|
|
35
|
+
validPatch(input.patch);
|
|
36
|
+
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
|
+
if (creating && (!bounded(input.itemKey, 256) || !bounded(input.originRef, 2048) || input.expectedRevision !== void 0)) throw new Error("origin and itemKey required");
|
|
39
|
+
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
|
+
const activityId = creating ? `work-${hash([scope.ownerId, scope.spaceId, input.originRef, input.itemKey])}` : input.activityId;
|
|
41
|
+
const evidenceId = `work-change-${hash([activityId, input.changeId])}`;
|
|
42
|
+
const fingerprint = hash([scope.spaceId, scope.dialogId, input]);
|
|
43
|
+
let result;
|
|
44
|
+
await applyMemoryInterpreterMutation(db, scope.ownerId, async () => {
|
|
45
|
+
const states = (await listMemoryStatesForEntityVNext(db, scope.ownerId, activityId)).filter(isWorkContextState);
|
|
46
|
+
const currents = states.filter((s) => !s.retiredAt);
|
|
47
|
+
if (currents.length > 1 || currents[0] && !validValue(currents[0].value)) throw new Error("invalid work context state");
|
|
48
|
+
const current = currents[0];
|
|
49
|
+
const old = current?.value;
|
|
50
|
+
if (old && old.spaceId !== scope.spaceId) {
|
|
51
|
+
result = { activityId, revision: 0, outcome: "conflict" };
|
|
52
|
+
return { action: "no_op", reason: "scope mismatch" };
|
|
53
|
+
}
|
|
54
|
+
const receipt = await getMemoryEvidenceVNextStrict(db, scope.ownerId, evidenceId);
|
|
55
|
+
if (receipt) {
|
|
56
|
+
const matching = states.find((s) => s.evidenceIds.includes(evidenceId));
|
|
57
|
+
const savedValue = matching && validValue(matching.value) ? matching.value : void 0;
|
|
58
|
+
const match = receipt.text === fingerprint && !!savedValue;
|
|
59
|
+
result = { activityId, revision: match ? savedValue.revision : old?.revision ?? 0, outcome: match ? savedValue.revision === 1 ? "created" : "updated" : "conflict" };
|
|
60
|
+
return { action: "no_op", reason: "duplicate change" };
|
|
61
|
+
}
|
|
62
|
+
if (creating && current || !creating && (!old || old.revision !== input.expectedRevision)) {
|
|
63
|
+
result = { activityId, revision: old?.revision ?? 0, outcome: "conflict" };
|
|
64
|
+
return { action: "no_op", reason: "revision conflict" };
|
|
65
|
+
}
|
|
66
|
+
if (!old && !input.patch.goal) throw new Error("goal required");
|
|
67
|
+
const status = input.patch.status ?? old?.status ?? "active";
|
|
68
|
+
const dialogIds = [.../* @__PURE__ */ new Set([...old?.dialogIds ?? [], scope.dialogId])];
|
|
69
|
+
if (dialogIds.length > 100) throw new Error("dialog association limit exceeded");
|
|
70
|
+
const value = { version: 1, revision: (old?.revision ?? 0) + 1, status, goal: input.patch.goal ?? old.goal, constraints: input.patch.constraints ?? old?.constraints ?? [], openItems: input.patch.openItems ?? old?.openItems ?? [], nextStep: input.patch.nextStep ?? old?.nextStep, latestSourceRefs: input.sourceRefs, spaceId: scope.spaceId, dialogIds };
|
|
71
|
+
const unchanged = !!old && JSON.stringify([old.status, old.goal, old.constraints, old.openItems, old.nextStep]) === JSON.stringify([value.status, value.goal, value.constraints, value.openItems, value.nextStep]);
|
|
72
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
73
|
+
result = { activityId, revision: unchanged ? old.revision : value.revision, outcome: unchanged ? "unchanged" : old ? "updated" : "created" };
|
|
74
|
+
if (unchanged) return { action: "no_op", reason: "unchanged" };
|
|
75
|
+
const evidence = { id: evidenceId, ownerId: scope.ownerId, text: fingerprint, sourceRef: input.sourceRefs[0], confidence: 1, createdAt: now };
|
|
76
|
+
return { action: old ? "update" : "create", reason: "work context", entities: old ? [] : [{ id: activityId, ownerId: scope.ownerId, type: "activity", subtype: facet, name: value.goal, createdAt: now, updatedAt: now }], evidence: [evidence], states: [{ id: `work-state-${hash([activityId, value.revision])}`, ownerId: scope.ownerId, entityId: activityId, facet, value, text: value.goal, evidenceIds: [evidenceId], createdAt: now, updatedAt: now }], supersededStateIds: current ? [current.id] : [] };
|
|
77
|
+
});
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
async function readWorkContexts(db, scope, query = {}) {
|
|
81
|
+
validScope(scope);
|
|
82
|
+
if (!object(query) || Object.keys(query).some((k) => !["activityId", "status", "query", "limit", "discovery"].includes(k))) throw new Error("invalid query");
|
|
83
|
+
const limit = query.limit ?? 20;
|
|
84
|
+
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 100) throw new Error("limit must be 1..100");
|
|
85
|
+
if (query.status !== void 0 && query.status !== "all" && !statuses.some((status) => status === query.status)) throw new Error("invalid status");
|
|
86
|
+
if (query.discovery !== void 0 && query.discovery !== "dialog" && query.discovery !== "scope") throw new Error("invalid discovery");
|
|
87
|
+
if (query.activityId !== void 0 && !bounded(query.activityId, 256)) throw new Error("invalid activityId");
|
|
88
|
+
if (query.query !== void 0 && !bounded(query.query, 512)) throw new Error("invalid query text");
|
|
89
|
+
const states = query.activityId ? await listMemoryStatesForEntityVNext(db, scope.ownerId, query.activityId) : (await loadMemoryVNextCatalog(db, scope.ownerId)).states;
|
|
90
|
+
const items = [];
|
|
91
|
+
for (const state of states) {
|
|
92
|
+
if (!isWorkContextState(state) || state.retiredAt) continue;
|
|
93
|
+
if (!validValue(state.value) || !bounded(state.entityId, 256) || !bounded(state.updatedAt, 128)) throw new Error("invalid work context state");
|
|
94
|
+
const value = state.value;
|
|
95
|
+
if (value.spaceId !== scope.spaceId || !query.activityId && query.discovery !== "scope" && !value.dialogIds.includes(scope.dialogId)) continue;
|
|
96
|
+
if (query.status !== "all" && value.status !== (query.status ?? (query.activityId ? value.status : "active"))) continue;
|
|
97
|
+
if (query.query && !JSON.stringify([value.goal, value.constraints, value.openItems, value.nextStep]).toLowerCase().includes(query.query.toLowerCase())) continue;
|
|
98
|
+
items.push({ activityId: state.entityId, value, updatedAt: state.updatedAt });
|
|
99
|
+
}
|
|
100
|
+
items.sort((a, b) => Number(b.value.dialogIds.includes(scope.dialogId)) - Number(a.value.dialogIds.includes(scope.dialogId)) || b.updatedAt.localeCompare(a.updatedAt) || a.activityId.localeCompare(b.activityId));
|
|
101
|
+
return { items: items.slice(0, limit), hasMore: items.length > limit };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export {
|
|
105
|
+
isWorkContextState,
|
|
106
|
+
updateWorkContext,
|
|
107
|
+
readWorkContexts
|
|
108
|
+
};
|