@qvac/core 0.4.1 → 0.6.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/CHANGELOG.md +262 -1
- package/README.md +1 -1
- package/dist-lib/lib/api/agents.js +3 -2
- package/dist-lib/lib/api/app-config.d.ts +1 -1
- package/dist-lib/lib/api/app-config.js +54 -15
- package/dist-lib/lib/api/attachments.d.ts +6 -5
- package/dist-lib/lib/api/attachments.js +4 -2
- package/dist-lib/lib/api/chat.d.ts +7 -3
- package/dist-lib/lib/api/chat.js +4 -4
- package/dist-lib/lib/api/chunks.js +3 -3
- package/dist-lib/lib/api/config.js +2 -2
- package/dist-lib/lib/api/current-mesh.d.ts +3 -4
- package/dist-lib/lib/api/current-mesh.js +9 -4
- package/dist-lib/lib/api/custom-models.d.ts +8 -1
- package/dist-lib/lib/api/custom-models.js +53 -16
- package/dist-lib/lib/api/devices.d.ts +14 -5
- package/dist-lib/lib/api/devices.js +14 -9
- package/dist-lib/lib/api/diagnostics.d.ts +1 -0
- package/dist-lib/lib/api/diagnostics.js +1 -1
- package/dist-lib/lib/api/effective-ctx-size.d.ts +6 -1
- package/dist-lib/lib/api/effective-ctx-size.js +5 -3
- package/dist-lib/lib/api/execution.js +9 -2
- package/dist-lib/lib/api/files.js +2 -1
- package/dist-lib/lib/api/index.d.ts +7 -1
- package/dist-lib/lib/api/index.js +101 -101
- package/dist-lib/lib/api/instrument.js +29 -20
- package/dist-lib/lib/api/knowledge.d.ts +6 -5
- package/dist-lib/lib/api/knowledge.js +8 -6
- package/dist-lib/lib/api/local-files.js +1 -1
- package/dist-lib/lib/api/logs.js +6 -3
- package/dist-lib/lib/api/members.js +22 -13
- package/dist-lib/lib/api/mesh.d.ts +7 -2
- package/dist-lib/lib/api/mesh.js +10 -5
- package/dist-lib/lib/api/model-download.js +1 -1
- package/dist-lib/lib/api/network.d.ts +1 -0
- package/dist-lib/lib/api/network.js +1 -1
- package/dist-lib/lib/api/notifications.js +23 -13
- package/dist-lib/lib/api/rag.d.ts +6 -1
- package/dist-lib/lib/api/rag.js +20 -11
- package/dist-lib/lib/api/range.d.ts +2 -2
- package/dist-lib/lib/api/sync.js +1 -1
- package/dist-lib/lib/api/tool-activity.js +7 -3
- package/dist-lib/lib/api/tool-configs.js +2 -4
- package/dist-lib/lib/api/upload-frames.d.ts +7 -8
- package/dist-lib/lib/api/upload-frames.js +2 -1
- package/dist-lib/lib/api/watchable.d.ts +6 -1
- package/dist-lib/lib/api/watchable.js +23 -14
- package/dist-lib/lib/assistant/fetch-body.js +4 -2
- package/dist-lib/lib/assistant/harness.d.ts +72 -24
- package/dist-lib/lib/assistant/harness.js +53 -15
- package/dist-lib/lib/assistant/history.d.ts +9 -7
- package/dist-lib/lib/assistant/history.js +77 -42
- package/dist-lib/lib/assistant/message.d.ts +5 -3
- package/dist-lib/lib/assistant/message.js +4 -2
- package/dist-lib/lib/assistant/skill-encode.d.ts +3 -1
- package/dist-lib/lib/assistant/skill-encode.js +52 -62
- package/dist-lib/lib/assistant-client.js +7 -4
- package/dist-lib/lib/assistant-tree.js +36 -11
- package/dist-lib/lib/assistant.d.ts +37 -12
- package/dist-lib/lib/assistant.js +977 -373
- package/dist-lib/lib/audio-format.d.ts +1 -1
- package/dist-lib/lib/audio-format.js +1 -1
- package/dist-lib/lib/chat-title.js +9 -4
- package/dist-lib/lib/client.js +3 -2
- package/dist-lib/lib/collabora/convert.d.ts +2 -2
- package/dist-lib/lib/collabora/convert.js +6 -3
- package/dist-lib/lib/collabora/entry.js +9 -5
- package/dist-lib/lib/collabora/protocol.d.ts +2 -2
- package/dist-lib/lib/collabora/protocol.js +14 -7
- package/dist-lib/lib/collabora/worker.js +14 -7
- package/dist-lib/lib/compaction.d.ts +5 -6
- package/dist-lib/lib/compaction.js +14 -7
- package/dist-lib/lib/constants.d.ts +2 -0
- package/dist-lib/lib/constants.js +4 -0
- package/dist-lib/lib/core/account-recovery.d.ts +4 -3
- package/dist-lib/lib/core/account-recovery.js +7 -4
- package/dist-lib/lib/core/agent.d.ts +0 -1
- package/dist-lib/lib/core/agent.js +18 -16
- package/dist-lib/lib/core/approval-rules.d.ts +7 -6
- package/dist-lib/lib/core/approval-rules.js +12 -6
- package/dist-lib/lib/core/archived-mesh.d.ts +7 -5
- package/dist-lib/lib/core/archived-mesh.js +25 -22
- package/dist-lib/lib/core/async-iterable.js +10 -5
- package/dist-lib/lib/core/attachment-link.d.ts +2 -2
- package/dist-lib/lib/core/audio-attachment.js +1 -1
- package/dist-lib/lib/core/blind-peers.d.ts +2 -2
- package/dist-lib/lib/core/chat-activity.d.ts +2 -2
- package/dist-lib/lib/core/chat-activity.js +42 -21
- package/dist-lib/lib/core/chat-group.d.ts +8 -6
- package/dist-lib/lib/core/chat-group.js +17 -10
- package/dist-lib/lib/core/chat-order.d.ts +11 -9
- package/dist-lib/lib/core/chat-order.js +1 -3
- package/dist-lib/lib/core/chat-search.d.ts +4 -4
- package/dist-lib/lib/core/chat-search.js +38 -24
- package/dist-lib/lib/core/chat.d.ts +20 -14
- package/dist-lib/lib/core/chat.js +42 -28
- package/dist-lib/lib/core/chunk.d.ts +20 -24
- package/dist-lib/lib/core/chunk.js +34 -22
- package/dist-lib/lib/core/collections.d.ts +69 -0
- package/dist-lib/lib/core/collections.js +69 -0
- package/dist-lib/lib/core/contract/activity.d.ts +8 -2
- package/dist-lib/lib/core/contract/activity.js +39 -11
- package/dist-lib/lib/core/contract/agents.js +3 -2
- package/dist-lib/lib/core/contract/approval-rules.js +1 -1
- package/dist-lib/lib/core/contract/attestations.js +1 -1
- package/dist-lib/lib/core/contract/chat-group.js +1 -1
- package/dist-lib/lib/core/contract/chat.js +1 -1
- package/dist-lib/lib/core/contract/chunks.js +16 -9
- package/dist-lib/lib/core/contract/compute.js +2 -1
- package/dist-lib/lib/core/contract/devices.js +10 -6
- package/dist-lib/lib/core/contract/grant-order.d.ts +5 -0
- package/dist-lib/lib/core/contract/grant-order.js +20 -0
- package/dist-lib/lib/core/contract/index.d.ts +1 -1
- package/dist-lib/lib/core/contract/index.js +27 -2
- package/dist-lib/lib/core/contract/indexing.js +3 -3
- package/dist-lib/lib/core/contract/invites.d.ts +16 -0
- package/dist-lib/lib/core/contract/invites.js +256 -0
- package/dist-lib/lib/core/contract/joined-meshes.js +22 -22
- package/dist-lib/lib/core/contract/knowledge.js +5 -5
- package/dist-lib/lib/core/contract/members.d.ts +15 -0
- package/dist-lib/lib/core/contract/members.js +116 -31
- package/dist-lib/lib/core/contract/mesh-kind.d.ts +6 -0
- package/dist-lib/lib/core/contract/mesh-kind.js +49 -0
- package/dist-lib/lib/core/contract/seal.js +1 -1
- package/dist-lib/lib/core/contract/seed-defaults.js +1 -3
- package/dist-lib/lib/core/contract/tool-activity.js +5 -5
- package/dist-lib/lib/core/contract/tool-configs.js +1 -2
- package/dist-lib/lib/core/contract/writers.d.ts +13 -0
- package/dist-lib/lib/core/contract/writers.js +181 -24
- package/dist-lib/lib/core/departures.js +16 -8
- package/dist-lib/lib/core/device-attestation.d.ts +5 -0
- package/dist-lib/lib/core/device-attestation.js +24 -0
- package/dist-lib/lib/core/device-invites.d.ts +2 -0
- package/dist-lib/lib/core/device-invites.js +29 -7
- package/dist-lib/lib/core/devices.d.ts +2 -1
- package/dist-lib/lib/core/devices.js +52 -2
- package/dist-lib/lib/core/document-attachment.d.ts +20 -11
- package/dist-lib/lib/core/document-attachment.js +10 -5
- package/dist-lib/lib/core/files/attachments.d.ts +2 -5
- package/dist-lib/lib/core/files/attachments.js +6 -3
- package/dist-lib/lib/core/files/index.d.ts +44 -52
- package/dist-lib/lib/core/files/index.js +142 -93
- package/dist-lib/lib/core/files/knowledge.d.ts +2 -5
- package/dist-lib/lib/core/files/local-index.js +9 -5
- package/dist-lib/lib/core/files/preview/image.d.ts +0 -1
- package/dist-lib/lib/core/files/preview/image.js +9 -6
- package/dist-lib/lib/core/files/preview/index.d.ts +8 -11
- package/dist-lib/lib/core/files/preview/index.js +20 -15
- package/dist-lib/lib/core/files/processing/claims.d.ts +6 -5
- package/dist-lib/lib/core/files/processing/claims.js +16 -8
- package/dist-lib/lib/core/files/processing/document.d.ts +21 -50
- package/dist-lib/lib/core/files/processing/index.d.ts +18 -13
- package/dist-lib/lib/core/files/processing/index.js +65 -37
- package/dist-lib/lib/core/files/processing/ownership.d.ts +8 -1
- package/dist-lib/lib/core/files/processing/ownership.js +1 -1
- package/dist-lib/lib/core/files/processing/protocol.d.ts +19 -19
- package/dist-lib/lib/core/files/processing/protocol.js +5 -5
- package/dist-lib/lib/core/files/processing/settle.d.ts +10 -7
- package/dist-lib/lib/core/files/processing/settle.js +22 -11
- package/dist-lib/lib/core/files/processing/source.js +14 -8
- package/dist-lib/lib/core/files/processing/state.d.ts +13 -11
- package/dist-lib/lib/core/files/processing/state.js +19 -12
- package/dist-lib/lib/core/files/rag/build.d.ts +2 -2
- package/dist-lib/lib/core/files/rag/build.js +2 -1
- package/dist-lib/lib/core/files/rag/document-types.d.ts +4 -6
- package/dist-lib/lib/core/files/rag/index.d.ts +10 -13
- package/dist-lib/lib/core/files/rag/index.js +3 -2
- package/dist-lib/lib/core/files/rag/load.d.ts +10 -9
- package/dist-lib/lib/core/files/rag/load.js +26 -13
- package/dist-lib/lib/core/files/rag/policy.js +2 -1
- package/dist-lib/lib/core/files/rag/produce.js +33 -19
- package/dist-lib/lib/core/files/rag/retrieval/full-text.d.ts +5 -3
- package/dist-lib/lib/core/files/rag/retrieval/full-text.js +30 -10
- package/dist-lib/lib/core/files/records/chunks.js +4 -2
- package/dist-lib/lib/core/files/records/knowledge.d.ts +10 -11
- package/dist-lib/lib/core/files/records/knowledge.js +9 -8
- package/dist-lib/lib/core/files/records/linkage.js +6 -3
- package/dist-lib/lib/core/files/records/output.d.ts +5 -4
- package/dist-lib/lib/core/files/records/output.js +8 -4
- package/dist-lib/lib/core/files/records/reclaim.js +41 -25
- package/dist-lib/lib/core/files/records/routing.d.ts +4 -6
- package/dist-lib/lib/core/files/records/routing.js +15 -8
- package/dist-lib/lib/core/files/records/source.d.ts +5 -4
- package/dist-lib/lib/core/files/records/source.js +20 -14
- package/dist-lib/lib/core/files/records/sweep.js +1 -3
- package/dist-lib/lib/core/files/store/blob.d.ts +10 -10
- package/dist-lib/lib/core/files/store/blob.js +25 -19
- package/dist-lib/lib/core/files/store/index.d.ts +1 -6
- package/dist-lib/lib/core/files/store/index.js +4 -4
- package/dist-lib/lib/core/files/store/inline.d.ts +2 -2
- package/dist-lib/lib/core/files/store/inline.js +6 -3
- package/dist-lib/lib/core/files/store/reference.d.ts +6 -9
- package/dist-lib/lib/core/files/store/reference.js +25 -17
- package/dist-lib/lib/core/files/store/server.d.ts +7 -6
- package/dist-lib/lib/core/files/store/server.js +22 -11
- package/dist-lib/lib/core/files/store/sweep.js +13 -7
- package/dist-lib/lib/core/files/upload-input.d.ts +4 -12
- package/dist-lib/lib/core/files/upload-input.js +10 -5
- package/dist-lib/lib/core/files/upload.d.ts +27 -24
- package/dist-lib/lib/core/files/upload.js +74 -51
- package/dist-lib/lib/core/fs-drives.js +4 -2
- package/dist-lib/lib/core/grant-expiry.d.ts +11 -0
- package/dist-lib/lib/core/grant-expiry.js +66 -0
- package/dist-lib/lib/core/handoff-channel.d.ts +2 -1
- package/dist-lib/lib/core/handoff-channel.js +36 -15
- package/dist-lib/lib/core/harness-loan.js +35 -17
- package/dist-lib/lib/core/helpers/index.d.ts +2 -1
- package/dist-lib/lib/core/helpers/index.js +11 -6
- package/dist-lib/lib/core/hosted-agents.js +19 -12
- package/dist-lib/lib/core/id.js +1 -1
- package/dist-lib/lib/core/identity.d.ts +1 -0
- package/dist-lib/lib/core/identity.js +11 -3
- package/dist-lib/lib/core/image/cache-sweep.d.ts +12 -10
- package/dist-lib/lib/core/image/cache-sweep.js +11 -6
- package/dist-lib/lib/core/image/normalize.d.ts +6 -0
- package/dist-lib/lib/core/image/normalize.js +12 -2
- package/dist-lib/lib/core/image/sniff.js +42 -21
- package/dist-lib/lib/core/inference-calls-receiver.js +7 -4
- package/dist-lib/lib/core/invite-grants.d.ts +20 -0
- package/dist-lib/lib/core/invite-grants.js +46 -0
- package/dist-lib/lib/core/invite.d.ts +3 -0
- package/dist-lib/lib/core/invite.js +6 -3
- package/dist-lib/lib/core/local/files.js +20 -19
- package/dist-lib/lib/core/local/index.d.ts +70 -45
- package/dist-lib/lib/core/local/index.js +157 -126
- package/dist-lib/lib/core/membership.d.ts +15 -2
- package/dist-lib/lib/core/membership.js +95 -20
- package/dist-lib/lib/core/mesh-seed-handoff.d.ts +12 -4
- package/dist-lib/lib/core/mesh-seed-handoff.js +23 -5
- package/dist-lib/lib/core/mesh.d.ts +57 -30
- package/dist-lib/lib/core/mesh.js +232 -78
- package/dist-lib/lib/core/migrations/agent-catalog.js +3 -2
- package/dist-lib/lib/core/migrations/agent-indexes.js +3 -3
- package/dist-lib/lib/core/migrations/device-indexes.d.ts +2 -0
- package/dist-lib/lib/core/migrations/device-indexes.js +7 -0
- package/dist-lib/lib/core/migrations/file-index.js +7 -4
- package/dist-lib/lib/core/migrations/index.d.ts +4 -3
- package/dist-lib/lib/core/migrations/index.js +3 -1
- package/dist-lib/lib/core/migrations/membership.js +9 -4
- package/dist-lib/lib/core/migrations/seal.js +3 -2
- package/dist-lib/lib/core/min-version.js +4 -2
- package/dist-lib/lib/core/next-frame.d.ts +5 -4
- package/dist-lib/lib/core/next-frame.js +6 -3
- package/dist-lib/lib/core/notification.d.ts +5 -1
- package/dist-lib/lib/core/notification.js +89 -77
- package/dist-lib/lib/core/ota-config.js +2 -1
- package/dist-lib/lib/core/pdf/rasterize.d.ts +18 -0
- package/dist-lib/lib/core/pdf/rasterize.js +57 -0
- package/dist-lib/lib/core/prompt-history.js +4 -2
- package/dist-lib/lib/core/range.d.ts +4 -4
- package/dist-lib/lib/core/range.js +12 -6
- package/dist-lib/lib/core/rank.d.ts +5 -4
- package/dist-lib/lib/core/rank.js +2 -1
- package/dist-lib/lib/core/send.d.ts +8 -5
- package/dist-lib/lib/core/send.js +9 -3
- package/dist-lib/lib/core/skill-overlay-receiver.js +7 -4
- package/dist-lib/lib/core/skill-secrets.js +16 -9
- package/dist-lib/lib/core/sync/chunks.js +2 -1
- package/dist-lib/lib/core/sync/devices.js +3 -1
- package/dist-lib/lib/core/sync/files.d.ts +2 -4
- package/dist-lib/lib/core/sync/files.js +28 -20
- package/dist-lib/lib/core/sync/index.d.ts +2 -5
- package/dist-lib/lib/core/sync/index.js +33 -17
- package/dist-lib/lib/core/sync-status.js +10 -7
- package/dist-lib/lib/core/system-info.js +4 -2
- package/dist-lib/lib/core/tool-activity.d.ts +4 -3
- package/dist-lib/lib/core/tool-activity.js +1 -1
- package/dist-lib/lib/core/tool-configs.js +12 -7
- package/dist-lib/lib/core.d.ts +107 -45
- package/dist-lib/lib/core.js +1765 -595
- package/dist-lib/lib/credential-pusher.d.ts +12 -17
- package/dist-lib/lib/credential-pusher.js +61 -42
- package/dist-lib/lib/custom-model-pusher.d.ts +7 -3
- package/dist-lib/lib/custom-model-pusher.js +15 -7
- package/dist-lib/lib/custom-model-task.d.ts +1 -0
- package/dist-lib/lib/custom-model-task.js +12 -0
- package/dist-lib/lib/deadline.js +4 -2
- package/dist-lib/lib/diagnostics.d.ts +1 -5
- package/dist-lib/lib/frame-readable.d.ts +3 -0
- package/dist-lib/lib/frame-readable.js +3 -0
- package/dist-lib/lib/fs-drive-bridge.js +24 -14
- package/dist-lib/lib/fs-grants.js +13 -8
- package/dist-lib/lib/guards.d.ts +3 -0
- package/dist-lib/lib/guards.js +9 -0
- package/dist-lib/lib/inference-calls.d.ts +28 -23
- package/dist-lib/lib/inference-calls.js +25 -13
- package/dist-lib/lib/integrations/mcp-providers.d.ts +2 -2
- package/dist-lib/lib/integrations/setup-routes.d.ts +2 -2
- package/dist-lib/lib/knowledge-search.d.ts +6 -5
- package/dist-lib/lib/knowledge-search.js +26 -18
- package/dist-lib/lib/kv-cache-reclaim.js +4 -2
- package/dist-lib/lib/kv-cache.js +8 -4
- package/dist-lib/lib/legacy-core-domain.d.ts +42 -42
- package/dist-lib/lib/log-buffer.js +2 -1
- package/dist-lib/lib/log.js +25 -15
- package/dist-lib/lib/mesh-scoped-engine.js +14 -4
- package/dist-lib/lib/model-catalog-revision.js +6 -3
- package/dist-lib/lib/model-clamp.js +6 -3
- package/dist-lib/lib/model-context.d.ts +8 -3
- package/dist-lib/lib/model-context.js +13 -5
- package/dist-lib/lib/model-download-status.js +4 -2
- package/dist-lib/lib/model-download.d.ts +12 -4
- package/dist-lib/lib/model-download.js +200 -103
- package/dist-lib/lib/model-idle-pusher.d.ts +10 -0
- package/dist-lib/lib/model-idle-pusher.js +41 -0
- package/dist-lib/lib/oauth/browser-connect.d.ts +10 -8
- package/dist-lib/lib/oauth/browser-connect.js +33 -20
- package/dist-lib/lib/oauth/client.d.ts +2 -2
- package/dist-lib/lib/oauth/flow-core.js +23 -9
- package/dist-lib/lib/oauth/flow.d.ts +1 -3
- package/dist-lib/lib/oauth/flow.js +9 -5
- package/dist-lib/lib/oauth/keys.d.ts +4 -4
- package/dist-lib/lib/oauth/keys.js +18 -12
- package/dist-lib/lib/oauth/loopback.d.ts +2 -2
- package/dist-lib/lib/oauth/loopback.js +147 -107
- package/dist-lib/lib/oauth/loopback.stub.d.ts +2 -2
- package/dist-lib/lib/oauth/loopback.stub.js +1 -1
- package/dist-lib/lib/oauth/pkce.d.ts +4 -2
- package/dist-lib/lib/oauth/pkce.js +10 -0
- package/dist-lib/lib/oauth/providers.js +5 -5
- package/dist-lib/lib/oauth/redirect-types.d.ts +12 -7
- package/dist-lib/lib/oauth/register.js +3 -2
- package/dist-lib/lib/oauth/registry.d.ts +2 -2
- package/dist-lib/lib/oauth/registry.js +2 -1
- package/dist-lib/lib/oauth/resolve.d.ts +30 -10
- package/dist-lib/lib/oauth/resolve.js +12 -6
- package/dist-lib/lib/oauth/token-exchange-core.d.ts +12 -4
- package/dist-lib/lib/oauth/token-exchange-core.js +1 -1
- package/dist-lib/lib/oauth/types.d.ts +12 -12
- package/dist-lib/lib/oauth.d.ts +4 -5
- package/dist-lib/lib/oauth.js +2 -3
- package/dist-lib/lib/reconnecting-watch.d.ts +1 -1
- package/dist-lib/lib/reconnecting-watch.js +6 -6
- package/dist-lib/lib/retry-budget.js +6 -3
- package/dist-lib/lib/run-notices.d.ts +2 -0
- package/dist-lib/lib/run-notices.js +7 -3
- package/dist-lib/lib/run-transcript.d.ts +2 -4
- package/dist-lib/lib/run-transcript.js +4 -2
- package/dist-lib/lib/skill-readiness.d.ts +1 -0
- package/dist-lib/lib/skill-readiness.js +17 -2
- package/dist-lib/lib/skill-types.d.ts +16 -16
- package/dist-lib/lib/suspend-lifecycle.d.ts +4 -4
- package/dist-lib/lib/suspend-lifecycle.js +10 -5
- package/dist-lib/lib/task.d.ts +5 -1
- package/dist-lib/lib/task.js +29 -12
- package/dist-lib/lib/unref.d.ts +3 -2
- package/dist-lib/lib/unref.js +2 -1
- package/dist-lib/lib/wav-duration.js +10 -5
- package/dist-lib/lib/write-queue.d.ts +5 -4
- package/dist-lib/lib/write-queue.js +2 -1
- package/dist-lib/schema/build.js +16 -8
- package/dist-lib/schema/config.d.ts +3 -4
- package/dist-lib/schema/config.js +1 -1
- package/dist-lib/schema/content.d.ts +18 -2
- package/dist-lib/schema/content.js +4 -1
- package/dist-lib/schema/engine.d.ts +3 -2
- package/dist-lib/schema/engine.js +192 -12
- package/dist-lib/schema/field-order.js +22 -11
- package/dist-lib/schema/indexes.d.ts +22 -0
- package/dist-lib/schema/{helpers.js → indexes.js} +19 -57
- package/dist-lib/schema/local.d.ts +3 -2
- package/dist-lib/schema/local.js +9 -3
- package/dist-lib/schema/media-kind.d.ts +8 -0
- package/dist-lib/schema/media-kind.js +52 -0
- package/dist-lib/schema/qvac.d.ts +12 -9
- package/dist-lib/schema/qvac.js +132 -7
- package/dist-lib/spec/bind.js +21 -0
- package/dist-lib/spec/calls.js +7 -0
- package/dist-lib/spec/capabilities.d.ts +18 -4
- package/dist-lib/spec/config/hyperconf/index.js +1 -1
- package/dist-lib/spec/hrpc/hrpc.json +93 -2
- package/dist-lib/spec/hrpc/index.js +89 -5
- package/dist-lib/spec/hrpc/messages.js +1568 -941
- package/dist-lib/spec/hyperschema/index.js +1568 -941
- package/dist-lib/spec/hyperschema/schema.json +531 -1
- package/dist-lib/spec/hyperschema/types.d.ts +145 -1
- package/dist-lib/spec/local/hyperdb/index.js +1 -1
- package/dist-lib/spec/local/hyperdb/messages.js +92 -20
- package/dist-lib/spec/local/hyperschema/index.js +47 -11
- package/dist-lib/spec/local/hyperschema/schema.json +32 -1
- package/dist-lib/spec/local/hyperschema/types.d.ts +7 -1
- package/dist-lib/spec/mesh/hyperdb/db.json +131 -3
- package/dist-lib/spec/mesh/hyperdb/index.js +548 -5
- package/dist-lib/spec/mesh/hyperdb/messages.js +2444 -893
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +37 -1
- package/dist-lib/spec/mesh/hyperdispatch/index.js +104 -2
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +1035 -11
- package/dist-lib/spec/mesh/hyperschema/index.js +1035 -11
- package/dist-lib/spec/mesh/hyperschema/schema.json +553 -1
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +143 -1
- package/package.json +11 -5
- package/tui/app.mjs +2624 -986
- package/tui/boot.mjs +17 -46
- package/tui/index.mjs +10 -5
- package/tui/lib/boot-timing.mjs +8 -8
- package/tui/lib/busy-words.mjs +21 -22
- package/tui/lib/export.mjs +100 -32
- package/tui/lib/knowledge-command.mjs +64 -19
- package/tui/lib/knowledge-import.mjs +52 -18
- package/tui/lib/render.mjs +65 -33
- package/tui/lib/save-file.mjs +30 -13
- package/tui/lib/select.mjs +23 -5
- package/tui/lib/selection.mjs +6 -4
- package/tui/lib/setup.mjs +11 -19
- package/tui/lib/sidebar.mjs +23 -13
- package/tui/lib/splash.mjs +6 -7
- package/tui/lib/upload-frames.mjs +1 -2
- package/tui/lib/usage.mjs +13 -9
- package/tui/lib/wrap.mjs +35 -6
- package/tui/main.mjs +54 -78
- package/worker/assistant-sidecar.mjs +5 -10
- package/worker/stow-entry.mjs +7 -4
- package/dist-lib/lib/custom-model-source.d.ts +0 -15
- package/dist-lib/lib/custom-model-source.js +0 -46
- package/dist-lib/lib/oauth/common.d.ts +0 -38
- package/dist-lib/lib/oauth/common.js +0 -34
- package/dist-lib/schema/helpers.d.ts +0 -32
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,219 @@ release.
|
|
|
13
13
|
|
|
14
14
|
## [Unreleased]
|
|
15
15
|
|
|
16
|
+
## [0.6.0] - 2026-09-28
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Loading and unloading a model by hand, for a Models screen. `loadModel` loads
|
|
21
|
+
a downloaded model under the settings of the agent on this device that runs
|
|
22
|
+
it, so that agent's next reply finds it loaded; it never downloads, and returns
|
|
23
|
+
`loaded: false` with `reason: 'memory'` when it would not fit beside what is
|
|
24
|
+
loaded. Chat models loaded this way stay loaded side by side. `unloadModel`
|
|
25
|
+
puts a reply this device is generating with the model back in the queue, and it
|
|
26
|
+
completes once the model has been loaded again. Both bump `modelCatalogWatch`,
|
|
27
|
+
and `isLoaded` in `listModels` is right for chat, embedding, speech and
|
|
28
|
+
transcription models. A harness older than `@qvac/harness` 0.6 refuses both.
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
const { loaded, reason } = await engine.loadModel({ name: 'Qwen3.5-4B-Q4_K_M' })
|
|
32
|
+
await engine.unloadModel({ name: 'Qwen3.5-4B-Q4_K_M' })
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
(#242)
|
|
36
|
+
|
|
37
|
+
- `previewCustomModel` checks a link or path through the harness before
|
|
38
|
+
anything is added, and returns the resolved link, size, context window,
|
|
39
|
+
architecture, size label, task type, license and fit, a file list for a
|
|
40
|
+
repository with several weights, or a refusal with its reason.
|
|
41
|
+
`customModelsWatch` rows carry `contextLength`, `taskType`, `license` and
|
|
42
|
+
`label`. (#215)
|
|
43
|
+
- An attached PDF's scanned, figure and text-less pages reach a vision model as
|
|
44
|
+
images, at most 10 per message, alongside the PDF as a document. A PDF whose
|
|
45
|
+
pages rendered is no longer reported as unread. Core now depends on
|
|
46
|
+
`bare-pdfium`. (#94)
|
|
47
|
+
- `setModelReleased({ name, released })` and `releasedModels` on the app
|
|
48
|
+
config: the models this device does not fetch ahead of need. (#189)
|
|
49
|
+
|
|
50
|
+
### Changed
|
|
51
|
+
|
|
52
|
+
- A custom model is named by an id derived from its file (`custom:…`), not by
|
|
53
|
+
what the caller typed. `addCustomModel` takes a `label` in place of `name` and
|
|
54
|
+
returns `{ id }`, and `removeCustomModel`, `deleteModel` and an agent's
|
|
55
|
+
`modelName` take that id. `addCustomModel` runs the preview first and rejects
|
|
56
|
+
a refused source, a multi-weight repository or a model that is not a text
|
|
57
|
+
model, storing nothing; with no harness that can preview, it rejects.
|
|
58
|
+
`removeCustomModel` also frees the downloaded copy and answers with the
|
|
59
|
+
`deleteModel` summary in place of `{ ok }`. Needs `@qvac/harness` 0.6. See
|
|
60
|
+
[custom models](docs/api/custom-models.md). (#215)
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
// 0.5.0
|
|
64
|
+
await engine.addCustomModel({ name: 'Qwen3 small', src })
|
|
65
|
+
await engine.removeCustomModel({ name: 'Qwen3 small' })
|
|
66
|
+
// 0.6.0
|
|
67
|
+
const { id } = await engine.addCustomModel({ label: 'Qwen3 small', src })
|
|
68
|
+
await engine.removeCustomModel({ name: id })
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- `deleteModel` no longer has the model downloaded again straight away. It
|
|
72
|
+
stops an in-flight transfer and releases the model, which is fetched again
|
|
73
|
+
only when a run needs it or on `retryModelDownload`. (#189)
|
|
74
|
+
- `@qvac/harness` 0.6.0, with `@qvac/inference` 0.20.0. (#215)
|
|
75
|
+
- For a host embedding Core, `startOAuthLoopback` is now
|
|
76
|
+
`openOAuthLoopback(port, { credentialKey, state })`, and `waitForCode` no
|
|
77
|
+
longer takes the state. One server per fixed port is shared by every flow
|
|
78
|
+
redirecting to it. (#181)
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
|
|
82
|
+
- Two OAuth flows landing on the same loopback port superseded each other, so
|
|
83
|
+
sibling skills of one provider could not connect at the same time. A callback
|
|
84
|
+
is now routed to the flow whose `state` it carries. (#181)
|
|
85
|
+
- `networkWatch` and `diagnosticsWatch` logged two churn lines a second on an
|
|
86
|
+
idle device. A sampled watch that wakes with the same answer is no longer
|
|
87
|
+
counted as churn, and a real burst is reported once per window. (#145)
|
|
88
|
+
|
|
89
|
+
## [0.5.0] - 2026-09-26
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
|
|
93
|
+
- "Free up memory when idle" reaches the harness. A device's choice lives under
|
|
94
|
+
the device-local config key `model.idleUnloadMinutes` (`MODEL_IDLE_UNLOAD_KEY`
|
|
95
|
+
from `@qvac/core/constants`), as one of `MODEL_IDLE_UNLOAD_MINUTES`: 15, 30,
|
|
96
|
+
60, 120, 240, 480, 720 or 1440. The assistant pushes it to the harness as
|
|
97
|
+
`setModelIdleTimeout`, which unloads every idle model once the device has had
|
|
98
|
+
no request for that long. An absent key, `0` or any other value is Never,
|
|
99
|
+
today's behaviour. A harness older than `@qvac/harness` 0.5 ignores it. (#241)
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
await engine.configSet({ key: MODEL_IDLE_UNLOAD_KEY, value: 30 })
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- `previewMeshInvite` reads whether an invite adds a device to an existing
|
|
106
|
+
member or mints a new person, without joining. A device invite now carries
|
|
107
|
+
`inviterName`, the minting member's display name, which the preview returns.
|
|
108
|
+
An invite that does not decode is refused with `Invalid mesh invite`. (#194)
|
|
109
|
+
|
|
110
|
+
- `createMesh` mints a shared mesh, optionally a compute one. It takes
|
|
111
|
+
`{ config: { compute } }`, typed `AssistantMeshConfig`, and returns
|
|
112
|
+
`{ meshId }`, as `createRoom` did. (#198)
|
|
113
|
+
|
|
114
|
+
```js
|
|
115
|
+
const { meshId } = await engine.createMesh({})
|
|
116
|
+
const compute = await engine.createMesh({ config: { compute: true } })
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
- A run can invoke a harness capability without loading a model. `runAgent`,
|
|
120
|
+
`sendMessage` and `runTask` take `capability`, `capabilityArgs` and
|
|
121
|
+
`enhance` (`never`, the default, or `auto`). The run is claimed, stopped and
|
|
122
|
+
reports progress like any other, and a capability the executing device's
|
|
123
|
+
harness does not know fails the run with a notice. `runTask` returns
|
|
124
|
+
`metrics`. See `examples/mesh-capability-run.mjs`. (#162)
|
|
125
|
+
- `detectLanguage`: the language a piece of text is in, ranked. Device-local
|
|
126
|
+
and synchronous; the classifier ships in the harness bundle, so it needs no
|
|
127
|
+
model. (#162)
|
|
128
|
+
- `meshEntry.reason` and `meshEntry.awaitingFrom`: a mesh this device was never
|
|
129
|
+
admitted to reports `awaiting-admission` and names the one device that can
|
|
130
|
+
admit it. (#174)
|
|
131
|
+
|
|
132
|
+
### Changed
|
|
133
|
+
|
|
134
|
+
- The consensus floor, `VENDORED_MIN_SUPPORTED_VERSION`, is `>=0.19.0`. This
|
|
135
|
+
release sends dispatch routes 28 to 37, which app 0.18.x (`@qvac/core` 0.1.x)
|
|
136
|
+
cannot route, and a device that cannot route an op halts apply. Route 34
|
|
137
|
+
writes the account seal on its first settle, so an un-upgraded device of that
|
|
138
|
+
account halts at once. Ship the 0.19 app before publishing this floor to the
|
|
139
|
+
lane cores. A host embedding this release that reports an app version below
|
|
140
|
+
0.19.0 is withheld from its meshes as needing an upgrade; a prerelease such as
|
|
141
|
+
`0.19.0-dev` counts as 0.19.0, and a host that reports none is not gated.
|
|
142
|
+
(#196)
|
|
143
|
+
- A shared mesh admits a writer only through an invite grant or a live
|
|
144
|
+
device's vouch. `meshInvite` with `member: true` puts a single-use grant
|
|
145
|
+
behind the link that expires after 48 hours, and every call mints a fresh
|
|
146
|
+
one, so each person needs their own link. An invite minted before grants
|
|
147
|
+
leaves the joiner a reader, and `joinMesh` fails after 60 seconds.
|
|
148
|
+
(#171, #199, #225)
|
|
149
|
+
- `joinMesh` fails with `This invite was revoked`, `This invite has expired` or
|
|
150
|
+
`This invite has already been used` when the device can already see why, and
|
|
151
|
+
a member or device invite join that is not admitted within 60 seconds fails
|
|
152
|
+
instead of waiting forever. Only `recoverAccount` still waits unbounded.
|
|
153
|
+
(#171, #229)
|
|
154
|
+
- A device invite expires after 48 hours, a device keeps at most five
|
|
155
|
+
outstanding, and one minted before this release no longer redeems. The
|
|
156
|
+
joining device no longer appends its own join: it sends a signed claim to the
|
|
157
|
+
inviting device, which writes the admission. The link format is unchanged.
|
|
158
|
+
(#229)
|
|
159
|
+
- An account is sealed the first time a device on this release settles it, and
|
|
160
|
+
from then on refuses the bare seed `@qvac/join`, invite grants and
|
|
161
|
+
`@qvac/add-writer`: pairing and `recoverAccount` are the only ways in.
|
|
162
|
+
Booting with another account's `meshSeed` and `meshKey` leaves the device a
|
|
163
|
+
reader, with a `meshStatusWatch` error saying to pair it with a device
|
|
164
|
+
invite. A host that boots every device on one configured `meshSeed` is
|
|
165
|
+
unaffected until it pairs a device in. (#229)
|
|
166
|
+
- `recoverAccount` joins through `@qvac/recover-device`, on a proof the
|
|
167
|
+
phrase's identity signs, and is refused in a shared mesh and for a device
|
|
168
|
+
another writer removed. `publishAccountRecovery` refuses a phrase that names
|
|
169
|
+
no member of the account. (#200, #225)
|
|
170
|
+
- A shared mesh takes its member from the account, so every device of one
|
|
171
|
+
person is the same member in it. `createMesh`, and a member `meshInvite` that
|
|
172
|
+
mints the shared mesh, refuse with "This device is not part of its account
|
|
173
|
+
yet" until the account row names that member. A sibling that follows a
|
|
174
|
+
shared mesh opens it read-only until a live device of the same member admits
|
|
175
|
+
it. A shared mesh refuses `@qvac/join-member` and a self-signed
|
|
176
|
+
`@qvac/attest-member-device`, so a member link there comes only with
|
|
177
|
+
admission. (#174, #226, #227)
|
|
178
|
+
- A shared mesh starts with no agent and no chat, both when it is created and
|
|
179
|
+
when a member joins. Read `agents` after a join as possibly empty rather than
|
|
180
|
+
taking `agents[0]`. The account still starts with its default agent and a
|
|
181
|
+
first chat. (#188)
|
|
182
|
+
- A device's build and inventory go only to its own account. In a shared mesh
|
|
183
|
+
`appVersion`, `appBuild` and `appChannel` are withheld, the installed and
|
|
184
|
+
cached inventory is reported empty, and `readySkillNames` carries only the
|
|
185
|
+
agents the device hosts there. Read another device's tools and skills off the
|
|
186
|
+
account's roster. (#173)
|
|
187
|
+
- Removing a device or a member revokes the live invite grants it minted, a
|
|
188
|
+
kick lands even after the device moved to a new writer key, and a device row
|
|
189
|
+
that moves to a new writer removes the one it moved off. Consensus changes,
|
|
190
|
+
covered by the `>=0.19.0` floor. (#226)
|
|
191
|
+
- Revoking another writer takes standing: `removeDevice` and `removeMember` are
|
|
192
|
+
refused in apply unless the author is a live device of a member of the mesh.
|
|
193
|
+
Any admitted writer could revoke any other before, including a device paired
|
|
194
|
+
in by invite that a sibling has not yet attested. A refusal leaves the writer
|
|
195
|
+
set untouched. A consensus change, covered by the `>=0.19.0` floor. (#170)
|
|
196
|
+
- Notice and error text says "mesh" where it said "room". A member `meshInvite`
|
|
197
|
+
into a mesh that already holds another member or a message returns the
|
|
198
|
+
`notice` "this mesh is not empty: everyone in it will see the newcomer arrive,
|
|
199
|
+
and the newcomer replays the whole history of the mesh, including what earlier
|
|
200
|
+
members wrote", and a member `meshInvite` naming a mesh only another of your
|
|
201
|
+
devices can open refuses with "Another of your devices holds this mesh: bring
|
|
202
|
+
that device online, or invite from it instead". Code matching on the old text
|
|
203
|
+
has to match the new. (#198)
|
|
204
|
+
- `autobee` 2.11.8. A member whose view was never written now maps through the
|
|
205
|
+
reindex, and the fast-forward search follows signalled trusted heads and only
|
|
206
|
+
moves forward. (#249)
|
|
207
|
+
|
|
208
|
+
### Removed
|
|
209
|
+
|
|
210
|
+
- `createRoom`. It stays on the wire because it shipped, and now refuses with
|
|
211
|
+
`createRoom is retired: call createMesh with the same input`. For a host
|
|
212
|
+
embedding Core, `Core.createRoom` and `Core.sharedRoom` are renamed
|
|
213
|
+
`createMesh` and `sharedMesh`. (#198)
|
|
214
|
+
|
|
215
|
+
### Fixed
|
|
216
|
+
|
|
217
|
+
- A mesh a device learned of from a sibling was followed once, ever: one
|
|
218
|
+
refused seed request or failed open stranded it for good, with nothing
|
|
219
|
+
logged. A failed open now unwinds, the reason is logged, and a follow that
|
|
220
|
+
failed for a reason that can change is retried on every sync pass until the
|
|
221
|
+
mesh opens. A refusal is not retried. (#172, #201)
|
|
222
|
+
- `removeDevice` on one of your own devices revoked it only in the account, so
|
|
223
|
+
it stayed a live writer, and a live voucher, in every other mesh. It is now
|
|
224
|
+
revoked in each mesh this device holds, and in any other as soon as it
|
|
225
|
+
opens. Whether a sibling may follow our meshes is read off the account alone,
|
|
226
|
+
so one revoked by another member in a single mesh is no longer refused the
|
|
227
|
+
seed of all of them. (#228)
|
|
228
|
+
|
|
16
229
|
## [0.4.1] - 2026-09-25
|
|
17
230
|
|
|
18
231
|
### Changed
|
|
@@ -213,6 +426,38 @@ release.
|
|
|
213
426
|
request carried a non-native `AbortSignal`. Calendar, Spotify and other
|
|
214
427
|
connected skills stopped working an hour after connecting. (#207)
|
|
215
428
|
|
|
429
|
+
## [0.3.5] - 2026-09-25
|
|
430
|
+
|
|
431
|
+
### Changed
|
|
432
|
+
|
|
433
|
+
- `autobee` 2.11.4 with `strictReindex`: the boot reindex rewrites views still
|
|
434
|
+
on a version 1 manifest, which autobee 2.11 will no longer append to.
|
|
435
|
+
`corestore` 7.12.6 and `hypercore` 11.37. (#205)
|
|
436
|
+
|
|
437
|
+
### Fixed
|
|
438
|
+
|
|
439
|
+
- A React Native app could not bundle `@qvac/core/oauth/client`: Metro rejects
|
|
440
|
+
this package's imports map, so `#abort-controller` did not resolve. Token
|
|
441
|
+
refresh now uses the runtime's own `AbortController`, and
|
|
442
|
+
`bare-abort-controller` only on Bare, which has none. React Native's `fetch`
|
|
443
|
+
gets a native signal too. (#231)
|
|
444
|
+
|
|
445
|
+
```js
|
|
446
|
+
// mobile: bundles again, nothing else changes
|
|
447
|
+
import { createOAuthClient } from '@qvac/core/oauth/client'
|
|
448
|
+
|
|
449
|
+
const oauth = createOAuthClient({ fetch, randomBase64Url, sha256Base64Url })
|
|
450
|
+
const tokens = await oauth.refreshOAuthTokens(config, refreshToken)
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
## [0.3.4] - 2026-09-24
|
|
454
|
+
|
|
455
|
+
### Fixed
|
|
456
|
+
|
|
457
|
+
- OAuth token refresh failed on Node 24, including Electron 42, because the
|
|
458
|
+
request carried a non-native `AbortSignal`. Calendar, Spotify and other
|
|
459
|
+
connected skills stopped working an hour after connecting. (#207)
|
|
460
|
+
|
|
216
461
|
## [0.3.3] - 2026-09-24
|
|
217
462
|
|
|
218
463
|
### Changed
|
|
@@ -639,6 +884,17 @@ release.
|
|
|
639
884
|
minted. Leaving or being kicked archives a mesh instead of deleting it, so
|
|
640
885
|
its seed survives. (#56)
|
|
641
886
|
|
|
887
|
+
## [0.1.8] - 2026-09-26
|
|
888
|
+
|
|
889
|
+
Published under the `release-0.1` dist-tag.
|
|
890
|
+
|
|
891
|
+
### Changed
|
|
892
|
+
|
|
893
|
+
- `autobee` 2.11.8, backported from 0.5.0, with the `strictReindex` that 0.4.0
|
|
894
|
+
brought in. A mesh opened by 0.1.7 reindexes its views on first open.
|
|
895
|
+
`hyperbee2` 2.18, `hypercore` 11.37, `corestore` 7.12.6, `hyperschema` 1.26.2
|
|
896
|
+
and `hyperdb` 6.9; the wire format is unchanged. (#250)
|
|
897
|
+
|
|
642
898
|
## [0.1.7] - 2026-09-17
|
|
643
899
|
|
|
644
900
|
Published under the `release-0.1` dist-tag.
|
|
@@ -780,9 +1036,13 @@ Published under the `release-0.1` dist-tag.
|
|
|
780
1036
|
await assistant.ready()
|
|
781
1037
|
```
|
|
782
1038
|
|
|
783
|
-
[Unreleased]: https://github.com/tetherto/qvac-core/compare/v0.
|
|
1039
|
+
[Unreleased]: https://github.com/tetherto/qvac-core/compare/v0.6.0...HEAD
|
|
1040
|
+
[0.6.0]: https://github.com/tetherto/qvac-core/compare/v0.5.0...v0.6.0
|
|
1041
|
+
[0.5.0]: https://github.com/tetherto/qvac-core/compare/v0.4.1...v0.5.0
|
|
784
1042
|
[0.4.1]: https://github.com/tetherto/qvac-core/compare/v0.4.0...v0.4.1
|
|
785
1043
|
[0.4.0]: https://github.com/tetherto/qvac-core/compare/v0.3.3...v0.4.0
|
|
1044
|
+
[0.3.5]: https://github.com/tetherto/qvac-core/compare/v0.3.4...v0.3.5
|
|
1045
|
+
[0.3.4]: https://github.com/tetherto/qvac-core/compare/v0.3.3...v0.3.4
|
|
786
1046
|
[0.3.3]: https://github.com/tetherto/qvac-core/compare/v0.3.2...v0.3.3
|
|
787
1047
|
[0.3.2]: https://github.com/tetherto/qvac-core/compare/v0.3.1...v0.3.2
|
|
788
1048
|
[0.3.1]: https://github.com/tetherto/qvac-core/compare/v0.3.0...v0.3.1
|
|
@@ -790,6 +1050,7 @@ Published under the `release-0.1` dist-tag.
|
|
|
790
1050
|
[0.2.2]: https://github.com/tetherto/qvac-core/compare/v0.2.1...v0.2.2
|
|
791
1051
|
[0.2.1]: https://github.com/tetherto/qvac-core/compare/v0.2.0...v0.2.1
|
|
792
1052
|
[0.2.0]: https://github.com/tetherto/qvac-core/compare/v0.1.5...v0.2.0
|
|
1053
|
+
[0.1.8]: https://github.com/tetherto/qvac-core/compare/v0.1.7...v0.1.8
|
|
793
1054
|
[0.1.7]: https://github.com/tetherto/qvac-core/compare/v0.1.6...v0.1.7
|
|
794
1055
|
[0.1.6]: https://github.com/tetherto/qvac-core/compare/v0.1.5...v0.1.6
|
|
795
1056
|
[0.1.5]: https://github.com/tetherto/qvac-core/compare/v0.1.4...v0.1.5
|
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ Wire it up — prod shape, Core in its own Bare sidecar process:
|
|
|
85
85
|
import { QvacAssistant, AssistantClient } from 'qvac-core'
|
|
86
86
|
|
|
87
87
|
// Spawns the bundled Core sidecar for free — ready() boots it, close()
|
|
88
|
-
// tears it down. Joining
|
|
88
|
+
// tears it down. Joining an account: redeem a device invite with joinMesh.
|
|
89
89
|
const engine = new AssistantClient({
|
|
90
90
|
storagePath: '/path/to/state',
|
|
91
91
|
device: { name: 'my-device', capabilityProfile: 'mid', recommendedModelName: 'Qwen3.5-9B' }
|
|
@@ -32,8 +32,9 @@ export function createAgentsApi(pool, deviceId, computeLender = null) {
|
|
|
32
32
|
getDefaultAgent: async ({ meshId, providerDeviceId }) => {
|
|
33
33
|
const mesh = await requireMesh(pool, meshId);
|
|
34
34
|
const agent = await getDefaultAgent(mesh, providerDeviceId ?? undefined);
|
|
35
|
-
if (!agent)
|
|
35
|
+
if (!agent) {
|
|
36
36
|
return {};
|
|
37
|
+
}
|
|
37
38
|
return { agent: await withOrphaned(mesh, agent) };
|
|
38
39
|
},
|
|
39
40
|
updateAgent: async ({ agentId, meshId, config }) => {
|
|
@@ -44,6 +45,6 @@ export function createAgentsApi(pool, deviceId, computeLender = null) {
|
|
|
44
45
|
const mesh = await requireMesh(pool, meshId);
|
|
45
46
|
return withOrphaned(mesh, await deleteAgent(mesh, deviceId, agentId));
|
|
46
47
|
},
|
|
47
|
-
agentsWatch: meshWatchable(
|
|
48
|
+
agentsWatch: meshWatchable(pool, (request, mesh) => list(mesh, request.providerDeviceId ?? undefined), { name: 'agentsWatch' })
|
|
48
49
|
};
|
|
49
50
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { openLocalStore } from '../core/local/index.ts';
|
|
2
2
|
import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
|
|
3
3
|
type LocalStore = Awaited<ReturnType<typeof openLocalStore>>;
|
|
4
|
-
export declare function createAppConfigApi(state: LocalStore): Pick<CapabilityHandlers, 'getConfig' | 'setConfig' | 'setModelPaused' | 'configWatchTyped'>;
|
|
4
|
+
export declare function createAppConfigApi(state: LocalStore): Pick<CapabilityHandlers, 'getConfig' | 'setConfig' | 'setModelPaused' | 'setModelReleased' | 'configWatchTyped'>;
|
|
5
5
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
1
2
|
import { watchable } from './watchable.js';
|
|
2
3
|
const EMPTY_CAPABILITIES = {
|
|
3
4
|
chat: false,
|
|
@@ -20,14 +21,30 @@ const DEFAULT_CONFIG = {
|
|
|
20
21
|
lastModelName: null,
|
|
21
22
|
onboardingCompleted: false,
|
|
22
23
|
delegation: EMPTY_DELEGATION,
|
|
23
|
-
pausedModels: []
|
|
24
|
+
pausedModels: [],
|
|
25
|
+
releasedModels: []
|
|
24
26
|
};
|
|
27
|
+
const DelegationSchema = z.object({
|
|
28
|
+
enabled: z.boolean().optional(),
|
|
29
|
+
targetDeviceId: z.string().nullish(),
|
|
30
|
+
targetAgentId: z.string().nullish(),
|
|
31
|
+
capabilities: z
|
|
32
|
+
.object({
|
|
33
|
+
chat: z.boolean().optional(),
|
|
34
|
+
transcription: z.boolean().optional(),
|
|
35
|
+
tts: z.boolean().optional(),
|
|
36
|
+
embeddings: z.boolean().optional(),
|
|
37
|
+
knowledge: z.boolean().optional()
|
|
38
|
+
})
|
|
39
|
+
.nullish()
|
|
40
|
+
});
|
|
25
41
|
function normalizeDelegation(raw) {
|
|
26
|
-
|
|
42
|
+
const parsed = DelegationSchema.safeParse(raw);
|
|
43
|
+
if (!parsed.success) {
|
|
27
44
|
return { ...EMPTY_DELEGATION, capabilities: { ...EMPTY_CAPABILITIES } };
|
|
28
45
|
}
|
|
29
|
-
const d =
|
|
30
|
-
const c =
|
|
46
|
+
const d = parsed.data;
|
|
47
|
+
const c = d.capabilities ?? EMPTY_CAPABILITIES;
|
|
31
48
|
return {
|
|
32
49
|
enabled: d.enabled ?? false,
|
|
33
50
|
targetDeviceId: d.targetDeviceId ?? null,
|
|
@@ -42,8 +59,9 @@ function normalizeDelegation(raw) {
|
|
|
42
59
|
};
|
|
43
60
|
}
|
|
44
61
|
function toConfig(row) {
|
|
45
|
-
if (!row)
|
|
62
|
+
if (!row) {
|
|
46
63
|
return { ...DEFAULT_CONFIG, delegation: normalizeDelegation(null) };
|
|
64
|
+
}
|
|
47
65
|
return {
|
|
48
66
|
activeAgentId: row.activeAgentId ?? null,
|
|
49
67
|
activeChatId: row.activeChatId ?? null,
|
|
@@ -52,7 +70,8 @@ function toConfig(row) {
|
|
|
52
70
|
lastModelName: row.lastModelName ?? null,
|
|
53
71
|
onboardingCompleted: row.onboardingCompleted ?? false,
|
|
54
72
|
delegation: normalizeDelegation(row.delegation),
|
|
55
|
-
pausedModels: row.pausedModels ?? []
|
|
73
|
+
pausedModels: row.pausedModels ?? [],
|
|
74
|
+
releasedModels: row.releasedModels ?? []
|
|
56
75
|
};
|
|
57
76
|
}
|
|
58
77
|
function applyWrite(current, update) {
|
|
@@ -64,9 +83,20 @@ function applyWrite(current, update) {
|
|
|
64
83
|
lastModelName: current.lastModelName,
|
|
65
84
|
onboardingCompleted: update.onboardingCompleted ?? false,
|
|
66
85
|
delegation: normalizeDelegation(update.delegation),
|
|
67
|
-
pausedModels: current.pausedModels
|
|
86
|
+
pausedModels: current.pausedModels,
|
|
87
|
+
releasedModels: current.releasedModels
|
|
68
88
|
};
|
|
69
89
|
}
|
|
90
|
+
function toggled(names, name, on) {
|
|
91
|
+
const set = new Set(names);
|
|
92
|
+
if (on) {
|
|
93
|
+
set.add(name);
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
set.delete(name);
|
|
97
|
+
}
|
|
98
|
+
return [...set];
|
|
99
|
+
}
|
|
70
100
|
async function readConfig(state) {
|
|
71
101
|
return toConfig(await state.getAppConfigRow());
|
|
72
102
|
}
|
|
@@ -79,7 +109,8 @@ function toRow(config) {
|
|
|
79
109
|
lastModelName: config.lastModelName,
|
|
80
110
|
onboardingCompleted: config.onboardingCompleted,
|
|
81
111
|
delegation: config.delegation,
|
|
82
|
-
pausedModels: config.pausedModels
|
|
112
|
+
pausedModels: config.pausedModels,
|
|
113
|
+
releasedModels: config.releasedModels
|
|
83
114
|
};
|
|
84
115
|
}
|
|
85
116
|
export function createAppConfigApi(state) {
|
|
@@ -94,15 +125,23 @@ export function createAppConfigApi(state) {
|
|
|
94
125
|
async setModelPaused(input) {
|
|
95
126
|
const row = await state.updateAppConfigRow((current) => {
|
|
96
127
|
const config = toConfig(current);
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
128
|
+
return toRow({
|
|
129
|
+
...config,
|
|
130
|
+
pausedModels: toggled(config.pausedModels ?? [], input.name, input.paused ?? false)
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
return toConfig(row);
|
|
134
|
+
},
|
|
135
|
+
async setModelReleased(input) {
|
|
136
|
+
const row = await state.updateAppConfigRow((current) => {
|
|
137
|
+
const config = toConfig(current);
|
|
138
|
+
return toRow({
|
|
139
|
+
...config,
|
|
140
|
+
releasedModels: toggled(config.releasedModels ?? [], input.name, input.released ?? false)
|
|
141
|
+
});
|
|
103
142
|
});
|
|
104
143
|
return toConfig(row);
|
|
105
144
|
},
|
|
106
|
-
configWatchTyped: watchable(
|
|
145
|
+
configWatchTyped: watchable(() => state, () => readConfig(state), { name: 'configWatchTyped' })
|
|
107
146
|
};
|
|
108
147
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
|
|
2
2
|
import { type MeshPool } from './current-mesh.ts';
|
|
3
3
|
export { MAX_ATTACHMENT_BYTES } from '../core/files/attachments.ts';
|
|
4
|
-
export
|
|
5
|
-
maxBytes?: number;
|
|
6
|
-
deviceId?: Buffer | null;
|
|
7
|
-
inactivityMs?: number;
|
|
8
|
-
}
|
|
4
|
+
export interface CreateAttachmentsApiOptions {
|
|
5
|
+
readonly maxBytes?: number;
|
|
6
|
+
readonly deviceId?: Buffer | null;
|
|
7
|
+
readonly inactivityMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function createAttachmentsApi(pool: MeshPool, options?: CreateAttachmentsApiOptions): Pick<CapabilityHandlers, 'uploadAttachment' | 'downloadAttachment' | 'deleteAttachment'>;
|
|
@@ -5,10 +5,12 @@ export function createAttachmentsApi(pool, options = {}) {
|
|
|
5
5
|
return {
|
|
6
6
|
async *uploadAttachment(frames) {
|
|
7
7
|
const upload = await openUpload(frames);
|
|
8
|
-
if (!upload)
|
|
8
|
+
if (!upload) {
|
|
9
9
|
return;
|
|
10
|
-
|
|
10
|
+
}
|
|
11
|
+
if (!upload.first.meshId) {
|
|
11
12
|
throw new Error(UPLOAD_NAMES_NO_MESH);
|
|
13
|
+
}
|
|
12
14
|
const mesh = await requireMesh(pool, upload.first.meshId);
|
|
13
15
|
yield* mesh.files.attachments(options).uploadAttachment(upload.rest);
|
|
14
16
|
},
|
|
@@ -3,7 +3,11 @@ import type { openLocalStore } from '../core/local/index.ts';
|
|
|
3
3
|
import { type MeshPool } from './current-mesh.ts';
|
|
4
4
|
type LocalStore = ReturnType<typeof openLocalStore>;
|
|
5
5
|
type ChatCapabilities = Pick<CapabilityHandlers, 'createChat' | 'listChats' | 'getChat' | 'renameChat' | 'setChatRagEnabled' | 'setChatWebSearchEnabled' | 'deleteChat' | 'chatsWatch' | 'listChatActivity' | 'chatActivityWatch' | 'searchChats'>;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export interface CreateChatApiOptions {
|
|
7
|
+
readonly deviceId: Buffer | null;
|
|
8
|
+
readonly inferenceCalls?: {
|
|
9
|
+
forget(chatId: string): Promise<void>;
|
|
10
|
+
} | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function createChatApi(pool: MeshPool, local: LocalStore, { deviceId, inferenceCalls }: CreateChatApiOptions): ChatCapabilities;
|
|
9
13
|
export {};
|
package/dist-lib/lib/api/chat.js
CHANGED
|
@@ -5,7 +5,7 @@ import { listChatPage } from '../core/chat-order.js';
|
|
|
5
5
|
import { searchChats } from '../core/chat-search.js';
|
|
6
6
|
import { meshWatchable, requireMesh } from './current-mesh.js';
|
|
7
7
|
const SEARCH_SUPERSEDED_ABORT = 'superseded by a newer chat search';
|
|
8
|
-
export function createChatApi(pool,
|
|
8
|
+
export function createChatApi(pool, local, { deviceId, inferenceCalls = null }) {
|
|
9
9
|
let searchAbort = null;
|
|
10
10
|
const chatList = (mesh, { limit, cursor }) => listChatPage(mesh, local, { limit: limit || undefined, cursor: cursor ?? undefined });
|
|
11
11
|
const chatActivity = (mesh, chatIds) => listChatActivity(mesh, chatIds ?? undefined).then((activities) => ({ activities }));
|
|
@@ -14,16 +14,16 @@ export function createChatApi(pool, deviceId, local, inferenceCalls = null) {
|
|
|
14
14
|
listChats: async (request) => chatList(await requireMesh(pool, request.meshId), request),
|
|
15
15
|
getChat: async ({ chatId, meshId }) => mustGetActiveChatListing(await requireMesh(pool, meshId), chatId),
|
|
16
16
|
renameChat: async ({ chatId, meshId, config }) => renameChat(await requireMesh(pool, meshId), chatId, config.title),
|
|
17
|
-
setChatRagEnabled: async ({ chatId, enabled, meshId }) => setChatRagEnabled(await requireMesh(pool, meshId), chatId, enabled ?? false),
|
|
17
|
+
setChatRagEnabled: async ({ chatId, enabled, meshId }) => setChatRagEnabled(await requireMesh(pool, meshId), chatId, { ragEnabled: enabled ?? false }),
|
|
18
18
|
setChatWebSearchEnabled: async ({ chatId, enabled, meshId }) => setChatWebSearchEnabled(await requireMesh(pool, meshId), chatId, enabled ?? false),
|
|
19
19
|
deleteChat: async ({ chatId, meshId }) => {
|
|
20
20
|
const deleted = await deleteChat(await requireMesh(pool, meshId), deviceId, chatId);
|
|
21
21
|
await inferenceCalls?.forget(chatId);
|
|
22
22
|
return deleted;
|
|
23
23
|
},
|
|
24
|
-
chatsWatch: meshWatchable(
|
|
24
|
+
chatsWatch: meshWatchable(pool, (request, store) => chatList(store, request), { name: 'chatsWatch', changes: local }),
|
|
25
25
|
listChatActivity: async (input) => chatActivity(await requireMesh(pool, input.meshId), input.chatIds),
|
|
26
|
-
chatActivityWatch: meshWatchable(
|
|
26
|
+
chatActivityWatch: meshWatchable(pool, (request, store) => chatActivity(store, request.chatIds), { name: 'chatActivityWatch' }),
|
|
27
27
|
searchChats: async (input) => {
|
|
28
28
|
searchAbort?.abort(SEARCH_SUPERSEDED_ABORT);
|
|
29
29
|
const controller = new AbortController();
|
|
@@ -31,10 +31,10 @@ export function createChunksApi(pool, deviceId) {
|
|
|
31
31
|
});
|
|
32
32
|
return { chunks: await recordLinks(mesh, chunks) };
|
|
33
33
|
},
|
|
34
|
-
chunksWatch: meshWatchable(
|
|
34
|
+
chunksWatch: meshWatchable(pool, async ({ meshId, ...input }, mesh) => ({
|
|
35
35
|
chunks: await recordLinks(mesh, await listChunks(mesh, chunkSelection(input)))
|
|
36
|
-
})),
|
|
37
|
-
runRequestsWatch: meshWatchable(
|
|
36
|
+
}), { name: 'chunksWatch' }),
|
|
37
|
+
runRequestsWatch: meshWatchable(pool, async (_request, mesh) => ({ chunks: await listRunRequests(mesh, deviceId) }), { name: 'runRequestsWatch' })
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
function chunkSelection({ chatId, type, types, ...rest }) {
|
|
@@ -8,8 +8,8 @@ export function createConfigApi(state) {
|
|
|
8
8
|
await state.set(key, value);
|
|
9
9
|
return { ok: true };
|
|
10
10
|
},
|
|
11
|
-
configWatch: watchable(
|
|
11
|
+
configWatch: watchable(() => state, async ({ key }) => ({
|
|
12
12
|
value: await state.get(key)
|
|
13
|
-
}))
|
|
13
|
+
}), { name: 'configWatch' })
|
|
14
14
|
};
|
|
15
15
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import type { Readable } from 'streamx';
|
|
1
2
|
import type { Mesh } from '../core/mesh.ts';
|
|
3
|
+
import { type WatchableOptions } from './watchable.ts';
|
|
2
4
|
export type MeshPool = (meshId: string) => Mesh | null | Promise<Mesh | null>;
|
|
3
5
|
export declare const NO_SUCH_MESH = "no such mesh";
|
|
4
6
|
export declare function requireMesh(pool: MeshPool, meshId: string): Promise<Mesh>;
|
|
5
7
|
export declare function isMissingMesh(err: unknown): boolean;
|
|
6
|
-
export declare function meshWatchable<TRequest extends MeshScoped, TResult>(
|
|
7
|
-
watch(listener: () => void): void;
|
|
8
|
-
unwatch(listener: () => void): void;
|
|
9
|
-
}): (request: TRequest) => import("streamx").Readable<import("streamx").ReadableEvents> & AsyncIterable<TResult>;
|
|
8
|
+
export declare function meshWatchable<TRequest extends MeshScoped, TResult>(pool: MeshPool, query: (request: TRequest, mesh: Mesh) => Promise<TResult>, { name, changes }: WatchableOptions): (request: TRequest) => Readable & AsyncIterable<TResult>;
|
|
10
9
|
interface MeshScoped {
|
|
11
10
|
readonly meshId: string;
|
|
12
11
|
}
|
|
@@ -2,15 +2,20 @@ import { watchable } from './watchable.js';
|
|
|
2
2
|
export const NO_SUCH_MESH = 'no such mesh';
|
|
3
3
|
export async function requireMesh(pool, meshId) {
|
|
4
4
|
const mesh = await pool(meshId);
|
|
5
|
-
if (!mesh)
|
|
5
|
+
if (!mesh) {
|
|
6
6
|
throw new Error(`${NO_SUCH_MESH}: ${meshId}`);
|
|
7
|
-
|
|
7
|
+
}
|
|
8
|
+
if (!mesh.opened) {
|
|
8
9
|
await mesh.ready();
|
|
10
|
+
}
|
|
9
11
|
return mesh;
|
|
10
12
|
}
|
|
11
13
|
export function isMissingMesh(err) {
|
|
12
14
|
return err instanceof Error && err.message.startsWith(`${NO_SUCH_MESH}: `);
|
|
13
15
|
}
|
|
14
|
-
export function meshWatchable(
|
|
15
|
-
return watchable(
|
|
16
|
+
export function meshWatchable(pool, query, { name, changes }) {
|
|
17
|
+
return watchable((request) => requireMesh(pool, request.meshId), query, {
|
|
18
|
+
name,
|
|
19
|
+
changes
|
|
20
|
+
});
|
|
16
21
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
import type { AssistantCustomModelPreview, AssistantDeleteModelResponse, AssistantPreviewCustomModelRequest } from '../../spec/hyperschema/types.d.ts';
|
|
1
2
|
import type { openLocalStore } from '../core/local/index.ts';
|
|
2
3
|
import type { CapabilityHandlers } from '../../spec/capabilities.d.ts';
|
|
3
4
|
type LocalStore = Awaited<ReturnType<typeof openLocalStore>>;
|
|
4
|
-
export declare
|
|
5
|
+
export declare const CUSTOM_MODEL_ID_PREFIX = "custom:";
|
|
6
|
+
export declare function customModelId(src: string): string;
|
|
7
|
+
export type CustomModelFileDelete = (request: {
|
|
8
|
+
name: string;
|
|
9
|
+
}) => Promise<AssistantDeleteModelResponse>;
|
|
10
|
+
export type CustomModelPreviewSource = (request: AssistantPreviewCustomModelRequest) => Promise<AssistantCustomModelPreview>;
|
|
11
|
+
export declare function createCustomModelApi(state: LocalStore, preview: CustomModelPreviewSource | null, deleteFiles?: CustomModelFileDelete | null): Pick<CapabilityHandlers, 'customModelsWatch' | 'addCustomModel' | 'removeCustomModel' | 'previewCustomModel'>;
|
|
5
12
|
export {};
|