@qvac/core 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +80 -1
  2. package/dist-lib/index.d.ts +1 -0
  3. package/dist-lib/index.js +1 -0
  4. package/dist-lib/lib/api/chunk-delta.d.ts +6 -2
  5. package/dist-lib/lib/api/chunk-delta.js +69 -7
  6. package/dist-lib/lib/api/chunks.js +6 -2
  7. package/dist-lib/lib/api/config.d.ts +4 -1
  8. package/dist-lib/lib/api/config.js +23 -4
  9. package/dist-lib/lib/api/devices.js +3 -1
  10. package/dist-lib/lib/api/rag.js +4 -2
  11. package/dist-lib/lib/assistant/harness.d.ts +3 -1
  12. package/dist-lib/lib/assistant/harness.js +10 -0
  13. package/dist-lib/lib/assistant/history.js +25 -3
  14. package/dist-lib/lib/assistant/message.js +2 -2
  15. package/dist-lib/lib/assistant-tree.js +1 -1
  16. package/dist-lib/lib/assistant.d.ts +1 -0
  17. package/dist-lib/lib/assistant.js +14 -4
  18. package/dist-lib/lib/client.js +10 -1
  19. package/dist-lib/lib/core/archived-mesh.js +1 -0
  20. package/dist-lib/lib/core/chunk.d.ts +5 -2
  21. package/dist-lib/lib/core/chunk.js +74 -18
  22. package/dist-lib/lib/core/collections.d.ts +1 -0
  23. package/dist-lib/lib/core/collections.js +1 -0
  24. package/dist-lib/lib/core/config-value.d.ts +6 -0
  25. package/dist-lib/lib/core/config-value.js +14 -0
  26. package/dist-lib/lib/core/contract/chat.d.ts +1 -0
  27. package/dist-lib/lib/core/contract/chat.js +8 -1
  28. package/dist-lib/lib/core/contract/chunks.js +20 -6
  29. package/dist-lib/lib/core/contract/compute.d.ts +1 -1
  30. package/dist-lib/lib/core/contract/compute.js +2 -1
  31. package/dist-lib/lib/core/contract/devices.js +3 -2
  32. package/dist-lib/lib/core/departures.js +1 -0
  33. package/dist-lib/lib/core/devices.d.ts +2 -1
  34. package/dist-lib/lib/core/devices.js +4 -2
  35. package/dist-lib/lib/core/files/index.d.ts +1 -1
  36. package/dist-lib/lib/core/files/index.js +1 -1
  37. package/dist-lib/lib/core/files/rag/index.d.ts +1 -1
  38. package/dist-lib/lib/core/files/rag/index.js +1 -1
  39. package/dist-lib/lib/core/files/rag/retrieval/full-text.d.ts +1 -0
  40. package/dist-lib/lib/core/files/rag/retrieval/full-text.js +4 -1
  41. package/dist-lib/lib/core/inference-calls-receiver.js +2 -2
  42. package/dist-lib/lib/core/known-sender.d.ts +3 -0
  43. package/dist-lib/lib/core/known-sender.js +26 -0
  44. package/dist-lib/lib/core/local/index.d.ts +2 -0
  45. package/dist-lib/lib/core/local/index.js +17 -10
  46. package/dist-lib/lib/core/mesh.d.ts +5 -1
  47. package/dist-lib/lib/core/mesh.js +6 -6
  48. package/dist-lib/lib/core/migrations/chat-chunks.d.ts +4 -0
  49. package/dist-lib/lib/core/migrations/chat-chunks.js +43 -0
  50. package/dist-lib/lib/core/skill-overlay-receiver.js +2 -2
  51. package/dist-lib/lib/core/skill-secrets.js +2 -2
  52. package/dist-lib/lib/core.d.ts +11 -1
  53. package/dist-lib/lib/core.js +50 -5
  54. package/dist-lib/lib/device-tree.d.ts +18 -0
  55. package/dist-lib/lib/device-tree.js +32 -0
  56. package/dist-lib/schema/engine.js +20 -3
  57. package/dist-lib/schema/field-order.js +8 -1
  58. package/dist-lib/schema/local.js +7 -3
  59. package/dist-lib/schema/qvac.js +19 -2
  60. package/dist-lib/spec/hrpc/messages.js +1236 -1184
  61. package/dist-lib/spec/hyperschema/index.js +1236 -1184
  62. package/dist-lib/spec/hyperschema/schema.json +47 -0
  63. package/dist-lib/spec/hyperschema/types.d.ts +11 -0
  64. package/dist-lib/spec/local/hyperdb/messages.js +70 -20
  65. package/dist-lib/spec/local/hyperschema/index.js +36 -11
  66. package/dist-lib/spec/local/hyperschema/schema.json +21 -1
  67. package/dist-lib/spec/local/hyperschema/types.d.ts +5 -1
  68. package/dist-lib/spec/mesh/hyperdb/db.json +17 -1
  69. package/dist-lib/spec/mesh/hyperdb/index.js +83 -2
  70. package/dist-lib/spec/mesh/hyperdb/messages.js +573 -255
  71. package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +7 -1
  72. package/dist-lib/spec/mesh/hyperdispatch/index.js +18 -1
  73. package/dist-lib/spec/mesh/hyperdispatch/messages.js +121 -8
  74. package/dist-lib/spec/mesh/hyperschema/index.js +121 -8
  75. package/dist-lib/spec/mesh/hyperschema/schema.json +69 -1
  76. package/dist-lib/spec/mesh/hyperschema/types.d.ts +19 -1
  77. package/package.json +9 -8
@@ -51,6 +51,11 @@
51
51
  "name": "value",
52
52
  "type": "json",
53
53
  "version": 1
54
+ },
55
+ {
56
+ "name": "falsyValue",
57
+ "type": "string",
58
+ "version": 1
54
59
  }
55
60
  ]
56
61
  },
@@ -1752,6 +1757,36 @@
1752
1757
  }
1753
1758
  ]
1754
1759
  },
1760
+ {
1761
+ "name": "custom-model-report-entry",
1762
+ "namespace": "assistant",
1763
+ "compact": false,
1764
+ "flagsPosition": 2,
1765
+ "fields": [
1766
+ {
1767
+ "name": "name",
1768
+ "required": true,
1769
+ "type": "string",
1770
+ "version": 1
1771
+ },
1772
+ {
1773
+ "name": "label",
1774
+ "required": true,
1775
+ "type": "string",
1776
+ "version": 1
1777
+ },
1778
+ {
1779
+ "name": "taskType",
1780
+ "type": "string",
1781
+ "version": 1
1782
+ },
1783
+ {
1784
+ "name": "expectedSize",
1785
+ "type": "uint",
1786
+ "version": 1
1787
+ }
1788
+ ]
1789
+ },
1755
1790
  {
1756
1791
  "name": "device",
1757
1792
  "namespace": "assistant",
@@ -1853,6 +1888,12 @@
1853
1888
  "name": "memberId",
1854
1889
  "type": "fixed32",
1855
1890
  "version": 1
1891
+ },
1892
+ {
1893
+ "name": "customModels",
1894
+ "array": true,
1895
+ "type": "@assistant/custom-model-report-entry",
1896
+ "version": 1
1856
1897
  }
1857
1898
  ]
1858
1899
  },
@@ -1980,6 +2021,12 @@
1980
2021
  "required": true,
1981
2022
  "type": "string",
1982
2023
  "version": 1
2024
+ },
2025
+ {
2026
+ "name": "customModels",
2027
+ "array": true,
2028
+ "type": "@assistant/custom-model-report-entry",
2029
+ "version": 1
1983
2030
  }
1984
2031
  ]
1985
2032
  },
@@ -16,6 +16,7 @@ export interface AssistantConfigKey {
16
16
 
17
17
  export interface AssistantConfigValue {
18
18
  value?: unknown | null
19
+ falsyValue?: string | null
19
20
  }
20
21
 
21
22
  export interface AssistantConfigSetRequest {
@@ -365,6 +366,13 @@ export interface AssistantToolReportEntry {
365
366
  writeRootsRequired?: boolean
366
367
  }
367
368
 
369
+ export interface AssistantCustomModelReportEntry {
370
+ name: string
371
+ label: string
372
+ taskType?: string | null
373
+ expectedSize?: number
374
+ }
375
+
368
376
  export interface AssistantDevice {
369
377
  id: Buffer
370
378
  name: string
@@ -383,6 +391,7 @@ export interface AssistantDevice {
383
391
  readySkillNames?: string[] | null
384
392
  toolCatalog?: AssistantToolReportEntry[] | null
385
393
  memberId?: Buffer | null
394
+ customModels?: AssistantCustomModelReportEntry[] | null
386
395
  }
387
396
 
388
397
  export interface AssistantDeviceList {
@@ -413,6 +422,7 @@ export interface AssistantSaveDeviceCapabilitiesRequest {
413
422
  readySkillNames?: string[] | null
414
423
  toolCatalog?: AssistantToolReportEntry[] | null
415
424
  meshId: string
425
+ customModels?: AssistantCustomModelReportEntry[] | null
416
426
  }
417
427
 
418
428
  export interface AssistantDeviceId {
@@ -1979,6 +1989,7 @@ export interface SchemaTypes {
1979
1989
  "@assistant/move-chat-request": AssistantMoveChatRequest
1980
1990
  "@assistant/move-chat-group-request": AssistantMoveChatGroupRequest
1981
1991
  "@assistant/tool-report-entry": AssistantToolReportEntry
1992
+ "@assistant/custom-model-report-entry": AssistantCustomModelReportEntry
1982
1993
  "@assistant/device": AssistantDevice
1983
1994
  "@assistant/device-list": AssistantDeviceList
1984
1995
  "@assistant/member": AssistantMember
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 11
2
+ // Schema Version: 12
3
3
  /* eslint-disable camelcase */
4
4
  /* eslint-disable quotes */
5
5
  /* eslint-disable space-before-function-paren */
6
6
 
7
7
  import { c } from 'hyperschema/runtime'
8
8
 
9
- const VERSION = 11
9
+ const VERSION = 12
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -36,17 +36,19 @@ const encoding0 = {
36
36
  const encoding1 = {
37
37
  preencode(state, m) {
38
38
  c.string.preencode(state, m.key)
39
- state.end++ // max flag is 1 so always one byte
39
+ state.end++ // max flag is 2 so always one byte
40
40
 
41
41
  if (m.value) c.json.preencode(state, m.value)
42
+ if (version >= 12 && m.falsyValue) c.string.preencode(state, m.falsyValue)
42
43
  },
43
44
  encode(state, m) {
44
- const flags = m.value ? 1 : 0
45
+ const flags = (m.value ? 1 : 0) | ((version >= 12 && m.falsyValue) ? 2 : 0)
45
46
 
46
47
  c.string.encode(state, m.key)
47
48
  c.uint.encode(state, flags)
48
49
 
49
50
  if (m.value) c.json.encode(state, m.value)
51
+ if (version >= 12 && m.falsyValue) c.string.encode(state, m.falsyValue)
50
52
  },
51
53
  decode(state) {
52
54
  const r0 = c.string.decode(state)
@@ -55,7 +57,8 @@ const encoding1 = {
55
57
  return {
56
58
  version: 0,
57
59
  key: r0,
58
- value: (flags & 1) !== 0 ? c.json.decode(state) : null
60
+ value: (flags & 1) !== 0 ? c.json.decode(state) : null,
61
+ falsyValue: (version >= 12 && (flags & 2) !== 0) ? c.string.decode(state) : null
59
62
  }
60
63
  }
61
64
  }
@@ -1061,12 +1064,15 @@ const encoding25 = {
1061
1064
  preencode(state, m) {
1062
1065
  c.buffer.preencode(state, m.key)
1063
1066
  c.buffer.preencode(state, m.seed)
1064
- state.end++ // max flag is 2 so always one byte
1067
+ state.end++ // max flag is 4 so always one byte
1065
1068
 
1066
1069
  if (version >= 4 && m.writerSeed) c.string.preencode(state, m.writerSeed)
1067
1070
  },
1068
1071
  encode(state, m) {
1069
- const flags = ((version >= 4 && m.creator) ? 1 : 0) | ((version >= 4 && m.writerSeed) ? 2 : 0)
1072
+ const flags =
1073
+ ((version >= 4 && m.creator) ? 1 : 0) |
1074
+ ((version >= 4 && m.writerSeed) ? 2 : 0) |
1075
+ ((version >= 12 && m.compute) ? 4 : 0)
1070
1076
 
1071
1077
  c.buffer.encode(state, m.key)
1072
1078
  c.buffer.encode(state, m.seed)
@@ -1084,7 +1090,8 @@ const encoding25 = {
1084
1090
  key: r0,
1085
1091
  seed: r1,
1086
1092
  creator: (version >= 4 && (flags & 1) !== 0),
1087
- writerSeed: (version >= 4 && (flags & 2) !== 0) ? c.string.decode(state) : null
1093
+ writerSeed: (version >= 4 && (flags & 2) !== 0) ? c.string.decode(state) : null,
1094
+ compute: (version >= 12 && (flags & 4) !== 0)
1088
1095
  }
1089
1096
  }
1090
1097
  }
@@ -1206,13 +1213,25 @@ const encoding28 = {
1206
1213
  // @local/mesh-membership-v1
1207
1214
  const encoding29 = {
1208
1215
  preencode(state, m) {
1216
+ const flags =
1217
+ ((version >= 5 && m.writerSeed) ? 1 : 0) |
1218
+ ((version >= 5 && m.leftAt) ? 2 : 0) |
1219
+ ((version >= 5 && m.wasHome) ? 4 : 0) |
1220
+ ((version >= 5 && m.migratedAt) ? 8 : 0) |
1221
+ ((version >= 5 && m.compute) ? 16 : 0) |
1222
+ ((version >= 7 && m.awaitingAdmission) ? 32 : 0) |
1223
+ ((version >= 12 && m.bootKey) ? 64 : 0) |
1224
+ ((version >= 12 && m.bootLength) ? 128 : 0)
1225
+
1209
1226
  c.fixed32.preencode(state, m.key)
1210
1227
  c.fixed32.preencode(state, m.seed)
1211
- state.end++ // max flag is 32 so always one byte
1228
+ c.uint.preencode(state, flags)
1212
1229
 
1213
1230
  if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
1214
1231
  if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
1215
1232
  if (version >= 5 && m.migratedAt) c.uint.preencode(state, m.migratedAt)
1233
+ if (version >= 12 && m.bootKey) c.fixed32.preencode(state, m.bootKey)
1234
+ if (version >= 12 && m.bootLength) c.uint.preencode(state, m.bootLength)
1216
1235
  },
1217
1236
  encode(state, m) {
1218
1237
  const flags =
@@ -1221,7 +1240,9 @@ const encoding29 = {
1221
1240
  ((version >= 5 && m.wasHome) ? 4 : 0) |
1222
1241
  ((version >= 5 && m.migratedAt) ? 8 : 0) |
1223
1242
  ((version >= 5 && m.compute) ? 16 : 0) |
1224
- ((version >= 7 && m.awaitingAdmission) ? 32 : 0)
1243
+ ((version >= 7 && m.awaitingAdmission) ? 32 : 0) |
1244
+ ((version >= 12 && m.bootKey) ? 64 : 0) |
1245
+ ((version >= 12 && m.bootLength) ? 128 : 0)
1225
1246
 
1226
1247
  c.fixed32.encode(state, m.key)
1227
1248
  c.fixed32.encode(state, m.seed)
@@ -1230,6 +1251,8 @@ const encoding29 = {
1230
1251
  if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
1231
1252
  if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
1232
1253
  if (version >= 5 && m.migratedAt) c.uint.encode(state, m.migratedAt)
1254
+ if (version >= 12 && m.bootKey) c.fixed32.encode(state, m.bootKey)
1255
+ if (version >= 12 && m.bootLength) c.uint.encode(state, m.bootLength)
1233
1256
  },
1234
1257
  decode(state) {
1235
1258
  const r0 = c.fixed32.decode(state)
@@ -1245,7 +1268,9 @@ const encoding29 = {
1245
1268
  wasHome: (version >= 5 && (flags & 4) !== 0),
1246
1269
  migratedAt: (version >= 5 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
1247
1270
  compute: (version >= 5 && (flags & 16) !== 0),
1248
- awaitingAdmission: (version >= 7 && (flags & 32) !== 0)
1271
+ awaitingAdmission: (version >= 7 && (flags & 32) !== 0),
1272
+ bootKey: (version >= 12 && (flags & 64) !== 0) ? c.fixed32.decode(state) : null,
1273
+ bootLength: (version >= 12 && (flags & 128) !== 0) ? c.uint.decode(state) : 0
1249
1274
  }
1250
1275
  }
1251
1276
  }
@@ -1795,16 +1820,18 @@ const encoding42 = {
1795
1820
  // @local/config-v1/hyperdb#0
1796
1821
  const encoding43 = {
1797
1822
  preencode(state, m) {
1798
- state.end++ // max flag is 1 so always one byte
1823
+ state.end++ // max flag is 2 so always one byte
1799
1824
 
1800
1825
  if (m.value) c.json.preencode(state, m.value)
1826
+ if (version >= 12 && m.falsyValue) c.string.preencode(state, m.falsyValue)
1801
1827
  },
1802
1828
  encode(state, m) {
1803
- const flags = m.value ? 1 : 0
1829
+ const flags = (m.value ? 1 : 0) | ((version >= 12 && m.falsyValue) ? 2 : 0)
1804
1830
 
1805
1831
  c.uint.encode(state, flags)
1806
1832
 
1807
1833
  if (m.value) c.json.encode(state, m.value)
1834
+ if (version >= 12 && m.falsyValue) c.string.encode(state, m.falsyValue)
1808
1835
  },
1809
1836
  decode(state) {
1810
1837
  const flags = c.uint.decode(state)
@@ -1812,7 +1839,8 @@ const encoding43 = {
1812
1839
  return {
1813
1840
  version: 0,
1814
1841
  key: null,
1815
- value: (flags & 1) !== 0 ? c.json.decode(state) : null
1842
+ value: (flags & 1) !== 0 ? c.json.decode(state) : null,
1843
+ falsyValue: (version >= 12 && (flags & 2) !== 0) ? c.string.decode(state) : null
1816
1844
  }
1817
1845
  }
1818
1846
  }
@@ -2685,12 +2713,15 @@ const encoding64 = {
2685
2713
  const encoding65 = {
2686
2714
  preencode(state, m) {
2687
2715
  c.buffer.preencode(state, m.seed)
2688
- state.end++ // max flag is 2 so always one byte
2716
+ state.end++ // max flag is 4 so always one byte
2689
2717
 
2690
2718
  if (version >= 4 && m.writerSeed) c.string.preencode(state, m.writerSeed)
2691
2719
  },
2692
2720
  encode(state, m) {
2693
- const flags = ((version >= 4 && m.creator) ? 1 : 0) | ((version >= 4 && m.writerSeed) ? 2 : 0)
2721
+ const flags =
2722
+ ((version >= 4 && m.creator) ? 1 : 0) |
2723
+ ((version >= 4 && m.writerSeed) ? 2 : 0) |
2724
+ ((version >= 12 && m.compute) ? 4 : 0)
2694
2725
 
2695
2726
  c.buffer.encode(state, m.seed)
2696
2727
  c.uint.encode(state, flags)
@@ -2706,7 +2737,8 @@ const encoding65 = {
2706
2737
  key: null,
2707
2738
  seed: r1,
2708
2739
  creator: (version >= 4 && (flags & 1) !== 0),
2709
- writerSeed: (version >= 4 && (flags & 2) !== 0) ? c.string.decode(state) : null
2740
+ writerSeed: (version >= 4 && (flags & 2) !== 0) ? c.string.decode(state) : null,
2741
+ compute: (version >= 12 && (flags & 4) !== 0)
2710
2742
  }
2711
2743
  }
2712
2744
  }
@@ -2825,12 +2857,24 @@ const encoding68 = {
2825
2857
  // @local/mesh-membership-v1/hyperdb#13
2826
2858
  const encoding69 = {
2827
2859
  preencode(state, m) {
2860
+ const flags =
2861
+ ((version >= 5 && m.writerSeed) ? 1 : 0) |
2862
+ ((version >= 5 && m.leftAt) ? 2 : 0) |
2863
+ ((version >= 5 && m.wasHome) ? 4 : 0) |
2864
+ ((version >= 5 && m.migratedAt) ? 8 : 0) |
2865
+ ((version >= 5 && m.compute) ? 16 : 0) |
2866
+ ((version >= 7 && m.awaitingAdmission) ? 32 : 0) |
2867
+ ((version >= 12 && m.bootKey) ? 64 : 0) |
2868
+ ((version >= 12 && m.bootLength) ? 128 : 0)
2869
+
2828
2870
  c.fixed32.preencode(state, m.seed)
2829
- state.end++ // max flag is 32 so always one byte
2871
+ c.uint.preencode(state, flags)
2830
2872
 
2831
2873
  if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
2832
2874
  if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
2833
2875
  if (version >= 5 && m.migratedAt) c.uint.preencode(state, m.migratedAt)
2876
+ if (version >= 12 && m.bootKey) c.fixed32.preencode(state, m.bootKey)
2877
+ if (version >= 12 && m.bootLength) c.uint.preencode(state, m.bootLength)
2834
2878
  },
2835
2879
  encode(state, m) {
2836
2880
  const flags =
@@ -2839,7 +2883,9 @@ const encoding69 = {
2839
2883
  ((version >= 5 && m.wasHome) ? 4 : 0) |
2840
2884
  ((version >= 5 && m.migratedAt) ? 8 : 0) |
2841
2885
  ((version >= 5 && m.compute) ? 16 : 0) |
2842
- ((version >= 7 && m.awaitingAdmission) ? 32 : 0)
2886
+ ((version >= 7 && m.awaitingAdmission) ? 32 : 0) |
2887
+ ((version >= 12 && m.bootKey) ? 64 : 0) |
2888
+ ((version >= 12 && m.bootLength) ? 128 : 0)
2843
2889
 
2844
2890
  c.fixed32.encode(state, m.seed)
2845
2891
  c.uint.encode(state, flags)
@@ -2847,6 +2893,8 @@ const encoding69 = {
2847
2893
  if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
2848
2894
  if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
2849
2895
  if (version >= 5 && m.migratedAt) c.uint.encode(state, m.migratedAt)
2896
+ if (version >= 12 && m.bootKey) c.fixed32.encode(state, m.bootKey)
2897
+ if (version >= 12 && m.bootLength) c.uint.encode(state, m.bootLength)
2850
2898
  },
2851
2899
  decode(state) {
2852
2900
  const r1 = c.fixed32.decode(state)
@@ -2861,7 +2909,9 @@ const encoding69 = {
2861
2909
  wasHome: (version >= 5 && (flags & 4) !== 0),
2862
2910
  migratedAt: (version >= 5 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
2863
2911
  compute: (version >= 5 && (flags & 16) !== 0),
2864
- awaitingAdmission: (version >= 7 && (flags & 32) !== 0)
2912
+ awaitingAdmission: (version >= 7 && (flags & 32) !== 0),
2913
+ bootKey: (version >= 12 && (flags & 64) !== 0) ? c.fixed32.decode(state) : null,
2914
+ bootLength: (version >= 12 && (flags & 128) !== 0) ? c.uint.decode(state) : 0
2865
2915
  }
2866
2916
  }
2867
2917
  }
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 11
2
+ // Schema Version: 12
3
3
  /* eslint-disable camelcase */
4
4
  /* eslint-disable quotes */
5
5
  /* eslint-disable space-before-function-paren */
6
6
 
7
7
  import { c } from 'hyperschema/runtime'
8
8
 
9
- const VERSION = 11
9
+ const VERSION = 12
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -36,17 +36,19 @@ const encoding0 = {
36
36
  const encoding1 = {
37
37
  preencode(state, m) {
38
38
  c.string.preencode(state, m.key)
39
- state.end++ // max flag is 1 so always one byte
39
+ state.end++ // max flag is 2 so always one byte
40
40
 
41
41
  if (m.value) c.json.preencode(state, m.value)
42
+ if (version >= 12 && m.falsyValue) c.string.preencode(state, m.falsyValue)
42
43
  },
43
44
  encode(state, m) {
44
- const flags = m.value ? 1 : 0
45
+ const flags = (m.value ? 1 : 0) | ((version >= 12 && m.falsyValue) ? 2 : 0)
45
46
 
46
47
  c.string.encode(state, m.key)
47
48
  c.uint.encode(state, flags)
48
49
 
49
50
  if (m.value) c.json.encode(state, m.value)
51
+ if (version >= 12 && m.falsyValue) c.string.encode(state, m.falsyValue)
50
52
  },
51
53
  decode(state) {
52
54
  const r0 = c.string.decode(state)
@@ -55,7 +57,8 @@ const encoding1 = {
55
57
  return {
56
58
  version: 0,
57
59
  key: r0,
58
- value: (flags & 1) !== 0 ? c.json.decode(state) : null
60
+ value: (flags & 1) !== 0 ? c.json.decode(state) : null,
61
+ falsyValue: (version >= 12 && (flags & 2) !== 0) ? c.string.decode(state) : null
59
62
  }
60
63
  }
61
64
  }
@@ -1061,12 +1064,15 @@ const encoding25 = {
1061
1064
  preencode(state, m) {
1062
1065
  c.buffer.preencode(state, m.key)
1063
1066
  c.buffer.preencode(state, m.seed)
1064
- state.end++ // max flag is 2 so always one byte
1067
+ state.end++ // max flag is 4 so always one byte
1065
1068
 
1066
1069
  if (version >= 4 && m.writerSeed) c.string.preencode(state, m.writerSeed)
1067
1070
  },
1068
1071
  encode(state, m) {
1069
- const flags = ((version >= 4 && m.creator) ? 1 : 0) | ((version >= 4 && m.writerSeed) ? 2 : 0)
1072
+ const flags =
1073
+ ((version >= 4 && m.creator) ? 1 : 0) |
1074
+ ((version >= 4 && m.writerSeed) ? 2 : 0) |
1075
+ ((version >= 12 && m.compute) ? 4 : 0)
1070
1076
 
1071
1077
  c.buffer.encode(state, m.key)
1072
1078
  c.buffer.encode(state, m.seed)
@@ -1084,7 +1090,8 @@ const encoding25 = {
1084
1090
  key: r0,
1085
1091
  seed: r1,
1086
1092
  creator: (version >= 4 && (flags & 1) !== 0),
1087
- writerSeed: (version >= 4 && (flags & 2) !== 0) ? c.string.decode(state) : null
1093
+ writerSeed: (version >= 4 && (flags & 2) !== 0) ? c.string.decode(state) : null,
1094
+ compute: (version >= 12 && (flags & 4) !== 0)
1088
1095
  }
1089
1096
  }
1090
1097
  }
@@ -1206,13 +1213,25 @@ const encoding28 = {
1206
1213
  // @local/mesh-membership-v1
1207
1214
  const encoding29 = {
1208
1215
  preencode(state, m) {
1216
+ const flags =
1217
+ ((version >= 5 && m.writerSeed) ? 1 : 0) |
1218
+ ((version >= 5 && m.leftAt) ? 2 : 0) |
1219
+ ((version >= 5 && m.wasHome) ? 4 : 0) |
1220
+ ((version >= 5 && m.migratedAt) ? 8 : 0) |
1221
+ ((version >= 5 && m.compute) ? 16 : 0) |
1222
+ ((version >= 7 && m.awaitingAdmission) ? 32 : 0) |
1223
+ ((version >= 12 && m.bootKey) ? 64 : 0) |
1224
+ ((version >= 12 && m.bootLength) ? 128 : 0)
1225
+
1209
1226
  c.fixed32.preencode(state, m.key)
1210
1227
  c.fixed32.preencode(state, m.seed)
1211
- state.end++ // max flag is 32 so always one byte
1228
+ c.uint.preencode(state, flags)
1212
1229
 
1213
1230
  if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
1214
1231
  if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
1215
1232
  if (version >= 5 && m.migratedAt) c.uint.preencode(state, m.migratedAt)
1233
+ if (version >= 12 && m.bootKey) c.fixed32.preencode(state, m.bootKey)
1234
+ if (version >= 12 && m.bootLength) c.uint.preencode(state, m.bootLength)
1216
1235
  },
1217
1236
  encode(state, m) {
1218
1237
  const flags =
@@ -1221,7 +1240,9 @@ const encoding29 = {
1221
1240
  ((version >= 5 && m.wasHome) ? 4 : 0) |
1222
1241
  ((version >= 5 && m.migratedAt) ? 8 : 0) |
1223
1242
  ((version >= 5 && m.compute) ? 16 : 0) |
1224
- ((version >= 7 && m.awaitingAdmission) ? 32 : 0)
1243
+ ((version >= 7 && m.awaitingAdmission) ? 32 : 0) |
1244
+ ((version >= 12 && m.bootKey) ? 64 : 0) |
1245
+ ((version >= 12 && m.bootLength) ? 128 : 0)
1225
1246
 
1226
1247
  c.fixed32.encode(state, m.key)
1227
1248
  c.fixed32.encode(state, m.seed)
@@ -1230,6 +1251,8 @@ const encoding29 = {
1230
1251
  if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
1231
1252
  if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
1232
1253
  if (version >= 5 && m.migratedAt) c.uint.encode(state, m.migratedAt)
1254
+ if (version >= 12 && m.bootKey) c.fixed32.encode(state, m.bootKey)
1255
+ if (version >= 12 && m.bootLength) c.uint.encode(state, m.bootLength)
1233
1256
  },
1234
1257
  decode(state) {
1235
1258
  const r0 = c.fixed32.decode(state)
@@ -1245,7 +1268,9 @@ const encoding29 = {
1245
1268
  wasHome: (version >= 5 && (flags & 4) !== 0),
1246
1269
  migratedAt: (version >= 5 && (flags & 8) !== 0) ? c.uint.decode(state) : 0,
1247
1270
  compute: (version >= 5 && (flags & 16) !== 0),
1248
- awaitingAdmission: (version >= 7 && (flags & 32) !== 0)
1271
+ awaitingAdmission: (version >= 7 && (flags & 32) !== 0),
1272
+ bootKey: (version >= 12 && (flags & 64) !== 0) ? c.fixed32.decode(state) : null,
1273
+ bootLength: (version >= 12 && (flags & 128) !== 0) ? c.uint.decode(state) : 0
1249
1274
  }
1250
1275
  }
1251
1276
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 11,
2
+ "version": 12,
3
3
  "schema": [
4
4
  {
5
5
  "name": "qvac-state",
@@ -41,6 +41,11 @@
41
41
  "name": "value",
42
42
  "type": "json",
43
43
  "version": 1
44
+ },
45
+ {
46
+ "name": "falsyValue",
47
+ "type": "string",
48
+ "version": 12
44
49
  }
45
50
  ]
46
51
  },
@@ -677,6 +682,11 @@
677
682
  "name": "writerSeed",
678
683
  "type": "string",
679
684
  "version": 4
685
+ },
686
+ {
687
+ "name": "compute",
688
+ "type": "bool",
689
+ "version": 12
680
690
  }
681
691
  ]
682
692
  },
@@ -775,6 +785,16 @@
775
785
  "name": "awaitingAdmission",
776
786
  "type": "bool",
777
787
  "version": 7
788
+ },
789
+ {
790
+ "name": "bootKey",
791
+ "type": "fixed32",
792
+ "version": 12
793
+ },
794
+ {
795
+ "name": "bootLength",
796
+ "type": "uint",
797
+ "version": 12
778
798
  }
779
799
  ]
780
800
  },
@@ -1,5 +1,5 @@
1
1
  // This file is autogenerated by hyperschema-ts
2
- // Schema version: 11
2
+ // Schema version: 12
3
3
  // Do not edit manually.
4
4
 
5
5
  export type LocalQvacState = 1 | 2 | 3 | 4
@@ -7,6 +7,7 @@ export type LocalQvacState = 1 | 2 | 3 | 4
7
7
  export interface LocalConfigV1 {
8
8
  key: string
9
9
  value?: unknown | null
10
+ falsyValue?: string | null
10
11
  }
11
12
 
12
13
  export type LocalConfig = (LocalConfigV1 & { version?: number })
@@ -132,6 +133,7 @@ export interface LocalMeshDepartureV1 {
132
133
  seed: Buffer
133
134
  creator?: boolean
134
135
  writerSeed?: string | null
136
+ compute?: boolean
135
137
  }
136
138
 
137
139
  export type LocalMeshDeparture = (LocalMeshDepartureV1 & { version?: number })
@@ -153,6 +155,8 @@ export interface LocalMeshMembershipV1 {
153
155
  migratedAt?: number
154
156
  compute?: boolean
155
157
  awaitingAdmission?: boolean
158
+ bootKey?: Buffer | null
159
+ bootLength?: number
156
160
  }
157
161
 
158
162
  export type LocalMeshMembership = (LocalMeshMembershipV1 & { version?: number })
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": 10,
2
+ "version": 11,
3
3
  "offset": 0,
4
4
  "schema": [
5
5
  {
@@ -937,6 +937,22 @@
937
937
  "meshKey"
938
938
  ],
939
939
  "trigger": null
940
+ },
941
+ {
942
+ "name": "chat-chunks",
943
+ "namespace": "qvac",
944
+ "id": 51,
945
+ "type": 1,
946
+ "version": 11,
947
+ "versionField": null,
948
+ "indexes": [],
949
+ "schema": "@qvac/chunk",
950
+ "derived": false,
951
+ "key": [
952
+ "chatId",
953
+ "seq"
954
+ ],
955
+ "trigger": null
940
956
  }
941
957
  ]
942
958
  }