@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
|
@@ -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
|
// '@local/config' collection key
|
|
10
10
|
const collection0_key = new IndexEncoder([
|
|
@@ -810,6 +810,207 @@ const collection11 = {
|
|
|
810
810
|
decodedVersion: 0
|
|
811
811
|
}
|
|
812
812
|
|
|
813
|
+
// '@local/active-mesh' collection key
|
|
814
|
+
const collection12_key = new IndexEncoder([
|
|
815
|
+
IndexEncoder.BUFFER
|
|
816
|
+
], { prefix: 12 })
|
|
817
|
+
|
|
818
|
+
function collection12_indexify (record) {
|
|
819
|
+
const a = record.deviceId
|
|
820
|
+
return a === undefined ? [] : [a]
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// '@local/active-mesh' value encoding
|
|
824
|
+
const collection12_enc = getEncoding('@local/active-mesh/hyperdb#12')
|
|
825
|
+
|
|
826
|
+
// '@local/active-mesh' reconstruction function
|
|
827
|
+
function collection12_reconstruct (schemaVersion, keyBuf, valueBuf) {
|
|
828
|
+
const key = collection12_key.decode(keyBuf)
|
|
829
|
+
setVersion(schemaVersion)
|
|
830
|
+
const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
|
|
831
|
+
const type = c.uint.decode(state)
|
|
832
|
+
if (type !== 0) throw new Error('Unknown collection type: ' + type)
|
|
833
|
+
collection12.decodedVersion = c.uint.decode(state)
|
|
834
|
+
const record = collection12_enc.decode(state)
|
|
835
|
+
record.deviceId = key[0]
|
|
836
|
+
return record
|
|
837
|
+
}
|
|
838
|
+
// '@local/active-mesh' key reconstruction function
|
|
839
|
+
function collection12_reconstruct_key (keyBuf) {
|
|
840
|
+
const key = collection12_key.decode(keyBuf)
|
|
841
|
+
return {
|
|
842
|
+
deviceId: key[0]
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
// '@local/active-mesh'
|
|
847
|
+
const collection12 = {
|
|
848
|
+
name: '@local/active-mesh',
|
|
849
|
+
id: 12,
|
|
850
|
+
version: 5,
|
|
851
|
+
encodeKey (record) {
|
|
852
|
+
const key = [record.deviceId]
|
|
853
|
+
return collection12_key.encode(key)
|
|
854
|
+
},
|
|
855
|
+
encodeKeyRange ({ gt, lt, gte, lte } = {}) {
|
|
856
|
+
return collection12_key.encodeRange({
|
|
857
|
+
gt: gt ? collection12_indexify(gt) : null,
|
|
858
|
+
lt: lt ? collection12_indexify(lt) : null,
|
|
859
|
+
gte: gte ? collection12_indexify(gte) : null,
|
|
860
|
+
lte: lte ? collection12_indexify(lte) : null
|
|
861
|
+
})
|
|
862
|
+
},
|
|
863
|
+
encodeValue (schemaVersion, collectionVersion, record) {
|
|
864
|
+
setVersion(schemaVersion)
|
|
865
|
+
const state = { start: 0, end: 2, buffer: null }
|
|
866
|
+
collection12_enc.preencode(state, record)
|
|
867
|
+
state.buffer = b4a.allocUnsafe(state.end)
|
|
868
|
+
state.buffer[state.start++] = 0
|
|
869
|
+
state.buffer[state.start++] = collectionVersion
|
|
870
|
+
collection12_enc.encode(state, record)
|
|
871
|
+
return state.buffer
|
|
872
|
+
},
|
|
873
|
+
trigger: null,
|
|
874
|
+
reconstruct: collection12_reconstruct,
|
|
875
|
+
reconstructKey: collection12_reconstruct_key,
|
|
876
|
+
indexes: [],
|
|
877
|
+
decodedVersion: 0
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// '@local/mesh-membership' collection key
|
|
881
|
+
const collection13_key = new IndexEncoder([
|
|
882
|
+
IndexEncoder.BUFFER
|
|
883
|
+
], { prefix: 13 })
|
|
884
|
+
|
|
885
|
+
function collection13_indexify (record) {
|
|
886
|
+
const a = record.key
|
|
887
|
+
return a === undefined ? [] : [a]
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
// '@local/mesh-membership' value encoding
|
|
891
|
+
const collection13_enc = getEncoding('@local/mesh-membership/hyperdb#13')
|
|
892
|
+
|
|
893
|
+
// '@local/mesh-membership' reconstruction function
|
|
894
|
+
function collection13_reconstruct (schemaVersion, keyBuf, valueBuf) {
|
|
895
|
+
const key = collection13_key.decode(keyBuf)
|
|
896
|
+
setVersion(schemaVersion)
|
|
897
|
+
const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
|
|
898
|
+
const type = c.uint.decode(state)
|
|
899
|
+
if (type !== 0) throw new Error('Unknown collection type: ' + type)
|
|
900
|
+
collection13.decodedVersion = c.uint.decode(state)
|
|
901
|
+
const record = collection13_enc.decode(state)
|
|
902
|
+
record.key = key[0]
|
|
903
|
+
return record
|
|
904
|
+
}
|
|
905
|
+
// '@local/mesh-membership' key reconstruction function
|
|
906
|
+
function collection13_reconstruct_key (keyBuf) {
|
|
907
|
+
const key = collection13_key.decode(keyBuf)
|
|
908
|
+
return {
|
|
909
|
+
key: key[0]
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
// '@local/mesh-membership'
|
|
914
|
+
const collection13 = {
|
|
915
|
+
name: '@local/mesh-membership',
|
|
916
|
+
id: 13,
|
|
917
|
+
version: 5,
|
|
918
|
+
encodeKey (record) {
|
|
919
|
+
const key = [record.key]
|
|
920
|
+
return collection13_key.encode(key)
|
|
921
|
+
},
|
|
922
|
+
encodeKeyRange ({ gt, lt, gte, lte } = {}) {
|
|
923
|
+
return collection13_key.encodeRange({
|
|
924
|
+
gt: gt ? collection13_indexify(gt) : null,
|
|
925
|
+
lt: lt ? collection13_indexify(lt) : null,
|
|
926
|
+
gte: gte ? collection13_indexify(gte) : null,
|
|
927
|
+
lte: lte ? collection13_indexify(lte) : null
|
|
928
|
+
})
|
|
929
|
+
},
|
|
930
|
+
encodeValue (schemaVersion, collectionVersion, record) {
|
|
931
|
+
setVersion(schemaVersion)
|
|
932
|
+
const state = { start: 0, end: 2, buffer: null }
|
|
933
|
+
collection13_enc.preencode(state, record)
|
|
934
|
+
state.buffer = b4a.allocUnsafe(state.end)
|
|
935
|
+
state.buffer[state.start++] = 0
|
|
936
|
+
state.buffer[state.start++] = collectionVersion
|
|
937
|
+
collection13_enc.encode(state, record)
|
|
938
|
+
return state.buffer
|
|
939
|
+
},
|
|
940
|
+
trigger: null,
|
|
941
|
+
reconstruct: collection13_reconstruct,
|
|
942
|
+
reconstructKey: collection13_reconstruct_key,
|
|
943
|
+
indexes: [],
|
|
944
|
+
decodedVersion: 0
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// '@local/member-proof' collection key
|
|
948
|
+
const collection14_key = new IndexEncoder([
|
|
949
|
+
IndexEncoder.BUFFER
|
|
950
|
+
], { prefix: 14 })
|
|
951
|
+
|
|
952
|
+
function collection14_indexify (record) {
|
|
953
|
+
const a = record.meshKey
|
|
954
|
+
return a === undefined ? [] : [a]
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
// '@local/member-proof' value encoding
|
|
958
|
+
const collection14_enc = getEncoding('@local/member-proof/hyperdb#14')
|
|
959
|
+
|
|
960
|
+
// '@local/member-proof' reconstruction function
|
|
961
|
+
function collection14_reconstruct (schemaVersion, keyBuf, valueBuf) {
|
|
962
|
+
const key = collection14_key.decode(keyBuf)
|
|
963
|
+
setVersion(schemaVersion)
|
|
964
|
+
const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
|
|
965
|
+
const type = c.uint.decode(state)
|
|
966
|
+
if (type !== 0) throw new Error('Unknown collection type: ' + type)
|
|
967
|
+
collection14.decodedVersion = c.uint.decode(state)
|
|
968
|
+
const record = collection14_enc.decode(state)
|
|
969
|
+
record.meshKey = key[0]
|
|
970
|
+
return record
|
|
971
|
+
}
|
|
972
|
+
// '@local/member-proof' key reconstruction function
|
|
973
|
+
function collection14_reconstruct_key (keyBuf) {
|
|
974
|
+
const key = collection14_key.decode(keyBuf)
|
|
975
|
+
return {
|
|
976
|
+
meshKey: key[0]
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
// '@local/member-proof'
|
|
981
|
+
const collection14 = {
|
|
982
|
+
name: '@local/member-proof',
|
|
983
|
+
id: 14,
|
|
984
|
+
version: 5,
|
|
985
|
+
encodeKey (record) {
|
|
986
|
+
const key = [record.meshKey]
|
|
987
|
+
return collection14_key.encode(key)
|
|
988
|
+
},
|
|
989
|
+
encodeKeyRange ({ gt, lt, gte, lte } = {}) {
|
|
990
|
+
return collection14_key.encodeRange({
|
|
991
|
+
gt: gt ? collection14_indexify(gt) : null,
|
|
992
|
+
lt: lt ? collection14_indexify(lt) : null,
|
|
993
|
+
gte: gte ? collection14_indexify(gte) : null,
|
|
994
|
+
lte: lte ? collection14_indexify(lte) : null
|
|
995
|
+
})
|
|
996
|
+
},
|
|
997
|
+
encodeValue (schemaVersion, collectionVersion, record) {
|
|
998
|
+
setVersion(schemaVersion)
|
|
999
|
+
const state = { start: 0, end: 2, buffer: null }
|
|
1000
|
+
collection14_enc.preencode(state, record)
|
|
1001
|
+
state.buffer = b4a.allocUnsafe(state.end)
|
|
1002
|
+
state.buffer[state.start++] = 0
|
|
1003
|
+
state.buffer[state.start++] = collectionVersion
|
|
1004
|
+
collection14_enc.encode(state, record)
|
|
1005
|
+
return state.buffer
|
|
1006
|
+
},
|
|
1007
|
+
trigger: null,
|
|
1008
|
+
reconstruct: collection14_reconstruct,
|
|
1009
|
+
reconstructKey: collection14_reconstruct_key,
|
|
1010
|
+
indexes: [],
|
|
1011
|
+
decodedVersion: 0
|
|
1012
|
+
}
|
|
1013
|
+
|
|
813
1014
|
const collections = [
|
|
814
1015
|
collection0,
|
|
815
1016
|
collection1,
|
|
@@ -822,7 +1023,10 @@ const collections = [
|
|
|
822
1023
|
collection8,
|
|
823
1024
|
collection9,
|
|
824
1025
|
collection10,
|
|
825
|
-
collection11
|
|
1026
|
+
collection11,
|
|
1027
|
+
collection12,
|
|
1028
|
+
collection13,
|
|
1029
|
+
collection14
|
|
826
1030
|
]
|
|
827
1031
|
|
|
828
1032
|
const indexes = [
|
|
@@ -844,6 +1048,9 @@ function resolveCollection (name) {
|
|
|
844
1048
|
case '@local/chat-notify': return collection9
|
|
845
1049
|
case '@local/model-notify': return collection10
|
|
846
1050
|
case '@local/mesh-departure': return collection11
|
|
1051
|
+
case '@local/active-mesh': return collection12
|
|
1052
|
+
case '@local/mesh-membership': return collection13
|
|
1053
|
+
case '@local/member-proof': return collection14
|
|
847
1054
|
default: return null
|
|
848
1055
|
}
|
|
849
1056
|
}
|