@qvac/core 0.0.0 → 0.1.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 (586) hide show
  1. package/LICENSE.md +198 -0
  2. package/NOTICE.md +13 -0
  3. package/README.md +694 -0
  4. package/SECURITY.md +6 -0
  5. package/dist/assistant.bundle +47256 -0
  6. package/dist/assistant.cjs +18 -0
  7. package/dist/assistant.d.ts +8 -0
  8. package/dist/prebuilds-manifest.json +380 -0
  9. package/dist-lib/client.d.ts +2 -0
  10. package/dist-lib/client.js +1 -0
  11. package/dist-lib/index.d.ts +13 -0
  12. package/dist-lib/index.js +10 -0
  13. package/dist-lib/lib/agent-icons.d.ts +3 -0
  14. package/dist-lib/lib/agent-icons.js +1 -0
  15. package/dist-lib/lib/api/agents.d.ts +5 -0
  16. package/dist-lib/lib/api/agents.js +38 -0
  17. package/dist-lib/lib/api/app-config.d.ts +5 -0
  18. package/dist-lib/lib/api/app-config.js +108 -0
  19. package/dist-lib/lib/api/approval-rules.d.ts +3 -0
  20. package/dist-lib/lib/api/approval-rules.js +9 -0
  21. package/dist-lib/lib/api/attachments.d.ts +8 -0
  22. package/dist-lib/lib/api/attachments.js +15 -0
  23. package/dist-lib/lib/api/chat-groups.d.ts +5 -0
  24. package/dist-lib/lib/api/chat-groups.js +12 -0
  25. package/dist-lib/lib/api/chat.d.ts +5 -0
  26. package/dist-lib/lib/api/chat.js +38 -0
  27. package/dist-lib/lib/api/chunks.d.ts +5 -0
  28. package/dist-lib/lib/api/chunks.js +61 -0
  29. package/dist-lib/lib/api/config.d.ts +5 -0
  30. package/dist-lib/lib/api/config.js +15 -0
  31. package/dist-lib/lib/api/current-mesh.d.ts +5 -0
  32. package/dist-lib/lib/api/current-mesh.js +12 -0
  33. package/dist-lib/lib/api/custom-models.d.ts +5 -0
  34. package/dist-lib/lib/api/custom-models.js +45 -0
  35. package/dist-lib/lib/api/devices.d.ts +8 -0
  36. package/dist-lib/lib/api/devices.js +125 -0
  37. package/dist-lib/lib/api/diagnostics.d.ts +7 -0
  38. package/dist-lib/lib/api/diagnostics.js +7 -0
  39. package/dist-lib/lib/api/effective-ctx-size.d.ts +2 -0
  40. package/dist-lib/lib/api/effective-ctx-size.js +10 -0
  41. package/dist-lib/lib/api/execution.d.ts +3 -0
  42. package/dist-lib/lib/api/execution.js +45 -0
  43. package/dist-lib/lib/api/files.d.ts +3 -0
  44. package/dist-lib/lib/api/files.js +48 -0
  45. package/dist-lib/lib/api/index.d.ts +62 -0
  46. package/dist-lib/lib/api/index.js +172 -0
  47. package/dist-lib/lib/api/instrument.d.ts +2 -0
  48. package/dist-lib/lib/api/instrument.js +86 -0
  49. package/dist-lib/lib/api/knowledge.d.ts +8 -0
  50. package/dist-lib/lib/api/knowledge.js +26 -0
  51. package/dist-lib/lib/api/logs.d.ts +14 -0
  52. package/dist-lib/lib/api/logs.js +116 -0
  53. package/dist-lib/lib/api/mesh.d.ts +13 -0
  54. package/dist-lib/lib/api/mesh.js +25 -0
  55. package/dist-lib/lib/api/model-download.d.ts +5 -0
  56. package/dist-lib/lib/api/model-download.js +47 -0
  57. package/dist-lib/lib/api/network.d.ts +8 -0
  58. package/dist-lib/lib/api/network.js +6 -0
  59. package/dist-lib/lib/api/notifications.d.ts +21 -0
  60. package/dist-lib/lib/api/notifications.js +108 -0
  61. package/dist-lib/lib/api/rag.d.ts +7 -0
  62. package/dist-lib/lib/api/rag.js +216 -0
  63. package/dist-lib/lib/api/sync.d.ts +3 -0
  64. package/dist-lib/lib/api/sync.js +6 -0
  65. package/dist-lib/lib/api/tool-activity.d.ts +5 -0
  66. package/dist-lib/lib/api/tool-activity.js +53 -0
  67. package/dist-lib/lib/api/tool-configs.d.ts +6 -0
  68. package/dist-lib/lib/api/tool-configs.js +27 -0
  69. package/dist-lib/lib/api/watchable.d.ts +12 -0
  70. package/dist-lib/lib/api/watchable.js +121 -0
  71. package/dist-lib/lib/assistant-client.d.ts +21 -0
  72. package/dist-lib/lib/assistant-client.js +52 -0
  73. package/dist-lib/lib/assistant-tree.d.ts +50 -0
  74. package/dist-lib/lib/assistant-tree.js +184 -0
  75. package/dist-lib/lib/assistant.d.ts +425 -0
  76. package/dist-lib/lib/assistant.js +2706 -0
  77. package/dist-lib/lib/audio-format.d.ts +4 -0
  78. package/dist-lib/lib/audio-format.js +4 -0
  79. package/dist-lib/lib/chat-title.d.ts +5 -0
  80. package/dist-lib/lib/chat-title.js +58 -0
  81. package/dist-lib/lib/client.d.ts +25 -0
  82. package/dist-lib/lib/client.js +53 -0
  83. package/dist-lib/lib/collabora/convert.d.ts +9 -0
  84. package/dist-lib/lib/collabora/convert.js +62 -0
  85. package/dist-lib/lib/collabora/entry.d.ts +1 -0
  86. package/dist-lib/lib/collabora/entry.js +44 -0
  87. package/dist-lib/lib/collabora/protocol.d.ts +15 -0
  88. package/dist-lib/lib/collabora/protocol.js +24 -0
  89. package/dist-lib/lib/collabora/worker.d.ts +5 -0
  90. package/dist-lib/lib/collabora/worker.js +111 -0
  91. package/dist-lib/lib/compaction.d.ts +30 -0
  92. package/dist-lib/lib/compaction.js +95 -0
  93. package/dist-lib/lib/constants.d.ts +4 -0
  94. package/dist-lib/lib/constants.js +4 -0
  95. package/dist-lib/lib/core/agent.d.ts +15 -0
  96. package/dist-lib/lib/core/agent.js +149 -0
  97. package/dist-lib/lib/core/app-build.d.ts +7 -0
  98. package/dist-lib/lib/core/app-build.js +1 -0
  99. package/dist-lib/lib/core/approval-rules.d.ts +15 -0
  100. package/dist-lib/lib/core/approval-rules.js +41 -0
  101. package/dist-lib/lib/core/async-iterable.d.ts +13 -0
  102. package/dist-lib/lib/core/async-iterable.js +65 -0
  103. package/dist-lib/lib/core/attachment-link.d.ts +7 -0
  104. package/dist-lib/lib/core/attachment-link.js +6 -0
  105. package/dist-lib/lib/core/audio-attachment.d.ts +1 -0
  106. package/dist-lib/lib/core/audio-attachment.js +4 -0
  107. package/dist-lib/lib/core/blind-peers.d.ts +6 -0
  108. package/dist-lib/lib/core/blind-peers.js +13 -0
  109. package/dist-lib/lib/core/chat-activity.d.ts +7 -0
  110. package/dist-lib/lib/core/chat-activity.js +244 -0
  111. package/dist-lib/lib/core/chat-group.d.ts +14 -0
  112. package/dist-lib/lib/core/chat-group.js +79 -0
  113. package/dist-lib/lib/core/chat-search.d.ts +17 -0
  114. package/dist-lib/lib/core/chat-search.js +199 -0
  115. package/dist-lib/lib/core/chat.d.ts +37 -0
  116. package/dist-lib/lib/core/chat.js +196 -0
  117. package/dist-lib/lib/core/chunk.d.ts +61 -0
  118. package/dist-lib/lib/core/chunk.js +212 -0
  119. package/dist-lib/lib/core/contract/activity.d.ts +11 -0
  120. package/dist-lib/lib/core/contract/activity.js +45 -0
  121. package/dist-lib/lib/core/contract/agents.d.ts +2 -0
  122. package/dist-lib/lib/core/contract/agents.js +29 -0
  123. package/dist-lib/lib/core/contract/approval-rules.d.ts +2 -0
  124. package/dist-lib/lib/core/contract/approval-rules.js +14 -0
  125. package/dist-lib/lib/core/contract/attestations.d.ts +2 -0
  126. package/dist-lib/lib/core/contract/attestations.js +14 -0
  127. package/dist-lib/lib/core/contract/chat-group.d.ts +2 -0
  128. package/dist-lib/lib/core/contract/chat-group.js +20 -0
  129. package/dist-lib/lib/core/contract/chat.d.ts +2 -0
  130. package/dist-lib/lib/core/contract/chat.js +18 -0
  131. package/dist-lib/lib/core/contract/chunks.d.ts +2 -0
  132. package/dist-lib/lib/core/contract/chunks.js +156 -0
  133. package/dist-lib/lib/core/contract/devices.d.ts +2 -0
  134. package/dist-lib/lib/core/contract/devices.js +110 -0
  135. package/dist-lib/lib/core/contract/index.d.ts +2 -0
  136. package/dist-lib/lib/core/contract/index.js +30 -0
  137. package/dist-lib/lib/core/contract/indexing.d.ts +4 -0
  138. package/dist-lib/lib/core/contract/indexing.js +82 -0
  139. package/dist-lib/lib/core/contract/knowledge.d.ts +2 -0
  140. package/dist-lib/lib/core/contract/knowledge.js +55 -0
  141. package/dist-lib/lib/core/contract/members.d.ts +2 -0
  142. package/dist-lib/lib/core/contract/members.js +96 -0
  143. package/dist-lib/lib/core/contract/seed-defaults.d.ts +2 -0
  144. package/dist-lib/lib/core/contract/seed-defaults.js +29 -0
  145. package/dist-lib/lib/core/contract/tool-activity.d.ts +2 -0
  146. package/dist-lib/lib/core/contract/tool-activity.js +25 -0
  147. package/dist-lib/lib/core/contract/tool-configs.d.ts +2 -0
  148. package/dist-lib/lib/core/contract/tool-configs.js +50 -0
  149. package/dist-lib/lib/core/contract/types.d.ts +11 -0
  150. package/dist-lib/lib/core/contract/types.js +1 -0
  151. package/dist-lib/lib/core/contract/writers.d.ts +2 -0
  152. package/dist-lib/lib/core/contract/writers.js +112 -0
  153. package/dist-lib/lib/core/cpu-info-node.d.ts +3 -0
  154. package/dist-lib/lib/core/cpu-info-node.js +2 -0
  155. package/dist-lib/lib/core/departures.d.ts +41 -0
  156. package/dist-lib/lib/core/departures.js +145 -0
  157. package/dist-lib/lib/core/device-attestation.d.ts +6 -0
  158. package/dist-lib/lib/core/device-attestation.js +12 -0
  159. package/dist-lib/lib/core/devices.d.ts +14 -0
  160. package/dist-lib/lib/core/devices.js +11 -0
  161. package/dist-lib/lib/core/document-attachment.d.ts +22 -0
  162. package/dist-lib/lib/core/document-attachment.js +35 -0
  163. package/dist-lib/lib/core/files/attachments.d.ts +8 -0
  164. package/dist-lib/lib/core/files/attachments.js +50 -0
  165. package/dist-lib/lib/core/files/index.d.ts +133 -0
  166. package/dist-lib/lib/core/files/index.js +585 -0
  167. package/dist-lib/lib/core/files/knowledge.d.ts +9 -0
  168. package/dist-lib/lib/core/files/knowledge.js +31 -0
  169. package/dist-lib/lib/core/files/preview/image.d.ts +4 -0
  170. package/dist-lib/lib/core/files/preview/image.js +42 -0
  171. package/dist-lib/lib/core/files/preview/index.d.ts +33 -0
  172. package/dist-lib/lib/core/files/preview/index.js +161 -0
  173. package/dist-lib/lib/core/files/processing/claims.d.ts +26 -0
  174. package/dist-lib/lib/core/files/processing/claims.js +89 -0
  175. package/dist-lib/lib/core/files/processing/document.d.ts +100 -0
  176. package/dist-lib/lib/core/files/processing/document.js +101 -0
  177. package/dist-lib/lib/core/files/processing/index.d.ts +75 -0
  178. package/dist-lib/lib/core/files/processing/index.js +295 -0
  179. package/dist-lib/lib/core/files/processing/ownership.d.ts +11 -0
  180. package/dist-lib/lib/core/files/processing/ownership.js +41 -0
  181. package/dist-lib/lib/core/files/processing/protocol.d.ts +29 -0
  182. package/dist-lib/lib/core/files/processing/protocol.js +70 -0
  183. package/dist-lib/lib/core/files/processing/settle.d.ts +10 -0
  184. package/dist-lib/lib/core/files/processing/settle.js +75 -0
  185. package/dist-lib/lib/core/files/processing/source.d.ts +36 -0
  186. package/dist-lib/lib/core/files/processing/source.js +96 -0
  187. package/dist-lib/lib/core/files/processing/state.d.ts +64 -0
  188. package/dist-lib/lib/core/files/processing/state.js +118 -0
  189. package/dist-lib/lib/core/files/rag/artifact/codec.d.ts +3 -0
  190. package/dist-lib/lib/core/files/rag/artifact/codec.js +172 -0
  191. package/dist-lib/lib/core/files/rag/artifact/id.d.ts +10 -0
  192. package/dist-lib/lib/core/files/rag/artifact/id.js +39 -0
  193. package/dist-lib/lib/core/files/rag/artifact/types.d.ts +24 -0
  194. package/dist-lib/lib/core/files/rag/artifact/types.js +41 -0
  195. package/dist-lib/lib/core/files/rag/build.d.ts +25 -0
  196. package/dist-lib/lib/core/files/rag/build.js +60 -0
  197. package/dist-lib/lib/core/files/rag/chunk/chunking.d.ts +12 -0
  198. package/dist-lib/lib/core/files/rag/chunk/chunking.js +117 -0
  199. package/dist-lib/lib/core/files/rag/chunk/metadata.d.ts +30 -0
  200. package/dist-lib/lib/core/files/rag/chunk/metadata.js +89 -0
  201. package/dist-lib/lib/core/files/rag/chunk/tokenizer.d.ts +7 -0
  202. package/dist-lib/lib/core/files/rag/chunk/tokenizer.js +18 -0
  203. package/dist-lib/lib/core/files/rag/document-types.d.ts +11 -0
  204. package/dist-lib/lib/core/files/rag/document-types.js +94 -0
  205. package/dist-lib/lib/core/files/rag/extract/csv-text.d.ts +1 -0
  206. package/dist-lib/lib/core/files/rag/extract/csv-text.js +117 -0
  207. package/dist-lib/lib/core/files/rag/extract/document-types.d.ts +22 -0
  208. package/dist-lib/lib/core/files/rag/extract/document-types.js +152 -0
  209. package/dist-lib/lib/core/files/rag/extract/extract.d.ts +17 -0
  210. package/dist-lib/lib/core/files/rag/extract/extract.js +81 -0
  211. package/dist-lib/lib/core/files/rag/extract/html-table-text.d.ts +1 -0
  212. package/dist-lib/lib/core/files/rag/extract/html-table-text.js +125 -0
  213. package/dist-lib/lib/core/files/rag/extract/html-text.d.ts +1 -0
  214. package/dist-lib/lib/core/files/rag/extract/html-text.js +132 -0
  215. package/dist-lib/lib/core/files/rag/extract/office-collabora.d.ts +2 -0
  216. package/dist-lib/lib/core/files/rag/extract/office-collabora.js +8 -0
  217. package/dist-lib/lib/core/files/rag/extract/pdf-platform.d.ts +17 -0
  218. package/dist-lib/lib/core/files/rag/extract/pdf-platform.js +141 -0
  219. package/dist-lib/lib/core/files/rag/extract/pdf-text.d.ts +12 -0
  220. package/dist-lib/lib/core/files/rag/extract/pdf-text.js +43 -0
  221. package/dist-lib/lib/core/files/rag/extract/rtf-text.d.ts +1 -0
  222. package/dist-lib/lib/core/files/rag/extract/rtf-text.js +15 -0
  223. package/dist-lib/lib/core/files/rag/extract/text-decoding.d.ts +1 -0
  224. package/dist-lib/lib/core/files/rag/extract/text-decoding.js +91 -0
  225. package/dist-lib/lib/core/files/rag/extract/types.d.ts +36 -0
  226. package/dist-lib/lib/core/files/rag/extract/types.js +12 -0
  227. package/dist-lib/lib/core/files/rag/extract/utf.d.ts +2 -0
  228. package/dist-lib/lib/core/files/rag/extract/utf.js +18 -0
  229. package/dist-lib/lib/core/files/rag/index.d.ts +54 -0
  230. package/dist-lib/lib/core/files/rag/index.js +79 -0
  231. package/dist-lib/lib/core/files/rag/limits.d.ts +2 -0
  232. package/dist-lib/lib/core/files/rag/limits.js +2 -0
  233. package/dist-lib/lib/core/files/rag/load.d.ts +28 -0
  234. package/dist-lib/lib/core/files/rag/load.js +250 -0
  235. package/dist-lib/lib/core/files/rag/models.d.ts +1 -0
  236. package/dist-lib/lib/core/files/rag/models.js +1 -0
  237. package/dist-lib/lib/core/files/rag/policy.d.ts +2 -0
  238. package/dist-lib/lib/core/files/rag/policy.js +23 -0
  239. package/dist-lib/lib/core/files/rag/produce.d.ts +21 -0
  240. package/dist-lib/lib/core/files/rag/produce.js +214 -0
  241. package/dist-lib/lib/core/files/rag/retrieval/citation-match.d.ts +2 -0
  242. package/dist-lib/lib/core/files/rag/retrieval/citation-match.js +16 -0
  243. package/dist-lib/lib/core/files/rag/retrieval/coverage.d.ts +4 -0
  244. package/dist-lib/lib/core/files/rag/retrieval/coverage.js +48 -0
  245. package/dist-lib/lib/core/files/rag/retrieval/diversity.d.ts +10 -0
  246. package/dist-lib/lib/core/files/rag/retrieval/diversity.js +37 -0
  247. package/dist-lib/lib/core/files/rag/retrieval/floor.d.ts +5 -0
  248. package/dist-lib/lib/core/files/rag/retrieval/floor.js +21 -0
  249. package/dist-lib/lib/core/files/rag/retrieval/format.d.ts +6 -0
  250. package/dist-lib/lib/core/files/rag/retrieval/format.js +21 -0
  251. package/dist-lib/lib/core/files/rag/retrieval/full-text.d.ts +22 -0
  252. package/dist-lib/lib/core/files/rag/retrieval/full-text.js +137 -0
  253. package/dist-lib/lib/core/files/rag/retrieval/knowledge.d.ts +2 -0
  254. package/dist-lib/lib/core/files/rag/retrieval/knowledge.js +53 -0
  255. package/dist-lib/lib/core/files/rag/retrieval/notices.d.ts +16 -0
  256. package/dist-lib/lib/core/files/rag/retrieval/notices.js +27 -0
  257. package/dist-lib/lib/core/files/rag/retrieval/scoring.d.ts +8 -0
  258. package/dist-lib/lib/core/files/rag/retrieval/scoring.js +82 -0
  259. package/dist-lib/lib/core/files/rag/retrieval/search.d.ts +3 -0
  260. package/dist-lib/lib/core/files/rag/retrieval/search.js +46 -0
  261. package/dist-lib/lib/core/files/rag/retrieval/selection.d.ts +10 -0
  262. package/dist-lib/lib/core/files/rag/retrieval/selection.js +63 -0
  263. package/dist-lib/lib/core/files/rag/retrieval/source-tag-filter.d.ts +6 -0
  264. package/dist-lib/lib/core/files/rag/retrieval/source-tag-filter.js +79 -0
  265. package/dist-lib/lib/core/files/rag/retrieval/sources.d.ts +13 -0
  266. package/dist-lib/lib/core/files/rag/retrieval/sources.js +20 -0
  267. package/dist-lib/lib/core/files/rag/retrieval/target.d.ts +13 -0
  268. package/dist-lib/lib/core/files/rag/retrieval/target.js +89 -0
  269. package/dist-lib/lib/core/files/rag/retrieval/terms.d.ts +8 -0
  270. package/dist-lib/lib/core/files/rag/retrieval/terms.js +70 -0
  271. package/dist-lib/lib/core/files/rag/retrieval/types.d.ts +28 -0
  272. package/dist-lib/lib/core/files/rag/retrieval/types.js +1 -0
  273. package/dist-lib/lib/core/files/rag/retrieval/web-sources.d.ts +8 -0
  274. package/dist-lib/lib/core/files/rag/retrieval/web-sources.js +41 -0
  275. package/dist-lib/lib/core/files/rag/retrieval/whole-document-query.d.ts +1 -0
  276. package/dist-lib/lib/core/files/rag/retrieval/whole-document-query.js +96 -0
  277. package/dist-lib/lib/core/files/rag/vector/memory.d.ts +15 -0
  278. package/dist-lib/lib/core/files/rag/vector/memory.js +135 -0
  279. package/dist-lib/lib/core/files/rag/vector/types.d.ts +28 -0
  280. package/dist-lib/lib/core/files/rag/vector/types.js +1 -0
  281. package/dist-lib/lib/core/files/records/chunks.d.ts +3 -0
  282. package/dist-lib/lib/core/files/records/chunks.js +12 -0
  283. package/dist-lib/lib/core/files/records/index.d.ts +10 -0
  284. package/dist-lib/lib/core/files/records/index.js +8 -0
  285. package/dist-lib/lib/core/files/records/knowledge.d.ts +22 -0
  286. package/dist-lib/lib/core/files/records/knowledge.js +105 -0
  287. package/dist-lib/lib/core/files/records/linkage.d.ts +11 -0
  288. package/dist-lib/lib/core/files/records/linkage.js +27 -0
  289. package/dist-lib/lib/core/files/records/output.d.ts +8 -0
  290. package/dist-lib/lib/core/files/records/output.js +38 -0
  291. package/dist-lib/lib/core/files/records/reclaim.d.ts +5 -0
  292. package/dist-lib/lib/core/files/records/reclaim.js +73 -0
  293. package/dist-lib/lib/core/files/records/routing.d.ts +23 -0
  294. package/dist-lib/lib/core/files/records/routing.js +62 -0
  295. package/dist-lib/lib/core/files/records/source.d.ts +16 -0
  296. package/dist-lib/lib/core/files/records/source.js +70 -0
  297. package/dist-lib/lib/core/files/records/sweep.d.ts +2 -0
  298. package/dist-lib/lib/core/files/records/sweep.js +30 -0
  299. package/dist-lib/lib/core/files/store/blob.d.ts +29 -0
  300. package/dist-lib/lib/core/files/store/blob.js +98 -0
  301. package/dist-lib/lib/core/files/store/index.d.ts +36 -0
  302. package/dist-lib/lib/core/files/store/index.js +89 -0
  303. package/dist-lib/lib/core/files/store/inline.d.ts +8 -0
  304. package/dist-lib/lib/core/files/store/inline.js +38 -0
  305. package/dist-lib/lib/core/files/store/reference.d.ts +27 -0
  306. package/dist-lib/lib/core/files/store/reference.js +168 -0
  307. package/dist-lib/lib/core/files/store/server.d.ts +27 -0
  308. package/dist-lib/lib/core/files/store/server.js +114 -0
  309. package/dist-lib/lib/core/files/store/sweep.d.ts +2 -0
  310. package/dist-lib/lib/core/files/store/sweep.js +45 -0
  311. package/dist-lib/lib/core/files/upload-input.d.ts +27 -0
  312. package/dist-lib/lib/core/files/upload-input.js +52 -0
  313. package/dist-lib/lib/core/files/upload.d.ts +32 -0
  314. package/dist-lib/lib/core/files/upload.js +201 -0
  315. package/dist-lib/lib/core/fs-drives.d.ts +18 -0
  316. package/dist-lib/lib/core/fs-drives.js +58 -0
  317. package/dist-lib/lib/core/gpu-info-node.d.ts +3 -0
  318. package/dist-lib/lib/core/gpu-info-node.js +2 -0
  319. package/dist-lib/lib/core/handoff-channel.d.ts +46 -0
  320. package/dist-lib/lib/core/handoff-channel.js +102 -0
  321. package/dist-lib/lib/core/health-assistant.d.ts +7 -0
  322. package/dist-lib/lib/core/health-assistant.js +24 -0
  323. package/dist-lib/lib/core/helpers/index.d.ts +5 -0
  324. package/dist-lib/lib/core/helpers/index.js +74 -0
  325. package/dist-lib/lib/core/hosted-agents.d.ts +36 -0
  326. package/dist-lib/lib/core/hosted-agents.js +127 -0
  327. package/dist-lib/lib/core/id.d.ts +1 -0
  328. package/dist-lib/lib/core/id.js +5 -0
  329. package/dist-lib/lib/core/identity.d.ts +14 -0
  330. package/dist-lib/lib/core/identity.js +45 -0
  331. package/dist-lib/lib/core/image/cache-sweep.d.ts +12 -0
  332. package/dist-lib/lib/core/image/cache-sweep.js +67 -0
  333. package/dist-lib/lib/core/image/normalize.d.ts +3 -0
  334. package/dist-lib/lib/core/image/normalize.js +49 -0
  335. package/dist-lib/lib/core/image/sniff.d.ts +3 -0
  336. package/dist-lib/lib/core/image/sniff.js +149 -0
  337. package/dist-lib/lib/core/invite.d.ts +14 -0
  338. package/dist-lib/lib/core/invite.js +36 -0
  339. package/dist-lib/lib/core/local/index.d.ts +71 -0
  340. package/dist-lib/lib/core/local/index.js +391 -0
  341. package/dist-lib/lib/core/membership.d.ts +15 -0
  342. package/dist-lib/lib/core/membership.js +40 -0
  343. package/dist-lib/lib/core/mesh.d.ts +153 -0
  344. package/dist-lib/lib/core/mesh.js +509 -0
  345. package/dist-lib/lib/core/migrations/agent-catalog.d.ts +6 -0
  346. package/dist-lib/lib/core/migrations/agent-catalog.js +17 -0
  347. package/dist-lib/lib/core/migrations/index.d.ts +5 -0
  348. package/dist-lib/lib/core/migrations/index.js +7 -0
  349. package/dist-lib/lib/core/migrations/membership.d.ts +11 -0
  350. package/dist-lib/lib/core/migrations/membership.js +26 -0
  351. package/dist-lib/lib/core/min-version.d.ts +6 -0
  352. package/dist-lib/lib/core/min-version.js +31 -0
  353. package/dist-lib/lib/core/next-frame.d.ts +6 -0
  354. package/dist-lib/lib/core/next-frame.js +27 -0
  355. package/dist-lib/lib/core/notification.d.ts +6 -0
  356. package/dist-lib/lib/core/notification.js +162 -0
  357. package/dist-lib/lib/core/ota-config.d.ts +19 -0
  358. package/dist-lib/lib/core/ota-config.js +44 -0
  359. package/dist-lib/lib/core/prompt-history.d.ts +12 -0
  360. package/dist-lib/lib/core/prompt-history.js +40 -0
  361. package/dist-lib/lib/core/search-fold.d.ts +1 -0
  362. package/dist-lib/lib/core/search-fold.js +4 -0
  363. package/dist-lib/lib/core/secret-handoff.d.ts +17 -0
  364. package/dist-lib/lib/core/secret-handoff.js +29 -0
  365. package/dist-lib/lib/core/send.d.ts +18 -0
  366. package/dist-lib/lib/core/send.js +46 -0
  367. package/dist-lib/lib/core/skill-overlay-handoff.d.ts +25 -0
  368. package/dist-lib/lib/core/skill-overlay-handoff.js +50 -0
  369. package/dist-lib/lib/core/skill-overlay-receiver.d.ts +8 -0
  370. package/dist-lib/lib/core/skill-overlay-receiver.js +20 -0
  371. package/dist-lib/lib/core/skill-secrets.d.ts +25 -0
  372. package/dist-lib/lib/core/skill-secrets.js +79 -0
  373. package/dist-lib/lib/core/sync/chats.d.ts +3 -0
  374. package/dist-lib/lib/core/sync/chats.js +5 -0
  375. package/dist-lib/lib/core/sync/chunks.d.ts +9 -0
  376. package/dist-lib/lib/core/sync/chunks.js +16 -0
  377. package/dist-lib/lib/core/sync/devices.d.ts +4 -0
  378. package/dist-lib/lib/core/sync/devices.js +12 -0
  379. package/dist-lib/lib/core/sync/files.d.ts +16 -0
  380. package/dist-lib/lib/core/sync/files.js +109 -0
  381. package/dist-lib/lib/core/sync/index.d.ts +5 -0
  382. package/dist-lib/lib/core/sync/index.js +63 -0
  383. package/dist-lib/lib/core/sync-status.d.ts +17 -0
  384. package/dist-lib/lib/core/sync-status.js +129 -0
  385. package/dist-lib/lib/core/system-info.d.ts +24 -0
  386. package/dist-lib/lib/core/system-info.js +66 -0
  387. package/dist-lib/lib/core/tool-activity.d.ts +22 -0
  388. package/dist-lib/lib/core/tool-activity.js +39 -0
  389. package/dist-lib/lib/core/tool-configs.d.ts +13 -0
  390. package/dist-lib/lib/core/tool-configs.js +141 -0
  391. package/dist-lib/lib/core.d.ts +291 -0
  392. package/dist-lib/lib/core.js +2126 -0
  393. package/dist-lib/lib/credential-pusher.d.ts +67 -0
  394. package/dist-lib/lib/credential-pusher.js +290 -0
  395. package/dist-lib/lib/custom-model-pusher.d.ts +9 -0
  396. package/dist-lib/lib/custom-model-pusher.js +42 -0
  397. package/dist-lib/lib/custom-model-source.d.ts +15 -0
  398. package/dist-lib/lib/custom-model-source.js +46 -0
  399. package/dist-lib/lib/deadline.d.ts +9 -0
  400. package/dist-lib/lib/deadline.js +31 -0
  401. package/dist-lib/lib/diagnostics.d.ts +35 -0
  402. package/dist-lib/lib/diagnostics.js +14 -0
  403. package/dist-lib/lib/fetch-node.d.ts +1 -0
  404. package/dist-lib/lib/fetch-node.js +1 -0
  405. package/dist-lib/lib/fs-drive-bridge.d.ts +12 -0
  406. package/dist-lib/lib/fs-drive-bridge.js +186 -0
  407. package/dist-lib/lib/fs-grant-keys.d.ts +2 -0
  408. package/dist-lib/lib/fs-grant-keys.js +6 -0
  409. package/dist-lib/lib/fs-grants.d.ts +10 -0
  410. package/dist-lib/lib/fs-grants.js +44 -0
  411. package/dist-lib/lib/image-cache-dir.d.ts +1 -0
  412. package/dist-lib/lib/image-cache-dir.js +5 -0
  413. package/dist-lib/lib/integrations/index.d.ts +4 -0
  414. package/dist-lib/lib/integrations/index.js +3 -0
  415. package/dist-lib/lib/integrations/mcp-providers.d.ts +12 -0
  416. package/dist-lib/lib/integrations/mcp-providers.js +22 -0
  417. package/dist-lib/lib/integrations/oauth-providers.d.ts +14 -0
  418. package/dist-lib/lib/integrations/oauth-providers.js +116 -0
  419. package/dist-lib/lib/integrations/setup-routes.d.ts +12 -0
  420. package/dist-lib/lib/integrations/setup-routes.js +114 -0
  421. package/dist-lib/lib/knowledge-search.d.ts +7 -0
  422. package/dist-lib/lib/knowledge-search.js +53 -0
  423. package/dist-lib/lib/kv-cache-reclaim.d.ts +5 -0
  424. package/dist-lib/lib/kv-cache-reclaim.js +29 -0
  425. package/dist-lib/lib/kv-cache.d.ts +18 -0
  426. package/dist-lib/lib/kv-cache.js +33 -0
  427. package/dist-lib/lib/legacy-core-domain.d.ts +258 -0
  428. package/dist-lib/lib/legacy-core-domain.js +1 -0
  429. package/dist-lib/lib/llm-model-names.d.ts +1 -0
  430. package/dist-lib/lib/llm-model-names.js +1 -0
  431. package/dist-lib/lib/log-buffer.d.ts +7 -0
  432. package/dist-lib/lib/log-buffer.js +16 -0
  433. package/dist-lib/lib/log-levels.d.ts +7 -0
  434. package/dist-lib/lib/log-levels.js +1 -0
  435. package/dist-lib/lib/log.d.ts +60 -0
  436. package/dist-lib/lib/log.js +149 -0
  437. package/dist-lib/lib/logger-type.d.ts +13 -0
  438. package/dist-lib/lib/logger-type.js +1 -0
  439. package/dist-lib/lib/logger.d.ts +5 -0
  440. package/dist-lib/lib/logger.js +18 -0
  441. package/dist-lib/lib/model-catalog-revision.d.ts +9 -0
  442. package/dist-lib/lib/model-catalog-revision.js +65 -0
  443. package/dist-lib/lib/model-clamp.d.ts +6 -0
  444. package/dist-lib/lib/model-clamp.js +20 -0
  445. package/dist-lib/lib/model-context.d.ts +13 -0
  446. package/dist-lib/lib/model-context.js +71 -0
  447. package/dist-lib/lib/model-download-status.d.ts +29 -0
  448. package/dist-lib/lib/model-download-status.js +56 -0
  449. package/dist-lib/lib/model-download.d.ts +191 -0
  450. package/dist-lib/lib/model-download.js +787 -0
  451. package/dist-lib/lib/oauth/asana.d.ts +35 -0
  452. package/dist-lib/lib/oauth/asana.js +71 -0
  453. package/dist-lib/lib/oauth/browser-connect.d.ts +22 -0
  454. package/dist-lib/lib/oauth/browser-connect.js +83 -0
  455. package/dist-lib/lib/oauth/client.d.ts +9 -0
  456. package/dist-lib/lib/oauth/client.js +9 -0
  457. package/dist-lib/lib/oauth/common.d.ts +38 -0
  458. package/dist-lib/lib/oauth/common.js +36 -0
  459. package/dist-lib/lib/oauth/crypto.d.ts +3 -0
  460. package/dist-lib/lib/oauth/crypto.js +25 -0
  461. package/dist-lib/lib/oauth/fetch-platform.d.ts +1 -0
  462. package/dist-lib/lib/oauth/fetch-platform.js +1 -0
  463. package/dist-lib/lib/oauth/flow-core.d.ts +6 -0
  464. package/dist-lib/lib/oauth/flow-core.js +37 -0
  465. package/dist-lib/lib/oauth/flow.d.ts +3 -0
  466. package/dist-lib/lib/oauth/flow.js +24 -0
  467. package/dist-lib/lib/oauth/google.d.ts +37 -0
  468. package/dist-lib/lib/oauth/google.js +77 -0
  469. package/dist-lib/lib/oauth/host.d.ts +5 -0
  470. package/dist-lib/lib/oauth/host.js +3 -0
  471. package/dist-lib/lib/oauth/keys.d.ts +25 -0
  472. package/dist-lib/lib/oauth/keys.js +93 -0
  473. package/dist-lib/lib/oauth/loopback.d.ts +3 -0
  474. package/dist-lib/lib/oauth/loopback.js +119 -0
  475. package/dist-lib/lib/oauth/loopback.stub.d.ts +3 -0
  476. package/dist-lib/lib/oauth/loopback.stub.js +6 -0
  477. package/dist-lib/lib/oauth/notion.d.ts +34 -0
  478. package/dist-lib/lib/oauth/notion.js +82 -0
  479. package/dist-lib/lib/oauth/pkce-runtime.d.ts +3 -0
  480. package/dist-lib/lib/oauth/pkce-runtime.js +5 -0
  481. package/dist-lib/lib/oauth/pkce.d.ts +8 -0
  482. package/dist-lib/lib/oauth/pkce.js +6 -0
  483. package/dist-lib/lib/oauth/providers.d.ts +5 -0
  484. package/dist-lib/lib/oauth/providers.js +73 -0
  485. package/dist-lib/lib/oauth/redirect-types.d.ts +19 -0
  486. package/dist-lib/lib/oauth/redirect-types.js +1 -0
  487. package/dist-lib/lib/oauth/register.d.ts +3 -0
  488. package/dist-lib/lib/oauth/register.js +34 -0
  489. package/dist-lib/lib/oauth/resolve.d.ts +17 -0
  490. package/dist-lib/lib/oauth/resolve.js +57 -0
  491. package/dist-lib/lib/oauth/spotify.d.ts +32 -0
  492. package/dist-lib/lib/oauth/spotify.js +73 -0
  493. package/dist-lib/lib/oauth/token-exchange-core.d.ts +6 -0
  494. package/dist-lib/lib/oauth/token-exchange-core.js +97 -0
  495. package/dist-lib/lib/oauth/token-exchange.d.ts +5 -0
  496. package/dist-lib/lib/oauth/token-exchange.js +9 -0
  497. package/dist-lib/lib/oauth/types.d.ts +54 -0
  498. package/dist-lib/lib/oauth/types.js +1 -0
  499. package/dist-lib/lib/oauth.client.d.ts +5 -0
  500. package/dist-lib/lib/oauth.client.js +2 -0
  501. package/dist-lib/lib/oauth.d.ts +14 -0
  502. package/dist-lib/lib/oauth.js +12 -0
  503. package/dist-lib/lib/obsidian-key.d.ts +1 -0
  504. package/dist-lib/lib/obsidian-key.js +1 -0
  505. package/dist-lib/lib/race-resource.d.ts +5 -0
  506. package/dist-lib/lib/race-resource.js +25 -0
  507. package/dist-lib/lib/reconnecting-watch.d.ts +2 -0
  508. package/dist-lib/lib/reconnecting-watch.js +78 -0
  509. package/dist-lib/lib/retry-budget.d.ts +14 -0
  510. package/dist-lib/lib/retry-budget.js +39 -0
  511. package/dist-lib/lib/run-notices.d.ts +23 -0
  512. package/dist-lib/lib/run-notices.js +33 -0
  513. package/dist-lib/lib/run-transcript.d.ts +35 -0
  514. package/dist-lib/lib/run-transcript.js +106 -0
  515. package/dist-lib/lib/skill-readiness.d.ts +2 -0
  516. package/dist-lib/lib/skill-readiness.js +21 -0
  517. package/dist-lib/lib/skill-types.d.ts +70 -0
  518. package/dist-lib/lib/skill-types.js +1 -0
  519. package/dist-lib/lib/spec-loader.d.ts +14 -0
  520. package/dist-lib/lib/spec-loader.js +9 -0
  521. package/dist-lib/lib/suspend-lifecycle.d.ts +17 -0
  522. package/dist-lib/lib/suspend-lifecycle.js +33 -0
  523. package/dist-lib/lib/task.d.ts +26 -0
  524. package/dist-lib/lib/task.js +69 -0
  525. package/dist-lib/lib/unref.d.ts +3 -0
  526. package/dist-lib/lib/unref.js +4 -0
  527. package/dist-lib/lib/wav-duration.d.ts +1 -0
  528. package/dist-lib/lib/wav-duration.js +53 -0
  529. package/dist-lib/lib/write-queue.d.ts +22 -0
  530. package/dist-lib/lib/write-queue.js +39 -0
  531. package/dist-lib/schema/build.d.ts +1 -0
  532. package/dist-lib/schema/build.js +120 -0
  533. package/dist-lib/schema/config.d.ts +4 -0
  534. package/dist-lib/schema/config.js +7 -0
  535. package/dist-lib/schema/content.d.ts +20 -0
  536. package/dist-lib/schema/content.js +122 -0
  537. package/dist-lib/schema/engine.d.ts +2 -0
  538. package/dist-lib/schema/engine.js +2013 -0
  539. package/dist-lib/schema/field-order.d.ts +1 -0
  540. package/dist-lib/schema/field-order.js +95 -0
  541. package/dist-lib/schema/local.d.ts +2 -0
  542. package/dist-lib/schema/local.js +133 -0
  543. package/dist-lib/schema/qvac.d.ts +22 -0
  544. package/dist-lib/schema/qvac.js +722 -0
  545. package/dist-lib/spec/bind.d.ts +2 -0
  546. package/dist-lib/spec/bind.js +520 -0
  547. package/dist-lib/spec/calls.d.ts +3 -0
  548. package/dist-lib/spec/calls.js +129 -0
  549. package/dist-lib/spec/capabilities.d.ts +263 -0
  550. package/dist-lib/spec/config/hyperconf/index.d.ts +15 -0
  551. package/dist-lib/spec/config/hyperconf/index.js +24 -0
  552. package/dist-lib/spec/config/hyperconf/package.json +3 -0
  553. package/dist-lib/spec/config/hyperschema/index.js +81 -0
  554. package/dist-lib/spec/config/hyperschema/schema.json +19 -0
  555. package/dist-lib/spec/hrpc/hrpc.json +1500 -0
  556. package/dist-lib/spec/hrpc/index.d.ts +3 -0
  557. package/dist-lib/spec/hrpc/index.js +1545 -0
  558. package/dist-lib/spec/hrpc/messages.d.ts +4 -0
  559. package/dist-lib/spec/hrpc/messages.js +8373 -0
  560. package/dist-lib/spec/hyperschema/index.d.ts +20 -0
  561. package/dist-lib/spec/hyperschema/index.js +8373 -0
  562. package/dist-lib/spec/hyperschema/schema.json +6202 -0
  563. package/dist-lib/spec/hyperschema/types.d.ts +1545 -0
  564. package/dist-lib/spec/index.d.ts +36 -0
  565. package/dist-lib/spec/index.js +6 -0
  566. package/dist-lib/spec/local/hyperdb/db.json +186 -0
  567. package/dist-lib/spec/local/hyperdb/index.d.ts +9 -0
  568. package/dist-lib/spec/local/hyperdb/index.js +855 -0
  569. package/dist-lib/spec/local/hyperdb/messages.js +2189 -0
  570. package/dist-lib/spec/local/hyperschema/index.js +1208 -0
  571. package/dist-lib/spec/local/hyperschema/schema.json +639 -0
  572. package/dist-lib/spec/local/hyperschema/types.d.ts +159 -0
  573. package/dist-lib/spec/mesh/hyperdb/db.json +702 -0
  574. package/dist-lib/spec/mesh/hyperdb/index.d.ts +9 -0
  575. package/dist-lib/spec/mesh/hyperdb/index.js +2260 -0
  576. package/dist-lib/spec/mesh/hyperdb/messages.js +7453 -0
  577. package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +174 -0
  578. package/dist-lib/spec/mesh/hyperdispatch/index.d.ts +13 -0
  579. package/dist-lib/spec/mesh/hyperdispatch/index.js +566 -0
  580. package/dist-lib/spec/mesh/hyperdispatch/messages.js +5713 -0
  581. package/dist-lib/spec/mesh/hyperschema/index.d.ts +14 -0
  582. package/dist-lib/spec/mesh/hyperschema/index.js +5713 -0
  583. package/dist-lib/spec/mesh/hyperschema/schema.json +3142 -0
  584. package/dist-lib/spec/mesh/hyperschema/types.d.ts +754 -0
  585. package/ducks.png +0 -0
  586. package/package.json +332 -1
@@ -0,0 +1,2260 @@
1
+ // This file is autogenerated by the hyperdb compiler
2
+ /* eslint-disable camelcase */
3
+
4
+ import { IndexEncoder, c, b4a } from 'hyperdb/runtime'
5
+ import { version, getEncoding, setVersion } from './messages.js'
6
+
7
+ const versions = { schema: version, db: 4 }
8
+
9
+ import * as helpers0 from '../../../schema/helpers.js'
10
+
11
+ // '@qvac/chunks' collection key
12
+ const collection0_key = new IndexEncoder([
13
+ IndexEncoder.STRING
14
+ ], { prefix: 0 })
15
+
16
+ function collection0_indexify (record) {
17
+ const a = record.id
18
+ return a === undefined ? [] : [a]
19
+ }
20
+
21
+ // '@qvac/chunks' value encoding
22
+ const collection0_enc = getEncoding('@qvac/chunk/hyperdb#0')
23
+
24
+ // '@qvac/chunks' reconstruction function
25
+ function collection0_reconstruct (schemaVersion, keyBuf, valueBuf) {
26
+ const key = collection0_key.decode(keyBuf)
27
+ setVersion(schemaVersion)
28
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
29
+ const type = c.uint.decode(state)
30
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
31
+ collection0.decodedVersion = c.uint.decode(state)
32
+ const record = collection0_enc.decode(state)
33
+ record.id = key[0]
34
+ return record
35
+ }
36
+ // '@qvac/chunks' key reconstruction function
37
+ function collection0_reconstruct_key (keyBuf) {
38
+ const key = collection0_key.decode(keyBuf)
39
+ return {
40
+ id: key[0]
41
+ }
42
+ }
43
+
44
+ // '@qvac/chunks'
45
+ const collection0 = {
46
+ name: '@qvac/chunks',
47
+ id: 0,
48
+ version: 2,
49
+ encodeKey (record) {
50
+ const key = [record.id]
51
+ return collection0_key.encode(key)
52
+ },
53
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
54
+ return collection0_key.encodeRange({
55
+ gt: gt ? collection0_indexify(gt) : null,
56
+ lt: lt ? collection0_indexify(lt) : null,
57
+ gte: gte ? collection0_indexify(gte) : null,
58
+ lte: lte ? collection0_indexify(lte) : null
59
+ })
60
+ },
61
+ encodeValue (schemaVersion, collectionVersion, record) {
62
+ setVersion(schemaVersion)
63
+ const state = { start: 0, end: 2, buffer: null }
64
+ collection0_enc.preencode(state, record)
65
+ state.buffer = b4a.allocUnsafe(state.end)
66
+ state.buffer[state.start++] = 0
67
+ state.buffer[state.start++] = collectionVersion
68
+ collection0_enc.encode(state, record)
69
+ return state.buffer
70
+ },
71
+ trigger: null,
72
+ reconstruct: collection0_reconstruct,
73
+ reconstructKey: collection0_reconstruct_key,
74
+ indexes: [],
75
+ decodedVersion: 0
76
+ }
77
+
78
+ // '@qvac/chunk-counters' collection key
79
+ const collection1_key = new IndexEncoder([
80
+ IndexEncoder.STRING
81
+ ], { prefix: 1 })
82
+
83
+ function collection1_indexify (record) {
84
+ const a = record.chatId
85
+ return a === undefined ? [] : [a]
86
+ }
87
+
88
+ // '@qvac/chunk-counters' value encoding
89
+ const collection1_enc = getEncoding('@qvac/chunk-counter/hyperdb#1')
90
+
91
+ // '@qvac/chunk-counters' reconstruction function
92
+ function collection1_reconstruct (schemaVersion, keyBuf, valueBuf) {
93
+ const key = collection1_key.decode(keyBuf)
94
+ setVersion(schemaVersion)
95
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
96
+ const type = c.uint.decode(state)
97
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
98
+ collection1.decodedVersion = c.uint.decode(state)
99
+ const record = collection1_enc.decode(state)
100
+ record.chatId = key[0]
101
+ return record
102
+ }
103
+ // '@qvac/chunk-counters' key reconstruction function
104
+ function collection1_reconstruct_key (keyBuf) {
105
+ const key = collection1_key.decode(keyBuf)
106
+ return {
107
+ chatId: key[0]
108
+ }
109
+ }
110
+
111
+ // '@qvac/chunk-counters'
112
+ const collection1 = {
113
+ name: '@qvac/chunk-counters',
114
+ id: 1,
115
+ version: 1,
116
+ encodeKey (record) {
117
+ const key = [record.chatId]
118
+ return collection1_key.encode(key)
119
+ },
120
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
121
+ return collection1_key.encodeRange({
122
+ gt: gt ? collection1_indexify(gt) : null,
123
+ lt: lt ? collection1_indexify(lt) : null,
124
+ gte: gte ? collection1_indexify(gte) : null,
125
+ lte: lte ? collection1_indexify(lte) : null
126
+ })
127
+ },
128
+ encodeValue (schemaVersion, collectionVersion, record) {
129
+ setVersion(schemaVersion)
130
+ const state = { start: 0, end: 2, buffer: null }
131
+ collection1_enc.preencode(state, record)
132
+ state.buffer = b4a.allocUnsafe(state.end)
133
+ state.buffer[state.start++] = 0
134
+ state.buffer[state.start++] = collectionVersion
135
+ collection1_enc.encode(state, record)
136
+ return state.buffer
137
+ },
138
+ trigger: null,
139
+ reconstruct: collection1_reconstruct,
140
+ reconstructKey: collection1_reconstruct_key,
141
+ indexes: [],
142
+ decodedVersion: 0
143
+ }
144
+
145
+ // '@qvac/agents' collection key
146
+ const collection2_key = new IndexEncoder([
147
+ IndexEncoder.STRING
148
+ ], { prefix: 2 })
149
+
150
+ function collection2_indexify (record) {
151
+ const a = record.id
152
+ return a === undefined ? [] : [a]
153
+ }
154
+
155
+ // '@qvac/agents' value encoding
156
+ const collection2_enc = getEncoding('@qvac/agent/hyperdb#2')
157
+
158
+ // '@qvac/agents' reconstruction function
159
+ function collection2_reconstruct (schemaVersion, keyBuf, valueBuf) {
160
+ const key = collection2_key.decode(keyBuf)
161
+ setVersion(schemaVersion)
162
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
163
+ const type = c.uint.decode(state)
164
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
165
+ collection2.decodedVersion = c.uint.decode(state)
166
+ const record = collection2_enc.decode(state)
167
+ record.id = key[0]
168
+ return record
169
+ }
170
+ // '@qvac/agents' key reconstruction function
171
+ function collection2_reconstruct_key (keyBuf) {
172
+ const key = collection2_key.decode(keyBuf)
173
+ return {
174
+ id: key[0]
175
+ }
176
+ }
177
+
178
+ // '@qvac/agents'
179
+ const collection2 = {
180
+ name: '@qvac/agents',
181
+ id: 2,
182
+ version: 1,
183
+ encodeKey (record) {
184
+ const key = [record.id]
185
+ return collection2_key.encode(key)
186
+ },
187
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
188
+ return collection2_key.encodeRange({
189
+ gt: gt ? collection2_indexify(gt) : null,
190
+ lt: lt ? collection2_indexify(lt) : null,
191
+ gte: gte ? collection2_indexify(gte) : null,
192
+ lte: lte ? collection2_indexify(lte) : null
193
+ })
194
+ },
195
+ encodeValue (schemaVersion, collectionVersion, record) {
196
+ setVersion(schemaVersion)
197
+ const state = { start: 0, end: 2, buffer: null }
198
+ collection2_enc.preencode(state, record)
199
+ state.buffer = b4a.allocUnsafe(state.end)
200
+ state.buffer[state.start++] = 0
201
+ state.buffer[state.start++] = collectionVersion
202
+ collection2_enc.encode(state, record)
203
+ return state.buffer
204
+ },
205
+ trigger: null,
206
+ reconstruct: collection2_reconstruct,
207
+ reconstructKey: collection2_reconstruct_key,
208
+ indexes: [],
209
+ decodedVersion: 0
210
+ }
211
+
212
+ // '@qvac/approval-rules' collection key
213
+ const collection3_key = new IndexEncoder([
214
+ IndexEncoder.STRING
215
+ ], { prefix: 3 })
216
+
217
+ function collection3_indexify (record) {
218
+ const a = record.id
219
+ return a === undefined ? [] : [a]
220
+ }
221
+
222
+ // '@qvac/approval-rules' value encoding
223
+ const collection3_enc = getEncoding('@qvac/approval-rule/hyperdb#3')
224
+
225
+ // '@qvac/approval-rules' reconstruction function
226
+ function collection3_reconstruct (schemaVersion, keyBuf, valueBuf) {
227
+ const key = collection3_key.decode(keyBuf)
228
+ setVersion(schemaVersion)
229
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
230
+ const type = c.uint.decode(state)
231
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
232
+ collection3.decodedVersion = c.uint.decode(state)
233
+ const record = collection3_enc.decode(state)
234
+ record.id = key[0]
235
+ return record
236
+ }
237
+ // '@qvac/approval-rules' key reconstruction function
238
+ function collection3_reconstruct_key (keyBuf) {
239
+ const key = collection3_key.decode(keyBuf)
240
+ return {
241
+ id: key[0]
242
+ }
243
+ }
244
+
245
+ // '@qvac/approval-rules'
246
+ const collection3 = {
247
+ name: '@qvac/approval-rules',
248
+ id: 3,
249
+ version: 1,
250
+ encodeKey (record) {
251
+ const key = [record.id]
252
+ return collection3_key.encode(key)
253
+ },
254
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
255
+ return collection3_key.encodeRange({
256
+ gt: gt ? collection3_indexify(gt) : null,
257
+ lt: lt ? collection3_indexify(lt) : null,
258
+ gte: gte ? collection3_indexify(gte) : null,
259
+ lte: lte ? collection3_indexify(lte) : null
260
+ })
261
+ },
262
+ encodeValue (schemaVersion, collectionVersion, record) {
263
+ setVersion(schemaVersion)
264
+ const state = { start: 0, end: 2, buffer: null }
265
+ collection3_enc.preencode(state, record)
266
+ state.buffer = b4a.allocUnsafe(state.end)
267
+ state.buffer[state.start++] = 0
268
+ state.buffer[state.start++] = collectionVersion
269
+ collection3_enc.encode(state, record)
270
+ return state.buffer
271
+ },
272
+ trigger: null,
273
+ reconstruct: collection3_reconstruct,
274
+ reconstructKey: collection3_reconstruct_key,
275
+ indexes: [],
276
+ decodedVersion: 0
277
+ }
278
+
279
+ // '@qvac/chats' collection key
280
+ const collection4_key = new IndexEncoder([
281
+ IndexEncoder.STRING
282
+ ], { prefix: 4 })
283
+
284
+ function collection4_indexify (record) {
285
+ const a = record.id
286
+ return a === undefined ? [] : [a]
287
+ }
288
+
289
+ // '@qvac/chats' value encoding
290
+ const collection4_enc = getEncoding('@qvac/chat/hyperdb#4')
291
+
292
+ // '@qvac/chats' reconstruction function
293
+ function collection4_reconstruct (schemaVersion, keyBuf, valueBuf) {
294
+ const key = collection4_key.decode(keyBuf)
295
+ setVersion(schemaVersion)
296
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
297
+ const type = c.uint.decode(state)
298
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
299
+ collection4.decodedVersion = c.uint.decode(state)
300
+ const record = collection4_enc.decode(state)
301
+ record.id = key[0]
302
+ return record
303
+ }
304
+ // '@qvac/chats' key reconstruction function
305
+ function collection4_reconstruct_key (keyBuf) {
306
+ const key = collection4_key.decode(keyBuf)
307
+ return {
308
+ id: key[0]
309
+ }
310
+ }
311
+
312
+ // '@qvac/chats'
313
+ const collection4 = {
314
+ name: '@qvac/chats',
315
+ id: 4,
316
+ version: 1,
317
+ encodeKey (record) {
318
+ const key = [record.id]
319
+ return collection4_key.encode(key)
320
+ },
321
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
322
+ return collection4_key.encodeRange({
323
+ gt: gt ? collection4_indexify(gt) : null,
324
+ lt: lt ? collection4_indexify(lt) : null,
325
+ gte: gte ? collection4_indexify(gte) : null,
326
+ lte: lte ? collection4_indexify(lte) : null
327
+ })
328
+ },
329
+ encodeValue (schemaVersion, collectionVersion, record) {
330
+ setVersion(schemaVersion)
331
+ const state = { start: 0, end: 2, buffer: null }
332
+ collection4_enc.preencode(state, record)
333
+ state.buffer = b4a.allocUnsafe(state.end)
334
+ state.buffer[state.start++] = 0
335
+ state.buffer[state.start++] = collectionVersion
336
+ collection4_enc.encode(state, record)
337
+ return state.buffer
338
+ },
339
+ trigger: null,
340
+ reconstruct: collection4_reconstruct,
341
+ reconstructKey: collection4_reconstruct_key,
342
+ indexes: [],
343
+ decodedVersion: 0
344
+ }
345
+
346
+ // '@qvac/devices' collection key
347
+ const collection5_key = new IndexEncoder([
348
+ IndexEncoder.BUFFER
349
+ ], { prefix: 5 })
350
+
351
+ function collection5_indexify (record) {
352
+ const a = record.id
353
+ return a === undefined ? [] : [a]
354
+ }
355
+
356
+ // '@qvac/devices' value encoding
357
+ const collection5_enc = getEncoding('@qvac/device/hyperdb#5')
358
+
359
+ // '@qvac/devices' reconstruction function
360
+ function collection5_reconstruct (schemaVersion, keyBuf, valueBuf) {
361
+ const key = collection5_key.decode(keyBuf)
362
+ setVersion(schemaVersion)
363
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
364
+ const type = c.uint.decode(state)
365
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
366
+ collection5.decodedVersion = c.uint.decode(state)
367
+ const record = collection5_enc.decode(state)
368
+ record.id = key[0]
369
+ return record
370
+ }
371
+ // '@qvac/devices' key reconstruction function
372
+ function collection5_reconstruct_key (keyBuf) {
373
+ const key = collection5_key.decode(keyBuf)
374
+ return {
375
+ id: key[0]
376
+ }
377
+ }
378
+
379
+ // '@qvac/devices'
380
+ const collection5 = {
381
+ name: '@qvac/devices',
382
+ id: 5,
383
+ version: 3,
384
+ encodeKey (record) {
385
+ const key = [record.id]
386
+ return collection5_key.encode(key)
387
+ },
388
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
389
+ return collection5_key.encodeRange({
390
+ gt: gt ? collection5_indexify(gt) : null,
391
+ lt: lt ? collection5_indexify(lt) : null,
392
+ gte: gte ? collection5_indexify(gte) : null,
393
+ lte: lte ? collection5_indexify(lte) : null
394
+ })
395
+ },
396
+ encodeValue (schemaVersion, collectionVersion, record) {
397
+ setVersion(schemaVersion)
398
+ const state = { start: 0, end: 2, buffer: null }
399
+ collection5_enc.preencode(state, record)
400
+ state.buffer = b4a.allocUnsafe(state.end)
401
+ state.buffer[state.start++] = 0
402
+ state.buffer[state.start++] = collectionVersion
403
+ collection5_enc.encode(state, record)
404
+ return state.buffer
405
+ },
406
+ trigger: null,
407
+ reconstruct: collection5_reconstruct,
408
+ reconstructKey: collection5_reconstruct_key,
409
+ indexes: [],
410
+ decodedVersion: 0
411
+ }
412
+
413
+ // '@qvac/mesh-blind-peers' collection key
414
+ const collection6_key = new IndexEncoder([
415
+ IndexEncoder.BUFFER
416
+ ], { prefix: 6 })
417
+
418
+ function collection6_indexify (record) {
419
+ const a = record.key
420
+ return a === undefined ? [] : [a]
421
+ }
422
+
423
+ // '@qvac/mesh-blind-peers' value encoding
424
+ const collection6_enc = getEncoding('@qvac/mesh-blind-peer/hyperdb#6')
425
+
426
+ // '@qvac/mesh-blind-peers' reconstruction function
427
+ function collection6_reconstruct (schemaVersion, keyBuf, valueBuf) {
428
+ const key = collection6_key.decode(keyBuf)
429
+ setVersion(schemaVersion)
430
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
431
+ const type = c.uint.decode(state)
432
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
433
+ collection6.decodedVersion = c.uint.decode(state)
434
+ const record = collection6_enc.decode(state)
435
+ record.key = key[0]
436
+ return record
437
+ }
438
+ // '@qvac/mesh-blind-peers' key reconstruction function
439
+ function collection6_reconstruct_key (keyBuf) {
440
+ const key = collection6_key.decode(keyBuf)
441
+ return {
442
+ key: key[0]
443
+ }
444
+ }
445
+
446
+ // '@qvac/mesh-blind-peers'
447
+ const collection6 = {
448
+ name: '@qvac/mesh-blind-peers',
449
+ id: 6,
450
+ version: 1,
451
+ encodeKey (record) {
452
+ const key = [record.key]
453
+ return collection6_key.encode(key)
454
+ },
455
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
456
+ return collection6_key.encodeRange({
457
+ gt: gt ? collection6_indexify(gt) : null,
458
+ lt: lt ? collection6_indexify(lt) : null,
459
+ gte: gte ? collection6_indexify(gte) : null,
460
+ lte: lte ? collection6_indexify(lte) : null
461
+ })
462
+ },
463
+ encodeValue (schemaVersion, collectionVersion, record) {
464
+ setVersion(schemaVersion)
465
+ const state = { start: 0, end: 2, buffer: null }
466
+ collection6_enc.preencode(state, record)
467
+ state.buffer = b4a.allocUnsafe(state.end)
468
+ state.buffer[state.start++] = 0
469
+ state.buffer[state.start++] = collectionVersion
470
+ collection6_enc.encode(state, record)
471
+ return state.buffer
472
+ },
473
+ trigger: null,
474
+ reconstruct: collection6_reconstruct,
475
+ reconstructKey: collection6_reconstruct_key,
476
+ indexes: [],
477
+ decodedVersion: 0
478
+ }
479
+
480
+ // '@qvac/knowledge' collection key
481
+ const collection7_key = new IndexEncoder([
482
+ IndexEncoder.STRING
483
+ ], { prefix: 7 })
484
+
485
+ function collection7_indexify (record) {
486
+ const a = record.id
487
+ return a === undefined ? [] : [a]
488
+ }
489
+
490
+ // '@qvac/knowledge' value encoding
491
+ const collection7_enc = getEncoding('@qvac/knowledge/hyperdb#7')
492
+
493
+ // '@qvac/knowledge' reconstruction function
494
+ function collection7_reconstruct (schemaVersion, keyBuf, valueBuf) {
495
+ const key = collection7_key.decode(keyBuf)
496
+ setVersion(schemaVersion)
497
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
498
+ const type = c.uint.decode(state)
499
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
500
+ collection7.decodedVersion = c.uint.decode(state)
501
+ const record = collection7_enc.decode(state)
502
+ record.id = key[0]
503
+ return record
504
+ }
505
+ // '@qvac/knowledge' key reconstruction function
506
+ function collection7_reconstruct_key (keyBuf) {
507
+ const key = collection7_key.decode(keyBuf)
508
+ return {
509
+ id: key[0]
510
+ }
511
+ }
512
+
513
+ // '@qvac/knowledge'
514
+ const collection7 = {
515
+ name: '@qvac/knowledge',
516
+ id: 7,
517
+ version: 1,
518
+ encodeKey (record) {
519
+ const key = [record.id]
520
+ return collection7_key.encode(key)
521
+ },
522
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
523
+ return collection7_key.encodeRange({
524
+ gt: gt ? collection7_indexify(gt) : null,
525
+ lt: lt ? collection7_indexify(lt) : null,
526
+ gte: gte ? collection7_indexify(gte) : null,
527
+ lte: lte ? collection7_indexify(lte) : null
528
+ })
529
+ },
530
+ encodeValue (schemaVersion, collectionVersion, record) {
531
+ setVersion(schemaVersion)
532
+ const state = { start: 0, end: 2, buffer: null }
533
+ collection7_enc.preencode(state, record)
534
+ state.buffer = b4a.allocUnsafe(state.end)
535
+ state.buffer[state.start++] = 0
536
+ state.buffer[state.start++] = collectionVersion
537
+ collection7_enc.encode(state, record)
538
+ return state.buffer
539
+ },
540
+ trigger: null,
541
+ reconstruct: collection7_reconstruct,
542
+ reconstructKey: collection7_reconstruct_key,
543
+ indexes: [],
544
+ decodedVersion: 0
545
+ }
546
+
547
+ // '@qvac/knowledge-artifacts' collection key
548
+ const collection8_key = new IndexEncoder([
549
+ IndexEncoder.STRING
550
+ ], { prefix: 8 })
551
+
552
+ function collection8_indexify (record) {
553
+ const a = record.id
554
+ return a === undefined ? [] : [a]
555
+ }
556
+
557
+ // '@qvac/knowledge-artifacts' value encoding
558
+ const collection8_enc = getEncoding('@qvac/knowledge-artifact/hyperdb#8')
559
+
560
+ // '@qvac/knowledge-artifacts' reconstruction function
561
+ function collection8_reconstruct (schemaVersion, keyBuf, valueBuf) {
562
+ const key = collection8_key.decode(keyBuf)
563
+ setVersion(schemaVersion)
564
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
565
+ const type = c.uint.decode(state)
566
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
567
+ collection8.decodedVersion = c.uint.decode(state)
568
+ const record = collection8_enc.decode(state)
569
+ record.id = key[0]
570
+ return record
571
+ }
572
+ // '@qvac/knowledge-artifacts' key reconstruction function
573
+ function collection8_reconstruct_key (keyBuf) {
574
+ const key = collection8_key.decode(keyBuf)
575
+ return {
576
+ id: key[0]
577
+ }
578
+ }
579
+
580
+ // '@qvac/knowledge-artifacts'
581
+ const collection8 = {
582
+ name: '@qvac/knowledge-artifacts',
583
+ id: 8,
584
+ version: 1,
585
+ encodeKey (record) {
586
+ const key = [record.id]
587
+ return collection8_key.encode(key)
588
+ },
589
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
590
+ return collection8_key.encodeRange({
591
+ gt: gt ? collection8_indexify(gt) : null,
592
+ lt: lt ? collection8_indexify(lt) : null,
593
+ gte: gte ? collection8_indexify(gte) : null,
594
+ lte: lte ? collection8_indexify(lte) : null
595
+ })
596
+ },
597
+ encodeValue (schemaVersion, collectionVersion, record) {
598
+ setVersion(schemaVersion)
599
+ const state = { start: 0, end: 2, buffer: null }
600
+ collection8_enc.preencode(state, record)
601
+ state.buffer = b4a.allocUnsafe(state.end)
602
+ state.buffer[state.start++] = 0
603
+ state.buffer[state.start++] = collectionVersion
604
+ collection8_enc.encode(state, record)
605
+ return state.buffer
606
+ },
607
+ trigger: null,
608
+ reconstruct: collection8_reconstruct,
609
+ reconstructKey: collection8_reconstruct_key,
610
+ indexes: [],
611
+ decodedVersion: 0
612
+ }
613
+
614
+ // '@qvac/indexing-status' collection key
615
+ const collection9_key = new IndexEncoder([
616
+ IndexEncoder.STRING
617
+ ], { prefix: 9 })
618
+
619
+ function collection9_indexify (record) {
620
+ const a = record.id
621
+ return a === undefined ? [] : [a]
622
+ }
623
+
624
+ // '@qvac/indexing-status' value encoding
625
+ const collection9_enc = getEncoding('@qvac/indexing-status/hyperdb#9')
626
+
627
+ // '@qvac/indexing-status' reconstruction function
628
+ function collection9_reconstruct (schemaVersion, keyBuf, valueBuf) {
629
+ const key = collection9_key.decode(keyBuf)
630
+ setVersion(schemaVersion)
631
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
632
+ const type = c.uint.decode(state)
633
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
634
+ collection9.decodedVersion = c.uint.decode(state)
635
+ const record = collection9_enc.decode(state)
636
+ record.id = key[0]
637
+ return record
638
+ }
639
+ // '@qvac/indexing-status' key reconstruction function
640
+ function collection9_reconstruct_key (keyBuf) {
641
+ const key = collection9_key.decode(keyBuf)
642
+ return {
643
+ id: key[0]
644
+ }
645
+ }
646
+
647
+ // '@qvac/indexing-status'
648
+ const collection9 = {
649
+ name: '@qvac/indexing-status',
650
+ id: 9,
651
+ version: 1,
652
+ encodeKey (record) {
653
+ const key = [record.id]
654
+ return collection9_key.encode(key)
655
+ },
656
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
657
+ return collection9_key.encodeRange({
658
+ gt: gt ? collection9_indexify(gt) : null,
659
+ lt: lt ? collection9_indexify(lt) : null,
660
+ gte: gte ? collection9_indexify(gte) : null,
661
+ lte: lte ? collection9_indexify(lte) : null
662
+ })
663
+ },
664
+ encodeValue (schemaVersion, collectionVersion, record) {
665
+ setVersion(schemaVersion)
666
+ const state = { start: 0, end: 2, buffer: null }
667
+ collection9_enc.preencode(state, record)
668
+ state.buffer = b4a.allocUnsafe(state.end)
669
+ state.buffer[state.start++] = 0
670
+ state.buffer[state.start++] = collectionVersion
671
+ collection9_enc.encode(state, record)
672
+ return state.buffer
673
+ },
674
+ trigger: null,
675
+ reconstruct: collection9_reconstruct,
676
+ reconstructKey: collection9_reconstruct_key,
677
+ indexes: [],
678
+ decodedVersion: 0
679
+ }
680
+
681
+ // '@qvac/chunks-by-chat' collection key
682
+ const index10_key = new IndexEncoder([
683
+ IndexEncoder.STRING,
684
+ IndexEncoder.UINT,
685
+ IndexEncoder.STRING
686
+ ], { prefix: 10 })
687
+
688
+ function index10_indexify (record) {
689
+ const arr = []
690
+
691
+ const a0 = record.chatId
692
+ if (a0 === undefined) return arr
693
+ arr.push(a0)
694
+
695
+ const a1 = record.seq
696
+ if (a1 === undefined) return arr
697
+ arr.push(a1)
698
+
699
+ const a2 = record.id
700
+ if (a2 === undefined) return arr
701
+ arr.push(a2)
702
+
703
+ return arr
704
+ }
705
+
706
+ // '@qvac/chunks-by-chat'
707
+ const index10 = {
708
+ name: '@qvac/chunks-by-chat',
709
+ version: 1,
710
+ id: 10,
711
+ encodeKey (record) {
712
+ return index10_key.encode(index10_indexify(record))
713
+ },
714
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
715
+ return index10_key.encodeRange({
716
+ gt: gt ? index10_indexify(gt) : null,
717
+ lt: lt ? index10_indexify(lt) : null,
718
+ gte: gte ? index10_indexify(gte) : null,
719
+ lte: lte ? index10_indexify(lte) : null
720
+ })
721
+ },
722
+ encodeValue: (record) => index10.collection.encodeKey(record),
723
+ encodeIndexKeys (record, context) {
724
+ return [index10_key.encode([record.chatId, record.seq, record.id])]
725
+ },
726
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
727
+ offset: collection0.indexes.length,
728
+ collection: collection0
729
+ }
730
+ collection0.indexes.push(index10)
731
+
732
+ // '@qvac/chunks-by-type' collection key
733
+ const index11_key = new IndexEncoder([
734
+ IndexEncoder.STRING,
735
+ IndexEncoder.UINT,
736
+ IndexEncoder.UINT,
737
+ IndexEncoder.STRING
738
+ ], { prefix: 11 })
739
+
740
+ // '@qvac/chunks-by-type' has the following schema defined key map
741
+ const index11_map = helpers0.chunksByTypeMap
742
+
743
+ function index11_indexify (record) {
744
+ const arr = []
745
+
746
+ const a0 = record.chatId
747
+ if (a0 === undefined) return arr
748
+ arr.push(a0)
749
+
750
+ const a1 = record.type
751
+ if (a1 === undefined) return arr
752
+ arr.push(a1)
753
+
754
+ const a2 = record.seq
755
+ if (a2 === undefined) return arr
756
+ arr.push(a2)
757
+
758
+ return arr
759
+ }
760
+
761
+ // '@qvac/chunks-by-type'
762
+ const index11 = {
763
+ name: '@qvac/chunks-by-type',
764
+ version: 1,
765
+ id: 11,
766
+ encodeKey (record) {
767
+ return index11_key.encode(index11_indexify(record))
768
+ },
769
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
770
+ return index11_key.encodeRange({
771
+ gt: gt ? index11_indexify(gt) : null,
772
+ lt: lt ? index11_indexify(lt) : null,
773
+ gte: gte ? index11_indexify(gte) : null,
774
+ lte: lte ? index11_indexify(lte) : null
775
+ })
776
+ },
777
+ encodeValue: (record) => index11.collection.encodeKey(record),
778
+ encodeIndexKeys (record, context) {
779
+ const mapped = index11_map(record, context)
780
+ const keys = new Array(mapped.length)
781
+ for (let i = 0; i < mapped.length; i++) {
782
+ const mappedRecord = mapped[i]
783
+ keys[i] = index11_key.encode([mappedRecord.chatId, mappedRecord.type, mappedRecord.seq, record.id])
784
+ }
785
+ return keys
786
+ },
787
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
788
+ offset: collection0.indexes.length,
789
+ collection: collection0
790
+ }
791
+ collection0.indexes.push(index11)
792
+
793
+ // '@qvac/run-requests' collection key
794
+ const index12_key = new IndexEncoder([
795
+ IndexEncoder.STRING,
796
+ IndexEncoder.UINT,
797
+ IndexEncoder.STRING
798
+ ], { prefix: 12 })
799
+
800
+ // '@qvac/run-requests' has the following schema defined key map
801
+ const index12_map = helpers0.runRequestsMap
802
+
803
+ function index12_indexify (record) {
804
+ const arr = []
805
+
806
+ const a0 = record.chatId
807
+ if (a0 === undefined) return arr
808
+ arr.push(a0)
809
+
810
+ const a1 = record.seq
811
+ if (a1 === undefined) return arr
812
+ arr.push(a1)
813
+
814
+ return arr
815
+ }
816
+
817
+ // '@qvac/run-requests'
818
+ const index12 = {
819
+ name: '@qvac/run-requests',
820
+ version: 1,
821
+ id: 12,
822
+ encodeKey (record) {
823
+ return index12_key.encode(index12_indexify(record))
824
+ },
825
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
826
+ return index12_key.encodeRange({
827
+ gt: gt ? index12_indexify(gt) : null,
828
+ lt: lt ? index12_indexify(lt) : null,
829
+ gte: gte ? index12_indexify(gte) : null,
830
+ lte: lte ? index12_indexify(lte) : null
831
+ })
832
+ },
833
+ encodeValue: (record) => index12.collection.encodeKey(record),
834
+ encodeIndexKeys (record, context) {
835
+ const mapped = index12_map(record, context)
836
+ const keys = new Array(mapped.length)
837
+ for (let i = 0; i < mapped.length; i++) {
838
+ const mappedRecord = mapped[i]
839
+ keys[i] = index12_key.encode([mappedRecord.chatId, mappedRecord.seq, record.id])
840
+ }
841
+ return keys
842
+ },
843
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
844
+ offset: collection0.indexes.length,
845
+ collection: collection0
846
+ }
847
+ collection0.indexes.push(index12)
848
+
849
+ // '@qvac/active-agents' collection key
850
+ const index13_key = new IndexEncoder([
851
+ IndexEncoder.UINT,
852
+ IndexEncoder.STRING
853
+ ], { prefix: 13 })
854
+
855
+ // '@qvac/active-agents' has the following schema defined key map
856
+ const index13_map = helpers0.activeAgentsMap
857
+
858
+ function index13_indexify (record) {
859
+ const a = record.createdAt
860
+ return a === undefined ? [] : [a]
861
+ }
862
+
863
+ // '@qvac/active-agents'
864
+ const index13 = {
865
+ name: '@qvac/active-agents',
866
+ version: 1,
867
+ id: 13,
868
+ encodeKey (record) {
869
+ return index13_key.encode(index13_indexify(record))
870
+ },
871
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
872
+ return index13_key.encodeRange({
873
+ gt: gt ? index13_indexify(gt) : null,
874
+ lt: lt ? index13_indexify(lt) : null,
875
+ gte: gte ? index13_indexify(gte) : null,
876
+ lte: lte ? index13_indexify(lte) : null
877
+ })
878
+ },
879
+ encodeValue: (record) => index13.collection.encodeKey(record),
880
+ encodeIndexKeys (record, context) {
881
+ const mapped = index13_map(record, context)
882
+ const keys = new Array(mapped.length)
883
+ for (let i = 0; i < mapped.length; i++) {
884
+ const mappedRecord = mapped[i]
885
+ keys[i] = index13_key.encode([mappedRecord.createdAt, record.id])
886
+ }
887
+ return keys
888
+ },
889
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
890
+ offset: collection2.indexes.length,
891
+ collection: collection2
892
+ }
893
+ collection2.indexes.push(index13)
894
+
895
+ // '@qvac/active-chats' collection key
896
+ const index14_key = new IndexEncoder([
897
+ IndexEncoder.UINT,
898
+ IndexEncoder.STRING
899
+ ], { prefix: 14 })
900
+
901
+ // '@qvac/active-chats' has the following schema defined key map
902
+ const index14_map = helpers0.activeChatsMap
903
+
904
+ function index14_indexify (record) {
905
+ const a = record.createdAt
906
+ return a === undefined ? [] : [a]
907
+ }
908
+
909
+ // '@qvac/active-chats'
910
+ const index14 = {
911
+ name: '@qvac/active-chats',
912
+ version: 1,
913
+ id: 14,
914
+ encodeKey (record) {
915
+ return index14_key.encode(index14_indexify(record))
916
+ },
917
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
918
+ return index14_key.encodeRange({
919
+ gt: gt ? index14_indexify(gt) : null,
920
+ lt: lt ? index14_indexify(lt) : null,
921
+ gte: gte ? index14_indexify(gte) : null,
922
+ lte: lte ? index14_indexify(lte) : null
923
+ })
924
+ },
925
+ encodeValue: (record) => index14.collection.encodeKey(record),
926
+ encodeIndexKeys (record, context) {
927
+ const mapped = index14_map(record, context)
928
+ const keys = new Array(mapped.length)
929
+ for (let i = 0; i < mapped.length; i++) {
930
+ const mappedRecord = mapped[i]
931
+ keys[i] = index14_key.encode([mappedRecord.createdAt, record.id])
932
+ }
933
+ return keys
934
+ },
935
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
936
+ offset: collection4.indexes.length,
937
+ collection: collection4
938
+ }
939
+ collection4.indexes.push(index14)
940
+
941
+ // '@qvac/active-chats-by-agent' collection key
942
+ const index15_key = new IndexEncoder([
943
+ IndexEncoder.STRING,
944
+ IndexEncoder.UINT,
945
+ IndexEncoder.STRING
946
+ ], { prefix: 15 })
947
+
948
+ // '@qvac/active-chats-by-agent' has the following schema defined key map
949
+ const index15_map = helpers0.activeChatsByAgentMap
950
+
951
+ function index15_indexify (record) {
952
+ const arr = []
953
+
954
+ const a0 = record.agentId
955
+ if (a0 === undefined) return arr
956
+ arr.push(a0)
957
+
958
+ const a1 = record.createdAt
959
+ if (a1 === undefined) return arr
960
+ arr.push(a1)
961
+
962
+ return arr
963
+ }
964
+
965
+ // '@qvac/active-chats-by-agent'
966
+ const index15 = {
967
+ name: '@qvac/active-chats-by-agent',
968
+ version: 1,
969
+ id: 15,
970
+ encodeKey (record) {
971
+ return index15_key.encode(index15_indexify(record))
972
+ },
973
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
974
+ return index15_key.encodeRange({
975
+ gt: gt ? index15_indexify(gt) : null,
976
+ lt: lt ? index15_indexify(lt) : null,
977
+ gte: gte ? index15_indexify(gte) : null,
978
+ lte: lte ? index15_indexify(lte) : null
979
+ })
980
+ },
981
+ encodeValue: (record) => index15.collection.encodeKey(record),
982
+ encodeIndexKeys (record, context) {
983
+ const mapped = index15_map(record, context)
984
+ const keys = new Array(mapped.length)
985
+ for (let i = 0; i < mapped.length; i++) {
986
+ const mappedRecord = mapped[i]
987
+ keys[i] = index15_key.encode([mappedRecord.agentId, mappedRecord.createdAt, record.id])
988
+ }
989
+ return keys
990
+ },
991
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
992
+ offset: collection4.indexes.length,
993
+ collection: collection4
994
+ }
995
+ collection4.indexes.push(index15)
996
+
997
+ // '@qvac/knowledge-by-chat' collection key
998
+ const index16_key = new IndexEncoder([
999
+ IndexEncoder.STRING,
1000
+ IndexEncoder.STRING
1001
+ ], { prefix: 16 })
1002
+
1003
+ function index16_indexify (record) {
1004
+ const arr = []
1005
+
1006
+ const a0 = record.chatId
1007
+ if (a0 === undefined) return arr
1008
+ arr.push(a0)
1009
+
1010
+ const a1 = record.id
1011
+ if (a1 === undefined) return arr
1012
+ arr.push(a1)
1013
+
1014
+ return arr
1015
+ }
1016
+
1017
+ // '@qvac/knowledge-by-chat'
1018
+ const index16 = {
1019
+ name: '@qvac/knowledge-by-chat',
1020
+ version: 1,
1021
+ id: 16,
1022
+ encodeKey (record) {
1023
+ return index16_key.encode(index16_indexify(record))
1024
+ },
1025
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1026
+ return index16_key.encodeRange({
1027
+ gt: gt ? index16_indexify(gt) : null,
1028
+ lt: lt ? index16_indexify(lt) : null,
1029
+ gte: gte ? index16_indexify(gte) : null,
1030
+ lte: lte ? index16_indexify(lte) : null
1031
+ })
1032
+ },
1033
+ encodeValue: (record) => index16.collection.encodeKey(record),
1034
+ encodeIndexKeys (record, context) {
1035
+ return [index16_key.encode([record.chatId, record.id])]
1036
+ },
1037
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1038
+ offset: collection7.indexes.length,
1039
+ collection: collection7
1040
+ }
1041
+ collection7.indexes.push(index16)
1042
+
1043
+ // '@qvac/knowledge-artifacts-by-knowledge' collection key
1044
+ const index17_key = new IndexEncoder([
1045
+ IndexEncoder.STRING,
1046
+ IndexEncoder.STRING
1047
+ ], { prefix: 17 })
1048
+
1049
+ function index17_indexify (record) {
1050
+ const arr = []
1051
+
1052
+ const a0 = record.knowledgeId
1053
+ if (a0 === undefined) return arr
1054
+ arr.push(a0)
1055
+
1056
+ const a1 = record.id
1057
+ if (a1 === undefined) return arr
1058
+ arr.push(a1)
1059
+
1060
+ return arr
1061
+ }
1062
+
1063
+ // '@qvac/knowledge-artifacts-by-knowledge'
1064
+ const index17 = {
1065
+ name: '@qvac/knowledge-artifacts-by-knowledge',
1066
+ version: 1,
1067
+ id: 17,
1068
+ encodeKey (record) {
1069
+ return index17_key.encode(index17_indexify(record))
1070
+ },
1071
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1072
+ return index17_key.encodeRange({
1073
+ gt: gt ? index17_indexify(gt) : null,
1074
+ lt: lt ? index17_indexify(lt) : null,
1075
+ gte: gte ? index17_indexify(gte) : null,
1076
+ lte: lte ? index17_indexify(lte) : null
1077
+ })
1078
+ },
1079
+ encodeValue: (record) => index17.collection.encodeKey(record),
1080
+ encodeIndexKeys (record, context) {
1081
+ return [index17_key.encode([record.knowledgeId, record.id])]
1082
+ },
1083
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1084
+ offset: collection8.indexes.length,
1085
+ collection: collection8
1086
+ }
1087
+ collection8.indexes.push(index17)
1088
+
1089
+ // '@qvac/indexing-status-by-knowledge' collection key
1090
+ const index18_key = new IndexEncoder([
1091
+ IndexEncoder.STRING,
1092
+ IndexEncoder.STRING
1093
+ ], { prefix: 18 })
1094
+
1095
+ function index18_indexify (record) {
1096
+ const arr = []
1097
+
1098
+ const a0 = record.knowledgeId
1099
+ if (a0 === undefined) return arr
1100
+ arr.push(a0)
1101
+
1102
+ const a1 = record.id
1103
+ if (a1 === undefined) return arr
1104
+ arr.push(a1)
1105
+
1106
+ return arr
1107
+ }
1108
+
1109
+ // '@qvac/indexing-status-by-knowledge'
1110
+ const index18 = {
1111
+ name: '@qvac/indexing-status-by-knowledge',
1112
+ version: 1,
1113
+ id: 18,
1114
+ encodeKey (record) {
1115
+ return index18_key.encode(index18_indexify(record))
1116
+ },
1117
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1118
+ return index18_key.encodeRange({
1119
+ gt: gt ? index18_indexify(gt) : null,
1120
+ lt: lt ? index18_indexify(lt) : null,
1121
+ gte: gte ? index18_indexify(gte) : null,
1122
+ lte: lte ? index18_indexify(lte) : null
1123
+ })
1124
+ },
1125
+ encodeValue: (record) => index18.collection.encodeKey(record),
1126
+ encodeIndexKeys (record, context) {
1127
+ return [index18_key.encode([record.knowledgeId, record.id])]
1128
+ },
1129
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1130
+ offset: collection9.indexes.length,
1131
+ collection: collection9
1132
+ }
1133
+ collection9.indexes.push(index18)
1134
+
1135
+ // '@qvac/history-chunks' collection key
1136
+ const index19_key = new IndexEncoder([
1137
+ IndexEncoder.STRING,
1138
+ IndexEncoder.UINT,
1139
+ IndexEncoder.STRING
1140
+ ], { prefix: 19 })
1141
+
1142
+ // '@qvac/history-chunks' has the following schema defined key map
1143
+ const index19_map = helpers0.historyChunksMap
1144
+
1145
+ function index19_indexify (record) {
1146
+ const arr = []
1147
+
1148
+ const a0 = record.chatId
1149
+ if (a0 === undefined) return arr
1150
+ arr.push(a0)
1151
+
1152
+ const a1 = record.seq
1153
+ if (a1 === undefined) return arr
1154
+ arr.push(a1)
1155
+
1156
+ return arr
1157
+ }
1158
+
1159
+ // '@qvac/history-chunks'
1160
+ const index19 = {
1161
+ name: '@qvac/history-chunks',
1162
+ version: 1,
1163
+ id: 19,
1164
+ encodeKey (record) {
1165
+ return index19_key.encode(index19_indexify(record))
1166
+ },
1167
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1168
+ return index19_key.encodeRange({
1169
+ gt: gt ? index19_indexify(gt) : null,
1170
+ lt: lt ? index19_indexify(lt) : null,
1171
+ gte: gte ? index19_indexify(gte) : null,
1172
+ lte: lte ? index19_indexify(lte) : null
1173
+ })
1174
+ },
1175
+ encodeValue: (record) => index19.collection.encodeKey(record),
1176
+ encodeIndexKeys (record, context) {
1177
+ const mapped = index19_map(record, context)
1178
+ const keys = new Array(mapped.length)
1179
+ for (let i = 0; i < mapped.length; i++) {
1180
+ const mappedRecord = mapped[i]
1181
+ keys[i] = index19_key.encode([mappedRecord.chatId, mappedRecord.seq, record.id])
1182
+ }
1183
+ return keys
1184
+ },
1185
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1186
+ offset: collection0.indexes.length,
1187
+ collection: collection0
1188
+ }
1189
+ collection0.indexes.push(index19)
1190
+
1191
+ // '@qvac/indexing-status-by-chat' collection key
1192
+ const index20_key = new IndexEncoder([
1193
+ IndexEncoder.STRING,
1194
+ IndexEncoder.STRING
1195
+ ], { prefix: 20 })
1196
+
1197
+ function index20_indexify (record) {
1198
+ const arr = []
1199
+
1200
+ const a0 = record.chatId
1201
+ if (a0 === undefined) return arr
1202
+ arr.push(a0)
1203
+
1204
+ const a1 = record.id
1205
+ if (a1 === undefined) return arr
1206
+ arr.push(a1)
1207
+
1208
+ return arr
1209
+ }
1210
+
1211
+ // '@qvac/indexing-status-by-chat'
1212
+ const index20 = {
1213
+ name: '@qvac/indexing-status-by-chat',
1214
+ version: 1,
1215
+ id: 20,
1216
+ encodeKey (record) {
1217
+ return index20_key.encode(index20_indexify(record))
1218
+ },
1219
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1220
+ return index20_key.encodeRange({
1221
+ gt: gt ? index20_indexify(gt) : null,
1222
+ lt: lt ? index20_indexify(lt) : null,
1223
+ gte: gte ? index20_indexify(gte) : null,
1224
+ lte: lte ? index20_indexify(lte) : null
1225
+ })
1226
+ },
1227
+ encodeValue: (record) => index20.collection.encodeKey(record),
1228
+ encodeIndexKeys (record, context) {
1229
+ return [index20_key.encode([record.chatId, record.id])]
1230
+ },
1231
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1232
+ offset: collection9.indexes.length,
1233
+ collection: collection9
1234
+ }
1235
+ collection9.indexes.push(index20)
1236
+
1237
+ // '@qvac/active-knowledge-by-chat' collection key
1238
+ const index21_key = new IndexEncoder([
1239
+ IndexEncoder.STRING,
1240
+ IndexEncoder.STRING
1241
+ ], { prefix: 21 })
1242
+
1243
+ // '@qvac/active-knowledge-by-chat' has the following schema defined key map
1244
+ const index21_map = helpers0.activeKnowledgeByChatMap
1245
+
1246
+ function index21_indexify (record) {
1247
+ const a = record.chatId
1248
+ return a === undefined ? [] : [a]
1249
+ }
1250
+
1251
+ // '@qvac/active-knowledge-by-chat'
1252
+ const index21 = {
1253
+ name: '@qvac/active-knowledge-by-chat',
1254
+ version: 1,
1255
+ id: 21,
1256
+ encodeKey (record) {
1257
+ return index21_key.encode(index21_indexify(record))
1258
+ },
1259
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1260
+ return index21_key.encodeRange({
1261
+ gt: gt ? index21_indexify(gt) : null,
1262
+ lt: lt ? index21_indexify(lt) : null,
1263
+ gte: gte ? index21_indexify(gte) : null,
1264
+ lte: lte ? index21_indexify(lte) : null
1265
+ })
1266
+ },
1267
+ encodeValue: (record) => index21.collection.encodeKey(record),
1268
+ encodeIndexKeys (record, context) {
1269
+ const mapped = index21_map(record, context)
1270
+ const keys = new Array(mapped.length)
1271
+ for (let i = 0; i < mapped.length; i++) {
1272
+ const mappedRecord = mapped[i]
1273
+ keys[i] = index21_key.encode([mappedRecord.chatId, record.id])
1274
+ }
1275
+ return keys
1276
+ },
1277
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1278
+ offset: collection7.indexes.length,
1279
+ collection: collection7
1280
+ }
1281
+ collection7.indexes.push(index21)
1282
+
1283
+ // '@qvac/tool-configs' collection key
1284
+ const collection22_key = new IndexEncoder([
1285
+ IndexEncoder.STRING,
1286
+ IndexEncoder.STRING
1287
+ ], { prefix: 22 })
1288
+
1289
+ function collection22_indexify (record) {
1290
+ const arr = []
1291
+
1292
+ const a0 = record.agentId
1293
+ if (a0 === undefined) return arr
1294
+ arr.push(a0)
1295
+
1296
+ const a1 = record.toolName
1297
+ if (a1 === undefined) return arr
1298
+ arr.push(a1)
1299
+
1300
+ return arr
1301
+ }
1302
+
1303
+ // '@qvac/tool-configs' value encoding
1304
+ const collection22_enc = getEncoding('@qvac/tool-configs/hyperdb#22')
1305
+
1306
+ // '@qvac/tool-configs' reconstruction function
1307
+ function collection22_reconstruct (schemaVersion, keyBuf, valueBuf) {
1308
+ const key = collection22_key.decode(keyBuf)
1309
+ setVersion(schemaVersion)
1310
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
1311
+ const type = c.uint.decode(state)
1312
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
1313
+ collection22.decodedVersion = c.uint.decode(state)
1314
+ const record = collection22_enc.decode(state)
1315
+ record.agentId = key[0]
1316
+ record.toolName = key[1]
1317
+ return record
1318
+ }
1319
+ // '@qvac/tool-configs' key reconstruction function
1320
+ function collection22_reconstruct_key (keyBuf) {
1321
+ const key = collection22_key.decode(keyBuf)
1322
+ return {
1323
+ agentId: key[0],
1324
+ toolName: key[1]
1325
+ }
1326
+ }
1327
+
1328
+ // '@qvac/tool-configs'
1329
+ const collection22 = {
1330
+ name: '@qvac/tool-configs',
1331
+ id: 22,
1332
+ version: 2,
1333
+ encodeKey (record) {
1334
+ const key = [record.agentId, record.toolName]
1335
+ return collection22_key.encode(key)
1336
+ },
1337
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1338
+ return collection22_key.encodeRange({
1339
+ gt: gt ? collection22_indexify(gt) : null,
1340
+ lt: lt ? collection22_indexify(lt) : null,
1341
+ gte: gte ? collection22_indexify(gte) : null,
1342
+ lte: lte ? collection22_indexify(lte) : null
1343
+ })
1344
+ },
1345
+ encodeValue (schemaVersion, collectionVersion, record) {
1346
+ setVersion(schemaVersion)
1347
+ const state = { start: 0, end: 2, buffer: null }
1348
+ collection22_enc.preencode(state, record)
1349
+ state.buffer = b4a.allocUnsafe(state.end)
1350
+ state.buffer[state.start++] = 0
1351
+ state.buffer[state.start++] = collectionVersion
1352
+ collection22_enc.encode(state, record)
1353
+ return state.buffer
1354
+ },
1355
+ trigger: null,
1356
+ reconstruct: collection22_reconstruct,
1357
+ reconstructKey: collection22_reconstruct_key,
1358
+ indexes: [],
1359
+ decodedVersion: 0
1360
+ }
1361
+
1362
+ // '@qvac/tool-activity' collection key
1363
+ const collection23_key = new IndexEncoder([
1364
+ IndexEncoder.STRING
1365
+ ], { prefix: 23 })
1366
+
1367
+ function collection23_indexify (record) {
1368
+ const a = record.id
1369
+ return a === undefined ? [] : [a]
1370
+ }
1371
+
1372
+ // '@qvac/tool-activity' value encoding
1373
+ const collection23_enc = getEncoding('@qvac/tool-activity/hyperdb#23')
1374
+
1375
+ // '@qvac/tool-activity' reconstruction function
1376
+ function collection23_reconstruct (schemaVersion, keyBuf, valueBuf) {
1377
+ const key = collection23_key.decode(keyBuf)
1378
+ setVersion(schemaVersion)
1379
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
1380
+ const type = c.uint.decode(state)
1381
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
1382
+ collection23.decodedVersion = c.uint.decode(state)
1383
+ const record = collection23_enc.decode(state)
1384
+ record.id = key[0]
1385
+ return record
1386
+ }
1387
+ // '@qvac/tool-activity' key reconstruction function
1388
+ function collection23_reconstruct_key (keyBuf) {
1389
+ const key = collection23_key.decode(keyBuf)
1390
+ return {
1391
+ id: key[0]
1392
+ }
1393
+ }
1394
+
1395
+ // '@qvac/tool-activity'
1396
+ const collection23 = {
1397
+ name: '@qvac/tool-activity',
1398
+ id: 23,
1399
+ version: 2,
1400
+ encodeKey (record) {
1401
+ const key = [record.id]
1402
+ return collection23_key.encode(key)
1403
+ },
1404
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1405
+ return collection23_key.encodeRange({
1406
+ gt: gt ? collection23_indexify(gt) : null,
1407
+ lt: lt ? collection23_indexify(lt) : null,
1408
+ gte: gte ? collection23_indexify(gte) : null,
1409
+ lte: lte ? collection23_indexify(lte) : null
1410
+ })
1411
+ },
1412
+ encodeValue (schemaVersion, collectionVersion, record) {
1413
+ setVersion(schemaVersion)
1414
+ const state = { start: 0, end: 2, buffer: null }
1415
+ collection23_enc.preencode(state, record)
1416
+ state.buffer = b4a.allocUnsafe(state.end)
1417
+ state.buffer[state.start++] = 0
1418
+ state.buffer[state.start++] = collectionVersion
1419
+ collection23_enc.encode(state, record)
1420
+ return state.buffer
1421
+ },
1422
+ trigger: null,
1423
+ reconstruct: collection23_reconstruct,
1424
+ reconstructKey: collection23_reconstruct_key,
1425
+ indexes: [],
1426
+ decodedVersion: 0
1427
+ }
1428
+
1429
+ // '@qvac/tool-activity-counter' collection key
1430
+ const collection24_key = new IndexEncoder([
1431
+ IndexEncoder.STRING
1432
+ ], { prefix: 24 })
1433
+
1434
+ function collection24_indexify (record) {
1435
+ const a = record.agentId
1436
+ return a === undefined ? [] : [a]
1437
+ }
1438
+
1439
+ // '@qvac/tool-activity-counter' value encoding
1440
+ const collection24_enc = getEncoding('@qvac/tool-activity-counter/hyperdb#24')
1441
+
1442
+ // '@qvac/tool-activity-counter' reconstruction function
1443
+ function collection24_reconstruct (schemaVersion, keyBuf, valueBuf) {
1444
+ const key = collection24_key.decode(keyBuf)
1445
+ setVersion(schemaVersion)
1446
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
1447
+ const type = c.uint.decode(state)
1448
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
1449
+ collection24.decodedVersion = c.uint.decode(state)
1450
+ const record = collection24_enc.decode(state)
1451
+ record.agentId = key[0]
1452
+ return record
1453
+ }
1454
+ // '@qvac/tool-activity-counter' key reconstruction function
1455
+ function collection24_reconstruct_key (keyBuf) {
1456
+ const key = collection24_key.decode(keyBuf)
1457
+ return {
1458
+ agentId: key[0]
1459
+ }
1460
+ }
1461
+
1462
+ // '@qvac/tool-activity-counter'
1463
+ const collection24 = {
1464
+ name: '@qvac/tool-activity-counter',
1465
+ id: 24,
1466
+ version: 2,
1467
+ encodeKey (record) {
1468
+ const key = [record.agentId]
1469
+ return collection24_key.encode(key)
1470
+ },
1471
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1472
+ return collection24_key.encodeRange({
1473
+ gt: gt ? collection24_indexify(gt) : null,
1474
+ lt: lt ? collection24_indexify(lt) : null,
1475
+ gte: gte ? collection24_indexify(gte) : null,
1476
+ lte: lte ? collection24_indexify(lte) : null
1477
+ })
1478
+ },
1479
+ encodeValue (schemaVersion, collectionVersion, record) {
1480
+ setVersion(schemaVersion)
1481
+ const state = { start: 0, end: 2, buffer: null }
1482
+ collection24_enc.preencode(state, record)
1483
+ state.buffer = b4a.allocUnsafe(state.end)
1484
+ state.buffer[state.start++] = 0
1485
+ state.buffer[state.start++] = collectionVersion
1486
+ collection24_enc.encode(state, record)
1487
+ return state.buffer
1488
+ },
1489
+ trigger: null,
1490
+ reconstruct: collection24_reconstruct,
1491
+ reconstructKey: collection24_reconstruct_key,
1492
+ indexes: [],
1493
+ decodedVersion: 0
1494
+ }
1495
+
1496
+ // '@qvac/active-tool-configs-by-agent' collection key
1497
+ const index25_key = new IndexEncoder([
1498
+ IndexEncoder.STRING,
1499
+ IndexEncoder.STRING,
1500
+ IndexEncoder.STRING
1501
+ ], { prefix: 25 })
1502
+
1503
+ // '@qvac/active-tool-configs-by-agent' has the following schema defined key map
1504
+ const index25_map = helpers0.activeToolConfigsByAgentMap
1505
+
1506
+ function index25_indexify (record) {
1507
+ const a = record.agentId
1508
+ return a === undefined ? [] : [a]
1509
+ }
1510
+
1511
+ // '@qvac/active-tool-configs-by-agent'
1512
+ const index25 = {
1513
+ name: '@qvac/active-tool-configs-by-agent',
1514
+ version: 2,
1515
+ id: 25,
1516
+ encodeKey (record) {
1517
+ return index25_key.encode(index25_indexify(record))
1518
+ },
1519
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1520
+ return index25_key.encodeRange({
1521
+ gt: gt ? index25_indexify(gt) : null,
1522
+ lt: lt ? index25_indexify(lt) : null,
1523
+ gte: gte ? index25_indexify(gte) : null,
1524
+ lte: lte ? index25_indexify(lte) : null
1525
+ })
1526
+ },
1527
+ encodeValue: (record) => index25.collection.encodeKey(record),
1528
+ encodeIndexKeys (record, context) {
1529
+ const mapped = index25_map(record, context)
1530
+ const keys = new Array(mapped.length)
1531
+ for (let i = 0; i < mapped.length; i++) {
1532
+ const mappedRecord = mapped[i]
1533
+ keys[i] = index25_key.encode([mappedRecord.agentId, record.agentId, record.toolName])
1534
+ }
1535
+ return keys
1536
+ },
1537
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1538
+ offset: collection22.indexes.length,
1539
+ collection: collection22
1540
+ }
1541
+ collection22.indexes.push(index25)
1542
+
1543
+ // '@qvac/attachments-by-media-kind' collection key
1544
+ const index26_key = new IndexEncoder([
1545
+ IndexEncoder.UINT,
1546
+ IndexEncoder.UINT,
1547
+ IndexEncoder.STRING
1548
+ ], { prefix: 26 })
1549
+
1550
+ // '@qvac/attachments-by-media-kind' has the following schema defined key map
1551
+ const index26_map = helpers0.attachmentsByMediaKindMap
1552
+
1553
+ function index26_indexify (record) {
1554
+ const arr = []
1555
+
1556
+ const a0 = record.mediaKind
1557
+ if (a0 === undefined) return arr
1558
+ arr.push(a0)
1559
+
1560
+ const a1 = record.createdAt
1561
+ if (a1 === undefined) return arr
1562
+ arr.push(a1)
1563
+
1564
+ return arr
1565
+ }
1566
+
1567
+ // '@qvac/attachments-by-media-kind'
1568
+ const index26 = {
1569
+ name: '@qvac/attachments-by-media-kind',
1570
+ version: 2,
1571
+ id: 26,
1572
+ encodeKey (record) {
1573
+ return index26_key.encode(index26_indexify(record))
1574
+ },
1575
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1576
+ return index26_key.encodeRange({
1577
+ gt: gt ? index26_indexify(gt) : null,
1578
+ lt: lt ? index26_indexify(lt) : null,
1579
+ gte: gte ? index26_indexify(gte) : null,
1580
+ lte: lte ? index26_indexify(lte) : null
1581
+ })
1582
+ },
1583
+ encodeValue: (record) => index26.collection.encodeKey(record),
1584
+ encodeIndexKeys (record, context) {
1585
+ const mapped = index26_map(record, context)
1586
+ const keys = new Array(mapped.length)
1587
+ for (let i = 0; i < mapped.length; i++) {
1588
+ const mappedRecord = mapped[i]
1589
+ keys[i] = index26_key.encode([mappedRecord.mediaKind, mappedRecord.createdAt, record.id])
1590
+ }
1591
+ return keys
1592
+ },
1593
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1594
+ offset: collection0.indexes.length,
1595
+ collection: collection0
1596
+ }
1597
+ collection0.indexes.push(index26)
1598
+
1599
+ // '@qvac/attachments-by-media-kind-origin' collection key
1600
+ const index27_key = new IndexEncoder([
1601
+ IndexEncoder.UINT,
1602
+ IndexEncoder.UINT,
1603
+ IndexEncoder.UINT,
1604
+ IndexEncoder.STRING
1605
+ ], { prefix: 27 })
1606
+
1607
+ // '@qvac/attachments-by-media-kind-origin' has the following schema defined key map
1608
+ const index27_map = helpers0.attachmentsByMediaKindOriginMap
1609
+
1610
+ function index27_indexify (record) {
1611
+ const arr = []
1612
+
1613
+ const a0 = record.mediaKind
1614
+ if (a0 === undefined) return arr
1615
+ arr.push(a0)
1616
+
1617
+ const a1 = record.generated
1618
+ if (a1 === undefined) return arr
1619
+ arr.push(a1)
1620
+
1621
+ const a2 = record.createdAt
1622
+ if (a2 === undefined) return arr
1623
+ arr.push(a2)
1624
+
1625
+ return arr
1626
+ }
1627
+
1628
+ // '@qvac/attachments-by-media-kind-origin'
1629
+ const index27 = {
1630
+ name: '@qvac/attachments-by-media-kind-origin',
1631
+ version: 2,
1632
+ id: 27,
1633
+ encodeKey (record) {
1634
+ return index27_key.encode(index27_indexify(record))
1635
+ },
1636
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1637
+ return index27_key.encodeRange({
1638
+ gt: gt ? index27_indexify(gt) : null,
1639
+ lt: lt ? index27_indexify(lt) : null,
1640
+ gte: gte ? index27_indexify(gte) : null,
1641
+ lte: lte ? index27_indexify(lte) : null
1642
+ })
1643
+ },
1644
+ encodeValue: (record) => index27.collection.encodeKey(record),
1645
+ encodeIndexKeys (record, context) {
1646
+ const mapped = index27_map(record, context)
1647
+ const keys = new Array(mapped.length)
1648
+ for (let i = 0; i < mapped.length; i++) {
1649
+ const mappedRecord = mapped[i]
1650
+ keys[i] = index27_key.encode([mappedRecord.mediaKind, mappedRecord.generated, mappedRecord.createdAt, record.id])
1651
+ }
1652
+ return keys
1653
+ },
1654
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1655
+ offset: collection0.indexes.length,
1656
+ collection: collection0
1657
+ }
1658
+ collection0.indexes.push(index27)
1659
+
1660
+ // '@qvac/tool-activity-by-agent' collection key
1661
+ const index28_key = new IndexEncoder([
1662
+ IndexEncoder.STRING,
1663
+ IndexEncoder.UINT,
1664
+ IndexEncoder.STRING
1665
+ ], { prefix: 28 })
1666
+
1667
+ // '@qvac/tool-activity-by-agent' has the following schema defined key map
1668
+ const index28_map = helpers0.toolActivityByAgentMap
1669
+
1670
+ function index28_indexify (record) {
1671
+ const arr = []
1672
+
1673
+ const a0 = record.agentId
1674
+ if (a0 === undefined) return arr
1675
+ arr.push(a0)
1676
+
1677
+ const a1 = record.seq
1678
+ if (a1 === undefined) return arr
1679
+ arr.push(a1)
1680
+
1681
+ return arr
1682
+ }
1683
+
1684
+ // '@qvac/tool-activity-by-agent'
1685
+ const index28 = {
1686
+ name: '@qvac/tool-activity-by-agent',
1687
+ version: 2,
1688
+ id: 28,
1689
+ encodeKey (record) {
1690
+ return index28_key.encode(index28_indexify(record))
1691
+ },
1692
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1693
+ return index28_key.encodeRange({
1694
+ gt: gt ? index28_indexify(gt) : null,
1695
+ lt: lt ? index28_indexify(lt) : null,
1696
+ gte: gte ? index28_indexify(gte) : null,
1697
+ lte: lte ? index28_indexify(lte) : null
1698
+ })
1699
+ },
1700
+ encodeValue: (record) => index28.collection.encodeKey(record),
1701
+ encodeIndexKeys (record, context) {
1702
+ const mapped = index28_map(record, context)
1703
+ const keys = new Array(mapped.length)
1704
+ for (let i = 0; i < mapped.length; i++) {
1705
+ const mappedRecord = mapped[i]
1706
+ keys[i] = index28_key.encode([mappedRecord.agentId, mappedRecord.seq, record.id])
1707
+ }
1708
+ return keys
1709
+ },
1710
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1711
+ offset: collection23.indexes.length,
1712
+ collection: collection23
1713
+ }
1714
+ collection23.indexes.push(index28)
1715
+
1716
+ // '@qvac/writer-activity' collection key
1717
+ const collection29_key = new IndexEncoder([
1718
+ IndexEncoder.BUFFER
1719
+ ], { prefix: 29 })
1720
+
1721
+ function collection29_indexify (record) {
1722
+ const a = record.writerKey
1723
+ return a === undefined ? [] : [a]
1724
+ }
1725
+
1726
+ // '@qvac/writer-activity' value encoding
1727
+ const collection29_enc = getEncoding('@qvac/writer-activity/hyperdb#29')
1728
+
1729
+ // '@qvac/writer-activity' reconstruction function
1730
+ function collection29_reconstruct (schemaVersion, keyBuf, valueBuf) {
1731
+ const key = collection29_key.decode(keyBuf)
1732
+ setVersion(schemaVersion)
1733
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
1734
+ const type = c.uint.decode(state)
1735
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
1736
+ collection29.decodedVersion = c.uint.decode(state)
1737
+ const record = collection29_enc.decode(state)
1738
+ record.writerKey = key[0]
1739
+ return record
1740
+ }
1741
+ // '@qvac/writer-activity' key reconstruction function
1742
+ function collection29_reconstruct_key (keyBuf) {
1743
+ const key = collection29_key.decode(keyBuf)
1744
+ return {
1745
+ writerKey: key[0]
1746
+ }
1747
+ }
1748
+
1749
+ // '@qvac/writer-activity'
1750
+ const collection29 = {
1751
+ name: '@qvac/writer-activity',
1752
+ id: 29,
1753
+ version: 4,
1754
+ encodeKey (record) {
1755
+ const key = [record.writerKey]
1756
+ return collection29_key.encode(key)
1757
+ },
1758
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1759
+ return collection29_key.encodeRange({
1760
+ gt: gt ? collection29_indexify(gt) : null,
1761
+ lt: lt ? collection29_indexify(lt) : null,
1762
+ gte: gte ? collection29_indexify(gte) : null,
1763
+ lte: lte ? collection29_indexify(lte) : null
1764
+ })
1765
+ },
1766
+ encodeValue (schemaVersion, collectionVersion, record) {
1767
+ setVersion(schemaVersion)
1768
+ const state = { start: 0, end: 2, buffer: null }
1769
+ collection29_enc.preencode(state, record)
1770
+ state.buffer = b4a.allocUnsafe(state.end)
1771
+ state.buffer[state.start++] = 0
1772
+ state.buffer[state.start++] = collectionVersion
1773
+ collection29_enc.encode(state, record)
1774
+ return state.buffer
1775
+ },
1776
+ trigger: null,
1777
+ reconstruct: collection29_reconstruct,
1778
+ reconstructKey: collection29_reconstruct_key,
1779
+ indexes: [],
1780
+ decodedVersion: 0
1781
+ }
1782
+
1783
+ // '@qvac/devices-by-writer-key' collection key
1784
+ const index30_key = new IndexEncoder([
1785
+ IndexEncoder.BUFFER,
1786
+ IndexEncoder.BUFFER
1787
+ ], { prefix: 30 })
1788
+
1789
+ // '@qvac/devices-by-writer-key' has the following schema defined key map
1790
+ const index30_map = helpers0.devicesByWriterKeyMap
1791
+
1792
+ function index30_indexify (record) {
1793
+ const a = record.writerKey
1794
+ return a === undefined ? [] : [a]
1795
+ }
1796
+
1797
+ // '@qvac/devices-by-writer-key'
1798
+ const index30 = {
1799
+ name: '@qvac/devices-by-writer-key',
1800
+ version: 3,
1801
+ id: 30,
1802
+ encodeKey (record) {
1803
+ return index30_key.encode(index30_indexify(record))
1804
+ },
1805
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1806
+ return index30_key.encodeRange({
1807
+ gt: gt ? index30_indexify(gt) : null,
1808
+ lt: lt ? index30_indexify(lt) : null,
1809
+ gte: gte ? index30_indexify(gte) : null,
1810
+ lte: lte ? index30_indexify(lte) : null
1811
+ })
1812
+ },
1813
+ encodeValue: (record) => index30.collection.encodeKey(record),
1814
+ encodeIndexKeys (record, context) {
1815
+ const mapped = index30_map(record, context)
1816
+ const keys = new Array(mapped.length)
1817
+ for (let i = 0; i < mapped.length; i++) {
1818
+ const mappedRecord = mapped[i]
1819
+ keys[i] = index30_key.encode([mappedRecord.writerKey, record.id])
1820
+ }
1821
+ return keys
1822
+ },
1823
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1824
+ offset: collection5.indexes.length,
1825
+ collection: collection5
1826
+ }
1827
+ collection5.indexes.push(index30)
1828
+
1829
+ // '@qvac/writers-by-most-recent' collection key
1830
+ const index31_key = new IndexEncoder([
1831
+ IndexEncoder.UINT,
1832
+ IndexEncoder.BUFFER
1833
+ ], { prefix: 31 })
1834
+
1835
+ function index31_indexify (record) {
1836
+ const arr = []
1837
+
1838
+ const a0 = record.clock
1839
+ if (a0 === undefined) return arr
1840
+ arr.push(a0)
1841
+
1842
+ const a1 = record.writerKey
1843
+ if (a1 === undefined) return arr
1844
+ arr.push(a1)
1845
+
1846
+ return arr
1847
+ }
1848
+
1849
+ // '@qvac/writers-by-most-recent'
1850
+ const index31 = {
1851
+ name: '@qvac/writers-by-most-recent',
1852
+ version: 3,
1853
+ id: 31,
1854
+ encodeKey (record) {
1855
+ return index31_key.encode(index31_indexify(record))
1856
+ },
1857
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1858
+ return index31_key.encodeRange({
1859
+ gt: gt ? index31_indexify(gt) : null,
1860
+ lt: lt ? index31_indexify(lt) : null,
1861
+ gte: gte ? index31_indexify(gte) : null,
1862
+ lte: lte ? index31_indexify(lte) : null
1863
+ })
1864
+ },
1865
+ encodeValue: (record) => index31.collection.encodeKey(record),
1866
+ encodeIndexKeys (record, context) {
1867
+ return [index31_key.encode([record.clock, record.writerKey])]
1868
+ },
1869
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
1870
+ offset: collection29.indexes.length,
1871
+ collection: collection29
1872
+ }
1873
+ collection29.indexes.push(index31)
1874
+
1875
+ // '@qvac/device-attestations' collection key
1876
+ const collection32_key = new IndexEncoder([
1877
+ IndexEncoder.BUFFER
1878
+ ], { prefix: 32 })
1879
+
1880
+ function collection32_indexify (record) {
1881
+ const a = record.deviceId
1882
+ return a === undefined ? [] : [a]
1883
+ }
1884
+
1885
+ // '@qvac/device-attestations' value encoding
1886
+ const collection32_enc = getEncoding('@qvac/device-attestation/hyperdb#32')
1887
+
1888
+ // '@qvac/device-attestations' reconstruction function
1889
+ function collection32_reconstruct (schemaVersion, keyBuf, valueBuf) {
1890
+ const key = collection32_key.decode(keyBuf)
1891
+ setVersion(schemaVersion)
1892
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
1893
+ const type = c.uint.decode(state)
1894
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
1895
+ collection32.decodedVersion = c.uint.decode(state)
1896
+ const record = collection32_enc.decode(state)
1897
+ record.deviceId = key[0]
1898
+ return record
1899
+ }
1900
+ // '@qvac/device-attestations' key reconstruction function
1901
+ function collection32_reconstruct_key (keyBuf) {
1902
+ const key = collection32_key.decode(keyBuf)
1903
+ return {
1904
+ deviceId: key[0]
1905
+ }
1906
+ }
1907
+
1908
+ // '@qvac/device-attestations'
1909
+ const collection32 = {
1910
+ name: '@qvac/device-attestations',
1911
+ id: 32,
1912
+ version: 3,
1913
+ encodeKey (record) {
1914
+ const key = [record.deviceId]
1915
+ return collection32_key.encode(key)
1916
+ },
1917
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1918
+ return collection32_key.encodeRange({
1919
+ gt: gt ? collection32_indexify(gt) : null,
1920
+ lt: lt ? collection32_indexify(lt) : null,
1921
+ gte: gte ? collection32_indexify(gte) : null,
1922
+ lte: lte ? collection32_indexify(lte) : null
1923
+ })
1924
+ },
1925
+ encodeValue (schemaVersion, collectionVersion, record) {
1926
+ setVersion(schemaVersion)
1927
+ const state = { start: 0, end: 2, buffer: null }
1928
+ collection32_enc.preencode(state, record)
1929
+ state.buffer = b4a.allocUnsafe(state.end)
1930
+ state.buffer[state.start++] = 0
1931
+ state.buffer[state.start++] = collectionVersion
1932
+ collection32_enc.encode(state, record)
1933
+ return state.buffer
1934
+ },
1935
+ trigger: null,
1936
+ reconstruct: collection32_reconstruct,
1937
+ reconstructKey: collection32_reconstruct_key,
1938
+ indexes: [],
1939
+ decodedVersion: 0
1940
+ }
1941
+
1942
+ // '@qvac/members' collection key
1943
+ const collection33_key = new IndexEncoder([
1944
+ IndexEncoder.BUFFER
1945
+ ], { prefix: 33 })
1946
+
1947
+ function collection33_indexify (record) {
1948
+ const a = record.id
1949
+ return a === undefined ? [] : [a]
1950
+ }
1951
+
1952
+ // '@qvac/members' value encoding
1953
+ const collection33_enc = getEncoding('@qvac/member/hyperdb#33')
1954
+
1955
+ // '@qvac/members' reconstruction function
1956
+ function collection33_reconstruct (schemaVersion, keyBuf, valueBuf) {
1957
+ const key = collection33_key.decode(keyBuf)
1958
+ setVersion(schemaVersion)
1959
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
1960
+ const type = c.uint.decode(state)
1961
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
1962
+ collection33.decodedVersion = c.uint.decode(state)
1963
+ const record = collection33_enc.decode(state)
1964
+ record.id = key[0]
1965
+ return record
1966
+ }
1967
+ // '@qvac/members' key reconstruction function
1968
+ function collection33_reconstruct_key (keyBuf) {
1969
+ const key = collection33_key.decode(keyBuf)
1970
+ return {
1971
+ id: key[0]
1972
+ }
1973
+ }
1974
+
1975
+ // '@qvac/members'
1976
+ const collection33 = {
1977
+ name: '@qvac/members',
1978
+ id: 33,
1979
+ version: 3,
1980
+ encodeKey (record) {
1981
+ const key = [record.id]
1982
+ return collection33_key.encode(key)
1983
+ },
1984
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
1985
+ return collection33_key.encodeRange({
1986
+ gt: gt ? collection33_indexify(gt) : null,
1987
+ lt: lt ? collection33_indexify(lt) : null,
1988
+ gte: gte ? collection33_indexify(gte) : null,
1989
+ lte: lte ? collection33_indexify(lte) : null
1990
+ })
1991
+ },
1992
+ encodeValue (schemaVersion, collectionVersion, record) {
1993
+ setVersion(schemaVersion)
1994
+ const state = { start: 0, end: 2, buffer: null }
1995
+ collection33_enc.preencode(state, record)
1996
+ state.buffer = b4a.allocUnsafe(state.end)
1997
+ state.buffer[state.start++] = 0
1998
+ state.buffer[state.start++] = collectionVersion
1999
+ collection33_enc.encode(state, record)
2000
+ return state.buffer
2001
+ },
2002
+ trigger: null,
2003
+ reconstruct: collection33_reconstruct,
2004
+ reconstructKey: collection33_reconstruct_key,
2005
+ indexes: [],
2006
+ decodedVersion: 0
2007
+ }
2008
+
2009
+ // '@qvac/chat-groups' collection key
2010
+ const collection34_key = new IndexEncoder([
2011
+ IndexEncoder.STRING
2012
+ ], { prefix: 34 })
2013
+
2014
+ function collection34_indexify (record) {
2015
+ const a = record.id
2016
+ return a === undefined ? [] : [a]
2017
+ }
2018
+
2019
+ // '@qvac/chat-groups' value encoding
2020
+ const collection34_enc = getEncoding('@qvac/chat-group/hyperdb#34')
2021
+
2022
+ // '@qvac/chat-groups' reconstruction function
2023
+ function collection34_reconstruct (schemaVersion, keyBuf, valueBuf) {
2024
+ const key = collection34_key.decode(keyBuf)
2025
+ setVersion(schemaVersion)
2026
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
2027
+ const type = c.uint.decode(state)
2028
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
2029
+ collection34.decodedVersion = c.uint.decode(state)
2030
+ const record = collection34_enc.decode(state)
2031
+ record.id = key[0]
2032
+ return record
2033
+ }
2034
+ // '@qvac/chat-groups' key reconstruction function
2035
+ function collection34_reconstruct_key (keyBuf) {
2036
+ const key = collection34_key.decode(keyBuf)
2037
+ return {
2038
+ id: key[0]
2039
+ }
2040
+ }
2041
+
2042
+ // '@qvac/chat-groups'
2043
+ const collection34 = {
2044
+ name: '@qvac/chat-groups',
2045
+ id: 34,
2046
+ version: 4,
2047
+ encodeKey (record) {
2048
+ const key = [record.id]
2049
+ return collection34_key.encode(key)
2050
+ },
2051
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
2052
+ return collection34_key.encodeRange({
2053
+ gt: gt ? collection34_indexify(gt) : null,
2054
+ lt: lt ? collection34_indexify(lt) : null,
2055
+ gte: gte ? collection34_indexify(gte) : null,
2056
+ lte: lte ? collection34_indexify(lte) : null
2057
+ })
2058
+ },
2059
+ encodeValue (schemaVersion, collectionVersion, record) {
2060
+ setVersion(schemaVersion)
2061
+ const state = { start: 0, end: 2, buffer: null }
2062
+ collection34_enc.preencode(state, record)
2063
+ state.buffer = b4a.allocUnsafe(state.end)
2064
+ state.buffer[state.start++] = 0
2065
+ state.buffer[state.start++] = collectionVersion
2066
+ collection34_enc.encode(state, record)
2067
+ return state.buffer
2068
+ },
2069
+ trigger: null,
2070
+ reconstruct: collection34_reconstruct,
2071
+ reconstructKey: collection34_reconstruct_key,
2072
+ indexes: [],
2073
+ decodedVersion: 0
2074
+ }
2075
+
2076
+ // '@qvac/active-chat-groups' collection key
2077
+ const index35_key = new IndexEncoder([
2078
+ IndexEncoder.UINT,
2079
+ IndexEncoder.STRING
2080
+ ], { prefix: 35 })
2081
+
2082
+ // '@qvac/active-chat-groups' has the following schema defined key map
2083
+ const index35_map = helpers0.activeChatGroupsMap
2084
+
2085
+ function index35_indexify (record) {
2086
+ const a = record.createdAt
2087
+ return a === undefined ? [] : [a]
2088
+ }
2089
+
2090
+ // '@qvac/active-chat-groups'
2091
+ const index35 = {
2092
+ name: '@qvac/active-chat-groups',
2093
+ version: 4,
2094
+ id: 35,
2095
+ encodeKey (record) {
2096
+ return index35_key.encode(index35_indexify(record))
2097
+ },
2098
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
2099
+ return index35_key.encodeRange({
2100
+ gt: gt ? index35_indexify(gt) : null,
2101
+ lt: lt ? index35_indexify(lt) : null,
2102
+ gte: gte ? index35_indexify(gte) : null,
2103
+ lte: lte ? index35_indexify(lte) : null
2104
+ })
2105
+ },
2106
+ encodeValue: (record) => index35.collection.encodeKey(record),
2107
+ encodeIndexKeys (record, context) {
2108
+ const mapped = index35_map(record, context)
2109
+ const keys = new Array(mapped.length)
2110
+ for (let i = 0; i < mapped.length; i++) {
2111
+ const mappedRecord = mapped[i]
2112
+ keys[i] = index35_key.encode([mappedRecord.createdAt, record.id])
2113
+ }
2114
+ return keys
2115
+ },
2116
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
2117
+ offset: collection34.indexes.length,
2118
+ collection: collection34
2119
+ }
2120
+ collection34.indexes.push(index35)
2121
+
2122
+ // '@qvac/live-writers-by-most-recent' collection key
2123
+ const index36_key = new IndexEncoder([
2124
+ IndexEncoder.UINT,
2125
+ IndexEncoder.BUFFER
2126
+ ], { prefix: 36 })
2127
+
2128
+ // '@qvac/live-writers-by-most-recent' has the following schema defined key map
2129
+ const index36_map = helpers0.liveWritersByMostRecentMap
2130
+
2131
+ function index36_indexify (record) {
2132
+ const a = record.clock
2133
+ return a === undefined ? [] : [a]
2134
+ }
2135
+
2136
+ // '@qvac/live-writers-by-most-recent'
2137
+ const index36 = {
2138
+ name: '@qvac/live-writers-by-most-recent',
2139
+ version: 4,
2140
+ id: 36,
2141
+ encodeKey (record) {
2142
+ return index36_key.encode(index36_indexify(record))
2143
+ },
2144
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
2145
+ return index36_key.encodeRange({
2146
+ gt: gt ? index36_indexify(gt) : null,
2147
+ lt: lt ? index36_indexify(lt) : null,
2148
+ gte: gte ? index36_indexify(gte) : null,
2149
+ lte: lte ? index36_indexify(lte) : null
2150
+ })
2151
+ },
2152
+ encodeValue: (record) => index36.collection.encodeKey(record),
2153
+ encodeIndexKeys (record, context) {
2154
+ const mapped = index36_map(record, context)
2155
+ const keys = new Array(mapped.length)
2156
+ for (let i = 0; i < mapped.length; i++) {
2157
+ const mappedRecord = mapped[i]
2158
+ keys[i] = index36_key.encode([mappedRecord.clock, record.writerKey])
2159
+ }
2160
+ return keys
2161
+ },
2162
+ reconstruct: (keyBuf, valueBuf) => valueBuf,
2163
+ offset: collection29.indexes.length,
2164
+ collection: collection29
2165
+ }
2166
+ collection29.indexes.push(index36)
2167
+
2168
+ const collections = [
2169
+ collection0,
2170
+ collection1,
2171
+ collection2,
2172
+ collection3,
2173
+ collection4,
2174
+ collection5,
2175
+ collection6,
2176
+ collection7,
2177
+ collection8,
2178
+ collection9,
2179
+ collection22,
2180
+ collection23,
2181
+ collection24,
2182
+ collection29,
2183
+ collection32,
2184
+ collection33,
2185
+ collection34
2186
+ ]
2187
+
2188
+ const indexes = [
2189
+ index10,
2190
+ index11,
2191
+ index12,
2192
+ index13,
2193
+ index14,
2194
+ index15,
2195
+ index16,
2196
+ index17,
2197
+ index18,
2198
+ index19,
2199
+ index20,
2200
+ index21,
2201
+ index25,
2202
+ index26,
2203
+ index27,
2204
+ index28,
2205
+ index30,
2206
+ index31,
2207
+ index35,
2208
+ index36
2209
+ ]
2210
+
2211
+ export default { versions, collections, indexes, resolveCollection, resolveIndex }
2212
+
2213
+ function resolveCollection (name) {
2214
+ switch (name) {
2215
+ case '@qvac/chunks': return collection0
2216
+ case '@qvac/chunk-counters': return collection1
2217
+ case '@qvac/agents': return collection2
2218
+ case '@qvac/approval-rules': return collection3
2219
+ case '@qvac/chats': return collection4
2220
+ case '@qvac/devices': return collection5
2221
+ case '@qvac/mesh-blind-peers': return collection6
2222
+ case '@qvac/knowledge': return collection7
2223
+ case '@qvac/knowledge-artifacts': return collection8
2224
+ case '@qvac/indexing-status': return collection9
2225
+ case '@qvac/tool-configs': return collection22
2226
+ case '@qvac/tool-activity': return collection23
2227
+ case '@qvac/tool-activity-counter': return collection24
2228
+ case '@qvac/writer-activity': return collection29
2229
+ case '@qvac/device-attestations': return collection32
2230
+ case '@qvac/members': return collection33
2231
+ case '@qvac/chat-groups': return collection34
2232
+ default: return null
2233
+ }
2234
+ }
2235
+
2236
+ function resolveIndex (name) {
2237
+ switch (name) {
2238
+ case '@qvac/chunks-by-chat': return index10
2239
+ case '@qvac/chunks-by-type': return index11
2240
+ case '@qvac/run-requests': return index12
2241
+ case '@qvac/active-agents': return index13
2242
+ case '@qvac/active-chats': return index14
2243
+ case '@qvac/active-chats-by-agent': return index15
2244
+ case '@qvac/knowledge-by-chat': return index16
2245
+ case '@qvac/knowledge-artifacts-by-knowledge': return index17
2246
+ case '@qvac/indexing-status-by-knowledge': return index18
2247
+ case '@qvac/history-chunks': return index19
2248
+ case '@qvac/indexing-status-by-chat': return index20
2249
+ case '@qvac/active-knowledge-by-chat': return index21
2250
+ case '@qvac/active-tool-configs-by-agent': return index25
2251
+ case '@qvac/attachments-by-media-kind': return index26
2252
+ case '@qvac/attachments-by-media-kind-origin': return index27
2253
+ case '@qvac/tool-activity-by-agent': return index28
2254
+ case '@qvac/devices-by-writer-key': return index30
2255
+ case '@qvac/writers-by-most-recent': return index31
2256
+ case '@qvac/active-chat-groups': return index35
2257
+ case '@qvac/live-writers-by-most-recent': return index36
2258
+ default: return null
2259
+ }
2260
+ }