nolo-cli 0.99.0-alpha.1 → 0.99.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 (206) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-CJP7VSJB.js → _executeModel-F324DLT6.js} +74 -67
  3. package/action-PNPQLJHG.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-RBOUD7SJ.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-IODCR6TB.js} +18 -19
  6. package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-EFWZSSZA.js} +47 -42
  7. package/{agentEmailCommands-UH7KTTCN.js → agentEmailCommands-3TQXT2DZ.js} +97 -87
  8. package/agentListCommands-EDV4RJ4D.js +742 -0
  9. package/{agentMachineCommands-6NVUXZGQ.js → agentMachineCommands-HCHRMJRJ.js} +48 -43
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-IRNZXVGE.js} +1 -1
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-YX7CN2PH.js +138 -0
  13. package/agentRunCommand-BT5U3G5Q.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-SXYAKX3A.js} +48 -39
  16. package/{agentSlice-OU6TZKQP.js → agentSlice-TFZX3W5R.js} +14 -13
  17. package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-GTTBG53T.js} +46 -41
  18. package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-ZZCHUJAT.js} +46 -41
  19. package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-GZLLGY7Z.js} +46 -41
  20. package/{appGetCommands-SFAPP5PB.js → appGetCommands-ZRLWHJ3C.js} +46 -41
  21. package/{appListCommands-EKUBDRUO.js → appListCommands-OHARWLIL.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-NHDLY3IB.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-UDBJVSZU.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MAR5LPAC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  30. package/chunk-36XI7AVG.js +7881 -0
  31. package/{chunk-CSSGXQJ3.js → chunk-3AD37QCF.js} +551 -516
  32. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  33. package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
  34. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  35. package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
  36. package/chunk-4LCOCOR5.js +50 -0
  37. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  38. package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
  39. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  40. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  41. package/chunk-5J3PYNUP.js +255 -0
  42. package/chunk-5MMAK75Q.js +15 -0
  43. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  44. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  45. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  46. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  47. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  48. package/{chunk-L5UXH3B2.js → chunk-7TKWCTSY.js} +22 -6
  49. package/chunk-7UEMHIFV.js +13536 -0
  50. package/chunk-A4SQRTZ6.js +15 -0
  51. package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
  52. package/chunk-AGIM7IMJ.js +147 -0
  53. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  54. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  55. package/{chunk-53SXIJK6.js → chunk-AW2UF3FF.js} +19 -17
  56. package/chunk-BMQ2MJUK.js +153 -0
  57. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  58. package/chunk-CHOZJMJS.js +78 -0
  59. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  60. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  61. package/chunk-DZ7R5V3Y.js +164 -0
  62. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  63. package/{chunk-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
  64. package/{chunk-BA63USCV.js → chunk-ED7UD6EF.js} +1 -1
  65. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  66. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  67. package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
  68. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  69. package/{chunk-6IG4XSS6.js → chunk-FY7DCYW7.js} +88 -17
  70. package/{chunk-6VFARHZW.js → chunk-G53AA7RW.js} +934 -1091
  71. package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
  72. package/chunk-GMZLP5DV.js +82 -0
  73. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  74. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  75. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  76. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  77. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  78. package/{chunk-WCI7KQ4F.js → chunk-HPATMUWW.js} +24 -77
  79. package/{chunk-WP7SWVOM.js → chunk-I5L5CBSE.js} +20 -11
  80. package/{chunk-7KBQIEEW.js → chunk-J6ZXSIBA.js} +11 -9
  81. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  82. package/{chunk-FXRSQVU4.js → chunk-L6VWRPBW.js} +24 -5
  83. package/{chunk-4OEFYTWL.js → chunk-LKERWYPX.js} +67 -48
  84. package/{chunk-OEVAY4J6.js → chunk-LNVJHIGA.js} +18 -20
  85. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  86. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  87. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  88. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  89. package/chunk-NWENLDMM.js +42 -0
  90. package/{chunk-AEOE4Z6Q.js → chunk-NZWAO6LH.js} +13 -15
  91. package/chunk-OCZKATRC.js +129 -0
  92. package/chunk-OW4APERY.js +870 -0
  93. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  94. package/{chunk-KIOVECFO.js → chunk-OYA47B3D.js} +873 -227
  95. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  96. package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
  97. package/{chunk-5H7KJX7J.js → chunk-SEB5HAUU.js} +5 -5
  98. package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
  99. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  100. package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
  101. package/{chunk-ICLAW6SN.js → chunk-TWYWQFJR.js} +10 -10
  102. package/chunk-TY3TIUJK.js +89 -0
  103. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  104. package/{chunk-RG6JBBX5.js → chunk-U7XXEI5R.js} +166 -13
  105. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  106. package/chunk-UJXNKP5V.js +760 -0
  107. package/{chunk-UKZDAFYT.js → chunk-UM4PH574.js} +6 -10
  108. package/{chunk-GEPUP7OO.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-S2YPVYRY.js → chunk-UW4JVRYR.js} +67 -45
  110. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  111. package/{chunk-NA35QHCF.js → chunk-V7Y6KRAH.js} +1 -1
  112. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  113. package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
  114. package/chunk-VIWDGTDA.js +8 -0
  115. package/chunk-VJVNU77E.js +83 -0
  116. package/{chunk-VA2M2T36.js → chunk-VNR63IV3.js} +23 -28
  117. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  118. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  119. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  120. package/{chunk-ZDXFQMB4.js → chunk-WHZ67DFH.js} +47 -67
  121. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  122. package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
  123. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  124. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  125. package/{chunk-ETI2NYVF.js → chunk-YPOPJAKN.js} +4 -4
  126. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  127. package/chunk-YV25TM3R.js +780 -0
  128. package/chunk-ZRAU6T47.js +56 -0
  129. package/commandRegistry-MODC2W5M.js +833 -0
  130. package/{contentThunks-I3AWWOK4.js → contentThunks-636N2NA7.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-QNNIWYI3.js → createAgentAutomationAction-2ZGYUIT4.js} +38 -36
  133. package/createDialogAction-DOZD7XW7.js +69 -0
  134. package/{createPageAction-G2ASSMFZ.js → createPageAction-FJQVAHIK.js} +45 -42
  135. package/{chunk-Q6NAY3XN.js → cursorProvider-YGGNMVWX.js} +2496 -9897
  136. package/{dbSlice-XVWBAGYN.js → dbSlice-Q25STFGJ.js} +11 -10
  137. package/{deleteFile-YG6QMJLU.js → deleteFile-AJ2EZMHT.js} +7 -6
  138. package/{dialogCommands-5J56DFWN.js → dialogCommands-LF7PLYAD.js} +49 -45
  139. package/{dialogSlice-HQLYBDH7.js → dialogSlice-FOWUVVPW.js} +40 -33
  140. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  141. package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-NQR3S7A4.js} +48 -43
  142. package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-V3IAQ2HT.js} +49 -44
  143. package/{docReadCommands-HOSVSBDJ.js → docReadCommands-GDX4CLSU.js} +47 -42
  144. package/{docStore-5LMRNCZG.js → docStore-F645L3JQ.js} +16 -12
  145. package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-QMYXWQOU.js} +48 -43
  146. package/{fetchMessages-EIU7UFFK.js → fetchMessages-I5ICDDHM.js} +5 -5
  147. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  148. package/{handleSendMessageAction-DMWWDWN5.js → handleSendMessageAction-6DCDAY6A.js} +110 -86
  149. package/index.js +87 -884
  150. package/{lib-FRRS27KN.js → lib-PU2G2MSO.js} +523 -191
  151. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
  152. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  153. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  154. package/{machineCommands-T4T4AUNA.js → machineCommands-465OUHT4.js} +91 -81
  155. package/machineWsRunDispatch-M3FUGFP4.js +154 -0
  156. package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.js} +20 -18
  157. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  158. package/oauthTokenStore-ITEB663N.js +23 -0
  159. package/package.json +1 -1
  160. package/pdf-U6KSUEZZ.js +26435 -0
  161. package/processSpawn-SOAV3FEV.js +11 -0
  162. package/profileConfig-ZGOFORWV.js +43 -0
  163. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  164. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  165. package/{read-COE3ZYR6.js → read-SRQMNO26.js} +7 -6
  166. package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
  167. package/{readlineWorkspace-LN2D7OGW.js → readlineWorkspace-LFCVKGAB.js} +2704 -2060
  168. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  169. package/{runAgentClientLoop-I773V27D.js → runAgentClientLoop-KBRADH67.js} +75 -69
  170. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  171. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  172. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
  173. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
  174. package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.js} +226 -940
  175. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  176. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  177. package/{spaceCommands-NKJVJCQQ.js → spaceCommands-2P2X37MC.js} +51 -46
  178. package/{streamAgentChatTurn-PSF5RYKO.js → streamAgentChatTurn-CCOW4CUC.js} +199 -104
  179. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
  180. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  181. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  182. package/tools-QNXUF3LE.js +116 -0
  183. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
  184. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  185. package/{updateDialogTitleAction-QBT5WOLY.js → updateDialogTitleAction-ZLUQE6XC.js} +82 -44
  186. package/action-YVYQEAAV.js +0 -31
  187. package/agentListCommands-KMS675GZ.js +0 -406
  188. package/agentRecordCommands-A7AIQPNG.js +0 -128
  189. package/agentRunCommand-KO5UM7O6.js +0 -155
  190. package/browser-image-compression-MFDTD7K6.js +0 -1763
  191. package/chatQueueReduxAdapter-JS633LXU.js +0 -186
  192. package/chunk-M76ECQRD.js +0 -13658
  193. package/chunk-MEYIRKDN.js +0 -8967
  194. package/chunk-Q5FJJ6XI.js +0 -103
  195. package/chunk-S7Z2HMCN.js +0 -25
  196. package/chunk-Y5GCAMGP.js +0 -9
  197. package/chunk-YHYPCMKI.js +0 -19005
  198. package/chunk-YPREESF4.js +0 -225
  199. package/createDialogAction-STKILXXW.js +0 -65
  200. package/machineWsRunDispatch-F6XWVLKA.js +0 -144
  201. package/settingSlice-ZQZVUPKK.js +0 -204
  202. package/syncMapping-N6RGXGBW.js +0 -437
  203. package/tools-2ZTTVIGF.js +0 -110
  204. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  205. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  206. 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-2ZTTVIGF.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-CSSGXQJ3.js";
12
- import "./chunk-5UTFL4QJ.js";
13
- import "./chunk-NF64D32W.js";
14
- import "./chunk-3L2WKC3W.js";
15
- import "./chunk-3VNWWVKB.js";
16
- import "./chunk-RG6JBBX5.js";
17
- import "./chunk-KQHGZWSV.js";
18
- import "./chunk-J4MOO56S.js";
19
- import "./chunk-HJUYAD4A.js";
20
- import "./chunk-VLTIYV3X.js";
21
- import "./chunk-UKZDAFYT.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-WP7SWVOM.js";
28
- import "./chunk-VA2M2T36.js";
29
- import "./chunk-ZDXFQMB4.js";
30
- import "./chunk-ZJ7UHBJS.js";
31
- import "./chunk-YHYPCMKI.js";
32
- import "./chunk-MC4XLIJ7.js";
33
- import "./chunk-3BMYXEUW.js";
34
- import "./chunk-YYLHWIW6.js";
35
- import "./chunk-AGGIDPCZ.js";
36
- import "./chunk-7KBQIEEW.js";
37
- import "./chunk-TOP2VXOR.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-4OEFYTWL.js";
55
- import "./chunk-DNCEALKX.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-BP4XNZRM.js";
70
- import "./chunk-AFUORTY4.js";
71
- import "./chunk-Y5GCAMGP.js";
72
- import "./chunk-QDSINZM3.js";
73
- import "./chunk-KX6YBIHG.js";
74
- import "./chunk-V4MJDUSR.js";
75
- import "./chunk-UAD2WT54.js";
76
- import "./chunk-H62HCIUP.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
- };
@@ -2390,6 +2390,11 @@ var require_rambda = __commonJS({
2390
2390
  }
2391
2391
  });
2392
2392
 
2393
+ // packages/core/toTrimmedString.ts
2394
+ function toTrimmedString(value) {
2395
+ return typeof value === "string" ? value.trim() : value == null ? "" : String(value).trim();
2396
+ }
2397
+
2393
2398
  // packages/core/stringArray.ts
2394
2399
  function asNonEmptyStringArray(value) {
2395
2400
  if (!Array.isArray(value)) return [];
@@ -2401,11 +2406,6 @@ function asTrimmedNonEmptyStringArray(value) {
2401
2406
  return asNonEmptyStringArray(value).map((item) => item.trim());
2402
2407
  }
2403
2408
 
2404
- // packages/core/toTrimmedString.ts
2405
- function toTrimmedString(value) {
2406
- return typeof value === "string" ? value.trim() : value == null ? "" : String(value).trim();
2407
- }
2408
-
2409
2409
  // packages/database/utils/ulid.ts
2410
2410
  import { monotonicFactory } from "ulid";
2411
2411
  var prng = () => Math.random();
@@ -3177,10 +3177,10 @@ var sanitizeShareData = (data) => {
3177
3177
  };
3178
3178
 
3179
3179
  export {
3180
- asNonEmptyStringArray,
3181
- asTrimmedNonEmptyStringArray,
3182
3180
  ulid,
3183
3181
  toTrimmedString,
3182
+ asNonEmptyStringArray,
3183
+ asTrimmedNonEmptyStringArray,
3184
3184
  toNonEmptyString,
3185
3185
  extractAgentInfo,
3186
3186
  extractCoverImage,
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