@qvac/core 1.0.0-rc.0 → 1.0.0-rc.10
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 +1203 -1
- package/README.md +56 -45
- package/dist-lib/index.d.ts +3 -2
- 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 +20 -2
- package/dist-lib/lib/api/agents.js +128 -24
- package/dist-lib/lib/api/app-config.d.ts +7 -1
- package/dist-lib/lib/api/app-config.js +37 -6
- package/dist-lib/lib/api/approval-rules.d.ts +1 -1
- package/dist-lib/lib/api/approval-rules.js +12 -5
- package/dist-lib/lib/api/attachments.d.ts +1 -1
- package/dist-lib/lib/api/attachments.js +14 -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 +12 -2
- package/dist-lib/lib/api/chat.js +100 -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 +19 -2
- package/dist-lib/lib/api/chunks.js +73 -13
- package/dist-lib/lib/api/config.d.ts +11 -3
- package/dist-lib/lib/api/config.js +51 -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 +14 -0
- package/dist-lib/lib/api/device-routes.js +144 -0
- package/dist-lib/lib/api/devices.d.ts +3 -2
- package/dist-lib/lib/api/devices.js +28 -28
- 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 +16 -1
- package/dist-lib/lib/api/execution.js +72 -16
- 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 +39 -7
- package/dist-lib/lib/api/index.js +116 -36
- 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 +69 -44
- package/dist-lib/lib/api/mesh.d.ts +15 -6
- package/dist-lib/lib/api/mesh.js +13 -9
- 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 +172 -0
- package/dist-lib/lib/api/rag-plugin.d.ts +17 -0
- package/dist-lib/lib/api/rag-plugin.js +44 -0
- package/dist-lib/lib/api/rag.d.ts +0 -1
- package/dist-lib/lib/api/rag.js +106 -33
- package/dist-lib/lib/api/served.d.ts +17 -0
- package/dist-lib/lib/api/served.js +65 -0
- package/dist-lib/lib/api/sync.d.ts +2 -1
- package/dist-lib/lib/api/sync.js +13 -3
- 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 +12 -0
- package/dist-lib/lib/api/workspace.js +61 -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 +48 -31
- package/dist-lib/lib/assistant/harness.js +51 -10
- package/dist-lib/lib/assistant/history.d.ts +37 -17
- package/dist-lib/lib/assistant/history.js +212 -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/media-round.d.ts +61 -0
- package/dist-lib/lib/assistant/media-round.js +111 -0
- package/dist-lib/lib/assistant/message.d.ts +28 -1
- package/dist-lib/lib/assistant/message.js +65 -2
- package/dist-lib/lib/assistant/model-round.d.ts +118 -0
- package/dist-lib/lib/assistant/model-round.js +706 -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 +65 -0
- package/dist-lib/lib/assistant/round-host.js +332 -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/upload.d.ts +12 -0
- package/dist-lib/lib/assistant/upload.js +36 -0
- 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 +5 -1
- package/dist-lib/lib/assistant-client.js +54 -14
- package/dist-lib/lib/assistant-tree.d.ts +14 -3
- package/dist-lib/lib/assistant-tree.js +113 -21
- package/dist-lib/lib/assistant.d.ts +115 -25
- package/dist-lib/lib/assistant.js +2409 -1245
- 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 +3 -2
- package/dist-lib/lib/client.js +18 -3
- 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 +47 -0
- package/dist-lib/lib/core/agent-hosting.d.ts +25 -0
- package/dist-lib/lib/core/agent-hosting.js +76 -0
- package/dist-lib/lib/core/agent.d.ts +9 -1
- package/dist-lib/lib/core/agent.js +58 -63
- package/dist-lib/lib/core/approval-rules.d.ts +5 -1
- package/dist-lib/lib/core/approval-rules.js +17 -9
- package/dist-lib/lib/core/archived-mesh.d.ts +14 -7
- package/dist-lib/lib/core/archived-mesh.js +75 -59
- 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 +404 -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 +10 -22
- package/dist-lib/lib/core/chat-move.d.ts +77 -0
- package/dist-lib/lib/core/chat-move.js +601 -0
- package/dist-lib/lib/core/chat-order.d.ts +2 -1
- package/dist-lib/lib/core/chat-order.js +28 -19
- 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 +32 -4
- package/dist-lib/lib/core/chat.js +135 -61
- package/dist-lib/lib/core/chunk.d.ts +35 -7
- package/dist-lib/lib/core/chunk.js +271 -72
- package/dist-lib/lib/core/collections.d.ts +41 -1
- package/dist-lib/lib/core/collections.js +41 -1
- package/dist-lib/lib/core/config-value.d.ts +7 -0
- package/dist-lib/lib/core/config-value.js +15 -0
- package/dist-lib/lib/core/contract/activity.d.ts +7 -2
- package/dist-lib/lib/core/contract/activity.js +71 -23
- 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 +38 -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 +4 -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 +48 -12
- 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 +9 -0
- package/dist-lib/lib/core/contract/project-device-keys.js +38 -0
- package/dist-lib/lib/core/contract/project-host-keys.d.ts +9 -0
- package/dist-lib/lib/core/contract/project-host-keys.js +52 -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 +23 -0
- package/dist-lib/lib/core/contract/projects.js +339 -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 +123 -0
- package/dist-lib/lib/core/contract/run-requests.d.ts +11 -0
- package/dist-lib/lib/core/contract/run-requests.js +114 -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/deleted-agent-runs.d.ts +8 -0
- package/dist-lib/lib/core/deleted-agent-runs.js +57 -0
- package/dist-lib/lib/core/departures.d.ts +18 -5
- package/dist-lib/lib/core/departures.js +82 -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 +6 -11
- 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.d.ts +2 -0
- package/dist-lib/lib/core/files/attachments.js +23 -7
- package/dist-lib/lib/core/files/index.d.ts +28 -15
- package/dist-lib/lib/core/files/index.js +222 -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 +12 -3
- package/dist-lib/lib/core/files/processing/index.js +122 -73
- package/dist-lib/lib/core/files/processing/protocol.d.ts +7 -1
- package/dist-lib/lib/core/files/processing/protocol.js +27 -37
- 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 +15 -2
- package/dist-lib/lib/core/files/rag/build.js +119 -21
- package/dist-lib/lib/core/files/rag/failure.d.ts +20 -0
- package/dist-lib/lib/core/files/rag/failure.js +58 -0
- package/dist-lib/lib/core/files/rag/index.d.ts +21 -5
- package/dist-lib/lib/core/files/rag/index.js +38 -9
- 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.d.ts +3 -3
- package/dist-lib/lib/core/files/rag/load.js +6 -3
- package/dist-lib/lib/core/files/rag/plugin-index.d.ts +32 -0
- package/dist-lib/lib/core/files/rag/plugin-index.js +120 -0
- 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 +3 -4
- 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 +12 -4
- package/dist-lib/lib/core/files/records/knowledge.js +34 -30
- package/dist-lib/lib/core/files/records/purge.js +13 -8
- package/dist-lib/lib/core/files/records/reclaim.js +21 -55
- 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 +117 -51
- 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 +35 -35
- package/dist-lib/lib/core/helpers/index.d.ts +1 -1
- package/dist-lib/lib/core/helpers/index.js +2 -2
- 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 +93 -8
- package/dist-lib/lib/core/local/index.js +327 -28
- 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 +132 -29
- package/dist-lib/lib/core/mesh.js +775 -215
- package/dist-lib/lib/core/migrations/agent-catalog.js +2 -8
- package/dist-lib/lib/core/migrations/agent-tools-scope.d.ts +2 -0
- package/dist-lib/lib/core/migrations/agent-tools-scope.js +18 -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/migrations/writer-links.d.ts +3 -0
- package/dist-lib/lib/core/migrations/writer-links.js +30 -0
- 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 +16 -0
- package/dist-lib/lib/core/project-keys.js +65 -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 +25 -0
- package/dist-lib/lib/core/public-mesh.js +81 -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 +14 -0
- package/dist-lib/lib/core/run-requests.js +78 -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-availability.d.ts +33 -0
- package/dist-lib/lib/core/skill-availability.js +67 -0
- package/dist-lib/lib/core/skill-secrets.d.ts +13 -18
- package/dist-lib/lib/core/skill-secrets.js +93 -72
- package/dist-lib/lib/core/sync/background.d.ts +34 -0
- package/dist-lib/lib/core/sync/background.js +86 -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 +193 -81
- package/dist-lib/lib/core/sync/view-updates.d.ts +39 -0
- package/dist-lib/lib/core/sync/view-updates.js +124 -0
- package/dist-lib/lib/core/sync-status.js +99 -43
- 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-activity.js +6 -12
- package/dist-lib/lib/core/tool-configs.d.ts +5 -3
- package/dist-lib/lib/core/tool-configs.js +27 -39
- 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/upgrade-summary.d.ts +19 -0
- package/dist-lib/lib/core/upgrade-summary.js +67 -0
- package/dist-lib/lib/core/vault-managed-skills.d.ts +18 -0
- package/dist-lib/lib/core/vault-managed-skills.js +105 -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/view-read.d.ts +4 -0
- package/dist-lib/lib/core/view-read.js +23 -0
- package/dist-lib/lib/core/workspace-upgrade.d.ts +23 -0
- package/dist-lib/lib/core/workspace-upgrade.js +51 -0
- package/dist-lib/lib/core.d.ts +345 -88
- package/dist-lib/lib/core.js +4275 -1513
- 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 +814 -0
- package/dist-lib/lib/errors.js +748 -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-ledger.d.ts +22 -0
- package/dist-lib/lib/kv-cache-ledger.js +72 -0
- 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 +36 -0
- package/dist-lib/lib/kv-cache-retention.js +101 -0
- package/dist-lib/lib/latest-frame.d.ts +10 -0
- package/dist-lib/lib/latest-frame.js +48 -0
- package/dist-lib/lib/llm-model-names.d.ts +1 -1
- package/dist-lib/lib/llm-model-names.js +1 -1
- 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 +47 -2
- package/dist-lib/lib/model-context.js +1 -2
- package/dist-lib/lib/model-download-status.d.ts +3 -3
- package/dist-lib/lib/model-download.d.ts +22 -13
- package/dist-lib/lib/model-download.js +106 -37
- package/dist-lib/lib/model-idle-pusher.d.ts +2 -4
- package/dist-lib/lib/model-memory-cap.d.ts +30 -0
- package/dist-lib/lib/model-memory-cap.js +78 -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 +42 -13
- package/dist-lib/lib/oauth/token-exchange-core.js +40 -31
- 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 +8 -0
- package/dist-lib/lib/probe-rounds.js +10 -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 +45 -0
- package/dist-lib/lib/run-replay.js +169 -0
- package/dist-lib/lib/run-transcript.d.ts +13 -12
- package/dist-lib/lib/run-transcript.js +20 -19
- 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 +941 -152
- package/dist-lib/schema/field-order.js +8 -1
- package/dist-lib/schema/indexes.d.ts +10 -0
- package/dist-lib/schema/indexes.js +53 -3
- package/dist-lib/schema/local.js +83 -5
- package/dist-lib/schema/qvac.d.ts +4 -1
- package/dist-lib/schema/qvac.js +558 -16
- package/dist-lib/spec/bind.js +261 -48
- package/dist-lib/spec/calls.js +56 -5
- package/dist-lib/spec/capabilities.d.ts +129 -20
- package/dist-lib/spec/config/hyperconf/index.js +1 -1
- package/dist-lib/spec/hrpc/hrpc.json +870 -207
- package/dist-lib/spec/hrpc/index.js +969 -347
- package/dist-lib/spec/hrpc/messages.js +7590 -4896
- package/dist-lib/spec/hyperschema/index.js +7590 -4896
- package/dist-lib/spec/hyperschema/schema.json +5316 -3224
- package/dist-lib/spec/hyperschema/types.d.ts +576 -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 +1588 -488
- package/dist-lib/spec/local/hyperschema/index.js +584 -16
- package/dist-lib/spec/local/hyperschema/schema.json +369 -1
- package/dist-lib/spec/local/hyperschema/types.d.ts +88 -2
- package/dist-lib/spec/mesh/hyperdb/db.json +711 -9
- package/dist-lib/spec/mesh/hyperdb/index.js +2769 -7
- package/dist-lib/spec/mesh/hyperdb/messages.js +7140 -1298
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +205 -1
- package/dist-lib/spec/mesh/hyperdispatch/index.js +579 -1
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +4017 -267
- package/dist-lib/spec/mesh/hyperschema/index.js +4017 -267
- package/dist-lib/spec/mesh/hyperschema/schema.json +2193 -19
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +550 -6
- package/package.json +136 -90
- package/tui/README.md +119 -20
- package/tui/app.mjs +2000 -621
- package/tui/boot.mjs +74 -9
- package/tui/cli.mjs +93 -0
- package/tui/index.mjs +2 -51
- package/tui/lib/connect-sheet.mjs +350 -0
- package/tui/lib/device-target.mjs +64 -0
- package/tui/lib/folders-command.mjs +84 -0
- package/tui/lib/fork-command.mjs +43 -0
- package/tui/lib/knowledge-import.mjs +3 -21
- package/tui/lib/local-path.mjs +21 -0
- package/tui/lib/move-command.mjs +17 -0
- package/tui/lib/render.mjs +30 -1
- package/tui/lib/setup.mjs +59 -25
- package/tui/lib/skill-connect.mjs +145 -0
- package/tui/lib/updater.mjs +86 -0
- package/tui/main.mjs +44 -18
- package/tui/plugins.mjs +158 -0
- package/worker/assistant-sidecar.mjs +28 -4
- package/worker/stow-entry.mjs +3 -50
- 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
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { CHUNK_PAYLOAD_FIELDS, ragSourcesWithinBounds } from '../../schema/qvac.js';
|
|
2
2
|
import { chunkTypeOrdinal } from '../../schema/indexes.js';
|
|
3
3
|
import { mediaKindOrdinal } from '../../schema/media-kind.js';
|
|
4
|
+
import { CoreError } from '../errors.js';
|
|
4
5
|
import { putApprovalRule } from './approval-rules.js';
|
|
5
6
|
import { linkAttachment } from './attachment-link.js';
|
|
7
|
+
import { foreignChat } from './contract/chat.js';
|
|
8
|
+
import { runRequestOf } from './contract/chunks.js';
|
|
9
|
+
import { asModelRequest, takenBySigner } from './contract/model-requests.js';
|
|
10
|
+
import { inProject, projectRules } from './contract/projects.js';
|
|
6
11
|
import { randomId } from './id.js';
|
|
7
12
|
import { keyRange } from './range.js';
|
|
13
|
+
import { runDefinition } from './shared-agents.js';
|
|
14
|
+
import { drivenBy, handedOff, offeredTo } from './run-driver.js';
|
|
8
15
|
import b4a from 'b4a';
|
|
9
|
-
import { AGENTS, ATTACHMENTS_BY_MEDIA_KIND, ATTACHMENTS_BY_MEDIA_KIND_ORIGIN, CHUNKS, CHUNKS_BY_CHAT, CHUNKS_BY_TYPE, HISTORY_CHUNKS, RUN_REQUESTS } from './collections.js';
|
|
16
|
+
import { AGENTS, ATTACHMENTS_BY_MEDIA_KIND, ATTACHMENTS_BY_MEDIA_KIND_ORIGIN, CHAT_CHUNKS, CHUNKS, CHUNKS_BY_CHAT, CHUNKS_BY_TYPE, CHUNK_COUNTERS, HISTORY_CHUNKS, RUN_REQUESTS } from './collections.js';
|
|
17
|
+
const TERMINAL_RUN_STATES = new Set(['completed', 'failed', 'canceled']);
|
|
10
18
|
export const HISTORY_CHUNK_TYPES = [
|
|
11
19
|
'user-message',
|
|
12
20
|
'run-request',
|
|
@@ -15,68 +23,141 @@ export const HISTORY_CHUNK_TYPES = [
|
|
|
15
23
|
'compaction',
|
|
16
24
|
'round-reset'
|
|
17
25
|
];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
const FALSY_RESULTS = new Map([
|
|
27
|
+
['false', false],
|
|
28
|
+
['0', 0],
|
|
29
|
+
['""', '']
|
|
30
|
+
]);
|
|
31
|
+
export function readChunk({ toolResult, ...chunk }) {
|
|
32
|
+
if (!toolResult) {
|
|
33
|
+
return { ...chunk, toolResult: null };
|
|
22
34
|
}
|
|
23
|
-
|
|
35
|
+
const stored = chunk.falsyResult ?? '';
|
|
36
|
+
const result = FALSY_RESULTS.has(stored) ? FALSY_RESULTS.get(stored) : (toolResult.result ?? null);
|
|
37
|
+
return { ...chunk, toolResult: { ...toolResult, result } };
|
|
38
|
+
}
|
|
39
|
+
export function linkChunks(store, chunks) {
|
|
40
|
+
const mint = store.attachmentUrl;
|
|
41
|
+
return chunks.map((row) => {
|
|
42
|
+
const chunk = readChunk(row);
|
|
43
|
+
return mint && chunk.attachment
|
|
44
|
+
? { ...chunk, attachment: linkAttachment(mint, chunk.attachment) }
|
|
45
|
+
: chunk;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function falsyResultOf(payload) {
|
|
49
|
+
const result = payload.toolResult?.result;
|
|
50
|
+
return result === false || result === 0 || result === '' ? JSON.stringify(result) : undefined;
|
|
24
51
|
}
|
|
25
52
|
export async function recordLinks(store, chunks) {
|
|
26
53
|
await store.fileIndex?.record(chunks.filter((chunk) => chunk.attachment?.url));
|
|
27
54
|
return chunks;
|
|
28
55
|
}
|
|
29
|
-
export function findChunksOfType(snap, { chatId, type, ...bounds }) {
|
|
56
|
+
export async function findChunksOfType(snap, { chatId, type, ...bounds }) {
|
|
30
57
|
const prefix = { chatId, type: chunkTypeOrdinal(type) };
|
|
31
|
-
return snap
|
|
58
|
+
return await snap
|
|
32
59
|
.find(CHUNKS_BY_TYPE, keyRange(prefix, 'seq', bounds))
|
|
33
60
|
.toArray();
|
|
34
61
|
}
|
|
35
|
-
export async function
|
|
62
|
+
export async function findChunksOfTypes(db, { chatId, types, ...bounds }) {
|
|
63
|
+
const ordered = await readChatOrdered(db, chatId, { types, ...bounds });
|
|
64
|
+
if (ordered) {
|
|
65
|
+
return ordered;
|
|
66
|
+
}
|
|
67
|
+
const byType = await Promise.all(types.map((type) => findChunksOfType(db, { chatId, type, ...bounds })));
|
|
68
|
+
return byType.flat().sort((left, right) => left.seq - right.seq);
|
|
69
|
+
}
|
|
70
|
+
export async function listChunks(store, input) {
|
|
71
|
+
const snap = store.view.snapshot();
|
|
72
|
+
try {
|
|
73
|
+
return linkChunks(store, await readChunks(snap, input));
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
await snap.close();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export async function readChunks(db, { chatId, type, types, ...bounds }) {
|
|
36
80
|
const selected = selectedChunkTypes(type, types);
|
|
37
81
|
if (selected?.length === 0) {
|
|
38
82
|
return [];
|
|
39
83
|
}
|
|
40
84
|
if (selected && selected.length > 1 && !isHistorySelection(selected)) {
|
|
41
|
-
throw new
|
|
85
|
+
throw new CoreError('CHUNK_TYPES_UNMAPPED');
|
|
42
86
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (selected?.length === 1) {
|
|
46
|
-
const prefix = { chatId, type: chunkTypeOrdinal(selected[0]) };
|
|
47
|
-
const chunks = await snap
|
|
48
|
-
.find(CHUNKS_BY_TYPE, keyRange(prefix, 'seq', bounds))
|
|
49
|
-
.toArray();
|
|
50
|
-
return linkChunks(store, chunks);
|
|
51
|
-
}
|
|
52
|
-
const chunks = await snap
|
|
53
|
-
.find(selected ? HISTORY_CHUNKS : CHUNKS_BY_CHAT, keyRange({ chatId }, 'seq', bounds))
|
|
54
|
-
.toArray();
|
|
55
|
-
return linkChunks(store, chunks);
|
|
87
|
+
if (selected?.length === 1) {
|
|
88
|
+
return findChunksOfType(db, { chatId, type: selected[0], ...bounds });
|
|
56
89
|
}
|
|
57
|
-
|
|
58
|
-
|
|
90
|
+
const history = selected !== null;
|
|
91
|
+
const ordered = history && bounds.limit
|
|
92
|
+
? null
|
|
93
|
+
: await readChatOrdered(db, chatId, {
|
|
94
|
+
types: history ? HISTORY_CHUNK_TYPES : null,
|
|
95
|
+
...bounds
|
|
96
|
+
});
|
|
97
|
+
if (ordered) {
|
|
98
|
+
return ordered;
|
|
59
99
|
}
|
|
100
|
+
return db
|
|
101
|
+
.find(history ? HISTORY_CHUNKS : CHUNKS_BY_CHAT, keyRange({ chatId }, 'seq', bounds))
|
|
102
|
+
.toArray();
|
|
103
|
+
}
|
|
104
|
+
async function readChatOrdered(db, chatId, { types, ...bounds }) {
|
|
105
|
+
const counter = await db.get(CHUNK_COUNTERS, { chatId });
|
|
106
|
+
if (!counter) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const chunks = await db
|
|
110
|
+
.find(CHAT_CHUNKS, keyRange({ chatId }, 'seq', bounds))
|
|
111
|
+
.toArray();
|
|
112
|
+
const { first, last } = seqSpan(counter.count, bounds);
|
|
113
|
+
if (last < first) {
|
|
114
|
+
return chunks.length === 0 ? chunks : null;
|
|
115
|
+
}
|
|
116
|
+
const [low, high] = bounds.reverse ? [chunks.at(-1), chunks[0]] : [chunks[0], chunks.at(-1)];
|
|
117
|
+
const whole = chunks.length === last - first + 1 && low?.seq === first && high?.seq === last;
|
|
118
|
+
if (!whole) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
const settled = new Set(chunks
|
|
122
|
+
.filter((chunk) => TERMINAL_RUN_STATES.has(chunk.runStatus?.state ?? ''))
|
|
123
|
+
.map((c) => c.runId));
|
|
124
|
+
const selected = types ? chunks.filter((chunk) => types.includes(chunk.type)) : chunks;
|
|
125
|
+
return Promise.all(selected.map((chunk) => (changeable(chunk, settled) ? current(db, chunk) : chunk)));
|
|
126
|
+
}
|
|
127
|
+
function changeable(chunk, settled) {
|
|
128
|
+
return ((chunk.type === 'run-status' && !settled.has(chunk.runId)) ||
|
|
129
|
+
(chunk.type === 'approval-request' && chunk.approvalRequest?.status === 'pending') ||
|
|
130
|
+
(chunk.type === 'attachment' && !chunk.attachment?.deletedAt));
|
|
131
|
+
}
|
|
132
|
+
async function current(db, chunk) {
|
|
133
|
+
return (await db.get(CHUNKS, { id: chunk.id })) ?? chunk;
|
|
134
|
+
}
|
|
135
|
+
function seqSpan(count, { gt, gte, lt, lte, reverse, limit }) {
|
|
136
|
+
let first = Math.max(0, gte ?? 0, gt === undefined ? 0 : gt + 1);
|
|
137
|
+
let last = Math.min(count - 1, lte ?? Infinity, lt === undefined ? Infinity : lt - 1);
|
|
138
|
+
if (limit) {
|
|
139
|
+
if (reverse) {
|
|
140
|
+
first = Math.max(first, last - limit + 1);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
last = Math.min(last, first + limit - 1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return { first, last };
|
|
60
147
|
}
|
|
61
148
|
export async function listAttachmentsByKind(store, { kind, origin, ...bounds }) {
|
|
62
149
|
const mediaKind = mediaKindOrdinal(kind);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const chunks = await snap
|
|
67
|
-
.find(ATTACHMENTS_BY_MEDIA_KIND, keyRange({ mediaKind }, 'createdAt', bounds))
|
|
68
|
-
.toArray();
|
|
69
|
-
return linkChunks(store, chunks);
|
|
70
|
-
}
|
|
71
|
-
const generated = origin === 'generated' ? 1 : 0;
|
|
72
|
-
const chunks = await snap
|
|
73
|
-
.find(ATTACHMENTS_BY_MEDIA_KIND_ORIGIN, keyRange({ mediaKind, generated }, 'createdAt', bounds))
|
|
150
|
+
if (origin === undefined) {
|
|
151
|
+
const chunks = await store.view
|
|
152
|
+
.find(ATTACHMENTS_BY_MEDIA_KIND, keyRange({ mediaKind }, 'createdAt', bounds))
|
|
74
153
|
.toArray();
|
|
75
154
|
return linkChunks(store, chunks);
|
|
76
155
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
156
|
+
const generated = origin === 'generated' ? 1 : 0;
|
|
157
|
+
const chunks = await store.view
|
|
158
|
+
.find(ATTACHMENTS_BY_MEDIA_KIND_ORIGIN, keyRange({ mediaKind, generated }, 'createdAt', bounds))
|
|
159
|
+
.toArray();
|
|
160
|
+
return linkChunks(store, chunks);
|
|
80
161
|
}
|
|
81
162
|
function selectedChunkTypes(type, types) {
|
|
82
163
|
if (!type && types === undefined)
|
|
@@ -87,24 +168,26 @@ function selectedChunkTypes(type, types) {
|
|
|
87
168
|
}
|
|
88
169
|
return [...selected];
|
|
89
170
|
}
|
|
171
|
+
export function selectsChunk({ chatId, type, types, gt, gte, lt, lte }, chunk) {
|
|
172
|
+
const selected = selectedChunkTypes(type, types);
|
|
173
|
+
return (chunk.chatId === chatId &&
|
|
174
|
+
(selected === null || selected.includes(chunk.type)) &&
|
|
175
|
+
(gt === undefined || chunk.seq > gt) &&
|
|
176
|
+
(gte === undefined || chunk.seq >= gte) &&
|
|
177
|
+
(lt === undefined || chunk.seq < lt) &&
|
|
178
|
+
(lte === undefined || chunk.seq <= lte));
|
|
179
|
+
}
|
|
90
180
|
function isHistorySelection(types) {
|
|
91
181
|
return (types.length === HISTORY_CHUNK_TYPES.length &&
|
|
92
182
|
types.every((type) => HISTORY_CHUNK_TYPES.includes(type)));
|
|
93
183
|
}
|
|
94
184
|
export async function getChunk(store, id) {
|
|
95
|
-
|
|
96
|
-
try {
|
|
97
|
-
const chunk = await snap.get(CHUNKS, { id });
|
|
98
|
-
return chunk;
|
|
99
|
-
}
|
|
100
|
-
finally {
|
|
101
|
-
await snap.close();
|
|
102
|
-
}
|
|
185
|
+
return store.view.get(CHUNKS, { id });
|
|
103
186
|
}
|
|
104
|
-
async function mustGetChunk(store, id) {
|
|
187
|
+
export async function mustGetChunk(store, id) {
|
|
105
188
|
const chunk = await getChunk(store, id);
|
|
106
189
|
if (!chunk) {
|
|
107
|
-
throw new
|
|
190
|
+
throw new CoreError('CHUNK_NOT_FOUND', [id]);
|
|
108
191
|
}
|
|
109
192
|
return chunk;
|
|
110
193
|
}
|
|
@@ -115,29 +198,130 @@ function assertPayloadMatchesType(type, payload) {
|
|
|
115
198
|
(candidate === field)) {
|
|
116
199
|
continue;
|
|
117
200
|
}
|
|
118
|
-
throw new
|
|
201
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [`${type} carries ${field} and nothing else`]);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
export async function requireChatIn(store, chatId) {
|
|
205
|
+
if (store.role === 'project' && (await foreignChat(store.view, chatId))) {
|
|
206
|
+
throw new CoreError('CHAT_NOT_FOUND', [chatId]);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function projectRun(store) {
|
|
210
|
+
return store.role === 'project' ? projectRules(store.view) : Promise.resolve(false);
|
|
211
|
+
}
|
|
212
|
+
async function ourMember(store) {
|
|
213
|
+
return store.ourMemberId ?? (await store.refreshOurMember())?.memberId;
|
|
214
|
+
}
|
|
215
|
+
export async function ownedByUs(store, chunk) {
|
|
216
|
+
const ours = await ourMember(store);
|
|
217
|
+
return !!ours && !!chunk.requesterMemberId && b4a.equals(ours, chunk.requesterMemberId);
|
|
218
|
+
}
|
|
219
|
+
export async function requireProjectMember(store, meshId) {
|
|
220
|
+
if (!(await projectRun(store))) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const ours = await ourMember(store);
|
|
224
|
+
if (!ours || !(await inProject(store.view, ours))) {
|
|
225
|
+
throw new CoreError('PROJECT_NOT_FOUND', [meshId]);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async function projectRunRequest(store, chatId, runId) {
|
|
229
|
+
if (!(await projectRun(store))) {
|
|
230
|
+
return null;
|
|
231
|
+
}
|
|
232
|
+
const request = await runRequestOf(store.view, chatId, runId);
|
|
233
|
+
if (!request) {
|
|
234
|
+
throw new CoreError('RUN_NOT_FOUND', [runId]);
|
|
119
235
|
}
|
|
236
|
+
return request;
|
|
120
237
|
}
|
|
121
|
-
export async function
|
|
238
|
+
export async function answersRound(store, parentId) {
|
|
239
|
+
return !!parentId && !!asModelRequest(await getChunk(store, parentId));
|
|
240
|
+
}
|
|
241
|
+
export async function requireOwnRun(store, chatId, runId) {
|
|
242
|
+
const request = await projectRunRequest(store, chatId, runId);
|
|
243
|
+
if (request && !(await ownedByUs(store, request))) {
|
|
244
|
+
throw new CoreError('RUN_NOT_OURS', [runId]);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
export async function requireStoppableRun(store, { meshId, chatId, runId }) {
|
|
248
|
+
if (await projectRunRequest(store, chatId, runId)) {
|
|
249
|
+
await requireProjectMember(store, meshId);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
async function requireRoundOutput(store, { type, runId }, parent) {
|
|
253
|
+
const round = asModelRequest(parent);
|
|
254
|
+
if (!round) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if ((type !== 'content' && type !== 'thinking') || runId !== round.runId) {
|
|
258
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [
|
|
259
|
+
"only its run's content and thinking answer a model-request"
|
|
260
|
+
]);
|
|
261
|
+
}
|
|
262
|
+
if (!(await takenBySigner(store.view, round, store.localWriterKey))) {
|
|
263
|
+
throw new CoreError('MODEL_REQUEST_NOT_OURS', [round.id]);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async function namedHost(store, agentId) {
|
|
267
|
+
const row = agentId ? await store.view.get(AGENTS, { id: agentId }) : null;
|
|
268
|
+
if (row && !row.sharedIn && store.role !== 'project') {
|
|
269
|
+
return row.providerDeviceId;
|
|
270
|
+
}
|
|
271
|
+
if (!row?.sharedIn || !(await store.pickedFrom?.())) {
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
return (await runDefinition(store, row))?.providerDeviceId;
|
|
275
|
+
}
|
|
276
|
+
export async function appendChunk(store, { id = randomId(), chatId, runId, type, originDeviceId, parentId, effect, intent, display, rawCall, capability, capabilityArgs, enhance, senderNameAtSend, sourceId, round, callId, resumed, runnerDeviceId, unavailableSkills, ...payload }, into = store) {
|
|
122
277
|
assertPayloadMatchesType(type, payload);
|
|
123
278
|
if (type === 'sources' && !runId) {
|
|
124
|
-
throw new
|
|
279
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', ['a sources chunk requires runId']);
|
|
125
280
|
}
|
|
126
281
|
if (type === 'sources' && !ragSourcesWithinBounds(payload.sources)) {
|
|
127
|
-
throw new
|
|
282
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', ['a sources chunk exceeds its wire bounds']);
|
|
128
283
|
}
|
|
129
284
|
if (capability && type !== 'run-request') {
|
|
130
|
-
throw new
|
|
285
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', ['only a run-request carries a capability']);
|
|
286
|
+
}
|
|
287
|
+
if (runnerDeviceId && (type !== 'run-request' || capability)) {
|
|
288
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', ['only a run-request for an agent names a runner']);
|
|
289
|
+
}
|
|
290
|
+
if (unavailableSkills?.length && type !== 'run-status') {
|
|
291
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [
|
|
292
|
+
'only a run-status names the skills a run lacked'
|
|
293
|
+
]);
|
|
294
|
+
}
|
|
295
|
+
if (sourceId && type !== 'attachment') {
|
|
296
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', ['only an attachment is derived from another']);
|
|
131
297
|
}
|
|
132
298
|
if (type === 'user-message' && !store.ourMemberId) {
|
|
133
299
|
await store.refreshOurMember();
|
|
134
300
|
}
|
|
301
|
+
if (type === 'agent-switch' && (runId || parentId)) {
|
|
302
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', ['an agent-switch belongs to the chat, not a run']);
|
|
303
|
+
}
|
|
304
|
+
if ((type === 'context' || type === 'model-request') && !runId) {
|
|
305
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [`a ${type} chunk requires runId`]);
|
|
306
|
+
}
|
|
307
|
+
if ((type === 'context' || type === 'model-request') &&
|
|
308
|
+
!(store.ourDeviceId && b4a.equals(store.ourDeviceId, originDeviceId))) {
|
|
309
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [
|
|
310
|
+
`a ${type} chunk is written by its origin device`
|
|
311
|
+
]);
|
|
312
|
+
}
|
|
135
313
|
if (parentId) {
|
|
136
314
|
const parent = await getChunk(store, parentId);
|
|
137
315
|
if (!parent || parent.chatId !== chatId) {
|
|
138
|
-
throw new
|
|
316
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [
|
|
317
|
+
`parentId is not a chunk in this chat: ${parentId}`
|
|
318
|
+
]);
|
|
139
319
|
}
|
|
320
|
+
await requireRoundOutput(store, { type, runId }, parent);
|
|
140
321
|
}
|
|
322
|
+
const senderMemberId = type === 'user-message' && store.ourDeviceId && b4a.equals(store.ourDeviceId, originDeviceId)
|
|
323
|
+
? store.ourMemberId || undefined
|
|
324
|
+
: undefined;
|
|
141
325
|
const op = {
|
|
142
326
|
id,
|
|
143
327
|
chatId,
|
|
@@ -152,15 +336,22 @@ export async function appendChunk(store, { id = randomId(), chatId, runId, type,
|
|
|
152
336
|
capability,
|
|
153
337
|
capabilityArgs,
|
|
154
338
|
enhance,
|
|
339
|
+
sourceId,
|
|
340
|
+
falsyResult: falsyResultOf(payload),
|
|
155
341
|
round,
|
|
156
342
|
callId,
|
|
157
343
|
resumed,
|
|
344
|
+
runnerDeviceId,
|
|
345
|
+
unavailableSkills: unavailableSkills?.length ? unavailableSkills : undefined,
|
|
158
346
|
createdAt: Date.now(),
|
|
159
|
-
senderMemberId
|
|
160
|
-
|
|
161
|
-
: undefined,
|
|
347
|
+
senderMemberId,
|
|
348
|
+
senderNameAtSend: senderMemberId ? senderNameAtSend : undefined,
|
|
162
349
|
...payload
|
|
163
350
|
};
|
|
351
|
+
if (op.modelRequest && runId) {
|
|
352
|
+
const host = await namedHost(store, op.modelRequest.agents?.[0]);
|
|
353
|
+
op.modelRequest = { ...op.modelRequest, hostDeviceId: host };
|
|
354
|
+
}
|
|
164
355
|
await into.dispatch('append-chunk', op);
|
|
165
356
|
if (type === 'attachment') {
|
|
166
357
|
await store.fileIndex?.record([op]);
|
|
@@ -186,25 +377,32 @@ export function updateOp(chunk, { id, runStatus, attachment }) {
|
|
|
186
377
|
(runStatus === null || runStatus === undefined)) {
|
|
187
378
|
return { id, attachment, updatedAt: Date.now() };
|
|
188
379
|
}
|
|
189
|
-
throw new
|
|
380
|
+
throw new CoreError('CHUNK_PAYLOAD_INVALID', [
|
|
381
|
+
'a run-status edits runStatus, an attachment edits attachment'
|
|
382
|
+
]);
|
|
383
|
+
}
|
|
384
|
+
export async function othersApproval(store, id) {
|
|
385
|
+
const ask = await getChunk(store, id);
|
|
386
|
+
return !!ask && (await projectRun(store)) && !(await ownedByUs(store, ask));
|
|
190
387
|
}
|
|
191
|
-
|
|
192
|
-
export async function resolveApproval(store, { id, approved, scope, expiresAt, agentId }) {
|
|
388
|
+
export async function resolveApproval(store, { id, approved, scope, expiresAt, agentId }, rules = store) {
|
|
193
389
|
const before = await getChunk(store, id);
|
|
194
390
|
const wasPending = before?.type === 'approval-request' && before.approvalRequest?.status === 'pending';
|
|
195
391
|
await store.dispatch('resolve-approval', { id, approved, resolvedAt: Date.now() });
|
|
196
392
|
const resolved = await mustGetChunk(store, id);
|
|
197
|
-
if (scope === 'always' && wasPending) {
|
|
393
|
+
if (rules && scope === 'always' && wasPending) {
|
|
198
394
|
const ask = resolved.approvalRequest;
|
|
199
395
|
if (ask && (ask.status === 'approved' || ask.status === 'denied')) {
|
|
200
|
-
await putApprovalRule(
|
|
396
|
+
await putApprovalRule(rules, {
|
|
397
|
+
id,
|
|
201
398
|
toolName: ask.name,
|
|
202
399
|
resourceKind: ask.resource?.kind ?? undefined,
|
|
203
400
|
resourcePattern: ask.resource?.label ?? undefined,
|
|
204
401
|
decision: ask.status === 'approved' ? 'allow' : 'deny',
|
|
205
|
-
expiresAt
|
|
402
|
+
expiresAt,
|
|
206
403
|
agentId: ask.agentId ?? agentId,
|
|
207
|
-
effect: resolved.effect ?? undefined
|
|
404
|
+
effect: resolved.effect ?? undefined,
|
|
405
|
+
chatId: resolved.chatId
|
|
208
406
|
});
|
|
209
407
|
}
|
|
210
408
|
}
|
|
@@ -213,24 +411,25 @@ export async function resolveApproval(store, { id, approved, scope, expiresAt, a
|
|
|
213
411
|
export async function listRunRequests(store, deviceId) {
|
|
214
412
|
if (!deviceId)
|
|
215
413
|
return [];
|
|
414
|
+
const project = await projectRun(store);
|
|
216
415
|
const snap = store.view.snapshot();
|
|
217
416
|
try {
|
|
218
417
|
const requests = await snap.find(RUN_REQUESTS).toArray();
|
|
219
|
-
const
|
|
418
|
+
const agents = new Map();
|
|
220
419
|
const mine = [];
|
|
221
420
|
for (const request of requests) {
|
|
222
421
|
if (store.closing)
|
|
223
422
|
return mine;
|
|
224
423
|
const agentId = request.runRequest?.agentId;
|
|
225
|
-
if (!agentId) {
|
|
424
|
+
if (!agentId || (project && !(await ownedByUs(store, request)))) {
|
|
226
425
|
continue;
|
|
227
426
|
}
|
|
228
|
-
if (!
|
|
229
|
-
|
|
230
|
-
providers.set(agentId, agent?.providerDeviceId);
|
|
427
|
+
if (!agents.has(agentId)) {
|
|
428
|
+
agents.set(agentId, await runDefinition(store, await snap.get(AGENTS, { id: agentId })));
|
|
231
429
|
}
|
|
232
|
-
const
|
|
233
|
-
|
|
430
|
+
const agent = agents.get(agentId);
|
|
431
|
+
const listed = offeredTo(request, deviceId) || handedOff(request, deviceId);
|
|
432
|
+
if (agent && (listed || drivenBy({ request, agent }, deviceId))) {
|
|
234
433
|
mine.push(request);
|
|
235
434
|
}
|
|
236
435
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const CHUNKS = "@qvac/chunks";
|
|
2
|
+
export declare const CHAT_CHUNKS = "@qvac/chat-chunks";
|
|
2
3
|
export declare const CHUNK_COUNTERS = "@qvac/chunk-counters";
|
|
3
4
|
export declare const AGENTS = "@qvac/agents";
|
|
4
5
|
export declare const APPROVAL_RULES = "@qvac/approval-rules";
|
|
@@ -20,6 +21,7 @@ export declare const INDEXING_STATUS_BY_KNOWLEDGE = "@qvac/indexing-status-by-kn
|
|
|
20
21
|
export declare const HISTORY_CHUNKS = "@qvac/history-chunks";
|
|
21
22
|
export declare const INDEXING_STATUS_BY_CHAT = "@qvac/indexing-status-by-chat";
|
|
22
23
|
export declare const ACTIVE_KNOWLEDGE_BY_CHAT = "@qvac/active-knowledge-by-chat";
|
|
24
|
+
export declare const ACTIVE_KNOWLEDGE_BASE = "@qvac/active-knowledge-base";
|
|
23
25
|
export declare const TOOL_CONFIGS = "@qvac/tool-configs";
|
|
24
26
|
export declare const TOOL_ACTIVITY = "@qvac/tool-activity";
|
|
25
27
|
export declare const TOOL_ACTIVITY_COUNTER = "@qvac/tool-activity-counter";
|
|
@@ -34,6 +36,7 @@ export declare const MEMBERS = "@qvac/members";
|
|
|
34
36
|
export declare const CHAT_GROUPS = "@qvac/chat-groups";
|
|
35
37
|
export declare const ACTIVE_CHAT_GROUPS = "@qvac/active-chat-groups";
|
|
36
38
|
export declare const LIVE_WRITERS_BY_MOST_RECENT = "@qvac/live-writers-by-most-recent";
|
|
39
|
+
export declare const LINKED_WRITERS_BY_MOST_RECENT = "@qvac/linked-writers-by-most-recent";
|
|
37
40
|
export declare const JOINED_MESHES = "@qvac/joined-meshes";
|
|
38
41
|
export declare const AGENTS_BY_PROVIDER = "@qvac/agents-by-provider";
|
|
39
42
|
export declare const DEFAULT_AGENTS = "@qvac/default-agents";
|
|
@@ -57,14 +60,51 @@ export declare const LOCAL_FILES = "@local/files";
|
|
|
57
60
|
export declare const LOCAL_FILES_BY_BLOB = "@local/files-by-blob";
|
|
58
61
|
export declare const LOCAL_RECLAIMABLE_FILES_BY_LAST_ACCESSED = "@local/reclaimable-files-by-last-accessed";
|
|
59
62
|
export declare const LOCAL_LIVE_FILES = "@local/live-files";
|
|
63
|
+
export declare const LOCAL_CHAT_MOVES = "@local/chat-moves";
|
|
64
|
+
export declare const LOCAL_MESH_UPDATES = "@local/mesh-updates";
|
|
65
|
+
export declare const LOCAL_MESH_PURGES = "@local/mesh-purges";
|
|
66
|
+
export declare const LOCAL_MESH_NAMES = "@local/mesh-names";
|
|
67
|
+
export declare const LOCAL_RUN_LOGS = "@local/run-logs";
|
|
68
|
+
export declare const LOCAL_RUN_LOG_STEPS = "@local/run-log-steps";
|
|
60
69
|
export declare const LOCAL_MESH_SESSION = "@local/mesh-session";
|
|
61
70
|
export declare const LOCAL_MESH_HISTORY = "@local/mesh-history";
|
|
62
71
|
export declare const LOCAL_MEMBERSHIP = "@local/membership";
|
|
63
|
-
export declare const INDEX_BACKFILLS = "@qvac/index-backfills";
|
|
64
72
|
export declare const LIVE_DEVICES_BY_WRITER_KEY = "@qvac/live-devices-by-writer-key";
|
|
73
|
+
export declare const LIVE_DEVICES_BY_MEMBER = "@qvac/live-devices-by-member";
|
|
74
|
+
export declare const DEVICES_BY_MEMBER = "@qvac/devices-by-member";
|
|
75
|
+
export declare const AGENT_HOSTS_BY_AGENT = "@qvac/agent-hosts-by-agent";
|
|
76
|
+
export declare const AGENT_HOSTS_BY_DEVICE = "@qvac/agent-hosts-by-device";
|
|
77
|
+
export declare const PUBLIC_SEEDS_BY_DEVICE = "@qvac/public-seeds-by-device";
|
|
78
|
+
export declare const PROJECT_HOST_SEALS_BY_DEVICE = "@qvac/project-host-seals-by-device";
|
|
79
|
+
export declare const PROJECT_DEVICE_SEALS_BY_DEVICE = "@qvac/project-device-seals-by-device";
|
|
80
|
+
export declare const PROJECT_DEVICE_SEALS_BY_MEMBER = "@qvac/project-device-seals-by-member";
|
|
81
|
+
export declare const AGENT_USERS_BY_USER = "@qvac/agent-users-by-user";
|
|
82
|
+
export declare const PROJECT_MEMBER_SEALS_BY_MEMBER = "@qvac/project-member-seals-by-member";
|
|
83
|
+
export declare const TERMINAL_RUN_STATUSES = "@qvac/terminal-run-statuses";
|
|
65
84
|
export declare const MEMBER_REMOVALS = "@qvac/member-removals";
|
|
66
85
|
export declare const INVITE_SEQUENCES = "@qvac/invite-sequences";
|
|
67
86
|
export declare const MESH_INVITE_SPENDS = "@qvac/mesh-invite-spends";
|
|
68
87
|
export declare const MESH_INVITE_GRANTS = "@qvac/mesh-invite-grants";
|
|
69
88
|
export declare const MESH_FOUNDERS = "@qvac/mesh-founders";
|
|
70
89
|
export declare const MESH_KINDS = "@qvac/mesh-kinds";
|
|
90
|
+
export declare const MESH_NAMES = "@qvac/mesh-names";
|
|
91
|
+
export declare const MESH_SEEDS = "@qvac/mesh-seeds";
|
|
92
|
+
export declare const MESH_RULES = "@qvac/mesh-rules";
|
|
93
|
+
export declare const PUBLIC_MESHES = "@qvac/public-meshes";
|
|
94
|
+
export declare const WORKSPACE = "@qvac/workspace";
|
|
95
|
+
export declare const MEMBER_ROLES = "@qvac/member-roles";
|
|
96
|
+
export declare const PUBLIC_SEEDS = "@qvac/public-seeds";
|
|
97
|
+
export declare const PROJECTS = "@qvac/projects";
|
|
98
|
+
export declare const PROJECT_MEMBERS = "@qvac/project-members";
|
|
99
|
+
export declare const PROJECT_ORDER = "@qvac/project-order";
|
|
100
|
+
export declare const CHAT_READS = "@qvac/chat-reads";
|
|
101
|
+
export declare const RUN_REQUEST_BY_RUN = "@qvac/run-request-by-run";
|
|
102
|
+
export declare const KNOWLEDGE_CAPS = "@qvac/knowledge-caps";
|
|
103
|
+
export declare const LIVE_MODEL_REQUESTS = "@qvac/live-model-requests";
|
|
104
|
+
export declare const AGENT_HOSTS = "@qvac/agent-hosts";
|
|
105
|
+
export declare const AGENT_USERS = "@qvac/agent-users";
|
|
106
|
+
export declare const MEMBER_KEYS = "@qvac/member-keys";
|
|
107
|
+
export declare const PROJECT_MEMBER_SEALS = "@qvac/project-member-seals";
|
|
108
|
+
export declare const PROJECT_HOST_SEALS = "@qvac/project-host-seals";
|
|
109
|
+
export declare const PROJECT_DEVICE_SEALS = "@qvac/project-device-seals";
|
|
110
|
+
export declare const SKILL_SECRETS = "@qvac/skill-secrets";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const CHUNKS = '@qvac/chunks';
|
|
2
|
+
export const CHAT_CHUNKS = '@qvac/chat-chunks';
|
|
2
3
|
export const CHUNK_COUNTERS = '@qvac/chunk-counters';
|
|
3
4
|
export const AGENTS = '@qvac/agents';
|
|
4
5
|
export const APPROVAL_RULES = '@qvac/approval-rules';
|
|
@@ -20,6 +21,7 @@ export const INDEXING_STATUS_BY_KNOWLEDGE = '@qvac/indexing-status-by-knowledge'
|
|
|
20
21
|
export const HISTORY_CHUNKS = '@qvac/history-chunks';
|
|
21
22
|
export const INDEXING_STATUS_BY_CHAT = '@qvac/indexing-status-by-chat';
|
|
22
23
|
export const ACTIVE_KNOWLEDGE_BY_CHAT = '@qvac/active-knowledge-by-chat';
|
|
24
|
+
export const ACTIVE_KNOWLEDGE_BASE = '@qvac/active-knowledge-base';
|
|
23
25
|
export const TOOL_CONFIGS = '@qvac/tool-configs';
|
|
24
26
|
export const TOOL_ACTIVITY = '@qvac/tool-activity';
|
|
25
27
|
export const TOOL_ACTIVITY_COUNTER = '@qvac/tool-activity-counter';
|
|
@@ -34,6 +36,7 @@ export const MEMBERS = '@qvac/members';
|
|
|
34
36
|
export const CHAT_GROUPS = '@qvac/chat-groups';
|
|
35
37
|
export const ACTIVE_CHAT_GROUPS = '@qvac/active-chat-groups';
|
|
36
38
|
export const LIVE_WRITERS_BY_MOST_RECENT = '@qvac/live-writers-by-most-recent';
|
|
39
|
+
export const LINKED_WRITERS_BY_MOST_RECENT = '@qvac/linked-writers-by-most-recent';
|
|
37
40
|
export const JOINED_MESHES = '@qvac/joined-meshes';
|
|
38
41
|
export const AGENTS_BY_PROVIDER = '@qvac/agents-by-provider';
|
|
39
42
|
export const DEFAULT_AGENTS = '@qvac/default-agents';
|
|
@@ -57,14 +60,51 @@ export const LOCAL_FILES = '@local/files';
|
|
|
57
60
|
export const LOCAL_FILES_BY_BLOB = '@local/files-by-blob';
|
|
58
61
|
export const LOCAL_RECLAIMABLE_FILES_BY_LAST_ACCESSED = '@local/reclaimable-files-by-last-accessed';
|
|
59
62
|
export const LOCAL_LIVE_FILES = '@local/live-files';
|
|
63
|
+
export const LOCAL_CHAT_MOVES = '@local/chat-moves';
|
|
64
|
+
export const LOCAL_MESH_UPDATES = '@local/mesh-updates';
|
|
65
|
+
export const LOCAL_MESH_PURGES = '@local/mesh-purges';
|
|
66
|
+
export const LOCAL_MESH_NAMES = '@local/mesh-names';
|
|
67
|
+
export const LOCAL_RUN_LOGS = '@local/run-logs';
|
|
68
|
+
export const LOCAL_RUN_LOG_STEPS = '@local/run-log-steps';
|
|
60
69
|
export const LOCAL_MESH_SESSION = '@local/mesh-session';
|
|
61
70
|
export const LOCAL_MESH_HISTORY = '@local/mesh-history';
|
|
62
71
|
export const LOCAL_MEMBERSHIP = '@local/membership';
|
|
63
|
-
export const INDEX_BACKFILLS = '@qvac/index-backfills';
|
|
64
72
|
export const LIVE_DEVICES_BY_WRITER_KEY = '@qvac/live-devices-by-writer-key';
|
|
73
|
+
export const LIVE_DEVICES_BY_MEMBER = '@qvac/live-devices-by-member';
|
|
74
|
+
export const DEVICES_BY_MEMBER = '@qvac/devices-by-member';
|
|
75
|
+
export const AGENT_HOSTS_BY_AGENT = '@qvac/agent-hosts-by-agent';
|
|
76
|
+
export const AGENT_HOSTS_BY_DEVICE = '@qvac/agent-hosts-by-device';
|
|
77
|
+
export const PUBLIC_SEEDS_BY_DEVICE = '@qvac/public-seeds-by-device';
|
|
78
|
+
export const PROJECT_HOST_SEALS_BY_DEVICE = '@qvac/project-host-seals-by-device';
|
|
79
|
+
export const PROJECT_DEVICE_SEALS_BY_DEVICE = '@qvac/project-device-seals-by-device';
|
|
80
|
+
export const PROJECT_DEVICE_SEALS_BY_MEMBER = '@qvac/project-device-seals-by-member';
|
|
81
|
+
export const AGENT_USERS_BY_USER = '@qvac/agent-users-by-user';
|
|
82
|
+
export const PROJECT_MEMBER_SEALS_BY_MEMBER = '@qvac/project-member-seals-by-member';
|
|
83
|
+
export const TERMINAL_RUN_STATUSES = '@qvac/terminal-run-statuses';
|
|
65
84
|
export const MEMBER_REMOVALS = '@qvac/member-removals';
|
|
66
85
|
export const INVITE_SEQUENCES = '@qvac/invite-sequences';
|
|
67
86
|
export const MESH_INVITE_SPENDS = '@qvac/mesh-invite-spends';
|
|
68
87
|
export const MESH_INVITE_GRANTS = '@qvac/mesh-invite-grants';
|
|
69
88
|
export const MESH_FOUNDERS = '@qvac/mesh-founders';
|
|
70
89
|
export const MESH_KINDS = '@qvac/mesh-kinds';
|
|
90
|
+
export const MESH_NAMES = '@qvac/mesh-names';
|
|
91
|
+
export const MESH_SEEDS = '@qvac/mesh-seeds';
|
|
92
|
+
export const MESH_RULES = '@qvac/mesh-rules';
|
|
93
|
+
export const PUBLIC_MESHES = '@qvac/public-meshes';
|
|
94
|
+
export const WORKSPACE = '@qvac/workspace';
|
|
95
|
+
export const MEMBER_ROLES = '@qvac/member-roles';
|
|
96
|
+
export const PUBLIC_SEEDS = '@qvac/public-seeds';
|
|
97
|
+
export const PROJECTS = '@qvac/projects';
|
|
98
|
+
export const PROJECT_MEMBERS = '@qvac/project-members';
|
|
99
|
+
export const PROJECT_ORDER = '@qvac/project-order';
|
|
100
|
+
export const CHAT_READS = '@qvac/chat-reads';
|
|
101
|
+
export const RUN_REQUEST_BY_RUN = '@qvac/run-request-by-run';
|
|
102
|
+
export const KNOWLEDGE_CAPS = '@qvac/knowledge-caps';
|
|
103
|
+
export const LIVE_MODEL_REQUESTS = '@qvac/live-model-requests';
|
|
104
|
+
export const AGENT_HOSTS = '@qvac/agent-hosts';
|
|
105
|
+
export const AGENT_USERS = '@qvac/agent-users';
|
|
106
|
+
export const MEMBER_KEYS = '@qvac/member-keys';
|
|
107
|
+
export const PROJECT_MEMBER_SEALS = '@qvac/project-member-seals';
|
|
108
|
+
export const PROJECT_HOST_SEALS = '@qvac/project-host-seals';
|
|
109
|
+
export const PROJECT_DEVICE_SEALS = '@qvac/project-device-seals';
|
|
110
|
+
export const SKILL_SECRETS = '@qvac/skill-secrets';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const QUARANTINE_PREFIX = "quarantine.";
|
|
2
|
+
export interface StoredConfigValue {
|
|
3
|
+
readonly value?: unknown;
|
|
4
|
+
readonly falsyValue?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function configValue(value: unknown): StoredConfigValue;
|
|
7
|
+
export declare function readConfigValue({ value, falsyValue }: StoredConfigValue): unknown;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const QUARANTINE_PREFIX = 'quarantine.';
|
|
2
|
+
const FALSY_VALUES = new Map([
|
|
3
|
+
['false', false],
|
|
4
|
+
['0', 0],
|
|
5
|
+
['""', '']
|
|
6
|
+
]);
|
|
7
|
+
export function configValue(value) {
|
|
8
|
+
return value === false || value === 0 || value === ''
|
|
9
|
+
? { value: null, falsyValue: JSON.stringify(value) }
|
|
10
|
+
: { value };
|
|
11
|
+
}
|
|
12
|
+
export function readConfigValue({ value, falsyValue }) {
|
|
13
|
+
const falsy = falsyValue ?? '';
|
|
14
|
+
return FALSY_VALUES.has(falsy) ? FALSY_VALUES.get(falsy) : (value ?? null);
|
|
15
|
+
}
|