@qvac/core 0.4.0 → 0.4.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/CHANGELOG.md ADDED
@@ -0,0 +1,800 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@qvac/core` are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+ While the major version is `0`, a breaking change bumps the minor version.
8
+
9
+ Route by route detail, with what a caller has to do differently, is in each
10
+ module's changelog under [`docs/api/`](docs/api/README.md). The examples below
11
+ call the routes on a `Client`, named `engine`, in the shape they had in that
12
+ release.
13
+
14
+ ## [Unreleased]
15
+
16
+ ## [0.4.1] - 2026-09-25
17
+
18
+ ### Changed
19
+
20
+ - `autobee` 2.11.5, which also reindexes its system view on boot, alongside the
21
+ strict reindex 0.4.0 brought in. `hyperbee2` is pinned to 2.18.0 and
22
+ `hyperdb` needs 6.9. (#230)
23
+
24
+ ### Fixed
25
+
26
+ - A React Native app could not bundle `@qvac/core/oauth/client`: Metro rejects
27
+ this package's imports map, so `#abort-controller` did not resolve. Token
28
+ refresh now uses the runtime's own `AbortController`, and
29
+ `bare-abort-controller` only on Bare, which has none. React Native's `fetch`
30
+ gets a native signal too. 0.4.0 and 0.3.4 are affected. (#231)
31
+
32
+ ```js
33
+ // mobile: bundles again, nothing else changes
34
+ import { createOAuthClient } from '@qvac/core/oauth/client'
35
+
36
+ const oauth = createOAuthClient({ fetch, randomBase64Url, sha256Base64Url })
37
+ const tokens = await oauth.refreshOAuthTokens(config, refreshToken)
38
+ ```
39
+
40
+ ## [0.4.0] - 2026-09-24
41
+
42
+ ### Added
43
+
44
+ - `account` and `accountWatch`: the account's `meshId`, whether it is writable,
45
+ and the user's display name, so a host no longer picks the account out of the
46
+ mesh list. The watch emits again after a kick or leave mints a new account.
47
+ (#155)
48
+
49
+ ```js
50
+ const { meshId, writable, displayName } = await engine.account({})
51
+
52
+ for await (const account of engine.accountWatch({})) {
53
+ showAccount(account.meshId, account.displayName)
54
+ }
55
+ ```
56
+
57
+ - `listChats` and `chatsWatch` take `limit` and `cursor`, and the list carries
58
+ `nextCursor`. A limit returns the newest page, oldest-first inside it, and
59
+ `nextCursor` is set only while an older page exists. Leaving `limit` out
60
+ returns the whole list, as before. (#168)
61
+
62
+ ```js
63
+ let page = await engine.listChats({ meshId, limit: 50 })
64
+ render(page.chats)
65
+ while (page.nextCursor) {
66
+ page = await engine.listChats({ meshId, limit: 50, cursor: page.nextCursor })
67
+ renderAbove(page.chats)
68
+ }
69
+ ```
70
+
71
+ - A device-local index of the files a device holds, served by `listLocalFiles`.
72
+ `Core.clearOldFiles({ olderThanMs, includeOwn })` clears the bytes of files
73
+ not read since a cutoff and resolves with how many it cleared. A later read
74
+ fetches them back. Your own uploads are kept unless `includeOwn` is `true`.
75
+ The `fileGc` Core option runs the same sweep on an interval, and is off
76
+ unless set. Files an older build left behind are backfilled once per mesh,
77
+ so they can be reclaimed too. (#183)
78
+
79
+ ```js
80
+ const DAY = 24 * 60 * 60 * 1000
81
+ const core = new Core(() => server, {
82
+ storagePath,
83
+ device,
84
+ fileGc: { maxAgeMs: 30 * DAY, intervalMs: DAY }
85
+ })
86
+
87
+ const cleared = await core.clearOldFiles({ olderThanMs: 30 * DAY })
88
+ const { files } = await engine.listLocalFiles({ meshId })
89
+ const held = files.filter((file) => !file.cleared)
90
+ ```
91
+
92
+ - `getDefaultAgent` and `getDevice` read one row off an index, where a caller
93
+ used to list and search. `listAgents` and `agentsWatch` take an optional
94
+ `providerDeviceId`. (#183)
95
+
96
+ ```js
97
+ const { id: deviceId } = await engine.deviceInfo({})
98
+ const { agent } = await engine.getDefaultAgent({ meshId, providerDeviceId: deviceId })
99
+ const device = await engine.getDevice({ meshId, deviceId })
100
+ const { agents } = await engine.listAgents({ meshId, providerDeviceId: deviceId })
101
+ ```
102
+
103
+ ### Changed
104
+
105
+ - **Breaking:** every mesh-backed route takes a required `meshId`, and Core
106
+ holds a pool of meshes rather than a selected one. A route opens a mesh this
107
+ device belongs to on demand, and a watch ends with the mesh it names.
108
+ `selectMesh` is gone, and which mesh a window shows is the host's own state.
109
+ `meshStatusWatch` loses `writable`, `meshKey` and `discoveryKey`, a
110
+ `listMeshes` row loses `active`, `meshEntry.home` is now `account`, and `wasHome` is now
111
+ `wasAccount`. `leaveMesh` names the mesh it leaves, and `meshInvite` with no
112
+ `meshId` is a device invite for the account. hrpc route ids after
113
+ `selectMesh` shift down by one, so Client and Core ship together. (#155)
114
+
115
+ ```js
116
+ // 0.3
117
+ await engine.selectMesh({ meshId: room.meshId })
118
+ const { chats } = await engine.listChats({})
119
+ const { meshes } = await engine.listMeshes({})
120
+ const home = meshes.find((mesh) => mesh.home)
121
+ for await (const { writable } of engine.meshStatusWatch({})) showWritable(writable)
122
+ await engine.leaveMesh({})
123
+
124
+ // 0.4
125
+ const { chats } = await engine.listChats({ meshId: room.meshId })
126
+ const { meshId: accountId } = await engine.account({})
127
+ for await (const { meshes } of engine.meshesWatch({})) {
128
+ showWritable(meshes.find((mesh) => mesh.meshId === room.meshId)?.writable)
129
+ }
130
+ await engine.leaveMesh({ meshId: room.meshId })
131
+ ```
132
+
133
+ - **Breaking:** `listChunks`, `chunksWatch`, `listAttachmentsByKind`,
134
+ `listToolActivity` and `toolActivityWatch` take a `gt`/`gte`/`lt`/`lte` range
135
+ in place of `fromSeq`, `fromCreatedAt` and `beforeSeq`. `fromSeq` and
136
+ `fromCreatedAt` were inclusive floors, so they become `gte`, and `beforeSeq`
137
+ was an exclusive ceiling, so it becomes `lt`. A `0` bound arrives as absent
138
+ on the wire, so ask for the adjacent bound instead (`gt: 0` is `gte: 1`).
139
+ (#168)
140
+
141
+ ```js
142
+ // 0.3
143
+ await engine.listChunks({ chatId, fromSeq: 40 })
144
+ await engine.listAttachmentsByKind({ kind: 'image', fromCreatedAt: since })
145
+ await engine.listToolActivity({ agentId, beforeSeq: oldest.seq })
146
+
147
+ // 0.4
148
+ await engine.listChunks({ meshId, chatId, gte: 40 })
149
+ await engine.listAttachmentsByKind({ meshId, kind: 'image', gte: since })
150
+ await engine.listToolActivity({ meshId, agentId, lt: oldest.seq })
151
+
152
+ // a page of history older than seq 120, newest first
153
+ await engine.listChunks({ meshId, chatId, lt: 120, reverse: true, limit: 50 })
154
+ ```
155
+
156
+ - **Breaking:** a request names each entity by kind (`agentId`, `chatId`,
157
+ `groupId`, `deviceId`, `memberId`, `chunkId`) instead of `id`, and every
158
+ create, update and rename takes what it sets under `config`. Response rows
159
+ keep `id`. `renameDevice` always renames the calling device. `updateMember`
160
+ takes no id or `meshId`: it renames the caller's own member in the account,
161
+ and every other mesh picks the name up. (#178)
162
+
163
+ ```js
164
+ // 0.3
165
+ await engine.createChat({ agentId, title: 'Plans' })
166
+ await engine.renameChat({ id: chatId, title: 'Trip plans' })
167
+ await engine.updateAgent({ id: agentId, modelName: 'Qwen3.5-9B' })
168
+ await engine.setChatGroup({ id: chatId, groupId })
169
+ await engine.resolveApproval({ id: approvalChunkId, approved: true })
170
+ await engine.renameDevice({ id: deviceId, name: 'Laptop' })
171
+ await engine.updateMember({ id: memberId, name: 'Ada', meshId })
172
+ await engine.createRoom({ compute: true })
173
+
174
+ // 0.4
175
+ await engine.createChat({ meshId, agentId, config: { title: 'Plans' } })
176
+ await engine.renameChat({ meshId, chatId, config: { title: 'Trip plans' } })
177
+ await engine.updateAgent({ meshId, agentId, config: { modelName: 'Qwen3.5-9B' } })
178
+ await engine.setChatGroup({ meshId, chatId, groupId })
179
+ await engine.resolveApproval({ meshId, chunkId: approvalChunkId, approved: true })
180
+ await engine.renameDevice({ meshId, config: { name: 'Laptop' } })
181
+ await engine.updateMember({ config: { name: 'Ada' } })
182
+ await engine.createRoom({ config: { compute: true } })
183
+ ```
184
+
185
+ - `autobee` 2.11.4 with `strictReindex`: the boot reindex rewrites views still
186
+ on a version 1 manifest, which autobee 2.11 will no longer append to. (#205)
187
+
188
+ ### Deprecated
189
+
190
+ - The `setDisplayName` route now calls `updateMember`, and will be removed.
191
+ (#178)
192
+
193
+ ```js
194
+ // instead of engine.setDisplayName({ name: 'Ada' })
195
+ await engine.updateMember({ config: { name: 'Ada' } })
196
+ ```
197
+
198
+ ### Removed
199
+
200
+ - `Core.selectMesh` and `Core.setDisplayName`, for a host embedding Core.
201
+ `Core.mesh` is the account. (#155, #178)
202
+
203
+ ### Fixed
204
+
205
+ - `ragSearch` could search the selected mesh's vectors for a chat in another
206
+ mesh. Every open mesh now indexes against its own vector index. (#155)
207
+ - A member renamed on one device could be renamed back by another device of
208
+ the same member that held an older name. The newest name now wins. (#180)
209
+ - While one chat's image or music model was sampling, another chat's model
210
+ load or a background download reset its phase, so its sidebar row and thread
211
+ placeholder flickered back to running. (#202)
212
+ - OAuth token refresh failed on Node 24, including Electron 42, because the
213
+ request carried a non-native `AbortSignal`. Calendar, Spotify and other
214
+ connected skills stopped working an hour after connecting. (#207)
215
+
216
+ ## [0.3.3] - 2026-09-24
217
+
218
+ ### Changed
219
+
220
+ - `@qvac/harness` 0.3.3 and `@qvac/skills` 0.1.9. The harness moves to
221
+ `@qvac/sdk` 0.20, and some addons now ship per-platform prebuild packages,
222
+ so a host that bundles Core should read the harness 0.3.3 notes. (#203)
223
+
224
+ ### Fixed
225
+
226
+ - `listChatActivity` and `chatActivityWatch` reported `generating-image` or
227
+ `generating-audio` for the whole time a media model was downloading or
228
+ loading. That wait now reads as `running`, and the media state starts with
229
+ the first sampling tick. (#177)
230
+
231
+ ## [0.3.2] - 2026-09-23
232
+
233
+ ### Added
234
+
235
+ - XLSX and PPTX uploads are indexed as Knowledge and retrieved like other
236
+ documents, including uploads that another client sends to a desktop host.
237
+ Nothing changes for the caller: upload them the way you upload a PDF.
238
+ Requires `rag-extract` 0.1.1. (#161)
239
+ - In a chat where more than one person speaks, each user turn reaches the model
240
+ with its sender's name, so an agent can tell who asked for what. A chat with
241
+ one speaker produces the same prompt as before, so its KV cache still
242
+ matches. (#102)
243
+
244
+ ### Changed
245
+
246
+ - **Breaking:** OAuth provider config moves out of Core and into each skill's
247
+ manifest. Core keeps a generic engine, and the provider-named functions are
248
+ gone: read the skill catalog, look up the spec for a credential key, and run
249
+ the flow from it. `cancelOAuthFlow` takes `{ credentialKey }`. A skill
250
+ manifest is replicated content, so `specFromRoute` drops any route it cannot
251
+ run safely. (#169)
252
+
253
+ ```js
254
+ // 0.3.1
255
+ import { connectGoogle } from '@qvac/core/oauth'
256
+
257
+ const tokens = await connectGoogle({
258
+ clientId,
259
+ clientSecret,
260
+ credentialKey: 'gmail_access_token',
261
+ openUrl
262
+ })
263
+
264
+ // 0.3.2
265
+ import { buildProviderConfig, oauthSpecFor, runOAuthFlow } from '@qvac/core/oauth'
266
+
267
+ const { skills } = await engine.skills({ agentId })
268
+ const spec = oauthSpecFor(skills, 'gmail_access_token')
269
+ const tokens = await runOAuthFlow(buildProviderConfig(spec, { clientId, clientSecret }), {
270
+ openUrl
271
+ })
272
+ ```
273
+
274
+ - `@qvac/harness` 0.3.1 and `@qvac/skills` 0.1.6. (#191)
275
+
276
+ ### Removed
277
+
278
+ - The provider-named OAuth exports (`connectGoogle`, `exchangeAsanaCode`,
279
+ `refreshSpotifyToken`, every `*_CREDENTIAL_KEY` constant and the rest),
280
+ `providerRequiresSecret`, `providerSupportsDcr`,
281
+ `providerSupportsSharedIosSession`, `OAUTH_PROVIDERS` and
282
+ `verifyOAuthTokens`. Read the same facts off the spec instead. See
283
+ [`docs/api/runtime.md`](docs/api/runtime.md) for the full list. (#169)
284
+
285
+ ```js
286
+ // instead of providerRequiresSecret(provider)
287
+ const needsSecret = spec.tokenAuth !== 'pkce-only'
288
+ // instead of providerSupportsDcr(provider)
289
+ const registers = Boolean(spec.registrationEndpoint)
290
+ // instead of providerSupportsSharedIosSession(provider)
291
+ const shared = spec.sharedIosSession === true
292
+ ```
293
+
294
+ ### Fixed
295
+
296
+ - A device that booted straight into a room showed every mesh unnamed, and
297
+ `shared`/`sharedAt` were wrong after a restart. A boot now always opens the
298
+ account next to the mesh it lands on. (#150)
299
+ - A `closeMesh` that landed while the same mesh was still opening closed
300
+ nothing, and left the mesh open and replicating. (#150)
301
+ - `duck`'s `/save` dropped the extension of every attachment that was not a
302
+ JPEG or PNG, so a saved `.mp4` or `.pdf` would not open. (#182)
303
+
304
+ ## [0.3.1] - 2026-09-22
305
+
306
+ ### Added
307
+
308
+ - The prompt inspector: `inferenceCalls` returns the model calls recorded for a
309
+ chat, merging the rounds this device ran with those the agent's host ran.
310
+ Nothing is recorded until the device-local `inspector.captureInferenceCalls`
311
+ key is set to the string `'on'`. Records stay on the device, are dropped with
312
+ their chat, and are pruned by count and age. (#58)
313
+
314
+ ```js
315
+ await engine.configSet({ key: 'inspector.captureInferenceCalls', value: 'on' })
316
+
317
+ const { calls, truncated } = await engine.inferenceCalls({ chatId })
318
+ for (const { runId, at, call } of calls ?? []) inspect(runId, at, call)
319
+ ```
320
+
321
+ - `senderMemberId` on a user message's chunk, stamped by Core, so a message
322
+ records which member sent it even after the device that wrote it is removed.
323
+ Messages from before this carry none. (#101)
324
+
325
+ ```js
326
+ const { chunks } = await engine.listChunks({ chatId, type: 'user-message' })
327
+ const { members } = await engine.listMembers({ meshId })
328
+ const sender = (chunk) =>
329
+ members.find((member) => b4a.equals(member.id, chunk.senderMemberId))?.name
330
+ ```
331
+
332
+ ### Changed
333
+
334
+ - The extraction, chunking and retrieval pipeline comes from `rag-extract`, and
335
+ behaviour is unchanged. A host that gates installs on release age has to
336
+ exempt `rag-extract`. (#112)
337
+
338
+ ```toml
339
+ # bunfig.toml
340
+ [install]
341
+ minimumReleaseAgeExcludes = ["rag-extract"]
342
+ ```
343
+
344
+ - `autobee` 2.10. The on-disk record layout is unchanged, so released peers
345
+ still read it. (#154)
346
+ - `@qvac/harness` 0.2.9, which sends `stopReason`, so `duck` now marks an
347
+ answer the context window cut short. (#163)
348
+ - `deleteChat` also drops the chat's prompt-inspector records, and fails if
349
+ that drop fails. (#58)
350
+
351
+ ### Fixed
352
+
353
+ - A new room could be created with the device's name as the member name, when
354
+ the user had already given their own name. Co-members saw the device name
355
+ until a rename caught up. (#159)
356
+
357
+ ## [0.3.0] - 2026-09-21
358
+
359
+ ### Added
360
+
361
+ - `verifyOAuthTokens` checks a fresh token before a host saves it: it refuses an
362
+ Asana token from a non-MCP app, and a Spotify account without Premium. A
363
+ network error or timeout still lets the connect go through. (#136)
364
+
365
+ ```js
366
+ import { verifyOAuthTokens } from '@qvac/core/oauth'
367
+
368
+ const result = await verifyOAuthTokens(credentialKey, tokens.accessToken, fetch)
369
+ if (!result.ok) throw new Error(result.error) // e.g. OAuth error: spotify_premium_required
370
+ ```
371
+
372
+ - `duck`: `/usage` shows how full the chat's context window is and what fills
373
+ it, the palette completes each command's verbs (tab or enter), and a new
374
+ session reopens the agent and chat the last one left active. (#132, #133,
375
+ #134)
376
+
377
+ ```
378
+ /usage the window, what fills it, and the chat's totals
379
+ /chat n completes to /chat new and runs it
380
+ ```
381
+
382
+ ### Changed
383
+
384
+ - A watch opened without a `meshId` stayed on the mesh selected when it
385
+ opened. It now ends when the selection moves, and the caller reopens it on
386
+ the mesh it wants. Omitting `meshId` is deprecated. To keep one watch across
387
+ a selection change, name its mesh. (#139)
388
+
389
+ ```js
390
+ // ends when the user selects another mesh
391
+ for await (const frame of engine.chatsWatch({})) render(frame)
392
+
393
+ // stays on the mesh it names
394
+ for await (const frame of engine.chatsWatch({ meshId })) render(frame)
395
+ ```
396
+
397
+ - `runRequestsWatch` only serves the requests whose agent names the calling
398
+ device. (#144)
399
+ - A chat is compacted only before a run starts, never after an answer. The
400
+ turn that crosses the threshold finishes untouched, and the next message
401
+ folds first. (#130)
402
+
403
+ ### Fixed
404
+
405
+ - After switching mesh, the assistant stopped claiming runs, so no model
406
+ loaded for a request on the newly selected mesh. (#139)
407
+ - `listKnowledge`, `listIndexing`, `knowledgeWatch`, `indexingWatch` and
408
+ `indexingProgressWatch` ignored the `meshId` they were given and answered
409
+ for the selected mesh instead. (#142)
410
+ - A device name had no length limit, and a very long one broke the room UI.
411
+ Names are now capped at 100 characters, and a longer one is refused. (#84)
412
+
413
+ ## [0.2.2] - 2026-09-18
414
+
415
+ ### Added
416
+
417
+ - Compute meshes: `createRoom({ compute: true })` makes a mesh that holds only
418
+ devices and members, so a device can lend its model to another device
419
+ without receiving its chats, knowledge or agents. The borrower keeps the run,
420
+ and only the completion call crosses the wire. (#67)
421
+
422
+ ```js
423
+ // the device with the model
424
+ const { meshId } = await desktop.createRoom({ compute: true })
425
+ const { invite } = await desktop.meshInvite({ member: true, meshId })
426
+
427
+ // the device that borrows it
428
+ await phone.joinMesh({ invite })
429
+ const { id, computeLenderId } = await phone.deviceInfo({})
430
+ await phone.createAgent({
431
+ name: 'Borrower',
432
+ bio: 'runs here, thinks there',
433
+ providerDeviceId: id,
434
+ modelName: 'Qwen3.5-9B',
435
+ lenderDeviceId: computeLenderId
436
+ })
437
+ ```
438
+
439
+ - Runs are served from every open mesh, not only the selected one, so a
440
+ co-member's message in a room is answered while the host is looking at
441
+ another mesh. (#93)
442
+ - `listDevices`, `devicesWatch` and `listMembers` take a `meshId`, and
443
+ `membersWatch` is new. A background run can read the rosters of its own
444
+ mesh. (#87, #122)
445
+
446
+ ```js
447
+ const { devices } = await engine.listDevices({ meshId: room.meshId })
448
+ for await (const { members } of engine.membersWatch({ meshId: room.meshId })) {
449
+ render(members)
450
+ }
451
+ ```
452
+
453
+ - `updateMember` and `removeMember`. Any member may remove another, and doing
454
+ so revokes every device of that member at once. A removed member no longer
455
+ appears in `listMembers`. A device cannot remove its own member. (#89, #92)
456
+
457
+ ```js
458
+ await engine.updateMember({ id: memberId, name: 'Ada at work', meshId })
459
+ await engine.removeMember({ id: otherMemberId, meshId })
460
+ ```
461
+
462
+ - `shared` and `sharedAt` on each mesh entry, marking the room a member invite
463
+ reuses. (#91)
464
+
465
+ ```js
466
+ const { meshes } = await engine.listMeshes({})
467
+ const sharedRoom = meshes.find((mesh) => mesh.shared)
468
+ ```
469
+
470
+ - `listArchivedMeshes`, `archivedMeshContents` and `migrateArchivedMesh`: after
471
+ a device invite moves a device onto another account, the account it left can
472
+ be counted and its chats, agents and knowledge copied across. A second
473
+ migrate answers `migrated: false`. (#105)
474
+
475
+ ```js
476
+ await phone.joinMesh({ invite: (await laptop.meshInvite({})).invite })
477
+
478
+ const [left] = (await phone.listArchivedMeshes({})).meshes ?? []
479
+ const { chats, agents, knowledge } = await phone.archivedMeshContents({ meshId: left.meshId })
480
+ if (await askUser(`Bring over ${chats} chats, ${agents} agents, ${knowledge} documents?`)) {
481
+ await phone.migrateArchivedMesh({ meshId: left.meshId })
482
+ }
483
+ ```
484
+
485
+ - Account recovery from the identity phrase: `accountRecoverable`,
486
+ `recoveryPublish` and `recoverAccount`. A copy of the account seed that only
487
+ the phrase can open is mirrored by the blind peers, so a wiped device can get
488
+ its account back. An account made before this has to be published once.
489
+ (#107)
490
+
491
+ ```js
492
+ // once, on a device that has the account
493
+ const { recoverable } = await engine.accountRecoverable({})
494
+ if (!recoverable) await engine.recoveryPublish({ phrase })
495
+
496
+ // on a wiped device
497
+ await engine.recoverAccount({ phrase, timeout: 30_000 })
498
+ ```
499
+
500
+ - `displayName` and `setDisplayName`: a member is named after its user rather
501
+ than after the device that founded it. The account is minted before
502
+ onboarding runs, so set the name once the user has entered it. (#108, #109)
503
+
504
+ ```js
505
+ await engine.setDisplayName({ name: 'Ada' })
506
+ const { name } = await engine.displayName({})
507
+ ```
508
+
509
+ - `sortChatGroupsByName`. Groups nobody has arranged sort by name, and this
510
+ drops every arrangement to go back to that order. (#110)
511
+
512
+ ```js
513
+ const { groups } = await engine.sortChatGroupsByName({})
514
+ ```
515
+
516
+ - Transcription resolves the newest audio attachment when no id is given.
517
+ (#66)
518
+ - `duck`: `/leave`, `/compact`, a marker where a chat was compacted, `/ctx`
519
+ and a menu entry to set the agent's context size, and a note when the
520
+ context window cut an answer short. (#86, #127, #129)
521
+
522
+ ```
523
+ /leave leave the mesh in use
524
+ /compact compact the chat now
525
+ /ctx 8k run the agent at an 8,192-token window; /ctx auto clears it
526
+ ```
527
+
528
+ ### Changed
529
+
530
+ - An approval rule records the member who wrote it, and only applies to that
531
+ member. In a shared room, one member's standing rule no longer approves
532
+ another member's tool calls. A rule written before this has no author and
533
+ applies to nobody, so its call is asked again. (#123)
534
+
535
+ ```js
536
+ const { rules, ourMemberId } = await engine.listApprovalRules({ meshId })
537
+ const mine = rules.filter((rule) => rule.memberId && b4a.equals(rule.memberId, ourMemberId))
538
+ ```
539
+
540
+ - A room's default agent is named after the member whose device runs it,
541
+ rather than after the built-in agent. (#96)
542
+ - When a member leaves a room on one device, the room is also retired on that
543
+ member's other devices. (#95)
544
+
545
+ ### Fixed
546
+
547
+ - The turn that triggered compaction lost its own answer from later prompts,
548
+ and on 4k and 8k windows compaction ran a turn too late. The threshold now
549
+ depends on the window size. (#126)
550
+ - When two devices of one member redeemed the same member invite, the room
551
+ ended up with two members instead of one member with two devices. (#111)
552
+ - With a room selected, a device invite targeted the room and was refused. It
553
+ now targets the account. (#81)
554
+ - The inviter's `meshesWatch` never saw a member join a room it was not
555
+ looking at. (#100)
556
+ - A member invite warned that a room with only its own member in it was not
557
+ empty. (#97)
558
+ - With Knowledge off, a document over 20 MiB was not read at all. Its opening
559
+ is now read whatever the file's size. (#83)
560
+
561
+ ### Security
562
+
563
+ - Once a mesh holds a verified device signature, it refuses unsigned device
564
+ rows. Before this, any admitted writer could create or rewrite a device row
565
+ for a key it did not hold. Meshes that predate this are sealed by the first
566
+ signing build to boot on them. (#88)
567
+
568
+ ## [0.2.1] - 2026-09-16
569
+
570
+ ### Fixed
571
+
572
+ - When a user attached many documents and asked a topic-specific question,
573
+ retrieval could leave some of them out. Every attached file now gets a share
574
+ of the token budget. (#64)
575
+
576
+ ## [0.2.0] - 2026-09-15
577
+
578
+ ### Added
579
+
580
+ - Member invites: `meshInvite({ member: true })` opens a shared room and
581
+ invites a second person into it as a member of their own, keeping their
582
+ identity. The account is never invitable this way. `listMembers` returns the
583
+ members, and the response's `notice` says when the room already holds
584
+ people. (#49, #57)
585
+
586
+ ```js
587
+ // Ada
588
+ const { invite, meshId, notice } = await ada.meshInvite({ member: true })
589
+
590
+ // Ben, on his own device
591
+ await ben.joinMesh({ invite })
592
+ ```
593
+
594
+ - Multiple meshes per device: `listMeshes`, `meshesWatch`, `openMesh`,
595
+ `selectMesh`, `closeMesh` and `setMeshLabel`, and a `meshId` on the agent
596
+ and chat calls. Joining a room keeps the mesh already in use, the member's
597
+ other devices pick the room up, and each member gets their own default agent
598
+ in it, on their own device. (#50, #51, #52, #53, #54, #55)
599
+
600
+ ```js
601
+ const { meshes } = await engine.listMeshes({})
602
+ // [{ meshId, state, writable, open, active, home, label, members }, …]
603
+
604
+ const room = meshes.find((mesh) => !mesh.home)
605
+ await engine.setMeshLabel({ meshId: room.meshId, label: 'Family' })
606
+ await engine.selectMesh({ meshId: room.meshId })
607
+ const { chats } = await engine.listChats({ meshId: room.meshId })
608
+ ```
609
+
610
+ - `moveChat` and `moveChatGroup`: chats and groups can be dragged into an
611
+ order. A dropped row lands directly below `afterId`, or at the top when it is
612
+ left out, and a chat can change group in the same call. (#44)
613
+
614
+ ```js
615
+ await engine.moveChat({ id: chatId, groupId, afterId: chatAboveId })
616
+ await engine.moveChat({ id: chatId }) // ungrouped, at the top
617
+ await engine.moveChatGroup({ id: groupId, afterId: groupAboveId })
618
+ ```
619
+
620
+ ### Changed
621
+
622
+ - **Breaking:** a device is adopted into a member only if it presents a claim,
623
+ so pairing needs an invite from an upgraded device. A device still on an
624
+ older build connects, but is not listed as yours until it is updated and
625
+ paired again. (#70)
626
+
627
+ ```js
628
+ // on the upgraded device
629
+ const { invite } = await laptop.meshInvite({})
630
+ // on the device being paired, once it runs 0.2.0
631
+ await phone.joinMesh({ invite })
632
+ ```
633
+
634
+ - **Breaking:** the member join is a new mesh route, and
635
+ `VENDORED_MIN_SUPPORTED_VERSION` moves to `>=0.18.0`. A peer on an older
636
+ build withdraws a mesh as needing an upgrade once a joined room is recorded
637
+ in it. (#49, #55)
638
+ - `home` on a mesh entry now marks the account mesh, not the mesh this device
639
+ minted. Leaving or being kicked archives a mesh instead of deleting it, so
640
+ its seed survives. (#56)
641
+
642
+ ## [0.1.7] - 2026-09-17
643
+
644
+ Published under the `release-0.1` dist-tag.
645
+
646
+ ### Added
647
+
648
+ - `moveChat` and `moveChatGroup`, and groups nobody has arranged sort by name,
649
+ backported from 0.2.0 and 0.2.2. See 0.2.0 for an example. (#44, #110)
650
+
651
+ ## [0.1.6] - 2026-09-16
652
+
653
+ Published under the `release-0.1` dist-tag.
654
+
655
+ ### Changed
656
+
657
+ - `@qvac/harness` 0.2.7.
658
+
659
+ ### Fixed
660
+
661
+ - Every attached file gets a share of the retrieval budget, backported from
662
+ 0.2.1. (#64)
663
+
664
+ ## [0.1.5] - 2026-09-15
665
+
666
+ ### Added
667
+
668
+ - Joining through a fast-forward loads the device, agent, member and chat lists
669
+ the app needs to start, so a cold join no longer stalls on "Requesting host
670
+ setup". Nothing to call: it runs on every fast-forward. (#43)
671
+
672
+ ### Fixed
673
+
674
+ - Mesh keys are derived from the `qvac-assistant/mesh` namespace again. Since
675
+ 0.1.0 a seed stored by the `qvac-assistant` package opened as a fresh, empty
676
+ mesh with no error, and its chats, agents and groups were left behind on
677
+ disk. They come back with this release. A mesh first created by 0.1.0 to
678
+ 0.1.4 derives differently here. (#59)
679
+ - After a few skill turns, the prompt could end on a tool turn, so the model
680
+ narrated loading a skill or gave no answer. (#48)
681
+
682
+ ## [0.1.4] - 2026-09-12
683
+
684
+ ### Added
685
+
686
+ - `duck --help` and `duck --version`. Both answer without loading the engine.
687
+ (#36)
688
+
689
+ ```sh
690
+ $ duck --version
691
+ @qvac/core 0.1.4
692
+ @qvac/harness 0.2.4
693
+ @qvac/sdk 0.19.0
694
+ ```
695
+
696
+ ### Changed
697
+
698
+ - `duck` draws its first frame before loading the engine, and
699
+ `QVAC_INPROCESS` is gone: `duck` runs the same sidecar topology as the
700
+ desktop app. (#37)
701
+
702
+ ### Fixed
703
+
704
+ - The README image on npm was broken, so `ducks.png` ships in the package
705
+ again. (#36)
706
+
707
+ ## [0.1.3] - 2026-09-12
708
+
709
+ ### Removed
710
+
711
+ - **Breaking:** the `./dist/assistant.cjs` export. Nothing relocated the bundle
712
+ this package published. A host that spawns Core from its own bundle stows
713
+ `worker/assistant-sidecar.mjs` in its own build, as the desktop and mobile
714
+ apps do, and passes the result as `entry`. (#33)
715
+
716
+ ```js
717
+ const engine = new AssistantClient({
718
+ storagePath,
719
+ device,
720
+ entry: '/path/to/your/assistant.bundle'
721
+ })
722
+ ```
723
+
724
+ ### Fixed
725
+
726
+ - 0.1.2 installed and then hung with no output: 14 of the 47 native addons
727
+ outside the published bundle were at a different version from the ones the
728
+ bundle was built with. `duck` now runs from the installed files, and the
729
+ tarball shrinks from 11.9 MB to 517 KB. Requires `@qvac/harness` 0.2.4. (#33)
730
+
731
+ ## [0.1.2] - 2026-09-11
732
+
733
+ ### Added
734
+
735
+ - `duck`, the terminal app, ships in the package. It runs the same assistant
736
+ sidecar that the desktop app ships. Joining a mesh is `/join` inside the app,
737
+ not an argument at startup. `bare` has to be on your PATH. (#30)
738
+
739
+ ```sh
740
+ npm i -g @qvac/core
741
+ duck
742
+ ```
743
+
744
+ ## [0.1.1] - 2026-09-11
745
+
746
+ ### Added
747
+
748
+ - A `./wire-codec` export for the generated hyperschema messages, so a host can
749
+ decode what the real decoder produces. (#28)
750
+
751
+ ```js
752
+ import { decode, encode } from '@qvac/core/wire-codec'
753
+
754
+ const chunk = decode('@assistant/chunk', encode('@assistant/chunk', value))
755
+ ```
756
+
757
+ ### Fixed
758
+
759
+ - The compiled library could not load: eight modules in `dist-lib` imported
760
+ `schema/helpers.js`, which was missing from the package. (#28)
761
+
762
+ ## [0.1.0] - 2026-09-11
763
+
764
+ ### Added
765
+
766
+ - First release as `@qvac/core`. It contains `Core`, `Client` and
767
+ `QvacAssistant`, moved out of `qvac-app` with their history. The hosting
768
+ contract and the schema codegen come from `@qvac/harness`. (#1, #4, #7, #11)
769
+
770
+ ```js
771
+ import { AssistantClient, QvacAssistant } from '@qvac/core'
772
+
773
+ const engine = new AssistantClient({
774
+ storagePath: '/path/to/state',
775
+ device: { name: 'laptop', capabilityProfile: 'high', recommendedModelName: 'Qwen3.5-9B' }
776
+ })
777
+ await engine.ready()
778
+
779
+ const assistant = new QvacAssistant(engine, harness)
780
+ await assistant.ready()
781
+ ```
782
+
783
+ [Unreleased]: https://github.com/tetherto/qvac-core/compare/v0.4.1...HEAD
784
+ [0.4.1]: https://github.com/tetherto/qvac-core/compare/v0.4.0...v0.4.1
785
+ [0.4.0]: https://github.com/tetherto/qvac-core/compare/v0.3.3...v0.4.0
786
+ [0.3.3]: https://github.com/tetherto/qvac-core/compare/v0.3.2...v0.3.3
787
+ [0.3.2]: https://github.com/tetherto/qvac-core/compare/v0.3.1...v0.3.2
788
+ [0.3.1]: https://github.com/tetherto/qvac-core/compare/v0.3.0...v0.3.1
789
+ [0.3.0]: https://github.com/tetherto/qvac-core/compare/v0.2.2...v0.3.0
790
+ [0.2.2]: https://github.com/tetherto/qvac-core/compare/v0.2.1...v0.2.2
791
+ [0.2.1]: https://github.com/tetherto/qvac-core/compare/v0.2.0...v0.2.1
792
+ [0.2.0]: https://github.com/tetherto/qvac-core/compare/v0.1.5...v0.2.0
793
+ [0.1.7]: https://github.com/tetherto/qvac-core/compare/v0.1.6...v0.1.7
794
+ [0.1.6]: https://github.com/tetherto/qvac-core/compare/v0.1.5...v0.1.6
795
+ [0.1.5]: https://github.com/tetherto/qvac-core/compare/v0.1.4...v0.1.5
796
+ [0.1.4]: https://github.com/tetherto/qvac-core/compare/v0.1.3...v0.1.4
797
+ [0.1.3]: https://github.com/tetherto/qvac-core/compare/v0.1.2...v0.1.3
798
+ [0.1.2]: https://github.com/tetherto/qvac-core/compare/v0.1.1...v0.1.2
799
+ [0.1.1]: https://github.com/tetherto/qvac-core/compare/v0.1.0...v0.1.1
800
+ [0.1.0]: https://github.com/tetherto/qvac-core/releases/tag/v0.1.0
@@ -246,7 +246,7 @@ export class Mesh extends ReadyResource {
246
246
  this.files.start({ deviceId: this._deviceId });
247
247
  }
248
248
  startBlindPeering(dht) {
249
- if (this.closing || !this.autobee || !this.blobs)
249
+ if (this.closing || this._blindPeering || !this.autobee || !this.blobs)
250
250
  return;
251
251
  this._blindPeering = new BlindPeering(dht, this._store, {
252
252
  pick: 2,
@@ -1,4 +1,3 @@
1
- import { type OAuthTokens } from './common.ts';
2
1
  export declare function waitForOAuthCallback(opts: {
3
2
  port: number;
4
3
  state: string;
@@ -7,16 +6,3 @@ export declare function waitForOAuthCallback(opts: {
7
6
  }): Promise<{
8
7
  code: string;
9
8
  }>;
10
- export declare function runBrowserConnect(opts: {
11
- port: number;
12
- buildAuthUrl: (args: {
13
- state: string;
14
- challenge: string;
15
- }) => string;
16
- openUrl: (url: string) => unknown;
17
- exchange: (args: {
18
- code: string;
19
- verifier: string;
20
- }) => Promise<OAuthTokens>;
21
- timeoutMs?: number;
22
- }): Promise<OAuthTokens>;
@@ -1,7 +1,6 @@
1
- import { randomBytes as defaultRandomBytes } from 'crypto';
2
1
  import { createServer } from 'http';
3
2
  import { URL } from 'url';
4
- import { base64url, CALLBACK_PATH, createPkce, DEFAULT_TIMEOUT_MS } from './common.js';
3
+ import { CALLBACK_PATH, DEFAULT_TIMEOUT_MS } from './common.js';
5
4
  export function waitForOAuthCallback(opts) {
6
5
  const { port, state, timeoutMs = DEFAULT_TIMEOUT_MS, onListening } = opts;
7
6
  return new Promise((resolve, reject) => {
@@ -57,27 +56,3 @@ export function waitForOAuthCallback(opts) {
57
56
  server.listen(port, '127.0.0.1', () => onListening?.());
58
57
  });
59
58
  }
60
- export async function runBrowserConnect(opts) {
61
- const { verifier, challenge } = createPkce();
62
- const state = base64url(defaultRandomBytes(16));
63
- let onListening;
64
- const listening = new Promise((resolve) => {
65
- onListening = resolve;
66
- });
67
- const callback = waitForOAuthCallback({
68
- port: opts.port,
69
- state,
70
- timeoutMs: opts.timeoutMs,
71
- onListening: () => onListening()
72
- });
73
- try {
74
- await Promise.race([listening, callback]);
75
- await opts.openUrl(opts.buildAuthUrl({ state, challenge }));
76
- }
77
- catch (err) {
78
- callback.catch(() => { });
79
- throw err;
80
- }
81
- const { code } = await callback;
82
- return opts.exchange({ code, verifier });
83
- }
@@ -1,6 +1,7 @@
1
- import { AbortController } from '#abort-controller';
1
+ import { AbortController as BareAbortController } from 'bare-abort-controller';
2
2
  import * as z from 'zod';
3
3
  const TOKEN_REQUEST_TIMEOUT_MS = 30_000;
4
+ const AbortController = globalThis.AbortController ?? BareAbortController;
4
5
  const TokenResponseSchema = z.object({
5
6
  access_token: z.string(),
6
7
  token_type: z.string(),
@@ -1,5 +1,4 @@
1
- import type { OAuthFlowDeps, OAuthProviderConfig, OAuthTokens } from './types.ts';
1
+ import type { OAuthProviderConfig, OAuthTokens } from './types.ts';
2
2
  import { isTokenExpired } from './token-exchange-core.ts';
3
- export declare function exchangeCode(config: OAuthProviderConfig, clientId: string, redirectUri: string, code: string, verifier: string, deps: OAuthFlowDeps): Promise<OAuthTokens>;
4
3
  export declare function refreshOAuthTokens(config: OAuthProviderConfig, refreshToken: string): Promise<OAuthTokens>;
5
4
  export { isTokenExpired };
@@ -1,8 +1,5 @@
1
1
  import defaultFetch from '@qvac/core/oauth/runtime/fetch';
2
- import { exchangeCodeWithFetch, isTokenExpired, refreshOAuthTokensWithFetch } from './token-exchange-core.js';
3
- export function exchangeCode(config, clientId, redirectUri, code, verifier, deps) {
4
- return exchangeCodeWithFetch(config, clientId, redirectUri, code, verifier, deps, defaultFetch);
5
- }
2
+ import { isTokenExpired, refreshOAuthTokensWithFetch } from './token-exchange-core.js';
6
3
  export function refreshOAuthTokens(config, refreshToken) {
7
4
  return refreshOAuthTokensWithFetch(config, refreshToken, defaultFetch);
8
5
  }
@@ -1,9 +1,6 @@
1
1
  import fs from 'bare-fs';
2
2
  import { spawnSync } from 'bare-subprocess';
3
- const EXEMPT = {
4
- '@qvac/seed-defaults-operation-v1.agent': 'seedableAgent allowlists the seed agent and leaves lenderDeviceId off it',
5
- '@qvac/writer-claim-v1.device': 'claimableDevice allowlists the claim and leaves claimedMemberId, inviteToken and deviceSignature off it'
6
- };
3
+ const EXEMPT = {};
7
4
  export function assertFieldOrder(root, schemaFile, tags) {
8
5
  const current = index(JSON.parse(fs.readFileSync(schemaFile, 'utf8')).schema);
9
6
  const seen = new Set();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/core",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Peer-to-peer AI across your devices",
6
6
  "exports": {
@@ -142,6 +142,11 @@
142
142
  "scripts": {
143
143
  "build:splash": "node tui/build-splash.mjs",
144
144
  "build:schema": "bare schema/build.ts",
145
+ "bench:rag": "node --experimental-strip-types bench/rag/cli.ts",
146
+ "bench:rag:database": "node --experimental-strip-types bench/rag/database/cli.ts",
147
+ "bench:rag:pilot": "node --experimental-strip-types bench/rag/pilot.ts",
148
+ "bench:rag:test": "node --experimental-strip-types bench/rag/test/all.ts",
149
+ "bench:rag:typecheck": "tsc -p bench/rag/tsconfig.json",
145
150
  "duck": "bare tui/index.mjs",
146
151
  "mesh-two-people": "bare examples/mesh-two-people.mjs",
147
152
  "mesh-lend-a-model": "bare examples/mesh-lend-a-model.mjs",
@@ -152,7 +157,7 @@
152
157
  "mesh-lab": "bare examples/mesh-lab.mjs",
153
158
  "mesh-recover-account": "bare examples/mesh-recover-account.mjs",
154
159
  "mesh-user-names": "bare examples/mesh-user-names.mjs",
155
- "test": "npm run test:bare",
160
+ "test": "npm run test:bare && npm run bench:rag:test",
156
161
  "test:bare": "QVAC_NO_SKILL_BIN_PROBE=1 brittle-jobs -j 2 --retries 1 'test/*.ts' 'test/{api,basic,rag}/**/*.ts' 'test/tui/**/!(helpers).ts'",
157
162
  "test:model": "QVAC_TEST_MODELS=1 npm run test:bare",
158
163
  "format": "prettier . --write",
@@ -207,10 +212,6 @@
207
212
  "bare": "bare-fetch",
208
213
  "default": "./dist-lib/lib/fetch-node.js"
209
214
  },
210
- "#abort-controller": {
211
- "bare": "bare-abort-controller",
212
- "default": "./dist-lib/lib/abort-controller-node.js"
213
- },
214
215
  "#oauth-loopback": {
215
216
  "bare": "./dist-lib/lib/oauth/loopback.stub.js",
216
217
  "default": "./dist-lib/lib/oauth/loopback.js"
@@ -228,7 +229,7 @@
228
229
  "@qvac/harness": "^0.3.3",
229
230
  "@qvac/skills": "^0.1.9",
230
231
  "asenion": "^0.1.0",
231
- "autobee": "^2.11.4",
232
+ "autobee": "^2.11.5",
232
233
  "b4a": "^1.9.0",
233
234
  "bare-abort-controller": "^1.1.2",
234
235
  "bare-buffer": "^3.6.1",
@@ -267,7 +268,7 @@
267
268
  "hypercore-crypto": "^3.7.0",
268
269
  "hypercore-id-encoding": "^1.3.0",
269
270
  "hypercore-storage": "^3.1.2",
270
- "hyperdb": "^6.8.0",
271
+ "hyperdb": "^6.9.0",
271
272
  "hyperdispatch": "^1.6.0",
272
273
  "hyperdrive": "^13.3.3",
273
274
  "hyperschema": "1.26.2",
@@ -296,7 +297,7 @@
296
297
  "bare-bundle": "^1.10.0",
297
298
  "bare-module-lexer": "^1.6.3",
298
299
  "bare-pack": "^2.2.1",
299
- "bare-runtime": "^1.30.0",
300
+ "bare-runtime": "1.31.0",
300
301
  "bare-sidecar": "^0.5.2",
301
302
  "brittle": "^4.0.2",
302
303
  "brittle-jobs": "0.2.1",
@@ -333,13 +334,14 @@
333
334
  },
334
335
  "overrides": {
335
336
  "@qvac/asr-ggml": "0.4.2",
336
- "bare-runtime": "^1.30.0",
337
+ "bare-runtime": "1.31.0",
337
338
  "bare-module": "6.4.0",
338
339
  "bare-http1": "4.6.1",
339
340
  "lodash": "4.18.1",
340
341
  "hyperschema": "1.26.2",
341
- "hyperdb": "^6.8.0",
342
+ "hyperdb": "^6.9.0",
342
343
  "hypercore": "^11.37.0",
344
+ "hyperbee2": "^2.18.0",
343
345
  "tar": "^7.5.22"
344
346
  },
345
347
  "publishConfig": {
@@ -1,4 +0,0 @@
1
- export declare const AbortController: {
2
- new (): AbortController;
3
- prototype: AbortController;
4
- };
@@ -1 +0,0 @@
1
- export const AbortController = globalThis.AbortController;
@@ -1,24 +0,0 @@
1
- // QVAC_MMPROJ: one mmproj for every model, or per-model pairs
2
- // "model=mmproj,model2=mmproj2" (keys match the agent's model name/path)
3
- export function parseProjectionEnv(value) {
4
- if (!value) return undefined
5
- const eq = value.indexOf('=')
6
- if (eq < 0) return value
7
- const scheme = value.indexOf('://')
8
- // '=' appearing only inside a URL (…?token=x) is one global source, not pairs
9
- if (scheme >= 0 && scheme < eq) return value
10
- const map = {}
11
- let key = null
12
- for (const segment of value.split(',')) {
13
- const i = segment.indexOf('=')
14
- if (i > 0) {
15
- key = segment.slice(0, i).trim()
16
- map[key] = segment.slice(i + 1).trim()
17
- } else if (key) {
18
- // no '=' means the comma belonged to the previous value (a url like
19
- // …?token=a,b); a comma followed by k=v stays ambiguous and unsupported
20
- map[key] += ',' + segment.trim()
21
- }
22
- }
23
- return map
24
- }