@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
@@ -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: 10 }
7
+ const versions = { schema: version, db: 11 }
8
8
 
9
9
  import * as helpers0 from '../../../schema/indexes.js'
10
10
 
@@ -3072,6 +3072,85 @@ const collection50 = {
3072
3072
  decodedVersion: 0
3073
3073
  }
3074
3074
 
3075
+ // '@qvac/chat-chunks' collection key
3076
+ const collection51_key = new IndexEncoder([
3077
+ IndexEncoder.STRING,
3078
+ IndexEncoder.UINT
3079
+ ], { prefix: 51 })
3080
+
3081
+ function collection51_indexify (record) {
3082
+ const arr = []
3083
+
3084
+ const a0 = record.chatId
3085
+ if (a0 === undefined) return arr
3086
+ arr.push(a0)
3087
+
3088
+ const a1 = record.seq
3089
+ if (a1 === undefined) return arr
3090
+ arr.push(a1)
3091
+
3092
+ return arr
3093
+ }
3094
+
3095
+ // '@qvac/chat-chunks' value encoding
3096
+ const collection51_enc = getEncoding('@qvac/chunk/hyperdb#51')
3097
+
3098
+ // '@qvac/chat-chunks' reconstruction function
3099
+ function collection51_reconstruct (schemaVersion, keyBuf, valueBuf) {
3100
+ const key = collection51_key.decode(keyBuf)
3101
+ setVersion(schemaVersion)
3102
+ const state = { start: 0, end: valueBuf.byteLength, buffer: valueBuf }
3103
+ const type = c.uint.decode(state)
3104
+ if (type !== 0) throw new Error('Unknown collection type: ' + type)
3105
+ collection51.decodedVersion = c.uint.decode(state)
3106
+ const record = collection51_enc.decode(state)
3107
+ record.chatId = key[0]
3108
+ record.seq = key[1]
3109
+ return record
3110
+ }
3111
+ // '@qvac/chat-chunks' key reconstruction function
3112
+ function collection51_reconstruct_key (keyBuf) {
3113
+ const key = collection51_key.decode(keyBuf)
3114
+ return {
3115
+ chatId: key[0],
3116
+ seq: key[1]
3117
+ }
3118
+ }
3119
+
3120
+ // '@qvac/chat-chunks'
3121
+ const collection51 = {
3122
+ name: '@qvac/chat-chunks',
3123
+ id: 51,
3124
+ version: 11,
3125
+ encodeKey (record) {
3126
+ const key = [record.chatId, record.seq]
3127
+ return collection51_key.encode(key)
3128
+ },
3129
+ encodeKeyRange ({ gt, lt, gte, lte } = {}) {
3130
+ return collection51_key.encodeRange({
3131
+ gt: gt ? collection51_indexify(gt) : null,
3132
+ lt: lt ? collection51_indexify(lt) : null,
3133
+ gte: gte ? collection51_indexify(gte) : null,
3134
+ lte: lte ? collection51_indexify(lte) : null
3135
+ })
3136
+ },
3137
+ encodeValue (schemaVersion, collectionVersion, record) {
3138
+ setVersion(schemaVersion)
3139
+ const state = { start: 0, end: 2, buffer: null }
3140
+ collection51_enc.preencode(state, record)
3141
+ state.buffer = b4a.allocUnsafe(state.end)
3142
+ state.buffer[state.start++] = 0
3143
+ state.buffer[state.start++] = collectionVersion
3144
+ collection51_enc.encode(state, record)
3145
+ return state.buffer
3146
+ },
3147
+ trigger: null,
3148
+ reconstruct: collection51_reconstruct,
3149
+ reconstructKey: collection51_reconstruct_key,
3150
+ indexes: [],
3151
+ decodedVersion: 0
3152
+ }
3153
+
3075
3154
  const collections = [
3076
3155
  collection0,
3077
3156
  collection1,
@@ -3100,7 +3179,8 @@ const collections = [
3100
3179
  collection47,
3101
3180
  collection48,
3102
3181
  collection49,
3103
- collection50
3182
+ collection50,
3183
+ collection51
3104
3184
  ]
3105
3185
 
3106
3186
  const indexes = [
@@ -3161,6 +3241,7 @@ function resolveCollection (name) {
3161
3241
  case '@qvac/purged-chats': return collection48
3162
3242
  case '@qvac/mesh-names': return collection49
3163
3243
  case '@qvac/mesh-seeds': return collection50
3244
+ case '@qvac/chat-chunks': return collection51
3164
3245
  default: return null
3165
3246
  }
3166
3247
  }