@qvac/core 0.2.1 → 0.2.2

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 (263) hide show
  1. package/.claude/skills/compaction/SKILL.md +9 -4
  2. package/.claude/skills/pr-create/SKILL.md +24 -3
  3. package/.claude/skills/pr-review/SKILL.md +248 -40
  4. package/CLAUDE.md +1 -3
  5. package/README.md +3 -1
  6. package/dist-lib/client.js +1 -1
  7. package/dist-lib/index.js +8 -8
  8. package/dist-lib/lib/api/agents.d.ts +1 -1
  9. package/dist-lib/lib/api/agents.js +10 -9
  10. package/dist-lib/lib/api/app-config.js +1 -1
  11. package/dist-lib/lib/api/approval-rules.js +9 -5
  12. package/dist-lib/lib/api/attachments.js +25 -3
  13. package/dist-lib/lib/api/chat-groups.d.ts +1 -1
  14. package/dist-lib/lib/api/chat-groups.js +5 -4
  15. package/dist-lib/lib/api/chat.js +8 -8
  16. package/dist-lib/lib/api/chunks.js +11 -11
  17. package/dist-lib/lib/api/config.js +1 -1
  18. package/dist-lib/lib/api/custom-models.js +2 -2
  19. package/dist-lib/lib/api/devices.d.ts +1 -1
  20. package/dist-lib/lib/api/devices.js +9 -9
  21. package/dist-lib/lib/api/diagnostics.js +1 -1
  22. package/dist-lib/lib/api/effective-ctx-size.js +1 -1
  23. package/dist-lib/lib/api/execution.js +4 -4
  24. package/dist-lib/lib/api/files.js +2 -2
  25. package/dist-lib/lib/api/index.d.ts +1 -0
  26. package/dist-lib/lib/api/index.js +33 -33
  27. package/dist-lib/lib/api/instrument.js +1 -1
  28. package/dist-lib/lib/api/knowledge.js +4 -4
  29. package/dist-lib/lib/api/logs.js +1 -1
  30. package/dist-lib/lib/api/members.d.ts +4 -1
  31. package/dist-lib/lib/api/members.js +88 -18
  32. package/dist-lib/lib/api/mesh.d.ts +13 -3
  33. package/dist-lib/lib/api/mesh.js +25 -2
  34. package/dist-lib/lib/api/model-download.js +1 -1
  35. package/dist-lib/lib/api/network.js +1 -1
  36. package/dist-lib/lib/api/notifications.js +3 -3
  37. package/dist-lib/lib/api/rag.js +7 -7
  38. package/dist-lib/lib/api/sync.js +1 -1
  39. package/dist-lib/lib/api/tool-activity.js +4 -4
  40. package/dist-lib/lib/api/tool-configs.js +5 -5
  41. package/dist-lib/lib/api/watchable.js +1 -1
  42. package/dist-lib/lib/assistant/fetch-body.d.ts +5 -0
  43. package/dist-lib/lib/assistant/fetch-body.js +36 -0
  44. package/dist-lib/lib/assistant/harness.d.ts +225 -0
  45. package/dist-lib/lib/assistant/harness.js +154 -0
  46. package/dist-lib/lib/assistant/history.d.ts +32 -0
  47. package/dist-lib/lib/assistant/history.js +232 -0
  48. package/dist-lib/lib/assistant/message.d.ts +45 -0
  49. package/dist-lib/lib/assistant/message.js +47 -0
  50. package/dist-lib/lib/assistant/skill-encode.d.ts +21 -0
  51. package/dist-lib/lib/assistant/skill-encode.js +71 -0
  52. package/dist-lib/lib/assistant-client.js +2 -2
  53. package/dist-lib/lib/assistant-tree.js +10 -4
  54. package/dist-lib/lib/assistant.d.ts +25 -285
  55. package/dist-lib/lib/assistant.js +250 -637
  56. package/dist-lib/lib/audio-format.js +2 -2
  57. package/dist-lib/lib/client.js +2 -2
  58. package/dist-lib/lib/collabora/convert.js +1 -1
  59. package/dist-lib/lib/collabora/entry.js +1 -1
  60. package/dist-lib/lib/collabora/worker.js +1 -1
  61. package/dist-lib/lib/compaction.d.ts +1 -2
  62. package/dist-lib/lib/compaction.js +8 -6
  63. package/dist-lib/lib/constants.js +1 -1
  64. package/dist-lib/lib/core/account-recovery.d.ts +19 -0
  65. package/dist-lib/lib/core/account-recovery.js +50 -0
  66. package/dist-lib/lib/core/agent.js +8 -4
  67. package/dist-lib/lib/core/app-build.d.ts +1 -1
  68. package/dist-lib/lib/core/approval-rules.d.ts +1 -0
  69. package/dist-lib/lib/core/approval-rules.js +3 -1
  70. package/dist-lib/lib/core/archived-mesh.d.ts +25 -0
  71. package/dist-lib/lib/core/archived-mesh.js +162 -0
  72. package/dist-lib/lib/core/chat-activity.js +1 -1
  73. package/dist-lib/lib/core/chat-group.d.ts +1 -0
  74. package/dist-lib/lib/core/chat-group.js +24 -4
  75. package/dist-lib/lib/core/chat-search.js +2 -2
  76. package/dist-lib/lib/core/chat.js +5 -5
  77. package/dist-lib/lib/core/chunk.d.ts +1 -1
  78. package/dist-lib/lib/core/chunk.js +4 -4
  79. package/dist-lib/lib/core/contract/agents.js +1 -1
  80. package/dist-lib/lib/core/contract/approval-rules.js +6 -4
  81. package/dist-lib/lib/core/contract/attestations.js +1 -1
  82. package/dist-lib/lib/core/contract/chat-group.js +1 -1
  83. package/dist-lib/lib/core/contract/chat.js +1 -1
  84. package/dist-lib/lib/core/contract/chunks.js +2 -2
  85. package/dist-lib/lib/core/contract/compute.d.ts +11 -0
  86. package/dist-lib/lib/core/contract/compute.js +45 -0
  87. package/dist-lib/lib/core/contract/devices.js +16 -3
  88. package/dist-lib/lib/core/contract/index.d.ts +3 -1
  89. package/dist-lib/lib/core/contract/index.js +19 -16
  90. package/dist-lib/lib/core/contract/indexing.js +2 -2
  91. package/dist-lib/lib/core/contract/joined-meshes.js +1 -1
  92. package/dist-lib/lib/core/contract/knowledge.js +2 -2
  93. package/dist-lib/lib/core/contract/members.js +2 -2
  94. package/dist-lib/lib/core/contract/seal.d.ts +2 -0
  95. package/dist-lib/lib/core/contract/seal.js +8 -0
  96. package/dist-lib/lib/core/contract/seed-defaults.js +1 -1
  97. package/dist-lib/lib/core/contract/tool-activity.js +1 -1
  98. package/dist-lib/lib/core/contract/tool-configs.js +3 -3
  99. package/dist-lib/lib/core/contract/writers.js +66 -42
  100. package/dist-lib/lib/core/departures.js +1 -1
  101. package/dist-lib/lib/core/device-invites.js +1 -1
  102. package/dist-lib/lib/core/document-attachment.js +2 -2
  103. package/dist-lib/lib/core/files/attachments.js +3 -3
  104. package/dist-lib/lib/core/files/index.d.ts +2 -2
  105. package/dist-lib/lib/core/files/index.js +19 -19
  106. package/dist-lib/lib/core/files/knowledge.js +3 -3
  107. package/dist-lib/lib/core/files/preview/image.js +1 -1
  108. package/dist-lib/lib/core/files/preview/index.js +6 -6
  109. package/dist-lib/lib/core/files/processing/claims.js +1 -1
  110. package/dist-lib/lib/core/files/processing/document.js +5 -5
  111. package/dist-lib/lib/core/files/processing/index.js +8 -8
  112. package/dist-lib/lib/core/files/processing/ownership.js +1 -1
  113. package/dist-lib/lib/core/files/processing/protocol.js +3 -3
  114. package/dist-lib/lib/core/files/processing/source.js +1 -1
  115. package/dist-lib/lib/core/files/rag/artifact/codec.js +1 -1
  116. package/dist-lib/lib/core/files/rag/artifact/id.js +1 -1
  117. package/dist-lib/lib/core/files/rag/artifact/types.d.ts +4 -4
  118. package/dist-lib/lib/core/files/rag/build.js +2 -2
  119. package/dist-lib/lib/core/files/rag/chunk/chunking.js +2 -2
  120. package/dist-lib/lib/core/files/rag/document-types.d.ts +3 -3
  121. package/dist-lib/lib/core/files/rag/extract/document-types.d.ts +9 -9
  122. package/dist-lib/lib/core/files/rag/extract/extract.js +7 -7
  123. package/dist-lib/lib/core/files/rag/extract/html-text.js +1 -1
  124. package/dist-lib/lib/core/files/rag/extract/office-collabora.js +2 -2
  125. package/dist-lib/lib/core/files/rag/extract/pdf-platform.js +1 -1
  126. package/dist-lib/lib/core/files/rag/extract/pdf-text.js +1 -1
  127. package/dist-lib/lib/core/files/rag/extract/text-decoding.js +1 -1
  128. package/dist-lib/lib/core/files/rag/extract/types.d.ts +2 -2
  129. package/dist-lib/lib/core/files/rag/index.js +22 -22
  130. package/dist-lib/lib/core/files/rag/load.js +5 -5
  131. package/dist-lib/lib/core/files/rag/policy.js +2 -2
  132. package/dist-lib/lib/core/files/rag/produce.js +5 -5
  133. package/dist-lib/lib/core/files/rag/retrieval/coverage.js +2 -2
  134. package/dist-lib/lib/core/files/rag/retrieval/diversity.js +1 -1
  135. package/dist-lib/lib/core/files/rag/retrieval/floor.js +2 -2
  136. package/dist-lib/lib/core/files/rag/retrieval/format.js +1 -1
  137. package/dist-lib/lib/core/files/rag/retrieval/full-text.js +18 -11
  138. package/dist-lib/lib/core/files/rag/retrieval/knowledge.js +5 -5
  139. package/dist-lib/lib/core/files/rag/retrieval/scoring.js +2 -2
  140. package/dist-lib/lib/core/files/rag/retrieval/search.js +4 -4
  141. package/dist-lib/lib/core/files/rag/retrieval/selection.js +2 -2
  142. package/dist-lib/lib/core/files/rag/retrieval/sources.js +2 -2
  143. package/dist-lib/lib/core/files/rag/retrieval/terms.js +1 -1
  144. package/dist-lib/lib/core/files/rag/retrieval/web-sources.js +1 -1
  145. package/dist-lib/lib/core/files/records/chunks.js +1 -1
  146. package/dist-lib/lib/core/files/records/index.js +8 -8
  147. package/dist-lib/lib/core/files/records/knowledge.js +2 -2
  148. package/dist-lib/lib/core/files/records/output.js +1 -1
  149. package/dist-lib/lib/core/files/records/reclaim.js +5 -5
  150. package/dist-lib/lib/core/files/records/routing.js +7 -7
  151. package/dist-lib/lib/core/files/store/blob.js +2 -2
  152. package/dist-lib/lib/core/files/store/index.js +7 -7
  153. package/dist-lib/lib/core/files/store/reference.js +2 -2
  154. package/dist-lib/lib/core/files/store/server.js +1 -1
  155. package/dist-lib/lib/core/files/store/sweep.js +1 -1
  156. package/dist-lib/lib/core/files/upload-input.js +2 -2
  157. package/dist-lib/lib/core/files/upload.d.ts +1 -1
  158. package/dist-lib/lib/core/files/upload.js +6 -6
  159. package/dist-lib/lib/core/harness-loan.d.ts +29 -0
  160. package/dist-lib/lib/core/harness-loan.js +187 -0
  161. package/dist-lib/lib/core/helpers/index.d.ts +2 -1
  162. package/dist-lib/lib/core/helpers/index.js +4 -4
  163. package/dist-lib/lib/core/hosted-agents.js +2 -2
  164. package/dist-lib/lib/core/identity.d.ts +2 -0
  165. package/dist-lib/lib/core/identity.js +4 -2
  166. package/dist-lib/lib/core/invite.d.ts +1 -0
  167. package/dist-lib/lib/core/invite.js +4 -2
  168. package/dist-lib/lib/core/local/index.d.ts +12 -3
  169. package/dist-lib/lib/core/local/index.js +75 -16
  170. package/dist-lib/lib/core/membership.d.ts +3 -0
  171. package/dist-lib/lib/core/membership.js +15 -1
  172. package/dist-lib/lib/core/mesh-seed-handoff.js +1 -1
  173. package/dist-lib/lib/core/mesh.d.ts +9 -3
  174. package/dist-lib/lib/core/mesh.js +41 -26
  175. package/dist-lib/lib/core/migrations/agent-catalog.js +1 -1
  176. package/dist-lib/lib/core/migrations/index.js +5 -3
  177. package/dist-lib/lib/core/migrations/membership.js +2 -2
  178. package/dist-lib/lib/core/migrations/seal.d.ts +3 -0
  179. package/dist-lib/lib/core/migrations/seal.js +30 -0
  180. package/dist-lib/lib/core/next-frame.js +1 -1
  181. package/dist-lib/lib/core/notification.js +1 -1
  182. package/dist-lib/lib/core/ota-config.js +1 -1
  183. package/dist-lib/lib/core/secret-handoff.js +1 -1
  184. package/dist-lib/lib/core/send.js +3 -3
  185. package/dist-lib/lib/core/skill-overlay-handoff.js +1 -1
  186. package/dist-lib/lib/core/skill-overlay-receiver.js +2 -2
  187. package/dist-lib/lib/core/skill-secrets.js +3 -3
  188. package/dist-lib/lib/core/sync/devices.js +1 -1
  189. package/dist-lib/lib/core/sync/index.js +8 -5
  190. package/dist-lib/lib/core/sync-status.js +1 -1
  191. package/dist-lib/lib/core/system-info.js +1 -1
  192. package/dist-lib/lib/core/tool-activity.js +2 -2
  193. package/dist-lib/lib/core/tool-configs.js +2 -2
  194. package/dist-lib/lib/core.d.ts +41 -3
  195. package/dist-lib/lib/core.js +525 -90
  196. package/dist-lib/lib/credential-pusher.js +4 -4
  197. package/dist-lib/lib/deadline.js +1 -1
  198. package/dist-lib/lib/fs-drive-bridge.js +4 -2
  199. package/dist-lib/lib/integrations/index.js +3 -3
  200. package/dist-lib/lib/integrations/oauth-providers.js +1 -1
  201. package/dist-lib/lib/integrations/setup-routes.d.ts +5 -5
  202. package/dist-lib/lib/integrations/setup-routes.js +3 -3
  203. package/dist-lib/lib/knowledge-search.js +1 -1
  204. package/dist-lib/lib/log.js +3 -3
  205. package/dist-lib/lib/mesh-scoped-engine.d.ts +3 -0
  206. package/dist-lib/lib/mesh-scoped-engine.js +96 -0
  207. package/dist-lib/lib/model-context.d.ts +2 -2
  208. package/dist-lib/lib/model-context.js +1 -1
  209. package/dist-lib/lib/model-download.js +6 -6
  210. package/dist-lib/lib/oauth/asana.js +3 -3
  211. package/dist-lib/lib/oauth/browser-connect.js +1 -1
  212. package/dist-lib/lib/oauth/client.js +2 -2
  213. package/dist-lib/lib/oauth/common.d.ts +1 -1
  214. package/dist-lib/lib/oauth/common.js +1 -1
  215. package/dist-lib/lib/oauth/flow-core.js +3 -3
  216. package/dist-lib/lib/oauth/flow.js +2 -2
  217. package/dist-lib/lib/oauth/google.js +4 -4
  218. package/dist-lib/lib/oauth/host.js +3 -3
  219. package/dist-lib/lib/oauth/loopback.js +1 -1
  220. package/dist-lib/lib/oauth/notion.js +3 -3
  221. package/dist-lib/lib/oauth/providers.js +1 -1
  222. package/dist-lib/lib/oauth/resolve.js +1 -1
  223. package/dist-lib/lib/oauth/spotify.js +3 -3
  224. package/dist-lib/lib/oauth/token-exchange.js +1 -1
  225. package/dist-lib/lib/oauth.client.js +2 -2
  226. package/dist-lib/lib/oauth.js +12 -12
  227. package/dist-lib/lib/run-notices.d.ts +7 -7
  228. package/dist-lib/lib/run-transcript.js +1 -1
  229. package/dist-lib/schema/build.js +12 -6
  230. package/dist-lib/schema/content.d.ts +11 -11
  231. package/dist-lib/schema/engine.js +193 -30
  232. package/dist-lib/schema/field-order.js +2 -2
  233. package/dist-lib/schema/local.js +18 -4
  234. package/dist-lib/schema/qvac.js +15 -6
  235. package/dist-lib/spec/bind.js +41 -0
  236. package/dist-lib/spec/calls.js +12 -0
  237. package/dist-lib/spec/capabilities.d.ts +36 -12
  238. package/dist-lib/spec/hrpc/hrpc.json +161 -5
  239. package/dist-lib/spec/hrpc/index.js +154 -9
  240. package/dist-lib/spec/hrpc/messages.js +549 -129
  241. package/dist-lib/spec/hyperschema/index.js +549 -129
  242. package/dist-lib/spec/hyperschema/schema.json +370 -40
  243. package/dist-lib/spec/hyperschema/types.d.ts +85 -1
  244. package/dist-lib/spec/local/hyperdb/db.json +15 -0
  245. package/dist-lib/spec/local/hyperdb/index.js +70 -1
  246. package/dist-lib/spec/local/hyperdb/messages.js +300 -117
  247. package/dist-lib/spec/local/hyperschema/index.js +97 -4
  248. package/dist-lib/spec/local/hyperschema/schema.json +58 -1
  249. package/dist-lib/spec/local/hyperschema/types.d.ts +14 -0
  250. package/dist-lib/spec/mesh/hyperdb/messages.js +393 -288
  251. package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +6 -0
  252. package/dist-lib/spec/mesh/hyperdispatch/index.js +18 -1
  253. package/dist-lib/spec/mesh/hyperdispatch/messages.js +176 -85
  254. package/dist-lib/spec/mesh/hyperschema/index.js +176 -85
  255. package/dist-lib/spec/mesh/hyperschema/schema.json +71 -21
  256. package/dist-lib/spec/mesh/hyperschema/types.d.ts +14 -1
  257. package/package.json +15 -9
  258. package/tui/README.md +7 -0
  259. package/tui/app.mjs +311 -14
  260. package/tui/lib/busy-words.mjs +57 -5
  261. package/tui/lib/export.mjs +1 -0
  262. package/tui/lib/render.mjs +9 -2
  263. package/tui/main.mjs +5 -2
@@ -733,12 +733,20 @@ const encoding17 = {
733
733
  c.buffer.preencode(state, m.publicKey)
734
734
  c.buffer.preencode(state, m.proof)
735
735
  c.uint.preencode(state, m.createdAt)
736
+ state.end++ // max flag is 1 so always one byte
737
+
738
+ if (version >= 5 && m.displayName) c.string.preencode(state, m.displayName)
736
739
  },
737
740
  encode(state, m) {
741
+ const flags = (version >= 5 && m.displayName) ? 1 : 0
742
+
738
743
  c.string.encode(state, m.id)
739
744
  c.buffer.encode(state, m.publicKey)
740
745
  c.buffer.encode(state, m.proof)
741
746
  c.uint.encode(state, m.createdAt)
747
+ c.uint.encode(state, flags)
748
+
749
+ if (version >= 5 && m.displayName) c.string.encode(state, m.displayName)
742
750
  },
743
751
  decode(state) {
744
752
  const v = c.uint.decode(state)
@@ -746,13 +754,15 @@ const encoding17 = {
746
754
  const r1 = c.buffer.decode(state)
747
755
  const r2 = c.buffer.decode(state)
748
756
  const r3 = c.uint.decode(state)
757
+ const flags = state.start < state.end ? c.uint.decode(state) : 0
749
758
 
750
759
  return {
751
760
  version: v,
752
761
  id: r0,
753
762
  publicKey: r1,
754
763
  proof: r2,
755
- createdAt: r3
764
+ createdAt: r3,
765
+ displayName: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null
756
766
  }
757
767
  }
758
768
  }
@@ -1177,13 +1187,19 @@ const encoding29 = {
1177
1187
  preencode(state, m) {
1178
1188
  c.fixed32.preencode(state, m.key)
1179
1189
  c.fixed32.preencode(state, m.seed)
1180
- state.end++ // max flag is 2 so always one byte
1190
+ state.end++ // max flag is 16 so always one byte
1181
1191
 
1182
1192
  if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
1183
1193
  if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
1194
+ if (version >= 5 && m.migratedAt) c.uint.preencode(state, m.migratedAt)
1184
1195
  },
1185
1196
  encode(state, m) {
1186
- const flags = ((version >= 5 && m.writerSeed) ? 1 : 0) | ((version >= 5 && m.leftAt) ? 2 : 0)
1197
+ const flags =
1198
+ ((version >= 5 && m.writerSeed) ? 1 : 0) |
1199
+ ((version >= 5 && m.leftAt) ? 2 : 0) |
1200
+ ((version >= 5 && m.wasHome) ? 4 : 0) |
1201
+ ((version >= 5 && m.migratedAt) ? 8 : 0) |
1202
+ ((version >= 5 && m.compute) ? 16 : 0)
1187
1203
 
1188
1204
  c.fixed32.encode(state, m.key)
1189
1205
  c.fixed32.encode(state, m.seed)
@@ -1191,6 +1207,7 @@ const encoding29 = {
1191
1207
 
1192
1208
  if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
1193
1209
  if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
1210
+ if (version >= 5 && m.migratedAt) c.uint.encode(state, m.migratedAt)
1194
1211
  },
1195
1212
  decode(state) {
1196
1213
  const v = c.uint.decode(state)
@@ -1203,7 +1220,10 @@ const encoding29 = {
1203
1220
  key: r0,
1204
1221
  seed: r1,
1205
1222
  writerSeed: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null,
1206
- leftAt: (version >= 5 && (flags & 2) !== 0) ? c.uint.decode(state) : 0
1223
+ leftAt: (version >= 5 && (flags & 2) !== 0) ? c.uint.decode(state) : 0,
1224
+ wasHome: (version >= 5 && (flags & 4) !== 0),
1225
+ migratedAt: (version >= 5 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
1226
+ compute: (version >= 5 && (flags & 16) !== 0)
1207
1227
  }
1208
1228
  }
1209
1229
  }
@@ -1323,8 +1343,77 @@ const encoding32 = {
1323
1343
  }
1324
1344
  }
1325
1345
 
1326
- // @local/config-v1/hyperdb#0
1346
+ // @local/account-recovery-v1
1327
1347
  const encoding33 = {
1348
+ preencode(state, m) {
1349
+ c.fixed32.preencode(state, m.meshKey)
1350
+ c.fixed32.preencode(state, m.coreKey)
1351
+ c.uint.preencode(state, m.publishedAt)
1352
+ },
1353
+ encode(state, m) {
1354
+ c.fixed32.encode(state, m.meshKey)
1355
+ c.fixed32.encode(state, m.coreKey)
1356
+ c.uint.encode(state, m.publishedAt)
1357
+ },
1358
+ decode(state) {
1359
+ const v = c.uint.decode(state)
1360
+ const r0 = c.fixed32.decode(state)
1361
+ const r1 = c.fixed32.decode(state)
1362
+ const r2 = c.uint.decode(state)
1363
+
1364
+ return {
1365
+ version: v,
1366
+ meshKey: r0,
1367
+ coreKey: r1,
1368
+ publishedAt: r2
1369
+ }
1370
+ }
1371
+ }
1372
+
1373
+ // @local/account-recovery
1374
+ const encoding34 = {
1375
+ preencode(state, m) {
1376
+ const v = m.version ?? 1
1377
+ c.uint.preencode(state, v)
1378
+ switch (v) {
1379
+ case 0:
1380
+ case 1:
1381
+ encoding33.preencode(state, m)
1382
+ break
1383
+ default:
1384
+ throw new Error('Unsupported version')
1385
+ }
1386
+ },
1387
+ encode(state, m) {
1388
+ const v = m.version ?? 1
1389
+ c.uint.encode(state, v)
1390
+ switch (v) {
1391
+ case 0:
1392
+ case 1:
1393
+ encoding33.encode(state, m)
1394
+ break
1395
+ default:
1396
+ throw new Error('Unsupported version')
1397
+ }
1398
+ },
1399
+ decode(state) {
1400
+ const start = state.start
1401
+ const v = c.uint.decode(state)
1402
+ state.start = start
1403
+ switch (v) {
1404
+ case 0:
1405
+ case 1: {
1406
+ const decoded = encoding33.decode(state)
1407
+ return decoded
1408
+ }
1409
+ default:
1410
+ throw new Error('Unsupported version')
1411
+ }
1412
+ }
1413
+ }
1414
+
1415
+ // @local/config-v1/hyperdb#0
1416
+ const encoding35 = {
1328
1417
  preencode(state, m) {
1329
1418
  state.end++ // max flag is 1 so always one byte
1330
1419
 
@@ -1350,14 +1439,14 @@ const encoding33 = {
1350
1439
  }
1351
1440
 
1352
1441
  // @local/config/hyperdb#0
1353
- const encoding34 = {
1442
+ const encoding36 = {
1354
1443
  preencode(state, m) {
1355
1444
  const v = m.version ?? 1
1356
1445
  c.uint.preencode(state, v)
1357
1446
  switch (v) {
1358
1447
  case 0:
1359
1448
  case 1:
1360
- encoding33.preencode(state, m)
1449
+ encoding35.preencode(state, m)
1361
1450
  break
1362
1451
  default:
1363
1452
  throw new Error('Unsupported version')
@@ -1369,7 +1458,7 @@ const encoding34 = {
1369
1458
  switch (v) {
1370
1459
  case 0:
1371
1460
  case 1:
1372
- encoding33.encode(state, m)
1461
+ encoding35.encode(state, m)
1373
1462
  break
1374
1463
  default:
1375
1464
  throw new Error('Unsupported version')
@@ -1382,7 +1471,7 @@ const encoding34 = {
1382
1471
  switch (v) {
1383
1472
  case 0:
1384
1473
  case 1: {
1385
- const decoded = encoding33.decode(state)
1474
+ const decoded = encoding35.decode(state)
1386
1475
  return decoded
1387
1476
  }
1388
1477
  default:
@@ -1392,7 +1481,7 @@ const encoding34 = {
1392
1481
  }
1393
1482
 
1394
1483
  // @local/mesh-session-v1/hyperdb#1
1395
- const encoding35 = {
1484
+ const encoding37 = {
1396
1485
  preencode(state, m) {
1397
1486
  state.end++ // max flag is 4 so always one byte
1398
1487
 
@@ -1422,14 +1511,14 @@ const encoding35 = {
1422
1511
  }
1423
1512
 
1424
1513
  // @local/mesh-session/hyperdb#1
1425
- const encoding36 = {
1514
+ const encoding38 = {
1426
1515
  preencode(state, m) {
1427
1516
  const v = m.version ?? 1
1428
1517
  c.uint.preencode(state, v)
1429
1518
  switch (v) {
1430
1519
  case 0:
1431
1520
  case 1:
1432
- encoding35.preencode(state, m)
1521
+ encoding37.preencode(state, m)
1433
1522
  break
1434
1523
  default:
1435
1524
  throw new Error('Unsupported version')
@@ -1441,7 +1530,7 @@ const encoding36 = {
1441
1530
  switch (v) {
1442
1531
  case 0:
1443
1532
  case 1:
1444
- encoding35.encode(state, m)
1533
+ encoding37.encode(state, m)
1445
1534
  break
1446
1535
  default:
1447
1536
  throw new Error('Unsupported version')
@@ -1454,7 +1543,7 @@ const encoding36 = {
1454
1543
  switch (v) {
1455
1544
  case 0:
1456
1545
  case 1: {
1457
- const decoded = encoding35.decode(state)
1546
+ const decoded = encoding37.decode(state)
1458
1547
  return decoded
1459
1548
  }
1460
1549
  default:
@@ -1464,7 +1553,7 @@ const encoding36 = {
1464
1553
  }
1465
1554
 
1466
1555
  // @local/mesh-history-v1/hyperdb#2
1467
- const encoding37 = {
1556
+ const encoding39 = {
1468
1557
  preencode(state, m) {
1469
1558
  c.buffer.preencode(state, m.seed)
1470
1559
  state.end++ // max flag is 2 so always one byte
@@ -1495,14 +1584,14 @@ const encoding37 = {
1495
1584
  }
1496
1585
 
1497
1586
  // @local/mesh-history/hyperdb#2
1498
- const encoding38 = {
1587
+ const encoding40 = {
1499
1588
  preencode(state, m) {
1500
1589
  const v = m.version ?? 1
1501
1590
  c.uint.preencode(state, v)
1502
1591
  switch (v) {
1503
1592
  case 0:
1504
1593
  case 1:
1505
- encoding37.preencode(state, m)
1594
+ encoding39.preencode(state, m)
1506
1595
  break
1507
1596
  default:
1508
1597
  throw new Error('Unsupported version')
@@ -1514,7 +1603,7 @@ const encoding38 = {
1514
1603
  switch (v) {
1515
1604
  case 0:
1516
1605
  case 1:
1517
- encoding37.encode(state, m)
1606
+ encoding39.encode(state, m)
1518
1607
  break
1519
1608
  default:
1520
1609
  throw new Error('Unsupported version')
@@ -1527,7 +1616,7 @@ const encoding38 = {
1527
1616
  switch (v) {
1528
1617
  case 0:
1529
1618
  case 1: {
1530
- const decoded = encoding37.decode(state)
1619
+ const decoded = encoding39.decode(state)
1531
1620
  return decoded
1532
1621
  }
1533
1622
  default:
@@ -1537,7 +1626,7 @@ const encoding38 = {
1537
1626
  }
1538
1627
 
1539
1628
  // @local/device-v1/hyperdb#3
1540
- const encoding39 = {
1629
+ const encoding41 = {
1541
1630
  preencode(state, m) {
1542
1631
  c.string.preencode(state, m.name)
1543
1632
  encoding14.preencode(state, m.capabilityProfile)
@@ -1575,14 +1664,14 @@ const encoding39 = {
1575
1664
  }
1576
1665
 
1577
1666
  // @local/device/hyperdb#3
1578
- const encoding40 = {
1667
+ const encoding42 = {
1579
1668
  preencode(state, m) {
1580
1669
  const v = m.version ?? 1
1581
1670
  c.uint.preencode(state, v)
1582
1671
  switch (v) {
1583
1672
  case 0:
1584
1673
  case 1:
1585
- encoding39.preencode(state, m)
1674
+ encoding41.preencode(state, m)
1586
1675
  break
1587
1676
  default:
1588
1677
  throw new Error('Unsupported version')
@@ -1594,7 +1683,7 @@ const encoding40 = {
1594
1683
  switch (v) {
1595
1684
  case 0:
1596
1685
  case 1:
1597
- encoding39.encode(state, m)
1686
+ encoding41.encode(state, m)
1598
1687
  break
1599
1688
  default:
1600
1689
  throw new Error('Unsupported version')
@@ -1607,7 +1696,7 @@ const encoding40 = {
1607
1696
  switch (v) {
1608
1697
  case 0:
1609
1698
  case 1: {
1610
- const decoded = encoding39.decode(state)
1699
+ const decoded = encoding41.decode(state)
1611
1700
  return decoded
1612
1701
  }
1613
1702
  default:
@@ -1617,10 +1706,10 @@ const encoding40 = {
1617
1706
  }
1618
1707
 
1619
1708
  // @local/app-config-v1/hyperdb#4.pausedModels
1620
- const encoding41_8 = encoding9_8
1709
+ const encoding43_8 = encoding9_8
1621
1710
 
1622
1711
  // @local/app-config-v1/hyperdb#4
1623
- const encoding41 = {
1712
+ const encoding43 = {
1624
1713
  preencode(state, m) {
1625
1714
  const flags =
1626
1715
  (m.activeAgentId ? 1 : 0) |
@@ -1639,7 +1728,7 @@ const encoding41 = {
1639
1728
  if (m.ctxSize) c.uint.preencode(state, m.ctxSize)
1640
1729
  if (m.lastModelName) c.string.preencode(state, m.lastModelName)
1641
1730
  if (m.delegation) c.json.preencode(state, m.delegation)
1642
- if (m.pausedModels) encoding41_8.preencode(state, m.pausedModels)
1731
+ if (m.pausedModels) encoding43_8.preencode(state, m.pausedModels)
1643
1732
  },
1644
1733
  encode(state, m) {
1645
1734
  const flags =
@@ -1659,7 +1748,7 @@ const encoding41 = {
1659
1748
  if (m.ctxSize) c.uint.encode(state, m.ctxSize)
1660
1749
  if (m.lastModelName) c.string.encode(state, m.lastModelName)
1661
1750
  if (m.delegation) c.json.encode(state, m.delegation)
1662
- if (m.pausedModels) encoding41_8.encode(state, m.pausedModels)
1751
+ if (m.pausedModels) encoding43_8.encode(state, m.pausedModels)
1663
1752
  },
1664
1753
  decode(state) {
1665
1754
  const v = c.uint.decode(state)
@@ -1675,20 +1764,20 @@ const encoding41 = {
1675
1764
  lastModelName: (flags & 16) !== 0 ? c.string.decode(state) : null,
1676
1765
  onboardingCompleted: (flags & 32) !== 0,
1677
1766
  delegation: (flags & 64) !== 0 ? c.json.decode(state) : null,
1678
- pausedModels: (flags & 128) !== 0 ? encoding41_8.decode(state) : null
1767
+ pausedModels: (flags & 128) !== 0 ? encoding43_8.decode(state) : null
1679
1768
  }
1680
1769
  }
1681
1770
  }
1682
1771
 
1683
1772
  // @local/app-config/hyperdb#4
1684
- const encoding42 = {
1773
+ const encoding44 = {
1685
1774
  preencode(state, m) {
1686
1775
  const v = m.version ?? 1
1687
1776
  c.uint.preencode(state, v)
1688
1777
  switch (v) {
1689
1778
  case 0:
1690
1779
  case 1:
1691
- encoding41.preencode(state, m)
1780
+ encoding43.preencode(state, m)
1692
1781
  break
1693
1782
  default:
1694
1783
  throw new Error('Unsupported version')
@@ -1700,7 +1789,7 @@ const encoding42 = {
1700
1789
  switch (v) {
1701
1790
  case 0:
1702
1791
  case 1:
1703
- encoding41.encode(state, m)
1792
+ encoding43.encode(state, m)
1704
1793
  break
1705
1794
  default:
1706
1795
  throw new Error('Unsupported version')
@@ -1713,7 +1802,7 @@ const encoding42 = {
1713
1802
  switch (v) {
1714
1803
  case 0:
1715
1804
  case 1: {
1716
- const decoded = encoding41.decode(state)
1805
+ const decoded = encoding43.decode(state)
1717
1806
  return decoded
1718
1807
  }
1719
1808
  default:
@@ -1723,7 +1812,7 @@ const encoding42 = {
1723
1812
  }
1724
1813
 
1725
1814
  // @local/model-download-v1/hyperdb#5
1726
- const encoding43 = {
1815
+ const encoding45 = {
1727
1816
  preencode(state, m) {
1728
1817
  encoding11.preencode(state, m.phase)
1729
1818
  state.end++ // max flag is 16 so always one byte
@@ -1773,14 +1862,14 @@ const encoding43 = {
1773
1862
  }
1774
1863
 
1775
1864
  // @local/model-download/hyperdb#5
1776
- const encoding44 = {
1865
+ const encoding46 = {
1777
1866
  preencode(state, m) {
1778
1867
  const v = m.version ?? 1
1779
1868
  c.uint.preencode(state, v)
1780
1869
  switch (v) {
1781
1870
  case 0:
1782
1871
  case 1:
1783
- encoding43.preencode(state, m)
1872
+ encoding45.preencode(state, m)
1784
1873
  break
1785
1874
  default:
1786
1875
  throw new Error('Unsupported version')
@@ -1792,7 +1881,7 @@ const encoding44 = {
1792
1881
  switch (v) {
1793
1882
  case 0:
1794
1883
  case 1:
1795
- encoding43.encode(state, m)
1884
+ encoding45.encode(state, m)
1796
1885
  break
1797
1886
  default:
1798
1887
  throw new Error('Unsupported version')
@@ -1805,7 +1894,7 @@ const encoding44 = {
1805
1894
  switch (v) {
1806
1895
  case 0:
1807
1896
  case 1: {
1808
- const decoded = encoding43.decode(state)
1897
+ const decoded = encoding45.decode(state)
1809
1898
  return decoded
1810
1899
  }
1811
1900
  default:
@@ -1815,7 +1904,7 @@ const encoding44 = {
1815
1904
  }
1816
1905
 
1817
1906
  // @local/custom-model-v1/hyperdb#6
1818
- const encoding45 = {
1907
+ const encoding47 = {
1819
1908
  preencode(state, m) {
1820
1909
  c.string.preencode(state, m.src)
1821
1910
  state.end++ // max flag is 16 so always one byte
@@ -1859,14 +1948,14 @@ const encoding45 = {
1859
1948
  }
1860
1949
 
1861
1950
  // @local/custom-model/hyperdb#6
1862
- const encoding46 = {
1951
+ const encoding48 = {
1863
1952
  preencode(state, m) {
1864
1953
  const v = m.version ?? 1
1865
1954
  c.uint.preencode(state, v)
1866
1955
  switch (v) {
1867
1956
  case 0:
1868
1957
  case 1:
1869
- encoding45.preencode(state, m)
1958
+ encoding47.preencode(state, m)
1870
1959
  break
1871
1960
  default:
1872
1961
  throw new Error('Unsupported version')
@@ -1878,7 +1967,7 @@ const encoding46 = {
1878
1967
  switch (v) {
1879
1968
  case 0:
1880
1969
  case 1:
1881
- encoding45.encode(state, m)
1970
+ encoding47.encode(state, m)
1882
1971
  break
1883
1972
  default:
1884
1973
  throw new Error('Unsupported version')
@@ -1891,7 +1980,7 @@ const encoding46 = {
1891
1980
  switch (v) {
1892
1981
  case 0:
1893
1982
  case 1: {
1894
- const decoded = encoding45.decode(state)
1983
+ const decoded = encoding47.decode(state)
1895
1984
  return decoded
1896
1985
  }
1897
1986
  default:
@@ -1901,42 +1990,52 @@ const encoding46 = {
1901
1990
  }
1902
1991
 
1903
1992
  // @local/identity-v1/hyperdb#7
1904
- const encoding47 = {
1993
+ const encoding49 = {
1905
1994
  preencode(state, m) {
1906
1995
  c.buffer.preencode(state, m.publicKey)
1907
1996
  c.buffer.preencode(state, m.proof)
1908
1997
  c.uint.preencode(state, m.createdAt)
1998
+ state.end++ // max flag is 1 so always one byte
1999
+
2000
+ if (version >= 5 && m.displayName) c.string.preencode(state, m.displayName)
1909
2001
  },
1910
2002
  encode(state, m) {
2003
+ const flags = (version >= 5 && m.displayName) ? 1 : 0
2004
+
1911
2005
  c.buffer.encode(state, m.publicKey)
1912
2006
  c.buffer.encode(state, m.proof)
1913
2007
  c.uint.encode(state, m.createdAt)
2008
+ c.uint.encode(state, flags)
2009
+
2010
+ if (version >= 5 && m.displayName) c.string.encode(state, m.displayName)
1914
2011
  },
1915
2012
  decode(state) {
1916
2013
  const v = c.uint.decode(state)
1917
2014
  const r1 = c.buffer.decode(state)
1918
2015
  const r2 = c.buffer.decode(state)
1919
2016
  const r3 = c.uint.decode(state)
2017
+ const flags = state.start < state.end ? c.uint.decode(state) : 0
1920
2018
 
1921
2019
  return {
1922
2020
  version: v,
1923
2021
  id: null,
1924
2022
  publicKey: r1,
1925
2023
  proof: r2,
1926
- createdAt: r3
2024
+ createdAt: r3,
2025
+ displayName: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null
1927
2026
  }
1928
2027
  }
1929
2028
  }
1930
2029
 
1931
2030
  // @local/identity/hyperdb#7
1932
- const encoding48 = {
2031
+ const encoding50 = {
1933
2032
  preencode(state, m) {
1934
2033
  const v = m.version ?? 1
1935
2034
  c.uint.preencode(state, v)
1936
2035
  switch (v) {
1937
2036
  case 0:
1938
2037
  case 1:
1939
- encoding47.preencode(state, m)
2038
+ encoding49.preencode(state, m)
1940
2039
  break
1941
2040
  default:
1942
2041
  throw new Error('Unsupported version')
@@ -1948,7 +2047,7 @@ const encoding48 = {
1948
2047
  switch (v) {
1949
2048
  case 0:
1950
2049
  case 1:
1951
- encoding47.encode(state, m)
2050
+ encoding49.encode(state, m)
1952
2051
  break
1953
2052
  default:
1954
2053
  throw new Error('Unsupported version')
@@ -1961,7 +2060,7 @@ const encoding48 = {
1961
2060
  switch (v) {
1962
2061
  case 0:
1963
2062
  case 1: {
1964
- const decoded = encoding47.decode(state)
2063
+ const decoded = encoding49.decode(state)
1965
2064
  return decoded
1966
2065
  }
1967
2066
  default:
@@ -1971,7 +2070,7 @@ const encoding48 = {
1971
2070
  }
1972
2071
 
1973
2072
  // @local/membership-v1/hyperdb#8
1974
- const encoding49 = {
2073
+ const encoding51 = {
1975
2074
  preencode(state, m) {
1976
2075
  c.fixed32.preencode(state, m.memberId)
1977
2076
  c.buffer.preencode(state, m.proof)
@@ -1999,14 +2098,14 @@ const encoding49 = {
1999
2098
  }
2000
2099
 
2001
2100
  // @local/membership/hyperdb#8
2002
- const encoding50 = {
2101
+ const encoding52 = {
2003
2102
  preencode(state, m) {
2004
2103
  const v = m.version ?? 1
2005
2104
  c.uint.preencode(state, v)
2006
2105
  switch (v) {
2007
2106
  case 0:
2008
2107
  case 1:
2009
- encoding49.preencode(state, m)
2108
+ encoding51.preencode(state, m)
2010
2109
  break
2011
2110
  default:
2012
2111
  throw new Error('Unsupported version')
@@ -2018,7 +2117,7 @@ const encoding50 = {
2018
2117
  switch (v) {
2019
2118
  case 0:
2020
2119
  case 1:
2021
- encoding49.encode(state, m)
2120
+ encoding51.encode(state, m)
2022
2121
  break
2023
2122
  default:
2024
2123
  throw new Error('Unsupported version')
@@ -2031,7 +2130,7 @@ const encoding50 = {
2031
2130
  switch (v) {
2032
2131
  case 0:
2033
2132
  case 1: {
2034
- const decoded = encoding49.decode(state)
2133
+ const decoded = encoding51.decode(state)
2035
2134
  return decoded
2036
2135
  }
2037
2136
  default:
@@ -2041,7 +2140,7 @@ const encoding50 = {
2041
2140
  }
2042
2141
 
2043
2142
  // @local/chat-notify-v1/hyperdb#9
2044
- const encoding51 = {
2143
+ const encoding53 = {
2045
2144
  preencode(state, m) {
2046
2145
  c.uint.preencode(state, m.ackedThrough)
2047
2146
  },
@@ -2061,14 +2160,14 @@ const encoding51 = {
2061
2160
  }
2062
2161
 
2063
2162
  // @local/chat-notify/hyperdb#9
2064
- const encoding52 = {
2163
+ const encoding54 = {
2065
2164
  preencode(state, m) {
2066
2165
  const v = m.version ?? 1
2067
2166
  c.uint.preencode(state, v)
2068
2167
  switch (v) {
2069
2168
  case 0:
2070
2169
  case 1:
2071
- encoding51.preencode(state, m)
2170
+ encoding53.preencode(state, m)
2072
2171
  break
2073
2172
  default:
2074
2173
  throw new Error('Unsupported version')
@@ -2080,7 +2179,7 @@ const encoding52 = {
2080
2179
  switch (v) {
2081
2180
  case 0:
2082
2181
  case 1:
2083
- encoding51.encode(state, m)
2182
+ encoding53.encode(state, m)
2084
2183
  break
2085
2184
  default:
2086
2185
  throw new Error('Unsupported version')
@@ -2093,7 +2192,7 @@ const encoding52 = {
2093
2192
  switch (v) {
2094
2193
  case 0:
2095
2194
  case 1: {
2096
- const decoded = encoding51.decode(state)
2195
+ const decoded = encoding53.decode(state)
2097
2196
  return decoded
2098
2197
  }
2099
2198
  default:
@@ -2103,7 +2202,7 @@ const encoding52 = {
2103
2202
  }
2104
2203
 
2105
2204
  // @local/model-notify-v1/hyperdb#10
2106
- const encoding53 = {
2205
+ const encoding55 = {
2107
2206
  preencode(state, m) {
2108
2207
  c.string.preencode(state, m.transferId)
2109
2208
  state.end++ // max flag is 8 so always one byte
@@ -2142,14 +2241,14 @@ const encoding53 = {
2142
2241
  }
2143
2242
 
2144
2243
  // @local/model-notify/hyperdb#10
2145
- const encoding54 = {
2244
+ const encoding56 = {
2146
2245
  preencode(state, m) {
2147
2246
  const v = m.version ?? 1
2148
2247
  c.uint.preencode(state, v)
2149
2248
  switch (v) {
2150
2249
  case 0:
2151
2250
  case 1:
2152
- encoding53.preencode(state, m)
2251
+ encoding55.preencode(state, m)
2153
2252
  break
2154
2253
  default:
2155
2254
  throw new Error('Unsupported version')
@@ -2161,7 +2260,7 @@ const encoding54 = {
2161
2260
  switch (v) {
2162
2261
  case 0:
2163
2262
  case 1:
2164
- encoding53.encode(state, m)
2263
+ encoding55.encode(state, m)
2165
2264
  break
2166
2265
  default:
2167
2266
  throw new Error('Unsupported version')
@@ -2174,7 +2273,7 @@ const encoding54 = {
2174
2273
  switch (v) {
2175
2274
  case 0:
2176
2275
  case 1: {
2177
- const decoded = encoding53.decode(state)
2276
+ const decoded = encoding55.decode(state)
2178
2277
  return decoded
2179
2278
  }
2180
2279
  default:
@@ -2184,7 +2283,7 @@ const encoding54 = {
2184
2283
  }
2185
2284
 
2186
2285
  // @local/mesh-departure-v1/hyperdb#11
2187
- const encoding55 = {
2286
+ const encoding57 = {
2188
2287
  preencode(state, m) {
2189
2288
  c.buffer.preencode(state, m.seed)
2190
2289
  state.end++ // max flag is 2 so always one byte
@@ -2215,14 +2314,14 @@ const encoding55 = {
2215
2314
  }
2216
2315
 
2217
2316
  // @local/mesh-departure/hyperdb#11
2218
- const encoding56 = {
2317
+ const encoding58 = {
2219
2318
  preencode(state, m) {
2220
2319
  const v = m.version ?? 1
2221
2320
  c.uint.preencode(state, v)
2222
2321
  switch (v) {
2223
2322
  case 0:
2224
2323
  case 1:
2225
- encoding55.preencode(state, m)
2324
+ encoding57.preencode(state, m)
2226
2325
  break
2227
2326
  default:
2228
2327
  throw new Error('Unsupported version')
@@ -2234,7 +2333,7 @@ const encoding56 = {
2234
2333
  switch (v) {
2235
2334
  case 0:
2236
2335
  case 1:
2237
- encoding55.encode(state, m)
2336
+ encoding57.encode(state, m)
2238
2337
  break
2239
2338
  default:
2240
2339
  throw new Error('Unsupported version')
@@ -2247,7 +2346,7 @@ const encoding56 = {
2247
2346
  switch (v) {
2248
2347
  case 0:
2249
2348
  case 1: {
2250
- const decoded = encoding55.decode(state)
2349
+ const decoded = encoding57.decode(state)
2251
2350
  return decoded
2252
2351
  }
2253
2352
  default:
@@ -2257,7 +2356,7 @@ const encoding56 = {
2257
2356
  }
2258
2357
 
2259
2358
  // @local/active-mesh-v1/hyperdb#12
2260
- const encoding57 = {
2359
+ const encoding59 = {
2261
2360
  preencode(state, m) {
2262
2361
  state.end++ // max flag is 2 so always one byte
2263
2362
 
@@ -2287,14 +2386,14 @@ const encoding57 = {
2287
2386
  }
2288
2387
 
2289
2388
  // @local/active-mesh/hyperdb#12
2290
- const encoding58 = {
2389
+ const encoding60 = {
2291
2390
  preencode(state, m) {
2292
2391
  const v = m.version ?? 1
2293
2392
  c.uint.preencode(state, v)
2294
2393
  switch (v) {
2295
2394
  case 0:
2296
2395
  case 1:
2297
- encoding57.preencode(state, m)
2396
+ encoding59.preencode(state, m)
2298
2397
  break
2299
2398
  default:
2300
2399
  throw new Error('Unsupported version')
@@ -2306,7 +2405,7 @@ const encoding58 = {
2306
2405
  switch (v) {
2307
2406
  case 0:
2308
2407
  case 1:
2309
- encoding57.encode(state, m)
2408
+ encoding59.encode(state, m)
2310
2409
  break
2311
2410
  default:
2312
2411
  throw new Error('Unsupported version')
@@ -2319,7 +2418,7 @@ const encoding58 = {
2319
2418
  switch (v) {
2320
2419
  case 0:
2321
2420
  case 1: {
2322
- const decoded = encoding57.decode(state)
2421
+ const decoded = encoding59.decode(state)
2323
2422
  return decoded
2324
2423
  }
2325
2424
  default:
@@ -2329,22 +2428,29 @@ const encoding58 = {
2329
2428
  }
2330
2429
 
2331
2430
  // @local/mesh-membership-v1/hyperdb#13
2332
- const encoding59 = {
2431
+ const encoding61 = {
2333
2432
  preencode(state, m) {
2334
2433
  c.fixed32.preencode(state, m.seed)
2335
- state.end++ // max flag is 2 so always one byte
2434
+ state.end++ // max flag is 16 so always one byte
2336
2435
 
2337
2436
  if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
2338
2437
  if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
2438
+ if (version >= 5 && m.migratedAt) c.uint.preencode(state, m.migratedAt)
2339
2439
  },
2340
2440
  encode(state, m) {
2341
- const flags = ((version >= 5 && m.writerSeed) ? 1 : 0) | ((version >= 5 && m.leftAt) ? 2 : 0)
2441
+ const flags =
2442
+ ((version >= 5 && m.writerSeed) ? 1 : 0) |
2443
+ ((version >= 5 && m.leftAt) ? 2 : 0) |
2444
+ ((version >= 5 && m.wasHome) ? 4 : 0) |
2445
+ ((version >= 5 && m.migratedAt) ? 8 : 0) |
2446
+ ((version >= 5 && m.compute) ? 16 : 0)
2342
2447
 
2343
2448
  c.fixed32.encode(state, m.seed)
2344
2449
  c.uint.encode(state, flags)
2345
2450
 
2346
2451
  if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
2347
2452
  if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
2453
+ if (version >= 5 && m.migratedAt) c.uint.encode(state, m.migratedAt)
2348
2454
  },
2349
2455
  decode(state) {
2350
2456
  const v = c.uint.decode(state)
@@ -2356,20 +2462,23 @@ const encoding59 = {
2356
2462
  key: null,
2357
2463
  seed: r1,
2358
2464
  writerSeed: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null,
2359
- leftAt: (version >= 5 && (flags & 2) !== 0) ? c.uint.decode(state) : 0
2465
+ leftAt: (version >= 5 && (flags & 2) !== 0) ? c.uint.decode(state) : 0,
2466
+ wasHome: (version >= 5 && (flags & 4) !== 0),
2467
+ migratedAt: (version >= 5 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
2468
+ compute: (version >= 5 && (flags & 16) !== 0)
2360
2469
  }
2361
2470
  }
2362
2471
  }
2363
2472
 
2364
2473
  // @local/mesh-membership/hyperdb#13
2365
- const encoding60 = {
2474
+ const encoding62 = {
2366
2475
  preencode(state, m) {
2367
2476
  const v = m.version ?? 1
2368
2477
  c.uint.preencode(state, v)
2369
2478
  switch (v) {
2370
2479
  case 0:
2371
2480
  case 1:
2372
- encoding59.preencode(state, m)
2481
+ encoding61.preencode(state, m)
2373
2482
  break
2374
2483
  default:
2375
2484
  throw new Error('Unsupported version')
@@ -2381,7 +2490,7 @@ const encoding60 = {
2381
2490
  switch (v) {
2382
2491
  case 0:
2383
2492
  case 1:
2384
- encoding59.encode(state, m)
2493
+ encoding61.encode(state, m)
2385
2494
  break
2386
2495
  default:
2387
2496
  throw new Error('Unsupported version')
@@ -2394,7 +2503,7 @@ const encoding60 = {
2394
2503
  switch (v) {
2395
2504
  case 0:
2396
2505
  case 1: {
2397
- const decoded = encoding59.decode(state)
2506
+ const decoded = encoding61.decode(state)
2398
2507
  return decoded
2399
2508
  }
2400
2509
  default:
@@ -2404,7 +2513,7 @@ const encoding60 = {
2404
2513
  }
2405
2514
 
2406
2515
  // @local/member-proof-v1/hyperdb#14
2407
- const encoding61 = {
2516
+ const encoding63 = {
2408
2517
  preencode(state, m) {
2409
2518
  c.fixed32.preencode(state, m.memberId)
2410
2519
  c.buffer.preencode(state, m.proof)
@@ -2432,14 +2541,14 @@ const encoding61 = {
2432
2541
  }
2433
2542
 
2434
2543
  // @local/member-proof/hyperdb#14
2435
- const encoding62 = {
2544
+ const encoding64 = {
2436
2545
  preencode(state, m) {
2437
2546
  const v = m.version ?? 1
2438
2547
  c.uint.preencode(state, v)
2439
2548
  switch (v) {
2440
2549
  case 0:
2441
2550
  case 1:
2442
- encoding61.preencode(state, m)
2551
+ encoding63.preencode(state, m)
2443
2552
  break
2444
2553
  default:
2445
2554
  throw new Error('Unsupported version')
@@ -2451,7 +2560,7 @@ const encoding62 = {
2451
2560
  switch (v) {
2452
2561
  case 0:
2453
2562
  case 1:
2454
- encoding61.encode(state, m)
2563
+ encoding63.encode(state, m)
2455
2564
  break
2456
2565
  default:
2457
2566
  throw new Error('Unsupported version')
@@ -2464,7 +2573,73 @@ const encoding62 = {
2464
2573
  switch (v) {
2465
2574
  case 0:
2466
2575
  case 1: {
2467
- const decoded = encoding61.decode(state)
2576
+ const decoded = encoding63.decode(state)
2577
+ return decoded
2578
+ }
2579
+ default:
2580
+ throw new Error('Unsupported version')
2581
+ }
2582
+ }
2583
+ }
2584
+
2585
+ // @local/account-recovery-v1/hyperdb#15
2586
+ const encoding65 = {
2587
+ preencode(state, m) {
2588
+ c.fixed32.preencode(state, m.coreKey)
2589
+ c.uint.preencode(state, m.publishedAt)
2590
+ },
2591
+ encode(state, m) {
2592
+ c.fixed32.encode(state, m.coreKey)
2593
+ c.uint.encode(state, m.publishedAt)
2594
+ },
2595
+ decode(state) {
2596
+ const v = c.uint.decode(state)
2597
+ const r1 = c.fixed32.decode(state)
2598
+ const r2 = c.uint.decode(state)
2599
+
2600
+ return {
2601
+ version: v,
2602
+ meshKey: null,
2603
+ coreKey: r1,
2604
+ publishedAt: r2
2605
+ }
2606
+ }
2607
+ }
2608
+
2609
+ // @local/account-recovery/hyperdb#15
2610
+ const encoding66 = {
2611
+ preencode(state, m) {
2612
+ const v = m.version ?? 1
2613
+ c.uint.preencode(state, v)
2614
+ switch (v) {
2615
+ case 0:
2616
+ case 1:
2617
+ encoding65.preencode(state, m)
2618
+ break
2619
+ default:
2620
+ throw new Error('Unsupported version')
2621
+ }
2622
+ },
2623
+ encode(state, m) {
2624
+ const v = m.version ?? 1
2625
+ c.uint.encode(state, v)
2626
+ switch (v) {
2627
+ case 0:
2628
+ case 1:
2629
+ encoding65.encode(state, m)
2630
+ break
2631
+ default:
2632
+ throw new Error('Unsupported version')
2633
+ }
2634
+ },
2635
+ decode(state) {
2636
+ const start = state.start
2637
+ const v = c.uint.decode(state)
2638
+ state.start = start
2639
+ switch (v) {
2640
+ case 0:
2641
+ case 1: {
2642
+ const decoded = encoding65.decode(state)
2468
2643
  return decoded
2469
2644
  }
2470
2645
  default:
@@ -2568,66 +2743,74 @@ function getEncoding(name) {
2568
2743
  return encoding31
2569
2744
  case '@local/member-proof':
2570
2745
  return encoding32
2571
- case '@local/config-v1/hyperdb#0':
2746
+ case '@local/account-recovery-v1':
2572
2747
  return encoding33
2573
- case '@local/config/hyperdb#0':
2748
+ case '@local/account-recovery':
2574
2749
  return encoding34
2575
- case '@local/mesh-session-v1/hyperdb#1':
2750
+ case '@local/config-v1/hyperdb#0':
2576
2751
  return encoding35
2577
- case '@local/mesh-session/hyperdb#1':
2752
+ case '@local/config/hyperdb#0':
2578
2753
  return encoding36
2579
- case '@local/mesh-history-v1/hyperdb#2':
2754
+ case '@local/mesh-session-v1/hyperdb#1':
2580
2755
  return encoding37
2581
- case '@local/mesh-history/hyperdb#2':
2756
+ case '@local/mesh-session/hyperdb#1':
2582
2757
  return encoding38
2583
- case '@local/device-v1/hyperdb#3':
2758
+ case '@local/mesh-history-v1/hyperdb#2':
2584
2759
  return encoding39
2585
- case '@local/device/hyperdb#3':
2760
+ case '@local/mesh-history/hyperdb#2':
2586
2761
  return encoding40
2587
- case '@local/app-config-v1/hyperdb#4':
2762
+ case '@local/device-v1/hyperdb#3':
2588
2763
  return encoding41
2589
- case '@local/app-config/hyperdb#4':
2764
+ case '@local/device/hyperdb#3':
2590
2765
  return encoding42
2591
- case '@local/model-download-v1/hyperdb#5':
2766
+ case '@local/app-config-v1/hyperdb#4':
2592
2767
  return encoding43
2593
- case '@local/model-download/hyperdb#5':
2768
+ case '@local/app-config/hyperdb#4':
2594
2769
  return encoding44
2595
- case '@local/custom-model-v1/hyperdb#6':
2770
+ case '@local/model-download-v1/hyperdb#5':
2596
2771
  return encoding45
2597
- case '@local/custom-model/hyperdb#6':
2772
+ case '@local/model-download/hyperdb#5':
2598
2773
  return encoding46
2599
- case '@local/identity-v1/hyperdb#7':
2774
+ case '@local/custom-model-v1/hyperdb#6':
2600
2775
  return encoding47
2601
- case '@local/identity/hyperdb#7':
2776
+ case '@local/custom-model/hyperdb#6':
2602
2777
  return encoding48
2603
- case '@local/membership-v1/hyperdb#8':
2778
+ case '@local/identity-v1/hyperdb#7':
2604
2779
  return encoding49
2605
- case '@local/membership/hyperdb#8':
2780
+ case '@local/identity/hyperdb#7':
2606
2781
  return encoding50
2607
- case '@local/chat-notify-v1/hyperdb#9':
2782
+ case '@local/membership-v1/hyperdb#8':
2608
2783
  return encoding51
2609
- case '@local/chat-notify/hyperdb#9':
2784
+ case '@local/membership/hyperdb#8':
2610
2785
  return encoding52
2611
- case '@local/model-notify-v1/hyperdb#10':
2786
+ case '@local/chat-notify-v1/hyperdb#9':
2612
2787
  return encoding53
2613
- case '@local/model-notify/hyperdb#10':
2788
+ case '@local/chat-notify/hyperdb#9':
2614
2789
  return encoding54
2615
- case '@local/mesh-departure-v1/hyperdb#11':
2790
+ case '@local/model-notify-v1/hyperdb#10':
2616
2791
  return encoding55
2617
- case '@local/mesh-departure/hyperdb#11':
2792
+ case '@local/model-notify/hyperdb#10':
2618
2793
  return encoding56
2619
- case '@local/active-mesh-v1/hyperdb#12':
2794
+ case '@local/mesh-departure-v1/hyperdb#11':
2620
2795
  return encoding57
2621
- case '@local/active-mesh/hyperdb#12':
2796
+ case '@local/mesh-departure/hyperdb#11':
2622
2797
  return encoding58
2623
- case '@local/mesh-membership-v1/hyperdb#13':
2798
+ case '@local/active-mesh-v1/hyperdb#12':
2624
2799
  return encoding59
2625
- case '@local/mesh-membership/hyperdb#13':
2800
+ case '@local/active-mesh/hyperdb#12':
2626
2801
  return encoding60
2627
- case '@local/member-proof-v1/hyperdb#14':
2802
+ case '@local/mesh-membership-v1/hyperdb#13':
2628
2803
  return encoding61
2629
- case '@local/member-proof/hyperdb#14':
2804
+ case '@local/mesh-membership/hyperdb#13':
2630
2805
  return encoding62
2806
+ case '@local/member-proof-v1/hyperdb#14':
2807
+ return encoding63
2808
+ case '@local/member-proof/hyperdb#14':
2809
+ return encoding64
2810
+ case '@local/account-recovery-v1/hyperdb#15':
2811
+ return encoding65
2812
+ case '@local/account-recovery/hyperdb#15':
2813
+ return encoding66
2631
2814
  default:
2632
2815
  throw new Error('Encoder not found ' + name)
2633
2816
  }