mongo.do 0.1.0 → 0.1.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.
Files changed (706) hide show
  1. package/dist/cli/index.d.ts +1 -15
  2. package/dist/cli/index.js +4083 -196
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/index.d.ts +2740 -20
  5. package/dist/index.js +9375 -27
  6. package/dist/index.js.map +1 -1
  7. package/dist/worker-entrypoint-BEW23Gmp.d.ts +1331 -0
  8. package/dist/worker.d.ts +6 -5
  9. package/dist/worker.js +5477 -18
  10. package/dist/worker.js.map +1 -1
  11. package/package.json +3 -2
  12. package/dist/agentfs/adapters/anthropic.d.ts +0 -176
  13. package/dist/agentfs/adapters/anthropic.d.ts.map +0 -1
  14. package/dist/agentfs/adapters/anthropic.js +0 -629
  15. package/dist/agentfs/adapters/anthropic.js.map +0 -1
  16. package/dist/agentfs/adapters/index.d.ts +0 -21
  17. package/dist/agentfs/adapters/index.d.ts.map +0 -1
  18. package/dist/agentfs/adapters/index.js +0 -23
  19. package/dist/agentfs/adapters/index.js.map +0 -1
  20. package/dist/agentfs/adapters/vercel.d.ts +0 -260
  21. package/dist/agentfs/adapters/vercel.d.ts.map +0 -1
  22. package/dist/agentfs/adapters/vercel.js +0 -288
  23. package/dist/agentfs/adapters/vercel.js.map +0 -1
  24. package/dist/agentfs/glob.d.ts +0 -116
  25. package/dist/agentfs/glob.d.ts.map +0 -1
  26. package/dist/agentfs/glob.js +0 -270
  27. package/dist/agentfs/glob.js.map +0 -1
  28. package/dist/agentfs/grep.d.ts +0 -83
  29. package/dist/agentfs/grep.d.ts.map +0 -1
  30. package/dist/agentfs/grep.js +0 -193
  31. package/dist/agentfs/grep.js.map +0 -1
  32. package/dist/agentfs/index.d.ts +0 -22
  33. package/dist/agentfs/index.d.ts.map +0 -1
  34. package/dist/agentfs/index.js +0 -18
  35. package/dist/agentfs/index.js.map +0 -1
  36. package/dist/agentfs/kv-store.d.ts +0 -128
  37. package/dist/agentfs/kv-store.d.ts.map +0 -1
  38. package/dist/agentfs/kv-store.js +0 -227
  39. package/dist/agentfs/kv-store.js.map +0 -1
  40. package/dist/agentfs/mondo-agent.d.ts +0 -255
  41. package/dist/agentfs/mondo-agent.d.ts.map +0 -1
  42. package/dist/agentfs/mondo-agent.js +0 -879
  43. package/dist/agentfs/mondo-agent.js.map +0 -1
  44. package/dist/agentfs/toolcalls.d.ts +0 -130
  45. package/dist/agentfs/toolcalls.d.ts.map +0 -1
  46. package/dist/agentfs/toolcalls.js +0 -178
  47. package/dist/agentfs/toolcalls.js.map +0 -1
  48. package/dist/agentfs/types.d.ts +0 -171
  49. package/dist/agentfs/types.d.ts.map +0 -1
  50. package/dist/agentfs/types.js +0 -7
  51. package/dist/agentfs/types.js.map +0 -1
  52. package/dist/agentfs/vfs.d.ts +0 -249
  53. package/dist/agentfs/vfs.d.ts.map +0 -1
  54. package/dist/agentfs/vfs.js +0 -469
  55. package/dist/agentfs/vfs.js.map +0 -1
  56. package/dist/cli/index.d.ts.map +0 -1
  57. package/dist/cli/mcp.d.ts +0 -119
  58. package/dist/cli/mcp.d.ts.map +0 -1
  59. package/dist/cli/mcp.js +0 -418
  60. package/dist/cli/mcp.js.map +0 -1
  61. package/dist/cli/server.d.ts +0 -179
  62. package/dist/cli/server.d.ts.map +0 -1
  63. package/dist/cli/server.js +0 -441
  64. package/dist/cli/server.js.map +0 -1
  65. package/dist/client/Collection.d.ts +0 -199
  66. package/dist/client/Collection.d.ts.map +0 -1
  67. package/dist/client/Collection.js +0 -256
  68. package/dist/client/Collection.js.map +0 -1
  69. package/dist/client/Database.d.ts +0 -68
  70. package/dist/client/Database.d.ts.map +0 -1
  71. package/dist/client/Database.js +0 -105
  72. package/dist/client/Database.js.map +0 -1
  73. package/dist/client/MongoClient.d.ts +0 -165
  74. package/dist/client/MongoClient.d.ts.map +0 -1
  75. package/dist/client/MongoClient.js +0 -307
  76. package/dist/client/MongoClient.js.map +0 -1
  77. package/dist/client/aggregation-cursor.d.ts +0 -210
  78. package/dist/client/aggregation-cursor.d.ts.map +0 -1
  79. package/dist/client/aggregation-cursor.js +0 -509
  80. package/dist/client/aggregation-cursor.js.map +0 -1
  81. package/dist/client/bulk-write.d.ts +0 -216
  82. package/dist/client/bulk-write.d.ts.map +0 -1
  83. package/dist/client/bulk-write.js +0 -63
  84. package/dist/client/bulk-write.js.map +0 -1
  85. package/dist/client/change-stream.d.ts +0 -245
  86. package/dist/client/change-stream.d.ts.map +0 -1
  87. package/dist/client/change-stream.js +0 -429
  88. package/dist/client/change-stream.js.map +0 -1
  89. package/dist/client/cursor.d.ts +0 -85
  90. package/dist/client/cursor.d.ts.map +0 -1
  91. package/dist/client/cursor.js +0 -156
  92. package/dist/client/cursor.js.map +0 -1
  93. package/dist/client/http-cursor.d.ts +0 -233
  94. package/dist/client/http-cursor.d.ts.map +0 -1
  95. package/dist/client/http-cursor.js +0 -496
  96. package/dist/client/http-cursor.js.map +0 -1
  97. package/dist/client/index.d.ts +0 -18
  98. package/dist/client/index.d.ts.map +0 -1
  99. package/dist/client/index.js +0 -24
  100. package/dist/client/index.js.map +0 -1
  101. package/dist/client/mongo-client.d.ts +0 -60
  102. package/dist/client/mongo-client.d.ts.map +0 -1
  103. package/dist/client/mongo-client.js +0 -190
  104. package/dist/client/mongo-client.js.map +0 -1
  105. package/dist/client/mongo-collection.d.ts +0 -359
  106. package/dist/client/mongo-collection.d.ts.map +0 -1
  107. package/dist/client/mongo-collection.js +0 -1641
  108. package/dist/client/mongo-collection.js.map +0 -1
  109. package/dist/client/mongo-cursor.d.ts +0 -257
  110. package/dist/client/mongo-cursor.d.ts.map +0 -1
  111. package/dist/client/mongo-cursor.js +0 -621
  112. package/dist/client/mongo-cursor.js.map +0 -1
  113. package/dist/client/mongo-database.d.ts +0 -88
  114. package/dist/client/mongo-database.d.ts.map +0 -1
  115. package/dist/client/mongo-database.js +0 -139
  116. package/dist/client/mongo-database.js.map +0 -1
  117. package/dist/client/session.d.ts +0 -210
  118. package/dist/client/session.d.ts.map +0 -1
  119. package/dist/client/session.js +0 -326
  120. package/dist/client/session.js.map +0 -1
  121. package/dist/durable-object/index-manager.d.ts +0 -173
  122. package/dist/durable-object/index-manager.d.ts.map +0 -1
  123. package/dist/durable-object/index-manager.js +0 -764
  124. package/dist/durable-object/index-manager.js.map +0 -1
  125. package/dist/durable-object/index.d.ts +0 -12
  126. package/dist/durable-object/index.d.ts.map +0 -1
  127. package/dist/durable-object/index.js +0 -8
  128. package/dist/durable-object/index.js.map +0 -1
  129. package/dist/durable-object/mcp-handler.d.ts +0 -52
  130. package/dist/durable-object/mcp-handler.d.ts.map +0 -1
  131. package/dist/durable-object/mcp-handler.js +0 -186
  132. package/dist/durable-object/mcp-handler.js.map +0 -1
  133. package/dist/durable-object/migrations.d.ts +0 -40
  134. package/dist/durable-object/migrations.d.ts.map +0 -1
  135. package/dist/durable-object/migrations.js +0 -121
  136. package/dist/durable-object/migrations.js.map +0 -1
  137. package/dist/durable-object/mondo-database.d.ts +0 -148
  138. package/dist/durable-object/mondo-database.d.ts.map +0 -1
  139. package/dist/durable-object/mondo-database.js +0 -621
  140. package/dist/durable-object/mondo-database.js.map +0 -1
  141. package/dist/durable-object/schema.d.ts +0 -192
  142. package/dist/durable-object/schema.d.ts.map +0 -1
  143. package/dist/durable-object/schema.js +0 -186
  144. package/dist/durable-object/schema.js.map +0 -1
  145. package/dist/embedding/document-serializer.d.ts +0 -118
  146. package/dist/embedding/document-serializer.d.ts.map +0 -1
  147. package/dist/embedding/document-serializer.js +0 -339
  148. package/dist/embedding/document-serializer.js.map +0 -1
  149. package/dist/embedding/embedding-manager.d.ts +0 -136
  150. package/dist/embedding/embedding-manager.d.ts.map +0 -1
  151. package/dist/embedding/embedding-manager.js +0 -176
  152. package/dist/embedding/embedding-manager.js.map +0 -1
  153. package/dist/embedding/index.d.ts +0 -9
  154. package/dist/embedding/index.d.ts.map +0 -1
  155. package/dist/embedding/index.js +0 -9
  156. package/dist/embedding/index.js.map +0 -1
  157. package/dist/executor/aggregation-executor.d.ts +0 -93
  158. package/dist/executor/aggregation-executor.d.ts.map +0 -1
  159. package/dist/executor/aggregation-executor.js +0 -275
  160. package/dist/executor/aggregation-executor.js.map +0 -1
  161. package/dist/executor/function-executor.d.ts +0 -39
  162. package/dist/executor/function-executor.d.ts.map +0 -1
  163. package/dist/executor/function-executor.js +0 -168
  164. package/dist/executor/function-executor.js.map +0 -1
  165. package/dist/executor/index.d.ts +0 -4
  166. package/dist/executor/index.d.ts.map +0 -1
  167. package/dist/executor/index.js +0 -4
  168. package/dist/executor/index.js.map +0 -1
  169. package/dist/executor/vector-search-executor.d.ts +0 -71
  170. package/dist/executor/vector-search-executor.d.ts.map +0 -1
  171. package/dist/executor/vector-search-executor.js +0 -113
  172. package/dist/executor/vector-search-executor.js.map +0 -1
  173. package/dist/index.d.ts.map +0 -1
  174. package/dist/mcp/adapters/anthropic-adapter.d.ts +0 -256
  175. package/dist/mcp/adapters/anthropic-adapter.d.ts.map +0 -1
  176. package/dist/mcp/adapters/anthropic-adapter.js +0 -409
  177. package/dist/mcp/adapters/anthropic-adapter.js.map +0 -1
  178. package/dist/mcp/adapters/base-adapter.d.ts +0 -164
  179. package/dist/mcp/adapters/base-adapter.d.ts.map +0 -1
  180. package/dist/mcp/adapters/base-adapter.js +0 -277
  181. package/dist/mcp/adapters/base-adapter.js.map +0 -1
  182. package/dist/mcp/adapters/errors.d.ts +0 -173
  183. package/dist/mcp/adapters/errors.d.ts.map +0 -1
  184. package/dist/mcp/adapters/errors.js +0 -305
  185. package/dist/mcp/adapters/errors.js.map +0 -1
  186. package/dist/mcp/adapters/index.d.ts +0 -65
  187. package/dist/mcp/adapters/index.d.ts.map +0 -1
  188. package/dist/mcp/adapters/index.js +0 -92
  189. package/dist/mcp/adapters/index.js.map +0 -1
  190. package/dist/mcp/adapters/streaming.d.ts +0 -200
  191. package/dist/mcp/adapters/streaming.d.ts.map +0 -1
  192. package/dist/mcp/adapters/streaming.js +0 -381
  193. package/dist/mcp/adapters/streaming.js.map +0 -1
  194. package/dist/mcp/adapters/vercel-adapter.d.ts +0 -321
  195. package/dist/mcp/adapters/vercel-adapter.d.ts.map +0 -1
  196. package/dist/mcp/adapters/vercel-adapter.js +0 -487
  197. package/dist/mcp/adapters/vercel-adapter.js.map +0 -1
  198. package/dist/mcp/agent.d.ts +0 -192
  199. package/dist/mcp/agent.d.ts.map +0 -1
  200. package/dist/mcp/agent.js +0 -338
  201. package/dist/mcp/agent.js.map +0 -1
  202. package/dist/mcp/cli.d.ts +0 -71
  203. package/dist/mcp/cli.d.ts.map +0 -1
  204. package/dist/mcp/cli.js +0 -218
  205. package/dist/mcp/cli.js.map +0 -1
  206. package/dist/mcp/index.d.ts +0 -15
  207. package/dist/mcp/index.d.ts.map +0 -1
  208. package/dist/mcp/index.js +0 -20
  209. package/dist/mcp/index.js.map +0 -1
  210. package/dist/mcp/sandbox/database-proxy.d.ts +0 -118
  211. package/dist/mcp/sandbox/database-proxy.d.ts.map +0 -1
  212. package/dist/mcp/sandbox/database-proxy.js +0 -154
  213. package/dist/mcp/sandbox/database-proxy.js.map +0 -1
  214. package/dist/mcp/sandbox/index.d.ts +0 -8
  215. package/dist/mcp/sandbox/index.d.ts.map +0 -1
  216. package/dist/mcp/sandbox/index.js +0 -7
  217. package/dist/mcp/sandbox/index.js.map +0 -1
  218. package/dist/mcp/sandbox/miniflare-evaluator.d.ts +0 -72
  219. package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +0 -1
  220. package/dist/mcp/sandbox/miniflare-evaluator.js +0 -379
  221. package/dist/mcp/sandbox/miniflare-evaluator.js.map +0 -1
  222. package/dist/mcp/sandbox/template.d.ts +0 -48
  223. package/dist/mcp/sandbox/template.d.ts.map +0 -1
  224. package/dist/mcp/sandbox/template.js +0 -147
  225. package/dist/mcp/sandbox/template.js.map +0 -1
  226. package/dist/mcp/sandbox/worker-evaluator.d.ts +0 -160
  227. package/dist/mcp/sandbox/worker-evaluator.d.ts.map +0 -1
  228. package/dist/mcp/sandbox/worker-evaluator.js +0 -217
  229. package/dist/mcp/sandbox/worker-evaluator.js.map +0 -1
  230. package/dist/mcp/server.d.ts +0 -75
  231. package/dist/mcp/server.d.ts.map +0 -1
  232. package/dist/mcp/server.js +0 -278
  233. package/dist/mcp/server.js.map +0 -1
  234. package/dist/mcp/tool-call-auditor.d.ts +0 -188
  235. package/dist/mcp/tool-call-auditor.d.ts.map +0 -1
  236. package/dist/mcp/tool-call-auditor.js +0 -198
  237. package/dist/mcp/tool-call-auditor.js.map +0 -1
  238. package/dist/mcp/tools/do.d.ts +0 -51
  239. package/dist/mcp/tools/do.d.ts.map +0 -1
  240. package/dist/mcp/tools/do.js +0 -113
  241. package/dist/mcp/tools/do.js.map +0 -1
  242. package/dist/mcp/tools/fetch.d.ts +0 -43
  243. package/dist/mcp/tools/fetch.d.ts.map +0 -1
  244. package/dist/mcp/tools/fetch.js +0 -127
  245. package/dist/mcp/tools/fetch.js.map +0 -1
  246. package/dist/mcp/tools/index.d.ts +0 -9
  247. package/dist/mcp/tools/index.d.ts.map +0 -1
  248. package/dist/mcp/tools/index.js +0 -9
  249. package/dist/mcp/tools/index.js.map +0 -1
  250. package/dist/mcp/tools/search.d.ts +0 -60
  251. package/dist/mcp/tools/search.d.ts.map +0 -1
  252. package/dist/mcp/tools/search.js +0 -278
  253. package/dist/mcp/tools/search.js.map +0 -1
  254. package/dist/mcp/transport/http.d.ts +0 -144
  255. package/dist/mcp/transport/http.d.ts.map +0 -1
  256. package/dist/mcp/transport/http.js +0 -545
  257. package/dist/mcp/transport/http.js.map +0 -1
  258. package/dist/mcp/transport/index.d.ts +0 -10
  259. package/dist/mcp/transport/index.d.ts.map +0 -1
  260. package/dist/mcp/transport/index.js +0 -12
  261. package/dist/mcp/transport/index.js.map +0 -1
  262. package/dist/mcp/transport/stdio.d.ts +0 -132
  263. package/dist/mcp/transport/stdio.d.ts.map +0 -1
  264. package/dist/mcp/transport/stdio.js +0 -466
  265. package/dist/mcp/transport/stdio.js.map +0 -1
  266. package/dist/mcp/types.d.ts +0 -476
  267. package/dist/mcp/types.d.ts.map +0 -1
  268. package/dist/mcp/types.js +0 -178
  269. package/dist/mcp/types.js.map +0 -1
  270. package/dist/olap/cdc/cdc-buffer.d.ts +0 -92
  271. package/dist/olap/cdc/cdc-buffer.d.ts.map +0 -1
  272. package/dist/olap/cdc/cdc-buffer.js +0 -146
  273. package/dist/olap/cdc/cdc-buffer.js.map +0 -1
  274. package/dist/olap/cdc/cdc-emitter.d.ts +0 -118
  275. package/dist/olap/cdc/cdc-emitter.d.ts.map +0 -1
  276. package/dist/olap/cdc/cdc-emitter.js +0 -217
  277. package/dist/olap/cdc/cdc-emitter.js.map +0 -1
  278. package/dist/olap/cdc/cdc-schema.d.ts +0 -119
  279. package/dist/olap/cdc/cdc-schema.d.ts.map +0 -1
  280. package/dist/olap/cdc/cdc-schema.js +0 -253
  281. package/dist/olap/cdc/cdc-schema.js.map +0 -1
  282. package/dist/olap/cdc/index.d.ts +0 -10
  283. package/dist/olap/cdc/index.d.ts.map +0 -1
  284. package/dist/olap/cdc/index.js +0 -10
  285. package/dist/olap/cdc/index.js.map +0 -1
  286. package/dist/olap/clickhouse/iceberg.d.ts +0 -164
  287. package/dist/olap/clickhouse/iceberg.d.ts.map +0 -1
  288. package/dist/olap/clickhouse/iceberg.js +0 -138
  289. package/dist/olap/clickhouse/iceberg.js.map +0 -1
  290. package/dist/olap/clickhouse/index.d.ts +0 -14
  291. package/dist/olap/clickhouse/index.d.ts.map +0 -1
  292. package/dist/olap/clickhouse/index.js +0 -14
  293. package/dist/olap/clickhouse/index.js.map +0 -1
  294. package/dist/olap/clickhouse/mapper.d.ts +0 -170
  295. package/dist/olap/clickhouse/mapper.d.ts.map +0 -1
  296. package/dist/olap/clickhouse/mapper.js +0 -654
  297. package/dist/olap/clickhouse/mapper.js.map +0 -1
  298. package/dist/olap/clickhouse/olap-backend.d.ts +0 -181
  299. package/dist/olap/clickhouse/olap-backend.d.ts.map +0 -1
  300. package/dist/olap/clickhouse/olap-backend.js +0 -1083
  301. package/dist/olap/clickhouse/olap-backend.js.map +0 -1
  302. package/dist/olap/clickhouse/query-executor.d.ts +0 -163
  303. package/dist/olap/clickhouse/query-executor.d.ts.map +0 -1
  304. package/dist/olap/clickhouse/query-executor.js +0 -560
  305. package/dist/olap/clickhouse/query-executor.js.map +0 -1
  306. package/dist/olap/clickhouse/query.d.ts +0 -134
  307. package/dist/olap/clickhouse/query.d.ts.map +0 -1
  308. package/dist/olap/clickhouse/query.js +0 -512
  309. package/dist/olap/clickhouse/query.js.map +0 -1
  310. package/dist/olap/stage/index.d.ts +0 -6
  311. package/dist/olap/stage/index.d.ts.map +0 -1
  312. package/dist/olap/stage/index.js +0 -6
  313. package/dist/olap/stage/index.js.map +0 -1
  314. package/dist/olap/stage/parser.d.ts +0 -68
  315. package/dist/olap/stage/parser.d.ts.map +0 -1
  316. package/dist/olap/stage/parser.js +0 -293
  317. package/dist/olap/stage/parser.js.map +0 -1
  318. package/dist/olap/stage/router.d.ts +0 -94
  319. package/dist/olap/stage/router.d.ts.map +0 -1
  320. package/dist/olap/stage/router.js +0 -390
  321. package/dist/olap/stage/router.js.map +0 -1
  322. package/dist/rpc/endpoint.d.ts +0 -52
  323. package/dist/rpc/endpoint.d.ts.map +0 -1
  324. package/dist/rpc/endpoint.js +0 -734
  325. package/dist/rpc/endpoint.js.map +0 -1
  326. package/dist/rpc/index.d.ts +0 -34
  327. package/dist/rpc/index.d.ts.map +0 -1
  328. package/dist/rpc/index.js +0 -45
  329. package/dist/rpc/index.js.map +0 -1
  330. package/dist/rpc/rpc-client.d.ts +0 -275
  331. package/dist/rpc/rpc-client.d.ts.map +0 -1
  332. package/dist/rpc/rpc-client.js +0 -735
  333. package/dist/rpc/rpc-client.js.map +0 -1
  334. package/dist/rpc/rpc-target.d.ts +0 -220
  335. package/dist/rpc/rpc-target.d.ts.map +0 -1
  336. package/dist/rpc/rpc-target.js +0 -500
  337. package/dist/rpc/rpc-target.js.map +0 -1
  338. package/dist/rpc/worker-entrypoint.d.ts +0 -159
  339. package/dist/rpc/worker-entrypoint.d.ts.map +0 -1
  340. package/dist/rpc/worker-entrypoint.js +0 -212
  341. package/dist/rpc/worker-entrypoint.js.map +0 -1
  342. package/dist/server.d.ts +0 -18
  343. package/dist/server.d.ts.map +0 -1
  344. package/dist/server.js +0 -129
  345. package/dist/server.js.map +0 -1
  346. package/dist/studio/components/browser/CollectionItem.d.ts +0 -26
  347. package/dist/studio/components/browser/CollectionItem.d.ts.map +0 -1
  348. package/dist/studio/components/browser/CollectionItem.js +0 -143
  349. package/dist/studio/components/browser/CollectionItem.js.map +0 -1
  350. package/dist/studio/components/browser/CollectionTree.d.ts +0 -45
  351. package/dist/studio/components/browser/CollectionTree.d.ts.map +0 -1
  352. package/dist/studio/components/browser/CollectionTree.js +0 -207
  353. package/dist/studio/components/browser/CollectionTree.js.map +0 -1
  354. package/dist/studio/components/browser/ConnectedDatabaseBrowser.d.ts +0 -51
  355. package/dist/studio/components/browser/ConnectedDatabaseBrowser.d.ts.map +0 -1
  356. package/dist/studio/components/browser/ConnectedDatabaseBrowser.js +0 -185
  357. package/dist/studio/components/browser/ConnectedDatabaseBrowser.js.map +0 -1
  358. package/dist/studio/components/browser/DatabaseBrowser.d.ts +0 -46
  359. package/dist/studio/components/browser/DatabaseBrowser.d.ts.map +0 -1
  360. package/dist/studio/components/browser/DatabaseBrowser.js +0 -304
  361. package/dist/studio/components/browser/DatabaseBrowser.js.map +0 -1
  362. package/dist/studio/components/browser/__tests__/CollectionItem.test.d.ts +0 -5
  363. package/dist/studio/components/browser/__tests__/CollectionItem.test.d.ts.map +0 -1
  364. package/dist/studio/components/browser/__tests__/CollectionItem.test.js +0 -169
  365. package/dist/studio/components/browser/__tests__/CollectionItem.test.js.map +0 -1
  366. package/dist/studio/components/browser/__tests__/CollectionTree.test.d.ts +0 -5
  367. package/dist/studio/components/browser/__tests__/CollectionTree.test.d.ts.map +0 -1
  368. package/dist/studio/components/browser/__tests__/CollectionTree.test.js +0 -203
  369. package/dist/studio/components/browser/__tests__/CollectionTree.test.js.map +0 -1
  370. package/dist/studio/components/browser/__tests__/DatabaseBrowser.e2e.test.d.ts +0 -8
  371. package/dist/studio/components/browser/__tests__/DatabaseBrowser.e2e.test.d.ts.map +0 -1
  372. package/dist/studio/components/browser/__tests__/DatabaseBrowser.e2e.test.js +0 -522
  373. package/dist/studio/components/browser/__tests__/DatabaseBrowser.e2e.test.js.map +0 -1
  374. package/dist/studio/components/browser/__tests__/DatabaseBrowser.test.d.ts +0 -5
  375. package/dist/studio/components/browser/__tests__/DatabaseBrowser.test.d.ts.map +0 -1
  376. package/dist/studio/components/browser/__tests__/DatabaseBrowser.test.js +0 -518
  377. package/dist/studio/components/browser/__tests__/DatabaseBrowser.test.js.map +0 -1
  378. package/dist/studio/components/browser/__tests__/setup.d.ts +0 -5
  379. package/dist/studio/components/browser/__tests__/setup.d.ts.map +0 -1
  380. package/dist/studio/components/browser/__tests__/setup.js +0 -22
  381. package/dist/studio/components/browser/__tests__/setup.js.map +0 -1
  382. package/dist/studio/components/browser/index.d.ts +0 -15
  383. package/dist/studio/components/browser/index.d.ts.map +0 -1
  384. package/dist/studio/components/browser/index.js +0 -10
  385. package/dist/studio/components/browser/index.js.map +0 -1
  386. package/dist/studio/components/browser/types.d.ts +0 -33
  387. package/dist/studio/components/browser/types.d.ts.map +0 -1
  388. package/dist/studio/components/browser/types.js +0 -5
  389. package/dist/studio/components/browser/types.js.map +0 -1
  390. package/dist/studio/components/connection/ConnectionForm.d.ts +0 -59
  391. package/dist/studio/components/connection/ConnectionForm.d.ts.map +0 -1
  392. package/dist/studio/components/connection/ConnectionForm.js +0 -274
  393. package/dist/studio/components/connection/ConnectionForm.js.map +0 -1
  394. package/dist/studio/components/connection/ConnectionList.d.ts +0 -59
  395. package/dist/studio/components/connection/ConnectionList.d.ts.map +0 -1
  396. package/dist/studio/components/connection/ConnectionList.js +0 -286
  397. package/dist/studio/components/connection/ConnectionList.js.map +0 -1
  398. package/dist/studio/components/connection/ConnectionPanel.d.ts +0 -132
  399. package/dist/studio/components/connection/ConnectionPanel.d.ts.map +0 -1
  400. package/dist/studio/components/connection/ConnectionPanel.js +0 -293
  401. package/dist/studio/components/connection/ConnectionPanel.js.map +0 -1
  402. package/dist/studio/components/connection/__tests__/ConnectionPanel.test.d.ts +0 -8
  403. package/dist/studio/components/connection/__tests__/ConnectionPanel.test.d.ts.map +0 -1
  404. package/dist/studio/components/connection/__tests__/ConnectionPanel.test.js +0 -632
  405. package/dist/studio/components/connection/__tests__/ConnectionPanel.test.js.map +0 -1
  406. package/dist/studio/components/connection/__tests__/setup.d.ts +0 -5
  407. package/dist/studio/components/connection/__tests__/setup.d.ts.map +0 -1
  408. package/dist/studio/components/connection/__tests__/setup.js +0 -11
  409. package/dist/studio/components/connection/__tests__/setup.js.map +0 -1
  410. package/dist/studio/components/connection/index.d.ts +0 -10
  411. package/dist/studio/components/connection/index.d.ts.map +0 -1
  412. package/dist/studio/components/connection/index.js +0 -7
  413. package/dist/studio/components/connection/index.js.map +0 -1
  414. package/dist/studio/components/crud/DeleteDocumentDialog.d.ts +0 -91
  415. package/dist/studio/components/crud/DeleteDocumentDialog.d.ts.map +0 -1
  416. package/dist/studio/components/crud/DeleteDocumentDialog.js +0 -273
  417. package/dist/studio/components/crud/DeleteDocumentDialog.js.map +0 -1
  418. package/dist/studio/components/crud/DocumentEditor.d.ts +0 -32
  419. package/dist/studio/components/crud/DocumentEditor.d.ts.map +0 -1
  420. package/dist/studio/components/crud/DocumentEditor.js +0 -546
  421. package/dist/studio/components/crud/DocumentEditor.js.map +0 -1
  422. package/dist/studio/components/crud/InsertDocumentDialog.d.ts +0 -78
  423. package/dist/studio/components/crud/InsertDocumentDialog.d.ts.map +0 -1
  424. package/dist/studio/components/crud/InsertDocumentDialog.js +0 -323
  425. package/dist/studio/components/crud/InsertDocumentDialog.js.map +0 -1
  426. package/dist/studio/components/crud/__tests__/DeleteDocumentDialog.test.d.ts +0 -5
  427. package/dist/studio/components/crud/__tests__/DeleteDocumentDialog.test.d.ts.map +0 -1
  428. package/dist/studio/components/crud/__tests__/DeleteDocumentDialog.test.js +0 -298
  429. package/dist/studio/components/crud/__tests__/DeleteDocumentDialog.test.js.map +0 -1
  430. package/dist/studio/components/crud/__tests__/DocumentEditor.test.d.ts +0 -8
  431. package/dist/studio/components/crud/__tests__/DocumentEditor.test.d.ts.map +0 -1
  432. package/dist/studio/components/crud/__tests__/DocumentEditor.test.js +0 -368
  433. package/dist/studio/components/crud/__tests__/DocumentEditor.test.js.map +0 -1
  434. package/dist/studio/components/crud/__tests__/InsertDocumentDialog.test.d.ts +0 -2
  435. package/dist/studio/components/crud/__tests__/InsertDocumentDialog.test.d.ts.map +0 -1
  436. package/dist/studio/components/crud/__tests__/InsertDocumentDialog.test.js +0 -352
  437. package/dist/studio/components/crud/__tests__/InsertDocumentDialog.test.js.map +0 -1
  438. package/dist/studio/components/crud/__tests__/setup.d.ts +0 -5
  439. package/dist/studio/components/crud/__tests__/setup.d.ts.map +0 -1
  440. package/dist/studio/components/crud/__tests__/setup.js +0 -22
  441. package/dist/studio/components/crud/__tests__/setup.js.map +0 -1
  442. package/dist/studio/components/crud/index.d.ts +0 -12
  443. package/dist/studio/components/crud/index.d.ts.map +0 -1
  444. package/dist/studio/components/crud/index.js +0 -11
  445. package/dist/studio/components/crud/index.js.map +0 -1
  446. package/dist/studio/hooks/useConnection.d.ts +0 -127
  447. package/dist/studio/hooks/useConnection.d.ts.map +0 -1
  448. package/dist/studio/hooks/useConnection.js +0 -414
  449. package/dist/studio/hooks/useConnection.js.map +0 -1
  450. package/dist/studio/hooks/useDatabaseBrowser.d.ts +0 -107
  451. package/dist/studio/hooks/useDatabaseBrowser.d.ts.map +0 -1
  452. package/dist/studio/hooks/useDatabaseBrowser.js +0 -294
  453. package/dist/studio/hooks/useDatabaseBrowser.js.map +0 -1
  454. package/dist/studio/index.d.ts +0 -16
  455. package/dist/studio/index.d.ts.map +0 -1
  456. package/dist/studio/index.js +0 -14
  457. package/dist/studio/index.js.map +0 -1
  458. package/dist/studio/types/connection.d.ts +0 -266
  459. package/dist/studio/types/connection.d.ts.map +0 -1
  460. package/dist/studio/types/connection.js +0 -159
  461. package/dist/studio/types/connection.js.map +0 -1
  462. package/dist/studio/vitest.config.d.ts +0 -3
  463. package/dist/studio/vitest.config.d.ts.map +0 -1
  464. package/dist/studio/vitest.config.js +0 -33
  465. package/dist/studio/vitest.config.js.map +0 -1
  466. package/dist/translator/aggregation-translator.d.ts +0 -51
  467. package/dist/translator/aggregation-translator.d.ts.map +0 -1
  468. package/dist/translator/aggregation-translator.js +0 -324
  469. package/dist/translator/aggregation-translator.js.map +0 -1
  470. package/dist/translator/dialect.d.ts +0 -131
  471. package/dist/translator/dialect.d.ts.map +0 -1
  472. package/dist/translator/dialect.js +0 -276
  473. package/dist/translator/dialect.js.map +0 -1
  474. package/dist/translator/geo-translator.d.ts +0 -91
  475. package/dist/translator/geo-translator.d.ts.map +0 -1
  476. package/dist/translator/geo-translator.js +0 -587
  477. package/dist/translator/geo-translator.js.map +0 -1
  478. package/dist/translator/hybrid-translator.d.ts +0 -70
  479. package/dist/translator/hybrid-translator.d.ts.map +0 -1
  480. package/dist/translator/hybrid-translator.js +0 -193
  481. package/dist/translator/hybrid-translator.js.map +0 -1
  482. package/dist/translator/index.d.ts +0 -13
  483. package/dist/translator/index.d.ts.map +0 -1
  484. package/dist/translator/index.js +0 -11
  485. package/dist/translator/index.js.map +0 -1
  486. package/dist/translator/query-translator.d.ts +0 -211
  487. package/dist/translator/query-translator.d.ts.map +0 -1
  488. package/dist/translator/query-translator.js +0 -1276
  489. package/dist/translator/query-translator.js.map +0 -1
  490. package/dist/translator/search-highlight.d.ts +0 -83
  491. package/dist/translator/search-highlight.d.ts.map +0 -1
  492. package/dist/translator/search-highlight.js +0 -83
  493. package/dist/translator/search-highlight.js.map +0 -1
  494. package/dist/translator/search-translator.d.ts +0 -155
  495. package/dist/translator/search-translator.d.ts.map +0 -1
  496. package/dist/translator/search-translator.js +0 -241
  497. package/dist/translator/search-translator.js.map +0 -1
  498. package/dist/translator/stages/add-fields-stage.d.ts +0 -7
  499. package/dist/translator/stages/add-fields-stage.d.ts.map +0 -1
  500. package/dist/translator/stages/add-fields-stage.js +0 -72
  501. package/dist/translator/stages/add-fields-stage.js.map +0 -1
  502. package/dist/translator/stages/bucket-stage.d.ts +0 -7
  503. package/dist/translator/stages/bucket-stage.d.ts.map +0 -1
  504. package/dist/translator/stages/bucket-stage.js +0 -87
  505. package/dist/translator/stages/bucket-stage.js.map +0 -1
  506. package/dist/translator/stages/count-stage.d.ts +0 -7
  507. package/dist/translator/stages/count-stage.d.ts.map +0 -1
  508. package/dist/translator/stages/count-stage.js +0 -12
  509. package/dist/translator/stages/count-stage.js.map +0 -1
  510. package/dist/translator/stages/expression-translator.d.ts +0 -68
  511. package/dist/translator/stages/expression-translator.d.ts.map +0 -1
  512. package/dist/translator/stages/expression-translator.js +0 -467
  513. package/dist/translator/stages/expression-translator.js.map +0 -1
  514. package/dist/translator/stages/facet-stage.d.ts +0 -13
  515. package/dist/translator/stages/facet-stage.d.ts.map +0 -1
  516. package/dist/translator/stages/facet-stage.js +0 -26
  517. package/dist/translator/stages/facet-stage.js.map +0 -1
  518. package/dist/translator/stages/fusion-stages.d.ts +0 -118
  519. package/dist/translator/stages/fusion-stages.d.ts.map +0 -1
  520. package/dist/translator/stages/fusion-stages.js +0 -201
  521. package/dist/translator/stages/fusion-stages.js.map +0 -1
  522. package/dist/translator/stages/group-stage.d.ts +0 -8
  523. package/dist/translator/stages/group-stage.d.ts.map +0 -1
  524. package/dist/translator/stages/group-stage.js +0 -123
  525. package/dist/translator/stages/group-stage.js.map +0 -1
  526. package/dist/translator/stages/index.d.ts +0 -24
  527. package/dist/translator/stages/index.d.ts.map +0 -1
  528. package/dist/translator/stages/index.js +0 -24
  529. package/dist/translator/stages/index.js.map +0 -1
  530. package/dist/translator/stages/join-optimizer.d.ts +0 -37
  531. package/dist/translator/stages/join-optimizer.d.ts.map +0 -1
  532. package/dist/translator/stages/join-optimizer.js +0 -93
  533. package/dist/translator/stages/join-optimizer.js.map +0 -1
  534. package/dist/translator/stages/limit-stage.d.ts +0 -7
  535. package/dist/translator/stages/limit-stage.d.ts.map +0 -1
  536. package/dist/translator/stages/limit-stage.js +0 -11
  537. package/dist/translator/stages/limit-stage.js.map +0 -1
  538. package/dist/translator/stages/lookup-stage.d.ts +0 -7
  539. package/dist/translator/stages/lookup-stage.d.ts.map +0 -1
  540. package/dist/translator/stages/lookup-stage.js +0 -73
  541. package/dist/translator/stages/lookup-stage.js.map +0 -1
  542. package/dist/translator/stages/match-stage.d.ts +0 -7
  543. package/dist/translator/stages/match-stage.d.ts.map +0 -1
  544. package/dist/translator/stages/match-stage.js +0 -14
  545. package/dist/translator/stages/match-stage.js.map +0 -1
  546. package/dist/translator/stages/optimizer.d.ts +0 -15
  547. package/dist/translator/stages/optimizer.d.ts.map +0 -1
  548. package/dist/translator/stages/optimizer.js +0 -249
  549. package/dist/translator/stages/optimizer.js.map +0 -1
  550. package/dist/translator/stages/parallel-facet.d.ts +0 -47
  551. package/dist/translator/stages/parallel-facet.d.ts.map +0 -1
  552. package/dist/translator/stages/parallel-facet.js +0 -57
  553. package/dist/translator/stages/parallel-facet.js.map +0 -1
  554. package/dist/translator/stages/project-stage.d.ts +0 -8
  555. package/dist/translator/stages/project-stage.d.ts.map +0 -1
  556. package/dist/translator/stages/project-stage.js +0 -145
  557. package/dist/translator/stages/project-stage.js.map +0 -1
  558. package/dist/translator/stages/search-stage.d.ts +0 -60
  559. package/dist/translator/stages/search-stage.d.ts.map +0 -1
  560. package/dist/translator/stages/search-stage.js +0 -89
  561. package/dist/translator/stages/search-stage.js.map +0 -1
  562. package/dist/translator/stages/skip-stage.d.ts +0 -7
  563. package/dist/translator/stages/skip-stage.d.ts.map +0 -1
  564. package/dist/translator/stages/skip-stage.js +0 -11
  565. package/dist/translator/stages/skip-stage.js.map +0 -1
  566. package/dist/translator/stages/sort-stage.d.ts +0 -7
  567. package/dist/translator/stages/sort-stage.d.ts.map +0 -1
  568. package/dist/translator/stages/sort-stage.js +0 -21
  569. package/dist/translator/stages/sort-stage.js.map +0 -1
  570. package/dist/translator/stages/types.d.ts +0 -136
  571. package/dist/translator/stages/types.d.ts.map +0 -1
  572. package/dist/translator/stages/types.js +0 -5
  573. package/dist/translator/stages/types.js.map +0 -1
  574. package/dist/translator/stages/unwind-stage.d.ts +0 -7
  575. package/dist/translator/stages/unwind-stage.d.ts.map +0 -1
  576. package/dist/translator/stages/unwind-stage.js +0 -61
  577. package/dist/translator/stages/unwind-stage.js.map +0 -1
  578. package/dist/translator/stages/vector-search-stage.d.ts +0 -53
  579. package/dist/translator/stages/vector-search-stage.d.ts.map +0 -1
  580. package/dist/translator/stages/vector-search-stage.js +0 -62
  581. package/dist/translator/stages/vector-search-stage.js.map +0 -1
  582. package/dist/translator/update-translator.d.ts +0 -148
  583. package/dist/translator/update-translator.d.ts.map +0 -1
  584. package/dist/translator/update-translator.js +0 -819
  585. package/dist/translator/update-translator.js.map +0 -1
  586. package/dist/translator/vector-translator.d.ts +0 -89
  587. package/dist/translator/vector-translator.d.ts.map +0 -1
  588. package/dist/translator/vector-translator.js +0 -106
  589. package/dist/translator/vector-translator.js.map +0 -1
  590. package/dist/types/env.d.ts +0 -31
  591. package/dist/types/env.d.ts.map +0 -1
  592. package/dist/types/env.js +0 -5
  593. package/dist/types/env.js.map +0 -1
  594. package/dist/types/function.d.ts +0 -65
  595. package/dist/types/function.d.ts.map +0 -1
  596. package/dist/types/function.js +0 -5
  597. package/dist/types/function.js.map +0 -1
  598. package/dist/types/index.d.ts +0 -137
  599. package/dist/types/index.d.ts.map +0 -1
  600. package/dist/types/index.js +0 -13
  601. package/dist/types/index.js.map +0 -1
  602. package/dist/types/mongodb.d.ts +0 -258
  603. package/dist/types/mongodb.d.ts.map +0 -1
  604. package/dist/types/mongodb.js +0 -5
  605. package/dist/types/mongodb.js.map +0 -1
  606. package/dist/types/objectid.d.ts +0 -130
  607. package/dist/types/objectid.d.ts.map +0 -1
  608. package/dist/types/objectid.js +0 -314
  609. package/dist/types/objectid.js.map +0 -1
  610. package/dist/types/rpc.d.ts +0 -313
  611. package/dist/types/rpc.d.ts.map +0 -1
  612. package/dist/types/rpc.js +0 -136
  613. package/dist/types/rpc.js.map +0 -1
  614. package/dist/types/vectorize.d.ts +0 -136
  615. package/dist/types/vectorize.d.ts.map +0 -1
  616. package/dist/types/vectorize.js +0 -8
  617. package/dist/types/vectorize.js.map +0 -1
  618. package/dist/utils/sql-safety.d.ts +0 -64
  619. package/dist/utils/sql-safety.d.ts.map +0 -1
  620. package/dist/utils/sql-safety.js +0 -112
  621. package/dist/utils/sql-safety.js.map +0 -1
  622. package/dist/validation/document-validator.d.ts +0 -195
  623. package/dist/validation/document-validator.d.ts.map +0 -1
  624. package/dist/validation/document-validator.js +0 -529
  625. package/dist/validation/document-validator.js.map +0 -1
  626. package/dist/vectorize/document-serializer.d.ts +0 -119
  627. package/dist/vectorize/document-serializer.d.ts.map +0 -1
  628. package/dist/vectorize/document-serializer.js +0 -320
  629. package/dist/vectorize/document-serializer.js.map +0 -1
  630. package/dist/wire/auth/index.d.ts +0 -5
  631. package/dist/wire/auth/index.d.ts.map +0 -1
  632. package/dist/wire/auth/index.js +0 -5
  633. package/dist/wire/auth/index.js.map +0 -1
  634. package/dist/wire/auth/scram.d.ts +0 -160
  635. package/dist/wire/auth/scram.d.ts.map +0 -1
  636. package/dist/wire/auth/scram.js +0 -425
  637. package/dist/wire/auth/scram.js.map +0 -1
  638. package/dist/wire/backend/interface.d.ts +0 -168
  639. package/dist/wire/backend/interface.d.ts.map +0 -1
  640. package/dist/wire/backend/interface.js +0 -10
  641. package/dist/wire/backend/interface.js.map +0 -1
  642. package/dist/wire/backend/local-sqlite.d.ts +0 -89
  643. package/dist/wire/backend/local-sqlite.d.ts.map +0 -1
  644. package/dist/wire/backend/local-sqlite.js +0 -1002
  645. package/dist/wire/backend/local-sqlite.js.map +0 -1
  646. package/dist/wire/backend/query-router.d.ts +0 -197
  647. package/dist/wire/backend/query-router.d.ts.map +0 -1
  648. package/dist/wire/backend/query-router.js +0 -590
  649. package/dist/wire/backend/query-router.js.map +0 -1
  650. package/dist/wire/backend/validation.d.ts +0 -26
  651. package/dist/wire/backend/validation.d.ts.map +0 -1
  652. package/dist/wire/backend/validation.js +0 -79
  653. package/dist/wire/backend/validation.js.map +0 -1
  654. package/dist/wire/backend/workers-proxy.d.ts +0 -95
  655. package/dist/wire/backend/workers-proxy.d.ts.map +0 -1
  656. package/dist/wire/backend/workers-proxy.js +0 -429
  657. package/dist/wire/backend/workers-proxy.js.map +0 -1
  658. package/dist/wire/commands/admin.d.ts +0 -49
  659. package/dist/wire/commands/admin.d.ts.map +0 -1
  660. package/dist/wire/commands/admin.js +0 -272
  661. package/dist/wire/commands/admin.js.map +0 -1
  662. package/dist/wire/commands/aggregate.d.ts +0 -15
  663. package/dist/wire/commands/aggregate.d.ts.map +0 -1
  664. package/dist/wire/commands/aggregate.js +0 -98
  665. package/dist/wire/commands/aggregate.js.map +0 -1
  666. package/dist/wire/commands/auth.d.ts +0 -58
  667. package/dist/wire/commands/auth.d.ts.map +0 -1
  668. package/dist/wire/commands/auth.js +0 -158
  669. package/dist/wire/commands/auth.js.map +0 -1
  670. package/dist/wire/commands/crud.d.ts +0 -49
  671. package/dist/wire/commands/crud.d.ts.map +0 -1
  672. package/dist/wire/commands/crud.js +0 -336
  673. package/dist/wire/commands/crud.js.map +0 -1
  674. package/dist/wire/commands/hello.d.ts +0 -35
  675. package/dist/wire/commands/hello.d.ts.map +0 -1
  676. package/dist/wire/commands/hello.js +0 -204
  677. package/dist/wire/commands/hello.js.map +0 -1
  678. package/dist/wire/commands/index.d.ts +0 -24
  679. package/dist/wire/commands/index.d.ts.map +0 -1
  680. package/dist/wire/commands/index.js +0 -145
  681. package/dist/wire/commands/index.js.map +0 -1
  682. package/dist/wire/commands/router.d.ts +0 -46
  683. package/dist/wire/commands/router.d.ts.map +0 -1
  684. package/dist/wire/commands/router.js +0 -151
  685. package/dist/wire/commands/router.js.map +0 -1
  686. package/dist/wire/commands/types.d.ts +0 -51
  687. package/dist/wire/commands/types.d.ts.map +0 -1
  688. package/dist/wire/commands/types.js +0 -15
  689. package/dist/wire/commands/types.js.map +0 -1
  690. package/dist/wire/index.d.ts +0 -15
  691. package/dist/wire/index.d.ts.map +0 -1
  692. package/dist/wire/index.js +0 -19
  693. package/dist/wire/index.js.map +0 -1
  694. package/dist/wire/message.d.ts +0 -49
  695. package/dist/wire/message.d.ts.map +0 -1
  696. package/dist/wire/message.js +0 -299
  697. package/dist/wire/message.js.map +0 -1
  698. package/dist/wire/server.d.ts +0 -145
  699. package/dist/wire/server.d.ts.map +0 -1
  700. package/dist/wire/server.js +0 -284
  701. package/dist/wire/server.js.map +0 -1
  702. package/dist/wire/types.d.ts +0 -140
  703. package/dist/wire/types.d.ts.map +0 -1
  704. package/dist/wire/types.js +0 -64
  705. package/dist/wire/types.js.map +0 -1
  706. package/dist/worker.d.ts.map +0 -1
@@ -0,0 +1,1331 @@
1
+ /**
2
+ * ObjectId - MongoDB-compatible 12-byte unique identifier
3
+ *
4
+ * Structure (12 bytes = 24 hex characters):
5
+ * - 4 bytes: Unix timestamp (seconds since epoch)
6
+ * - 5 bytes: Random value (generated once per process)
7
+ * - 3 bytes: Incrementing counter (initialized to random value)
8
+ *
9
+ * Compatible with MongoDB BSON ObjectId specification.
10
+ */
11
+ /**
12
+ * Type guard for ObjectId-like values
13
+ */
14
+ type ObjectIdLike = ObjectId | string | Uint8Array;
15
+ /**
16
+ * Input types accepted by ObjectId constructor
17
+ */
18
+ type ObjectIdInput = ObjectIdLike | null | undefined;
19
+ /**
20
+ * ObjectId class - MongoDB-compatible unique identifier
21
+ *
22
+ * @example
23
+ * ```typescript
24
+ * // Generate new ObjectId
25
+ * const id = new ObjectId()
26
+ *
27
+ * // Create from hex string
28
+ * const id2 = ObjectId.createFromHexString('507f1f77bcf86cd799439011')
29
+ *
30
+ * // Get timestamp
31
+ * const timestamp = id.getTimestamp()
32
+ *
33
+ * // Compare ObjectIds
34
+ * id.equals(id2) // false
35
+ * ```
36
+ */
37
+ declare class ObjectId {
38
+ /** BSON type identifier for serialization compatibility */
39
+ readonly _bsontype: "ObjectId";
40
+ /** The raw 12-byte buffer containing the ObjectId data */
41
+ readonly id: Uint8Array;
42
+ /** Cached hex string representation (computed lazily) */
43
+ private _hexString;
44
+ /**
45
+ * Create a new ObjectId
46
+ *
47
+ * @param input - Optional: hex string, Uint8Array, or another ObjectId.
48
+ * If omitted, generates a new unique ObjectId.
49
+ * @throws {TypeError} If input is invalid
50
+ */
51
+ constructor(input?: ObjectIdInput);
52
+ /**
53
+ * Generate a new 12-byte ObjectId buffer
54
+ * Structure: 4-byte timestamp | 5-byte random | 3-byte counter
55
+ */
56
+ private generate;
57
+ /**
58
+ * Get the timestamp component of this ObjectId as a Date
59
+ *
60
+ * @returns Date object representing when this ObjectId was generated
61
+ */
62
+ getTimestamp(): Date;
63
+ /**
64
+ * Get the generation time as Unix timestamp (seconds)
65
+ */
66
+ getGenerationTime(): number;
67
+ /**
68
+ * Return the ObjectId as a 24-character lowercase hex string
69
+ */
70
+ toHexString(): string;
71
+ /**
72
+ * String representation of the ObjectId (same as toHexString)
73
+ */
74
+ toString(): string;
75
+ /**
76
+ * JSON serialization - returns hex string
77
+ * This allows ObjectIds to serialize naturally in JSON.stringify()
78
+ */
79
+ toJSON(): string;
80
+ /**
81
+ * Compare this ObjectId to another value for equality
82
+ *
83
+ * @param other - ObjectId, hex string, or null/undefined to compare
84
+ * @returns true if the ObjectIds are equal, false otherwise
85
+ */
86
+ equals(other: ObjectId | string | null | undefined): boolean;
87
+ /**
88
+ * Primitive value conversion (returns hex string)
89
+ */
90
+ valueOf(): string;
91
+ /**
92
+ * Symbol.toStringTag for better debugging output
93
+ */
94
+ get [Symbol.toStringTag](): string;
95
+ /**
96
+ * Create an ObjectId from a 24-character hex string
97
+ *
98
+ * @param hexString - 24-character hex string
99
+ * @returns New ObjectId instance
100
+ * @throws {TypeError} If hexString is invalid
101
+ */
102
+ static createFromHexString(hexString: string): ObjectId;
103
+ /**
104
+ * Create an ObjectId with a specific timestamp
105
+ * Useful for range queries on _id fields
106
+ *
107
+ * @param time - Unix timestamp in seconds
108
+ * @returns New ObjectId with the given timestamp and zeroed remaining bytes
109
+ */
110
+ static createFromTime(time: number): ObjectId;
111
+ /**
112
+ * Generate a new ObjectId (factory method, equivalent to new ObjectId())
113
+ *
114
+ * @returns New unique ObjectId instance
115
+ */
116
+ static generate(): ObjectId;
117
+ /**
118
+ * Check if a value is a valid ObjectId or ObjectId hex string
119
+ *
120
+ * @param value - Value to check
121
+ * @returns true if valid ObjectId or 24-char hex string
122
+ */
123
+ static isValid(value: unknown): value is ObjectId | string;
124
+ /**
125
+ * Check if a string is a valid 24-character hex string
126
+ */
127
+ private static isValidHex;
128
+ }
129
+
130
+ /**
131
+ * Consolidated RPC Types
132
+ *
133
+ * This module contains all shared RPC-related type definitions used across:
134
+ * - src/rpc/rpc-target.ts
135
+ * - src/rpc/rpc-client.ts
136
+ * - src/rpc/endpoint.ts
137
+ * - src/rpc/index.ts
138
+ * - src/wire/backend/workers-proxy.ts
139
+ */
140
+ /**
141
+ * Durable Object namespace interface
142
+ */
143
+ interface DurableObjectNamespace {
144
+ idFromName(name: string): DurableObjectId;
145
+ get(id: DurableObjectId): DurableObjectStub;
146
+ }
147
+ /**
148
+ * Durable Object ID interface
149
+ */
150
+ interface DurableObjectId {
151
+ toString(): string;
152
+ }
153
+ /**
154
+ * Durable Object stub interface
155
+ */
156
+ interface DurableObjectStub {
157
+ fetch(request: Request | string, init?: RequestInit): Promise<Response>;
158
+ }
159
+ /**
160
+ * Base Mondo environment bindings interface
161
+ */
162
+ interface MondoEnv {
163
+ MONDO_DATABASE: DurableObjectNamespace;
164
+ /** Optional Worker Loader for $function support (closed beta) */
165
+ LOADER?: WorkerLoader;
166
+ /** Optional auth token for RPC endpoint */
167
+ MONDO_AUTH_TOKEN?: string;
168
+ }
169
+ /**
170
+ * Worker Loader interface for dynamic worker creation
171
+ * (Closed beta feature for $function operator support)
172
+ */
173
+ interface WorkerLoader {
174
+ get(id: string, getCode: () => Promise<WorkerCode>): WorkerStub;
175
+ }
176
+ /**
177
+ * Worker code specification for dynamic workers
178
+ */
179
+ interface WorkerCode {
180
+ compatibilityDate: string;
181
+ compatibilityFlags?: string[];
182
+ mainModule: string;
183
+ modules: Record<string, string | {
184
+ js: string;
185
+ } | {
186
+ text: string;
187
+ }>;
188
+ globalOutbound?: null;
189
+ env?: Record<string, unknown>;
190
+ }
191
+ /**
192
+ * Worker stub interface for dynamic workers
193
+ */
194
+ interface WorkerStub {
195
+ fetch?(request: Request): Promise<Response>;
196
+ getEntrypoint?(name?: string): WorkerEntrypoint$1;
197
+ }
198
+ /**
199
+ * Worker entrypoint interface
200
+ */
201
+ interface WorkerEntrypoint$1 {
202
+ fetch(request: Request): Promise<Response>;
203
+ }
204
+ /**
205
+ * RPC request structure for Workers RPC (capnweb-style)
206
+ * Used by rpc-target.ts and rpc-client.ts
207
+ */
208
+ interface RpcRequest {
209
+ id?: string;
210
+ method: string;
211
+ params: unknown[];
212
+ }
213
+ /**
214
+ * RPC response structure for Workers RPC
215
+ */
216
+ interface RpcResponse {
217
+ id?: string;
218
+ result?: unknown;
219
+ error?: string;
220
+ }
221
+ /**
222
+ * Batch response structure
223
+ */
224
+ interface BatchResponse {
225
+ results: RpcResponse[];
226
+ }
227
+ /**
228
+ * RPC request structure for HTTP endpoint
229
+ * Used by endpoint.ts and workers-proxy.ts
230
+ */
231
+ interface HttpRpcRequest {
232
+ method: string;
233
+ db?: string;
234
+ collection?: string;
235
+ filter?: Record<string, unknown>;
236
+ update?: Record<string, unknown>;
237
+ document?: Record<string, unknown>;
238
+ documents?: Record<string, unknown>[];
239
+ pipeline?: Record<string, unknown>[];
240
+ options?: Record<string, unknown>;
241
+ field?: string;
242
+ query?: Record<string, unknown>;
243
+ }
244
+ /**
245
+ * HTTP RPC success response
246
+ */
247
+ interface HttpRpcSuccessResponse {
248
+ ok: 1;
249
+ result: unknown;
250
+ }
251
+ /**
252
+ * HTTP RPC error response
253
+ */
254
+ interface HttpRpcErrorResponse {
255
+ ok: 0;
256
+ error: string;
257
+ code: number;
258
+ codeName?: string;
259
+ }
260
+ /**
261
+ * HTTP RPC response (union type)
262
+ */
263
+ type HttpRpcResponse = HttpRpcSuccessResponse | HttpRpcErrorResponse;
264
+ /**
265
+ * RPC message types for internal operations
266
+ */
267
+ declare enum MessageType {
268
+ INSERT_ONE = "insertOne",
269
+ INSERT_MANY = "insertMany",
270
+ FIND_ONE = "findOne",
271
+ FIND = "find",
272
+ UPDATE_ONE = "updateOne",
273
+ UPDATE_MANY = "updateMany",
274
+ DELETE_ONE = "deleteOne",
275
+ DELETE_MANY = "deleteMany",
276
+ AGGREGATE = "aggregate",
277
+ COUNT = "count",
278
+ DISTINCT = "distinct",
279
+ CREATE_INDEX = "createIndex",
280
+ DROP_INDEX = "dropIndex",
281
+ LIST_INDEXES = "listIndexes",
282
+ CREATE_COLLECTION = "createCollection",
283
+ DROP_COLLECTION = "dropCollection",
284
+ LIST_COLLECTIONS = "listCollections",
285
+ STATS = "stats",
286
+ HEALTH = "health"
287
+ }
288
+ /**
289
+ * Legacy RPC request interface (message-based)
290
+ */
291
+ interface LegacyRpcRequest {
292
+ type: MessageType;
293
+ collection?: string;
294
+ payload: unknown;
295
+ }
296
+ /**
297
+ * Legacy RPC response interface
298
+ */
299
+ interface LegacyRpcResponse<T = unknown> {
300
+ success: boolean;
301
+ data?: T;
302
+ error?: {
303
+ code: string;
304
+ message: string;
305
+ };
306
+ }
307
+ /**
308
+ * Database reference returned by db() method
309
+ */
310
+ interface DatabaseRef {
311
+ name: string;
312
+ stub: DurableObjectStub;
313
+ }
314
+ /**
315
+ * Collection reference returned by collection() method
316
+ */
317
+ interface CollectionRef {
318
+ dbName: string;
319
+ collectionName: string;
320
+ stub: DurableObjectStub;
321
+ }
322
+ /**
323
+ * Batched executor options
324
+ */
325
+ interface BatchedExecutorOptions {
326
+ maxBatchSize?: number;
327
+ flushInterval?: number;
328
+ }
329
+ /**
330
+ * Pipelined operation reference
331
+ */
332
+ interface PipelineOp {
333
+ id: string;
334
+ method: string;
335
+ params: unknown[];
336
+ dependencies: string[];
337
+ }
338
+ /**
339
+ * RPC client options
340
+ */
341
+ interface RpcClientOptions {
342
+ /** Enable automatic reconnection */
343
+ autoReconnect?: boolean;
344
+ /** Maximum retry attempts */
345
+ maxRetries?: number;
346
+ /** Reconnect interval in milliseconds */
347
+ reconnectInterval?: number;
348
+ /** Enable request deduplication */
349
+ deduplicate?: boolean;
350
+ /** Deduplication TTL in milliseconds */
351
+ deduplicationTtl?: number;
352
+ /** Request timeout in milliseconds */
353
+ timeout?: number;
354
+ }
355
+ /**
356
+ * Options for request deduplicator
357
+ */
358
+ interface DeduplicatorOptions {
359
+ ttl?: number;
360
+ }
361
+ /**
362
+ * Event handler type
363
+ */
364
+ type EventHandler<T = unknown> = (event: T) => void;
365
+ /**
366
+ * Reconnect event data
367
+ */
368
+ interface ReconnectEvent {
369
+ attempt: number;
370
+ lastError?: Error;
371
+ }
372
+ /**
373
+ * RPC Handler interface
374
+ */
375
+ interface RpcHandler {
376
+ fetch(request: Request): Promise<Response>;
377
+ }
378
+ /**
379
+ * MongoDB-compatible error codes
380
+ */
381
+ declare const ErrorCode: {
382
+ readonly OK: 0;
383
+ readonly INTERNAL_ERROR: 1;
384
+ readonly BAD_VALUE: 2;
385
+ readonly NO_SUCH_KEY: 4;
386
+ readonly GRAPH_CONTAINS_CYCLE: 5;
387
+ readonly HOST_UNREACHABLE: 6;
388
+ readonly HOST_NOT_FOUND: 7;
389
+ readonly UNKNOWN_ERROR: 8;
390
+ readonly FAILED_TO_PARSE: 9;
391
+ readonly CANNOT_MUTATE_OBJECT: 10;
392
+ readonly USER_NOT_FOUND: 11;
393
+ readonly UNSUPPORTED_FORMAT: 12;
394
+ readonly UNAUTHORIZED: 13;
395
+ readonly TYPE_MISMATCH: 14;
396
+ readonly OVERFLOW: 15;
397
+ readonly INVALID_LENGTH: 16;
398
+ readonly PROTOCOL_ERROR: 17;
399
+ readonly AUTHENTICATION_FAILED: 18;
400
+ readonly CANNOT_REUSE_OBJECT: 19;
401
+ readonly ILLEGAL_OPERATION: 20;
402
+ readonly EMPTY_ARRAY_OPERATION: 21;
403
+ readonly INVALID_BSON: 22;
404
+ readonly ALREADY_INITIALIZED: 23;
405
+ readonly LOCK_TIMEOUT: 24;
406
+ readonly REMOTE_VALIDATION_ERROR: 25;
407
+ readonly NAMESPACE_NOT_FOUND: 26;
408
+ readonly INDEX_NOT_FOUND: 27;
409
+ readonly PATH_NOT_VIABLE: 28;
410
+ readonly NON_EXISTENT_PATH: 29;
411
+ readonly INVALID_PATH: 30;
412
+ readonly ROLE_NOT_FOUND: 31;
413
+ readonly ROLES_NOT_RELATED: 32;
414
+ readonly PRIVILEGE_NOT_FOUND: 33;
415
+ readonly CANNOT_BACKFILL_ARRAY: 34;
416
+ readonly COMMAND_NOT_FOUND: 59;
417
+ readonly DATABASE_NOT_FOUND: 60;
418
+ readonly LOCATION_ERROR: 16755;
419
+ readonly DUPLICATE_KEY: 11000;
420
+ };
421
+ type ErrorCodeValue = (typeof ErrorCode)[keyof typeof ErrorCode];
422
+ /**
423
+ * Get the code name for an error code
424
+ */
425
+ declare function getErrorCodeName(code: number): string;
426
+ /**
427
+ * Create a success response (Document format for wire protocol)
428
+ */
429
+ declare function successResponse(data?: Record<string, unknown>): Record<string, unknown>;
430
+ /**
431
+ * Create an error response (Document format for wire protocol)
432
+ */
433
+ declare function errorResponse(code: number, errmsg: string, codeName?: string): Record<string, unknown>;
434
+ /**
435
+ * Create a legacy success response
436
+ */
437
+ declare function legacySuccessResponse<T>(data: T): LegacyRpcResponse<T>;
438
+ /**
439
+ * Create a legacy error response
440
+ */
441
+ declare function legacyErrorResponse(code: string, message: string): LegacyRpcResponse<never>;
442
+
443
+ /**
444
+ * Index specification type
445
+ * Keys are field names, values are 1 (ascending), -1 (descending), or 'text' for text indexes
446
+ */
447
+ type IndexSpec = Record<string, 1 | -1 | 'text'>;
448
+ /**
449
+ * Options for creating an index
450
+ */
451
+ interface CreateIndexOptions {
452
+ /** Name of the index (auto-generated if not provided) */
453
+ name?: string;
454
+ /** Create a unique index */
455
+ unique?: boolean;
456
+ /** Create a sparse index (only index documents with the field) */
457
+ sparse?: boolean;
458
+ /** Create index in background */
459
+ background?: boolean;
460
+ /** Partial filter expression for partial indexes */
461
+ partialFilterExpression?: Record<string, unknown>;
462
+ /** TTL in seconds for TTL indexes */
463
+ expireAfterSeconds?: number;
464
+ /** Weights for text index fields (higher weight = more important) */
465
+ weights?: Record<string, number>;
466
+ /** Default language for text index */
467
+ default_language?: string;
468
+ /** Field containing document language override */
469
+ language_override?: string;
470
+ }
471
+ /**
472
+ * Result from createIndex operation
473
+ */
474
+ interface CreateIndexResult {
475
+ ok: 1;
476
+ numIndexesBefore: number;
477
+ numIndexesAfter: number;
478
+ createdCollectionAutomatically: boolean;
479
+ note?: string;
480
+ }
481
+ /**
482
+ * Index information returned by listIndexes
483
+ */
484
+ interface IndexInfo {
485
+ /** Index name */
486
+ name: string;
487
+ /** Index key specification */
488
+ key: IndexSpec;
489
+ /** Version (always 2 for SQLite backed indexes) */
490
+ v: number;
491
+ /** Whether this is a unique index */
492
+ unique?: boolean;
493
+ /** Whether this is a sparse index */
494
+ sparse?: boolean;
495
+ /** Partial filter expression */
496
+ partialFilterExpression?: Record<string, unknown>;
497
+ /** TTL in seconds */
498
+ expireAfterSeconds?: number;
499
+ /** Weights for text index fields */
500
+ weights?: Record<string, number>;
501
+ /** Default language for text index */
502
+ default_language?: string;
503
+ /** Whether this is a text index */
504
+ textIndexVersion?: number;
505
+ }
506
+ /**
507
+ * Result from dropIndex operation
508
+ */
509
+ interface DropIndexResult {
510
+ ok: 1;
511
+ nIndexesWas: number;
512
+ }
513
+ /**
514
+ * Document type - any JSON-serializable object with optional _id
515
+ */
516
+ interface Document {
517
+ _id?: string | ObjectId;
518
+ [key: string]: unknown;
519
+ }
520
+ /**
521
+ * Insert result
522
+ */
523
+ interface InsertOneResult {
524
+ acknowledged: boolean;
525
+ insertedId: string;
526
+ }
527
+ /**
528
+ * Delete result
529
+ */
530
+ interface DeleteResult {
531
+ acknowledged: boolean;
532
+ deletedCount: number;
533
+ }
534
+ /**
535
+ * Update result
536
+ */
537
+ interface UpdateResult {
538
+ acknowledged: boolean;
539
+ matchedCount: number;
540
+ modifiedCount: number;
541
+ /** Number of documents upserted (only present when upsert: true was used) */
542
+ upsertedCount?: number;
543
+ /** ID of the upserted document (only present when a document was upserted) */
544
+ upsertedId?: string;
545
+ }
546
+
547
+ /**
548
+ * SQLite Schema Management for MondoDB
549
+ *
550
+ * This module handles the initialization and management of SQLite tables
551
+ * for MongoDB-compatible document storage in Cloudflare Durable Objects.
552
+ *
553
+ * UNIFIED SCHEMA TYPES:
554
+ * This module serves as the single source of truth for all schema-related types
555
+ * used by both IndexManager and MondoDatabase.
556
+ */
557
+
558
+ /**
559
+ * Current schema version - derived from migrations module
560
+ */
561
+ declare const SCHEMA_VERSION: number;
562
+ /**
563
+ * Table definitions for the schema (exported for reference/testing)
564
+ *
565
+ * UNIFIED SCHEMA: This schema supports both MondoDatabase and IndexManager:
566
+ * - collections table: stores collection metadata including indexes JSON
567
+ * - documents table: stores documents with _id as the document identifier
568
+ *
569
+ * Note: The actual table creation is handled by migrations.ts.
570
+ * These definitions are kept in sync for reference and testing.
571
+ */
572
+ declare const SCHEMA_TABLES: {
573
+ readonly collections: {
574
+ readonly name: "collections";
575
+ readonly sql: string;
576
+ };
577
+ readonly documents: {
578
+ readonly name: "documents";
579
+ readonly sql: string;
580
+ };
581
+ };
582
+ /**
583
+ * Interface for SQL query result with parameter binding
584
+ * Used by MondoDatabase with Cloudflare's native SQL interface
585
+ */
586
+ interface SqlQueryResult {
587
+ toArray(): unknown[];
588
+ run(): void;
589
+ bind(...params: unknown[]): SqlQueryResult;
590
+ }
591
+ /**
592
+ * Interface for Cloudflare Durable Object SQL storage
593
+ * Used by MondoDatabase for direct SQL execution
594
+ */
595
+ interface SqlStorage {
596
+ exec(sql: string, ...params: unknown[]): SqlQueryResult;
597
+ }
598
+ /**
599
+ * Interface for Cloudflare Durable Object storage
600
+ * Used by MondoDatabase and SchemaManager
601
+ */
602
+ interface DurableObjectStorage {
603
+ sql: SqlStorage;
604
+ get<T>(key: string): Promise<T | undefined>;
605
+ put(key: string, value: unknown): Promise<void>;
606
+ /**
607
+ * Execute a synchronous callback wrapped in a transaction.
608
+ * If the callback throws, the transaction is rolled back.
609
+ * Only available for SQLite-backed Durable Objects.
610
+ */
611
+ transactionSync<T>(callback: () => T): T;
612
+ }
613
+ /**
614
+ * Interface for SQL prepared statement
615
+ * Used by IndexManager for prepared statement execution
616
+ */
617
+ interface SQLStatement {
618
+ bind(...params: unknown[]): SQLStatement;
619
+ run(): void;
620
+ first<T = unknown>(): T | null;
621
+ all<T = unknown>(): T[];
622
+ }
623
+ /**
624
+ * Interface for SQLite-compatible storage with SQL execution
625
+ * Used by IndexManager for prepared statement-based operations
626
+ *
627
+ * This is an alternative interface to DurableObjectStorage that provides
628
+ * a prepare() method for creating prepared statements, which is useful
629
+ * for operations that need to retrieve results or bind parameters.
630
+ */
631
+ interface SQLStorage {
632
+ exec(sql: string): void;
633
+ prepare(sql: string): SQLStatement;
634
+ }
635
+ /**
636
+ * TTL Index information with collection context
637
+ */
638
+ interface TTLIndexInfo {
639
+ collectionName: string;
640
+ collectionId: number;
641
+ indexName: string;
642
+ field: string;
643
+ expireAfterSeconds: number;
644
+ }
645
+ /**
646
+ * TTL metadata for tracking cleanup operations
647
+ */
648
+ interface TTLMetadata {
649
+ field: string;
650
+ expireAfterSeconds: number;
651
+ lastCleanupAt?: string;
652
+ lastCleanupCount?: number;
653
+ }
654
+ /**
655
+ * Result of a TTL cleanup operation
656
+ */
657
+ interface TTLCleanupResult {
658
+ ok: 1;
659
+ collectionsProcessed: number;
660
+ documentsDeleted: number;
661
+ errors?: string[];
662
+ }
663
+ /**
664
+ * Query info for deleting expired documents
665
+ */
666
+ interface ExpiredDocumentsQuery {
667
+ sql: string;
668
+ params: unknown[];
669
+ }
670
+ /**
671
+ * Schema validation result
672
+ */
673
+ interface SchemaValidationResult {
674
+ valid: boolean;
675
+ missingTables: string[];
676
+ missingIndexes: string[];
677
+ errors: string[];
678
+ }
679
+ /**
680
+ * SchemaManager handles SQLite schema initialization and migrations
681
+ */
682
+ declare class SchemaManager {
683
+ private storage;
684
+ constructor(storage: DurableObjectStorage);
685
+ /**
686
+ * Initialize the schema, running migrations if needed
687
+ */
688
+ initializeSchema(): Promise<void>;
689
+ /**
690
+ * Validate that the schema is properly initialized
691
+ * Returns true if all required tables exist
692
+ */
693
+ validateSchema(): Promise<boolean>;
694
+ /**
695
+ * Detailed schema validation with specific error information
696
+ */
697
+ validateSchemaDetailed(): Promise<SchemaValidationResult>;
698
+ /**
699
+ * Get the current schema version from storage
700
+ */
701
+ getSchemaVersion(): Promise<number>;
702
+ /**
703
+ * Check if schema needs migration
704
+ */
705
+ needsMigration(): Promise<boolean>;
706
+ /**
707
+ * Get list of pending migrations
708
+ */
709
+ getPendingMigrations(): Promise<number[]>;
710
+ }
711
+
712
+ /**
713
+ * Types for aggregation pipeline stages
714
+ */
715
+
716
+ type PipelineStage = {
717
+ $match: Record<string, unknown>;
718
+ } | {
719
+ $project: Record<string, unknown>;
720
+ } | {
721
+ $group: GroupStage;
722
+ } | {
723
+ $sort: Record<string, 1 | -1>;
724
+ } | {
725
+ $limit: number;
726
+ } | {
727
+ $skip: number;
728
+ } | {
729
+ $count: string;
730
+ } | {
731
+ $lookup: LookupStage;
732
+ } | {
733
+ $unwind: string | UnwindStage;
734
+ } | {
735
+ $addFields: Record<string, unknown>;
736
+ } | {
737
+ $bucket: BucketStage;
738
+ } | {
739
+ $facet: Record<string, PipelineStage[]>;
740
+ } | {
741
+ $search: SearchStage;
742
+ } | {
743
+ $vectorSearch: VectorSearchPipelineStage;
744
+ };
745
+ interface SearchStage {
746
+ index?: string;
747
+ text?: {
748
+ query: string;
749
+ path?: string | string[];
750
+ };
751
+ phrase?: {
752
+ query: string;
753
+ path?: string | string[];
754
+ };
755
+ wildcard?: {
756
+ query: string;
757
+ path?: string | string[];
758
+ };
759
+ compound?: {
760
+ must?: SearchStage[];
761
+ should?: SearchStage[];
762
+ mustNot?: SearchStage[];
763
+ filter?: SearchStage[];
764
+ };
765
+ }
766
+ interface GroupStage {
767
+ _id: null | string | Record<string, string>;
768
+ [accumulator: string]: unknown;
769
+ }
770
+ interface LookupStage {
771
+ from: string;
772
+ localField?: string;
773
+ foreignField?: string;
774
+ as: string;
775
+ let?: Record<string, string>;
776
+ pipeline?: PipelineStage[];
777
+ }
778
+ interface UnwindStage {
779
+ path: string;
780
+ includeArrayIndex?: string;
781
+ preserveNullAndEmptyArrays?: boolean;
782
+ }
783
+ interface BucketStage {
784
+ groupBy: string;
785
+ boundaries: number[];
786
+ default?: string;
787
+ output?: Record<string, unknown>;
788
+ }
789
+ /**
790
+ * $vectorSearch pipeline stage for vector similarity search
791
+ * Compatible with MongoDB Atlas vector search
792
+ */
793
+ interface VectorSearchPipelineStage {
794
+ /** Name of the vector search index */
795
+ index: string;
796
+ /** Path to the vector field in documents */
797
+ path: string;
798
+ /** The query vector to search for */
799
+ queryVector: number[];
800
+ /** Number of candidates to consider (default: limit * 10) */
801
+ numCandidates?: number;
802
+ /** Maximum number of results to return */
803
+ limit: number;
804
+ /** Optional filter to apply before vector search */
805
+ filter?: Record<string, unknown>;
806
+ /** Whether to perform exact search (slower but more accurate) */
807
+ exact?: boolean;
808
+ /** Field name to store the similarity score (default: 'score') */
809
+ scoreField?: string;
810
+ }
811
+
812
+ /**
813
+ * MondoDatabase - MongoDB-compatible Durable Object
814
+ *
815
+ * This is the main Durable Object class that provides MongoDB-compatible
816
+ * operations backed by Cloudflare's SQLite storage.
817
+ */
818
+
819
+ /**
820
+ * Interface for Durable Object state
821
+ */
822
+ interface DurableObjectState {
823
+ storage: DurableObjectStorage;
824
+ blockConcurrencyWhile<T>(callback: () => Promise<T>): void;
825
+ }
826
+ /**
827
+ * Interface for Cloudflare Environment bindings
828
+ */
829
+ interface Env {
830
+ /** Optional worker-loader binding for $function support */
831
+ LOADER?: WorkerLoader;
832
+ /** Enable debug endpoints (/internal/reset, /internal/dump) - DO NOT enable in production */
833
+ ENABLE_DEBUG_ENDPOINTS?: string;
834
+ }
835
+ /**
836
+ * Result of an insertMany operation
837
+ * Note: This uses string[] for insertedIds (matching MongoDB's native driver behavior),
838
+ * while the shared InsertManyResult type uses Record<number, string> for MongoDB compatibility
839
+ */
840
+ interface InsertManyResult {
841
+ acknowledged: boolean;
842
+ insertedCount: number;
843
+ insertedIds: string[];
844
+ }
845
+ /**
846
+ * MondoDatabase Durable Object
847
+ *
848
+ * Provides MongoDB-compatible document storage using Cloudflare Durable Objects
849
+ * with SQLite as the backing store.
850
+ */
851
+ declare class MondoDatabase {
852
+ private state;
853
+ private env;
854
+ private schemaManager;
855
+ private initialized;
856
+ private mcpHandler;
857
+ constructor(state: DurableObjectState, env: Env);
858
+ /**
859
+ * Check if the database is initialized
860
+ */
861
+ isInitialized(): boolean;
862
+ /**
863
+ * Get the schema manager for advanced operations
864
+ */
865
+ getSchemaManager(): SchemaManager;
866
+ /**
867
+ * Get the underlying storage
868
+ */
869
+ getStorage(): DurableObjectStorage;
870
+ /**
871
+ * Get or create a collection by name, returning the collection_id
872
+ */
873
+ private getOrCreateCollection;
874
+ /**
875
+ * Get collection ID by name, returns undefined if not found
876
+ */
877
+ private getCollectionId;
878
+ /**
879
+ * Insert a single document into a collection
880
+ */
881
+ insertOne(collection: string, document: Document): Promise<InsertOneResult>;
882
+ /**
883
+ * Insert multiple documents into a collection
884
+ */
885
+ insertMany(collection: string, documents: Document[]): Promise<InsertManyResult>;
886
+ /**
887
+ * Find a single document matching the query
888
+ */
889
+ findOne(collection: string, query?: Document): Promise<Document | null>;
890
+ /**
891
+ * Find all documents matching the query
892
+ */
893
+ find(collection: string, query?: Document): Promise<Document[]>;
894
+ /**
895
+ * Update a single document matching the filter
896
+ */
897
+ updateOne(collection: string, filter: Document, update: {
898
+ $set?: Document;
899
+ $unset?: Record<string, unknown>;
900
+ }): Promise<UpdateResult>;
901
+ /**
902
+ * Delete a single document matching the filter
903
+ */
904
+ deleteOne(collection: string, filter: Document): Promise<DeleteResult>;
905
+ /**
906
+ * Build WHERE clause from MongoDB-style query
907
+ * Supports: _id, simple field equality, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists
908
+ */
909
+ private buildWhereClause;
910
+ /**
911
+ * Convert a field name (possibly with dot notation) to JSON path
912
+ * e.g., "profile.level" -> "$.profile.level"
913
+ */
914
+ private fieldToJsonPath;
915
+ /**
916
+ * Set a nested value in an object using dot notation path
917
+ */
918
+ private setNestedValue;
919
+ /**
920
+ * Delete a nested value from an object using dot notation path
921
+ */
922
+ private deleteNestedValue;
923
+ /**
924
+ * Delete multiple documents matching the filter
925
+ */
926
+ deleteMany(collection: string, filter?: Document): Promise<DeleteResult>;
927
+ /**
928
+ * Count documents matching the filter
929
+ */
930
+ countDocuments(collection: string, filter?: Document): Promise<number>;
931
+ /**
932
+ * Execute an aggregation pipeline on a collection
933
+ *
934
+ * Supports async execution for $function operators that require
935
+ * JavaScript execution via worker-loader.
936
+ *
937
+ * @param collection - The collection name
938
+ * @param pipeline - Array of aggregation pipeline stages
939
+ * @returns Array of result documents
940
+ */
941
+ aggregate(collection: string, pipeline: PipelineStage[]): Promise<unknown[]>;
942
+ /**
943
+ * Reset database - for testing purposes
944
+ */
945
+ private reset;
946
+ /**
947
+ * Dump database contents - for debugging
948
+ */
949
+ private dump;
950
+ /**
951
+ * Handle incoming fetch requests
952
+ * Implements HTTP API for MongoDB-compatible operations
953
+ */
954
+ fetch(request: Request): Promise<Response>;
955
+ }
956
+
957
+ /**
958
+ * RPC Target - Server-side RPC handler for capnweb-style Workers RPC
959
+ *
960
+ * Implements:
961
+ * - MondoRpcTarget extending RpcTarget base class
962
+ * - Request routing to Durable Object stubs
963
+ * - HTTP batch protocol support
964
+ * - Promise pipelining for chained operations
965
+ */
966
+
967
+ /**
968
+ * Base class for RPC targets (capnweb-style)
969
+ */
970
+ declare class RpcTarget {
971
+ protected methods: Map<string, (...args: unknown[]) => Promise<unknown>>;
972
+ /**
973
+ * Allowlist of methods that can be invoked via RPC.
974
+ * Subclasses should override this to define their allowed methods.
975
+ * This prevents invocation of inherited methods like constructor, __proto__, toString, etc.
976
+ */
977
+ protected allowedMethods: Set<string>;
978
+ /**
979
+ * Register a method handler
980
+ */
981
+ protected registerMethod(name: string, handler: (...args: unknown[]) => Promise<unknown>): void;
982
+ /**
983
+ * Check if a method exists and is allowed
984
+ */
985
+ hasMethod(name: string): boolean;
986
+ /**
987
+ * Invoke a method by name
988
+ */
989
+ invoke(method: string, params: unknown[]): Promise<unknown>;
990
+ }
991
+ /**
992
+ * MondoRpcTarget provides MongoDB-compatible API via Workers RPC
993
+ */
994
+ declare class MondoRpcTarget extends RpcTarget {
995
+ private env;
996
+ private currentConnectionString;
997
+ private databases;
998
+ /**
999
+ * Explicit allowlist of methods that can be invoked via RPC.
1000
+ * This prevents invocation of inherited methods like constructor, __proto__, toString, etc.
1001
+ */
1002
+ protected allowedMethods: Set<string>;
1003
+ constructor(env: MondoEnv);
1004
+ /**
1005
+ * Connect to a MongoDB-compatible connection string
1006
+ */
1007
+ connect(connectionString: string): Promise<{
1008
+ connected: boolean;
1009
+ database?: string;
1010
+ }>;
1011
+ /**
1012
+ * Get the current connection string
1013
+ */
1014
+ get connectionString(): string | null;
1015
+ /**
1016
+ * Get a database reference
1017
+ */
1018
+ db(name: string): Promise<DatabaseRef>;
1019
+ /**
1020
+ * Get a collection reference
1021
+ */
1022
+ collection(dbName: string, collectionName: string): Promise<CollectionRef>;
1023
+ /**
1024
+ * Execute a find operation
1025
+ */
1026
+ find(dbName: string, collectionName: string, query: Record<string, unknown>): Promise<unknown[]>;
1027
+ /**
1028
+ * Execute an insertOne operation
1029
+ */
1030
+ insertOne(dbName: string, collectionName: string, document: Record<string, unknown>): Promise<{
1031
+ insertedId: string;
1032
+ }>;
1033
+ /**
1034
+ * Execute an updateOne operation
1035
+ */
1036
+ updateOne(dbName: string, collectionName: string, filter: Record<string, unknown>, update: Record<string, unknown>): Promise<{
1037
+ matchedCount: number;
1038
+ modifiedCount: number;
1039
+ }>;
1040
+ /**
1041
+ * Execute a deleteOne operation
1042
+ */
1043
+ deleteOne(dbName: string, collectionName: string, filter: Record<string, unknown>): Promise<{
1044
+ deletedCount: number;
1045
+ }>;
1046
+ }
1047
+ /**
1048
+ * Create a Workers RPC response from a target and request
1049
+ */
1050
+ declare function newWorkersRpcResponse(target: RpcTarget, request: Request): Promise<Response>;
1051
+ /**
1052
+ * Batched RPC executor that coalesces multiple requests
1053
+ */
1054
+ declare class BatchedRpcExecutor {
1055
+ private stub;
1056
+ private options;
1057
+ private queue;
1058
+ private flushTimer;
1059
+ constructor(stub: DurableObjectStub, options?: BatchedExecutorOptions);
1060
+ /**
1061
+ * Execute a method with batching
1062
+ */
1063
+ execute(method: string, params: Record<string, unknown>): Promise<unknown>;
1064
+ /**
1065
+ * Flush pending requests
1066
+ */
1067
+ flush(): Promise<void>;
1068
+ }
1069
+ /**
1070
+ * Pipeline tracker for chained operations
1071
+ */
1072
+ declare class PipelineTracker {
1073
+ private operations;
1074
+ private dependencyGraph;
1075
+ /**
1076
+ * Track a new operation
1077
+ */
1078
+ track(method: string, params: unknown[], dependency?: string): string;
1079
+ /**
1080
+ * Get all dependencies for an operation
1081
+ */
1082
+ getDependencies(opId: string): string[];
1083
+ /**
1084
+ * Get operation by ID
1085
+ */
1086
+ getOperation(opId: string): PipelineOp | undefined;
1087
+ /**
1088
+ * Get all operations in dependency order
1089
+ */
1090
+ getOrderedOperations(): PipelineOp[];
1091
+ }
1092
+ /**
1093
+ * Pipelined RPC proxy for chained method calls
1094
+ */
1095
+ declare class PipelinedRpcProxy {
1096
+ private target;
1097
+ private tracker;
1098
+ private currentDb;
1099
+ private currentCollection;
1100
+ constructor(target: MondoRpcTarget);
1101
+ /**
1102
+ * Get a database reference (pipelined)
1103
+ */
1104
+ db(name: string): PipelinedDbProxy;
1105
+ /**
1106
+ * Execute the pipelined operations
1107
+ */
1108
+ execute(): Promise<unknown>;
1109
+ /**
1110
+ * Get the underlying target
1111
+ */
1112
+ getTarget(): MondoRpcTarget;
1113
+ /**
1114
+ * Get current database name
1115
+ */
1116
+ getCurrentDb(): string | null;
1117
+ /**
1118
+ * Get current collection name
1119
+ */
1120
+ getCurrentCollection(): string | null;
1121
+ /**
1122
+ * Set current collection
1123
+ */
1124
+ setCurrentCollection(name: string): void;
1125
+ }
1126
+ /**
1127
+ * Pipelined database proxy
1128
+ */
1129
+ declare class PipelinedDbProxy {
1130
+ private parent;
1131
+ private dbName;
1132
+ private operationId;
1133
+ constructor(parent: PipelinedRpcProxy, dbName: string, opId: string);
1134
+ /**
1135
+ * Get the operation ID
1136
+ */
1137
+ get opId(): string;
1138
+ /**
1139
+ * Get a collection reference (pipelined)
1140
+ */
1141
+ collection(name: string): PipelinedCollectionProxy;
1142
+ }
1143
+ /**
1144
+ * Pipelined collection proxy
1145
+ */
1146
+ declare class PipelinedCollectionProxy {
1147
+ private parent;
1148
+ private dbName;
1149
+ private collectionName;
1150
+ constructor(parent: PipelinedRpcProxy, dbName: string, collectionName: string);
1151
+ /**
1152
+ * Find documents (executes the pipeline)
1153
+ */
1154
+ find(query: Record<string, unknown>): Promise<unknown[]>;
1155
+ /**
1156
+ * Insert one document
1157
+ */
1158
+ insertOne(document: Record<string, unknown>): Promise<{
1159
+ insertedId: string;
1160
+ }>;
1161
+ /**
1162
+ * Update one document
1163
+ */
1164
+ updateOne(filter: Record<string, unknown>, update: Record<string, unknown>): Promise<{
1165
+ matchedCount: number;
1166
+ modifiedCount: number;
1167
+ }>;
1168
+ /**
1169
+ * Delete one document
1170
+ */
1171
+ deleteOne(filter: Record<string, unknown>): Promise<{
1172
+ deletedCount: number;
1173
+ }>;
1174
+ }
1175
+
1176
+ /**
1177
+ * Worker Entrypoint - Workers RPC service binding support
1178
+ *
1179
+ * Implements:
1180
+ * - MondoEntrypoint extending WorkerEntrypoint
1181
+ * - Service binding methods
1182
+ * - TypeScript declarations
1183
+ * - Environment safety
1184
+ */
1185
+
1186
+ /**
1187
+ * Execution context interface
1188
+ */
1189
+ interface ExecutionContext {
1190
+ waitUntil(promise: Promise<unknown>): void;
1191
+ passThroughOnException(): void;
1192
+ }
1193
+ /**
1194
+ * Mondo bindings interface (for service binding consumers)
1195
+ */
1196
+ interface MondoBindings {
1197
+ /** Connect to a MongoDB-compatible connection string */
1198
+ connect(connectionString: string): Promise<{
1199
+ connected: boolean;
1200
+ database?: string;
1201
+ }>;
1202
+ /** Get a database reference */
1203
+ db(name: string): Promise<DatabaseRef>;
1204
+ /** Get a collection reference */
1205
+ collection(dbName: string, collectionName: string): Promise<CollectionRef>;
1206
+ }
1207
+ /**
1208
+ * Default options for the entrypoint
1209
+ */
1210
+ declare const DEFAULT_OPTIONS: {
1211
+ /** Maximum batch size for batched operations */
1212
+ readonly maxBatchSize: 100;
1213
+ /** Request timeout in milliseconds */
1214
+ readonly timeout: 30000;
1215
+ /** Enable background cleanup */
1216
+ readonly enableCleanup: true;
1217
+ /** Cleanup interval in milliseconds */
1218
+ readonly cleanupInterval: 60000;
1219
+ };
1220
+ /**
1221
+ * Entrypoint options
1222
+ */
1223
+ interface MondoEntrypointOptions {
1224
+ maxBatchSize?: number;
1225
+ timeout?: number;
1226
+ enableCleanup?: boolean;
1227
+ cleanupInterval?: number;
1228
+ }
1229
+ /**
1230
+ * Base class for Worker entrypoints (capnweb-style)
1231
+ */
1232
+ declare class WorkerEntrypoint {
1233
+ protected ctx: ExecutionContext;
1234
+ protected env: unknown;
1235
+ constructor(ctx: ExecutionContext, env: unknown);
1236
+ /**
1237
+ * Handle HTTP fetch requests
1238
+ */
1239
+ fetch(_request: Request): Promise<Response>;
1240
+ }
1241
+ /**
1242
+ * Type guard for Mondo environment
1243
+ */
1244
+ declare function isMondoEnv(env: unknown): env is MondoEnv;
1245
+ /**
1246
+ * Validate environment bindings
1247
+ */
1248
+ declare function validateEnv(env: unknown): boolean;
1249
+ /**
1250
+ * MondoEntrypoint extends WorkerEntrypoint for service binding support
1251
+ *
1252
+ * Usage in wrangler.toml:
1253
+ * ```toml
1254
+ * [[services]]
1255
+ * binding = "MONDO"
1256
+ * service = "mongo.do"
1257
+ * entrypoint = "MondoEntrypoint"
1258
+ * ```
1259
+ *
1260
+ * Usage in consuming worker:
1261
+ * ```typescript
1262
+ * const result = await env.MONDO.connect('mongodb://localhost/mydb');
1263
+ * ```
1264
+ */
1265
+ declare class MondoEntrypoint extends WorkerEntrypoint implements MondoBindings {
1266
+ protected env: MondoEnv;
1267
+ private rpcTarget;
1268
+ private entrypointOptions;
1269
+ private cleanupScheduled;
1270
+ constructor(ctx: ExecutionContext, env: MondoEnv);
1271
+ /**
1272
+ * Get the entrypoint options
1273
+ */
1274
+ get options(): Required<MondoEntrypointOptions>;
1275
+ /**
1276
+ * Handle HTTP fetch requests
1277
+ */
1278
+ fetch(request: Request): Promise<Response>;
1279
+ /**
1280
+ * Connect to a MongoDB-compatible connection string
1281
+ */
1282
+ connect(connectionString: string): Promise<{
1283
+ connected: boolean;
1284
+ database?: string;
1285
+ }>;
1286
+ /**
1287
+ * Get a database reference
1288
+ */
1289
+ db(name: string): Promise<DatabaseRef>;
1290
+ /**
1291
+ * Get a collection reference
1292
+ */
1293
+ collection(dbName: string, collectionName: string): Promise<CollectionRef>;
1294
+ /**
1295
+ * Execute a find operation
1296
+ */
1297
+ find(dbName: string, collectionName: string, query: Record<string, unknown>): Promise<unknown[]>;
1298
+ /**
1299
+ * Execute an insertOne operation
1300
+ */
1301
+ insertOne(dbName: string, collectionName: string, document: Record<string, unknown>): Promise<{
1302
+ insertedId: string;
1303
+ }>;
1304
+ /**
1305
+ * Execute an updateOne operation
1306
+ */
1307
+ updateOne(dbName: string, collectionName: string, filter: Record<string, unknown>, update: Record<string, unknown>): Promise<{
1308
+ matchedCount: number;
1309
+ modifiedCount: number;
1310
+ }>;
1311
+ /**
1312
+ * Execute a deleteOne operation
1313
+ */
1314
+ deleteOne(dbName: string, collectionName: string, filter: Record<string, unknown>): Promise<{
1315
+ deletedCount: number;
1316
+ }>;
1317
+ /**
1318
+ * Schedule background cleanup task
1319
+ */
1320
+ scheduleCleanup(): void;
1321
+ /**
1322
+ * Run cleanup task
1323
+ */
1324
+ private runCleanup;
1325
+ /**
1326
+ * Get the underlying RPC target (for testing)
1327
+ */
1328
+ getRpcTarget(): MondoRpcTarget;
1329
+ }
1330
+
1331
+ export { type ErrorCodeValue as $, type WorkerStub as A, type WorkerEntrypoint$1 as B, type CreateIndexOptions as C, type DropIndexResult as D, type ExecutionContext as E, type RpcResponse as F, type BatchResponse as G, type HttpRpcRequest as H, type IndexInfo as I, type HttpRpcSuccessResponse as J, type HttpRpcErrorResponse as K, type HttpRpcResponse as L, type MondoEnv as M, type LegacyRpcRequest as N, ObjectId as O, type PipelineStage as P, type LegacyRpcResponse as Q, type RpcClientOptions as R, type SQLStorage as S, type TTLIndexInfo as T, type DatabaseRef as U, type CollectionRef as V, WorkerEntrypoint as W, type BatchedExecutorOptions as X, type PipelineOp as Y, type ReconnectEvent as Z, type RpcHandler as _, MondoEntrypoint as a, RpcTarget as a0, MondoRpcTarget as a1, newWorkersRpcResponse as a2, BatchedRpcExecutor as a3, PipelineTracker as a4, PipelinedRpcProxy as a5, validateEnv as a6, isMondoEnv as a7, DEFAULT_OPTIONS as a8, type MondoBindings as a9, type MondoEntrypointOptions as aa, MondoDatabase as b, type IndexSpec as c, type CreateIndexResult as d, type ExpiredDocumentsQuery as e, type TTLMetadata as f, type TTLCleanupResult as g, type EventHandler as h, type RpcRequest as i, type DeduplicatorOptions as j, SchemaManager as k, SCHEMA_VERSION as l, SCHEMA_TABLES as m, type SQLStatement as n, ErrorCode as o, getErrorCodeName as p, errorResponse as q, legacySuccessResponse as r, successResponse as s, legacyErrorResponse as t, MessageType as u, type DurableObjectNamespace as v, type DurableObjectId as w, type DurableObjectStub as x, type WorkerLoader as y, type WorkerCode as z };