@qvac/core 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +5 -5
- 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,8 +1097,234 @@ const encoding26 = {
|
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
|
|
1100
|
-
// @local/
|
|
1100
|
+
// @local/active-mesh-v1
|
|
1101
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
|
+
|
|
1326
|
+
// @local/config-v1/hyperdb#0
|
|
1327
|
+
const encoding33 = {
|
|
1102
1328
|
preencode(state, m) {
|
|
1103
1329
|
state.end++ // max flag is 1 so always one byte
|
|
1104
1330
|
|
|
@@ -1124,14 +1350,14 @@ const encoding27 = {
|
|
|
1124
1350
|
}
|
|
1125
1351
|
|
|
1126
1352
|
// @local/config/hyperdb#0
|
|
1127
|
-
const
|
|
1353
|
+
const encoding34 = {
|
|
1128
1354
|
preencode(state, m) {
|
|
1129
1355
|
const v = m.version ?? 1
|
|
1130
1356
|
c.uint.preencode(state, v)
|
|
1131
1357
|
switch (v) {
|
|
1132
1358
|
case 0:
|
|
1133
1359
|
case 1:
|
|
1134
|
-
|
|
1360
|
+
encoding33.preencode(state, m)
|
|
1135
1361
|
break
|
|
1136
1362
|
default:
|
|
1137
1363
|
throw new Error('Unsupported version')
|
|
@@ -1143,7 +1369,7 @@ const encoding28 = {
|
|
|
1143
1369
|
switch (v) {
|
|
1144
1370
|
case 0:
|
|
1145
1371
|
case 1:
|
|
1146
|
-
|
|
1372
|
+
encoding33.encode(state, m)
|
|
1147
1373
|
break
|
|
1148
1374
|
default:
|
|
1149
1375
|
throw new Error('Unsupported version')
|
|
@@ -1156,7 +1382,7 @@ const encoding28 = {
|
|
|
1156
1382
|
switch (v) {
|
|
1157
1383
|
case 0:
|
|
1158
1384
|
case 1: {
|
|
1159
|
-
const decoded =
|
|
1385
|
+
const decoded = encoding33.decode(state)
|
|
1160
1386
|
return decoded
|
|
1161
1387
|
}
|
|
1162
1388
|
default:
|
|
@@ -1166,7 +1392,7 @@ const encoding28 = {
|
|
|
1166
1392
|
}
|
|
1167
1393
|
|
|
1168
1394
|
// @local/mesh-session-v1/hyperdb#1
|
|
1169
|
-
const
|
|
1395
|
+
const encoding35 = {
|
|
1170
1396
|
preencode(state, m) {
|
|
1171
1397
|
state.end++ // max flag is 4 so always one byte
|
|
1172
1398
|
|
|
@@ -1196,14 +1422,14 @@ const encoding29 = {
|
|
|
1196
1422
|
}
|
|
1197
1423
|
|
|
1198
1424
|
// @local/mesh-session/hyperdb#1
|
|
1199
|
-
const
|
|
1425
|
+
const encoding36 = {
|
|
1200
1426
|
preencode(state, m) {
|
|
1201
1427
|
const v = m.version ?? 1
|
|
1202
1428
|
c.uint.preencode(state, v)
|
|
1203
1429
|
switch (v) {
|
|
1204
1430
|
case 0:
|
|
1205
1431
|
case 1:
|
|
1206
|
-
|
|
1432
|
+
encoding35.preencode(state, m)
|
|
1207
1433
|
break
|
|
1208
1434
|
default:
|
|
1209
1435
|
throw new Error('Unsupported version')
|
|
@@ -1215,7 +1441,7 @@ const encoding30 = {
|
|
|
1215
1441
|
switch (v) {
|
|
1216
1442
|
case 0:
|
|
1217
1443
|
case 1:
|
|
1218
|
-
|
|
1444
|
+
encoding35.encode(state, m)
|
|
1219
1445
|
break
|
|
1220
1446
|
default:
|
|
1221
1447
|
throw new Error('Unsupported version')
|
|
@@ -1228,7 +1454,7 @@ const encoding30 = {
|
|
|
1228
1454
|
switch (v) {
|
|
1229
1455
|
case 0:
|
|
1230
1456
|
case 1: {
|
|
1231
|
-
const decoded =
|
|
1457
|
+
const decoded = encoding35.decode(state)
|
|
1232
1458
|
return decoded
|
|
1233
1459
|
}
|
|
1234
1460
|
default:
|
|
@@ -1238,7 +1464,7 @@ const encoding30 = {
|
|
|
1238
1464
|
}
|
|
1239
1465
|
|
|
1240
1466
|
// @local/mesh-history-v1/hyperdb#2
|
|
1241
|
-
const
|
|
1467
|
+
const encoding37 = {
|
|
1242
1468
|
preencode(state, m) {
|
|
1243
1469
|
c.buffer.preencode(state, m.seed)
|
|
1244
1470
|
state.end++ // max flag is 2 so always one byte
|
|
@@ -1269,14 +1495,14 @@ const encoding31 = {
|
|
|
1269
1495
|
}
|
|
1270
1496
|
|
|
1271
1497
|
// @local/mesh-history/hyperdb#2
|
|
1272
|
-
const
|
|
1498
|
+
const encoding38 = {
|
|
1273
1499
|
preencode(state, m) {
|
|
1274
1500
|
const v = m.version ?? 1
|
|
1275
1501
|
c.uint.preencode(state, v)
|
|
1276
1502
|
switch (v) {
|
|
1277
1503
|
case 0:
|
|
1278
1504
|
case 1:
|
|
1279
|
-
|
|
1505
|
+
encoding37.preencode(state, m)
|
|
1280
1506
|
break
|
|
1281
1507
|
default:
|
|
1282
1508
|
throw new Error('Unsupported version')
|
|
@@ -1288,7 +1514,7 @@ const encoding32 = {
|
|
|
1288
1514
|
switch (v) {
|
|
1289
1515
|
case 0:
|
|
1290
1516
|
case 1:
|
|
1291
|
-
|
|
1517
|
+
encoding37.encode(state, m)
|
|
1292
1518
|
break
|
|
1293
1519
|
default:
|
|
1294
1520
|
throw new Error('Unsupported version')
|
|
@@ -1301,7 +1527,7 @@ const encoding32 = {
|
|
|
1301
1527
|
switch (v) {
|
|
1302
1528
|
case 0:
|
|
1303
1529
|
case 1: {
|
|
1304
|
-
const decoded =
|
|
1530
|
+
const decoded = encoding37.decode(state)
|
|
1305
1531
|
return decoded
|
|
1306
1532
|
}
|
|
1307
1533
|
default:
|
|
@@ -1311,7 +1537,7 @@ const encoding32 = {
|
|
|
1311
1537
|
}
|
|
1312
1538
|
|
|
1313
1539
|
// @local/device-v1/hyperdb#3
|
|
1314
|
-
const
|
|
1540
|
+
const encoding39 = {
|
|
1315
1541
|
preencode(state, m) {
|
|
1316
1542
|
c.string.preencode(state, m.name)
|
|
1317
1543
|
encoding14.preencode(state, m.capabilityProfile)
|
|
@@ -1349,14 +1575,14 @@ const encoding33 = {
|
|
|
1349
1575
|
}
|
|
1350
1576
|
|
|
1351
1577
|
// @local/device/hyperdb#3
|
|
1352
|
-
const
|
|
1578
|
+
const encoding40 = {
|
|
1353
1579
|
preencode(state, m) {
|
|
1354
1580
|
const v = m.version ?? 1
|
|
1355
1581
|
c.uint.preencode(state, v)
|
|
1356
1582
|
switch (v) {
|
|
1357
1583
|
case 0:
|
|
1358
1584
|
case 1:
|
|
1359
|
-
|
|
1585
|
+
encoding39.preencode(state, m)
|
|
1360
1586
|
break
|
|
1361
1587
|
default:
|
|
1362
1588
|
throw new Error('Unsupported version')
|
|
@@ -1368,7 +1594,7 @@ const encoding34 = {
|
|
|
1368
1594
|
switch (v) {
|
|
1369
1595
|
case 0:
|
|
1370
1596
|
case 1:
|
|
1371
|
-
|
|
1597
|
+
encoding39.encode(state, m)
|
|
1372
1598
|
break
|
|
1373
1599
|
default:
|
|
1374
1600
|
throw new Error('Unsupported version')
|
|
@@ -1381,7 +1607,7 @@ const encoding34 = {
|
|
|
1381
1607
|
switch (v) {
|
|
1382
1608
|
case 0:
|
|
1383
1609
|
case 1: {
|
|
1384
|
-
const decoded =
|
|
1610
|
+
const decoded = encoding39.decode(state)
|
|
1385
1611
|
return decoded
|
|
1386
1612
|
}
|
|
1387
1613
|
default:
|
|
@@ -1391,10 +1617,10 @@ const encoding34 = {
|
|
|
1391
1617
|
}
|
|
1392
1618
|
|
|
1393
1619
|
// @local/app-config-v1/hyperdb#4.pausedModels
|
|
1394
|
-
const
|
|
1620
|
+
const encoding41_8 = encoding9_8
|
|
1395
1621
|
|
|
1396
1622
|
// @local/app-config-v1/hyperdb#4
|
|
1397
|
-
const
|
|
1623
|
+
const encoding41 = {
|
|
1398
1624
|
preencode(state, m) {
|
|
1399
1625
|
const flags =
|
|
1400
1626
|
(m.activeAgentId ? 1 : 0) |
|
|
@@ -1413,7 +1639,7 @@ const encoding35 = {
|
|
|
1413
1639
|
if (m.ctxSize) c.uint.preencode(state, m.ctxSize)
|
|
1414
1640
|
if (m.lastModelName) c.string.preencode(state, m.lastModelName)
|
|
1415
1641
|
if (m.delegation) c.json.preencode(state, m.delegation)
|
|
1416
|
-
if (m.pausedModels)
|
|
1642
|
+
if (m.pausedModels) encoding41_8.preencode(state, m.pausedModels)
|
|
1417
1643
|
},
|
|
1418
1644
|
encode(state, m) {
|
|
1419
1645
|
const flags =
|
|
@@ -1433,7 +1659,7 @@ const encoding35 = {
|
|
|
1433
1659
|
if (m.ctxSize) c.uint.encode(state, m.ctxSize)
|
|
1434
1660
|
if (m.lastModelName) c.string.encode(state, m.lastModelName)
|
|
1435
1661
|
if (m.delegation) c.json.encode(state, m.delegation)
|
|
1436
|
-
if (m.pausedModels)
|
|
1662
|
+
if (m.pausedModels) encoding41_8.encode(state, m.pausedModels)
|
|
1437
1663
|
},
|
|
1438
1664
|
decode(state) {
|
|
1439
1665
|
const v = c.uint.decode(state)
|
|
@@ -1449,20 +1675,20 @@ const encoding35 = {
|
|
|
1449
1675
|
lastModelName: (flags & 16) !== 0 ? c.string.decode(state) : null,
|
|
1450
1676
|
onboardingCompleted: (flags & 32) !== 0,
|
|
1451
1677
|
delegation: (flags & 64) !== 0 ? c.json.decode(state) : null,
|
|
1452
|
-
pausedModels: (flags & 128) !== 0 ?
|
|
1678
|
+
pausedModels: (flags & 128) !== 0 ? encoding41_8.decode(state) : null
|
|
1453
1679
|
}
|
|
1454
1680
|
}
|
|
1455
1681
|
}
|
|
1456
1682
|
|
|
1457
1683
|
// @local/app-config/hyperdb#4
|
|
1458
|
-
const
|
|
1684
|
+
const encoding42 = {
|
|
1459
1685
|
preencode(state, m) {
|
|
1460
1686
|
const v = m.version ?? 1
|
|
1461
1687
|
c.uint.preencode(state, v)
|
|
1462
1688
|
switch (v) {
|
|
1463
1689
|
case 0:
|
|
1464
1690
|
case 1:
|
|
1465
|
-
|
|
1691
|
+
encoding41.preencode(state, m)
|
|
1466
1692
|
break
|
|
1467
1693
|
default:
|
|
1468
1694
|
throw new Error('Unsupported version')
|
|
@@ -1474,7 +1700,7 @@ const encoding36 = {
|
|
|
1474
1700
|
switch (v) {
|
|
1475
1701
|
case 0:
|
|
1476
1702
|
case 1:
|
|
1477
|
-
|
|
1703
|
+
encoding41.encode(state, m)
|
|
1478
1704
|
break
|
|
1479
1705
|
default:
|
|
1480
1706
|
throw new Error('Unsupported version')
|
|
@@ -1487,7 +1713,7 @@ const encoding36 = {
|
|
|
1487
1713
|
switch (v) {
|
|
1488
1714
|
case 0:
|
|
1489
1715
|
case 1: {
|
|
1490
|
-
const decoded =
|
|
1716
|
+
const decoded = encoding41.decode(state)
|
|
1491
1717
|
return decoded
|
|
1492
1718
|
}
|
|
1493
1719
|
default:
|
|
@@ -1497,7 +1723,7 @@ const encoding36 = {
|
|
|
1497
1723
|
}
|
|
1498
1724
|
|
|
1499
1725
|
// @local/model-download-v1/hyperdb#5
|
|
1500
|
-
const
|
|
1726
|
+
const encoding43 = {
|
|
1501
1727
|
preencode(state, m) {
|
|
1502
1728
|
encoding11.preencode(state, m.phase)
|
|
1503
1729
|
state.end++ // max flag is 16 so always one byte
|
|
@@ -1547,14 +1773,14 @@ const encoding37 = {
|
|
|
1547
1773
|
}
|
|
1548
1774
|
|
|
1549
1775
|
// @local/model-download/hyperdb#5
|
|
1550
|
-
const
|
|
1776
|
+
const encoding44 = {
|
|
1551
1777
|
preencode(state, m) {
|
|
1552
1778
|
const v = m.version ?? 1
|
|
1553
1779
|
c.uint.preencode(state, v)
|
|
1554
1780
|
switch (v) {
|
|
1555
1781
|
case 0:
|
|
1556
1782
|
case 1:
|
|
1557
|
-
|
|
1783
|
+
encoding43.preencode(state, m)
|
|
1558
1784
|
break
|
|
1559
1785
|
default:
|
|
1560
1786
|
throw new Error('Unsupported version')
|
|
@@ -1566,7 +1792,7 @@ const encoding38 = {
|
|
|
1566
1792
|
switch (v) {
|
|
1567
1793
|
case 0:
|
|
1568
1794
|
case 1:
|
|
1569
|
-
|
|
1795
|
+
encoding43.encode(state, m)
|
|
1570
1796
|
break
|
|
1571
1797
|
default:
|
|
1572
1798
|
throw new Error('Unsupported version')
|
|
@@ -1579,7 +1805,7 @@ const encoding38 = {
|
|
|
1579
1805
|
switch (v) {
|
|
1580
1806
|
case 0:
|
|
1581
1807
|
case 1: {
|
|
1582
|
-
const decoded =
|
|
1808
|
+
const decoded = encoding43.decode(state)
|
|
1583
1809
|
return decoded
|
|
1584
1810
|
}
|
|
1585
1811
|
default:
|
|
@@ -1589,7 +1815,7 @@ const encoding38 = {
|
|
|
1589
1815
|
}
|
|
1590
1816
|
|
|
1591
1817
|
// @local/custom-model-v1/hyperdb#6
|
|
1592
|
-
const
|
|
1818
|
+
const encoding45 = {
|
|
1593
1819
|
preencode(state, m) {
|
|
1594
1820
|
c.string.preencode(state, m.src)
|
|
1595
1821
|
state.end++ // max flag is 16 so always one byte
|
|
@@ -1633,14 +1859,14 @@ const encoding39 = {
|
|
|
1633
1859
|
}
|
|
1634
1860
|
|
|
1635
1861
|
// @local/custom-model/hyperdb#6
|
|
1636
|
-
const
|
|
1862
|
+
const encoding46 = {
|
|
1637
1863
|
preencode(state, m) {
|
|
1638
1864
|
const v = m.version ?? 1
|
|
1639
1865
|
c.uint.preencode(state, v)
|
|
1640
1866
|
switch (v) {
|
|
1641
1867
|
case 0:
|
|
1642
1868
|
case 1:
|
|
1643
|
-
|
|
1869
|
+
encoding45.preencode(state, m)
|
|
1644
1870
|
break
|
|
1645
1871
|
default:
|
|
1646
1872
|
throw new Error('Unsupported version')
|
|
@@ -1652,7 +1878,7 @@ const encoding40 = {
|
|
|
1652
1878
|
switch (v) {
|
|
1653
1879
|
case 0:
|
|
1654
1880
|
case 1:
|
|
1655
|
-
|
|
1881
|
+
encoding45.encode(state, m)
|
|
1656
1882
|
break
|
|
1657
1883
|
default:
|
|
1658
1884
|
throw new Error('Unsupported version')
|
|
@@ -1665,7 +1891,7 @@ const encoding40 = {
|
|
|
1665
1891
|
switch (v) {
|
|
1666
1892
|
case 0:
|
|
1667
1893
|
case 1: {
|
|
1668
|
-
const decoded =
|
|
1894
|
+
const decoded = encoding45.decode(state)
|
|
1669
1895
|
return decoded
|
|
1670
1896
|
}
|
|
1671
1897
|
default:
|
|
@@ -1675,7 +1901,7 @@ const encoding40 = {
|
|
|
1675
1901
|
}
|
|
1676
1902
|
|
|
1677
1903
|
// @local/identity-v1/hyperdb#7
|
|
1678
|
-
const
|
|
1904
|
+
const encoding47 = {
|
|
1679
1905
|
preencode(state, m) {
|
|
1680
1906
|
c.buffer.preencode(state, m.publicKey)
|
|
1681
1907
|
c.buffer.preencode(state, m.proof)
|
|
@@ -1703,14 +1929,14 @@ const encoding41 = {
|
|
|
1703
1929
|
}
|
|
1704
1930
|
|
|
1705
1931
|
// @local/identity/hyperdb#7
|
|
1706
|
-
const
|
|
1932
|
+
const encoding48 = {
|
|
1707
1933
|
preencode(state, m) {
|
|
1708
1934
|
const v = m.version ?? 1
|
|
1709
1935
|
c.uint.preencode(state, v)
|
|
1710
1936
|
switch (v) {
|
|
1711
1937
|
case 0:
|
|
1712
1938
|
case 1:
|
|
1713
|
-
|
|
1939
|
+
encoding47.preencode(state, m)
|
|
1714
1940
|
break
|
|
1715
1941
|
default:
|
|
1716
1942
|
throw new Error('Unsupported version')
|
|
@@ -1722,7 +1948,7 @@ const encoding42 = {
|
|
|
1722
1948
|
switch (v) {
|
|
1723
1949
|
case 0:
|
|
1724
1950
|
case 1:
|
|
1725
|
-
|
|
1951
|
+
encoding47.encode(state, m)
|
|
1726
1952
|
break
|
|
1727
1953
|
default:
|
|
1728
1954
|
throw new Error('Unsupported version')
|
|
@@ -1735,7 +1961,7 @@ const encoding42 = {
|
|
|
1735
1961
|
switch (v) {
|
|
1736
1962
|
case 0:
|
|
1737
1963
|
case 1: {
|
|
1738
|
-
const decoded =
|
|
1964
|
+
const decoded = encoding47.decode(state)
|
|
1739
1965
|
return decoded
|
|
1740
1966
|
}
|
|
1741
1967
|
default:
|
|
@@ -1745,7 +1971,7 @@ const encoding42 = {
|
|
|
1745
1971
|
}
|
|
1746
1972
|
|
|
1747
1973
|
// @local/membership-v1/hyperdb#8
|
|
1748
|
-
const
|
|
1974
|
+
const encoding49 = {
|
|
1749
1975
|
preencode(state, m) {
|
|
1750
1976
|
c.fixed32.preencode(state, m.memberId)
|
|
1751
1977
|
c.buffer.preencode(state, m.proof)
|
|
@@ -1773,14 +1999,14 @@ const encoding43 = {
|
|
|
1773
1999
|
}
|
|
1774
2000
|
|
|
1775
2001
|
// @local/membership/hyperdb#8
|
|
1776
|
-
const
|
|
2002
|
+
const encoding50 = {
|
|
1777
2003
|
preencode(state, m) {
|
|
1778
2004
|
const v = m.version ?? 1
|
|
1779
2005
|
c.uint.preencode(state, v)
|
|
1780
2006
|
switch (v) {
|
|
1781
2007
|
case 0:
|
|
1782
2008
|
case 1:
|
|
1783
|
-
|
|
2009
|
+
encoding49.preencode(state, m)
|
|
1784
2010
|
break
|
|
1785
2011
|
default:
|
|
1786
2012
|
throw new Error('Unsupported version')
|
|
@@ -1792,7 +2018,7 @@ const encoding44 = {
|
|
|
1792
2018
|
switch (v) {
|
|
1793
2019
|
case 0:
|
|
1794
2020
|
case 1:
|
|
1795
|
-
|
|
2021
|
+
encoding49.encode(state, m)
|
|
1796
2022
|
break
|
|
1797
2023
|
default:
|
|
1798
2024
|
throw new Error('Unsupported version')
|
|
@@ -1805,7 +2031,7 @@ const encoding44 = {
|
|
|
1805
2031
|
switch (v) {
|
|
1806
2032
|
case 0:
|
|
1807
2033
|
case 1: {
|
|
1808
|
-
const decoded =
|
|
2034
|
+
const decoded = encoding49.decode(state)
|
|
1809
2035
|
return decoded
|
|
1810
2036
|
}
|
|
1811
2037
|
default:
|
|
@@ -1815,7 +2041,7 @@ const encoding44 = {
|
|
|
1815
2041
|
}
|
|
1816
2042
|
|
|
1817
2043
|
// @local/chat-notify-v1/hyperdb#9
|
|
1818
|
-
const
|
|
2044
|
+
const encoding51 = {
|
|
1819
2045
|
preencode(state, m) {
|
|
1820
2046
|
c.uint.preencode(state, m.ackedThrough)
|
|
1821
2047
|
},
|
|
@@ -1835,14 +2061,14 @@ const encoding45 = {
|
|
|
1835
2061
|
}
|
|
1836
2062
|
|
|
1837
2063
|
// @local/chat-notify/hyperdb#9
|
|
1838
|
-
const
|
|
2064
|
+
const encoding52 = {
|
|
1839
2065
|
preencode(state, m) {
|
|
1840
2066
|
const v = m.version ?? 1
|
|
1841
2067
|
c.uint.preencode(state, v)
|
|
1842
2068
|
switch (v) {
|
|
1843
2069
|
case 0:
|
|
1844
2070
|
case 1:
|
|
1845
|
-
|
|
2071
|
+
encoding51.preencode(state, m)
|
|
1846
2072
|
break
|
|
1847
2073
|
default:
|
|
1848
2074
|
throw new Error('Unsupported version')
|
|
@@ -1854,7 +2080,7 @@ const encoding46 = {
|
|
|
1854
2080
|
switch (v) {
|
|
1855
2081
|
case 0:
|
|
1856
2082
|
case 1:
|
|
1857
|
-
|
|
2083
|
+
encoding51.encode(state, m)
|
|
1858
2084
|
break
|
|
1859
2085
|
default:
|
|
1860
2086
|
throw new Error('Unsupported version')
|
|
@@ -1867,7 +2093,7 @@ const encoding46 = {
|
|
|
1867
2093
|
switch (v) {
|
|
1868
2094
|
case 0:
|
|
1869
2095
|
case 1: {
|
|
1870
|
-
const decoded =
|
|
2096
|
+
const decoded = encoding51.decode(state)
|
|
1871
2097
|
return decoded
|
|
1872
2098
|
}
|
|
1873
2099
|
default:
|
|
@@ -1877,7 +2103,7 @@ const encoding46 = {
|
|
|
1877
2103
|
}
|
|
1878
2104
|
|
|
1879
2105
|
// @local/model-notify-v1/hyperdb#10
|
|
1880
|
-
const
|
|
2106
|
+
const encoding53 = {
|
|
1881
2107
|
preencode(state, m) {
|
|
1882
2108
|
c.string.preencode(state, m.transferId)
|
|
1883
2109
|
state.end++ // max flag is 8 so always one byte
|
|
@@ -1916,14 +2142,14 @@ const encoding47 = {
|
|
|
1916
2142
|
}
|
|
1917
2143
|
|
|
1918
2144
|
// @local/model-notify/hyperdb#10
|
|
1919
|
-
const
|
|
2145
|
+
const encoding54 = {
|
|
1920
2146
|
preencode(state, m) {
|
|
1921
2147
|
const v = m.version ?? 1
|
|
1922
2148
|
c.uint.preencode(state, v)
|
|
1923
2149
|
switch (v) {
|
|
1924
2150
|
case 0:
|
|
1925
2151
|
case 1:
|
|
1926
|
-
|
|
2152
|
+
encoding53.preencode(state, m)
|
|
1927
2153
|
break
|
|
1928
2154
|
default:
|
|
1929
2155
|
throw new Error('Unsupported version')
|
|
@@ -1935,7 +2161,7 @@ const encoding48 = {
|
|
|
1935
2161
|
switch (v) {
|
|
1936
2162
|
case 0:
|
|
1937
2163
|
case 1:
|
|
1938
|
-
|
|
2164
|
+
encoding53.encode(state, m)
|
|
1939
2165
|
break
|
|
1940
2166
|
default:
|
|
1941
2167
|
throw new Error('Unsupported version')
|
|
@@ -1948,7 +2174,7 @@ const encoding48 = {
|
|
|
1948
2174
|
switch (v) {
|
|
1949
2175
|
case 0:
|
|
1950
2176
|
case 1: {
|
|
1951
|
-
const decoded =
|
|
2177
|
+
const decoded = encoding53.decode(state)
|
|
1952
2178
|
return decoded
|
|
1953
2179
|
}
|
|
1954
2180
|
default:
|
|
@@ -1958,7 +2184,7 @@ const encoding48 = {
|
|
|
1958
2184
|
}
|
|
1959
2185
|
|
|
1960
2186
|
// @local/mesh-departure-v1/hyperdb#11
|
|
1961
|
-
const
|
|
2187
|
+
const encoding55 = {
|
|
1962
2188
|
preencode(state, m) {
|
|
1963
2189
|
c.buffer.preencode(state, m.seed)
|
|
1964
2190
|
state.end++ // max flag is 2 so always one byte
|
|
@@ -1989,14 +2215,14 @@ const encoding49 = {
|
|
|
1989
2215
|
}
|
|
1990
2216
|
|
|
1991
2217
|
// @local/mesh-departure/hyperdb#11
|
|
1992
|
-
const
|
|
2218
|
+
const encoding56 = {
|
|
1993
2219
|
preencode(state, m) {
|
|
1994
2220
|
const v = m.version ?? 1
|
|
1995
2221
|
c.uint.preencode(state, v)
|
|
1996
2222
|
switch (v) {
|
|
1997
2223
|
case 0:
|
|
1998
2224
|
case 1:
|
|
1999
|
-
|
|
2225
|
+
encoding55.preencode(state, m)
|
|
2000
2226
|
break
|
|
2001
2227
|
default:
|
|
2002
2228
|
throw new Error('Unsupported version')
|
|
@@ -2008,7 +2234,7 @@ const encoding50 = {
|
|
|
2008
2234
|
switch (v) {
|
|
2009
2235
|
case 0:
|
|
2010
2236
|
case 1:
|
|
2011
|
-
|
|
2237
|
+
encoding55.encode(state, m)
|
|
2012
2238
|
break
|
|
2013
2239
|
default:
|
|
2014
2240
|
throw new Error('Unsupported version')
|
|
@@ -2021,7 +2247,224 @@ const encoding50 = {
|
|
|
2021
2247
|
switch (v) {
|
|
2022
2248
|
case 0:
|
|
2023
2249
|
case 1: {
|
|
2024
|
-
const decoded =
|
|
2250
|
+
const decoded = encoding55.decode(state)
|
|
2251
|
+
return decoded
|
|
2252
|
+
}
|
|
2253
|
+
default:
|
|
2254
|
+
throw new Error('Unsupported version')
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2259
|
+
// @local/active-mesh-v1/hyperdb#12
|
|
2260
|
+
const encoding57 = {
|
|
2261
|
+
preencode(state, m) {
|
|
2262
|
+
state.end++ // max flag is 2 so always one byte
|
|
2263
|
+
|
|
2264
|
+
if (version >= 5 && m.activeMeshKey) c.fixed32.preencode(state, m.activeMeshKey)
|
|
2265
|
+
if (version >= 5 && m.homeMeshKey) c.fixed32.preencode(state, m.homeMeshKey)
|
|
2266
|
+
},
|
|
2267
|
+
encode(state, m) {
|
|
2268
|
+
const flags =
|
|
2269
|
+
((version >= 5 && m.activeMeshKey) ? 1 : 0) | ((version >= 5 && m.homeMeshKey) ? 2 : 0)
|
|
2270
|
+
|
|
2271
|
+
c.uint.encode(state, flags)
|
|
2272
|
+
|
|
2273
|
+
if (version >= 5 && m.activeMeshKey) c.fixed32.encode(state, m.activeMeshKey)
|
|
2274
|
+
if (version >= 5 && m.homeMeshKey) c.fixed32.encode(state, m.homeMeshKey)
|
|
2275
|
+
},
|
|
2276
|
+
decode(state) {
|
|
2277
|
+
const v = c.uint.decode(state)
|
|
2278
|
+
const flags = c.uint.decode(state)
|
|
2279
|
+
|
|
2280
|
+
return {
|
|
2281
|
+
version: v,
|
|
2282
|
+
deviceId: null,
|
|
2283
|
+
activeMeshKey: (version >= 5 && (flags & 1) !== 0) ? c.fixed32.decode(state) : null,
|
|
2284
|
+
homeMeshKey: (version >= 5 && (flags & 2) !== 0) ? c.fixed32.decode(state) : null
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
// @local/active-mesh/hyperdb#12
|
|
2290
|
+
const encoding58 = {
|
|
2291
|
+
preencode(state, m) {
|
|
2292
|
+
const v = m.version ?? 1
|
|
2293
|
+
c.uint.preencode(state, v)
|
|
2294
|
+
switch (v) {
|
|
2295
|
+
case 0:
|
|
2296
|
+
case 1:
|
|
2297
|
+
encoding57.preencode(state, m)
|
|
2298
|
+
break
|
|
2299
|
+
default:
|
|
2300
|
+
throw new Error('Unsupported version')
|
|
2301
|
+
}
|
|
2302
|
+
},
|
|
2303
|
+
encode(state, m) {
|
|
2304
|
+
const v = m.version ?? 1
|
|
2305
|
+
c.uint.encode(state, v)
|
|
2306
|
+
switch (v) {
|
|
2307
|
+
case 0:
|
|
2308
|
+
case 1:
|
|
2309
|
+
encoding57.encode(state, m)
|
|
2310
|
+
break
|
|
2311
|
+
default:
|
|
2312
|
+
throw new Error('Unsupported version')
|
|
2313
|
+
}
|
|
2314
|
+
},
|
|
2315
|
+
decode(state) {
|
|
2316
|
+
const start = state.start
|
|
2317
|
+
const v = c.uint.decode(state)
|
|
2318
|
+
state.start = start
|
|
2319
|
+
switch (v) {
|
|
2320
|
+
case 0:
|
|
2321
|
+
case 1: {
|
|
2322
|
+
const decoded = encoding57.decode(state)
|
|
2323
|
+
return decoded
|
|
2324
|
+
}
|
|
2325
|
+
default:
|
|
2326
|
+
throw new Error('Unsupported version')
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
// @local/mesh-membership-v1/hyperdb#13
|
|
2332
|
+
const encoding59 = {
|
|
2333
|
+
preencode(state, m) {
|
|
2334
|
+
c.fixed32.preencode(state, m.seed)
|
|
2335
|
+
state.end++ // max flag is 2 so always one byte
|
|
2336
|
+
|
|
2337
|
+
if (version >= 5 && m.writerSeed) c.string.preencode(state, m.writerSeed)
|
|
2338
|
+
if (version >= 5 && m.leftAt) c.uint.preencode(state, m.leftAt)
|
|
2339
|
+
},
|
|
2340
|
+
encode(state, m) {
|
|
2341
|
+
const flags = ((version >= 5 && m.writerSeed) ? 1 : 0) | ((version >= 5 && m.leftAt) ? 2 : 0)
|
|
2342
|
+
|
|
2343
|
+
c.fixed32.encode(state, m.seed)
|
|
2344
|
+
c.uint.encode(state, flags)
|
|
2345
|
+
|
|
2346
|
+
if (version >= 5 && m.writerSeed) c.string.encode(state, m.writerSeed)
|
|
2347
|
+
if (version >= 5 && m.leftAt) c.uint.encode(state, m.leftAt)
|
|
2348
|
+
},
|
|
2349
|
+
decode(state) {
|
|
2350
|
+
const v = c.uint.decode(state)
|
|
2351
|
+
const r1 = c.fixed32.decode(state)
|
|
2352
|
+
const flags = c.uint.decode(state)
|
|
2353
|
+
|
|
2354
|
+
return {
|
|
2355
|
+
version: v,
|
|
2356
|
+
key: null,
|
|
2357
|
+
seed: r1,
|
|
2358
|
+
writerSeed: (version >= 5 && (flags & 1) !== 0) ? c.string.decode(state) : null,
|
|
2359
|
+
leftAt: (version >= 5 && (flags & 2) !== 0) ? c.uint.decode(state) : 0
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
// @local/mesh-membership/hyperdb#13
|
|
2365
|
+
const encoding60 = {
|
|
2366
|
+
preencode(state, m) {
|
|
2367
|
+
const v = m.version ?? 1
|
|
2368
|
+
c.uint.preencode(state, v)
|
|
2369
|
+
switch (v) {
|
|
2370
|
+
case 0:
|
|
2371
|
+
case 1:
|
|
2372
|
+
encoding59.preencode(state, m)
|
|
2373
|
+
break
|
|
2374
|
+
default:
|
|
2375
|
+
throw new Error('Unsupported version')
|
|
2376
|
+
}
|
|
2377
|
+
},
|
|
2378
|
+
encode(state, m) {
|
|
2379
|
+
const v = m.version ?? 1
|
|
2380
|
+
c.uint.encode(state, v)
|
|
2381
|
+
switch (v) {
|
|
2382
|
+
case 0:
|
|
2383
|
+
case 1:
|
|
2384
|
+
encoding59.encode(state, m)
|
|
2385
|
+
break
|
|
2386
|
+
default:
|
|
2387
|
+
throw new Error('Unsupported version')
|
|
2388
|
+
}
|
|
2389
|
+
},
|
|
2390
|
+
decode(state) {
|
|
2391
|
+
const start = state.start
|
|
2392
|
+
const v = c.uint.decode(state)
|
|
2393
|
+
state.start = start
|
|
2394
|
+
switch (v) {
|
|
2395
|
+
case 0:
|
|
2396
|
+
case 1: {
|
|
2397
|
+
const decoded = encoding59.decode(state)
|
|
2398
|
+
return decoded
|
|
2399
|
+
}
|
|
2400
|
+
default:
|
|
2401
|
+
throw new Error('Unsupported version')
|
|
2402
|
+
}
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
// @local/member-proof-v1/hyperdb#14
|
|
2407
|
+
const encoding61 = {
|
|
2408
|
+
preencode(state, m) {
|
|
2409
|
+
c.fixed32.preencode(state, m.memberId)
|
|
2410
|
+
c.buffer.preencode(state, m.proof)
|
|
2411
|
+
c.uint.preencode(state, m.attestedAt)
|
|
2412
|
+
},
|
|
2413
|
+
encode(state, m) {
|
|
2414
|
+
c.fixed32.encode(state, m.memberId)
|
|
2415
|
+
c.buffer.encode(state, m.proof)
|
|
2416
|
+
c.uint.encode(state, m.attestedAt)
|
|
2417
|
+
},
|
|
2418
|
+
decode(state) {
|
|
2419
|
+
const v = c.uint.decode(state)
|
|
2420
|
+
const r1 = c.fixed32.decode(state)
|
|
2421
|
+
const r2 = c.buffer.decode(state)
|
|
2422
|
+
const r3 = c.uint.decode(state)
|
|
2423
|
+
|
|
2424
|
+
return {
|
|
2425
|
+
version: v,
|
|
2426
|
+
meshKey: null,
|
|
2427
|
+
memberId: r1,
|
|
2428
|
+
proof: r2,
|
|
2429
|
+
attestedAt: r3
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
|
|
2434
|
+
// @local/member-proof/hyperdb#14
|
|
2435
|
+
const encoding62 = {
|
|
2436
|
+
preencode(state, m) {
|
|
2437
|
+
const v = m.version ?? 1
|
|
2438
|
+
c.uint.preencode(state, v)
|
|
2439
|
+
switch (v) {
|
|
2440
|
+
case 0:
|
|
2441
|
+
case 1:
|
|
2442
|
+
encoding61.preencode(state, m)
|
|
2443
|
+
break
|
|
2444
|
+
default:
|
|
2445
|
+
throw new Error('Unsupported version')
|
|
2446
|
+
}
|
|
2447
|
+
},
|
|
2448
|
+
encode(state, m) {
|
|
2449
|
+
const v = m.version ?? 1
|
|
2450
|
+
c.uint.encode(state, v)
|
|
2451
|
+
switch (v) {
|
|
2452
|
+
case 0:
|
|
2453
|
+
case 1:
|
|
2454
|
+
encoding61.encode(state, m)
|
|
2455
|
+
break
|
|
2456
|
+
default:
|
|
2457
|
+
throw new Error('Unsupported version')
|
|
2458
|
+
}
|
|
2459
|
+
},
|
|
2460
|
+
decode(state) {
|
|
2461
|
+
const start = state.start
|
|
2462
|
+
const v = c.uint.decode(state)
|
|
2463
|
+
state.start = start
|
|
2464
|
+
switch (v) {
|
|
2465
|
+
case 0:
|
|
2466
|
+
case 1: {
|
|
2467
|
+
const decoded = encoding61.decode(state)
|
|
2025
2468
|
return decoded
|
|
2026
2469
|
}
|
|
2027
2470
|
default:
|
|
@@ -2113,54 +2556,78 @@ function getEncoding(name) {
|
|
|
2113
2556
|
return encoding25
|
|
2114
2557
|
case '@local/mesh-departure':
|
|
2115
2558
|
return encoding26
|
|
2116
|
-
case '@local/
|
|
2559
|
+
case '@local/active-mesh-v1':
|
|
2117
2560
|
return encoding27
|
|
2118
|
-
case '@local/
|
|
2561
|
+
case '@local/active-mesh':
|
|
2119
2562
|
return encoding28
|
|
2120
|
-
case '@local/mesh-
|
|
2563
|
+
case '@local/mesh-membership-v1':
|
|
2121
2564
|
return encoding29
|
|
2122
|
-
case '@local/mesh-
|
|
2565
|
+
case '@local/mesh-membership':
|
|
2123
2566
|
return encoding30
|
|
2124
|
-
case '@local/
|
|
2567
|
+
case '@local/member-proof-v1':
|
|
2125
2568
|
return encoding31
|
|
2126
|
-
case '@local/
|
|
2569
|
+
case '@local/member-proof':
|
|
2127
2570
|
return encoding32
|
|
2128
|
-
case '@local/
|
|
2571
|
+
case '@local/config-v1/hyperdb#0':
|
|
2129
2572
|
return encoding33
|
|
2130
|
-
case '@local/
|
|
2573
|
+
case '@local/config/hyperdb#0':
|
|
2131
2574
|
return encoding34
|
|
2132
|
-
case '@local/
|
|
2575
|
+
case '@local/mesh-session-v1/hyperdb#1':
|
|
2133
2576
|
return encoding35
|
|
2134
|
-
case '@local/
|
|
2577
|
+
case '@local/mesh-session/hyperdb#1':
|
|
2135
2578
|
return encoding36
|
|
2136
|
-
case '@local/
|
|
2579
|
+
case '@local/mesh-history-v1/hyperdb#2':
|
|
2137
2580
|
return encoding37
|
|
2138
|
-
case '@local/
|
|
2581
|
+
case '@local/mesh-history/hyperdb#2':
|
|
2139
2582
|
return encoding38
|
|
2140
|
-
case '@local/
|
|
2583
|
+
case '@local/device-v1/hyperdb#3':
|
|
2141
2584
|
return encoding39
|
|
2142
|
-
case '@local/
|
|
2585
|
+
case '@local/device/hyperdb#3':
|
|
2143
2586
|
return encoding40
|
|
2144
|
-
case '@local/
|
|
2587
|
+
case '@local/app-config-v1/hyperdb#4':
|
|
2145
2588
|
return encoding41
|
|
2146
|
-
case '@local/
|
|
2589
|
+
case '@local/app-config/hyperdb#4':
|
|
2147
2590
|
return encoding42
|
|
2148
|
-
case '@local/
|
|
2591
|
+
case '@local/model-download-v1/hyperdb#5':
|
|
2149
2592
|
return encoding43
|
|
2150
|
-
case '@local/
|
|
2593
|
+
case '@local/model-download/hyperdb#5':
|
|
2151
2594
|
return encoding44
|
|
2152
|
-
case '@local/
|
|
2595
|
+
case '@local/custom-model-v1/hyperdb#6':
|
|
2153
2596
|
return encoding45
|
|
2154
|
-
case '@local/
|
|
2597
|
+
case '@local/custom-model/hyperdb#6':
|
|
2155
2598
|
return encoding46
|
|
2156
|
-
case '@local/
|
|
2599
|
+
case '@local/identity-v1/hyperdb#7':
|
|
2157
2600
|
return encoding47
|
|
2158
|
-
case '@local/
|
|
2601
|
+
case '@local/identity/hyperdb#7':
|
|
2159
2602
|
return encoding48
|
|
2160
|
-
case '@local/
|
|
2603
|
+
case '@local/membership-v1/hyperdb#8':
|
|
2161
2604
|
return encoding49
|
|
2162
|
-
case '@local/
|
|
2605
|
+
case '@local/membership/hyperdb#8':
|
|
2163
2606
|
return encoding50
|
|
2607
|
+
case '@local/chat-notify-v1/hyperdb#9':
|
|
2608
|
+
return encoding51
|
|
2609
|
+
case '@local/chat-notify/hyperdb#9':
|
|
2610
|
+
return encoding52
|
|
2611
|
+
case '@local/model-notify-v1/hyperdb#10':
|
|
2612
|
+
return encoding53
|
|
2613
|
+
case '@local/model-notify/hyperdb#10':
|
|
2614
|
+
return encoding54
|
|
2615
|
+
case '@local/mesh-departure-v1/hyperdb#11':
|
|
2616
|
+
return encoding55
|
|
2617
|
+
case '@local/mesh-departure/hyperdb#11':
|
|
2618
|
+
return encoding56
|
|
2619
|
+
case '@local/active-mesh-v1/hyperdb#12':
|
|
2620
|
+
return encoding57
|
|
2621
|
+
case '@local/active-mesh/hyperdb#12':
|
|
2622
|
+
return encoding58
|
|
2623
|
+
case '@local/mesh-membership-v1/hyperdb#13':
|
|
2624
|
+
return encoding59
|
|
2625
|
+
case '@local/mesh-membership/hyperdb#13':
|
|
2626
|
+
return encoding60
|
|
2627
|
+
case '@local/member-proof-v1/hyperdb#14':
|
|
2628
|
+
return encoding61
|
|
2629
|
+
case '@local/member-proof/hyperdb#14':
|
|
2630
|
+
return encoding62
|
|
2164
2631
|
default:
|
|
2165
2632
|
throw new Error('Encoder not found ' + name)
|
|
2166
2633
|
}
|