@qvac/core 0.1.6 → 0.2.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.
- package/.claude/skills/compaction/SKILL.md +1 -1
- package/.claude/skills/gh-stack/SKILL.md +24 -24
- package/.claude/skills/gh-stack/references/commands.md +2 -2
- package/.claude/skills/js-house-style/SKILL.md +1 -1
- package/.claude/skills/pr-create/SKILL.md +46 -3
- package/.claude/skills/pr-review/SKILL.md +76 -7
- package/CLAUDE.md +3 -0
- package/README.md +10 -5
- package/dist-lib/lib/api/agents.js +3 -3
- package/dist-lib/lib/api/chat-groups.d.ts +1 -1
- package/dist-lib/lib/api/chat-groups.js +5 -3
- package/dist-lib/lib/api/chat.js +2 -2
- package/dist-lib/lib/api/current-mesh.d.ts +3 -2
- package/dist-lib/lib/api/current-mesh.js +4 -3
- package/dist-lib/lib/api/devices.js +1 -0
- package/dist-lib/lib/api/index.js +2 -0
- package/dist-lib/lib/api/members.d.ts +3 -0
- package/dist-lib/lib/api/members.js +23 -0
- package/dist-lib/lib/api/mesh.d.ts +14 -3
- package/dist-lib/lib/api/mesh.js +20 -3
- package/dist-lib/lib/api/watchable.d.ts +1 -1
- package/dist-lib/lib/api/watchable.js +1 -1
- package/dist-lib/lib/core/agent.d.ts +1 -0
- package/dist-lib/lib/core/agent.js +29 -1
- package/dist-lib/lib/core/chat-group.d.ts +4 -0
- package/dist-lib/lib/core/chat-group.js +43 -1
- package/dist-lib/lib/core/chat.d.ts +10 -0
- package/dist-lib/lib/core/chat.js +75 -9
- package/dist-lib/lib/core/contract/index.js +2 -0
- package/dist-lib/lib/core/contract/joined-meshes.d.ts +2 -0
- package/dist-lib/lib/core/contract/joined-meshes.js +41 -0
- package/dist-lib/lib/core/contract/members.js +68 -2
- package/dist-lib/lib/core/contract/writers.js +19 -3
- package/dist-lib/lib/core/departures.d.ts +3 -1
- package/dist-lib/lib/core/departures.js +6 -4
- package/dist-lib/lib/core/device-attestation.d.ts +8 -0
- package/dist-lib/lib/core/device-attestation.js +25 -0
- package/dist-lib/lib/core/device-invites.d.ts +9 -0
- package/dist-lib/lib/core/device-invites.js +40 -0
- package/dist-lib/lib/core/files/index.d.ts +2 -1
- package/dist-lib/lib/core/files/index.js +1 -1
- package/dist-lib/lib/core/files/store/index.d.ts +1 -0
- package/dist-lib/lib/core/files/store/server.d.ts +5 -4
- package/dist-lib/lib/core/files/store/server.js +10 -6
- package/dist-lib/lib/core/helpers/index.d.ts +1 -1
- package/dist-lib/lib/core/hosted-agents.d.ts +3 -1
- package/dist-lib/lib/core/hosted-agents.js +9 -3
- package/dist-lib/lib/core/identity.d.ts +10 -0
- package/dist-lib/lib/core/identity.js +45 -0
- package/dist-lib/lib/core/invite.d.ts +3 -0
- package/dist-lib/lib/core/invite.js +8 -2
- package/dist-lib/lib/core/local/index.d.ts +22 -7
- package/dist-lib/lib/core/local/index.js +202 -66
- package/dist-lib/lib/core/membership.d.ts +8 -2
- package/dist-lib/lib/core/membership.js +33 -9
- package/dist-lib/lib/core/mesh-seed-handoff.d.ts +17 -0
- package/dist-lib/lib/core/mesh-seed-handoff.js +34 -0
- package/dist-lib/lib/core/mesh.d.ts +12 -1
- package/dist-lib/lib/core/mesh.js +36 -7
- package/dist-lib/lib/core/migrations/index.d.ts +3 -1
- package/dist-lib/lib/core/migrations/index.js +2 -2
- package/dist-lib/lib/core/migrations/membership.js +27 -15
- package/dist-lib/lib/core/rank.d.ts +14 -0
- package/dist-lib/lib/core/rank.js +23 -0
- package/dist-lib/lib/core/sync/index.js +6 -0
- package/dist-lib/lib/core.d.ts +91 -13
- package/dist-lib/lib/core.js +1051 -207
- package/dist-lib/schema/build.js +3 -2
- package/dist-lib/schema/engine.js +153 -9
- package/dist-lib/schema/field-order.js +4 -1
- package/dist-lib/schema/local.js +32 -0
- package/dist-lib/schema/qvac.js +45 -6
- package/dist-lib/spec/bind.js +35 -0
- package/dist-lib/spec/calls.js +37 -27
- package/dist-lib/spec/capabilities.d.ts +30 -10
- package/dist-lib/spec/hrpc/hrpc.json +135 -5
- package/dist-lib/spec/hrpc/index.js +130 -9
- package/dist-lib/spec/hrpc/messages.js +408 -14
- package/dist-lib/spec/hyperschema/index.js +408 -14
- package/dist-lib/spec/hyperschema/schema.json +309 -1
- package/dist-lib/spec/hyperschema/types.d.ts +90 -1
- package/dist-lib/spec/local/hyperdb/db.json +46 -1
- package/dist-lib/spec/local/hyperdb/index.js +209 -2
- package/dist-lib/spec/local/hyperdb/messages.js +557 -90
- package/dist-lib/spec/local/hyperschema/index.js +240 -2
- package/dist-lib/spec/local/hyperschema/schema.json +120 -1
- package/dist-lib/spec/local/hyperschema/types.d.ts +33 -1
- package/dist-lib/spec/mesh/hyperdb/db.json +16 -1
- package/dist-lib/spec/mesh/hyperdb/index.js +71 -2
- package/dist-lib/spec/mesh/hyperdb/messages.js +571 -192
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +13 -1
- package/dist-lib/spec/mesh/hyperdispatch/index.js +35 -1
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +283 -20
- package/dist-lib/spec/mesh/hyperschema/index.js +283 -20
- package/dist-lib/spec/mesh/hyperschema/schema.json +179 -1
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +45 -1
- package/package.json +4 -4
- package/tui/app.mjs +416 -50
- package/tui/boot.mjs +1 -1
- package/tui/lib/sidebar.mjs +3 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated by the hyperschema compiler
|
|
2
|
-
// Schema Version:
|
|
2
|
+
// Schema Version: 5
|
|
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 =
|
|
9
|
+
const VERSION = 5
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line no-unused-vars
|
|
12
12
|
let version = VERSION
|
|
@@ -1097,6 +1097,232 @@ const encoding26 = {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
|
+
// @local/active-mesh-v1
|
|
1101
|
+
const encoding27 = {
|
|
1102
|
+
preencode(state, m) {
|
|
1103
|
+
c.fixed32.preencode(state, m.deviceId)
|
|
1104
|
+
state.end++ // max flag is 2 so always one byte
|
|
1105
|
+
|
|
1106
|
+
if (version >= 5 && m.activeMeshKey) c.fixed32.preencode(state, m.activeMeshKey)
|
|
1107
|
+
if (version >= 5 && m.homeMeshKey) c.fixed32.preencode(state, m.homeMeshKey)
|
|
1108
|
+
},
|
|
1109
|
+
encode(state, m) {
|
|
1110
|
+
const flags =
|
|
1111
|
+
((version >= 5 && m.activeMeshKey) ? 1 : 0) | ((version >= 5 && m.homeMeshKey) ? 2 : 0)
|
|
1112
|
+
|
|
1113
|
+
c.fixed32.encode(state, m.deviceId)
|
|
1114
|
+
c.uint.encode(state, flags)
|
|
1115
|
+
|
|
1116
|
+
if (version >= 5 && m.activeMeshKey) c.fixed32.encode(state, m.activeMeshKey)
|
|
1117
|
+
if (version >= 5 && m.homeMeshKey) c.fixed32.encode(state, m.homeMeshKey)
|
|
1118
|
+
},
|
|
1119
|
+
decode(state) {
|
|
1120
|
+
const v = c.uint.decode(state)
|
|
1121
|
+
const r0 = c.fixed32.decode(state)
|
|
1122
|
+
const flags = c.uint.decode(state)
|
|
1123
|
+
|
|
1124
|
+
return {
|
|
1125
|
+
version: v,
|
|
1126
|
+
deviceId: r0,
|
|
1127
|
+
activeMeshKey: (version >= 5 && (flags & 1) !== 0) ? c.fixed32.decode(state) : null,
|
|
1128
|
+
homeMeshKey: (version >= 5 && (flags & 2) !== 0) ? c.fixed32.decode(state) : null
|
|
1129
|
+
}
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
// @local/active-mesh
|
|
1134
|
+
const encoding28 = {
|
|
1135
|
+
preencode(state, m) {
|
|
1136
|
+
const v = m.version ?? 1
|
|
1137
|
+
c.uint.preencode(state, v)
|
|
1138
|
+
switch (v) {
|
|
1139
|
+
case 0:
|
|
1140
|
+
case 1:
|
|
1141
|
+
encoding27.preencode(state, m)
|
|
1142
|
+
break
|
|
1143
|
+
default:
|
|
1144
|
+
throw new Error('Unsupported version')
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
encode(state, m) {
|
|
1148
|
+
const v = m.version ?? 1
|
|
1149
|
+
c.uint.encode(state, v)
|
|
1150
|
+
switch (v) {
|
|
1151
|
+
case 0:
|
|
1152
|
+
case 1:
|
|
1153
|
+
encoding27.encode(state, m)
|
|
1154
|
+
break
|
|
1155
|
+
default:
|
|
1156
|
+
throw new Error('Unsupported version')
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
decode(state) {
|
|
1160
|
+
const start = state.start
|
|
1161
|
+
const v = c.uint.decode(state)
|
|
1162
|
+
state.start = start
|
|
1163
|
+
switch (v) {
|
|
1164
|
+
case 0:
|
|
1165
|
+
case 1: {
|
|
1166
|
+
const decoded = encoding27.decode(state)
|
|
1167
|
+
return decoded
|
|
1168
|
+
}
|
|
1169
|
+
default:
|
|
1170
|
+
throw new Error('Unsupported version')
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
// @local/mesh-membership-v1
|
|
1176
|
+
const encoding29 = {
|
|
1177
|
+
preencode(state, m) {
|
|
1178
|
+
c.fixed32.preencode(state, m.key)
|
|
1179
|
+
c.fixed32.preencode(state, m.seed)
|
|
1180
|
+
state.end++ // max flag is 2 so always one byte
|
|
1181
|
+
|
|
1182
|
+
if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
|
|
1183
|
+
if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
|
|
1184
|
+
},
|
|
1185
|
+
encode(state, m) {
|
|
1186
|
+
const flags = ((version >= 5 && m.writerSeed) ? 1 : 0) | ((version >= 5 && m.leftAt) ? 2 : 0)
|
|
1187
|
+
|
|
1188
|
+
c.fixed32.encode(state, m.key)
|
|
1189
|
+
c.fixed32.encode(state, m.seed)
|
|
1190
|
+
c.uint.encode(state, flags)
|
|
1191
|
+
|
|
1192
|
+
if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
|
|
1193
|
+
if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
|
|
1194
|
+
},
|
|
1195
|
+
decode(state) {
|
|
1196
|
+
const v = c.uint.decode(state)
|
|
1197
|
+
const r0 = c.fixed32.decode(state)
|
|
1198
|
+
const r1 = c.fixed32.decode(state)
|
|
1199
|
+
const flags = c.uint.decode(state)
|
|
1200
|
+
|
|
1201
|
+
return {
|
|
1202
|
+
version: v,
|
|
1203
|
+
key: r0,
|
|
1204
|
+
seed: r1,
|
|
1205
|
+
writerSeed: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null,
|
|
1206
|
+
leftAt: (version >= 5 && (flags & 2) !== 0) ? c.uint.decode(state) : 0
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
// @local/mesh-membership
|
|
1212
|
+
const encoding30 = {
|
|
1213
|
+
preencode(state, m) {
|
|
1214
|
+
const v = m.version ?? 1
|
|
1215
|
+
c.uint.preencode(state, v)
|
|
1216
|
+
switch (v) {
|
|
1217
|
+
case 0:
|
|
1218
|
+
case 1:
|
|
1219
|
+
encoding29.preencode(state, m)
|
|
1220
|
+
break
|
|
1221
|
+
default:
|
|
1222
|
+
throw new Error('Unsupported version')
|
|
1223
|
+
}
|
|
1224
|
+
},
|
|
1225
|
+
encode(state, m) {
|
|
1226
|
+
const v = m.version ?? 1
|
|
1227
|
+
c.uint.encode(state, v)
|
|
1228
|
+
switch (v) {
|
|
1229
|
+
case 0:
|
|
1230
|
+
case 1:
|
|
1231
|
+
encoding29.encode(state, m)
|
|
1232
|
+
break
|
|
1233
|
+
default:
|
|
1234
|
+
throw new Error('Unsupported version')
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
decode(state) {
|
|
1238
|
+
const start = state.start
|
|
1239
|
+
const v = c.uint.decode(state)
|
|
1240
|
+
state.start = start
|
|
1241
|
+
switch (v) {
|
|
1242
|
+
case 0:
|
|
1243
|
+
case 1: {
|
|
1244
|
+
const decoded = encoding29.decode(state)
|
|
1245
|
+
return decoded
|
|
1246
|
+
}
|
|
1247
|
+
default:
|
|
1248
|
+
throw new Error('Unsupported version')
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
// @local/member-proof-v1
|
|
1254
|
+
const encoding31 = {
|
|
1255
|
+
preencode(state, m) {
|
|
1256
|
+
c.fixed32.preencode(state, m.meshKey)
|
|
1257
|
+
c.fixed32.preencode(state, m.memberId)
|
|
1258
|
+
c.buffer.preencode(state, m.proof)
|
|
1259
|
+
c.uint.preencode(state, m.attestedAt)
|
|
1260
|
+
},
|
|
1261
|
+
encode(state, m) {
|
|
1262
|
+
c.fixed32.encode(state, m.meshKey)
|
|
1263
|
+
c.fixed32.encode(state, m.memberId)
|
|
1264
|
+
c.buffer.encode(state, m.proof)
|
|
1265
|
+
c.uint.encode(state, m.attestedAt)
|
|
1266
|
+
},
|
|
1267
|
+
decode(state) {
|
|
1268
|
+
const v = c.uint.decode(state)
|
|
1269
|
+
const r0 = c.fixed32.decode(state)
|
|
1270
|
+
const r1 = c.fixed32.decode(state)
|
|
1271
|
+
const r2 = c.buffer.decode(state)
|
|
1272
|
+
const r3 = c.uint.decode(state)
|
|
1273
|
+
|
|
1274
|
+
return {
|
|
1275
|
+
version: v,
|
|
1276
|
+
meshKey: r0,
|
|
1277
|
+
memberId: r1,
|
|
1278
|
+
proof: r2,
|
|
1279
|
+
attestedAt: r3
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
// @local/member-proof
|
|
1285
|
+
const encoding32 = {
|
|
1286
|
+
preencode(state, m) {
|
|
1287
|
+
const v = m.version ?? 1
|
|
1288
|
+
c.uint.preencode(state, v)
|
|
1289
|
+
switch (v) {
|
|
1290
|
+
case 0:
|
|
1291
|
+
case 1:
|
|
1292
|
+
encoding31.preencode(state, m)
|
|
1293
|
+
break
|
|
1294
|
+
default:
|
|
1295
|
+
throw new Error('Unsupported version')
|
|
1296
|
+
}
|
|
1297
|
+
},
|
|
1298
|
+
encode(state, m) {
|
|
1299
|
+
const v = m.version ?? 1
|
|
1300
|
+
c.uint.encode(state, v)
|
|
1301
|
+
switch (v) {
|
|
1302
|
+
case 0:
|
|
1303
|
+
case 1:
|
|
1304
|
+
encoding31.encode(state, m)
|
|
1305
|
+
break
|
|
1306
|
+
default:
|
|
1307
|
+
throw new Error('Unsupported version')
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
decode(state) {
|
|
1311
|
+
const start = state.start
|
|
1312
|
+
const v = c.uint.decode(state)
|
|
1313
|
+
state.start = start
|
|
1314
|
+
switch (v) {
|
|
1315
|
+
case 0:
|
|
1316
|
+
case 1: {
|
|
1317
|
+
const decoded = encoding31.decode(state)
|
|
1318
|
+
return decoded
|
|
1319
|
+
}
|
|
1320
|
+
default:
|
|
1321
|
+
throw new Error('Unsupported version')
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1100
1326
|
function setVersion(v) {
|
|
1101
1327
|
version = v
|
|
1102
1328
|
}
|
|
@@ -1180,6 +1406,18 @@ function getEncoding(name) {
|
|
|
1180
1406
|
return encoding25
|
|
1181
1407
|
case '@local/mesh-departure':
|
|
1182
1408
|
return encoding26
|
|
1409
|
+
case '@local/active-mesh-v1':
|
|
1410
|
+
return encoding27
|
|
1411
|
+
case '@local/active-mesh':
|
|
1412
|
+
return encoding28
|
|
1413
|
+
case '@local/mesh-membership-v1':
|
|
1414
|
+
return encoding29
|
|
1415
|
+
case '@local/mesh-membership':
|
|
1416
|
+
return encoding30
|
|
1417
|
+
case '@local/member-proof-v1':
|
|
1418
|
+
return encoding31
|
|
1419
|
+
case '@local/member-proof':
|
|
1420
|
+
return encoding32
|
|
1183
1421
|
default:
|
|
1184
1422
|
throw new Error('Encoder not found ' + name)
|
|
1185
1423
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version":
|
|
2
|
+
"version": 5,
|
|
3
3
|
"schema": [
|
|
4
4
|
{
|
|
5
5
|
"name": "qvac-state",
|
|
@@ -634,6 +634,125 @@
|
|
|
634
634
|
"version": 1
|
|
635
635
|
}
|
|
636
636
|
]
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
"name": "active-mesh-v1",
|
|
640
|
+
"namespace": "local",
|
|
641
|
+
"compact": false,
|
|
642
|
+
"flagsPosition": 1,
|
|
643
|
+
"fields": [
|
|
644
|
+
{
|
|
645
|
+
"name": "deviceId",
|
|
646
|
+
"required": true,
|
|
647
|
+
"type": "fixed32",
|
|
648
|
+
"version": 5
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
"name": "activeMeshKey",
|
|
652
|
+
"type": "fixed32",
|
|
653
|
+
"version": 5
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
"name": "homeMeshKey",
|
|
657
|
+
"type": "fixed32",
|
|
658
|
+
"version": 5
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"name": "active-mesh",
|
|
664
|
+
"namespace": "local",
|
|
665
|
+
"versions": [
|
|
666
|
+
{
|
|
667
|
+
"type": "@local/active-mesh-v1",
|
|
668
|
+
"map": null,
|
|
669
|
+
"version": 1
|
|
670
|
+
}
|
|
671
|
+
]
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
"name": "mesh-membership-v1",
|
|
675
|
+
"namespace": "local",
|
|
676
|
+
"compact": false,
|
|
677
|
+
"flagsPosition": 2,
|
|
678
|
+
"fields": [
|
|
679
|
+
{
|
|
680
|
+
"name": "key",
|
|
681
|
+
"required": true,
|
|
682
|
+
"type": "fixed32",
|
|
683
|
+
"version": 5
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"name": "seed",
|
|
687
|
+
"required": true,
|
|
688
|
+
"type": "fixed32",
|
|
689
|
+
"version": 5
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
"name": "writerSeed",
|
|
693
|
+
"type": "string",
|
|
694
|
+
"version": 5
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"name": "leftAt",
|
|
698
|
+
"type": "uint",
|
|
699
|
+
"version": 5
|
|
700
|
+
}
|
|
701
|
+
]
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"name": "mesh-membership",
|
|
705
|
+
"namespace": "local",
|
|
706
|
+
"versions": [
|
|
707
|
+
{
|
|
708
|
+
"type": "@local/mesh-membership-v1",
|
|
709
|
+
"map": null,
|
|
710
|
+
"version": 1
|
|
711
|
+
}
|
|
712
|
+
]
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
"name": "member-proof-v1",
|
|
716
|
+
"namespace": "local",
|
|
717
|
+
"compact": false,
|
|
718
|
+
"flagsPosition": -1,
|
|
719
|
+
"fields": [
|
|
720
|
+
{
|
|
721
|
+
"name": "meshKey",
|
|
722
|
+
"required": true,
|
|
723
|
+
"type": "fixed32",
|
|
724
|
+
"version": 5
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"name": "memberId",
|
|
728
|
+
"required": true,
|
|
729
|
+
"type": "fixed32",
|
|
730
|
+
"version": 5
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
"name": "proof",
|
|
734
|
+
"required": true,
|
|
735
|
+
"type": "buffer",
|
|
736
|
+
"version": 5
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"name": "attestedAt",
|
|
740
|
+
"required": true,
|
|
741
|
+
"type": "uint",
|
|
742
|
+
"version": 5
|
|
743
|
+
}
|
|
744
|
+
]
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"name": "member-proof",
|
|
748
|
+
"namespace": "local",
|
|
749
|
+
"versions": [
|
|
750
|
+
{
|
|
751
|
+
"type": "@local/member-proof-v1",
|
|
752
|
+
"map": null,
|
|
753
|
+
"version": 1
|
|
754
|
+
}
|
|
755
|
+
]
|
|
637
756
|
}
|
|
638
757
|
]
|
|
639
758
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is autogenerated by hyperschema-ts
|
|
2
|
-
// Schema version:
|
|
2
|
+
// Schema version: 5
|
|
3
3
|
// Do not edit manually.
|
|
4
4
|
|
|
5
5
|
export type LocalQvacState = 1 | 2 | 3 | 4
|
|
@@ -128,6 +128,32 @@ export interface LocalMeshDepartureV1 {
|
|
|
128
128
|
|
|
129
129
|
export type LocalMeshDeparture = (LocalMeshDepartureV1 & { version?: number })
|
|
130
130
|
|
|
131
|
+
export interface LocalActiveMeshV1 {
|
|
132
|
+
deviceId: Buffer
|
|
133
|
+
activeMeshKey?: Buffer | null
|
|
134
|
+
homeMeshKey?: Buffer | null
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export type LocalActiveMesh = (LocalActiveMeshV1 & { version?: number })
|
|
138
|
+
|
|
139
|
+
export interface LocalMeshMembershipV1 {
|
|
140
|
+
key: Buffer
|
|
141
|
+
seed: Buffer
|
|
142
|
+
writerSeed?: string | null
|
|
143
|
+
leftAt?: number
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export type LocalMeshMembership = (LocalMeshMembershipV1 & { version?: number })
|
|
147
|
+
|
|
148
|
+
export interface LocalMemberProofV1 {
|
|
149
|
+
meshKey: Buffer
|
|
150
|
+
memberId: Buffer
|
|
151
|
+
proof: Buffer
|
|
152
|
+
attestedAt: number
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export type LocalMemberProof = (LocalMemberProofV1 & { version?: number })
|
|
156
|
+
|
|
131
157
|
export interface SchemaTypes {
|
|
132
158
|
"@local/qvac-state": LocalQvacState
|
|
133
159
|
"@local/config-v1": LocalConfigV1
|
|
@@ -156,4 +182,10 @@ export interface SchemaTypes {
|
|
|
156
182
|
"@local/model-notify": LocalModelNotify
|
|
157
183
|
"@local/mesh-departure-v1": LocalMeshDepartureV1
|
|
158
184
|
"@local/mesh-departure": LocalMeshDeparture
|
|
185
|
+
"@local/active-mesh-v1": LocalActiveMeshV1
|
|
186
|
+
"@local/active-mesh": LocalActiveMesh
|
|
187
|
+
"@local/mesh-membership-v1": LocalMeshMembershipV1
|
|
188
|
+
"@local/mesh-membership": LocalMeshMembership
|
|
189
|
+
"@local/member-proof-v1": LocalMemberProofV1
|
|
190
|
+
"@local/member-proof": LocalMemberProof
|
|
159
191
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version":
|
|
2
|
+
"version": 5,
|
|
3
3
|
"offset": 0,
|
|
4
4
|
"schema": [
|
|
5
5
|
{
|
|
@@ -697,6 +697,21 @@
|
|
|
697
697
|
},
|
|
698
698
|
"map": "liveWritersByMostRecentMap"
|
|
699
699
|
}
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"name": "joined-meshes",
|
|
703
|
+
"namespace": "qvac",
|
|
704
|
+
"id": 37,
|
|
705
|
+
"type": 1,
|
|
706
|
+
"version": 5,
|
|
707
|
+
"versionField": null,
|
|
708
|
+
"indexes": [],
|
|
709
|
+
"schema": "@qvac/joined-mesh",
|
|
710
|
+
"derived": false,
|
|
711
|
+
"key": [
|
|
712
|
+
"meshKey"
|
|
713
|
+
],
|
|
714
|
+
"trigger": null
|
|
700
715
|
}
|
|
701
716
|
]
|
|
702
717
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { IndexEncoder, c, b4a } from 'hyperdb/runtime'
|
|
5
5
|
import { version, getEncoding, setVersion } from './messages.js'
|
|
6
6
|
|
|
7
|
-
const versions = { schema: version, db:
|
|
7
|
+
const versions = { schema: version, db: 5 }
|
|
8
8
|
|
|
9
9
|
import * as helpers0 from '../../../schema/helpers.js'
|
|
10
10
|
|
|
@@ -2165,6 +2165,73 @@ const index36 = {
|
|
|
2165
2165
|
}
|
|
2166
2166
|
collection29.indexes.push(index36)
|
|
2167
2167
|
|
|
2168
|
+
// '@qvac/joined-meshes' collection key
|
|
2169
|
+
const collection37_key = new IndexEncoder([
|
|
2170
|
+
IndexEncoder.BUFFER
|
|
2171
|
+
], { prefix: 37 })
|
|
2172
|
+
|
|
2173
|
+
function collection37_indexify (record) {
|
|
2174
|
+
const a = record.meshKey
|
|
2175
|
+
return a === undefined ? [] : [a]
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
// '@qvac/joined-meshes' value encoding
|
|
2179
|
+
const collection37_enc = getEncoding('@qvac/joined-mesh/hyperdb#37')
|
|
2180
|
+
|
|
2181
|
+
// '@qvac/joined-meshes' reconstruction function
|
|
2182
|
+
function collection37_reconstruct (schemaVersion, keyBuf, valueBuf) {
|
|
2183
|
+
const key = collection37_key.decode(keyBuf)
|
|
2184
|
+
setVersion(schemaVersion)
|
|
2185
|
+
const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
|
|
2186
|
+
const type = c.uint.decode(state)
|
|
2187
|
+
if (type !== 0) throw new Error('Unknown collection type: ' + type)
|
|
2188
|
+
collection37.decodedVersion = c.uint.decode(state)
|
|
2189
|
+
const record = collection37_enc.decode(state)
|
|
2190
|
+
record.meshKey = key[0]
|
|
2191
|
+
return record
|
|
2192
|
+
}
|
|
2193
|
+
// '@qvac/joined-meshes' key reconstruction function
|
|
2194
|
+
function collection37_reconstruct_key (keyBuf) {
|
|
2195
|
+
const key = collection37_key.decode(keyBuf)
|
|
2196
|
+
return {
|
|
2197
|
+
meshKey: key[0]
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
// '@qvac/joined-meshes'
|
|
2202
|
+
const collection37 = {
|
|
2203
|
+
name: '@qvac/joined-meshes',
|
|
2204
|
+
id: 37,
|
|
2205
|
+
version: 5,
|
|
2206
|
+
encodeKey (record) {
|
|
2207
|
+
const key = [record.meshKey]
|
|
2208
|
+
return collection37_key.encode(key)
|
|
2209
|
+
},
|
|
2210
|
+
encodeKeyRange ({ gt, lt, gte, lte } = {}) {
|
|
2211
|
+
return collection37_key.encodeRange({
|
|
2212
|
+
gt: gt ? collection37_indexify(gt) : null,
|
|
2213
|
+
lt: lt ? collection37_indexify(lt) : null,
|
|
2214
|
+
gte: gte ? collection37_indexify(gte) : null,
|
|
2215
|
+
lte: lte ? collection37_indexify(lte) : null
|
|
2216
|
+
})
|
|
2217
|
+
},
|
|
2218
|
+
encodeValue (schemaVersion, collectionVersion, record) {
|
|
2219
|
+
setVersion(schemaVersion)
|
|
2220
|
+
const state = { start: 0, end: 2, buffer: null }
|
|
2221
|
+
collection37_enc.preencode(state, record)
|
|
2222
|
+
state.buffer = b4a.allocUnsafe(state.end)
|
|
2223
|
+
state.buffer[state.start++] = 0
|
|
2224
|
+
state.buffer[state.start++] = collectionVersion
|
|
2225
|
+
collection37_enc.encode(state, record)
|
|
2226
|
+
return state.buffer
|
|
2227
|
+
},
|
|
2228
|
+
trigger: null,
|
|
2229
|
+
reconstruct: collection37_reconstruct,
|
|
2230
|
+
reconstructKey: collection37_reconstruct_key,
|
|
2231
|
+
indexes: [],
|
|
2232
|
+
decodedVersion: 0
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2168
2235
|
const collections = [
|
|
2169
2236
|
collection0,
|
|
2170
2237
|
collection1,
|
|
@@ -2182,7 +2249,8 @@ const collections = [
|
|
|
2182
2249
|
collection29,
|
|
2183
2250
|
collection32,
|
|
2184
2251
|
collection33,
|
|
2185
|
-
collection34
|
|
2252
|
+
collection34,
|
|
2253
|
+
collection37
|
|
2186
2254
|
]
|
|
2187
2255
|
|
|
2188
2256
|
const indexes = [
|
|
@@ -2229,6 +2297,7 @@ function resolveCollection (name) {
|
|
|
2229
2297
|
case '@qvac/device-attestations': return collection32
|
|
2230
2298
|
case '@qvac/members': return collection33
|
|
2231
2299
|
case '@qvac/chat-groups': return collection34
|
|
2300
|
+
case '@qvac/joined-meshes': return collection37
|
|
2232
2301
|
default: return null
|
|
2233
2302
|
}
|
|
2234
2303
|
}
|