@qvac/core 0.1.6 → 0.1.8

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 (34) hide show
  1. package/README.md +10 -5
  2. package/dist-lib/lib/api/chat-groups.d.ts +1 -1
  3. package/dist-lib/lib/api/chat-groups.js +6 -3
  4. package/dist-lib/lib/core/chat-group.d.ts +5 -0
  5. package/dist-lib/lib/core/chat-group.js +63 -1
  6. package/dist-lib/lib/core/chat.d.ts +10 -0
  7. package/dist-lib/lib/core/chat.js +75 -9
  8. package/dist-lib/lib/core/mesh.js +2 -1
  9. package/dist-lib/lib/core/rank.d.ts +14 -0
  10. package/dist-lib/lib/core/rank.js +23 -0
  11. package/dist-lib/schema/content.js +5 -1
  12. package/dist-lib/schema/engine.js +30 -0
  13. package/dist-lib/schema/field-order.js +3 -1
  14. package/dist-lib/schema/qvac.js +5 -2
  15. package/dist-lib/spec/bind.js +9 -0
  16. package/dist-lib/spec/calls.js +31 -28
  17. package/dist-lib/spec/capabilities.d.ts +6 -0
  18. package/dist-lib/spec/hrpc/hrpc.json +39 -0
  19. package/dist-lib/spec/hrpc/index.js +39 -3
  20. package/dist-lib/spec/hrpc/messages.js +85 -46
  21. package/dist-lib/spec/hyperschema/index.js +85 -46
  22. package/dist-lib/spec/hyperschema/schema.json +56 -1
  23. package/dist-lib/spec/hyperschema/types.d.ts +14 -1
  24. package/dist-lib/spec/local/hyperdb/messages.js +48 -96
  25. package/dist-lib/spec/local/hyperschema/index.js +24 -48
  26. package/dist-lib/spec/local/hyperschema/schema.json +12 -0
  27. package/dist-lib/spec/mesh/hyperdb/messages.js +177 -296
  28. package/dist-lib/spec/mesh/hyperdispatch/messages.js +126 -222
  29. package/dist-lib/spec/mesh/hyperschema/index.js +126 -222
  30. package/dist-lib/spec/mesh/hyperschema/schema.json +71 -1
  31. package/dist-lib/spec/mesh/hyperschema/types.d.ts +4 -1
  32. package/package.json +12 -11
  33. package/tui/app.mjs +95 -23
  34. package/tui/lib/sidebar.mjs +3 -2
@@ -235,7 +235,13 @@ const methods = new Map([
235
235
  ['@assistant/file-preview', 113],
236
236
  [113, '@assistant/file-preview'],
237
237
  ['@assistant/file-retry', 114],
238
- [114, '@assistant/file-retry']
238
+ [114, '@assistant/file-retry'],
239
+ ['@assistant/move-chat', 115],
240
+ [115, '@assistant/move-chat'],
241
+ ['@assistant/move-chat-group', 116],
242
+ [116, '@assistant/move-chat-group'],
243
+ ['@assistant/sort-chat-groups-by-name', 117],
244
+ [117, '@assistant/sort-chat-groups-by-name']
239
245
  ])
240
246
 
241
247
  class HRPC {
@@ -357,7 +363,10 @@ class HRPC {
357
363
  ['@assistant/delete-chat-kv-cache', getEncoding('@assistant/chat-id')],
358
364
  ['@assistant/file-read', getEncoding('@assistant/file-read-request')],
359
365
  ['@assistant/file-preview', getEncoding('@assistant/file-request')],
360
- ['@assistant/file-retry', getEncoding('@assistant/file-retry-request')]
366
+ ['@assistant/file-retry', getEncoding('@assistant/file-retry-request')],
367
+ ['@assistant/move-chat', getEncoding('@assistant/move-chat-request')],
368
+ ['@assistant/move-chat-group', getEncoding('@assistant/move-chat-group-request')],
369
+ ['@assistant/sort-chat-groups-by-name', getEncoding('@assistant/empty')]
361
370
  ])
362
371
  this._responseEncodings = new Map([
363
372
  ['@assistant/config-get', getEncoding('@assistant/config-value')],
@@ -474,7 +483,10 @@ class HRPC {
474
483
  ['@assistant/delete-chat-kv-cache', getEncoding('@assistant/kv-cache-deletion-response')],
475
484
  ['@assistant/file-read', getEncoding('@assistant/file-read-frame')],
476
485
  ['@assistant/file-preview', getEncoding('@assistant/file-preview-response')],
477
- ['@assistant/file-retry', getEncoding('@assistant/ok-response')]
486
+ ['@assistant/file-retry', getEncoding('@assistant/ok-response')],
487
+ ['@assistant/move-chat', getEncoding('@assistant/chat')],
488
+ ['@assistant/move-chat-group', getEncoding('@assistant/chat-group')],
489
+ ['@assistant/sort-chat-groups-by-name', getEncoding('@assistant/chat-group-list')]
478
490
  ])
479
491
  this._rpc = new RPC(stream, async (req) => {
480
492
  const command = methods.get(req.command)
@@ -1032,6 +1044,18 @@ class HRPC {
1032
1044
  return this._call('@assistant/file-retry', args)
1033
1045
  }
1034
1046
 
1047
+ async moveChat(args) {
1048
+ return this._call('@assistant/move-chat', args)
1049
+ }
1050
+
1051
+ async moveChatGroup(args) {
1052
+ return this._call('@assistant/move-chat-group', args)
1053
+ }
1054
+
1055
+ async sortChatGroupsByName(args) {
1056
+ return this._call('@assistant/sort-chat-groups-by-name', args)
1057
+ }
1058
+
1035
1059
  onConfigGet(responseFn) {
1036
1060
  this._handlers['@assistant/config-get'] = responseFn
1037
1061
  }
@@ -1492,6 +1516,18 @@ class HRPC {
1492
1516
  this._handlers['@assistant/file-retry'] = responseFn
1493
1517
  }
1494
1518
 
1519
+ onMoveChat(responseFn) {
1520
+ this._handlers['@assistant/move-chat'] = responseFn
1521
+ }
1522
+
1523
+ onMoveChatGroup(responseFn) {
1524
+ this._handlers['@assistant/move-chat-group'] = responseFn
1525
+ }
1526
+
1527
+ onSortChatGroupsByName(responseFn) {
1528
+ this._handlers['@assistant/sort-chat-groups-by-name'] = responseFn
1529
+ }
1530
+
1495
1531
  _requestIsStream(command) {
1496
1532
  return [
1497
1533
  '@assistant/upload-attachment',
@@ -1,12 +1,12 @@
1
1
  // This file is autogenerated by the hyperschema compiler
2
- // Schema Version: 5
2
+ // Schema Version: 6
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 = 5
9
+ const VERSION = 6
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
12
12
  let version = VERSION
@@ -1570,12 +1570,11 @@ const encoding35 = {
1570
1570
  if (m.progress) encoding35_5.encode(state, m.progress)
1571
1571
  },
1572
1572
  decode(state) {
1573
- const v = c.uint.decode(state)
1574
1573
  const r0 = encoding30.decode(state)
1575
1574
  const flags = c.uint.decode(state)
1576
1575
 
1577
1576
  return {
1578
- version: v,
1577
+ version: 0,
1579
1578
  state: r0,
1580
1579
  model: (flags & 1) !== 0 ? c.string.decode(state) : null,
1581
1580
  percentage: (flags & 2) !== 0 ? c.uint.decode(state) : 0,
@@ -1613,13 +1612,12 @@ const encoding36 = {
1613
1612
  }
1614
1613
  },
1615
1614
  decode(state) {
1616
- const start = state.start
1617
1615
  const v = c.uint.decode(state)
1618
- state.start = start
1619
1616
  switch (v) {
1620
1617
  case 0:
1621
1618
  case 1: {
1622
1619
  const decoded = encoding35.decode(state)
1620
+ decoded.version = v
1623
1621
  return decoded
1624
1622
  }
1625
1623
  default:
@@ -1654,14 +1652,13 @@ const encoding37 = {
1654
1652
  if (m.agentId) c.string.encode(state, m.agentId)
1655
1653
  },
1656
1654
  decode(state) {
1657
- const v = c.uint.decode(state)
1658
1655
  const r0 = encoding31.decode(state)
1659
1656
  const r1 = c.string.decode(state)
1660
1657
  const r2 = c.json.decode(state)
1661
1658
  const flags = c.uint.decode(state)
1662
1659
 
1663
1660
  return {
1664
- version: v,
1661
+ version: 0,
1665
1662
  status: r0,
1666
1663
  name: r1,
1667
1664
  arguments: r2,
@@ -1698,13 +1695,12 @@ const encoding38 = {
1698
1695
  }
1699
1696
  },
1700
1697
  decode(state) {
1701
- const start = state.start
1702
1698
  const v = c.uint.decode(state)
1703
- state.start = start
1704
1699
  switch (v) {
1705
1700
  case 0:
1706
1701
  case 1: {
1707
1702
  const decoded = encoding37.decode(state)
1703
+ decoded.version = v
1708
1704
  return decoded
1709
1705
  }
1710
1706
  default:
@@ -1722,11 +1718,10 @@ const encoding39 = {
1722
1718
  c.string.encode(state, m.text)
1723
1719
  },
1724
1720
  decode(state) {
1725
- const v = c.uint.decode(state)
1726
1721
  const r0 = c.string.decode(state)
1727
1722
 
1728
1723
  return {
1729
- version: v,
1724
+ version: 0,
1730
1725
  text: r0
1731
1726
  }
1732
1727
  }
@@ -1759,13 +1754,12 @@ const encoding40 = {
1759
1754
  }
1760
1755
  },
1761
1756
  decode(state) {
1762
- const start = state.start
1763
1757
  const v = c.uint.decode(state)
1764
- state.start = start
1765
1758
  switch (v) {
1766
1759
  case 0:
1767
1760
  case 1: {
1768
1761
  const decoded = encoding39.decode(state)
1762
+ decoded.version = v
1769
1763
  return decoded
1770
1764
  }
1771
1765
  default:
@@ -1804,13 +1798,12 @@ const encoding42 = {
1804
1798
  }
1805
1799
  },
1806
1800
  decode(state) {
1807
- const start = state.start
1808
1801
  const v = c.uint.decode(state)
1809
- state.start = start
1810
1802
  switch (v) {
1811
1803
  case 0:
1812
1804
  case 1: {
1813
1805
  const decoded = encoding41.decode(state)
1806
+ decoded.version = v
1814
1807
  return decoded
1815
1808
  }
1816
1809
  default:
@@ -1849,13 +1842,12 @@ const encoding44 = {
1849
1842
  }
1850
1843
  },
1851
1844
  decode(state) {
1852
- const start = state.start
1853
1845
  const v = c.uint.decode(state)
1854
- state.start = start
1855
1846
  switch (v) {
1856
1847
  case 0:
1857
1848
  case 1: {
1858
1849
  const decoded = encoding43.decode(state)
1850
+ decoded.version = v
1859
1851
  return decoded
1860
1852
  }
1861
1853
  default:
@@ -1881,12 +1873,11 @@ const encoding45 = {
1881
1873
  if (m.arguments) c.json.encode(state, m.arguments)
1882
1874
  },
1883
1875
  decode(state) {
1884
- const v = c.uint.decode(state)
1885
1876
  const r0 = c.string.decode(state)
1886
1877
  const flags = c.uint.decode(state)
1887
1878
 
1888
1879
  return {
1889
- version: v,
1880
+ version: 0,
1890
1881
  name: r0,
1891
1882
  arguments: (flags & 1) !== 0 ? c.json.decode(state) : null
1892
1883
  }
@@ -1920,13 +1911,12 @@ const encoding46 = {
1920
1911
  }
1921
1912
  },
1922
1913
  decode(state) {
1923
- const start = state.start
1924
1914
  const v = c.uint.decode(state)
1925
- state.start = start
1926
1915
  switch (v) {
1927
1916
  case 0:
1928
1917
  case 1: {
1929
1918
  const decoded = encoding45.decode(state)
1919
+ decoded.version = v
1930
1920
  return decoded
1931
1921
  }
1932
1922
  default:
@@ -1952,12 +1942,11 @@ const encoding47 = {
1952
1942
  if (m.result) c.json.encode(state, m.result)
1953
1943
  },
1954
1944
  decode(state) {
1955
- const v = c.uint.decode(state)
1956
1945
  const r0 = c.string.decode(state)
1957
1946
  const flags = c.uint.decode(state)
1958
1947
 
1959
1948
  return {
1960
- version: v,
1949
+ version: 0,
1961
1950
  name: r0,
1962
1951
  result: (flags & 1) !== 0 ? c.json.decode(state) : null
1963
1952
  }
@@ -1991,13 +1980,12 @@ const encoding48 = {
1991
1980
  }
1992
1981
  },
1993
1982
  decode(state) {
1994
- const start = state.start
1995
1983
  const v = c.uint.decode(state)
1996
- state.start = start
1997
1984
  switch (v) {
1998
1985
  case 0:
1999
1986
  case 1: {
2000
1987
  const decoded = encoding47.decode(state)
1988
+ decoded.version = v
2001
1989
  return decoded
2002
1990
  }
2003
1991
  default:
@@ -2035,7 +2023,6 @@ const encoding49 = {
2035
2023
  if (version >= 4 && m.url) c.string.encode(state, m.url)
2036
2024
  },
2037
2025
  decode(state) {
2038
- const v = c.uint.decode(state)
2039
2026
  const r0 = c.string.decode(state)
2040
2027
  const r1 = c.string.decode(state)
2041
2028
  const r2 = c.string.decode(state)
@@ -2045,7 +2032,7 @@ const encoding49 = {
2045
2032
  const flags = c.uint.decode(state)
2046
2033
 
2047
2034
  return {
2048
- version: v,
2035
+ version: 0,
2049
2036
  id: r0,
2050
2037
  fileName: r1,
2051
2038
  mimeType: r2,
@@ -2085,13 +2072,12 @@ const encoding50 = {
2085
2072
  }
2086
2073
  },
2087
2074
  decode(state) {
2088
- const start = state.start
2089
2075
  const v = c.uint.decode(state)
2090
- state.start = start
2091
2076
  switch (v) {
2092
2077
  case 0:
2093
2078
  case 1: {
2094
2079
  const decoded = encoding49.decode(state)
2080
+ decoded.version = v
2095
2081
  return decoded
2096
2082
  }
2097
2083
  default:
@@ -2109,11 +2095,10 @@ const encoding51 = {
2109
2095
  c.string.encode(state, m.agentId)
2110
2096
  },
2111
2097
  decode(state) {
2112
- const v = c.uint.decode(state)
2113
2098
  const r0 = c.string.decode(state)
2114
2099
 
2115
2100
  return {
2116
- version: v,
2101
+ version: 0,
2117
2102
  agentId: r0
2118
2103
  }
2119
2104
  }
@@ -2146,13 +2131,12 @@ const encoding52 = {
2146
2131
  }
2147
2132
  },
2148
2133
  decode(state) {
2149
- const start = state.start
2150
2134
  const v = c.uint.decode(state)
2151
- state.start = start
2152
2135
  switch (v) {
2153
2136
  case 0:
2154
2137
  case 1: {
2155
2138
  const decoded = encoding51.decode(state)
2139
+ decoded.version = v
2156
2140
  return decoded
2157
2141
  }
2158
2142
  default:
@@ -2226,12 +2210,11 @@ const encoding54 = {
2226
2210
  if (m.notice) c.string.encode(state, m.notice)
2227
2211
  },
2228
2212
  decode(state) {
2229
- const v = c.uint.decode(state)
2230
2213
  const r0 = encoding54_0.decode(state)
2231
2214
  const flags = c.uint.decode(state)
2232
2215
 
2233
2216
  return {
2234
- version: v,
2217
+ version: 0,
2235
2218
  sources: r0,
2236
2219
  notice: (flags & 1) !== 0 ? c.string.decode(state) : null
2237
2220
  }
@@ -2265,13 +2248,12 @@ const encoding55 = {
2265
2248
  }
2266
2249
  },
2267
2250
  decode(state) {
2268
- const start = state.start
2269
2251
  const v = c.uint.decode(state)
2270
- state.start = start
2271
2252
  switch (v) {
2272
2253
  case 0:
2273
2254
  case 1: {
2274
2255
  const decoded = encoding54.decode(state)
2256
+ decoded.version = v
2275
2257
  return decoded
2276
2258
  }
2277
2259
  default:
@@ -2382,13 +2364,12 @@ const encoding57 = {
2382
2364
  if (version >= 5 && m.compaction) encoding193.encode(state, m.compaction)
2383
2365
  },
2384
2366
  decode(state) {
2385
- const v = c.uint.decode(state)
2386
2367
  const r0 = c.string.decode(state)
2387
2368
  const r1 = c.string.decode(state)
2388
2369
  const flags = c.uint.decode(state)
2389
2370
 
2390
2371
  return {
2391
- version: v,
2372
+ version: 0,
2392
2373
  id: r0,
2393
2374
  chatId: r1,
2394
2375
  runId: (flags & 1) !== 0 ? c.string.decode(state) : null,
@@ -2444,13 +2425,12 @@ const encoding58 = {
2444
2425
  }
2445
2426
  },
2446
2427
  decode(state) {
2447
- const start = state.start
2448
2428
  const v = c.uint.decode(state)
2449
- state.start = start
2450
2429
  switch (v) {
2451
2430
  case 0:
2452
2431
  case 1: {
2453
2432
  const decoded = encoding57.decode(state)
2433
+ decoded.version = v
2454
2434
  return decoded
2455
2435
  }
2456
2436
  default:
@@ -6791,12 +6771,11 @@ const encoding192 = {
6791
6771
  c.string.encode(state, m.throughId)
6792
6772
  },
6793
6773
  decode(state) {
6794
- const v = c.uint.decode(state)
6795
6774
  const r0 = c.string.decode(state)
6796
6775
  const r1 = c.string.decode(state)
6797
6776
 
6798
6777
  return {
6799
- version: v,
6778
+ version: 0,
6800
6779
  summary: r0,
6801
6780
  throughId: r1
6802
6781
  }
@@ -6830,13 +6809,12 @@ const encoding193 = {
6830
6809
  }
6831
6810
  },
6832
6811
  decode(state) {
6833
- const start = state.start
6834
6812
  const v = c.uint.decode(state)
6835
- state.start = start
6836
6813
  switch (v) {
6837
6814
  case 0:
6838
6815
  case 1: {
6839
6816
  const decoded = encoding192.decode(state)
6817
+ decoded.version = v
6840
6818
  return decoded
6841
6819
  }
6842
6820
  default:
@@ -7807,6 +7785,63 @@ const encoding220 = {
7807
7785
  }
7808
7786
  }
7809
7787
 
7788
+ // @assistant/move-chat-request
7789
+ const encoding221 = {
7790
+ preencode(state, m) {
7791
+ c.string.preencode(state, m.id)
7792
+ state.end++ // max flag is 2 so always one byte
7793
+
7794
+ if (version >= 6 && m.groupId) c.string.preencode(state, m.groupId)
7795
+ if (version >= 6 && m.afterId) c.string.preencode(state, m.afterId)
7796
+ },
7797
+ encode(state, m) {
7798
+ const flags = ((version >= 6 && m.groupId) ? 1 : 0) | ((version >= 6 && m.afterId) ? 2 : 0)
7799
+
7800
+ c.string.encode(state, m.id)
7801
+ c.uint.encode(state, flags)
7802
+
7803
+ if (version >= 6 && m.groupId) c.string.encode(state, m.groupId)
7804
+ if (version >= 6 && m.afterId) c.string.encode(state, m.afterId)
7805
+ },
7806
+ decode(state) {
7807
+ const r0 = c.string.decode(state)
7808
+ const flags = c.uint.decode(state)
7809
+
7810
+ return {
7811
+ id: r0,
7812
+ groupId: (version >= 6 && (flags & 1) !== 0) ? c.string.decode(state) : null,
7813
+ afterId: (version >= 6 && (flags & 2) !== 0) ? c.string.decode(state) : null
7814
+ }
7815
+ }
7816
+ }
7817
+
7818
+ // @assistant/move-chat-group-request
7819
+ const encoding222 = {
7820
+ preencode(state, m) {
7821
+ c.string.preencode(state, m.id)
7822
+ state.end++ // max flag is 1 so always one byte
7823
+
7824
+ if (version >= 6 && m.afterId) c.string.preencode(state, m.afterId)
7825
+ },
7826
+ encode(state, m) {
7827
+ const flags = (version >= 6 && m.afterId) ? 1 : 0
7828
+
7829
+ c.string.encode(state, m.id)
7830
+ c.uint.encode(state, flags)
7831
+
7832
+ if (version >= 6 && m.afterId) c.string.encode(state, m.afterId)
7833
+ },
7834
+ decode(state) {
7835
+ const r0 = c.string.decode(state)
7836
+ const flags = c.uint.decode(state)
7837
+
7838
+ return {
7839
+ id: r0,
7840
+ afterId: (version >= 6 && (flags & 1) !== 0) ? c.string.decode(state) : null
7841
+ }
7842
+ }
7843
+ }
7844
+
7810
7845
  // @assistant/chat-list.groups, deferred due to recusive use
7811
7846
  const encoding18_1 = c.array(c.frame(encoding186))
7812
7847
  // @assistant/device.toolCatalog, deferred due to recusive use
@@ -8345,6 +8380,10 @@ function getEncoding(name) {
8345
8380
  return encoding219
8346
8381
  case '@assistant/file-retry-request':
8347
8382
  return encoding220
8383
+ case '@assistant/move-chat-request':
8384
+ return encoding221
8385
+ case '@assistant/move-chat-group-request':
8386
+ return encoding222
8348
8387
  default:
8349
8388
  throw new Error('Encoder not found ' + name)
8350
8389
  }