@qvac/core 1.0.0-rc.1 → 1.0.0-rc.3
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 +1008 -1
- package/README.md +40 -81
- package/dist-lib/index.d.ts +1 -1
- package/dist-lib/index.js +1 -1
- package/dist-lib/lib/api/agent-folders.d.ts +22 -0
- package/dist-lib/lib/api/agent-folders.js +115 -0
- package/dist-lib/lib/api/agents.d.ts +19 -2
- package/dist-lib/lib/api/agents.js +121 -24
- package/dist-lib/lib/api/app-config.d.ts +4 -1
- package/dist-lib/lib/api/app-config.js +17 -6
- package/dist-lib/lib/api/attachments.js +3 -2
- package/dist-lib/lib/api/chat-move.d.ts +4 -0
- package/dist-lib/lib/api/chat-move.js +7 -0
- package/dist-lib/lib/api/chat.d.ts +13 -2
- package/dist-lib/lib/api/chat.js +114 -9
- package/dist-lib/lib/api/chunk-delta.d.ts +12 -0
- package/dist-lib/lib/api/chunk-delta.js +115 -0
- package/dist-lib/lib/api/chunks.d.ts +17 -2
- package/dist-lib/lib/api/chunks.js +70 -13
- package/dist-lib/lib/api/config.d.ts +6 -2
- package/dist-lib/lib/api/config.js +47 -5
- package/dist-lib/lib/api/current-mesh.d.ts +13 -5
- package/dist-lib/lib/api/current-mesh.js +15 -11
- package/dist-lib/lib/api/custom-models.d.ts +7 -1
- package/dist-lib/lib/api/custom-models.js +12 -12
- package/dist-lib/lib/api/device-routes.d.ts +9 -0
- package/dist-lib/lib/api/device-routes.js +123 -0
- package/dist-lib/lib/api/devices.d.ts +3 -2
- package/dist-lib/lib/api/devices.js +23 -11
- package/dist-lib/lib/api/diagnostics.d.ts +2 -1
- package/dist-lib/lib/api/diagnostics.js +2 -2
- package/dist-lib/lib/api/execution.d.ts +12 -1
- package/dist-lib/lib/api/execution.js +44 -14
- package/dist-lib/lib/api/files.d.ts +1 -1
- package/dist-lib/lib/api/files.js +65 -8
- package/dist-lib/lib/api/host-run-log.d.ts +2 -41
- package/dist-lib/lib/api/host-run-log.js +35 -83
- package/dist-lib/lib/api/index.d.ts +28 -6
- package/dist-lib/lib/api/index.js +101 -33
- package/dist-lib/lib/api/instrument.d.ts +2 -2
- package/dist-lib/lib/api/instrument.js +24 -48
- package/dist-lib/lib/api/knowledge.d.ts +4 -1
- package/dist-lib/lib/api/knowledge.js +25 -7
- package/dist-lib/lib/api/local-files.d.ts +5 -1
- package/dist-lib/lib/api/local-files.js +9 -5
- package/dist-lib/lib/api/logs.js +3 -3
- package/dist-lib/lib/api/members.d.ts +10 -1
- package/dist-lib/lib/api/members.js +67 -26
- package/dist-lib/lib/api/mesh.d.ts +12 -4
- package/dist-lib/lib/api/mesh.js +12 -8
- package/dist-lib/lib/api/model-download.d.ts +2 -1
- package/dist-lib/lib/api/model-download.js +2 -2
- package/dist-lib/lib/api/network.d.ts +10 -2
- package/dist-lib/lib/api/network.js +8 -2
- package/dist-lib/lib/api/notifications.d.ts +3 -1
- package/dist-lib/lib/api/notifications.js +14 -9
- package/dist-lib/lib/api/projects.d.ts +20 -0
- package/dist-lib/lib/api/projects.js +169 -0
- package/dist-lib/lib/api/rag.d.ts +0 -1
- package/dist-lib/lib/api/rag.js +71 -34
- package/dist-lib/lib/api/served.d.ts +17 -0
- package/dist-lib/lib/api/served.js +48 -0
- package/dist-lib/lib/api/sync.d.ts +2 -1
- package/dist-lib/lib/api/sync.js +2 -2
- package/dist-lib/lib/api/tool-activity.d.ts +2 -1
- package/dist-lib/lib/api/tool-activity.js +4 -3
- package/dist-lib/lib/api/tool-configs.d.ts +2 -1
- package/dist-lib/lib/api/tool-configs.js +6 -9
- package/dist-lib/lib/api/upload-frames.d.ts +0 -1
- package/dist-lib/lib/api/upload-frames.js +0 -1
- package/dist-lib/lib/api/watchable.d.ts +3 -2
- package/dist-lib/lib/api/watchable.js +2 -3
- package/dist-lib/lib/api/workspace.d.ts +5 -0
- package/dist-lib/lib/api/workspace.js +47 -0
- package/dist-lib/lib/assistant/fake-models.d.ts +20 -0
- package/dist-lib/lib/assistant/fake-models.js +112 -0
- package/dist-lib/lib/assistant/harness.d.ts +37 -31
- package/dist-lib/lib/assistant/harness.js +51 -10
- package/dist-lib/lib/assistant/history.d.ts +30 -17
- package/dist-lib/lib/assistant/history.js +179 -87
- package/dist-lib/lib/assistant/host-run-log.d.ts +6 -1
- package/dist-lib/lib/assistant/host-run-log.js +24 -36
- package/dist-lib/lib/assistant/message.d.ts +27 -1
- package/dist-lib/lib/assistant/message.js +65 -2
- package/dist-lib/lib/assistant/model-round.d.ts +100 -0
- package/dist-lib/lib/assistant/model-round.js +619 -0
- package/dist-lib/lib/assistant/pdf-budget.d.ts +11 -0
- package/dist-lib/lib/assistant/pdf-budget.js +12 -0
- package/dist-lib/lib/assistant/pdf-pages.d.ts +25 -0
- package/dist-lib/lib/assistant/pdf-pages.js +75 -0
- package/dist-lib/lib/assistant/round-host.d.ts +42 -0
- package/dist-lib/lib/assistant/round-host.js +241 -0
- package/dist-lib/lib/assistant/skill-encode.d.ts +2 -1
- package/dist-lib/lib/assistant/skill-encode.js +2 -1
- package/dist-lib/lib/assistant/video-budget.d.ts +13 -0
- package/dist-lib/lib/assistant/video-budget.js +29 -0
- package/dist-lib/lib/assistant-client.d.ts +4 -1
- package/dist-lib/lib/assistant-client.js +27 -8
- package/dist-lib/lib/assistant-tree.d.ts +10 -3
- package/dist-lib/lib/assistant-tree.js +63 -20
- package/dist-lib/lib/assistant.d.ts +93 -24
- package/dist-lib/lib/assistant.js +2048 -1231
- package/dist-lib/lib/audio-format.js +1 -1
- package/dist-lib/lib/chat-suggestion.d.ts +3 -0
- package/dist-lib/lib/chat-suggestion.js +47 -0
- package/dist-lib/lib/client.d.ts +2 -2
- package/dist-lib/lib/client.js +10 -1
- package/dist-lib/lib/compaction.d.ts +3 -1
- package/dist-lib/lib/compaction.js +18 -4
- package/dist-lib/lib/constants.d.ts +10 -0
- package/dist-lib/lib/constants.js +10 -0
- package/dist-lib/lib/core/agent-copies.d.ts +9 -0
- package/dist-lib/lib/core/agent-copies.js +40 -0
- package/dist-lib/lib/core/agent-hosting.d.ts +25 -0
- package/dist-lib/lib/core/agent-hosting.js +71 -0
- package/dist-lib/lib/core/agent.d.ts +9 -1
- package/dist-lib/lib/core/agent.js +45 -19
- package/dist-lib/lib/core/archived-mesh.d.ts +11 -6
- package/dist-lib/lib/core/archived-mesh.js +77 -58
- package/dist-lib/lib/core/async-iterable.js +1 -1
- package/dist-lib/lib/core/blind-peers.d.ts +1 -0
- package/dist-lib/lib/core/blind-peers.js +1 -0
- package/dist-lib/lib/core/chat-activity.d.ts +1 -1
- package/dist-lib/lib/core/chat-activity.js +45 -34
- package/dist-lib/lib/core/chat-copy.d.ts +42 -0
- package/dist-lib/lib/core/chat-copy.js +395 -0
- package/dist-lib/lib/core/chat-fork.d.ts +16 -0
- package/dist-lib/lib/core/chat-fork.js +246 -0
- package/dist-lib/lib/core/chat-group.js +8 -7
- package/dist-lib/lib/core/chat-move.d.ts +75 -0
- package/dist-lib/lib/core/chat-move.js +598 -0
- package/dist-lib/lib/core/chat-order.d.ts +2 -1
- package/dist-lib/lib/core/chat-order.js +19 -4
- package/dist-lib/lib/core/chat-project.d.ts +2 -0
- package/dist-lib/lib/core/chat-project.js +15 -0
- package/dist-lib/lib/core/chat-read.d.ts +4 -0
- package/dist-lib/lib/core/chat-read.js +49 -0
- package/dist-lib/lib/core/chat-search.js +14 -12
- package/dist-lib/lib/core/chat.d.ts +33 -4
- package/dist-lib/lib/core/chat.js +122 -39
- package/dist-lib/lib/core/chunk.d.ts +35 -7
- package/dist-lib/lib/core/chunk.js +250 -45
- package/dist-lib/lib/core/collections.d.ts +40 -1
- package/dist-lib/lib/core/collections.js +40 -1
- package/dist-lib/lib/core/config-value.d.ts +6 -0
- package/dist-lib/lib/core/config-value.js +14 -0
- package/dist-lib/lib/core/contract/activity.d.ts +3 -2
- package/dist-lib/lib/core/contract/activity.js +39 -21
- package/dist-lib/lib/core/contract/agent-join.d.ts +10 -0
- package/dist-lib/lib/core/contract/agent-join.js +104 -0
- package/dist-lib/lib/core/contract/agents.d.ts +5 -0
- package/dist-lib/lib/core/contract/agents.js +142 -3
- package/dist-lib/lib/core/contract/chat.d.ts +4 -0
- package/dist-lib/lib/core/contract/chat.js +53 -3
- package/dist-lib/lib/core/contract/chunks.d.ts +7 -0
- package/dist-lib/lib/core/contract/chunks.js +125 -38
- package/dist-lib/lib/core/contract/devices.js +6 -4
- package/dist-lib/lib/core/contract/index.d.ts +2 -3
- package/dist-lib/lib/core/contract/index.js +36 -11
- package/dist-lib/lib/core/contract/indexing.d.ts +1 -0
- package/dist-lib/lib/core/contract/indexing.js +51 -7
- package/dist-lib/lib/core/contract/invites.d.ts +3 -14
- package/dist-lib/lib/core/contract/invites.js +26 -36
- package/dist-lib/lib/core/contract/joined-meshes.js +3 -1
- package/dist-lib/lib/core/contract/knowledge.d.ts +1 -0
- package/dist-lib/lib/core/contract/knowledge.js +57 -6
- package/dist-lib/lib/core/contract/members.d.ts +3 -1
- package/dist-lib/lib/core/contract/members.js +34 -4
- package/dist-lib/lib/core/contract/mesh-kind.d.ts +3 -3
- package/dist-lib/lib/core/contract/mesh-kind.js +20 -16
- package/dist-lib/lib/core/contract/mesh-name.d.ts +3 -0
- package/dist-lib/lib/core/contract/mesh-name.js +31 -0
- package/dist-lib/lib/core/contract/mesh-rules.d.ts +8 -0
- package/dist-lib/lib/core/contract/mesh-rules.js +35 -0
- package/dist-lib/lib/core/contract/mesh-seeds.d.ts +2 -0
- package/dist-lib/lib/core/contract/mesh-seeds.js +26 -0
- package/dist-lib/lib/core/contract/model-requests.d.ts +26 -0
- package/dist-lib/lib/core/contract/model-requests.js +280 -0
- package/dist-lib/lib/core/contract/oldest-version.d.ts +9 -0
- package/dist-lib/lib/core/contract/oldest-version.js +20 -0
- package/dist-lib/lib/core/contract/open-join.d.ts +2 -0
- package/dist-lib/lib/core/contract/open-join.js +77 -0
- package/dist-lib/lib/core/contract/project-device-keys.d.ts +7 -0
- package/dist-lib/lib/core/contract/project-device-keys.js +38 -0
- package/dist-lib/lib/core/contract/project-host-keys.d.ts +7 -0
- package/dist-lib/lib/core/contract/project-host-keys.js +41 -0
- package/dist-lib/lib/core/contract/project-order.d.ts +2 -0
- package/dist-lib/lib/core/contract/project-order.js +25 -0
- package/dist-lib/lib/core/contract/projects.d.ts +21 -0
- package/dist-lib/lib/core/contract/projects.js +327 -0
- package/dist-lib/lib/core/contract/public-mesh.d.ts +3 -0
- package/dist-lib/lib/core/contract/public-mesh.js +31 -0
- package/dist-lib/lib/core/contract/public-seeds.d.ts +9 -0
- package/dist-lib/lib/core/contract/public-seeds.js +43 -0
- package/dist-lib/lib/core/contract/roles.d.ts +10 -0
- package/dist-lib/lib/core/contract/roles.js +121 -0
- package/dist-lib/lib/core/contract/run-requests.d.ts +10 -0
- package/dist-lib/lib/core/contract/run-requests.js +81 -0
- package/dist-lib/lib/core/contract/seed-defaults.d.ts +3 -1
- package/dist-lib/lib/core/contract/seed-defaults.js +17 -4
- package/dist-lib/lib/core/contract/shipped-rows.d.ts +2 -0
- package/dist-lib/lib/core/contract/shipped-rows.js +22 -0
- package/dist-lib/lib/core/contract/skill-secrets.d.ts +3 -0
- package/dist-lib/lib/core/contract/skill-secrets.js +32 -0
- package/dist-lib/lib/core/contract/tool-activity.js +12 -1
- package/dist-lib/lib/core/contract/tool-configs.js +2 -1
- package/dist-lib/lib/core/contract/types.d.ts +2 -2
- package/dist-lib/lib/core/contract/workspace.d.ts +31 -0
- package/dist-lib/lib/core/contract/workspace.js +311 -0
- package/dist-lib/lib/core/contract/writers.js +100 -16
- package/dist-lib/lib/core/departures.d.ts +16 -5
- package/dist-lib/lib/core/departures.js +79 -6
- package/dist-lib/lib/core/device-control.d.ts +21 -0
- package/dist-lib/lib/core/device-control.js +91 -0
- package/dist-lib/lib/core/device-seal.d.ts +4 -0
- package/dist-lib/lib/core/device-seal.js +22 -0
- package/dist-lib/lib/core/devices.d.ts +2 -1
- package/dist-lib/lib/core/devices.js +5 -3
- package/dist-lib/lib/core/document-attachment.d.ts +10 -0
- package/dist-lib/lib/core/document-attachment.js +14 -0
- package/dist-lib/lib/core/files/attachments.js +8 -7
- package/dist-lib/lib/core/files/index.d.ts +27 -14
- package/dist-lib/lib/core/files/index.js +220 -43
- package/dist-lib/lib/core/files/knowledge.d.ts +10 -1
- package/dist-lib/lib/core/files/knowledge.js +77 -5
- package/dist-lib/lib/core/files/preview/index.js +6 -2
- package/dist-lib/lib/core/files/processing/claims.d.ts +7 -0
- package/dist-lib/lib/core/files/processing/claims.js +33 -7
- package/dist-lib/lib/core/files/processing/document.d.ts +8 -0
- package/dist-lib/lib/core/files/processing/document.js +26 -2
- package/dist-lib/lib/core/files/processing/index.d.ts +8 -3
- package/dist-lib/lib/core/files/processing/index.js +99 -73
- package/dist-lib/lib/core/files/processing/protocol.d.ts +7 -1
- package/dist-lib/lib/core/files/processing/protocol.js +14 -3
- package/dist-lib/lib/core/files/processing/source.d.ts +4 -0
- package/dist-lib/lib/core/files/processing/source.js +12 -4
- package/dist-lib/lib/core/files/processing/state.d.ts +5 -1
- package/dist-lib/lib/core/files/processing/state.js +9 -1
- package/dist-lib/lib/core/files/rag/build.d.ts +5 -1
- package/dist-lib/lib/core/files/rag/build.js +32 -8
- package/dist-lib/lib/core/files/rag/failure.d.ts +20 -0
- package/dist-lib/lib/core/files/rag/failure.js +57 -0
- package/dist-lib/lib/core/files/rag/index.d.ts +13 -2
- package/dist-lib/lib/core/files/rag/index.js +30 -8
- package/dist-lib/lib/core/files/rag/joined-index.d.ts +6 -0
- package/dist-lib/lib/core/files/rag/joined-index.js +35 -0
- package/dist-lib/lib/core/files/rag/limits.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/limits.js +1 -0
- package/dist-lib/lib/core/files/rag/load.js +6 -3
- package/dist-lib/lib/core/files/rag/policy.d.ts +10 -1
- package/dist-lib/lib/core/files/rag/policy.js +23 -2
- package/dist-lib/lib/core/files/rag/produce.d.ts +1 -1
- package/dist-lib/lib/core/files/rag/produce.js +31 -18
- package/dist-lib/lib/core/files/rag/retrieval/full-text.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/retrieval/full-text.js +8 -2
- package/dist-lib/lib/core/files/rag/similarity.d.ts +2 -2
- package/dist-lib/lib/core/files/rag/similarity.js +2 -3
- package/dist-lib/lib/core/files/records/chunks.js +22 -1
- package/dist-lib/lib/core/files/records/index.d.ts +1 -1
- package/dist-lib/lib/core/files/records/index.js +1 -1
- package/dist-lib/lib/core/files/records/knowledge.d.ts +11 -1
- package/dist-lib/lib/core/files/records/knowledge.js +40 -3
- package/dist-lib/lib/core/files/records/purge.js +13 -8
- package/dist-lib/lib/core/files/records/reclaim.js +20 -48
- package/dist-lib/lib/core/files/records/routing.d.ts +1 -1
- package/dist-lib/lib/core/files/records/routing.js +6 -2
- package/dist-lib/lib/core/files/records/source.js +3 -5
- package/dist-lib/lib/core/files/records/sweep.d.ts +3 -0
- package/dist-lib/lib/core/files/records/sweep.js +9 -3
- package/dist-lib/lib/core/files/store/blob.d.ts +2 -0
- package/dist-lib/lib/core/files/store/blob.js +2 -2
- package/dist-lib/lib/core/files/store/index.d.ts +3 -1
- package/dist-lib/lib/core/files/store/index.js +4 -1
- package/dist-lib/lib/core/files/store/reference.d.ts +3 -0
- package/dist-lib/lib/core/files/store/reference.js +12 -2
- package/dist-lib/lib/core/files/store/sweep.js +3 -1
- package/dist-lib/lib/core/files/upload.d.ts +5 -1
- package/dist-lib/lib/core/files/upload.js +53 -14
- package/dist-lib/lib/core/first-event.d.ts +6 -0
- package/dist-lib/lib/core/first-event.js +13 -0
- package/dist-lib/lib/core/fs-drives.d.ts +6 -3
- package/dist-lib/lib/core/fs-drives.js +30 -18
- package/dist-lib/lib/core/id.d.ts +1 -0
- package/dist-lib/lib/core/id.js +3 -0
- package/dist-lib/lib/core/identity.d.ts +3 -1
- package/dist-lib/lib/core/identity.js +25 -4
- package/dist-lib/lib/core/invite.d.ts +6 -2
- package/dist-lib/lib/core/invite.js +22 -8
- package/dist-lib/lib/core/local/files.d.ts +2 -1
- package/dist-lib/lib/core/local/files.js +5 -7
- package/dist-lib/lib/core/local/index.d.ts +86 -7
- package/dist-lib/lib/core/local/index.js +312 -27
- package/dist-lib/lib/core/local/run-logs.d.ts +38 -0
- package/dist-lib/lib/core/local/run-logs.js +132 -0
- package/dist-lib/lib/core/member-key.d.ts +7 -0
- package/dist-lib/lib/core/member-key.js +24 -0
- package/dist-lib/lib/core/membership.d.ts +3 -14
- package/dist-lib/lib/core/membership.js +3 -96
- package/dist-lib/lib/core/mesh.d.ts +107 -30
- package/dist-lib/lib/core/mesh.js +625 -171
- package/dist-lib/lib/core/migrations/agent-tools-scope.d.ts +2 -0
- package/dist-lib/lib/core/migrations/agent-tools-scope.js +24 -0
- package/dist-lib/lib/core/migrations/chat-chunks.d.ts +4 -0
- package/dist-lib/lib/core/migrations/chat-chunks.js +47 -0
- package/dist-lib/lib/core/migrations/file-index.d.ts +1 -1
- package/dist-lib/lib/core/migrations/file-index.js +8 -6
- package/dist-lib/lib/core/migrations/index.d.ts +2 -1
- package/dist-lib/lib/core/migrations/index.js +69 -8
- package/dist-lib/lib/core/model-requests.d.ts +13 -0
- package/dist-lib/lib/core/model-requests.js +65 -0
- package/dist-lib/lib/core/next-frame.js +2 -1
- package/dist-lib/lib/core/notification.js +100 -25
- package/dist-lib/lib/core/pdf/figure.d.ts +22 -0
- package/dist-lib/lib/core/pdf/figure.js +64 -0
- package/dist-lib/lib/core/pdf/rasterize.d.ts +12 -3
- package/dist-lib/lib/core/pdf/rasterize.js +77 -28
- package/dist-lib/lib/core/peer-duplex.d.ts +34 -0
- package/dist-lib/lib/core/{harness-loan.js → peer-duplex.js} +104 -45
- package/dist-lib/lib/core/project-keys.d.ts +13 -0
- package/dist-lib/lib/core/project-keys.js +56 -0
- package/dist-lib/lib/core/prompt-history.js +4 -4
- package/dist-lib/lib/core/protocol-pairing.d.ts +11 -0
- package/dist-lib/lib/core/protocol-pairing.js +22 -0
- package/dist-lib/lib/core/public-mesh.d.ts +26 -0
- package/dist-lib/lib/core/public-mesh.js +94 -0
- package/dist-lib/lib/core/purge.d.ts +3 -0
- package/dist-lib/lib/core/purge.js +7 -0
- package/dist-lib/lib/core/run-driver.d.ts +17 -0
- package/dist-lib/lib/core/run-driver.js +20 -0
- package/dist-lib/lib/core/run-requests.d.ts +11 -0
- package/dist-lib/lib/core/run-requests.js +58 -0
- package/dist-lib/lib/core/send.d.ts +2 -0
- package/dist-lib/lib/core/send.js +17 -4
- package/dist-lib/lib/core/senders.d.ts +19 -0
- package/dist-lib/lib/core/senders.js +45 -0
- package/dist-lib/lib/core/shared-agents.d.ts +40 -0
- package/dist-lib/lib/core/shared-agents.js +283 -0
- package/dist-lib/lib/core/skill-secrets.d.ts +10 -16
- package/dist-lib/lib/core/skill-secrets.js +90 -72
- package/dist-lib/lib/core/sync/background.d.ts +35 -0
- package/dist-lib/lib/core/sync/background.js +85 -0
- package/dist-lib/lib/core/sync/changed.d.ts +20 -0
- package/dist-lib/lib/core/sync/changed.js +7 -0
- package/dist-lib/lib/core/sync/devices.js +6 -3
- package/dist-lib/lib/core/sync/files.d.ts +1 -0
- package/dist-lib/lib/core/sync/files.js +50 -72
- package/dist-lib/lib/core/sync/index.d.ts +1 -1
- package/dist-lib/lib/core/sync/index.js +164 -81
- package/dist-lib/lib/core/sync/view-updates.d.ts +33 -0
- package/dist-lib/lib/core/sync/view-updates.js +133 -0
- package/dist-lib/lib/core/sync-status.js +3 -3
- package/dist-lib/lib/core/system-info.d.ts +2 -2
- package/dist-lib/lib/core/system-info.js +10 -11
- package/dist-lib/lib/core/tool-configs.d.ts +5 -3
- package/dist-lib/lib/core/tool-configs.js +11 -11
- package/dist-lib/lib/core/transcript-visibility.d.ts +5 -5
- package/dist-lib/lib/core/transcript-visibility.js +27 -31
- package/dist-lib/lib/core/upgrade-agents.d.ts +11 -0
- package/dist-lib/lib/core/upgrade-agents.js +78 -0
- package/dist-lib/lib/core/video/attachment.d.ts +1 -0
- package/dist-lib/lib/core/video/attachment.js +7 -0
- package/dist-lib/lib/core/video/digest.d.ts +16 -0
- package/dist-lib/lib/core/video/digest.js +57 -0
- package/dist-lib/lib/core/video/frames.d.ts +32 -0
- package/dist-lib/lib/core/video/frames.js +224 -0
- package/dist-lib/lib/core/workspace-upgrade.d.ts +22 -0
- package/dist-lib/lib/core/workspace-upgrade.js +50 -0
- package/dist-lib/lib/core.d.ts +303 -84
- package/dist-lib/lib/core.js +3952 -1511
- package/dist-lib/lib/credential-pusher.d.ts +17 -7
- package/dist-lib/lib/credential-pusher.js +111 -62
- package/dist-lib/lib/custom-model-pusher.d.ts +2 -4
- package/dist-lib/lib/custom-model-task.d.ts +2 -1
- package/dist-lib/lib/custom-model-task.js +2 -2
- package/dist-lib/lib/device-tree.d.ts +18 -0
- package/dist-lib/lib/device-tree.js +32 -0
- package/dist-lib/lib/diagnostics.d.ts +7 -0
- package/dist-lib/lib/diagnostics.js +22 -0
- package/dist-lib/lib/doctor/checks.d.ts +15 -0
- package/dist-lib/lib/doctor/checks.js +272 -0
- package/dist-lib/lib/doctor/redact.d.ts +4 -0
- package/dist-lib/lib/doctor/redact.js +31 -0
- package/dist-lib/lib/doctor/render.d.ts +8 -0
- package/dist-lib/lib/doctor/render.js +83 -0
- package/dist-lib/lib/doctor/tree.d.ts +5 -0
- package/dist-lib/lib/doctor/tree.js +167 -0
- package/dist-lib/lib/downloads-allowed-pusher.d.ts +8 -0
- package/dist-lib/lib/downloads-allowed-pusher.js +37 -0
- package/dist-lib/lib/errors.d.ts +794 -0
- package/dist-lib/lib/errors.js +728 -0
- package/dist-lib/lib/fs-drive-bridge.d.ts +8 -1
- package/dist-lib/lib/fs-drive-bridge.js +312 -31
- package/dist-lib/lib/guards.d.ts +1 -0
- package/dist-lib/lib/guards.js +4 -0
- package/dist-lib/lib/inference-calls.d.ts +1 -2
- package/dist-lib/lib/inference-calls.js +2 -10
- package/dist-lib/lib/integrations/setup-routes.js +7 -5
- package/dist-lib/lib/knowledge-search.d.ts +1 -1
- package/dist-lib/lib/knowledge-search.js +5 -51
- package/dist-lib/lib/kv-cache-reclaim.d.ts +2 -1
- package/dist-lib/lib/kv-cache-reclaim.js +30 -0
- package/dist-lib/lib/kv-cache-retention.d.ts +35 -0
- package/dist-lib/lib/kv-cache-retention.js +98 -0
- package/dist-lib/lib/latest-frame.d.ts +10 -0
- package/dist-lib/lib/latest-frame.js +48 -0
- package/dist-lib/lib/log.d.ts +7 -6
- package/dist-lib/lib/log.js +14 -7
- package/dist-lib/lib/logger-type.d.ts +2 -5
- package/dist-lib/lib/mesh-scoped-engine.js +42 -2
- package/dist-lib/lib/model-download-status.d.ts +3 -3
- package/dist-lib/lib/model-download.d.ts +16 -12
- package/dist-lib/lib/model-download.js +90 -34
- package/dist-lib/lib/model-idle-pusher.d.ts +2 -4
- package/dist-lib/lib/model-memory-cap.d.ts +27 -0
- package/dist-lib/lib/model-memory-cap.js +69 -0
- package/dist-lib/lib/models-watch.d.ts +1 -1
- package/dist-lib/lib/models-watch.js +4 -4
- package/dist-lib/lib/oauth/browser-connect.js +3 -2
- package/dist-lib/lib/oauth/flow-core.js +5 -3
- package/dist-lib/lib/oauth/flow.js +1 -1
- package/dist-lib/lib/oauth/loopback.d.ts +1 -0
- package/dist-lib/lib/oauth/loopback.js +57 -12
- package/dist-lib/lib/oauth/providers.js +4 -2
- package/dist-lib/lib/oauth/redirect-types.d.ts +1 -0
- package/dist-lib/lib/oauth/register.js +35 -19
- package/dist-lib/lib/oauth/request.d.ts +10 -0
- package/dist-lib/lib/oauth/request.js +22 -0
- package/dist-lib/lib/oauth/resolve.js +13 -5
- package/dist-lib/lib/oauth/token-exchange-core.js +31 -33
- package/dist-lib/lib/oauth/types.d.ts +3 -0
- package/dist-lib/lib/oauth.d.ts +2 -1
- package/dist-lib/lib/oauth.js +1 -0
- package/dist-lib/lib/persistent-dir.d.ts +1 -0
- package/dist-lib/lib/persistent-dir.js +9 -0
- package/dist-lib/lib/probe-rounds.d.ts +3 -0
- package/dist-lib/lib/probe-rounds.js +5 -0
- package/dist-lib/lib/reconnecting-watch.js +19 -11
- package/dist-lib/lib/run-input.d.ts +14 -0
- package/dist-lib/lib/run-input.js +33 -0
- package/dist-lib/lib/run-notices.d.ts +5 -0
- package/dist-lib/lib/run-notices.js +13 -2
- package/dist-lib/lib/run-replay.d.ts +44 -0
- package/dist-lib/lib/run-replay.js +158 -0
- package/dist-lib/lib/run-transcript.d.ts +11 -12
- package/dist-lib/lib/run-transcript.js +16 -18
- package/dist-lib/lib/suspend-lifecycle.js +15 -5
- package/dist-lib/lib/task.js +6 -4
- package/dist-lib/lib/test-env.d.ts +1 -0
- package/dist-lib/lib/test-env.js +4 -0
- package/dist-lib/schema/build.js +66 -55
- package/dist-lib/schema/config.d.ts +1 -1
- package/dist-lib/schema/config.js +1 -1
- package/dist-lib/schema/content.d.ts +5 -1
- package/dist-lib/schema/content.js +60 -12
- package/dist-lib/schema/engine.d.ts +1 -0
- package/dist-lib/schema/engine.js +780 -155
- package/dist-lib/schema/field-order.js +8 -1
- package/dist-lib/schema/indexes.d.ts +7 -0
- package/dist-lib/schema/indexes.js +48 -3
- package/dist-lib/schema/local.js +80 -5
- package/dist-lib/schema/qvac.d.ts +4 -1
- package/dist-lib/schema/qvac.js +474 -14
- package/dist-lib/spec/bind.js +212 -48
- package/dist-lib/spec/calls.js +46 -5
- package/dist-lib/spec/capabilities.d.ts +100 -18
- package/dist-lib/spec/config/hyperconf/index.js +1 -1
- package/dist-lib/spec/hrpc/hrpc.json +739 -206
- package/dist-lib/spec/hrpc/index.js +844 -345
- package/dist-lib/spec/hrpc/messages.js +3906 -1749
- package/dist-lib/spec/hyperschema/index.js +3906 -1749
- package/dist-lib/spec/hyperschema/schema.json +4809 -3119
- package/dist-lib/spec/hyperschema/types.d.ts +482 -62
- package/dist-lib/spec/local/hyperdb/db.json +95 -1
- package/dist-lib/spec/local/hyperdb/index.js +459 -2
- package/dist-lib/spec/local/hyperdb/messages.js +1565 -487
- package/dist-lib/spec/local/hyperschema/index.js +573 -16
- package/dist-lib/spec/local/hyperschema/schema.json +354 -1
- package/dist-lib/spec/local/hyperschema/types.d.ts +85 -2
- package/dist-lib/spec/mesh/hyperdb/db.json +577 -7
- package/dist-lib/spec/mesh/hyperdb/index.js +2224 -6
- package/dist-lib/spec/mesh/hyperdb/messages.js +6476 -1266
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +193 -1
- package/dist-lib/spec/mesh/hyperdispatch/index.js +545 -1
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +3655 -265
- package/dist-lib/spec/mesh/hyperschema/index.js +3655 -265
- package/dist-lib/spec/mesh/hyperschema/schema.json +1974 -19
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +498 -6
- package/package.json +64 -43
- package/worker/assistant-sidecar.mjs +18 -2
- package/worker/stow-entry.mjs +2 -0
- package/dist-lib/lib/core/contract/compute.d.ts +0 -11
- package/dist-lib/lib/core/contract/compute.js +0 -48
- package/dist-lib/lib/core/device-invites.d.ts +0 -11
- package/dist-lib/lib/core/device-invites.js +0 -63
- package/dist-lib/lib/core/files/processing/settle.d.ts +0 -13
- package/dist-lib/lib/core/files/processing/settle.js +0 -86
- package/dist-lib/lib/core/grant-expiry.d.ts +0 -11
- package/dist-lib/lib/core/grant-expiry.js +0 -66
- package/dist-lib/lib/core/handoff-channel.d.ts +0 -47
- package/dist-lib/lib/core/handoff-channel.js +0 -123
- package/dist-lib/lib/core/harness-loan.d.ts +0 -29
- package/dist-lib/lib/core/host-run-log-store.d.ts +0 -114
- package/dist-lib/lib/core/host-run-log-store.js +0 -976
- package/dist-lib/lib/core/hosted-agents.d.ts +0 -38
- package/dist-lib/lib/core/hosted-agents.js +0 -140
- package/dist-lib/lib/core/inference-calls-handoff.d.ts +0 -20
- package/dist-lib/lib/core/inference-calls-handoff.js +0 -37
- package/dist-lib/lib/core/inference-calls-receiver.d.ts +0 -14
- package/dist-lib/lib/core/inference-calls-receiver.js +0 -42
- package/dist-lib/lib/core/mesh-seed-handoff.d.ts +0 -25
- package/dist-lib/lib/core/mesh-seed-handoff.js +0 -52
- package/dist-lib/lib/core/migrations/device-indexes.d.ts +0 -2
- package/dist-lib/lib/core/migrations/device-indexes.js +0 -7
- package/dist-lib/lib/core/secret-handoff.d.ts +0 -17
- package/dist-lib/lib/core/secret-handoff.js +0 -29
- package/dist-lib/lib/core/skill-overlay-handoff.d.ts +0 -25
- package/dist-lib/lib/core/skill-overlay-handoff.js +0 -50
- package/dist-lib/lib/core/skill-overlay-receiver.d.ts +0 -8
- package/dist-lib/lib/core/skill-overlay-receiver.js +0 -23
- package/dist-lib/lib/image-cache-dir.d.ts +0 -1
- package/dist-lib/lib/image-cache-dir.js +0 -5
- package/dist-lib/lib/log-levels.d.ts +0 -7
- package/dist-lib/lib/log-levels.js +0 -1
- package/dist-lib/lib/logger.d.ts +0 -5
- package/dist-lib/lib/logger.js +0 -18
- package/dist-lib/lib/oauth/loopback.stub.d.ts +0 -3
- package/dist-lib/lib/oauth/loopback.stub.js +0 -6
- package/tui/README.md +0 -142
- package/tui/app.mjs +0 -6939
- package/tui/boot.mjs +0 -111
- package/tui/index.mjs +0 -53
- package/tui/lib/boot-timing.mjs +0 -41
- package/tui/lib/busy-words.mjs +0 -116
- package/tui/lib/export.mjs +0 -194
- package/tui/lib/knowledge-command.mjs +0 -190
- package/tui/lib/knowledge-import.mjs +0 -171
- package/tui/lib/render.mjs +0 -196
- package/tui/lib/save-file.mjs +0 -88
- package/tui/lib/select.mjs +0 -81
- package/tui/lib/selection.mjs +0 -18
- package/tui/lib/setup.mjs +0 -101
- package/tui/lib/sidebar.mjs +0 -63
- package/tui/lib/splash-art.mjs +0 -107
- package/tui/lib/splash.mjs +0 -18
- package/tui/lib/upload-frames.mjs +0 -9
- package/tui/lib/usage.mjs +0 -59
- package/tui/lib/wrap.mjs +0 -143
- package/tui/main.mjs +0 -264
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qvac/core",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Peer-to-peer AI across your devices",
|
|
6
6
|
"engines": {
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"types": "./dist-lib/lib/constants.d.ts",
|
|
24
24
|
"default": "./dist-lib/lib/constants.js"
|
|
25
25
|
},
|
|
26
|
+
"./errors": {
|
|
27
|
+
"types": "./dist-lib/lib/errors.d.ts",
|
|
28
|
+
"default": "./dist-lib/lib/errors.js"
|
|
29
|
+
},
|
|
26
30
|
"./credentials/obsidian": {
|
|
27
31
|
"types": "./dist-lib/lib/obsidian-key.d.ts",
|
|
28
32
|
"default": "./dist-lib/lib/obsidian-key.js"
|
|
@@ -105,14 +109,8 @@
|
|
|
105
109
|
"default": "./dist-lib/lib/oauth/fetch-platform.js"
|
|
106
110
|
},
|
|
107
111
|
"./oauth/runtime/loopback": {
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
"default": "./dist-lib/lib/oauth/loopback.stub.js"
|
|
111
|
-
},
|
|
112
|
-
"default": {
|
|
113
|
-
"types": "./dist-lib/lib/oauth/loopback.d.ts",
|
|
114
|
-
"default": "./dist-lib/lib/oauth/loopback.js"
|
|
115
|
-
}
|
|
112
|
+
"types": "./dist-lib/lib/oauth/loopback.d.ts",
|
|
113
|
+
"default": "./dist-lib/lib/oauth/loopback.js"
|
|
116
114
|
},
|
|
117
115
|
"./credential-pusher": {
|
|
118
116
|
"types": "./dist-lib/lib/credential-pusher.d.ts",
|
|
@@ -133,40 +131,53 @@
|
|
|
133
131
|
"./suspend-lifecycle": {
|
|
134
132
|
"types": "./dist-lib/lib/suspend-lifecycle.d.ts",
|
|
135
133
|
"default": "./dist-lib/lib/suspend-lifecycle.js"
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
"bin": {
|
|
139
|
-
"duck": "./tui/index.mjs"
|
|
134
|
+
},
|
|
135
|
+
"./sidecar-entry": "./worker/stow-entry.mjs"
|
|
140
136
|
},
|
|
141
137
|
"scripts": {
|
|
142
|
-
"build:splash": "node tui/build-splash.mjs",
|
|
143
138
|
"build:schema": "bare schema/build.ts",
|
|
139
|
+
"bench:chat-speed": "QVAC_TEST_MODELS=1 QVAC_TEST=1 QVAC_NO_SKILL_BIN_PROBE=1 bare bench/chat-speed/bench.ts",
|
|
140
|
+
"bench:chat-speed:report": "node --experimental-strip-types bench/chat-speed/report.ts",
|
|
141
|
+
"bench:chat-speed:test": "node --experimental-strip-types bench/chat-speed/test/metrics.ts && node --experimental-strip-types bench/chat-speed/test/report.ts",
|
|
144
142
|
"bench:rag": "node --experimental-strip-types bench/rag/cli.ts",
|
|
145
143
|
"bench:rag:database": "node --experimental-strip-types bench/rag/database/cli.ts",
|
|
144
|
+
"bench:rag:indexing": "node --experimental-strip-types bench/rag/indexing/cli.ts",
|
|
145
|
+
"bench:rag:indexing:generate": "node --experimental-strip-types bench/rag/indexing/generate.ts",
|
|
146
146
|
"bench:rag:pilot": "node --experimental-strip-types bench/rag/pilot.ts",
|
|
147
147
|
"bench:rag:test": "node --experimental-strip-types bench/rag/test/all.ts",
|
|
148
148
|
"bench:rag:typecheck": "tsc -p bench/rag/tsconfig.json",
|
|
149
|
-
"
|
|
149
|
+
"bench:served-rounds": "bare bench/served-rounds/bench.ts",
|
|
150
150
|
"mesh-two-people": "bare examples/mesh-two-people.mjs",
|
|
151
|
-
"mesh-lend-a-model": "bare examples/mesh-lend-a-model.mjs",
|
|
152
151
|
"mesh-capability-run": "bare examples/mesh-capability-run.mjs",
|
|
153
152
|
"model-idle-limit": "bare examples/model-idle-limit.mjs",
|
|
153
|
+
"model-memory-cap": "bare examples/model-memory-cap.mjs",
|
|
154
|
+
"device-models": "bare examples/device-models.mjs",
|
|
154
155
|
"model-load-unload": "bare examples/model-load-unload.mjs",
|
|
155
156
|
"model-users": "bare examples/model-users.mjs",
|
|
156
157
|
"models-by-task": "bare examples/models-by-task.mjs",
|
|
157
158
|
"models-watch": "bare examples/models-watch.mjs",
|
|
159
|
+
"error-codes": "bare examples/error-codes.mjs",
|
|
160
|
+
"model-downloads-held": "bare examples/model-downloads-held.mjs",
|
|
161
|
+
"blind-peering": "bare examples/blind-peering.mjs",
|
|
162
|
+
"agent-folders": "bare examples/agent-folders.mjs",
|
|
163
|
+
"chunks-delta-watch": "bare examples/chunks-delta-watch.mjs",
|
|
158
164
|
"mesh-pair-and-migrate": "bare examples/mesh-pair-and-migrate.mjs",
|
|
159
165
|
"mesh-scoped-catalog": "bare examples/mesh-scoped-catalog.mjs",
|
|
160
166
|
"mesh-peer": "bare examples/mesh-peer.mjs",
|
|
167
|
+
"device-tree": "bare examples/device-tree.mjs",
|
|
161
168
|
"mesh-member-admin": "bare examples/mesh-member-admin.mjs",
|
|
162
169
|
"mesh-lab": "bare examples/mesh-lab.mjs",
|
|
163
170
|
"chat-read-marker": "bare examples/chat-read-marker.mjs",
|
|
171
|
+
"chat-move": "bare examples/chat-move.mjs",
|
|
172
|
+
"chat-fork": "bare examples/chat-fork.mjs",
|
|
164
173
|
"custom-models": "bare examples/custom-models.mjs",
|
|
165
174
|
"mesh-recover-account": "bare examples/mesh-recover-account.mjs",
|
|
166
175
|
"mesh-user-names": "bare examples/mesh-user-names.mjs",
|
|
167
|
-
"test": "npm run test:bare && npm run bench:rag:test",
|
|
168
|
-
"test:bare": "QVAC_NO_SKILL_BIN_PROBE=1 brittle-jobs -j 2 --
|
|
176
|
+
"test": "npm run test:bare && npm run bench:rag:test && npm run bench:chat-speed:test",
|
|
177
|
+
"test:bare": "QVAC_NO_SKILL_BIN_PROBE=1 QVAC_TEST=1 brittle-jobs -j ${BRITTLE_JOBS:-2} --timeout ${BRITTLE_TIMEOUT:-180000} 'test/*.ts' 'test/{api,app,basic,host,rag}/**/*.ts'",
|
|
169
178
|
"test:model": "QVAC_TEST_MODELS=1 npm run test:bare",
|
|
179
|
+
"test:model-lane": "QVAC_NO_SKILL_BIN_PROBE=1 QVAC_TEST=1 brittle-jobs -j 1 --timeout 7200000 'test/model/*.ts'",
|
|
180
|
+
"test:scale": "QVAC_NO_SKILL_BIN_PROBE=1 QVAC_TEST=1 QVAC_SCALE_REPORT=${QVAC_SCALE_REPORT:-scale-report.txt} brittle-jobs -j 1 --timeout ${BRITTLE_TIMEOUT:-600000} --idle-timeout ${BRITTLE_IDLE_TIMEOUT:-300000} 'test/scale/*.ts'",
|
|
170
181
|
"format": "prettier . --write",
|
|
171
182
|
"lint": "prettier . --check && lunte && tsc --noEmit",
|
|
172
183
|
"build:bundle": "node scripts/build-bundle.mjs",
|
|
@@ -223,10 +234,6 @@
|
|
|
223
234
|
"bare": "bare-worker",
|
|
224
235
|
"default": "worker_threads"
|
|
225
236
|
},
|
|
226
|
-
"#oauth-loopback": {
|
|
227
|
-
"bare": "./dist-lib/lib/oauth/loopback.stub.js",
|
|
228
|
-
"default": "./dist-lib/lib/oauth/loopback.js"
|
|
229
|
-
},
|
|
230
237
|
"#cpu-info": {
|
|
231
238
|
"bare": "bare-cpu-info",
|
|
232
239
|
"default": "./dist-lib/lib/core/cpu-info-node.js"
|
|
@@ -237,10 +244,12 @@
|
|
|
237
244
|
}
|
|
238
245
|
},
|
|
239
246
|
"dependencies": {
|
|
240
|
-
"@qvac/
|
|
241
|
-
"@qvac/
|
|
247
|
+
"@qvac/error": "^0.2.0",
|
|
248
|
+
"@qvac/harness": "1.0.0-rc.12",
|
|
249
|
+
"@qvac/logging": "^0.2.0",
|
|
250
|
+
"@qvac/skills": "^0.1.19",
|
|
242
251
|
"asenion": "^0.1.0",
|
|
243
|
-
"autobee": "^2.
|
|
252
|
+
"autobee": "^2.12.1",
|
|
244
253
|
"b4a": "^1.9.0",
|
|
245
254
|
"bare-abort-controller": "^1.1.2",
|
|
246
255
|
"bare-buffer": "^3.6.1",
|
|
@@ -248,14 +257,16 @@
|
|
|
248
257
|
"bare-crypto": "^1.15.3",
|
|
249
258
|
"bare-events": "^2.9.1",
|
|
250
259
|
"bare-fetch": "^3.0.1",
|
|
260
|
+
"bare-ffmpeg": "^1.5.0",
|
|
251
261
|
"bare-file-logger": "^1.2.1",
|
|
252
262
|
"bare-fs": "^4.7.2",
|
|
253
263
|
"bare-gpu-info": "^0.1.0",
|
|
254
264
|
"bare-http1": "4.6.1",
|
|
255
265
|
"bare-media": "^2.10.0",
|
|
266
|
+
"bare-module": "~7.4.0",
|
|
256
267
|
"bare-os": "^3.9.1",
|
|
257
268
|
"bare-path": "^3.0.1",
|
|
258
|
-
"bare-pdfium": "^1.
|
|
269
|
+
"bare-pdfium": "^1.8.0",
|
|
259
270
|
"bare-pipe": "^4.2.2",
|
|
260
271
|
"bare-process": "^4.5.1",
|
|
261
272
|
"bare-rpc": "^1.3.7",
|
|
@@ -266,39 +277,37 @@
|
|
|
266
277
|
"bare-subprocess": "^6.1.0",
|
|
267
278
|
"bare-supervisor": "^0.1.1",
|
|
268
279
|
"bare-system-logger": "^1.0.3",
|
|
269
|
-
"bare-tui": "^0.3.0",
|
|
270
280
|
"bare-url": "^2.4.5",
|
|
271
281
|
"bare-worker": "^4.5.0",
|
|
272
282
|
"blind-peer": "^3.10.2",
|
|
273
|
-
"blind-peering": "
|
|
283
|
+
"blind-peering": "2.9.5",
|
|
274
284
|
"compact-encoding": "^3.4.0",
|
|
275
285
|
"corestore": "^7.12.6",
|
|
276
286
|
"hrpc": "^4.3.0",
|
|
277
|
-
"hyperbee2": "^2.18.0",
|
|
278
287
|
"hyperblobs": "^2.12.1",
|
|
279
288
|
"hyperconf": "^1.0.3",
|
|
280
|
-
"hypercore-blob-server": "^1.
|
|
289
|
+
"hypercore-blob-server": "^1.15.1",
|
|
281
290
|
"hypercore-crypto": "^3.7.0",
|
|
282
291
|
"hypercore-id-encoding": "^1.3.0",
|
|
283
|
-
"hypercore-storage": "^3.
|
|
284
|
-
"hyperdb": "^6.
|
|
292
|
+
"hypercore-storage": "^3.4.0",
|
|
293
|
+
"hyperdb": "^6.11.0",
|
|
285
294
|
"hyperdispatch": "^1.6.0",
|
|
286
295
|
"hyperdrive": "^13.3.3",
|
|
287
296
|
"hyperschema": "1.26.2",
|
|
288
297
|
"hyperschema-ts": "^0.1.1",
|
|
289
298
|
"hyperswarm": "^4.17.0",
|
|
290
299
|
"keet-identity-key": "^3.2.0",
|
|
291
|
-
"paparam": "^1.13.0",
|
|
292
300
|
"process-top": "^1.7.1",
|
|
293
301
|
"protomux": "^3.11.0",
|
|
294
302
|
"protomux-wakeup": "^2.9.0",
|
|
295
303
|
"rache": "^1.0.0",
|
|
296
|
-
"rag-extract": "^0.
|
|
304
|
+
"rag-extract": "^0.2.2",
|
|
297
305
|
"ready-guard": "^1.0.0",
|
|
298
306
|
"ready-resource": "^1.2.0",
|
|
299
307
|
"rocksdb-native": "^3.17.4",
|
|
300
308
|
"safety-catch": "^1.0.3",
|
|
301
309
|
"scope-lock": "^1.2.4",
|
|
310
|
+
"sodium-universal": "^5.0.0",
|
|
302
311
|
"streamx": "^2.28.0",
|
|
303
312
|
"suspendify": "^1.7.2",
|
|
304
313
|
"which-runtime": "^1.4.0",
|
|
@@ -306,6 +315,15 @@
|
|
|
306
315
|
"zod": "^4.3.6"
|
|
307
316
|
},
|
|
308
317
|
"devDependencies": {
|
|
318
|
+
"@qvac/core-previous": "npm:@qvac/core@0.10.3",
|
|
319
|
+
"@qvac/asr-ggml": "0.4.2",
|
|
320
|
+
"@qvac/audiogen-ggml": "^0.8.0",
|
|
321
|
+
"@qvac/diffusion-cpp": "^0.30.0",
|
|
322
|
+
"@qvac/embed-llamacpp": "0.48.2",
|
|
323
|
+
"@qvac/langdetect-text": "^0.1.2",
|
|
324
|
+
"@qvac/llm-llamacpp": "^0.61.1",
|
|
325
|
+
"@qvac/ocr-ggml": "^0.29.1",
|
|
326
|
+
"@qvac/tts-ggml": "^0.13.0",
|
|
309
327
|
"@types/node": "^26.4.0",
|
|
310
328
|
"bare-bundle": "^1.10.0",
|
|
311
329
|
"bare-module-lexer": "^1.6.3",
|
|
@@ -317,8 +335,8 @@
|
|
|
317
335
|
"holepunch-types": "^0.2.2",
|
|
318
336
|
"hyperdht": "^6.32.0",
|
|
319
337
|
"hyperschema-regen": "^3.0.1",
|
|
320
|
-
"lunte": "^1.8.
|
|
321
|
-
"lunte-plugin-qvac": "^0.
|
|
338
|
+
"lunte": "^1.8.6",
|
|
339
|
+
"lunte-plugin-qvac": "^0.2.0",
|
|
322
340
|
"prettier": "^3.6.2",
|
|
323
341
|
"prettier-config-holepunch": "^2.0.0",
|
|
324
342
|
"prettytap": "^0.2.0",
|
|
@@ -338,12 +356,14 @@
|
|
|
338
356
|
},
|
|
339
357
|
"homepage": "https://github.com/tetherto/qvac-core",
|
|
340
358
|
"patchedDependencies": {
|
|
341
|
-
"hypercore-blob-server@1.15.0": "patches/hypercore-blob-server@1.15.0.patch",
|
|
342
359
|
"pyodide@314.0.2": "patches/pyodide@314.0.2.patch",
|
|
343
360
|
"localwatch@1.4.3": "patches/localwatch@1.4.3.patch",
|
|
344
361
|
"bare-stow@0.1.5": "patches/bare-stow@0.1.5.patch",
|
|
345
|
-
"@
|
|
346
|
-
"hyperdb@6.
|
|
362
|
+
"blind-peering@2.9.5": "patches/blind-peering@2.9.5.patch",
|
|
363
|
+
"hyperdb@6.11.0": "patches/hyperdb@6.11.0.patch",
|
|
364
|
+
"corestore@7.12.6": "patches/corestore@7.12.6.patch",
|
|
365
|
+
"hyperschema@1.26.2": "patches/hyperschema@1.26.2.patch",
|
|
366
|
+
"hyperbee2@2.21.2": "patches/hyperbee2@2.21.2.patch"
|
|
347
367
|
},
|
|
348
368
|
"overrides": {
|
|
349
369
|
"bare-sidecar": "0.5.7",
|
|
@@ -354,10 +374,11 @@
|
|
|
354
374
|
"bare-http1": "4.6.1",
|
|
355
375
|
"lodash": "4.18.1",
|
|
356
376
|
"hyperschema": "1.26.2",
|
|
357
|
-
"hyperdb": "^6.
|
|
358
|
-
"hypercore": "^11.
|
|
359
|
-
"hyperbee2": "^2.
|
|
360
|
-
"tar": "^7.5.22"
|
|
377
|
+
"hyperdb": "^6.11.0",
|
|
378
|
+
"hypercore": "^11.39.5",
|
|
379
|
+
"hyperbee2": "^2.21.2",
|
|
380
|
+
"tar": "^7.5.22",
|
|
381
|
+
"bare-tls": "^3.1.13"
|
|
361
382
|
},
|
|
362
383
|
"publishConfig": {
|
|
363
384
|
"access": "public"
|
|
@@ -6,6 +6,7 @@ import { Core, assistantChild, clientSessions } from '../dist-lib/index.js'
|
|
|
6
6
|
import { DEFAULT_RAG_MODEL } from '../dist-lib/lib/core/files/rag/models.js'
|
|
7
7
|
import { Logger, toLoggerOptions } from '../dist-lib/lib/log.js'
|
|
8
8
|
import { releaseChannel, resolveStorage } from '@qvac/harness/storage'
|
|
9
|
+
import { closeOfficeWorker, extractOfficeText } from '@qvac/harness/office'
|
|
9
10
|
import {
|
|
10
11
|
DEFAULT_IMAGE_MODEL_CHOICE,
|
|
11
12
|
DEFAULT_MUSIC_MODEL_CHOICE,
|
|
@@ -33,7 +34,10 @@ export default stowEntry((ipc) => {
|
|
|
33
34
|
app = undefined,
|
|
34
35
|
llm = DEFAULT_KV_CACHE,
|
|
35
36
|
hostsModelSource = true,
|
|
36
|
-
eager = true
|
|
37
|
+
eager = true,
|
|
38
|
+
// undefined keeps Core's own choice; false lets a host start without fetching default models
|
|
39
|
+
autoDownloadModels = undefined,
|
|
40
|
+
fakeModels = false
|
|
37
41
|
} = JSON.parse(Bare.argv[2] || '{}')
|
|
38
42
|
|
|
39
43
|
const bootstrapNodes = bootstrapJson ? JSON.parse(bootstrapJson) : undefined
|
|
@@ -74,6 +78,7 @@ export default stowEntry((ipc) => {
|
|
|
74
78
|
bootstrapNodes,
|
|
75
79
|
app: app ? { ...app, channel } : undefined,
|
|
76
80
|
hostsModelSource,
|
|
81
|
+
autoDownloadModels,
|
|
77
82
|
apiLifecycle: {
|
|
78
83
|
suspend: () => sup.suspend(),
|
|
79
84
|
resume: () => sup.resume()
|
|
@@ -87,7 +92,12 @@ export default stowEntry((ipc) => {
|
|
|
87
92
|
.catch((err) => logger.warn('assistant-sidecar', 'session reset failed', err?.message))
|
|
88
93
|
})
|
|
89
94
|
|
|
95
|
+
sup.add('office', {
|
|
96
|
+
start: () => ({ close: closeOfficeWorker })
|
|
97
|
+
})
|
|
98
|
+
|
|
90
99
|
sup.add('core', {
|
|
100
|
+
deps: ['office'],
|
|
91
101
|
start: () => core,
|
|
92
102
|
presuspend: (handle) => handle.presuspend(),
|
|
93
103
|
suspend: (handle) => handle.suspend(),
|
|
@@ -98,6 +108,7 @@ export default stowEntry((ipc) => {
|
|
|
98
108
|
sup.add(
|
|
99
109
|
'assistant',
|
|
100
110
|
assistantChild({
|
|
111
|
+
extractors: { office: extractOfficeText },
|
|
101
112
|
// knowledge indexing volunteers this device; rebuilt against each harness incarnation
|
|
102
113
|
embedder: (harness) => ({
|
|
103
114
|
model: DEFAULT_RAG_MODEL,
|
|
@@ -116,7 +127,12 @@ export default stowEntry((ipc) => {
|
|
|
116
127
|
eager
|
|
117
128
|
}),
|
|
118
129
|
onHarness: (harness, { engine }) => startCredentialPusher(harness, engine, logger),
|
|
119
|
-
|
|
130
|
+
// the sweep drops what this mesh does not reference, so a shared dir loses other instances' pages
|
|
131
|
+
imageCacheDir: `${storage.root}/image-cache`,
|
|
132
|
+
inferenceCallsDir: `${storage.root}/inspector`,
|
|
133
|
+
runReplayDir: `${storage.root}/run-replay`,
|
|
134
|
+
logger,
|
|
135
|
+
fakeModels
|
|
120
136
|
})
|
|
121
137
|
)
|
|
122
138
|
|
package/worker/stow-entry.mjs
CHANGED
|
@@ -28,6 +28,8 @@ async function shutdown(code, err = null) {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
if (err) {
|
|
31
|
+
// the host may not be listening yet, so the reason also lands in the log
|
|
32
|
+
console.error(err.stack || err.message || err)
|
|
31
33
|
ipc.send('error', { message: err.message, stack: err.stack })
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Router } from '../../../spec/mesh/hyperdispatch/index.js';
|
|
2
|
-
declare const DROPPED: readonly ['@qvac/append-chunk', '@qvac/update-chunk', '@qvac/resolve-approval', '@qvac/put-agent', '@qvac/put-approval-rule', '@qvac/seed-defaults', '@qvac/add-knowledge', '@qvac/remove-knowledge', '@qvac/add-knowledge-artifact', '@qvac/claim-indexing', '@qvac/resolve-indexing', '@qvac/put-chat', '@qvac/put-tool-configs', '@qvac/append-tool-activity', '@qvac/migrate-agent-catalog', '@qvac/reindex-agents', '@qvac/put-chat-group', '@qvac/put-joined-mesh', '@qvac/purge-chat'];
|
|
3
|
-
export type DroppedComputeRoute = (typeof DROPPED)[number];
|
|
4
|
-
export declare function droppedComputeRoutes(): ReadonlyArray<DroppedComputeRoute>;
|
|
5
|
-
export declare class ComputeRouteDropped extends Error {
|
|
6
|
-
readonly route: string;
|
|
7
|
-
constructor(route: string);
|
|
8
|
-
}
|
|
9
|
-
export declare function assertComputeRoute(compute: boolean, name: string): void;
|
|
10
|
-
export declare function registerComputeDrops(router: Router): void;
|
|
11
|
-
export {};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const DROPPED = [
|
|
2
|
-
'@qvac/append-chunk',
|
|
3
|
-
'@qvac/update-chunk',
|
|
4
|
-
'@qvac/resolve-approval',
|
|
5
|
-
'@qvac/put-agent',
|
|
6
|
-
'@qvac/put-approval-rule',
|
|
7
|
-
'@qvac/seed-defaults',
|
|
8
|
-
'@qvac/add-knowledge',
|
|
9
|
-
'@qvac/remove-knowledge',
|
|
10
|
-
'@qvac/add-knowledge-artifact',
|
|
11
|
-
'@qvac/claim-indexing',
|
|
12
|
-
'@qvac/resolve-indexing',
|
|
13
|
-
'@qvac/put-chat',
|
|
14
|
-
'@qvac/put-tool-configs',
|
|
15
|
-
'@qvac/append-tool-activity',
|
|
16
|
-
'@qvac/migrate-agent-catalog',
|
|
17
|
-
'@qvac/reindex-agents',
|
|
18
|
-
'@qvac/put-chat-group',
|
|
19
|
-
'@qvac/put-joined-mesh',
|
|
20
|
-
'@qvac/purge-chat'
|
|
21
|
-
];
|
|
22
|
-
const DROPPED_ROUTES = new Set(DROPPED);
|
|
23
|
-
export function droppedComputeRoutes() {
|
|
24
|
-
return DROPPED;
|
|
25
|
-
}
|
|
26
|
-
export class ComputeRouteDropped extends Error {
|
|
27
|
-
route;
|
|
28
|
-
constructor(route) {
|
|
29
|
-
super(`${route} is dropped on a compute mesh: it carries only delegated work`);
|
|
30
|
-
this.name = 'ComputeRouteDropped';
|
|
31
|
-
this.route = route;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function assertComputeRoute(compute, name) {
|
|
35
|
-
if (!compute)
|
|
36
|
-
return;
|
|
37
|
-
const route = `@qvac/${name}`;
|
|
38
|
-
if (DROPPED_ROUTES.has(route)) {
|
|
39
|
-
throw new ComputeRouteDropped(route);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export function registerComputeDrops(router) {
|
|
43
|
-
for (const name of DROPPED) {
|
|
44
|
-
router.add(name, async (_op, { log }) => {
|
|
45
|
-
log?.debug('contract', `${name} dropped: this mesh carries only delegated work`);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const DEVICE_INVITE_SPENT = "This device invite has already been used";
|
|
2
|
-
export interface DeviceInvites {
|
|
3
|
-
issue(): Promise<Buffer>;
|
|
4
|
-
redeem(token: Buffer | null | undefined, deviceId: Buffer): Promise<boolean>;
|
|
5
|
-
spent(token: Buffer | null | undefined, deviceId: Buffer): Promise<boolean>;
|
|
6
|
-
}
|
|
7
|
-
export interface DeviceInviteStore {
|
|
8
|
-
get(key: string): Promise<unknown>;
|
|
9
|
-
set(key: string, value: unknown): Promise<void>;
|
|
10
|
-
}
|
|
11
|
-
export declare function openDeviceInvites(store: DeviceInviteStore): DeviceInvites;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import crypto from 'hypercore-crypto';
|
|
2
|
-
import ScopeLock from 'scope-lock';
|
|
3
|
-
import { deviceInviteToken } from './identity.js';
|
|
4
|
-
import b4a from 'b4a';
|
|
5
|
-
const NONCES_KEY = 'device-invite-nonces';
|
|
6
|
-
const INVITE_TTL_MS = 48 * 60 * 60 * 1000;
|
|
7
|
-
const MAX_OUTSTANDING = 5;
|
|
8
|
-
export const DEVICE_INVITE_SPENT = 'This device invite has already been used';
|
|
9
|
-
export function openDeviceInvites(store) {
|
|
10
|
-
const lock = new ScopeLock();
|
|
11
|
-
async function outstanding() {
|
|
12
|
-
const value = await store.get(NONCES_KEY);
|
|
13
|
-
const now = Date.now();
|
|
14
|
-
return (Array.isArray(value) ? value : []).filter((entry) => typeof entry?.nonce === 'string' && now - entry.issuedAt < INVITE_TTL_MS);
|
|
15
|
-
}
|
|
16
|
-
function matching(issued, token, deviceId) {
|
|
17
|
-
return issued.findIndex(({ nonce }) => b4a.equals(deviceInviteToken(b4a.from(nonce, 'hex'), deviceId), token));
|
|
18
|
-
}
|
|
19
|
-
return {
|
|
20
|
-
async issue() {
|
|
21
|
-
const nonce = crypto.randomBytes(32);
|
|
22
|
-
await lock.lock();
|
|
23
|
-
try {
|
|
24
|
-
const issued = await outstanding();
|
|
25
|
-
const spent = issued.filter((entry) => entry.spent);
|
|
26
|
-
const kept = issued.filter((entry) => !entry.spent).slice(-(MAX_OUTSTANDING - 1));
|
|
27
|
-
await store.set(NONCES_KEY, [
|
|
28
|
-
...spent,
|
|
29
|
-
...kept,
|
|
30
|
-
{ nonce: b4a.toHex(nonce), issuedAt: Date.now() }
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
finally {
|
|
34
|
-
lock.unlock();
|
|
35
|
-
}
|
|
36
|
-
return nonce;
|
|
37
|
-
},
|
|
38
|
-
async redeem(token, deviceId) {
|
|
39
|
-
if (!token)
|
|
40
|
-
return false;
|
|
41
|
-
await lock.lock();
|
|
42
|
-
try {
|
|
43
|
-
const issued = await outstanding();
|
|
44
|
-
const index = matching(issued, token, deviceId);
|
|
45
|
-
if (index === -1 || issued[index].spent) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
await store.set(NONCES_KEY, issued.map((entry, i) => (i === index ? { ...entry, spent: true } : entry)));
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
finally {
|
|
52
|
-
lock.unlock();
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
async spent(token, deviceId) {
|
|
56
|
-
if (!token)
|
|
57
|
-
return false;
|
|
58
|
-
const issued = await outstanding();
|
|
59
|
-
const index = matching(issued, token, deviceId);
|
|
60
|
-
return index !== -1 && issued[index].spent === true;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { AbortSignal } from 'bare-abort-controller';
|
|
2
|
-
import type { Files } from '../index.ts';
|
|
3
|
-
import type { FileProcessing } from './index.ts';
|
|
4
|
-
export interface SettleOptions {
|
|
5
|
-
readonly timeoutMs?: number;
|
|
6
|
-
readonly signal?: AbortSignal;
|
|
7
|
-
}
|
|
8
|
-
export interface SettleFilesOptions extends SettleOptions {
|
|
9
|
-
readonly ids: string[];
|
|
10
|
-
readonly processing: FileProcessing;
|
|
11
|
-
readonly chatIds: () => Promise<string[]>;
|
|
12
|
-
}
|
|
13
|
-
export declare function settleFiles(files: Files, options: SettleFilesOptions): Promise<void>;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { AbortedError } from '@qvac/harness/race-abort';
|
|
2
|
-
export function settleFiles(files, options) {
|
|
3
|
-
const { ids, processing, signal, timeoutMs = 5_000 } = options;
|
|
4
|
-
if (signal?.aborted) {
|
|
5
|
-
return Promise.reject(new AbortedError());
|
|
6
|
-
}
|
|
7
|
-
if (!ids.length || timeoutMs <= 0 || files.closed) {
|
|
8
|
-
return Promise.resolve();
|
|
9
|
-
}
|
|
10
|
-
const deadline = Date.now() + timeoutMs;
|
|
11
|
-
const wanted = new Set(ids);
|
|
12
|
-
return new Promise((resolve, reject) => {
|
|
13
|
-
let done = false;
|
|
14
|
-
let checking = false;
|
|
15
|
-
let dirty = false;
|
|
16
|
-
const timer = setTimeout(() => finish(), timeoutMs);
|
|
17
|
-
const finish = (error) => {
|
|
18
|
-
if (done)
|
|
19
|
-
return;
|
|
20
|
-
done = true;
|
|
21
|
-
clearTimeout(timer);
|
|
22
|
-
files.unwatch(check);
|
|
23
|
-
files.off('close', onClose);
|
|
24
|
-
signal?.removeEventListener('abort', onAbort);
|
|
25
|
-
if (error) {
|
|
26
|
-
reject(error);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
resolve();
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
const onClose = () => finish();
|
|
33
|
-
const onAbort = () => finish(new AbortedError());
|
|
34
|
-
const chats = options.chatIds();
|
|
35
|
-
const check = () => {
|
|
36
|
-
dirty = true;
|
|
37
|
-
if (checking || done) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
checking = true;
|
|
41
|
-
void (async () => {
|
|
42
|
-
while (dirty && !done) {
|
|
43
|
-
dirty = false;
|
|
44
|
-
const snapshots = await Promise.all((await chats).map((chatId) => files.status(chatId)));
|
|
45
|
-
if (done) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (!processing.active) {
|
|
49
|
-
return finish();
|
|
50
|
-
}
|
|
51
|
-
const waiting = snapshots
|
|
52
|
-
.flatMap((snapshot) => snapshot.files)
|
|
53
|
-
.some((file) => {
|
|
54
|
-
if (!wanted.has(file.fileId) || file.readyForChat)
|
|
55
|
-
return false;
|
|
56
|
-
const rag = file.processors.find((entry) => entry.processorId === 'rag');
|
|
57
|
-
if (!rag || rag.state === 'not-applicable') {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
if (rag.state === 'failed' && (!rag.retryAt || rag.retryAt > deadline)) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
return (processing.pending(file.fileId) ||
|
|
64
|
-
rag.state === 'running' ||
|
|
65
|
-
(rag.retryAt !== undefined && rag.retryAt <= deadline));
|
|
66
|
-
});
|
|
67
|
-
if (!waiting) {
|
|
68
|
-
finish();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})()
|
|
72
|
-
.catch(finish)
|
|
73
|
-
.finally(() => {
|
|
74
|
-
checking = false;
|
|
75
|
-
if (dirty && !done) {
|
|
76
|
-
check();
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
files.watch(check);
|
|
81
|
-
files.on('close', onClose);
|
|
82
|
-
signal?.addEventListener('abort', onAbort, { once: true });
|
|
83
|
-
processing.prioritize(ids);
|
|
84
|
-
check();
|
|
85
|
-
});
|
|
86
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Mesh } from './mesh.ts';
|
|
2
|
-
export declare class GrantExpiry {
|
|
3
|
-
private readonly _mesh;
|
|
4
|
-
private readonly _onError;
|
|
5
|
-
private readonly _timer;
|
|
6
|
-
private _pass;
|
|
7
|
-
constructor(mesh: Mesh, onError: (err: unknown) => void);
|
|
8
|
-
refresh(): Promise<void>;
|
|
9
|
-
close(): void;
|
|
10
|
-
private _sweep;
|
|
11
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { liveDeviceForWriter } from './contract/activity.js';
|
|
2
|
-
import { DeadlineScheduler } from '../deadline.js';
|
|
3
|
-
import { MESH_INVITE_GRANTS } from './collections.js';
|
|
4
|
-
const MAX_DELAY_MS = 2 ** 31 - 1;
|
|
5
|
-
export class GrantExpiry {
|
|
6
|
-
_mesh;
|
|
7
|
-
_onError;
|
|
8
|
-
_timer;
|
|
9
|
-
_pass = Promise.resolve();
|
|
10
|
-
constructor(mesh, onError) {
|
|
11
|
-
this._mesh = mesh;
|
|
12
|
-
this._onError = onError;
|
|
13
|
-
this._timer = new DeadlineScheduler(() => void this.refresh());
|
|
14
|
-
}
|
|
15
|
-
refresh() {
|
|
16
|
-
this._pass = this._pass.then(() => this._sweep()).catch(this._onError);
|
|
17
|
-
return this._pass;
|
|
18
|
-
}
|
|
19
|
-
close() {
|
|
20
|
-
this._timer.clear();
|
|
21
|
-
}
|
|
22
|
-
async _sweep() {
|
|
23
|
-
const mesh = this._mesh;
|
|
24
|
-
this._timer.clear();
|
|
25
|
-
if (mesh.closing || !mesh.writable) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const now = Date.now();
|
|
29
|
-
const expired = [];
|
|
30
|
-
let soonest = Infinity;
|
|
31
|
-
const snap = mesh.view.snapshot();
|
|
32
|
-
try {
|
|
33
|
-
if (!(await liveDeviceForWriter(snap, mesh.localWriterKey))) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
for await (const grant of snap.find(MESH_INVITE_GRANTS)) {
|
|
37
|
-
if (grant.revokedAt || !grant.expiresAt)
|
|
38
|
-
continue;
|
|
39
|
-
if (now > grant.expiresAt) {
|
|
40
|
-
expired.push(grant.grantKey);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
soonest = Math.min(soonest, grant.expiresAt);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
finally {
|
|
48
|
-
await snap.close();
|
|
49
|
-
}
|
|
50
|
-
if (mesh.closing) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (expired.length) {
|
|
54
|
-
const batch = mesh.batch();
|
|
55
|
-
for (const grantKey of expired) {
|
|
56
|
-
batch.dispatch('put-mesh-invite-grant', {
|
|
57
|
-
grant: { grantKey, revokedAt: now, updatedAt: now }
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
await batch.flush();
|
|
61
|
-
}
|
|
62
|
-
if (soonest !== Infinity && !mesh.closing) {
|
|
63
|
-
this._timer.schedule(Math.min(soonest, now + MAX_DELAY_MS));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|