nolo-cli 0.107.0-alpha.4 → 0.107.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.
Files changed (209) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-UDCSOTD2.js → _executeModel-C4EH5TZG.js} +77 -69
  3. package/action-GVA5ARSJ.js +20 -0
  4. package/{addContentAction-MB2HHMDZ.js → addContentAction-M2WOWZCL.js} +13 -12
  5. package/{addDialogAgentAction-MCEABSBA.js → addDialogAgentAction-QMAQ5Z6N.js} +19 -20
  6. package/{agentDeleteCommand-OWYHN6D6.js → agentDeleteCommand-D3RICSHX.js} +118 -43
  7. package/{agentEmailCommands-AU5I4M4W.js → agentEmailCommands-YC2A4USQ.js} +99 -89
  8. package/agentListCommands-UDJELMYP.js +741 -0
  9. package/{agentMachineCommands-YMNME2L6.js → agentMachineCommands-XH4IBGTO.js} +48 -44
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-CMVTBY5X.js} +97 -2
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-3EOC2QMN.js +138 -0
  13. package/agentRunCommand-BTHYOVVS.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-KCMC2TBD.js → agentRuntimeLocal-N4YGKL7M.js} +44 -40
  16. package/{agentSlice-R7PR6KYM.js → agentSlice-NIN4T6CF.js} +15 -14
  17. package/{appDeleteCommands-JEPA3EWE.js → appDeleteCommands-7DAF33AM.js} +46 -42
  18. package/{appDeployCommands-UTB76XFM.js → appDeployCommands-ZPZSMFGZ.js} +46 -42
  19. package/{appDeployStatusCommands-LGHF2SBD.js → appDeployStatusCommands-FWBDSSS5.js} +46 -42
  20. package/{appGetCommands-PX2BFHOB.js → appGetCommands-SZZOHGEP.js} +46 -42
  21. package/{appListCommands-BSMPTWKC.js → appListCommands-FPMUBDPM.js} +46 -42
  22. package/{authCommand-YW42YZA4.js → authCommand-VL3G26NQ.js} +119 -25
  23. package/{authCommands-RGOGCPP6.js → authCommands-5RTUDYZW.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-ZK4K67Y5.js} +11 -9
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-AU5ZJXBG.js} +289 -37
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-ZYTCMNHG.js} +156 -22
  27. package/{chunk-JDPFV2JV.js → chunk-2NNRWRM5.js} +20 -11
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-HVURBGF3.js → chunk-2U3NHADM.js} +6 -6
  30. package/{chunk-UVA7OYO3.js → chunk-2ZHBFX5R.js} +29 -9
  31. package/{chunk-QTGQ2LTL.js → chunk-3DQY5IFB.js} +6 -10
  32. package/chunk-4LCOCOR5.js +50 -0
  33. package/{chunk-JPGCXHNM.js → chunk-4LKMZ3RR.js} +1 -1
  34. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  35. package/{chunk-6D6VBVEW.js → chunk-4W24JM32.js} +80 -14
  36. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  37. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  38. package/chunk-5MMAK75Q.js +15 -0
  39. package/{chunk-7S4YWN7P.js → chunk-5UUIGN6I.js} +4 -4
  40. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  41. package/{chunk-IBOOZVVD.js → chunk-6IJDSYUA.js} +849 -279
  42. package/{chunk-4MK3I7Y4.js → chunk-6MAW4XOF.js} +5 -5
  43. package/chunk-76HO2DP6.js +15 -0
  44. package/chunk-7AY2H3GA.js +13692 -0
  45. package/{chunk-4CR5I7BD.js → chunk-7HYOPBUW.js} +47 -67
  46. package/{chunk-VLTIYV3X.js → chunk-7I25CBT5.js} +34 -8
  47. package/chunk-AGIM7IMJ.js +147 -0
  48. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  49. package/{chunk-6OZ36FXI.js → chunk-BIPGGSJS.js} +22 -4
  50. package/{chunk-EYAQT56M.js → chunk-BNQMNUKZ.js} +9 -6
  51. package/{chunk-62CATUYY.js → chunk-CBUMFIFE.js} +834 -962
  52. package/{chunk-OIVSQH2O.js → chunk-CDEEFJXN.js} +308 -11
  53. package/chunk-CHOZJMJS.js +78 -0
  54. package/{chunk-ETI2NYVF.js → chunk-CIP3AAMT.js} +4 -4
  55. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  56. package/{chunk-IBOZNTG2.js → chunk-DGEUP3DK.js} +23 -28
  57. package/{chunk-Q554LLSI.js → chunk-DMXLXZKL.js} +1 -1
  58. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  59. package/{chunk-HKNXJGEC.js → chunk-ECFHBYUW.js} +85 -50
  60. package/{chunk-ACTMNVHM.js → chunk-EHSYSKXV.js} +1 -1
  61. package/{chunk-WV42OMV7.js → chunk-ELUDRSRD.js} +8 -8
  62. package/{chunk-ABQYVJBJ.js → chunk-EV235ILT.js} +5 -5
  63. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  64. package/{chunk-BFDFRLLQ.js → chunk-EZ4VZHAG.js} +5 -5
  65. package/{chunk-GO3Z72MT.js → chunk-FHLMQIU7.js} +65 -95
  66. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  67. package/{chunk-SH43IESU.js → chunk-GGC55Q32.js} +199 -29
  68. package/chunk-GMZLP5DV.js +82 -0
  69. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  70. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  71. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  72. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  73. package/{chunk-BNGW5ASC.js → chunk-I2RGRVQ7.js} +22 -2
  74. package/{chunk-O6OSWFZQ.js → chunk-IHPDK6UD.js} +6 -0
  75. package/{chunk-QDSINZM3.js → chunk-IXH3HKY2.js} +1 -22
  76. package/{chunk-GQBOR3G6.js → chunk-JBKHQOYK.js} +8 -4
  77. package/{chunk-XD2MJFUG.js → chunk-JEFXP73H.js} +1 -1
  78. package/{chunk-PBA4UJBK.js → chunk-JIXGJTBU.js} +4 -4
  79. package/{chunk-AEOE4Z6Q.js → chunk-K6L5PNXK.js} +39 -15
  80. package/{chunk-Z77CRGTW.js → chunk-KA5O5KQL.js} +1 -1
  81. package/{chunk-GPCZ7UXG.js → chunk-KD6D6BLA.js} +1 -1
  82. package/{chunk-UZGQNTVW.js → chunk-KHKTDMYG.js} +8 -6
  83. package/{chunk-MRIHM22T.js → chunk-LBFL6RZG.js} +58 -9
  84. package/{chunk-C3M4465B.js → chunk-LKIVH2I2.js} +403 -658
  85. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  86. package/{chunk-DHDMC6FO.js → chunk-LUBFABMJ.js} +15 -14
  87. package/{chunk-NA35QHCF.js → chunk-LVBFKW65.js} +1 -1
  88. package/chunk-LWLNLZC5.js +265 -0
  89. package/{chunk-EEGDMATE.js → chunk-M3NMHYRB.js} +86 -81
  90. package/chunk-N4NGJDT6.js +929 -0
  91. package/{chunk-GL3EHUR4.js → chunk-N7NLLRQQ.js} +68 -46
  92. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  93. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  94. package/chunk-NWENLDMM.js +42 -0
  95. package/chunk-O7SVKKLY.js +875 -0
  96. package/chunk-OCZKATRC.js +129 -0
  97. package/{chunk-6Z7MY3V7.js → chunk-OEJLGVBL.js} +5 -5
  98. package/{chunk-VMFTFOWF.js → chunk-OKGVNZTL.js} +35 -8
  99. package/{chunk-GEPUP7OO.js → chunk-OR2UWD6X.js} +3 -3
  100. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  101. package/{chunk-J4MOO56S.js → chunk-PNXHPLRU.js} +10 -2
  102. package/{chunk-3BMYXEUW.js → chunk-R5AJODNI.js} +1 -1
  103. package/{chunk-P5EVSOPA.js → chunk-R6EBQEQE.js} +22 -29
  104. package/{chunk-NOF3HDSN.js → chunk-RLSF5CSE.js} +11 -9
  105. package/chunk-RQ6CTX2E.js +164 -0
  106. package/{chunk-3UZPUAES.js → chunk-RSB4PWX4.js} +1 -1
  107. package/{chunk-KQ4ONNQD.js → chunk-RXA3HAVW.js} +190 -8
  108. package/{chunk-IIVGDG4I.js → chunk-SJKULPGX.js} +13 -7
  109. package/chunk-SQHMSDDU.js +8004 -0
  110. package/{chunk-Q67DOFOO.js → chunk-SZC4REES.js} +212 -105
  111. package/{chunk-JRQFUXY7.js → chunk-TBAXFWOS.js} +99 -22
  112. package/{chunk-PQFHGD77.js → chunk-TBM2RS3U.js} +161 -14
  113. package/{chunk-XT35TTFG.js → chunk-TCYU7L6V.js} +18 -20
  114. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  115. package/chunk-TY3TIUJK.js +89 -0
  116. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  117. package/{chunk-YYLHWIW6.js → chunk-UKZX3NHN.js} +1 -1
  118. package/chunk-UM7TA3K4.js +1008 -0
  119. package/{chunk-6YTOJY35.js → chunk-VBG7GWWR.js} +253 -8
  120. package/chunk-VIWDGTDA.js +8 -0
  121. package/chunk-VJVNU77E.js +83 -0
  122. package/{chunk-W7HLWAQ7.js → chunk-VPLUU4IX.js} +118 -90
  123. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  124. package/chunk-VZLO4XJD.js +17 -0
  125. package/{chunk-AHAHBQMU.js → chunk-WDLSZMTA.js} +2 -2
  126. package/{chunk-53HEEOTT.js → chunk-WF5X57VW.js} +83 -16
  127. package/{chunk-VRTTFDBM.js → chunk-WPHY3VPF.js} +35 -22
  128. package/{chunk-ASIFZ2WY.js → chunk-YKZLFY5J.js} +66 -54
  129. package/chunk-YV25TM3R.js +780 -0
  130. package/{chunk-MS7TSPZR.js → chunk-YXKNBVYW.js} +19 -17
  131. package/chunk-ZRAU6T47.js +56 -0
  132. package/commandRegistry-UU6IOTHI.js +833 -0
  133. package/{contentThunks-IV2T3EJC.js → contentThunks-ARD56LKI.js} +39 -36
  134. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  135. package/{createAgentAutomationAction-JCOIEYY4.js → createAgentAutomationAction-HWJLU6DD.js} +40 -37
  136. package/createDialogAction-CHYA6PZE.js +70 -0
  137. package/{createPageAction-D2VOOLP3.js → createPageAction-TSCYNFX7.js} +47 -43
  138. package/{chunk-FG3HKPQP.js → cursorProvider-YGGNMVWX.js} +2751 -10185
  139. package/{dbSlice-A6C6H32X.js → dbSlice-TG4MZ5EB.js} +12 -11
  140. package/{deleteFile-YG6QMJLU.js → deleteFile-KESP65GC.js} +7 -6
  141. package/{dialogCommands-H7FPUYUQ.js → dialogCommands-IJYQAQMB.js} +49 -46
  142. package/{dialogSlice-6JZOOTDS.js → dialogSlice-H476I77R.js} +57 -37
  143. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  144. package/{docCreateCommands-WRG2JLGM.js → docCreateCommands-AZSK4NAG.js} +48 -44
  145. package/{docDeleteCommands-SHWJIBJS.js → docDeleteCommands-DDJMSMFZ.js} +49 -45
  146. package/{docReadCommands-WJN3WT6O.js → docReadCommands-5F5Q6EBZ.js} +47 -43
  147. package/{docStore-HUPQ2FSS.js → docStore-HW2RDZDM.js} +17 -13
  148. package/{docUpdateCommands-IE32IL6O.js → docUpdateCommands-XPNPVZOC.js} +48 -44
  149. package/{fetchMessages-EIU7UFFK.js → fetchMessages-3PXAHKCR.js} +5 -5
  150. package/{getPricing-LUSEABA6.js → getPricing-DOBBZLOK.js} +4 -4
  151. package/{handleSendMessageAction-DFPMQ7YM.js → handleSendMessageAction-IOXE7ILC.js} +109 -42
  152. package/index.js +87 -884
  153. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  154. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-UYCKO7YZ.js} +2 -2
  155. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  156. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  157. package/{machineCommands-M2T2I5NF.js → machineCommands-Q7TDGM6P.js} +96 -86
  158. package/machineWsRunDispatch-T5VFOQ3R.js +154 -0
  159. package/{memberThunks-P2ECUJ56.js → memberThunks-5S5D3N4U.js} +20 -18
  160. package/{models-T3SG6MJ5.js → models-PQU25T6Q.js} +2 -2
  161. package/oauthTokenStore-ITEB663N.js +23 -0
  162. package/package.json +1 -1
  163. package/processSpawn-SOAV3FEV.js +11 -0
  164. package/profileConfig-ZGOFORWV.js +43 -0
  165. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-HAQWVAQX.js} +7 -7
  166. package/{providerRegistry-757OWH3O.js → providerRegistry-5FGWB3X5.js} +11 -7
  167. package/{read-COE3ZYR6.js → read-LSYFLSIM.js} +8 -7
  168. package/{readDocTool-5USN4A6V.js → readDocTool-XWRXV3DR.js} +5 -3
  169. package/{readlineWorkspace-XQRDGWRZ.js → readlineWorkspace-25U6P3DG.js} +2595 -2031
  170. package/{removeDialogAgentAction-J6X5QMTA.js → removeDialogAgentAction-4TEFC3VL.js} +22 -26
  171. package/{runAgentClientLoop-5ZA62FBA.js → runAgentClientLoop-CZOYWHDN.js} +78 -71
  172. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  173. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  174. package/{setDialogExtraReferencesAction-WX5VTY6O.js → setDialogExtraReferencesAction-LSEN44OY.js} +16 -14
  175. package/{setPrimaryDialogAgentAction-FN22THHT.js → setPrimaryDialogAgentAction-SR366X5A.js} +23 -27
  176. package/{chunk-GP5LKBUZ.js → settingThunks-CTVPPGIN.js} +226 -940
  177. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  178. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  179. package/{spaceCommands-5GLCWZPO.js → spaceCommands-3UK63WPE.js} +51 -47
  180. package/{streamAgentChatTurn-6UZJMYRB.js → streamAgentChatTurn-LV6ZWUD4.js} +214 -114
  181. package/{switchDialogAgentAction-LVTEV3FR.js → switchDialogAgentAction-M6NAFOOU.js} +19 -20
  182. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  183. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-AD7CXTA4.js} +4 -3
  184. package/tools-UJOV6CQZ.js +117 -0
  185. package/{tuiSummaryLlmCaller-OHHFTHMG.js → tuiSummaryLlmCaller-DEH7ZEM6.js} +25 -23
  186. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  187. package/{updateDialogTitleAction-QTKNIURB.js → updateDialogTitleAction-JYXKIBNJ.js} +84 -45
  188. package/action-P4TNFGAD.js +0 -31
  189. package/agentListCommands-B2V4YAC4.js +0 -410
  190. package/agentRecordCommands-G4KK4R7H.js +0 -128
  191. package/agentRunCommand-UTZJA23G.js +0 -156
  192. package/browser-image-compression-MFDTD7K6.js +0 -1763
  193. package/chatQueueReduxAdapter-2P6NFX64.js +0 -186
  194. package/chunk-CQ3WA2NE.js +0 -299
  195. package/chunk-M76ECQRD.js +0 -13658
  196. package/chunk-MEYIRKDN.js +0 -8967
  197. package/chunk-PUOC4YRO.js +0 -394
  198. package/chunk-Q5FJJ6XI.js +0 -103
  199. package/chunk-S7Z2HMCN.js +0 -25
  200. package/chunk-T75QD6AB.js +0 -20923
  201. package/chunk-Y5GCAMGP.js +0 -9
  202. package/chunk-YPREESF4.js +0 -225
  203. package/createDialogAction-NGG7YVNU.js +0 -65
  204. package/machineWsRunDispatch-ISBKOOD7.js +0 -144
  205. package/settingSlice-P4ZW7K5X.js +0 -204
  206. package/syncMapping-N6RGXGBW.js +0 -437
  207. package/tools-KMGFWO43.js +0 -110
  208. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  209. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -1,437 +0,0 @@
1
- import {
2
- asOptionalFiniteNumber
3
- } from "./chunk-WWC7I6TA.js";
4
- import {
5
- isLevelNotFoundError
6
- } from "./chunk-OW765XBU.js";
7
- import {
8
- asTrimmedString
9
- } from "./chunk-3EUW3WEO.js";
10
- import {
11
- asOptionalPositiveFiniteNumber
12
- } from "./chunk-U6VC4MU4.js";
13
- import "./chunk-4VNS5WPM.js";
14
-
15
- // packages/database/sync/syncMappingKeys.ts
16
- var SYNC_MAPPING_KEY_PREFIX = "syncmap-local-";
17
- var SYNC_MAPPING_KEY_SEPARATOR = "::";
18
- var SYNC_MAPPING_RECORD_TYPE = "sync_mapping";
19
- var normalizeSegment = (value) => asTrimmedString(value);
20
- function buildSyncMappingRecordKey(accountUserId, localDbKey) {
21
- const account = normalizeSegment(accountUserId);
22
- const local = normalizeSegment(localDbKey);
23
- if (!account) {
24
- throw new Error("syncMapping record key requires accountUserId");
25
- }
26
- if (!local) {
27
- throw new Error("syncMapping record key requires localDbKey");
28
- }
29
- if (account.includes(SYNC_MAPPING_KEY_SEPARATOR)) {
30
- throw new Error(
31
- `syncMapping accountUserId must not contain "${SYNC_MAPPING_KEY_SEPARATOR}"`
32
- );
33
- }
34
- return `${SYNC_MAPPING_KEY_PREFIX}${account}${SYNC_MAPPING_KEY_SEPARATOR}${local}`;
35
- }
36
- function isSyncMappingRecordKey(dbKey) {
37
- const key = normalizeSegment(dbKey);
38
- return key.startsWith(SYNC_MAPPING_KEY_PREFIX);
39
- }
40
- function syncMappingRecordKeyRange() {
41
- const start = SYNC_MAPPING_KEY_PREFIX;
42
- return {
43
- gte: start,
44
- lte: `${start}\uFFFF`
45
- };
46
- }
47
-
48
- // packages/database/sync/syncMappingDurable.ts
49
- var clean = (value) => asTrimmedString(value);
50
- function toDurableSyncMappingRecord(input) {
51
- const localDbKey = clean(input.localDbKey);
52
- const remoteDbKey = clean(input.remoteDbKey);
53
- const accountUserId = clean(input.accountUserId);
54
- const contentType = clean(input.contentType) || "unknown";
55
- const updatedAt = asOptionalFiniteNumber(input.updatedAt) ?? Date.now();
56
- if (!localDbKey || !remoteDbKey || !accountUserId) {
57
- throw new Error("durable syncMapping requires local/remote/account keys");
58
- }
59
- const dbKey = buildSyncMappingRecordKey(accountUserId, localDbKey);
60
- return {
61
- type: SYNC_MAPPING_RECORD_TYPE,
62
- userId: "local",
63
- dbKey,
64
- localDbKey,
65
- remoteDbKey,
66
- accountUserId,
67
- contentType,
68
- updatedAt
69
- };
70
- }
71
- function parseDurableSyncMappingRecord(value) {
72
- if (!value || typeof value !== "object") return null;
73
- const row = value;
74
- if (row.type !== SYNC_MAPPING_RECORD_TYPE) return null;
75
- if (row.userId !== "local" && row.userId !== void 0) {
76
- return null;
77
- }
78
- const localDbKey = clean(row.localDbKey);
79
- const remoteDbKey = clean(row.remoteDbKey);
80
- const accountUserId = clean(row.accountUserId);
81
- const contentType = clean(row.contentType) || "unknown";
82
- const updatedAt = asOptionalFiniteNumber(row.updatedAt) ?? Date.now();
83
- if (!localDbKey || !remoteDbKey || !accountUserId) return null;
84
- if (localDbKey === remoteDbKey) return null;
85
- if (accountUserId === "local") return null;
86
- return {
87
- localDbKey,
88
- remoteDbKey,
89
- accountUserId,
90
- contentType,
91
- updatedAt
92
- };
93
- }
94
- async function persistSyncMappingToDb(db, input) {
95
- const record = toDurableSyncMappingRecord(input);
96
- await db.put(record.dbKey, record);
97
- return record;
98
- }
99
- async function removeSyncMappingFromDb(db, accountUserId, localDbKey) {
100
- const dbKey = buildSyncMappingRecordKey(accountUserId, localDbKey);
101
- try {
102
- if (typeof db.del === "function") {
103
- await db.del(dbKey);
104
- return true;
105
- }
106
- await db.put(dbKey, null);
107
- return true;
108
- } catch (err) {
109
- if (isLevelNotFoundError(err)) return false;
110
- throw err;
111
- }
112
- }
113
- async function loadSyncMappingsFromDb(db) {
114
- if (typeof db.iterator !== "function") {
115
- return [];
116
- }
117
- const range = syncMappingRecordKeyRange();
118
- let iterator = db.iterator(range);
119
- if (iterator && typeof iterator.then === "function") {
120
- iterator = await iterator;
121
- }
122
- if (!iterator) return [];
123
- const out = [];
124
- for await (const entry of iterator) {
125
- const pair = entry;
126
- const key = Array.isArray(pair) ? pair[0] : "";
127
- const value = Array.isArray(pair) ? pair[1] : null;
128
- if (!isSyncMappingRecordKey(key)) continue;
129
- if (value == null) continue;
130
- const mapping = parseDurableSyncMappingRecord(value);
131
- if (mapping) out.push(mapping);
132
- }
133
- return out;
134
- }
135
-
136
- // packages/database/sync/syncMapping.ts
137
- var normalizeKey = (value) => asTrimmedString(value);
138
- var normalizeContentType = (value) => {
139
- const trimmed = normalizeKey(value);
140
- return trimmed.length > 0 ? trimmed : "unknown";
141
- };
142
- var toUpdatedAt = (value, fallback) => {
143
- const asNumber = asOptionalPositiveFiniteNumber(value);
144
- if (asNumber !== void 0) return asNumber;
145
- if (typeof value === "string" && value.trim()) {
146
- return asOptionalPositiveFiniteNumber(Date.parse(value)) ?? fallback;
147
- }
148
- return fallback;
149
- };
150
- var pairKey = (accountUserId, localDbKey) => `${accountUserId}\0${localDbKey}`;
151
- function normalizeSyncMapping(input, now = Date.now()) {
152
- const localDbKey = normalizeKey(input.localDbKey);
153
- const remoteDbKey = normalizeKey(input.remoteDbKey);
154
- const accountUserId = normalizeKey(input.accountUserId);
155
- const contentType = normalizeContentType(input.contentType);
156
- if (!localDbKey) {
157
- throw new Error("syncMapping.localDbKey is required");
158
- }
159
- if (!remoteDbKey) {
160
- throw new Error("syncMapping.remoteDbKey is required");
161
- }
162
- if (!accountUserId) {
163
- throw new Error("syncMapping.accountUserId is required");
164
- }
165
- if (localDbKey === remoteDbKey) {
166
- throw new Error("syncMapping.localDbKey and remoteDbKey must differ");
167
- }
168
- if (accountUserId === "local") {
169
- throw new Error(
170
- "syncMapping.accountUserId must be a non-local account user id"
171
- );
172
- }
173
- return {
174
- localDbKey,
175
- remoteDbKey,
176
- accountUserId,
177
- contentType,
178
- updatedAt: toUpdatedAt(input.updatedAt, now)
179
- };
180
- }
181
- function createSyncMappingStore(options) {
182
- const now = options?.now ?? Date.now;
183
- const byPair = /* @__PURE__ */ new Map();
184
- const remoteToPair = /* @__PURE__ */ new Map();
185
- const forgetRemoteIndex = (mapping) => {
186
- if (!mapping) return;
187
- const current = remoteToPair.get(mapping.remoteDbKey);
188
- if (current === pairKey(mapping.accountUserId, mapping.localDbKey)) {
189
- remoteToPair.delete(mapping.remoteDbKey);
190
- }
191
- };
192
- return {
193
- put(input) {
194
- const mapping = normalizeSyncMapping(input, now());
195
- const key = pairKey(mapping.accountUserId, mapping.localDbKey);
196
- const previousLocal = byPair.get(key);
197
- if (previousLocal) {
198
- forgetRemoteIndex(previousLocal);
199
- }
200
- const previousPairForRemote = remoteToPair.get(mapping.remoteDbKey);
201
- if (previousPairForRemote && previousPairForRemote !== key) {
202
- const displaced = byPair.get(previousPairForRemote);
203
- if (displaced) {
204
- byPair.delete(previousPairForRemote);
205
- }
206
- }
207
- byPair.set(key, mapping);
208
- remoteToPair.set(mapping.remoteDbKey, key);
209
- return { ...mapping };
210
- },
211
- get(localDbKey, accountUserId) {
212
- const local = normalizeKey(localDbKey);
213
- if (!local) return null;
214
- const account = normalizeKey(accountUserId);
215
- if (account) {
216
- const mapping = byPair.get(pairKey(account, local));
217
- return mapping ? { ...mapping } : null;
218
- }
219
- let best = null;
220
- for (const mapping of byPair.values()) {
221
- if (mapping.localDbKey !== local) continue;
222
- if (!best || mapping.updatedAt > best.updatedAt) {
223
- best = mapping;
224
- }
225
- }
226
- return best ? { ...best } : null;
227
- },
228
- getByRemoteDbKey(remoteDbKey, accountUserId) {
229
- const key = normalizeKey(remoteDbKey);
230
- if (!key) return null;
231
- const pair = remoteToPair.get(key);
232
- if (!pair) return null;
233
- const mapping = byPair.get(pair);
234
- if (!mapping) return null;
235
- const account = normalizeKey(accountUserId);
236
- if (account && mapping.accountUserId !== account) return null;
237
- return { ...mapping };
238
- },
239
- list(filter) {
240
- const accountUserId = normalizeKey(filter?.accountUserId);
241
- const contentType = normalizeKey(filter?.contentType);
242
- const rows = Array.from(byPair.values()).filter((mapping) => {
243
- if (accountUserId && mapping.accountUserId !== accountUserId) {
244
- return false;
245
- }
246
- if (contentType && mapping.contentType !== contentType) return false;
247
- return true;
248
- });
249
- return rows.map((mapping) => ({ ...mapping })).sort(
250
- (left, right) => right.updatedAt - left.updatedAt || left.localDbKey.localeCompare(right.localDbKey) || left.accountUserId.localeCompare(right.accountUserId)
251
- );
252
- },
253
- remove(localDbKey, accountUserId) {
254
- const local = normalizeKey(localDbKey);
255
- if (!local) return false;
256
- const account = normalizeKey(accountUserId);
257
- if (account) {
258
- const key = pairKey(account, local);
259
- const existing = byPair.get(key);
260
- if (!existing) return false;
261
- byPair.delete(key);
262
- forgetRemoteIndex(existing);
263
- return true;
264
- }
265
- let removed = false;
266
- for (const [key, mapping] of Array.from(byPair.entries())) {
267
- if (mapping.localDbKey !== local) continue;
268
- byPair.delete(key);
269
- forgetRemoteIndex(mapping);
270
- removed = true;
271
- }
272
- return removed;
273
- },
274
- clear() {
275
- byPair.clear();
276
- remoteToPair.clear();
277
- },
278
- size() {
279
- return byPair.size;
280
- }
281
- };
282
- }
283
- var defaultSyncMappingStore = createSyncMappingStore();
284
- var mappingVersion = 0;
285
- var mappingListeners = /* @__PURE__ */ new Set();
286
- var sameConsumerMapping = (a, b) => {
287
- if (a === b) return true;
288
- if (!a || !b) return false;
289
- return a.localDbKey === b.localDbKey && a.remoteDbKey === b.remoteDbKey && a.accountUserId === b.accountUserId && a.contentType === b.contentType;
290
- };
291
- var notifySyncMappingListeners = () => {
292
- mappingVersion += 1;
293
- for (const listener of mappingListeners) {
294
- try {
295
- listener();
296
- } catch {
297
- }
298
- }
299
- };
300
- function subscribeSyncMappingVersion(listener) {
301
- mappingListeners.add(listener);
302
- return () => {
303
- mappingListeners.delete(listener);
304
- };
305
- }
306
- function getSyncMappingVersion() {
307
- return mappingVersion;
308
- }
309
- var boundClientDb = null;
310
- var mappingsHydrated = false;
311
- var hydrateEpoch = 0;
312
- var hydrateInFlight = null;
313
- function bindSyncMappingClientDb(db) {
314
- boundClientDb = db;
315
- mappingsHydrated = false;
316
- hydrateEpoch += 1;
317
- }
318
- function getBoundSyncMappingClientDb() {
319
- return boundClientDb;
320
- }
321
- async function ensureSyncMappingsHydrated(db) {
322
- const client = db ?? boundClientDb;
323
- if (!client) return false;
324
- if (mappingsHydrated) return false;
325
- if (hydrateInFlight && hydrateInFlight.epoch === hydrateEpoch) {
326
- await hydrateInFlight.promise;
327
- return false;
328
- }
329
- const epoch = hydrateEpoch;
330
- const clientAtStart = client;
331
- const promise = (async () => {
332
- const rows = await loadSyncMappingsFromDb(clientAtStart);
333
- if (epoch !== hydrateEpoch) {
334
- return false;
335
- }
336
- const beforeSize = defaultSyncMappingStore.size();
337
- defaultSyncMappingStore.clear();
338
- for (const row of rows) {
339
- try {
340
- defaultSyncMappingStore.put(row);
341
- } catch {
342
- }
343
- }
344
- mappingsHydrated = true;
345
- if (beforeSize > 0 || rows.length > 0 || defaultSyncMappingStore.size() > 0) {
346
- notifySyncMappingListeners();
347
- }
348
- return true;
349
- })();
350
- hydrateInFlight = { epoch, promise };
351
- try {
352
- return await promise;
353
- } finally {
354
- if (hydrateInFlight?.promise === promise) {
355
- hydrateInFlight = null;
356
- }
357
- }
358
- }
359
- function putSyncMapping(mapping) {
360
- const account = normalizeKey(mapping.accountUserId);
361
- const local = normalizeKey(mapping.localDbKey);
362
- const previous = account && local ? defaultSyncMappingStore.get(local, account) : null;
363
- const next = defaultSyncMappingStore.put(mapping);
364
- if (!sameConsumerMapping(previous, next)) {
365
- notifySyncMappingListeners();
366
- }
367
- return next;
368
- }
369
- async function putSyncMappingDurable(mapping) {
370
- const normalized = normalizeSyncMapping(mapping);
371
- if (!boundClientDb) {
372
- throw new Error(
373
- "putSyncMappingDurable requires a bound client DB; refuse silent memory-only durability"
374
- );
375
- }
376
- await persistSyncMappingToDb(boundClientDb, normalized);
377
- return putSyncMapping(normalized);
378
- }
379
- function getSyncMapping(localDbKey, accountUserId) {
380
- return defaultSyncMappingStore.get(localDbKey, accountUserId);
381
- }
382
- function getSyncMappingByRemoteDbKey(remoteDbKey, accountUserId) {
383
- return defaultSyncMappingStore.getByRemoteDbKey(remoteDbKey, accountUserId);
384
- }
385
- function listSyncMappings(filter) {
386
- return defaultSyncMappingStore.list(filter);
387
- }
388
- function removeSyncMapping(localDbKey, accountUserId) {
389
- const removed = defaultSyncMappingStore.remove(localDbKey, accountUserId);
390
- if (removed) {
391
- notifySyncMappingListeners();
392
- }
393
- return removed;
394
- }
395
- async function removeSyncMappingDurable(localDbKey, accountUserId) {
396
- const account = normalizeKey(accountUserId);
397
- const local = normalizeKey(localDbKey);
398
- if (!account || !local) return false;
399
- if (boundClientDb) {
400
- await removeSyncMappingFromDb(boundClientDb, account, local);
401
- }
402
- return removeSyncMapping(local, account);
403
- }
404
- function clearSyncMappings() {
405
- const hadRows = defaultSyncMappingStore.size() > 0;
406
- defaultSyncMappingStore.clear();
407
- mappingsHydrated = false;
408
- hydrateEpoch += 1;
409
- if (hadRows) {
410
- notifySyncMappingListeners();
411
- }
412
- }
413
- function getDefaultSyncMappingStore() {
414
- return defaultSyncMappingStore;
415
- }
416
- function areSyncMappingsHydrated() {
417
- return mappingsHydrated;
418
- }
419
- export {
420
- areSyncMappingsHydrated,
421
- bindSyncMappingClientDb,
422
- clearSyncMappings,
423
- createSyncMappingStore,
424
- ensureSyncMappingsHydrated,
425
- getBoundSyncMappingClientDb,
426
- getDefaultSyncMappingStore,
427
- getSyncMapping,
428
- getSyncMappingByRemoteDbKey,
429
- getSyncMappingVersion,
430
- listSyncMappings,
431
- normalizeSyncMapping,
432
- putSyncMapping,
433
- putSyncMappingDurable,
434
- removeSyncMapping,
435
- removeSyncMappingDurable,
436
- subscribeSyncMappingVersion
437
- };
package/tools-KMGFWO43.js DELETED
@@ -1,110 +0,0 @@
1
- import {
2
- TOOL_GROUP_META,
3
- findToolExecutor,
4
- patchAgentToolSchemas,
5
- toolDefinitionsByName,
6
- toolDescriptions,
7
- toolExecutors,
8
- toolQueryFunc,
9
- toolQueryFunctionSchema,
10
- toolRegistry
11
- } from "./chunk-C3M4465B.js";
12
- import "./chunk-5UTFL4QJ.js";
13
- import "./chunk-NF64D32W.js";
14
- import "./chunk-3L2WKC3W.js";
15
- import "./chunk-3VNWWVKB.js";
16
- import "./chunk-PQFHGD77.js";
17
- import "./chunk-KQHGZWSV.js";
18
- import "./chunk-J4MOO56S.js";
19
- import "./chunk-6Z7MY3V7.js";
20
- import "./chunk-VLTIYV3X.js";
21
- import "./chunk-QTGQ2LTL.js";
22
- import "./chunk-N4G4PKQ6.js";
23
- import "./chunk-FZGV4FGK.js";
24
- import "./chunk-MEYIRKDN.js";
25
- import "./chunk-63W5N6P3.js";
26
- import "./chunk-VF4K2QE6.js";
27
- import "./chunk-JDPFV2JV.js";
28
- import "./chunk-IBOZNTG2.js";
29
- import "./chunk-4CR5I7BD.js";
30
- import "./chunk-ZJ7UHBJS.js";
31
- import "./chunk-T75QD6AB.js";
32
- import "./chunk-MC4XLIJ7.js";
33
- import "./chunk-3BMYXEUW.js";
34
- import "./chunk-YYLHWIW6.js";
35
- import "./chunk-AGGIDPCZ.js";
36
- import "./chunk-NOF3HDSN.js";
37
- import "./chunk-BFDFRLLQ.js";
38
- import "./chunk-5RGU3J7P.js";
39
- import "./chunk-6YTOJY35.js";
40
- import "./chunk-M76ECQRD.js";
41
- import "./chunk-YDH3FDFQ.js";
42
- import "./chunk-JRQFUXY7.js";
43
- import {
44
- TOOL_PACKS,
45
- addDefaultLightWebToolsForConfiguredAgents,
46
- applyDefaultWebToolPacks
47
- } from "./chunk-DHDMC6FO.js";
48
- import "./chunk-Q554LLSI.js";
49
- import "./chunk-KHCLMKZZ.js";
50
- import "./chunk-IIVGDG4I.js";
51
- import "./chunk-FDTR4QJ6.js";
52
- import "./chunk-UZGQNTVW.js";
53
- import "./chunk-6OZ36FXI.js";
54
- import "./chunk-HKNXJGEC.js";
55
- import "./chunk-P5EVSOPA.js";
56
- import "./chunk-PSCNXBYA.js";
57
- import "./chunk-GQBOR3G6.js";
58
- import "./chunk-BYXBJQAS.js";
59
- import "./chunk-OIVSQH2O.js";
60
- import "./chunk-DWLEOOGR.js";
61
- import "./chunk-HVURBGF3.js";
62
- import "./chunk-ONXOABJR.js";
63
- import "./chunk-W7XHHYWM.js";
64
- import "./chunk-HNMXYYJR.js";
65
- import "./chunk-O6OSWFZQ.js";
66
- import "./chunk-7S4YWN7P.js";
67
- import "./chunk-ACTMNVHM.js";
68
- import "./chunk-Q67DOFOO.js";
69
- import "./chunk-PBA4UJBK.js";
70
- import "./chunk-GP5LKBUZ.js";
71
- import "./chunk-Y5GCAMGP.js";
72
- import "./chunk-QDSINZM3.js";
73
- import "./chunk-KX6YBIHG.js";
74
- import "./chunk-AHAHBQMU.js";
75
- import "./chunk-UAD2WT54.js";
76
- import "./chunk-VRTTFDBM.js";
77
- import "./chunk-VMFTFOWF.js";
78
- import "./chunk-WWC7I6TA.js";
79
- import "./chunk-ABQYVJBJ.js";
80
- import "./chunk-QSJ3HFEF.js";
81
- import "./chunk-WV42OMV7.js";
82
- import "./chunk-BNGW5ASC.js";
83
- import "./chunk-M2EJHDJP.js";
84
- import "./chunk-UKWGR5SS.js";
85
- import "./chunk-QOKAKDPE.js";
86
- import "./chunk-OW765XBU.js";
87
- import "./chunk-SEJ5OS6F.js";
88
- import "./chunk-GBRG75BQ.js";
89
- import "./chunk-KUG52IAP.js";
90
- import "./chunk-3EUW3WEO.js";
91
- import "./chunk-U6VC4MU4.js";
92
- import "./chunk-LCBAMY2M.js";
93
- import "./chunk-4SN6J65J.js";
94
- import "./chunk-CF7PE763.js";
95
- import "./chunk-G3SUCT4W.js";
96
- import "./chunk-4VNS5WPM.js";
97
- export {
98
- TOOL_GROUP_META,
99
- TOOL_PACKS,
100
- addDefaultLightWebToolsForConfiguredAgents,
101
- applyDefaultWebToolPacks,
102
- findToolExecutor,
103
- patchAgentToolSchemas,
104
- toolDefinitionsByName,
105
- toolDescriptions,
106
- toolExecutors,
107
- toolQueryFunc,
108
- toolQueryFunctionSchema,
109
- toolRegistry
110
- };
File without changes
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  getOrCreateServerStoreRuntime
3
3
  } from "./chunk-M5PVFLD4.js";
4
+ import "./chunk-CIF4X6ZM.js";
4
5
  import {
5
6
  isLevelLockError
6
7
  } from "./chunk-URMS4XY2.js";
7
- import "./chunk-CIF4X6ZM.js";
8
8
  import "./chunk-UV6VISQJ.js";
9
9
  import {
10
10
  resolveServerDbPath