@qvac/core 0.0.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +198 -0
- package/NOTICE.md +13 -0
- package/README.md +694 -0
- package/SECURITY.md +6 -0
- package/dist/assistant.bundle +47257 -0
- package/dist/assistant.cjs +18 -0
- package/dist/assistant.d.ts +8 -0
- package/dist/prebuilds-manifest.json +380 -0
- package/dist-lib/client.d.ts +2 -0
- package/dist-lib/client.js +1 -0
- package/dist-lib/index.d.ts +13 -0
- package/dist-lib/index.js +10 -0
- package/dist-lib/lib/agent-icons.d.ts +3 -0
- package/dist-lib/lib/agent-icons.js +1 -0
- package/dist-lib/lib/api/agents.d.ts +5 -0
- package/dist-lib/lib/api/agents.js +38 -0
- package/dist-lib/lib/api/app-config.d.ts +5 -0
- package/dist-lib/lib/api/app-config.js +108 -0
- package/dist-lib/lib/api/approval-rules.d.ts +3 -0
- package/dist-lib/lib/api/approval-rules.js +9 -0
- package/dist-lib/lib/api/attachments.d.ts +8 -0
- package/dist-lib/lib/api/attachments.js +15 -0
- package/dist-lib/lib/api/chat-groups.d.ts +5 -0
- package/dist-lib/lib/api/chat-groups.js +12 -0
- package/dist-lib/lib/api/chat.d.ts +5 -0
- package/dist-lib/lib/api/chat.js +38 -0
- package/dist-lib/lib/api/chunks.d.ts +5 -0
- package/dist-lib/lib/api/chunks.js +61 -0
- package/dist-lib/lib/api/config.d.ts +5 -0
- package/dist-lib/lib/api/config.js +15 -0
- package/dist-lib/lib/api/current-mesh.d.ts +5 -0
- package/dist-lib/lib/api/current-mesh.js +12 -0
- package/dist-lib/lib/api/custom-models.d.ts +5 -0
- package/dist-lib/lib/api/custom-models.js +45 -0
- package/dist-lib/lib/api/devices.d.ts +8 -0
- package/dist-lib/lib/api/devices.js +125 -0
- package/dist-lib/lib/api/diagnostics.d.ts +7 -0
- package/dist-lib/lib/api/diagnostics.js +7 -0
- package/dist-lib/lib/api/effective-ctx-size.d.ts +2 -0
- package/dist-lib/lib/api/effective-ctx-size.js +10 -0
- package/dist-lib/lib/api/execution.d.ts +3 -0
- package/dist-lib/lib/api/execution.js +45 -0
- package/dist-lib/lib/api/files.d.ts +3 -0
- package/dist-lib/lib/api/files.js +48 -0
- package/dist-lib/lib/api/index.d.ts +62 -0
- package/dist-lib/lib/api/index.js +172 -0
- package/dist-lib/lib/api/instrument.d.ts +2 -0
- package/dist-lib/lib/api/instrument.js +86 -0
- package/dist-lib/lib/api/knowledge.d.ts +8 -0
- package/dist-lib/lib/api/knowledge.js +26 -0
- package/dist-lib/lib/api/logs.d.ts +14 -0
- package/dist-lib/lib/api/logs.js +116 -0
- package/dist-lib/lib/api/mesh.d.ts +13 -0
- package/dist-lib/lib/api/mesh.js +25 -0
- package/dist-lib/lib/api/model-download.d.ts +5 -0
- package/dist-lib/lib/api/model-download.js +47 -0
- package/dist-lib/lib/api/network.d.ts +8 -0
- package/dist-lib/lib/api/network.js +6 -0
- package/dist-lib/lib/api/notifications.d.ts +21 -0
- package/dist-lib/lib/api/notifications.js +108 -0
- package/dist-lib/lib/api/rag.d.ts +7 -0
- package/dist-lib/lib/api/rag.js +216 -0
- package/dist-lib/lib/api/sync.d.ts +3 -0
- package/dist-lib/lib/api/sync.js +6 -0
- package/dist-lib/lib/api/tool-activity.d.ts +5 -0
- package/dist-lib/lib/api/tool-activity.js +53 -0
- package/dist-lib/lib/api/tool-configs.d.ts +6 -0
- package/dist-lib/lib/api/tool-configs.js +27 -0
- package/dist-lib/lib/api/watchable.d.ts +12 -0
- package/dist-lib/lib/api/watchable.js +121 -0
- package/dist-lib/lib/assistant-client.d.ts +21 -0
- package/dist-lib/lib/assistant-client.js +52 -0
- package/dist-lib/lib/assistant-tree.d.ts +50 -0
- package/dist-lib/lib/assistant-tree.js +184 -0
- package/dist-lib/lib/assistant.d.ts +425 -0
- package/dist-lib/lib/assistant.js +2706 -0
- package/dist-lib/lib/audio-format.d.ts +4 -0
- package/dist-lib/lib/audio-format.js +4 -0
- package/dist-lib/lib/chat-title.d.ts +5 -0
- package/dist-lib/lib/chat-title.js +58 -0
- package/dist-lib/lib/client.d.ts +25 -0
- package/dist-lib/lib/client.js +53 -0
- package/dist-lib/lib/collabora/convert.d.ts +9 -0
- package/dist-lib/lib/collabora/convert.js +62 -0
- package/dist-lib/lib/collabora/entry.d.ts +1 -0
- package/dist-lib/lib/collabora/entry.js +44 -0
- package/dist-lib/lib/collabora/protocol.d.ts +15 -0
- package/dist-lib/lib/collabora/protocol.js +24 -0
- package/dist-lib/lib/collabora/worker.d.ts +5 -0
- package/dist-lib/lib/collabora/worker.js +111 -0
- package/dist-lib/lib/compaction.d.ts +30 -0
- package/dist-lib/lib/compaction.js +95 -0
- package/dist-lib/lib/constants.d.ts +4 -0
- package/dist-lib/lib/constants.js +4 -0
- package/dist-lib/lib/core/agent.d.ts +15 -0
- package/dist-lib/lib/core/agent.js +149 -0
- package/dist-lib/lib/core/app-build.d.ts +7 -0
- package/dist-lib/lib/core/app-build.js +1 -0
- package/dist-lib/lib/core/approval-rules.d.ts +15 -0
- package/dist-lib/lib/core/approval-rules.js +41 -0
- package/dist-lib/lib/core/async-iterable.d.ts +13 -0
- package/dist-lib/lib/core/async-iterable.js +65 -0
- package/dist-lib/lib/core/attachment-link.d.ts +7 -0
- package/dist-lib/lib/core/attachment-link.js +6 -0
- package/dist-lib/lib/core/audio-attachment.d.ts +1 -0
- package/dist-lib/lib/core/audio-attachment.js +4 -0
- package/dist-lib/lib/core/blind-peers.d.ts +6 -0
- package/dist-lib/lib/core/blind-peers.js +13 -0
- package/dist-lib/lib/core/chat-activity.d.ts +7 -0
- package/dist-lib/lib/core/chat-activity.js +244 -0
- package/dist-lib/lib/core/chat-group.d.ts +14 -0
- package/dist-lib/lib/core/chat-group.js +79 -0
- package/dist-lib/lib/core/chat-search.d.ts +17 -0
- package/dist-lib/lib/core/chat-search.js +199 -0
- package/dist-lib/lib/core/chat.d.ts +37 -0
- package/dist-lib/lib/core/chat.js +196 -0
- package/dist-lib/lib/core/chunk.d.ts +61 -0
- package/dist-lib/lib/core/chunk.js +212 -0
- package/dist-lib/lib/core/contract/activity.d.ts +11 -0
- package/dist-lib/lib/core/contract/activity.js +45 -0
- package/dist-lib/lib/core/contract/agents.d.ts +2 -0
- package/dist-lib/lib/core/contract/agents.js +29 -0
- package/dist-lib/lib/core/contract/approval-rules.d.ts +2 -0
- package/dist-lib/lib/core/contract/approval-rules.js +14 -0
- package/dist-lib/lib/core/contract/attestations.d.ts +2 -0
- package/dist-lib/lib/core/contract/attestations.js +14 -0
- package/dist-lib/lib/core/contract/chat-group.d.ts +2 -0
- package/dist-lib/lib/core/contract/chat-group.js +20 -0
- package/dist-lib/lib/core/contract/chat.d.ts +2 -0
- package/dist-lib/lib/core/contract/chat.js +18 -0
- package/dist-lib/lib/core/contract/chunks.d.ts +2 -0
- package/dist-lib/lib/core/contract/chunks.js +156 -0
- package/dist-lib/lib/core/contract/devices.d.ts +2 -0
- package/dist-lib/lib/core/contract/devices.js +110 -0
- package/dist-lib/lib/core/contract/index.d.ts +2 -0
- package/dist-lib/lib/core/contract/index.js +30 -0
- package/dist-lib/lib/core/contract/indexing.d.ts +4 -0
- package/dist-lib/lib/core/contract/indexing.js +82 -0
- package/dist-lib/lib/core/contract/knowledge.d.ts +2 -0
- package/dist-lib/lib/core/contract/knowledge.js +55 -0
- package/dist-lib/lib/core/contract/members.d.ts +2 -0
- package/dist-lib/lib/core/contract/members.js +96 -0
- package/dist-lib/lib/core/contract/seed-defaults.d.ts +2 -0
- package/dist-lib/lib/core/contract/seed-defaults.js +29 -0
- package/dist-lib/lib/core/contract/tool-activity.d.ts +2 -0
- package/dist-lib/lib/core/contract/tool-activity.js +25 -0
- package/dist-lib/lib/core/contract/tool-configs.d.ts +2 -0
- package/dist-lib/lib/core/contract/tool-configs.js +50 -0
- package/dist-lib/lib/core/contract/types.d.ts +11 -0
- package/dist-lib/lib/core/contract/types.js +1 -0
- package/dist-lib/lib/core/contract/writers.d.ts +2 -0
- package/dist-lib/lib/core/contract/writers.js +112 -0
- package/dist-lib/lib/core/cpu-info-node.d.ts +3 -0
- package/dist-lib/lib/core/cpu-info-node.js +2 -0
- package/dist-lib/lib/core/departures.d.ts +41 -0
- package/dist-lib/lib/core/departures.js +145 -0
- package/dist-lib/lib/core/device-attestation.d.ts +6 -0
- package/dist-lib/lib/core/device-attestation.js +12 -0
- package/dist-lib/lib/core/devices.d.ts +14 -0
- package/dist-lib/lib/core/devices.js +11 -0
- package/dist-lib/lib/core/document-attachment.d.ts +22 -0
- package/dist-lib/lib/core/document-attachment.js +35 -0
- package/dist-lib/lib/core/files/attachments.d.ts +8 -0
- package/dist-lib/lib/core/files/attachments.js +50 -0
- package/dist-lib/lib/core/files/index.d.ts +133 -0
- package/dist-lib/lib/core/files/index.js +585 -0
- package/dist-lib/lib/core/files/knowledge.d.ts +9 -0
- package/dist-lib/lib/core/files/knowledge.js +31 -0
- package/dist-lib/lib/core/files/preview/image.d.ts +4 -0
- package/dist-lib/lib/core/files/preview/image.js +42 -0
- package/dist-lib/lib/core/files/preview/index.d.ts +33 -0
- package/dist-lib/lib/core/files/preview/index.js +161 -0
- package/dist-lib/lib/core/files/processing/claims.d.ts +26 -0
- package/dist-lib/lib/core/files/processing/claims.js +89 -0
- package/dist-lib/lib/core/files/processing/document.d.ts +100 -0
- package/dist-lib/lib/core/files/processing/document.js +101 -0
- package/dist-lib/lib/core/files/processing/index.d.ts +75 -0
- package/dist-lib/lib/core/files/processing/index.js +295 -0
- package/dist-lib/lib/core/files/processing/ownership.d.ts +11 -0
- package/dist-lib/lib/core/files/processing/ownership.js +41 -0
- package/dist-lib/lib/core/files/processing/protocol.d.ts +29 -0
- package/dist-lib/lib/core/files/processing/protocol.js +70 -0
- package/dist-lib/lib/core/files/processing/settle.d.ts +10 -0
- package/dist-lib/lib/core/files/processing/settle.js +75 -0
- package/dist-lib/lib/core/files/processing/source.d.ts +36 -0
- package/dist-lib/lib/core/files/processing/source.js +96 -0
- package/dist-lib/lib/core/files/processing/state.d.ts +64 -0
- package/dist-lib/lib/core/files/processing/state.js +118 -0
- package/dist-lib/lib/core/files/rag/artifact/codec.d.ts +3 -0
- package/dist-lib/lib/core/files/rag/artifact/codec.js +172 -0
- package/dist-lib/lib/core/files/rag/artifact/id.d.ts +10 -0
- package/dist-lib/lib/core/files/rag/artifact/id.js +39 -0
- package/dist-lib/lib/core/files/rag/artifact/types.d.ts +24 -0
- package/dist-lib/lib/core/files/rag/artifact/types.js +41 -0
- package/dist-lib/lib/core/files/rag/build.d.ts +25 -0
- package/dist-lib/lib/core/files/rag/build.js +60 -0
- package/dist-lib/lib/core/files/rag/chunk/chunking.d.ts +12 -0
- package/dist-lib/lib/core/files/rag/chunk/chunking.js +117 -0
- package/dist-lib/lib/core/files/rag/chunk/metadata.d.ts +30 -0
- package/dist-lib/lib/core/files/rag/chunk/metadata.js +89 -0
- package/dist-lib/lib/core/files/rag/chunk/tokenizer.d.ts +7 -0
- package/dist-lib/lib/core/files/rag/chunk/tokenizer.js +18 -0
- package/dist-lib/lib/core/files/rag/document-types.d.ts +11 -0
- package/dist-lib/lib/core/files/rag/document-types.js +94 -0
- package/dist-lib/lib/core/files/rag/extract/csv-text.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/extract/csv-text.js +117 -0
- package/dist-lib/lib/core/files/rag/extract/document-types.d.ts +22 -0
- package/dist-lib/lib/core/files/rag/extract/document-types.js +152 -0
- package/dist-lib/lib/core/files/rag/extract/extract.d.ts +17 -0
- package/dist-lib/lib/core/files/rag/extract/extract.js +81 -0
- package/dist-lib/lib/core/files/rag/extract/html-table-text.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/extract/html-table-text.js +125 -0
- package/dist-lib/lib/core/files/rag/extract/html-text.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/extract/html-text.js +132 -0
- package/dist-lib/lib/core/files/rag/extract/office-collabora.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/extract/office-collabora.js +8 -0
- package/dist-lib/lib/core/files/rag/extract/pdf-platform.d.ts +17 -0
- package/dist-lib/lib/core/files/rag/extract/pdf-platform.js +141 -0
- package/dist-lib/lib/core/files/rag/extract/pdf-text.d.ts +12 -0
- package/dist-lib/lib/core/files/rag/extract/pdf-text.js +43 -0
- package/dist-lib/lib/core/files/rag/extract/rtf-text.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/extract/rtf-text.js +15 -0
- package/dist-lib/lib/core/files/rag/extract/text-decoding.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/extract/text-decoding.js +91 -0
- package/dist-lib/lib/core/files/rag/extract/types.d.ts +36 -0
- package/dist-lib/lib/core/files/rag/extract/types.js +12 -0
- package/dist-lib/lib/core/files/rag/extract/utf.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/extract/utf.js +18 -0
- package/dist-lib/lib/core/files/rag/index.d.ts +54 -0
- package/dist-lib/lib/core/files/rag/index.js +79 -0
- package/dist-lib/lib/core/files/rag/limits.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/limits.js +2 -0
- package/dist-lib/lib/core/files/rag/load.d.ts +28 -0
- package/dist-lib/lib/core/files/rag/load.js +250 -0
- package/dist-lib/lib/core/files/rag/models.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/models.js +1 -0
- package/dist-lib/lib/core/files/rag/policy.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/policy.js +23 -0
- package/dist-lib/lib/core/files/rag/produce.d.ts +21 -0
- package/dist-lib/lib/core/files/rag/produce.js +214 -0
- package/dist-lib/lib/core/files/rag/retrieval/citation-match.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/retrieval/citation-match.js +16 -0
- package/dist-lib/lib/core/files/rag/retrieval/coverage.d.ts +4 -0
- package/dist-lib/lib/core/files/rag/retrieval/coverage.js +48 -0
- package/dist-lib/lib/core/files/rag/retrieval/diversity.d.ts +10 -0
- package/dist-lib/lib/core/files/rag/retrieval/diversity.js +37 -0
- package/dist-lib/lib/core/files/rag/retrieval/floor.d.ts +5 -0
- package/dist-lib/lib/core/files/rag/retrieval/floor.js +21 -0
- package/dist-lib/lib/core/files/rag/retrieval/format.d.ts +6 -0
- package/dist-lib/lib/core/files/rag/retrieval/format.js +21 -0
- package/dist-lib/lib/core/files/rag/retrieval/full-text.d.ts +22 -0
- package/dist-lib/lib/core/files/rag/retrieval/full-text.js +137 -0
- package/dist-lib/lib/core/files/rag/retrieval/knowledge.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/retrieval/knowledge.js +53 -0
- package/dist-lib/lib/core/files/rag/retrieval/notices.d.ts +16 -0
- package/dist-lib/lib/core/files/rag/retrieval/notices.js +27 -0
- package/dist-lib/lib/core/files/rag/retrieval/scoring.d.ts +8 -0
- package/dist-lib/lib/core/files/rag/retrieval/scoring.js +82 -0
- package/dist-lib/lib/core/files/rag/retrieval/search.d.ts +3 -0
- package/dist-lib/lib/core/files/rag/retrieval/search.js +46 -0
- package/dist-lib/lib/core/files/rag/retrieval/selection.d.ts +10 -0
- package/dist-lib/lib/core/files/rag/retrieval/selection.js +63 -0
- package/dist-lib/lib/core/files/rag/retrieval/source-tag-filter.d.ts +6 -0
- package/dist-lib/lib/core/files/rag/retrieval/source-tag-filter.js +79 -0
- package/dist-lib/lib/core/files/rag/retrieval/sources.d.ts +13 -0
- package/dist-lib/lib/core/files/rag/retrieval/sources.js +20 -0
- package/dist-lib/lib/core/files/rag/retrieval/target.d.ts +13 -0
- package/dist-lib/lib/core/files/rag/retrieval/target.js +89 -0
- package/dist-lib/lib/core/files/rag/retrieval/terms.d.ts +8 -0
- package/dist-lib/lib/core/files/rag/retrieval/terms.js +70 -0
- package/dist-lib/lib/core/files/rag/retrieval/types.d.ts +28 -0
- package/dist-lib/lib/core/files/rag/retrieval/types.js +1 -0
- package/dist-lib/lib/core/files/rag/retrieval/web-sources.d.ts +8 -0
- package/dist-lib/lib/core/files/rag/retrieval/web-sources.js +41 -0
- package/dist-lib/lib/core/files/rag/retrieval/whole-document-query.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/retrieval/whole-document-query.js +96 -0
- package/dist-lib/lib/core/files/rag/vector/memory.d.ts +15 -0
- package/dist-lib/lib/core/files/rag/vector/memory.js +135 -0
- package/dist-lib/lib/core/files/rag/vector/types.d.ts +28 -0
- package/dist-lib/lib/core/files/rag/vector/types.js +1 -0
- package/dist-lib/lib/core/files/records/chunks.d.ts +3 -0
- package/dist-lib/lib/core/files/records/chunks.js +12 -0
- package/dist-lib/lib/core/files/records/index.d.ts +10 -0
- package/dist-lib/lib/core/files/records/index.js +8 -0
- package/dist-lib/lib/core/files/records/knowledge.d.ts +22 -0
- package/dist-lib/lib/core/files/records/knowledge.js +105 -0
- package/dist-lib/lib/core/files/records/linkage.d.ts +11 -0
- package/dist-lib/lib/core/files/records/linkage.js +27 -0
- package/dist-lib/lib/core/files/records/output.d.ts +8 -0
- package/dist-lib/lib/core/files/records/output.js +38 -0
- package/dist-lib/lib/core/files/records/reclaim.d.ts +5 -0
- package/dist-lib/lib/core/files/records/reclaim.js +73 -0
- package/dist-lib/lib/core/files/records/routing.d.ts +23 -0
- package/dist-lib/lib/core/files/records/routing.js +62 -0
- package/dist-lib/lib/core/files/records/source.d.ts +16 -0
- package/dist-lib/lib/core/files/records/source.js +70 -0
- package/dist-lib/lib/core/files/records/sweep.d.ts +2 -0
- package/dist-lib/lib/core/files/records/sweep.js +30 -0
- package/dist-lib/lib/core/files/store/blob.d.ts +29 -0
- package/dist-lib/lib/core/files/store/blob.js +98 -0
- package/dist-lib/lib/core/files/store/index.d.ts +36 -0
- package/dist-lib/lib/core/files/store/index.js +89 -0
- package/dist-lib/lib/core/files/store/inline.d.ts +8 -0
- package/dist-lib/lib/core/files/store/inline.js +38 -0
- package/dist-lib/lib/core/files/store/reference.d.ts +27 -0
- package/dist-lib/lib/core/files/store/reference.js +168 -0
- package/dist-lib/lib/core/files/store/server.d.ts +27 -0
- package/dist-lib/lib/core/files/store/server.js +114 -0
- package/dist-lib/lib/core/files/store/sweep.d.ts +2 -0
- package/dist-lib/lib/core/files/store/sweep.js +45 -0
- package/dist-lib/lib/core/files/upload-input.d.ts +27 -0
- package/dist-lib/lib/core/files/upload-input.js +52 -0
- package/dist-lib/lib/core/files/upload.d.ts +32 -0
- package/dist-lib/lib/core/files/upload.js +201 -0
- package/dist-lib/lib/core/fs-drives.d.ts +18 -0
- package/dist-lib/lib/core/fs-drives.js +58 -0
- package/dist-lib/lib/core/gpu-info-node.d.ts +3 -0
- package/dist-lib/lib/core/gpu-info-node.js +2 -0
- package/dist-lib/lib/core/handoff-channel.d.ts +46 -0
- package/dist-lib/lib/core/handoff-channel.js +102 -0
- package/dist-lib/lib/core/health-assistant.d.ts +7 -0
- package/dist-lib/lib/core/health-assistant.js +24 -0
- package/dist-lib/lib/core/helpers/index.d.ts +5 -0
- package/dist-lib/lib/core/helpers/index.js +74 -0
- package/dist-lib/lib/core/hosted-agents.d.ts +36 -0
- package/dist-lib/lib/core/hosted-agents.js +127 -0
- package/dist-lib/lib/core/id.d.ts +1 -0
- package/dist-lib/lib/core/id.js +5 -0
- package/dist-lib/lib/core/identity.d.ts +14 -0
- package/dist-lib/lib/core/identity.js +45 -0
- package/dist-lib/lib/core/image/cache-sweep.d.ts +12 -0
- package/dist-lib/lib/core/image/cache-sweep.js +67 -0
- package/dist-lib/lib/core/image/normalize.d.ts +3 -0
- package/dist-lib/lib/core/image/normalize.js +49 -0
- package/dist-lib/lib/core/image/sniff.d.ts +3 -0
- package/dist-lib/lib/core/image/sniff.js +149 -0
- package/dist-lib/lib/core/invite.d.ts +14 -0
- package/dist-lib/lib/core/invite.js +36 -0
- package/dist-lib/lib/core/local/index.d.ts +71 -0
- package/dist-lib/lib/core/local/index.js +391 -0
- package/dist-lib/lib/core/membership.d.ts +15 -0
- package/dist-lib/lib/core/membership.js +40 -0
- package/dist-lib/lib/core/mesh.d.ts +153 -0
- package/dist-lib/lib/core/mesh.js +509 -0
- package/dist-lib/lib/core/migrations/agent-catalog.d.ts +6 -0
- package/dist-lib/lib/core/migrations/agent-catalog.js +17 -0
- package/dist-lib/lib/core/migrations/index.d.ts +5 -0
- package/dist-lib/lib/core/migrations/index.js +7 -0
- package/dist-lib/lib/core/migrations/membership.d.ts +11 -0
- package/dist-lib/lib/core/migrations/membership.js +26 -0
- package/dist-lib/lib/core/min-version.d.ts +6 -0
- package/dist-lib/lib/core/min-version.js +31 -0
- package/dist-lib/lib/core/next-frame.d.ts +6 -0
- package/dist-lib/lib/core/next-frame.js +27 -0
- package/dist-lib/lib/core/notification.d.ts +6 -0
- package/dist-lib/lib/core/notification.js +162 -0
- package/dist-lib/lib/core/ota-config.d.ts +19 -0
- package/dist-lib/lib/core/ota-config.js +44 -0
- package/dist-lib/lib/core/prompt-history.d.ts +12 -0
- package/dist-lib/lib/core/prompt-history.js +40 -0
- package/dist-lib/lib/core/search-fold.d.ts +1 -0
- package/dist-lib/lib/core/search-fold.js +4 -0
- package/dist-lib/lib/core/secret-handoff.d.ts +17 -0
- package/dist-lib/lib/core/secret-handoff.js +29 -0
- package/dist-lib/lib/core/send.d.ts +18 -0
- package/dist-lib/lib/core/send.js +46 -0
- package/dist-lib/lib/core/skill-overlay-handoff.d.ts +25 -0
- package/dist-lib/lib/core/skill-overlay-handoff.js +50 -0
- package/dist-lib/lib/core/skill-overlay-receiver.d.ts +8 -0
- package/dist-lib/lib/core/skill-overlay-receiver.js +20 -0
- package/dist-lib/lib/core/skill-secrets.d.ts +25 -0
- package/dist-lib/lib/core/skill-secrets.js +79 -0
- package/dist-lib/lib/core/sync/chats.d.ts +3 -0
- package/dist-lib/lib/core/sync/chats.js +5 -0
- package/dist-lib/lib/core/sync/chunks.d.ts +9 -0
- package/dist-lib/lib/core/sync/chunks.js +16 -0
- package/dist-lib/lib/core/sync/devices.d.ts +4 -0
- package/dist-lib/lib/core/sync/devices.js +12 -0
- package/dist-lib/lib/core/sync/files.d.ts +16 -0
- package/dist-lib/lib/core/sync/files.js +109 -0
- package/dist-lib/lib/core/sync/index.d.ts +5 -0
- package/dist-lib/lib/core/sync/index.js +63 -0
- package/dist-lib/lib/core/sync-status.d.ts +17 -0
- package/dist-lib/lib/core/sync-status.js +129 -0
- package/dist-lib/lib/core/system-info.d.ts +24 -0
- package/dist-lib/lib/core/system-info.js +66 -0
- package/dist-lib/lib/core/tool-activity.d.ts +22 -0
- package/dist-lib/lib/core/tool-activity.js +39 -0
- package/dist-lib/lib/core/tool-configs.d.ts +13 -0
- package/dist-lib/lib/core/tool-configs.js +141 -0
- package/dist-lib/lib/core.d.ts +291 -0
- package/dist-lib/lib/core.js +2126 -0
- package/dist-lib/lib/credential-pusher.d.ts +67 -0
- package/dist-lib/lib/credential-pusher.js +290 -0
- package/dist-lib/lib/custom-model-pusher.d.ts +9 -0
- package/dist-lib/lib/custom-model-pusher.js +42 -0
- package/dist-lib/lib/custom-model-source.d.ts +15 -0
- package/dist-lib/lib/custom-model-source.js +46 -0
- package/dist-lib/lib/deadline.d.ts +9 -0
- package/dist-lib/lib/deadline.js +31 -0
- package/dist-lib/lib/diagnostics.d.ts +35 -0
- package/dist-lib/lib/diagnostics.js +14 -0
- package/dist-lib/lib/fetch-node.d.ts +1 -0
- package/dist-lib/lib/fetch-node.js +1 -0
- package/dist-lib/lib/fs-drive-bridge.d.ts +12 -0
- package/dist-lib/lib/fs-drive-bridge.js +186 -0
- package/dist-lib/lib/fs-grant-keys.d.ts +2 -0
- package/dist-lib/lib/fs-grant-keys.js +6 -0
- package/dist-lib/lib/fs-grants.d.ts +10 -0
- package/dist-lib/lib/fs-grants.js +44 -0
- package/dist-lib/lib/image-cache-dir.d.ts +1 -0
- package/dist-lib/lib/image-cache-dir.js +5 -0
- package/dist-lib/lib/integrations/index.d.ts +4 -0
- package/dist-lib/lib/integrations/index.js +3 -0
- package/dist-lib/lib/integrations/mcp-providers.d.ts +12 -0
- package/dist-lib/lib/integrations/mcp-providers.js +22 -0
- package/dist-lib/lib/integrations/oauth-providers.d.ts +14 -0
- package/dist-lib/lib/integrations/oauth-providers.js +116 -0
- package/dist-lib/lib/integrations/setup-routes.d.ts +12 -0
- package/dist-lib/lib/integrations/setup-routes.js +114 -0
- package/dist-lib/lib/knowledge-search.d.ts +7 -0
- package/dist-lib/lib/knowledge-search.js +53 -0
- package/dist-lib/lib/kv-cache-reclaim.d.ts +5 -0
- package/dist-lib/lib/kv-cache-reclaim.js +29 -0
- package/dist-lib/lib/kv-cache.d.ts +18 -0
- package/dist-lib/lib/kv-cache.js +33 -0
- package/dist-lib/lib/legacy-core-domain.d.ts +258 -0
- package/dist-lib/lib/legacy-core-domain.js +1 -0
- package/dist-lib/lib/llm-model-names.d.ts +1 -0
- package/dist-lib/lib/llm-model-names.js +1 -0
- package/dist-lib/lib/log-buffer.d.ts +7 -0
- package/dist-lib/lib/log-buffer.js +16 -0
- package/dist-lib/lib/log-levels.d.ts +7 -0
- package/dist-lib/lib/log-levels.js +1 -0
- package/dist-lib/lib/log.d.ts +60 -0
- package/dist-lib/lib/log.js +149 -0
- package/dist-lib/lib/logger-type.d.ts +13 -0
- package/dist-lib/lib/logger-type.js +1 -0
- package/dist-lib/lib/logger.d.ts +5 -0
- package/dist-lib/lib/logger.js +18 -0
- package/dist-lib/lib/model-catalog-revision.d.ts +9 -0
- package/dist-lib/lib/model-catalog-revision.js +65 -0
- package/dist-lib/lib/model-clamp.d.ts +6 -0
- package/dist-lib/lib/model-clamp.js +20 -0
- package/dist-lib/lib/model-context.d.ts +13 -0
- package/dist-lib/lib/model-context.js +71 -0
- package/dist-lib/lib/model-download-status.d.ts +29 -0
- package/dist-lib/lib/model-download-status.js +56 -0
- package/dist-lib/lib/model-download.d.ts +191 -0
- package/dist-lib/lib/model-download.js +787 -0
- package/dist-lib/lib/oauth/asana.d.ts +35 -0
- package/dist-lib/lib/oauth/asana.js +71 -0
- package/dist-lib/lib/oauth/browser-connect.d.ts +22 -0
- package/dist-lib/lib/oauth/browser-connect.js +83 -0
- package/dist-lib/lib/oauth/client.d.ts +9 -0
- package/dist-lib/lib/oauth/client.js +9 -0
- package/dist-lib/lib/oauth/common.d.ts +38 -0
- package/dist-lib/lib/oauth/common.js +36 -0
- package/dist-lib/lib/oauth/crypto.d.ts +3 -0
- package/dist-lib/lib/oauth/crypto.js +25 -0
- package/dist-lib/lib/oauth/fetch-platform.d.ts +1 -0
- package/dist-lib/lib/oauth/fetch-platform.js +1 -0
- package/dist-lib/lib/oauth/flow-core.d.ts +6 -0
- package/dist-lib/lib/oauth/flow-core.js +37 -0
- package/dist-lib/lib/oauth/flow.d.ts +3 -0
- package/dist-lib/lib/oauth/flow.js +24 -0
- package/dist-lib/lib/oauth/google.d.ts +37 -0
- package/dist-lib/lib/oauth/google.js +77 -0
- package/dist-lib/lib/oauth/host.d.ts +5 -0
- package/dist-lib/lib/oauth/host.js +3 -0
- package/dist-lib/lib/oauth/keys.d.ts +25 -0
- package/dist-lib/lib/oauth/keys.js +93 -0
- package/dist-lib/lib/oauth/loopback.d.ts +3 -0
- package/dist-lib/lib/oauth/loopback.js +119 -0
- package/dist-lib/lib/oauth/loopback.stub.d.ts +3 -0
- package/dist-lib/lib/oauth/loopback.stub.js +6 -0
- package/dist-lib/lib/oauth/notion.d.ts +34 -0
- package/dist-lib/lib/oauth/notion.js +82 -0
- package/dist-lib/lib/oauth/pkce-runtime.d.ts +3 -0
- package/dist-lib/lib/oauth/pkce-runtime.js +5 -0
- package/dist-lib/lib/oauth/pkce.d.ts +8 -0
- package/dist-lib/lib/oauth/pkce.js +6 -0
- package/dist-lib/lib/oauth/providers.d.ts +5 -0
- package/dist-lib/lib/oauth/providers.js +73 -0
- package/dist-lib/lib/oauth/redirect-types.d.ts +19 -0
- package/dist-lib/lib/oauth/redirect-types.js +1 -0
- package/dist-lib/lib/oauth/register.d.ts +3 -0
- package/dist-lib/lib/oauth/register.js +34 -0
- package/dist-lib/lib/oauth/resolve.d.ts +17 -0
- package/dist-lib/lib/oauth/resolve.js +57 -0
- package/dist-lib/lib/oauth/spotify.d.ts +32 -0
- package/dist-lib/lib/oauth/spotify.js +73 -0
- package/dist-lib/lib/oauth/token-exchange-core.d.ts +6 -0
- package/dist-lib/lib/oauth/token-exchange-core.js +97 -0
- package/dist-lib/lib/oauth/token-exchange.d.ts +5 -0
- package/dist-lib/lib/oauth/token-exchange.js +9 -0
- package/dist-lib/lib/oauth/types.d.ts +54 -0
- package/dist-lib/lib/oauth/types.js +1 -0
- package/dist-lib/lib/oauth.client.d.ts +5 -0
- package/dist-lib/lib/oauth.client.js +2 -0
- package/dist-lib/lib/oauth.d.ts +14 -0
- package/dist-lib/lib/oauth.js +12 -0
- package/dist-lib/lib/obsidian-key.d.ts +1 -0
- package/dist-lib/lib/obsidian-key.js +1 -0
- package/dist-lib/lib/race-resource.d.ts +5 -0
- package/dist-lib/lib/race-resource.js +25 -0
- package/dist-lib/lib/reconnecting-watch.d.ts +2 -0
- package/dist-lib/lib/reconnecting-watch.js +78 -0
- package/dist-lib/lib/retry-budget.d.ts +14 -0
- package/dist-lib/lib/retry-budget.js +39 -0
- package/dist-lib/lib/run-notices.d.ts +23 -0
- package/dist-lib/lib/run-notices.js +33 -0
- package/dist-lib/lib/run-transcript.d.ts +35 -0
- package/dist-lib/lib/run-transcript.js +106 -0
- package/dist-lib/lib/skill-readiness.d.ts +2 -0
- package/dist-lib/lib/skill-readiness.js +21 -0
- package/dist-lib/lib/skill-types.d.ts +70 -0
- package/dist-lib/lib/skill-types.js +1 -0
- package/dist-lib/lib/spec-loader.d.ts +14 -0
- package/dist-lib/lib/spec-loader.js +9 -0
- package/dist-lib/lib/suspend-lifecycle.d.ts +17 -0
- package/dist-lib/lib/suspend-lifecycle.js +33 -0
- package/dist-lib/lib/task.d.ts +26 -0
- package/dist-lib/lib/task.js +69 -0
- package/dist-lib/lib/unref.d.ts +3 -0
- package/dist-lib/lib/unref.js +4 -0
- package/dist-lib/lib/wav-duration.d.ts +1 -0
- package/dist-lib/lib/wav-duration.js +53 -0
- package/dist-lib/lib/write-queue.d.ts +22 -0
- package/dist-lib/lib/write-queue.js +39 -0
- package/dist-lib/schema/build.d.ts +1 -0
- package/dist-lib/schema/build.js +120 -0
- package/dist-lib/schema/config.d.ts +4 -0
- package/dist-lib/schema/config.js +7 -0
- package/dist-lib/schema/content.d.ts +20 -0
- package/dist-lib/schema/content.js +122 -0
- package/dist-lib/schema/engine.d.ts +2 -0
- package/dist-lib/schema/engine.js +2013 -0
- package/dist-lib/schema/field-order.d.ts +1 -0
- package/dist-lib/schema/field-order.js +95 -0
- package/dist-lib/schema/helpers.d.ts +28 -0
- package/dist-lib/schema/helpers.js +176 -0
- package/dist-lib/schema/local.d.ts +2 -0
- package/dist-lib/schema/local.js +133 -0
- package/dist-lib/schema/qvac.d.ts +22 -0
- package/dist-lib/schema/qvac.js +722 -0
- package/dist-lib/schema/vendor.d.ts +5 -0
- package/dist-lib/spec/bind.d.ts +2 -0
- package/dist-lib/spec/bind.js +520 -0
- package/dist-lib/spec/calls.d.ts +3 -0
- package/dist-lib/spec/calls.js +129 -0
- package/dist-lib/spec/capabilities.d.ts +263 -0
- package/dist-lib/spec/config/hyperconf/index.d.ts +15 -0
- package/dist-lib/spec/config/hyperconf/index.js +24 -0
- package/dist-lib/spec/config/hyperconf/package.json +3 -0
- package/dist-lib/spec/config/hyperschema/index.js +81 -0
- package/dist-lib/spec/config/hyperschema/schema.json +19 -0
- package/dist-lib/spec/hrpc/hrpc.json +1500 -0
- package/dist-lib/spec/hrpc/index.d.ts +3 -0
- package/dist-lib/spec/hrpc/index.js +1545 -0
- package/dist-lib/spec/hrpc/messages.d.ts +4 -0
- package/dist-lib/spec/hrpc/messages.js +8373 -0
- package/dist-lib/spec/hyperschema/index.d.ts +20 -0
- package/dist-lib/spec/hyperschema/index.js +8373 -0
- package/dist-lib/spec/hyperschema/schema.json +6202 -0
- package/dist-lib/spec/hyperschema/types.d.ts +1545 -0
- package/dist-lib/spec/index.d.ts +36 -0
- package/dist-lib/spec/index.js +6 -0
- package/dist-lib/spec/local/hyperdb/db.json +186 -0
- package/dist-lib/spec/local/hyperdb/index.d.ts +9 -0
- package/dist-lib/spec/local/hyperdb/index.js +855 -0
- package/dist-lib/spec/local/hyperdb/messages.js +2189 -0
- package/dist-lib/spec/local/hyperschema/index.js +1208 -0
- package/dist-lib/spec/local/hyperschema/schema.json +639 -0
- package/dist-lib/spec/local/hyperschema/types.d.ts +159 -0
- package/dist-lib/spec/mesh/hyperdb/db.json +702 -0
- package/dist-lib/spec/mesh/hyperdb/index.d.ts +9 -0
- package/dist-lib/spec/mesh/hyperdb/index.js +2260 -0
- package/dist-lib/spec/mesh/hyperdb/messages.js +7453 -0
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +174 -0
- package/dist-lib/spec/mesh/hyperdispatch/index.d.ts +13 -0
- package/dist-lib/spec/mesh/hyperdispatch/index.js +566 -0
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +5713 -0
- package/dist-lib/spec/mesh/hyperschema/index.d.ts +14 -0
- package/dist-lib/spec/mesh/hyperschema/index.js +5713 -0
- package/dist-lib/spec/mesh/hyperschema/schema.json +3142 -0
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +754 -0
- package/ducks.png +0 -0
- package/package.json +336 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import b4a from 'b4a';
|
|
2
|
+
import { getAgent } from "./agent.js";
|
|
3
|
+
import { NO_SUCH_AGENT, NOT_THE_HOST, SENDER_REVOKED } from "./skill-secrets.js";
|
|
4
|
+
const DEVICES = '@qvac/devices';
|
|
5
|
+
export function createSkillOverlayReceiver(opts) {
|
|
6
|
+
return async (op, fromDeviceId) => {
|
|
7
|
+
const sender = await opts.mesh.view.get(DEVICES, { id: fromDeviceId });
|
|
8
|
+
if (!sender || sender.revoked)
|
|
9
|
+
throw new Error(SENDER_REVOKED);
|
|
10
|
+
if (!op.agentId)
|
|
11
|
+
throw new Error(NO_SUCH_AGENT);
|
|
12
|
+
const agent = await getAgent(opts.mesh, op.agentId);
|
|
13
|
+
if (!agent)
|
|
14
|
+
throw new Error(NO_SUCH_AGENT);
|
|
15
|
+
if (!agent.providerDeviceId || !b4a.equals(agent.providerDeviceId, opts.deviceId)) {
|
|
16
|
+
throw new Error(NOT_THE_HOST);
|
|
17
|
+
}
|
|
18
|
+
return opts.runLocal(op);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AssistantSkill } from '../../spec/hyperschema/types.d.ts';
|
|
2
|
+
import type { QvacAgent } from '../../spec/mesh/hyperschema/types.d.ts';
|
|
3
|
+
import type { openLocalStore } from './local/index.ts';
|
|
4
|
+
import type { Mesh } from './mesh.ts';
|
|
5
|
+
import type { SecretRequestHandler } from './secret-handoff.ts';
|
|
6
|
+
export declare const NOT_THE_HOST = "this device does not host that agent";
|
|
7
|
+
export declare const SENDER_REVOKED = "the sending device is no longer in the mesh";
|
|
8
|
+
export declare const HOST_REVOKED = "the device hosting this agent is no longer in the mesh";
|
|
9
|
+
export declare const NO_SUCH_AGENT = "no agent with that id";
|
|
10
|
+
export declare const NOT_A_SETUP_FIELD = "that skill declares no such setup field";
|
|
11
|
+
export type SetupFields = (skillName: string) => Promise<ReadonlyMap<string, boolean> | null>;
|
|
12
|
+
export interface SkillSecretsOptions {
|
|
13
|
+
readonly mesh: Mesh;
|
|
14
|
+
readonly local: ReturnType<typeof openLocalStore>;
|
|
15
|
+
readonly deviceId: Uint8Array;
|
|
16
|
+
readonly setupFields: SetupFields;
|
|
17
|
+
readonly onstored: () => Promise<unknown>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createSkillSecretReceiver(opts: SkillSecretsOptions): SecretRequestHandler;
|
|
20
|
+
export interface SkillValue {
|
|
21
|
+
readonly skillName: string;
|
|
22
|
+
readonly key: string;
|
|
23
|
+
readonly storageKey: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function agentSkillValues(catalog: ReadonlyArray<AssistantSkill>, agent: Pick<QvacAgent, 'id' | 'installedSkills' | 'enabledSkills'>): ReadonlyArray<SkillValue>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import b4a from 'b4a';
|
|
2
|
+
import { credentialSlots } from '@qvac/harness/lib/tools/skills/credential-slots.ts';
|
|
3
|
+
import { isDeviceSharedCredentialKey } from '@qvac/harness/lib/tools/skills/scope-key.ts';
|
|
4
|
+
import { oauthStateKey, settingConfigKey } from "../credential-pusher.js";
|
|
5
|
+
import { scopedKey } from "../oauth/common.js";
|
|
6
|
+
import { getAgent } from "./agent.js";
|
|
7
|
+
const DEVICES = '@qvac/devices';
|
|
8
|
+
export const NOT_THE_HOST = 'this device does not host that agent';
|
|
9
|
+
export const SENDER_REVOKED = 'the sending device is no longer in the mesh';
|
|
10
|
+
export const HOST_REVOKED = 'the device hosting this agent is no longer in the mesh';
|
|
11
|
+
export const NO_SUCH_AGENT = 'no agent with that id';
|
|
12
|
+
export const NOT_A_SETUP_FIELD = 'that skill declares no such setup field';
|
|
13
|
+
export function createSkillSecretReceiver(opts) {
|
|
14
|
+
return async (request, fromDeviceId) => {
|
|
15
|
+
const sender = await opts.mesh.view.get(DEVICES, { id: fromDeviceId });
|
|
16
|
+
if (!sender || sender.revoked)
|
|
17
|
+
throw new Error(SENDER_REVOKED);
|
|
18
|
+
const agent = await getAgent(opts.mesh, request.agentId);
|
|
19
|
+
if (!agent)
|
|
20
|
+
throw new Error(NO_SUCH_AGENT);
|
|
21
|
+
if (!agent.providerDeviceId || !b4a.equals(agent.providerDeviceId, opts.deviceId)) {
|
|
22
|
+
throw new Error(NOT_THE_HOST);
|
|
23
|
+
}
|
|
24
|
+
const fields = await opts.setupFields(request.skillName);
|
|
25
|
+
if (fields && request.values.some(({ key }) => !fields.has(key))) {
|
|
26
|
+
throw new Error(NOT_A_SETUP_FIELD);
|
|
27
|
+
}
|
|
28
|
+
const entries = request.values.map(({ key, value }) => ({
|
|
29
|
+
key: fields?.get(key) === false
|
|
30
|
+
? settingConfigKey(undefined, request.skillName, key)
|
|
31
|
+
: scopedKey(isDeviceSharedCredentialKey(key) ? undefined : request.agentId, key),
|
|
32
|
+
value
|
|
33
|
+
}));
|
|
34
|
+
if (entries.length === 0)
|
|
35
|
+
return;
|
|
36
|
+
await opts.local.setAll(entries);
|
|
37
|
+
await opts.onstored();
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function agentSkillValues(catalog, agent) {
|
|
41
|
+
const installed = new Set([...(agent.installedSkills ?? []), ...(agent.enabledSkills ?? [])]);
|
|
42
|
+
const values = new Map();
|
|
43
|
+
for (const skill of catalog) {
|
|
44
|
+
if (!installed.has(skill.name))
|
|
45
|
+
continue;
|
|
46
|
+
for (const key of credentialKeys(skill)) {
|
|
47
|
+
if (isDeviceSharedCredentialKey(key))
|
|
48
|
+
continue;
|
|
49
|
+
const storageKey = scopedKey(agent.id, key);
|
|
50
|
+
values.set(storageKey, { skillName: skill.name, key, storageKey });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return [...values.values()];
|
|
54
|
+
}
|
|
55
|
+
function credentialKeys(skill) {
|
|
56
|
+
const keys = new Set();
|
|
57
|
+
const slots = credentialSlots({
|
|
58
|
+
credentials: skill.credentials ?? undefined,
|
|
59
|
+
requires: { credentials: skill.requirements?.credentials ?? undefined }
|
|
60
|
+
});
|
|
61
|
+
for (const slot of slots) {
|
|
62
|
+
for (const key of slot)
|
|
63
|
+
keys.add(key);
|
|
64
|
+
}
|
|
65
|
+
for (const route of skill.setup?.routes ?? []) {
|
|
66
|
+
if (route.credentialKey)
|
|
67
|
+
keys.add(route.credentialKey);
|
|
68
|
+
for (const field of route.fields ?? []) {
|
|
69
|
+
if (field.secret === true)
|
|
70
|
+
keys.add(field.key);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
for (const key of [...keys]) {
|
|
74
|
+
const state = oauthStateKey(key);
|
|
75
|
+
if (state)
|
|
76
|
+
keys.add(state);
|
|
77
|
+
}
|
|
78
|
+
return [...keys];
|
|
79
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { QvacChunk } from '../../../spec/mesh/hyperschema/types';
|
|
2
|
+
import type { Mesh } from '../mesh';
|
|
3
|
+
export interface NotificationEvent {
|
|
4
|
+
readonly chatId: string;
|
|
5
|
+
readonly chunkId: string;
|
|
6
|
+
readonly seq: number;
|
|
7
|
+
readonly type: 'run-status' | 'approval-request' | 'user-message';
|
|
8
|
+
}
|
|
9
|
+
export declare function syncNotificationChunk(mesh: Mesh, chunk: QvacChunk): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function syncNotificationChunk(mesh, chunk) {
|
|
2
|
+
if (chunk.type === 'run-status') {
|
|
3
|
+
const state = chunk.runStatus?.state;
|
|
4
|
+
if (state !== 'completed' && state !== 'failed')
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
else if (chunk.type !== 'approval-request' && chunk.type !== 'user-message') {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
mesh.emit('notification', {
|
|
11
|
+
chatId: chunk.chatId,
|
|
12
|
+
chunkId: chunk.id,
|
|
13
|
+
seq: chunk.seq,
|
|
14
|
+
type: chunk.type
|
|
15
|
+
});
|
|
16
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { QvacDevice } from '../../../spec/mesh/hyperschema/types';
|
|
2
|
+
import type { Mesh } from '../mesh.ts';
|
|
3
|
+
export declare function syncOwnMember(mesh: Mesh, device: QvacDevice): void;
|
|
4
|
+
export declare function syncDeviceRevocation(mesh: Mesh, device: QvacDevice): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { isOwnKickedRow } from "../helpers/index.js";
|
|
2
|
+
export function syncOwnMember(mesh, device) {
|
|
3
|
+
if (!device.writerKey?.equals(mesh.localWriterKey))
|
|
4
|
+
return;
|
|
5
|
+
void mesh.refreshOurMember();
|
|
6
|
+
}
|
|
7
|
+
export function syncDeviceRevocation(mesh, device) {
|
|
8
|
+
if (!isOwnKickedRow(mesh, device))
|
|
9
|
+
return;
|
|
10
|
+
logger.info('sync', 'our writer was revoked (kicked)');
|
|
11
|
+
mesh.emit('kicked');
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type HyperDB from 'hyperdb';
|
|
2
|
+
import type { ViewChange } from 'hyperdb';
|
|
3
|
+
export declare class FileChanges {
|
|
4
|
+
private readonly _snap;
|
|
5
|
+
private readonly _from;
|
|
6
|
+
private readonly _documents;
|
|
7
|
+
private readonly _chats;
|
|
8
|
+
private readonly _agents;
|
|
9
|
+
private readonly _devices;
|
|
10
|
+
constructor(snap: HyperDB, from: {
|
|
11
|
+
key: Buffer;
|
|
12
|
+
length: number;
|
|
13
|
+
});
|
|
14
|
+
add(change: ViewChange): Promise<void>;
|
|
15
|
+
ids(): Promise<Set<string>>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import b4a from 'b4a';
|
|
2
|
+
import { toolsetEnabled } from '@qvac/harness/lib/tools/toolsets.ts';
|
|
3
|
+
export class FileChanges {
|
|
4
|
+
_snap;
|
|
5
|
+
_from;
|
|
6
|
+
_documents = new Set();
|
|
7
|
+
_chats = new Set();
|
|
8
|
+
_agents = new Set();
|
|
9
|
+
_devices = new Set();
|
|
10
|
+
constructor(snap, from) {
|
|
11
|
+
this._snap = snap;
|
|
12
|
+
this._from = from;
|
|
13
|
+
}
|
|
14
|
+
async add(change) {
|
|
15
|
+
const { collection, value } = change;
|
|
16
|
+
const query = { id: value.id };
|
|
17
|
+
const previous = { checkout: this._from };
|
|
18
|
+
switch (collection) {
|
|
19
|
+
case '@qvac/chunks': {
|
|
20
|
+
const chunk = await this._snap.get(collection, query);
|
|
21
|
+
if (chunk?.attachment && chunk.id === chunk.attachment.id)
|
|
22
|
+
this._documents.add(chunk.id);
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
case '@qvac/knowledge':
|
|
26
|
+
if (typeof value.id === 'string')
|
|
27
|
+
this._documents.add(value.id);
|
|
28
|
+
break;
|
|
29
|
+
case '@qvac/knowledge-artifacts':
|
|
30
|
+
case '@qvac/indexing-status': {
|
|
31
|
+
const row = change.type === 'delete' ? await this._snap.get(collection, query, previous) : value;
|
|
32
|
+
if (typeof row?.knowledgeId === 'string')
|
|
33
|
+
this._documents.add(row.knowledgeId);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
case '@qvac/chats': {
|
|
37
|
+
const before = await this._snap.get(collection, query, previous);
|
|
38
|
+
const after = await this._snap.get(collection, query);
|
|
39
|
+
if (!before ||
|
|
40
|
+
!after ||
|
|
41
|
+
before.agentId !== after.agentId ||
|
|
42
|
+
!!before.deletedAt !== !!after.deletedAt) {
|
|
43
|
+
const row = after ?? before;
|
|
44
|
+
if (row)
|
|
45
|
+
this._chats.add(row.id);
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case '@qvac/agents': {
|
|
50
|
+
const before = await this._snap.get(collection, query, previous);
|
|
51
|
+
const after = await this._snap.get(collection, query);
|
|
52
|
+
if (!before ||
|
|
53
|
+
!after ||
|
|
54
|
+
!b4a.equals(before.providerDeviceId, after.providerDeviceId) ||
|
|
55
|
+
!!before.deletedAt !== !!after.deletedAt ||
|
|
56
|
+
toolsetEnabled('knowledge', before.disabledToolsets) !==
|
|
57
|
+
toolsetEnabled('knowledge', after.disabledToolsets)) {
|
|
58
|
+
const row = after ?? before;
|
|
59
|
+
if (row)
|
|
60
|
+
this._agents.add(row.id);
|
|
61
|
+
}
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case '@qvac/devices': {
|
|
65
|
+
const before = await this._snap.get(collection, query, previous);
|
|
66
|
+
const after = await this._snap.get(collection, query);
|
|
67
|
+
if (!before || !after || !!before.revoked !== !!after.revoked) {
|
|
68
|
+
const row = after ?? before;
|
|
69
|
+
if (row)
|
|
70
|
+
this._devices.add(b4a.toString(row.id, 'hex'));
|
|
71
|
+
}
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async ids() {
|
|
77
|
+
if (this._devices.size) {
|
|
78
|
+
for await (const agent of this._snap.find('@qvac/agents')) {
|
|
79
|
+
if (this._devices.has(b4a.toString(agent.providerDeviceId, 'hex'))) {
|
|
80
|
+
this._agents.add(agent.id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (const agentId of this._agents) {
|
|
85
|
+
for await (const chat of this._snap.find('@qvac/active-chats-by-agent', {
|
|
86
|
+
gte: { agentId },
|
|
87
|
+
lte: { agentId }
|
|
88
|
+
})) {
|
|
89
|
+
this._chats.add(chat.id);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
for (const chatId of this._chats) {
|
|
93
|
+
for await (const document of this._snap.find('@qvac/knowledge-by-chat', {
|
|
94
|
+
gte: { chatId },
|
|
95
|
+
lte: { chatId }
|
|
96
|
+
})) {
|
|
97
|
+
this._documents.add(document.id);
|
|
98
|
+
}
|
|
99
|
+
for await (const chunk of this._snap.find('@qvac/chunks-by-chat', {
|
|
100
|
+
gte: { chatId },
|
|
101
|
+
lte: { chatId }
|
|
102
|
+
})) {
|
|
103
|
+
if (chunk.attachment && chunk.id === chunk.attachment.id)
|
|
104
|
+
this._documents.add(chunk.id);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return this._documents;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { FileChanges } from "./files.js";
|
|
2
|
+
import { syncDeviceRevocation, syncOwnMember } from "./devices.js";
|
|
3
|
+
import { syncChatTombstone } from "./chats.js";
|
|
4
|
+
import { syncNotificationChunk } from "./chunks.js";
|
|
5
|
+
export async function syncChanges(mesh, view, from) {
|
|
6
|
+
if (mesh.closing)
|
|
7
|
+
return;
|
|
8
|
+
let indexingDirty = new Set();
|
|
9
|
+
let unattestedDevice = false;
|
|
10
|
+
let membershipMoved = false;
|
|
11
|
+
let agentsDirty = false;
|
|
12
|
+
const snap = view.db.snapshot();
|
|
13
|
+
const files = new FileChanges(snap, from);
|
|
14
|
+
try {
|
|
15
|
+
for await (const change of snap.changes({ from })) {
|
|
16
|
+
if (mesh.closing)
|
|
17
|
+
return;
|
|
18
|
+
await files.add(change);
|
|
19
|
+
switch (change.collection) {
|
|
20
|
+
case '@qvac/devices': {
|
|
21
|
+
membershipMoved = true;
|
|
22
|
+
const device = change.value;
|
|
23
|
+
if (!device.revoked && !device.memberId)
|
|
24
|
+
unattestedDevice = true;
|
|
25
|
+
syncOwnMember(mesh, device);
|
|
26
|
+
syncDeviceRevocation(mesh, device);
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case '@qvac/members':
|
|
30
|
+
membershipMoved = true;
|
|
31
|
+
break;
|
|
32
|
+
case '@qvac/agents':
|
|
33
|
+
agentsDirty = true;
|
|
34
|
+
break;
|
|
35
|
+
case '@qvac/chats':
|
|
36
|
+
syncChatTombstone(mesh, change.value);
|
|
37
|
+
break;
|
|
38
|
+
case '@qvac/chunks':
|
|
39
|
+
syncNotificationChunk(mesh, change.value);
|
|
40
|
+
await mesh.files.syncAttachment(change.value);
|
|
41
|
+
break;
|
|
42
|
+
case '@qvac/knowledge':
|
|
43
|
+
await mesh.files.syncKnowledge(change.value);
|
|
44
|
+
break;
|
|
45
|
+
case '@qvac/knowledge-artifacts':
|
|
46
|
+
await mesh.files.syncArtifact(change.value);
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
indexingDirty = await files.ids();
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
await snap.close();
|
|
54
|
+
}
|
|
55
|
+
if (indexingDirty.size)
|
|
56
|
+
mesh.emit('indexing-dirty', indexingDirty);
|
|
57
|
+
if (unattestedDevice)
|
|
58
|
+
mesh.emit('unattested-device');
|
|
59
|
+
if (membershipMoved)
|
|
60
|
+
await mesh.refreshMembership();
|
|
61
|
+
if (agentsDirty)
|
|
62
|
+
mesh.emit('agents-dirty');
|
|
63
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AssistantSyncStatus } from '../../spec/hyperschema/types.d.ts';
|
|
2
|
+
import type { Mesh } from './mesh.ts';
|
|
3
|
+
export interface SyncActivity {
|
|
4
|
+
watch(listener: () => void): void;
|
|
5
|
+
unwatch(listener: () => void): void;
|
|
6
|
+
once(event: 'close', listener: () => void): unknown;
|
|
7
|
+
off(event: 'close', listener: () => void): unknown;
|
|
8
|
+
readonly closing: unknown;
|
|
9
|
+
readonly closed: boolean;
|
|
10
|
+
readonly hold: SyncHold;
|
|
11
|
+
snapshot(): Promise<AssistantSyncStatus>;
|
|
12
|
+
}
|
|
13
|
+
export interface SyncHold {
|
|
14
|
+
keep(busy: boolean): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function createSyncActivity(mesh: Mesh): SyncActivity;
|
|
17
|
+
export declare function syncStatusSnapshot(mesh: Mesh): Promise<AssistantSyncStatus>;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { unref } from "../unref.js";
|
|
2
|
+
const DEVICES = '@qvac/devices';
|
|
3
|
+
const MIN_SYNCING_MS = 1000;
|
|
4
|
+
export function createSyncActivity(mesh) {
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
const notify = () => {
|
|
7
|
+
for (const listener of [...listeners])
|
|
8
|
+
listener();
|
|
9
|
+
};
|
|
10
|
+
const track = (writer) => {
|
|
11
|
+
writer.core.on('append', notify);
|
|
12
|
+
writer.core.on('download', notify);
|
|
13
|
+
};
|
|
14
|
+
mesh.watch(notify);
|
|
15
|
+
mesh.autobee.on('writer', (writer) => track(writer));
|
|
16
|
+
for (const writer of mesh.autobee.activeWriters)
|
|
17
|
+
track(writer);
|
|
18
|
+
mesh.autobee.local.on('upload', notify);
|
|
19
|
+
mesh.autobee.local.on('peer-remove', notify);
|
|
20
|
+
return {
|
|
21
|
+
watch: (listener) => void listeners.add(listener),
|
|
22
|
+
unwatch: (listener) => void listeners.delete(listener),
|
|
23
|
+
once: (event, listener) => mesh.once(event, listener),
|
|
24
|
+
off: (event, listener) => mesh.off(event, listener),
|
|
25
|
+
get closing() {
|
|
26
|
+
return mesh.closing;
|
|
27
|
+
},
|
|
28
|
+
get closed() {
|
|
29
|
+
return mesh.closed;
|
|
30
|
+
},
|
|
31
|
+
hold: createSyncHold(notify),
|
|
32
|
+
snapshot: () => syncStatusSnapshot(mesh)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function createSyncHold(notify) {
|
|
36
|
+
let busyUntil = 0;
|
|
37
|
+
let timer = null;
|
|
38
|
+
return {
|
|
39
|
+
keep(busy) {
|
|
40
|
+
if (busy) {
|
|
41
|
+
busyUntil = Date.now() + MIN_SYNCING_MS;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
const remaining = busyUntil - Date.now();
|
|
45
|
+
if (remaining <= 0) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
if (timer === null) {
|
|
49
|
+
timer = setTimeout(() => {
|
|
50
|
+
timer = null;
|
|
51
|
+
notify();
|
|
52
|
+
}, remaining);
|
|
53
|
+
unref(timer);
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export async function syncStatusSnapshot(mesh) {
|
|
60
|
+
const deviceByWriter = await writerDeviceMap(mesh);
|
|
61
|
+
const localKey = mesh.autobee.local.key;
|
|
62
|
+
const sessions = openWriterSessions(mesh);
|
|
63
|
+
const remoteWriters = [...new Set([...deviceByWriter.keys(), ...sessions.keys()])]
|
|
64
|
+
.map((hex) => {
|
|
65
|
+
const session = sessions.get(hex);
|
|
66
|
+
const device = deviceByWriter.get(hex);
|
|
67
|
+
return { session, device, writerKey: session ? session.core.key : device.writerKey };
|
|
68
|
+
})
|
|
69
|
+
.filter((writer) => !writer.writerKey.equals(localKey));
|
|
70
|
+
const rows = await Promise.all(remoteWriters.map(async ({ session, device, writerKey }) => {
|
|
71
|
+
const info = await mesh.autobee.system.get(writerKey, { unflushed: true });
|
|
72
|
+
return {
|
|
73
|
+
device,
|
|
74
|
+
writerKey,
|
|
75
|
+
info,
|
|
76
|
+
length: session?.core.length ?? 0,
|
|
77
|
+
contiguousLength: session?.core.contiguousLength ?? 0
|
|
78
|
+
};
|
|
79
|
+
}));
|
|
80
|
+
const devices = [];
|
|
81
|
+
let pendingOps = 0;
|
|
82
|
+
for (const { device, writerKey, info, length, contiguousLength } of rows) {
|
|
83
|
+
if (info?.isRemoved)
|
|
84
|
+
continue;
|
|
85
|
+
const known = Math.max(info?.length ?? 0, length);
|
|
86
|
+
const applied = Math.max(info?.length ?? 0, contiguousLength);
|
|
87
|
+
pendingOps += Math.max(0, known - applied);
|
|
88
|
+
devices.push({
|
|
89
|
+
writerKey,
|
|
90
|
+
...(device ? { deviceId: device.id } : null),
|
|
91
|
+
applied,
|
|
92
|
+
known
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
const pendingUploads = mesh.pendingUploads();
|
|
96
|
+
const syncing = mesh.syncActivity.hold.keep(pendingOps + pendingUploads > 0);
|
|
97
|
+
return {
|
|
98
|
+
state: statusState(devices.length, syncing),
|
|
99
|
+
pendingOps,
|
|
100
|
+
pendingUploads,
|
|
101
|
+
devices
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function statusState(writerCount, syncing) {
|
|
105
|
+
if (writerCount === 0)
|
|
106
|
+
return 'idle';
|
|
107
|
+
return syncing ? 'syncing' : 'synced';
|
|
108
|
+
}
|
|
109
|
+
function openWriterSessions(mesh) {
|
|
110
|
+
const sessions = new Map();
|
|
111
|
+
for (const writer of mesh.autobee.activeWriters) {
|
|
112
|
+
sessions.set(writer.core.key.toString('hex'), writer);
|
|
113
|
+
}
|
|
114
|
+
return sessions;
|
|
115
|
+
}
|
|
116
|
+
async function writerDeviceMap(mesh) {
|
|
117
|
+
const map = new Map();
|
|
118
|
+
const snap = mesh.view.snapshot();
|
|
119
|
+
try {
|
|
120
|
+
for await (const device of snap.find(DEVICES)) {
|
|
121
|
+
if (device.writerKey && !device.revoked)
|
|
122
|
+
map.set(device.writerKey.toString('hex'), device);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
await snap.close();
|
|
127
|
+
}
|
|
128
|
+
return map;
|
|
129
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type CPUInfo from 'bare-cpu-info';
|
|
2
|
+
import type { Drivers, GPU, Usage as GpuUsage } from 'bare-gpu-info';
|
|
3
|
+
import '../logger.ts';
|
|
4
|
+
export type CpuQuery = ReturnType<CPUInfo['query']>;
|
|
5
|
+
export type CpuUsage = ReturnType<CPUInfo['sample']>;
|
|
6
|
+
export type CpuDiagnostics = CpuQuery & {
|
|
7
|
+
readonly usage: CpuUsage;
|
|
8
|
+
};
|
|
9
|
+
export type GpuDeviceDiagnostics = GPU & {
|
|
10
|
+
readonly usage: GpuUsage;
|
|
11
|
+
};
|
|
12
|
+
export interface GpuDiagnostics {
|
|
13
|
+
readonly drivers: Drivers;
|
|
14
|
+
readonly devices: ReadonlyArray<GpuDeviceDiagnostics>;
|
|
15
|
+
}
|
|
16
|
+
export interface SystemInfoSnapshot {
|
|
17
|
+
readonly cpu: CpuDiagnostics | null;
|
|
18
|
+
readonly gpu: GpuDiagnostics | null;
|
|
19
|
+
}
|
|
20
|
+
export interface SystemInfoSampler {
|
|
21
|
+
snapshot(): SystemInfoSnapshot;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createSystemInfoSampler(): SystemInfoSampler;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import CPUInfoCtor from '#cpu-info';
|
|
2
|
+
import GPUInfoCtor from '#gpu-info';
|
|
3
|
+
import "../logger.js";
|
|
4
|
+
const LOG_TAG = ['diagnostics', 'system-info'];
|
|
5
|
+
function readCpu(cpu) {
|
|
6
|
+
try {
|
|
7
|
+
return { ...cpu.query(), usage: cpu.sample() };
|
|
8
|
+
}
|
|
9
|
+
catch (err) {
|
|
10
|
+
logger.warn(LOG_TAG, 'cpu sample failed', err);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function readGpu(gpu) {
|
|
15
|
+
try {
|
|
16
|
+
const drivers = gpu.drivers();
|
|
17
|
+
const devices = [];
|
|
18
|
+
for (let i = 0; i < gpu.length; i++) {
|
|
19
|
+
try {
|
|
20
|
+
devices.push({ ...gpu.gpu(i), usage: gpu.sample(i) });
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
logger.warn(LOG_TAG, `gpu device ${i} sample failed`, err);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { drivers, devices };
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
logger.warn(LOG_TAG, 'gpu drivers query failed', err);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function createSystemInfoSampler() {
|
|
34
|
+
let cpu = null;
|
|
35
|
+
let gpu = null;
|
|
36
|
+
try {
|
|
37
|
+
if (CPUInfoCtor)
|
|
38
|
+
cpu = new CPUInfoCtor();
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
logger.warn(LOG_TAG, 'bare-cpu-info constructor failed', err);
|
|
42
|
+
cpu = null;
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
if (GPUInfoCtor)
|
|
46
|
+
gpu = new GPUInfoCtor();
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
logger.warn(LOG_TAG, 'bare-gpu-info constructor failed', err);
|
|
50
|
+
gpu = null;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
snapshot() {
|
|
54
|
+
return {
|
|
55
|
+
cpu: cpu ? readCpu(cpu) : null,
|
|
56
|
+
gpu: gpu ? readGpu(gpu) : null
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
destroy() {
|
|
60
|
+
cpu?.destroy();
|
|
61
|
+
gpu?.destroy();
|
|
62
|
+
cpu = null;
|
|
63
|
+
gpu = null;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { QvacResourceDescriptor, QvacToolActivity, QvacToolDecision } from '../../spec/mesh/hyperschema/types.d.ts';
|
|
2
|
+
import type { Mesh } from './mesh.ts';
|
|
3
|
+
export interface ToolActivityInput {
|
|
4
|
+
readonly agentId: string;
|
|
5
|
+
readonly originDeviceId: Buffer;
|
|
6
|
+
readonly toolName: string;
|
|
7
|
+
readonly decision: QvacToolDecision;
|
|
8
|
+
readonly effect?: string;
|
|
9
|
+
readonly arguments?: unknown;
|
|
10
|
+
readonly resource?: QvacResourceDescriptor | null;
|
|
11
|
+
readonly chatId?: string;
|
|
12
|
+
readonly runId?: string;
|
|
13
|
+
readonly at: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function recordToolActivity(store: Mesh, input: ToolActivityInput): Promise<{
|
|
16
|
+
id: string;
|
|
17
|
+
}>;
|
|
18
|
+
export interface ListToolActivityOptions {
|
|
19
|
+
readonly limit?: number;
|
|
20
|
+
readonly beforeSeq?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare function listToolActivity(store: Mesh, agentId: string, { limit, beforeSeq }?: ListToolActivityOptions): Promise<QvacToolActivity[]>;
|