@qvac/core 1.0.0-rc.1 → 1.0.0-rc.2
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 +852 -1
- package/README.md +40 -81
- package/dist-lib/index.d.ts +0 -1
- package/dist-lib/index.js +0 -1
- package/dist-lib/lib/api/agent-folders.d.ts +22 -0
- package/dist-lib/lib/api/agent-folders.js +115 -0
- package/dist-lib/lib/api/agents.d.ts +19 -2
- package/dist-lib/lib/api/agents.js +121 -24
- package/dist-lib/lib/api/app-config.d.ts +4 -1
- package/dist-lib/lib/api/app-config.js +17 -6
- package/dist-lib/lib/api/attachments.js +3 -2
- package/dist-lib/lib/api/chat-move.d.ts +4 -0
- package/dist-lib/lib/api/chat-move.js +7 -0
- package/dist-lib/lib/api/chat.d.ts +13 -2
- package/dist-lib/lib/api/chat.js +114 -9
- package/dist-lib/lib/api/chunk-delta.d.ts +7 -0
- package/dist-lib/lib/api/chunk-delta.js +33 -0
- package/dist-lib/lib/api/chunks.d.ts +17 -2
- package/dist-lib/lib/api/chunks.js +64 -13
- package/dist-lib/lib/api/config.d.ts +2 -1
- package/dist-lib/lib/api/config.js +3 -2
- 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 +10 -8
- package/dist-lib/lib/api/device-routes.d.ts +9 -0
- package/dist-lib/lib/api/device-routes.js +123 -0
- package/dist-lib/lib/api/devices.d.ts +3 -2
- package/dist-lib/lib/api/devices.js +20 -10
- package/dist-lib/lib/api/diagnostics.d.ts +2 -1
- package/dist-lib/lib/api/diagnostics.js +2 -2
- package/dist-lib/lib/api/execution.d.ts +12 -1
- package/dist-lib/lib/api/execution.js +44 -14
- package/dist-lib/lib/api/host-run-log.d.ts +2 -41
- package/dist-lib/lib/api/host-run-log.js +35 -83
- package/dist-lib/lib/api/index.d.ts +28 -6
- package/dist-lib/lib/api/index.js +101 -33
- package/dist-lib/lib/api/instrument.d.ts +2 -2
- package/dist-lib/lib/api/instrument.js +12 -44
- 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 +64 -17
- package/dist-lib/lib/api/mesh.d.ts +12 -2
- package/dist-lib/lib/api/mesh.js +10 -6
- 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 +6 -5
- package/dist-lib/lib/api/projects.d.ts +20 -0
- package/dist-lib/lib/api/projects.js +165 -0
- package/dist-lib/lib/api/rag.d.ts +0 -1
- package/dist-lib/lib/api/rag.js +47 -23
- package/dist-lib/lib/api/served.d.ts +17 -0
- package/dist-lib/lib/api/served.js +47 -0
- package/dist-lib/lib/api/sync.d.ts +2 -1
- package/dist-lib/lib/api/sync.js +2 -2
- package/dist-lib/lib/api/tool-activity.d.ts +2 -1
- package/dist-lib/lib/api/tool-activity.js +4 -3
- package/dist-lib/lib/api/tool-configs.d.ts +2 -1
- package/dist-lib/lib/api/tool-configs.js +6 -9
- package/dist-lib/lib/api/upload-frames.d.ts +0 -1
- package/dist-lib/lib/api/upload-frames.js +0 -1
- package/dist-lib/lib/api/watchable.d.ts +3 -2
- package/dist-lib/lib/api/watchable.js +2 -3
- package/dist-lib/lib/api/workspace.d.ts +5 -0
- package/dist-lib/lib/api/workspace.js +48 -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 +29 -29
- package/dist-lib/lib/assistant/harness.js +34 -6
- package/dist-lib/lib/assistant/history.d.ts +30 -17
- package/dist-lib/lib/assistant/history.js +168 -82
- package/dist-lib/lib/assistant/host-run-log.d.ts +6 -1
- package/dist-lib/lib/assistant/host-run-log.js +24 -36
- package/dist-lib/lib/assistant/message.d.ts +21 -0
- package/dist-lib/lib/assistant/message.js +43 -0
- package/dist-lib/lib/assistant/model-round.d.ts +95 -0
- package/dist-lib/lib/assistant/model-round.js +591 -0
- package/dist-lib/lib/assistant/pdf-budget.d.ts +3 -0
- package/dist-lib/lib/assistant/pdf-budget.js +13 -0
- package/dist-lib/lib/assistant/round-host.d.ts +42 -0
- package/dist-lib/lib/assistant/round-host.js +239 -0
- package/dist-lib/lib/assistant/skill-encode.d.ts +2 -1
- package/dist-lib/lib/assistant/skill-encode.js +2 -1
- package/dist-lib/lib/assistant/video-budget.d.ts +13 -0
- package/dist-lib/lib/assistant/video-budget.js +29 -0
- package/dist-lib/lib/assistant-client.d.ts +2 -0
- package/dist-lib/lib/assistant-client.js +4 -3
- package/dist-lib/lib/assistant-tree.d.ts +8 -3
- package/dist-lib/lib/assistant-tree.js +58 -18
- package/dist-lib/lib/assistant.d.ts +76 -20
- package/dist-lib/lib/assistant.js +1659 -1070
- package/dist-lib/lib/audio-format.js +1 -1
- package/dist-lib/lib/chat-suggestion.d.ts +3 -0
- package/dist-lib/lib/chat-suggestion.js +47 -0
- package/dist-lib/lib/client.d.ts +2 -2
- package/dist-lib/lib/constants.d.ts +7 -0
- package/dist-lib/lib/constants.js +7 -0
- package/dist-lib/lib/core/agent-copies.d.ts +9 -0
- package/dist-lib/lib/core/agent-copies.js +40 -0
- package/dist-lib/lib/core/agent-hosting.d.ts +25 -0
- package/dist-lib/lib/core/agent-hosting.js +71 -0
- package/dist-lib/lib/core/agent.d.ts +9 -1
- package/dist-lib/lib/core/agent.js +45 -19
- package/dist-lib/lib/core/archived-mesh.d.ts +11 -6
- package/dist-lib/lib/core/archived-mesh.js +77 -58
- package/dist-lib/lib/core/async-iterable.js +1 -1
- package/dist-lib/lib/core/blind-peers.d.ts +1 -0
- package/dist-lib/lib/core/blind-peers.js +1 -0
- package/dist-lib/lib/core/chat-activity.d.ts +1 -1
- package/dist-lib/lib/core/chat-activity.js +36 -22
- package/dist-lib/lib/core/chat-copy.d.ts +42 -0
- package/dist-lib/lib/core/chat-copy.js +395 -0
- package/dist-lib/lib/core/chat-fork.d.ts +16 -0
- package/dist-lib/lib/core/chat-fork.js +245 -0
- package/dist-lib/lib/core/chat-group.js +8 -7
- package/dist-lib/lib/core/chat-move.d.ts +71 -0
- package/dist-lib/lib/core/chat-move.js +567 -0
- package/dist-lib/lib/core/chat-order.d.ts +2 -1
- package/dist-lib/lib/core/chat-order.js +19 -4
- package/dist-lib/lib/core/chat-project.d.ts +2 -0
- package/dist-lib/lib/core/chat-project.js +15 -0
- package/dist-lib/lib/core/chat-read.d.ts +4 -0
- package/dist-lib/lib/core/chat-read.js +49 -0
- package/dist-lib/lib/core/chat-search.js +14 -12
- package/dist-lib/lib/core/chat.d.ts +34 -4
- package/dist-lib/lib/core/chat.js +122 -39
- package/dist-lib/lib/core/chunk.d.ts +21 -4
- package/dist-lib/lib/core/chunk.js +138 -23
- package/dist-lib/lib/core/collections.d.ts +28 -0
- package/dist-lib/lib/core/collections.js +28 -0
- package/dist-lib/lib/core/contract/agent-join.d.ts +10 -0
- package/dist-lib/lib/core/contract/agent-join.js +108 -0
- package/dist-lib/lib/core/contract/agents.d.ts +5 -0
- package/dist-lib/lib/core/contract/agents.js +141 -3
- package/dist-lib/lib/core/contract/chat.d.ts +1 -0
- package/dist-lib/lib/core/contract/chat.js +42 -3
- package/dist-lib/lib/core/contract/chunks.d.ts +7 -0
- package/dist-lib/lib/core/contract/chunks.js +112 -35
- package/dist-lib/lib/core/contract/index.d.ts +2 -3
- package/dist-lib/lib/core/contract/index.js +35 -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 +18 -9
- package/dist-lib/lib/core/contract/joined-meshes.js +2 -1
- package/dist-lib/lib/core/contract/knowledge.d.ts +1 -0
- package/dist-lib/lib/core/contract/knowledge.js +57 -6
- package/dist-lib/lib/core/contract/members.d.ts +3 -1
- package/dist-lib/lib/core/contract/members.js +34 -4
- package/dist-lib/lib/core/contract/mesh-kind.d.ts +3 -3
- package/dist-lib/lib/core/contract/mesh-kind.js +20 -16
- package/dist-lib/lib/core/contract/mesh-name.d.ts +3 -0
- package/dist-lib/lib/core/contract/mesh-name.js +31 -0
- package/dist-lib/lib/core/contract/mesh-rules.d.ts +8 -0
- package/dist-lib/lib/core/contract/mesh-rules.js +31 -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 +279 -0
- package/dist-lib/lib/core/contract/oldest-version.d.ts +9 -0
- package/dist-lib/lib/core/contract/oldest-version.js +20 -0
- package/dist-lib/lib/core/contract/open-join.d.ts +2 -0
- package/dist-lib/lib/core/contract/open-join.js +77 -0
- package/dist-lib/lib/core/contract/project-device-keys.d.ts +7 -0
- package/dist-lib/lib/core/contract/project-device-keys.js +29 -0
- package/dist-lib/lib/core/contract/project-host-keys.d.ts +7 -0
- package/dist-lib/lib/core/contract/project-host-keys.js +40 -0
- package/dist-lib/lib/core/contract/project-order.d.ts +2 -0
- package/dist-lib/lib/core/contract/project-order.js +25 -0
- package/dist-lib/lib/core/contract/projects.d.ts +21 -0
- package/dist-lib/lib/core/contract/projects.js +328 -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 +120 -0
- package/dist-lib/lib/core/contract/run-requests.d.ts +10 -0
- package/dist-lib/lib/core/contract/run-requests.js +75 -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/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 +317 -0
- package/dist-lib/lib/core/contract/writers.js +82 -12
- package/dist-lib/lib/core/departures.d.ts +16 -5
- package/dist-lib/lib/core/departures.js +79 -6
- package/dist-lib/lib/core/device-control.d.ts +21 -0
- package/dist-lib/lib/core/device-control.js +91 -0
- package/dist-lib/lib/core/device-seal.d.ts +4 -0
- package/dist-lib/lib/core/device-seal.js +22 -0
- package/dist-lib/lib/core/devices.js +1 -1
- package/dist-lib/lib/core/document-attachment.d.ts +7 -0
- package/dist-lib/lib/core/document-attachment.js +9 -0
- package/dist-lib/lib/core/files/attachments.js +5 -4
- package/dist-lib/lib/core/files/index.d.ts +21 -11
- package/dist-lib/lib/core/files/index.js +114 -28
- 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 +7 -2
- package/dist-lib/lib/core/files/processing/index.js +91 -71
- package/dist-lib/lib/core/files/processing/protocol.d.ts +7 -1
- package/dist-lib/lib/core/files/processing/protocol.js +14 -3
- package/dist-lib/lib/core/files/processing/source.d.ts +3 -0
- package/dist-lib/lib/core/files/processing/source.js +9 -4
- package/dist-lib/lib/core/files/processing/state.d.ts +4 -1
- package/dist-lib/lib/core/files/processing/state.js +2 -1
- package/dist-lib/lib/core/files/rag/build.d.ts +4 -1
- package/dist-lib/lib/core/files/rag/build.js +18 -7
- package/dist-lib/lib/core/files/rag/failure.d.ts +20 -0
- package/dist-lib/lib/core/files/rag/failure.js +57 -0
- package/dist-lib/lib/core/files/rag/index.d.ts +12 -1
- package/dist-lib/lib/core/files/rag/index.js +29 -7
- package/dist-lib/lib/core/files/rag/joined-index.d.ts +6 -0
- package/dist-lib/lib/core/files/rag/joined-index.js +35 -0
- package/dist-lib/lib/core/files/rag/limits.d.ts +1 -0
- package/dist-lib/lib/core/files/rag/limits.js +1 -0
- package/dist-lib/lib/core/files/rag/load.js +6 -3
- package/dist-lib/lib/core/files/rag/policy.d.ts +10 -1
- package/dist-lib/lib/core/files/rag/policy.js +23 -2
- package/dist-lib/lib/core/files/rag/produce.d.ts +1 -1
- package/dist-lib/lib/core/files/rag/produce.js +30 -18
- package/dist-lib/lib/core/files/rag/retrieval/full-text.js +1 -1
- package/dist-lib/lib/core/files/rag/similarity.d.ts +2 -2
- package/dist-lib/lib/core/files/rag/similarity.js +2 -3
- package/dist-lib/lib/core/files/records/chunks.js +22 -1
- package/dist-lib/lib/core/files/records/index.d.ts +1 -1
- package/dist-lib/lib/core/files/records/index.js +1 -1
- package/dist-lib/lib/core/files/records/knowledge.d.ts +11 -1
- package/dist-lib/lib/core/files/records/knowledge.js +40 -3
- package/dist-lib/lib/core/files/records/purge.js +13 -8
- package/dist-lib/lib/core/files/records/reclaim.js +20 -48
- package/dist-lib/lib/core/files/records/routing.d.ts +1 -1
- package/dist-lib/lib/core/files/records/routing.js +6 -2
- package/dist-lib/lib/core/files/records/source.js +3 -5
- package/dist-lib/lib/core/files/records/sweep.d.ts +3 -0
- package/dist-lib/lib/core/files/records/sweep.js +9 -3
- package/dist-lib/lib/core/files/store/blob.d.ts +2 -0
- package/dist-lib/lib/core/files/store/blob.js +2 -2
- package/dist-lib/lib/core/files/store/index.d.ts +3 -1
- package/dist-lib/lib/core/files/store/index.js +4 -1
- package/dist-lib/lib/core/files/store/reference.d.ts +3 -0
- package/dist-lib/lib/core/files/store/reference.js +12 -2
- package/dist-lib/lib/core/files/store/sweep.js +3 -1
- package/dist-lib/lib/core/files/upload.d.ts +5 -1
- package/dist-lib/lib/core/files/upload.js +53 -14
- package/dist-lib/lib/core/fs-drives.d.ts +6 -3
- package/dist-lib/lib/core/fs-drives.js +30 -18
- package/dist-lib/lib/core/id.d.ts +1 -0
- package/dist-lib/lib/core/id.js +3 -0
- package/dist-lib/lib/core/identity.d.ts +3 -1
- package/dist-lib/lib/core/identity.js +25 -4
- package/dist-lib/lib/core/invite.d.ts +4 -0
- package/dist-lib/lib/core/invite.js +19 -6
- 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 +76 -6
- package/dist-lib/lib/core/local/index.js +209 -19
- 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 +94 -28
- package/dist-lib/lib/core/mesh.js +527 -144
- package/dist-lib/lib/core/migrations/agent-tools-scope.d.ts +2 -0
- package/dist-lib/lib/core/migrations/agent-tools-scope.js +24 -0
- package/dist-lib/lib/core/migrations/file-index.js +2 -4
- package/dist-lib/lib/core/migrations/index.js +6 -2
- 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 +4 -2
- package/dist-lib/lib/core/pdf/rasterize.d.ts +2 -2
- package/dist-lib/lib/core/pdf/rasterize.js +5 -6
- package/dist-lib/lib/core/peer-duplex.d.ts +34 -0
- package/dist-lib/lib/core/{harness-loan.js → peer-duplex.js} +47 -40
- package/dist-lib/lib/core/project-keys.d.ts +13 -0
- package/dist-lib/lib/core/project-keys.js +56 -0
- package/dist-lib/lib/core/prompt-history.js +4 -4
- package/dist-lib/lib/core/protocol-pairing.d.ts +11 -0
- package/dist-lib/lib/core/protocol-pairing.js +22 -0
- package/dist-lib/lib/core/public-mesh.d.ts +26 -0
- package/dist-lib/lib/core/public-mesh.js +88 -0
- package/dist-lib/lib/core/purge.d.ts +3 -0
- package/dist-lib/lib/core/purge.js +7 -0
- package/dist-lib/lib/core/run-driver.d.ts +17 -0
- package/dist-lib/lib/core/run-driver.js +20 -0
- package/dist-lib/lib/core/run-requests.d.ts +11 -0
- package/dist-lib/lib/core/run-requests.js +59 -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 +18 -0
- package/dist-lib/lib/core/senders.js +52 -0
- package/dist-lib/lib/core/shared-agents.d.ts +39 -0
- package/dist-lib/lib/core/shared-agents.js +255 -0
- package/dist-lib/lib/core/skill-secrets.d.ts +10 -16
- package/dist-lib/lib/core/skill-secrets.js +90 -72
- package/dist-lib/lib/core/sync/background.d.ts +47 -0
- package/dist-lib/lib/core/sync/background.js +162 -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 +1 -1
- 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 +154 -81
- package/dist-lib/lib/core/sync/view-updates.d.ts +33 -0
- package/dist-lib/lib/core/sync/view-updates.js +133 -0
- package/dist-lib/lib/core/system-info.d.ts +2 -2
- package/dist-lib/lib/core/system-info.js +10 -11
- package/dist-lib/lib/core/tool-configs.d.ts +5 -3
- package/dist-lib/lib/core/tool-configs.js +11 -11
- package/dist-lib/lib/core/transcript-visibility.d.ts +5 -5
- package/dist-lib/lib/core/transcript-visibility.js +27 -31
- package/dist-lib/lib/core/upgrade-agents.d.ts +11 -0
- package/dist-lib/lib/core/upgrade-agents.js +78 -0
- package/dist-lib/lib/core/video/attachment.d.ts +1 -0
- package/dist-lib/lib/core/video/attachment.js +7 -0
- package/dist-lib/lib/core/video/digest.d.ts +16 -0
- package/dist-lib/lib/core/video/digest.js +57 -0
- package/dist-lib/lib/core/video/frames.d.ts +32 -0
- package/dist-lib/lib/core/video/frames.js +224 -0
- package/dist-lib/lib/core/workspace-upgrade.d.ts +22 -0
- package/dist-lib/lib/core/workspace-upgrade.js +50 -0
- package/dist-lib/lib/core.d.ts +249 -79
- package/dist-lib/lib/core.js +3369 -1460
- package/dist-lib/lib/credential-pusher.d.ts +6 -0
- package/dist-lib/lib/credential-pusher.js +77 -60
- 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/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 +790 -0
- package/dist-lib/lib/errors.js +724 -0
- package/dist-lib/lib/fs-drive-bridge.d.ts +1 -1
- package/dist-lib/lib/fs-drive-bridge.js +4 -1
- 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/knowledge-search.js +13 -18
- 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/log.d.ts +7 -6
- package/dist-lib/lib/log.js +14 -7
- package/dist-lib/lib/logger-type.d.ts +2 -5
- package/dist-lib/lib/mesh-scoped-engine.js +42 -2
- package/dist-lib/lib/model-download-status.d.ts +3 -3
- package/dist-lib/lib/model-download.d.ts +11 -12
- package/dist-lib/lib/model-download.js +63 -22
- package/dist-lib/lib/model-idle-pusher.d.ts +2 -4
- package/dist-lib/lib/model-memory-cap.d.ts +27 -0
- package/dist-lib/lib/model-memory-cap.js +69 -0
- package/dist-lib/lib/models-watch.d.ts +1 -1
- package/dist-lib/lib/models-watch.js +4 -4
- package/dist-lib/lib/oauth/browser-connect.js +3 -2
- package/dist-lib/lib/oauth/flow-core.js +5 -3
- package/dist-lib/lib/oauth/flow.js +1 -1
- package/dist-lib/lib/oauth/loopback.d.ts +1 -0
- package/dist-lib/lib/oauth/loopback.js +57 -12
- package/dist-lib/lib/oauth/providers.js +4 -2
- package/dist-lib/lib/oauth/redirect-types.d.ts +1 -0
- package/dist-lib/lib/oauth/register.js +35 -19
- package/dist-lib/lib/oauth/request.d.ts +10 -0
- package/dist-lib/lib/oauth/request.js +22 -0
- package/dist-lib/lib/oauth/token-exchange-core.js +31 -33
- package/dist-lib/lib/oauth/types.d.ts +3 -0
- package/dist-lib/lib/oauth.d.ts +2 -1
- package/dist-lib/lib/oauth.js +1 -0
- package/dist-lib/lib/persistent-dir.d.ts +1 -0
- package/dist-lib/lib/persistent-dir.js +9 -0
- package/dist-lib/lib/probe-rounds.d.ts +3 -0
- package/dist-lib/lib/probe-rounds.js +5 -0
- package/dist-lib/lib/run-input.d.ts +14 -0
- package/dist-lib/lib/run-input.js +33 -0
- package/dist-lib/lib/run-notices.d.ts +3 -0
- package/dist-lib/lib/run-notices.js +8 -2
- package/dist-lib/lib/run-replay.d.ts +32 -0
- package/dist-lib/lib/run-replay.js +121 -0
- package/dist-lib/lib/run-transcript.d.ts +11 -12
- package/dist-lib/lib/run-transcript.js +16 -18
- package/dist-lib/lib/suspend-lifecycle.js +15 -5
- package/dist-lib/lib/task.js +6 -4
- package/dist-lib/lib/test-env.d.ts +1 -0
- package/dist-lib/lib/test-env.js +4 -0
- package/dist-lib/schema/build.js +3 -1
- 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 +58 -11
- package/dist-lib/schema/engine.d.ts +1 -0
- package/dist-lib/schema/engine.js +709 -116
- package/dist-lib/schema/field-order.js +2 -1
- package/dist-lib/schema/indexes.d.ts +3 -0
- package/dist-lib/schema/indexes.js +30 -3
- package/dist-lib/schema/local.js +72 -4
- package/dist-lib/schema/qvac.d.ts +4 -1
- package/dist-lib/schema/qvac.js +364 -12
- package/dist-lib/spec/bind.js +209 -48
- package/dist-lib/spec/calls.js +45 -5
- package/dist-lib/spec/capabilities.d.ts +98 -18
- package/dist-lib/spec/config/hyperconf/index.js +1 -1
- package/dist-lib/spec/hrpc/hrpc.json +726 -206
- package/dist-lib/spec/hrpc/index.js +832 -345
- package/dist-lib/spec/hrpc/messages.js +6906 -4832
- package/dist-lib/spec/hyperschema/index.js +6906 -4832
- package/dist-lib/spec/hyperschema/schema.json +4744 -3139
- package/dist-lib/spec/hyperschema/types.d.ts +461 -61
- 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 +1506 -484
- package/dist-lib/spec/local/hyperschema/index.js +542 -13
- package/dist-lib/spec/local/hyperschema/schema.json +319 -1
- package/dist-lib/spec/local/hyperschema/types.d.ts +78 -2
- package/dist-lib/spec/mesh/hyperdb/db.json +371 -5
- package/dist-lib/spec/mesh/hyperdb/index.js +1564 -5
- package/dist-lib/spec/mesh/hyperdb/messages.js +6023 -1246
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +187 -1
- package/dist-lib/spec/mesh/hyperdispatch/index.js +528 -1
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +3449 -217
- package/dist-lib/spec/mesh/hyperschema/index.js +3449 -217
- package/dist-lib/spec/mesh/hyperschema/schema.json +1865 -19
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +470 -6
- package/package.json +50 -35
- package/worker/assistant-sidecar.mjs +15 -2
- package/worker/stow-entry.mjs +2 -0
- package/dist-lib/lib/core/contract/compute.d.ts +0 -11
- package/dist-lib/lib/core/contract/compute.js +0 -48
- package/dist-lib/lib/core/device-invites.d.ts +0 -11
- package/dist-lib/lib/core/device-invites.js +0 -63
- package/dist-lib/lib/core/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/secret-handoff.d.ts +0 -17
- package/dist-lib/lib/core/secret-handoff.js +0 -29
- package/dist-lib/lib/core/skill-overlay-handoff.d.ts +0 -25
- package/dist-lib/lib/core/skill-overlay-handoff.js +0 -50
- package/dist-lib/lib/core/skill-overlay-receiver.d.ts +0 -8
- package/dist-lib/lib/core/skill-overlay-receiver.js +0 -23
- package/dist-lib/lib/image-cache-dir.d.ts +0 -1
- package/dist-lib/lib/image-cache-dir.js +0 -5
- package/dist-lib/lib/log-levels.d.ts +0 -7
- package/dist-lib/lib/log-levels.js +0 -1
- package/dist-lib/lib/logger.d.ts +0 -5
- package/dist-lib/lib/logger.js +0 -18
- package/dist-lib/lib/oauth/loopback.stub.d.ts +0 -3
- package/dist-lib/lib/oauth/loopback.stub.js +0 -6
- package/tui/README.md +0 -142
- package/tui/app.mjs +0 -6939
- package/tui/boot.mjs +0 -111
- package/tui/index.mjs +0 -53
- package/tui/lib/boot-timing.mjs +0 -41
- package/tui/lib/busy-words.mjs +0 -116
- package/tui/lib/export.mjs +0 -194
- package/tui/lib/knowledge-command.mjs +0 -190
- package/tui/lib/knowledge-import.mjs +0 -171
- package/tui/lib/render.mjs +0 -196
- package/tui/lib/save-file.mjs +0 -88
- package/tui/lib/select.mjs +0 -81
- package/tui/lib/selection.mjs +0 -18
- package/tui/lib/setup.mjs +0 -101
- package/tui/lib/sidebar.mjs +0 -63
- package/tui/lib/splash-art.mjs +0 -107
- package/tui/lib/splash.mjs +0 -18
- package/tui/lib/upload-frames.mjs +0 -9
- package/tui/lib/usage.mjs +0 -59
- package/tui/lib/wrap.mjs +0 -143
- package/tui/main.mjs +0 -264
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
import { QvacErrorBase, addCodes } from '@qvac/error';
|
|
2
|
+
import { isRecord } from './guards.js';
|
|
3
|
+
export const NO_ARCHIVE_HELD = 'No archive is held for this mesh';
|
|
4
|
+
export const MESH_JOINING = 'This mesh is still joining: it accepts writes once it is joined';
|
|
5
|
+
export const DEVICE_INVITE_CHAIN_TOO_LONG = 'This device cannot invite another one: invite from another of your devices, or recover from your phrase';
|
|
6
|
+
export const DEVICE_UNREACHABLE = 'the device is not reachable';
|
|
7
|
+
export const LINK_SOURCES_ONLY = 'A model added from another device must come from a link: a path would name a file on this device.';
|
|
8
|
+
export const MODEL_SETTINGS_ONLY = 'Another device may read and change only the model settings of this one.';
|
|
9
|
+
export const NO_SUCH_AGENT = 'no agent with that id';
|
|
10
|
+
export const NOT_THE_HOST = 'this device does not host that agent';
|
|
11
|
+
export const HOST_REVOKED = 'the device hosting this agent is no longer in the mesh';
|
|
12
|
+
export const HOST_UNREACHABLE = 'the device hosting this agent is not connected';
|
|
13
|
+
export const HOST_SILENT = 'the device hosting this agent did not answer';
|
|
14
|
+
export const SENDER_REVOKED = 'the sending device is no longer in the mesh';
|
|
15
|
+
export const NOT_A_SETUP_FIELD = 'that skill declares no such setup field';
|
|
16
|
+
export const LOAN_UNREACHABLE = 'the device lending its model is not connected';
|
|
17
|
+
export const TURN_RUNNING = 'a turn up to the fork point is still running; fork once it has finished';
|
|
18
|
+
export const NO_SUCH_TURN = 'no turn of this chat has that run id';
|
|
19
|
+
export const NOTHING_BEFORE = 'nothing comes before the first turn, so there is nothing to fork';
|
|
20
|
+
export const FILE_NOT_HERE = 'a file in this chat is not on this device yet; open it here first';
|
|
21
|
+
export const UPLOAD_NAMES_NO_MESH = 'an upload must name its mesh on its first frame';
|
|
22
|
+
const DEFINITIONS = {
|
|
23
|
+
CORE_CLOSING: {
|
|
24
|
+
code: 100001,
|
|
25
|
+
message: (subject = 'core') => `${subject} is closing`
|
|
26
|
+
},
|
|
27
|
+
COMPUTE_ROUTE_DROPPED: {
|
|
28
|
+
code: 100101,
|
|
29
|
+
message: (route) => `${route} is dropped on a compute mesh: it carries only delegated work`
|
|
30
|
+
},
|
|
31
|
+
MESH_NOT_FOUND: { code: 100102, message: (meshId) => `no such mesh: ${meshId}` },
|
|
32
|
+
MESH_TRANSITION_IN_PROGRESS: {
|
|
33
|
+
code: 100103,
|
|
34
|
+
message: () => 'Mesh transition already in progress'
|
|
35
|
+
},
|
|
36
|
+
MESH_BELOW_FLOOR: { code: 100104, message: () => 'Build is below the mesh floor' },
|
|
37
|
+
ACCOUNT_MESH_MISSING: {
|
|
38
|
+
code: 100105,
|
|
39
|
+
message: () => 'Recording a mesh needs the account mesh'
|
|
40
|
+
},
|
|
41
|
+
ACCOUNT_MEMBER_UNKNOWN: {
|
|
42
|
+
code: 100106,
|
|
43
|
+
message: () => 'This device is not part of its account yet'
|
|
44
|
+
},
|
|
45
|
+
MESH_WITHOUT_MEMBER: {
|
|
46
|
+
code: 100107,
|
|
47
|
+
message: () => 'A mesh needs this device to belong to its account member'
|
|
48
|
+
},
|
|
49
|
+
ACCOUNT_NOT_WRITABLE: { code: 100108, message: () => 'The account mesh is not writable' },
|
|
50
|
+
ARCHIVE_NOT_ACCOUNT: {
|
|
51
|
+
code: 100109,
|
|
52
|
+
message: (meshId) => `Not an account this device left: ${meshId}`
|
|
53
|
+
},
|
|
54
|
+
ARCHIVE_NOT_FOUND: { code: 100110, message: () => NO_ARCHIVE_HELD },
|
|
55
|
+
MESH_NAME_TOO_LONG: {
|
|
56
|
+
code: 100111,
|
|
57
|
+
message: (max) => `mesh name must be at most ${max} characters`
|
|
58
|
+
},
|
|
59
|
+
MESH_NAME_ACCOUNT_REFUSED: { code: 100112, message: () => 'An account mesh has no shared name' },
|
|
60
|
+
ACCOUNT_MESH_CLOSE_REFUSED: {
|
|
61
|
+
code: 100113,
|
|
62
|
+
message: () => 'The account mesh cannot be closed'
|
|
63
|
+
},
|
|
64
|
+
ROUTE_RETIRED: {
|
|
65
|
+
code: 100114,
|
|
66
|
+
message: (route, replacement) => `${route} is retired: call ${replacement} with the same input`
|
|
67
|
+
},
|
|
68
|
+
MESH_STILL_JOINING: { code: 100115, message: () => MESH_JOINING },
|
|
69
|
+
ROUTE_NOT_IN_ROLE: {
|
|
70
|
+
code: 100116,
|
|
71
|
+
message: (route, role) => `${route} is not a route of a ${role} mesh`
|
|
72
|
+
},
|
|
73
|
+
MESH_RULES_FROM_A_NEWER_BUILD: {
|
|
74
|
+
code: 100117,
|
|
75
|
+
message: (rules, known) => `mesh rules ${rules} are newer than this build's ${known}`
|
|
76
|
+
},
|
|
77
|
+
NOT_A_WORKSPACE: { code: 100118, message: (meshId) => `not a workspace: ${meshId}` },
|
|
78
|
+
WORKSPACE_ADMIN_ONLY: {
|
|
79
|
+
code: 100119,
|
|
80
|
+
message: (action) => `Only an admin can ${action}`
|
|
81
|
+
},
|
|
82
|
+
WORKSPACE_NAME_EMPTY: { code: 100120, message: () => 'workspace name must not be empty' },
|
|
83
|
+
PUBLIC_MESH_UNKNOWN: {
|
|
84
|
+
code: 100121,
|
|
85
|
+
message: () => "This device does not know its account's public mesh yet"
|
|
86
|
+
},
|
|
87
|
+
PROJECT_NOT_FOUND: {
|
|
88
|
+
code: 100122,
|
|
89
|
+
message: (projectId) => `project not found: ${projectId}`
|
|
90
|
+
},
|
|
91
|
+
PROJECT_NAME_EMPTY: { code: 100123, message: () => 'project name must not be empty' },
|
|
92
|
+
PROJECT_MEMBER_NOT_IN_WORKSPACE: {
|
|
93
|
+
code: 100124,
|
|
94
|
+
message: () => 'Only a member of the workspace can be added to its project'
|
|
95
|
+
},
|
|
96
|
+
PROJECT_MEMBER_INVITE_REFUSED: {
|
|
97
|
+
code: 100125,
|
|
98
|
+
message: () => 'A project takes no invite: add people to it from its workspace'
|
|
99
|
+
},
|
|
100
|
+
WORKSPACE_LAST_ADMIN: {
|
|
101
|
+
code: 100126,
|
|
102
|
+
message: () => 'The last admin cannot leave while others remain: make someone else an admin first'
|
|
103
|
+
},
|
|
104
|
+
PROJECT_ORDER_TOO_LONG: {
|
|
105
|
+
code: 100127,
|
|
106
|
+
message: (max) => `A project order holds at most ${max} projects`
|
|
107
|
+
},
|
|
108
|
+
OWN_WORKSPACE_INVITE_REFUSED: {
|
|
109
|
+
code: 100128,
|
|
110
|
+
message: () => 'Your own workspace is yours alone: invite people into another workspace'
|
|
111
|
+
},
|
|
112
|
+
OWN_WORKSPACE_LEAVE_REFUSED: {
|
|
113
|
+
code: 100129,
|
|
114
|
+
message: () => 'Your own workspace cannot be left'
|
|
115
|
+
},
|
|
116
|
+
COMPUTE_MESH_RETIRED: {
|
|
117
|
+
code: 100130,
|
|
118
|
+
message: () => 'Compute meshes are retired: a model runs on the device that asks'
|
|
119
|
+
},
|
|
120
|
+
INVITE_INVALID: { code: 100201, message: () => 'Invalid mesh invite' },
|
|
121
|
+
MESH_JOIN_CANCELED: { code: 100202, message: () => 'Mesh join canceled' },
|
|
122
|
+
JOIN_NOT_PERMITTED: {
|
|
123
|
+
code: 100203,
|
|
124
|
+
message: () => 'Device is not permitted to join the invited mesh'
|
|
125
|
+
},
|
|
126
|
+
INVITE_ACCOUNT_UNREADABLE: {
|
|
127
|
+
code: 100204,
|
|
128
|
+
message: () => 'This device cannot reach its account to check'
|
|
129
|
+
},
|
|
130
|
+
MEMBER_INVITE_ACCOUNT_REFUSED: {
|
|
131
|
+
code: 100205,
|
|
132
|
+
message: () => 'An account mesh cannot be invited into'
|
|
133
|
+
},
|
|
134
|
+
DEVICE_INVITE_MESH_REFUSED: {
|
|
135
|
+
code: 100206,
|
|
136
|
+
message: () => 'Only an account mesh can take a device invite'
|
|
137
|
+
},
|
|
138
|
+
DEVICE_INVITE_CHAIN_TOO_LONG: { code: 100207, message: () => DEVICE_INVITE_CHAIN_TOO_LONG },
|
|
139
|
+
MESH_HELD_BY_SIBLING: {
|
|
140
|
+
code: 100208,
|
|
141
|
+
message: () => 'Another of your devices holds this mesh: bring that device online, or invite from it instead'
|
|
142
|
+
},
|
|
143
|
+
DEVICE_INVITE_UNLINKED: {
|
|
144
|
+
code: 100209,
|
|
145
|
+
message: () => 'This device is not linked into your account, so it cannot invite another one: invite from another of your devices, or recover from your phrase'
|
|
146
|
+
},
|
|
147
|
+
DEVICE_INVITE_UNDELEGATED: {
|
|
148
|
+
code: 100210,
|
|
149
|
+
message: () => 'This device invite cannot pair a device into an account: mint a new one from a linked device'
|
|
150
|
+
},
|
|
151
|
+
DEVICE_ADMIN_LAST: {
|
|
152
|
+
code: 100211,
|
|
153
|
+
message: () => "An admin's last device cannot be unpaired: remove them as a member instead"
|
|
154
|
+
},
|
|
155
|
+
RECOVERY_NO_ACCOUNT: {
|
|
156
|
+
code: 100301,
|
|
157
|
+
message: () => 'This device has no account to make recoverable'
|
|
158
|
+
},
|
|
159
|
+
RECOVERY_PHRASE_NOT_OURS: {
|
|
160
|
+
code: 100302,
|
|
161
|
+
message: () => 'The phrase does not derive the identity this device holds'
|
|
162
|
+
},
|
|
163
|
+
RECOVERY_PHRASE_NOT_A_MEMBER: {
|
|
164
|
+
code: 100303,
|
|
165
|
+
message: () => "The phrase names no member of this account, so it could not recover it: publish from a device holding the account's phrase"
|
|
166
|
+
},
|
|
167
|
+
RECOVERY_NOT_ADOPTED: { code: 100304, message: () => 'the recovered account did not adopt' },
|
|
168
|
+
RECOVERY_RECORD_NOT_FOUND: {
|
|
169
|
+
code: 100305,
|
|
170
|
+
message: () => 'No recovery record was found for this phrase'
|
|
171
|
+
},
|
|
172
|
+
MEMBER_RESOLVE_TIMEOUT: {
|
|
173
|
+
code: 100401,
|
|
174
|
+
message: () => 'resolving our member in this mesh timed out'
|
|
175
|
+
},
|
|
176
|
+
MEMBER_NOT_FOUND: {
|
|
177
|
+
code: 100402,
|
|
178
|
+
message: (id) => `member not found: ${id}`
|
|
179
|
+
},
|
|
180
|
+
MEMBER_NAME_EMPTY: {
|
|
181
|
+
code: 100403,
|
|
182
|
+
message: () => 'member name must not be empty'
|
|
183
|
+
},
|
|
184
|
+
MEMBER_RENAME_NO_ACCOUNT: {
|
|
185
|
+
code: 100404,
|
|
186
|
+
message: () => 'no account to rename the member in'
|
|
187
|
+
},
|
|
188
|
+
OWN_MEMBER_UNKNOWN: {
|
|
189
|
+
code: 100405,
|
|
190
|
+
message: (scope) => `this device is in no member of ${scope}`
|
|
191
|
+
},
|
|
192
|
+
MEMBER_REMOVE_SELF: {
|
|
193
|
+
code: 100406,
|
|
194
|
+
message: () => 'cannot remove own member, use leaveMesh'
|
|
195
|
+
},
|
|
196
|
+
MEMBER_ROLE_UNKNOWN: { code: 100407, message: (role) => `unknown role: ${role}` },
|
|
197
|
+
MEMBER_ROLE_SELF: { code: 100408, message: () => 'an admin cannot change their own role' },
|
|
198
|
+
DEVICE_NOT_FOUND: {
|
|
199
|
+
code: 100501,
|
|
200
|
+
message: (id) => `device not found: ${id}`
|
|
201
|
+
},
|
|
202
|
+
DEVICE_REMOVE_SELF: {
|
|
203
|
+
code: 100502,
|
|
204
|
+
message: () => 'cannot remove own device, use leaveMesh'
|
|
205
|
+
},
|
|
206
|
+
DEVICE_NO_WRITER_KEY: {
|
|
207
|
+
code: 100503,
|
|
208
|
+
message: () => 'device has no writer key, cannot remove'
|
|
209
|
+
},
|
|
210
|
+
DEVICE_NAME_EMPTY: {
|
|
211
|
+
code: 100504,
|
|
212
|
+
message: () => 'device name must not be empty'
|
|
213
|
+
},
|
|
214
|
+
DEVICE_NAME_TOO_LONG: {
|
|
215
|
+
code: 100505,
|
|
216
|
+
message: (max) => `device name must be at most ${max} characters`
|
|
217
|
+
},
|
|
218
|
+
DEVICE_ID_UNAVAILABLE: {
|
|
219
|
+
code: 100506,
|
|
220
|
+
message: () => 'cannot record tool activity without a device id'
|
|
221
|
+
},
|
|
222
|
+
DEVICE_ROUTE_NOT_SERVED: {
|
|
223
|
+
code: 100507,
|
|
224
|
+
message: (route) => `${route} is not served on this device`
|
|
225
|
+
},
|
|
226
|
+
DEVICE_UNREACHABLE: { code: 100508, message: () => DEVICE_UNREACHABLE },
|
|
227
|
+
DEVICE_REVOKED: {
|
|
228
|
+
code: 100509,
|
|
229
|
+
message: () => 'the device no longer takes requests from this one'
|
|
230
|
+
},
|
|
231
|
+
LINK_SOURCES_ONLY: { code: 100510, message: () => LINK_SOURCES_ONLY },
|
|
232
|
+
MODEL_SETTINGS_ONLY: { code: 100511, message: () => MODEL_SETTINGS_ONLY },
|
|
233
|
+
AGENT_NOT_FOUND: {
|
|
234
|
+
code: 100601,
|
|
235
|
+
message: (agentId) => `agent not found: ${agentId}`
|
|
236
|
+
},
|
|
237
|
+
AGENT_HOST_AGENT_UNKNOWN: { code: 100602, message: () => NO_SUCH_AGENT },
|
|
238
|
+
AGENT_LAST_DEFAULT: {
|
|
239
|
+
code: 100603,
|
|
240
|
+
message: () => 'cannot clear the last default agent of this member'
|
|
241
|
+
},
|
|
242
|
+
AGENT_DEFAULT_UNDELETABLE: { code: 100604, message: () => 'cannot delete the default agent' },
|
|
243
|
+
AGENT_DELETED: { code: 100605, message: (agentId) => `agent is deleted: ${agentId}` },
|
|
244
|
+
AGENT_NOT_HOSTED_HERE: { code: 100606, message: () => NOT_THE_HOST },
|
|
245
|
+
AGENT_HOST_REVOKED: { code: 100607, message: () => HOST_REVOKED },
|
|
246
|
+
AGENT_HOST_UNREACHABLE: { code: 100608, message: () => HOST_UNREACHABLE },
|
|
247
|
+
AGENT_HOST_SILENT: { code: 100609, message: () => HOST_SILENT },
|
|
248
|
+
PEER_SENDER_REVOKED: { code: 100610, message: () => SENDER_REVOKED },
|
|
249
|
+
SKILL_SETUP_FIELD_UNKNOWN: { code: 100611, message: () => NOT_A_SETUP_FIELD },
|
|
250
|
+
SKILL_OVERLAY_OP_UNKNOWN: {
|
|
251
|
+
code: 100612,
|
|
252
|
+
message: (op) => `unknown skill overlay op: ${op}`
|
|
253
|
+
},
|
|
254
|
+
INFERENCE_RECORDING_OFF: {
|
|
255
|
+
code: 100613,
|
|
256
|
+
message: () => 'this device is not recording prompts right now'
|
|
257
|
+
},
|
|
258
|
+
INFERENCE_CHAT_NOT_FOUND: {
|
|
259
|
+
code: 100614,
|
|
260
|
+
message: () => 'no such chat on the device hosting this agent'
|
|
261
|
+
},
|
|
262
|
+
LOAN_UNREACHABLE: { code: 100615, message: () => LOAN_UNREACHABLE },
|
|
263
|
+
LOAN_REVOKED: { code: 100616, message: () => 'the device stopped lending its model' },
|
|
264
|
+
AGENT_FOLDER_NOT_ABSOLUTE: {
|
|
265
|
+
code: 100617,
|
|
266
|
+
message: (path) => `a shared folder is an absolute path, not ${path}`
|
|
267
|
+
},
|
|
268
|
+
AGENT_FOLDER_MISSING: {
|
|
269
|
+
code: 100618,
|
|
270
|
+
message: (path) => `there is no folder at ${path}`
|
|
271
|
+
},
|
|
272
|
+
AGENT_FOLDER_IS_FILE: {
|
|
273
|
+
code: 100619,
|
|
274
|
+
message: (path) => `${path} is a file, not a folder`
|
|
275
|
+
},
|
|
276
|
+
AGENT_FOLDER_IN_STORAGE: {
|
|
277
|
+
code: 100620,
|
|
278
|
+
message: (path) => `${path} is inside the app's own storage, which no agent may reach`
|
|
279
|
+
},
|
|
280
|
+
AGENT_FOLDER_NOT_SHARED: {
|
|
281
|
+
code: 100621,
|
|
282
|
+
message: (path) => `${path} is not shared with this agent`
|
|
283
|
+
},
|
|
284
|
+
AGENT_NOT_OURS: {
|
|
285
|
+
code: 100622,
|
|
286
|
+
message: () => 'Only the person whose device runs an agent shares it'
|
|
287
|
+
},
|
|
288
|
+
AGENT_HOST_NOT_IN_WORKSPACE: {
|
|
289
|
+
code: 100623,
|
|
290
|
+
message: () => 'The device that runs this agent has not joined the workspace'
|
|
291
|
+
},
|
|
292
|
+
AGENT_NOT_SHARED: {
|
|
293
|
+
code: 100624,
|
|
294
|
+
message: (agentId) => `agent is not shared in this workspace: ${agentId}`
|
|
295
|
+
},
|
|
296
|
+
CHAT_AGENT_UNAVAILABLE: {
|
|
297
|
+
code: 100625,
|
|
298
|
+
message: () => "This chat's agent is no longer shared with you: pick another agent"
|
|
299
|
+
},
|
|
300
|
+
CHAT_NOT_FOUND: {
|
|
301
|
+
code: 100701,
|
|
302
|
+
message: (chatId) => `chat not found: ${chatId}`
|
|
303
|
+
},
|
|
304
|
+
CHAT_ANCHOR_SELF: {
|
|
305
|
+
code: 100702,
|
|
306
|
+
message: (chatId) => `a chat cannot be placed after itself: ${chatId}`
|
|
307
|
+
},
|
|
308
|
+
CHAT_ANCHOR_MISPLACED: {
|
|
309
|
+
code: 100703,
|
|
310
|
+
message: (anchor, groupId) => `chat ${anchor} is not in the ${groupId ? `group ${groupId}` : 'ungrouped list'}`
|
|
311
|
+
},
|
|
312
|
+
CHAT_GROUP_NOT_FOUND: {
|
|
313
|
+
code: 100704,
|
|
314
|
+
message: (groupId) => `chat group not found: ${groupId}`
|
|
315
|
+
},
|
|
316
|
+
CHAT_GROUP_NAME_EMPTY: {
|
|
317
|
+
code: 100705,
|
|
318
|
+
message: () => 'chat group name is required'
|
|
319
|
+
},
|
|
320
|
+
CHAT_GROUP_NAME_TOO_LONG: {
|
|
321
|
+
code: 100706,
|
|
322
|
+
message: (max) => `chat group name exceeds ${max} characters`
|
|
323
|
+
},
|
|
324
|
+
CHAT_GROUP_ANCHOR_SELF: {
|
|
325
|
+
code: 100707,
|
|
326
|
+
message: (groupId) => `a chat group cannot be placed after itself: ${groupId}`
|
|
327
|
+
},
|
|
328
|
+
CHUNK_NOT_FOUND: {
|
|
329
|
+
code: 100708,
|
|
330
|
+
message: (chunkId) => `chunk not found: ${chunkId}`
|
|
331
|
+
},
|
|
332
|
+
CHUNK_PAYLOAD_INVALID: {
|
|
333
|
+
code: 100709,
|
|
334
|
+
message: (detail) => `chunk payload invalid: ${detail}`
|
|
335
|
+
},
|
|
336
|
+
CHUNK_TYPES_UNMAPPED: {
|
|
337
|
+
code: 100710,
|
|
338
|
+
message: () => 'multiple chunk types require a mapped index'
|
|
339
|
+
},
|
|
340
|
+
SEND_AGENT_REQUIRED: {
|
|
341
|
+
code: 100711,
|
|
342
|
+
message: () => 'send-message: agentId is required to mint a chat'
|
|
343
|
+
},
|
|
344
|
+
RUN_NOT_FOUND: {
|
|
345
|
+
code: 100712,
|
|
346
|
+
message: (runId) => `run not found: ${runId}`
|
|
347
|
+
},
|
|
348
|
+
NOTIFICATION_ACK_AMBIGUOUS: {
|
|
349
|
+
code: 100713,
|
|
350
|
+
message: () => 'notification acknowledgement must select one source'
|
|
351
|
+
},
|
|
352
|
+
NOTIFICATION_CHAT_ACK_INCOMPLETE: {
|
|
353
|
+
code: 100714,
|
|
354
|
+
message: () => 'chat acknowledgement requires chatId and seq'
|
|
355
|
+
},
|
|
356
|
+
CHAT_FORK_NO_DEVICE: {
|
|
357
|
+
code: 100715,
|
|
358
|
+
message: () => 'this device has no identity yet, so it cannot write a fork'
|
|
359
|
+
},
|
|
360
|
+
CHAT_FORK_TURN_RUNNING: {
|
|
361
|
+
code: 100716,
|
|
362
|
+
message: () => TURN_RUNNING
|
|
363
|
+
},
|
|
364
|
+
CHAT_FORK_NO_SUCH_TURN: {
|
|
365
|
+
code: 100717,
|
|
366
|
+
message: () => NO_SUCH_TURN
|
|
367
|
+
},
|
|
368
|
+
CHAT_FORK_NOTHING_BEFORE: {
|
|
369
|
+
code: 100718,
|
|
370
|
+
message: () => NOTHING_BEFORE
|
|
371
|
+
},
|
|
372
|
+
CHAT_FORK_FILE_ARRIVING: {
|
|
373
|
+
code: 100720,
|
|
374
|
+
message: () => 'a file in this chat is still arriving; fork once it has landed'
|
|
375
|
+
},
|
|
376
|
+
CHAT_FORK_FILE_NOT_HERE: {
|
|
377
|
+
code: 100721,
|
|
378
|
+
message: () => FILE_NOT_HERE
|
|
379
|
+
},
|
|
380
|
+
CHAT_PROJECT_LINK_NOT_PRIVATE: {
|
|
381
|
+
code: 100722,
|
|
382
|
+
message: () => "only a chat in your account links to a project; a project's own chats are in it"
|
|
383
|
+
},
|
|
384
|
+
RUN_NOT_OURS: {
|
|
385
|
+
code: 100723,
|
|
386
|
+
message: (runId) => `run ${runId} is another member's; only its owner writes to it`
|
|
387
|
+
},
|
|
388
|
+
CHAT_SHARED_NEEDS_PROJECT: {
|
|
389
|
+
code: 100724,
|
|
390
|
+
message: () => 'a shared chat names the project it is written into'
|
|
391
|
+
},
|
|
392
|
+
MODEL_REQUEST_NOT_OURS: {
|
|
393
|
+
code: 100725,
|
|
394
|
+
message: (chunkId) => `model-request ${chunkId} is not this device's to change`
|
|
395
|
+
},
|
|
396
|
+
MODEL_REQUEST_CLOSED: {
|
|
397
|
+
code: 100726,
|
|
398
|
+
message: (chunkId) => `model-request ${chunkId} has already ended`
|
|
399
|
+
},
|
|
400
|
+
CHAT_PROJECT_OTHER_WORKSPACE: {
|
|
401
|
+
code: 100727,
|
|
402
|
+
message: () => "a chat links only projects of its own workspace: start one in the project's"
|
|
403
|
+
},
|
|
404
|
+
CHAT_AGENT_SWITCH_NO_DEVICE: {
|
|
405
|
+
code: 100728,
|
|
406
|
+
message: () => "this device has no identity yet, so it cannot switch a chat's agent"
|
|
407
|
+
},
|
|
408
|
+
RUN_REQUEST_NOT_OURS: {
|
|
409
|
+
code: 100729,
|
|
410
|
+
message: (chunkId) => `run-request ${chunkId} is not this device's to take`
|
|
411
|
+
},
|
|
412
|
+
RUN_REQUEST_TAKEN: {
|
|
413
|
+
code: 100730,
|
|
414
|
+
message: (chunkId) => `run-request ${chunkId} is not open to take`
|
|
415
|
+
},
|
|
416
|
+
CHAT_MOVE_NOT_FOUND: {
|
|
417
|
+
code: 100801,
|
|
418
|
+
message: () => 'no move of this chat is recorded on this device'
|
|
419
|
+
},
|
|
420
|
+
CHAT_MOVE_SAME_MESH: {
|
|
421
|
+
code: 100802,
|
|
422
|
+
message: () => 'a chat is moved to another mesh, not the one it is in'
|
|
423
|
+
},
|
|
424
|
+
CHAT_MOVE_ID_CONFLICT: {
|
|
425
|
+
code: 100803,
|
|
426
|
+
message: () => 'the target already holds this chat under another id'
|
|
427
|
+
},
|
|
428
|
+
CHAT_COMPUTE_MESH: {
|
|
429
|
+
code: 100804,
|
|
430
|
+
message: () => 'a compute mesh carries no chats'
|
|
431
|
+
},
|
|
432
|
+
CHAT_TARGET_NOT_WRITER: {
|
|
433
|
+
code: 100805,
|
|
434
|
+
message: () => 'this device cannot write to the target mesh'
|
|
435
|
+
},
|
|
436
|
+
CHAT_MOVE_STILL_ARRIVING: {
|
|
437
|
+
code: 100806,
|
|
438
|
+
message: () => 'this chat is still arriving from a move; move it once it has landed'
|
|
439
|
+
},
|
|
440
|
+
UPLOAD_MESH_MISSING: {
|
|
441
|
+
code: 100901,
|
|
442
|
+
message: () => UPLOAD_NAMES_NO_MESH
|
|
443
|
+
},
|
|
444
|
+
UPLOAD_FIRST_FRAME_INCOMPLETE: {
|
|
445
|
+
code: 100902,
|
|
446
|
+
message: (kind) => `upload${kind === 'knowledge' ? 'Knowledge' : 'Attachment'}: first frame must carry chatId, fileName, mimeType${kind === 'attachment' ? ', originDeviceId' : ''}`
|
|
447
|
+
},
|
|
448
|
+
UPLOAD_METADATA_INCOMPLETE: {
|
|
449
|
+
code: 100903,
|
|
450
|
+
message: () => 'upload metadata is incomplete'
|
|
451
|
+
},
|
|
452
|
+
FILE_ID_EXISTS: {
|
|
453
|
+
code: 100904,
|
|
454
|
+
message: () => 'file id already exists'
|
|
455
|
+
},
|
|
456
|
+
UPLOAD_MIME_MISMATCH: {
|
|
457
|
+
code: 100905,
|
|
458
|
+
message: (route, mimeType) => `${route}: bytes do not match declared mime ${mimeType}`
|
|
459
|
+
},
|
|
460
|
+
KNOWLEDGE_TYPE_UNSUPPORTED: {
|
|
461
|
+
code: 100906,
|
|
462
|
+
message: (fileName) => `${fileName} is not a supported Knowledge file.`
|
|
463
|
+
},
|
|
464
|
+
IMAGE_INVALID: {
|
|
465
|
+
code: 100907,
|
|
466
|
+
message: (mimeType) => `uploadAttachment: bytes are not a valid image for ${mimeType}`
|
|
467
|
+
},
|
|
468
|
+
IMAGE_DECODE_FAILED: {
|
|
469
|
+
code: 100908,
|
|
470
|
+
message: (mimeType) => `uploadAttachment: could not decode ${mimeType} image (it may be corrupt)`
|
|
471
|
+
},
|
|
472
|
+
UPLOAD_TOO_LARGE: {
|
|
473
|
+
code: 100909,
|
|
474
|
+
message: (kind, maxBytes) => `${kind} too large ${kind === 'attachment' ? '\u2014' : '-'} the limit is ${maxBytes} bytes`
|
|
475
|
+
},
|
|
476
|
+
UPLOAD_TIMEOUT: {
|
|
477
|
+
code: 100910,
|
|
478
|
+
message: () => 'upload source timed out'
|
|
479
|
+
},
|
|
480
|
+
NOT_AN_ATTACHMENT: {
|
|
481
|
+
code: 100911,
|
|
482
|
+
message: (chunkId) => `not an attachment chunk: ${chunkId}`
|
|
483
|
+
},
|
|
484
|
+
ATTACHMENT_DELETE_NOT_ORIGIN: {
|
|
485
|
+
code: 100912,
|
|
486
|
+
message: () => 'only the origin device may delete an attachment'
|
|
487
|
+
},
|
|
488
|
+
ATTACHMENT_DELETE_DROPPED: {
|
|
489
|
+
code: 100913,
|
|
490
|
+
message: () => 'delete-attachment dropped \u2014 only the origin device may delete an attachment'
|
|
491
|
+
},
|
|
492
|
+
KNOWLEDGE_NOT_FOUND: {
|
|
493
|
+
code: 100914,
|
|
494
|
+
message: (knowledgeId) => `knowledge not found: ${knowledgeId}`
|
|
495
|
+
},
|
|
496
|
+
BLOB_UNAVAILABLE: {
|
|
497
|
+
code: 100915,
|
|
498
|
+
message: () => 'blob unavailable'
|
|
499
|
+
},
|
|
500
|
+
KNOWLEDGE_BASE_NOT_A_PROJECT: {
|
|
501
|
+
code: 100916,
|
|
502
|
+
message: () => 'only a project has a knowledge base: name a chat to add this file to'
|
|
503
|
+
},
|
|
504
|
+
KNOWLEDGE_CAP_REACHED: {
|
|
505
|
+
code: 100917,
|
|
506
|
+
message: (capBytes) => `this project's knowledge base is full: its cap is ${capBytes} bytes`
|
|
507
|
+
},
|
|
508
|
+
KNOWLEDGE_CAP_INVALID: {
|
|
509
|
+
code: 100918,
|
|
510
|
+
message: () => 'a knowledge cap must be at least 1 byte'
|
|
511
|
+
},
|
|
512
|
+
TOOL_CONFIGS_INVALID: {
|
|
513
|
+
code: 101001,
|
|
514
|
+
message: () => 'tool configs must be a plain object'
|
|
515
|
+
},
|
|
516
|
+
TOOL_CONFIGS_SECRET: {
|
|
517
|
+
code: 101002,
|
|
518
|
+
message: (hit) => `tool configs must not carry secrets (${hit}); ` +
|
|
519
|
+
'keep the secret device-local and store a mesh-safe reference instead'
|
|
520
|
+
},
|
|
521
|
+
TOOL_CONFIGS_TOO_LARGE: {
|
|
522
|
+
code: 101003,
|
|
523
|
+
message: (max) => `tool configs exceed the ${max} byte wire cap`
|
|
524
|
+
},
|
|
525
|
+
TOOL_CONFIGS_NOT_FOUND: {
|
|
526
|
+
code: 101004,
|
|
527
|
+
message: (agentId, toolName) => `tool configs not found: ${agentId}/${toolName}`
|
|
528
|
+
},
|
|
529
|
+
CAPABILITY_UNBOUND: {
|
|
530
|
+
code: 101101,
|
|
531
|
+
message: (capability) => `no ${capability} bound`
|
|
532
|
+
},
|
|
533
|
+
MODEL_RUNTIME_UNBOUND: {
|
|
534
|
+
code: 101102,
|
|
535
|
+
message: () => 'no model runtime is bound'
|
|
536
|
+
},
|
|
537
|
+
CAPABILITY_UNSUPPORTED: {
|
|
538
|
+
code: 101103,
|
|
539
|
+
message: (capability) => `harness does not support ${capability}`
|
|
540
|
+
},
|
|
541
|
+
MODEL_RUNTIME_UNSUPPORTED: {
|
|
542
|
+
code: 101104,
|
|
543
|
+
message: (action) => `the model runtime cannot ${action} a model`
|
|
544
|
+
},
|
|
545
|
+
MODEL_NOT_DOWNLOADED: {
|
|
546
|
+
code: 101105,
|
|
547
|
+
message: (name) => `${name} is not downloaded on this device`
|
|
548
|
+
},
|
|
549
|
+
MODEL_DOWNLOAD_UNAVAILABLE: {
|
|
550
|
+
code: 101106,
|
|
551
|
+
message: () => 'model download reconciler is unavailable'
|
|
552
|
+
},
|
|
553
|
+
CUSTOM_MODEL_SOURCE_REFUSED: {
|
|
554
|
+
code: 101107,
|
|
555
|
+
message: (reason) => reason || 'The model source was refused.'
|
|
556
|
+
},
|
|
557
|
+
CUSTOM_MODEL_AMBIGUOUS: {
|
|
558
|
+
code: 101108,
|
|
559
|
+
message: () => 'This repository holds several models; add one of its files.'
|
|
560
|
+
},
|
|
561
|
+
CUSTOM_MODEL_TASK_UNSUPPORTED: {
|
|
562
|
+
code: 101109,
|
|
563
|
+
message: (task) => `This is ${/^[aeiou]/i.test(task) ? 'an' : 'a'} ${task} model. Custom models run as the assistant's text model only.`
|
|
564
|
+
},
|
|
565
|
+
CUSTOM_MODEL_LABEL_TAKEN: {
|
|
566
|
+
code: 101110,
|
|
567
|
+
message: (label) => `${label} is already the name of another model you added.`
|
|
568
|
+
},
|
|
569
|
+
MODEL_DOWNLOAD_CLOSED: {
|
|
570
|
+
code: 101111,
|
|
571
|
+
message: () => 'model download reconciler is closed'
|
|
572
|
+
},
|
|
573
|
+
OAUTH_LAUNCHER_UNAVAILABLE: {
|
|
574
|
+
code: 101201,
|
|
575
|
+
message: () => 'OAuth browser launcher is unavailable; inject openUrl or createRedirect'
|
|
576
|
+
},
|
|
577
|
+
OAUTH_STATE_MISMATCH: {
|
|
578
|
+
code: 101202,
|
|
579
|
+
message: () => 'OAuth state mismatch (possible CSRF)'
|
|
580
|
+
},
|
|
581
|
+
OAUTH_CANCELLED: {
|
|
582
|
+
code: 101203,
|
|
583
|
+
message: () => 'OAuth flow cancelled'
|
|
584
|
+
},
|
|
585
|
+
OAUTH_LOOPBACK_PORT_INVALID: {
|
|
586
|
+
code: 101204,
|
|
587
|
+
message: (port) => `OAuth loopback port must be an integer in [0, 65535], got ${port}`
|
|
588
|
+
},
|
|
589
|
+
OAUTH_SUPERSEDED: {
|
|
590
|
+
code: 101205,
|
|
591
|
+
message: () => 'OAuth loopback superseded by a new connect attempt'
|
|
592
|
+
},
|
|
593
|
+
OAUTH_LOOPBACK_BUSY: {
|
|
594
|
+
code: 101206,
|
|
595
|
+
message: (port, state) => `OAuth loopback on port ${port} already has a flow on state ${state}`
|
|
596
|
+
},
|
|
597
|
+
OAUTH_CALLBACK_TIMEOUT: {
|
|
598
|
+
code: 101207,
|
|
599
|
+
message: () => 'OAuth callback timed out'
|
|
600
|
+
},
|
|
601
|
+
OAUTH_LOOPBACK_CLOSED: {
|
|
602
|
+
code: 101208,
|
|
603
|
+
message: () => 'OAuth loopback closed'
|
|
604
|
+
},
|
|
605
|
+
OAUTH_LOOPBACK_PORT_IN_USE: {
|
|
606
|
+
code: 101209,
|
|
607
|
+
message: (port) => `OAuth loopback port ${port} is already in use by another process`
|
|
608
|
+
},
|
|
609
|
+
OAUTH_PROVIDER_ERROR: {
|
|
610
|
+
code: 101210,
|
|
611
|
+
message: (error) => `OAuth error: ${error}`
|
|
612
|
+
},
|
|
613
|
+
OAUTH_CALLBACK_INVALID: {
|
|
614
|
+
code: 101211,
|
|
615
|
+
message: () => 'OAuth callback missing code'
|
|
616
|
+
},
|
|
617
|
+
OAUTH_CLIENT_SECRET_MISSING: {
|
|
618
|
+
code: 101212,
|
|
619
|
+
message: (provider) => `Client secret is required for ${provider}.`
|
|
620
|
+
},
|
|
621
|
+
OAUTH_REGISTRATION_UNAVAILABLE: {
|
|
622
|
+
code: 101213,
|
|
623
|
+
message: () => 'Dynamic client registration requested without a registration endpoint'
|
|
624
|
+
},
|
|
625
|
+
OAUTH_REGISTRATION_FAILED: {
|
|
626
|
+
code: 101214,
|
|
627
|
+
message: (status, text) => `Client registration failed (${status}): ${text}`
|
|
628
|
+
},
|
|
629
|
+
OAUTH_TOKEN_ERROR: {
|
|
630
|
+
code: 101215,
|
|
631
|
+
message: (error, detail) => `Token endpoint returned an error: ${error}${detail ? ` \u2014 ${detail}` : ''}`
|
|
632
|
+
},
|
|
633
|
+
OAUTH_TOKEN_EXCHANGE_FAILED: {
|
|
634
|
+
code: 101216,
|
|
635
|
+
message: (status, text) => `Token exchange failed (${status}): ${text}`
|
|
636
|
+
},
|
|
637
|
+
OAUTH_TOKEN_REFRESH_TIMEOUT: {
|
|
638
|
+
code: 101217,
|
|
639
|
+
message: () => 'OAuth token refresh timed out'
|
|
640
|
+
},
|
|
641
|
+
OAUTH_TOKEN_REFRESH_FAILED: {
|
|
642
|
+
code: 101218,
|
|
643
|
+
message: (status, text) => `Token refresh failed (${status}): ${text}`
|
|
644
|
+
},
|
|
645
|
+
OAUTH_TOKEN_EXCHANGE_TIMEOUT: {
|
|
646
|
+
code: 101219,
|
|
647
|
+
message: () => 'OAuth token exchange timed out'
|
|
648
|
+
},
|
|
649
|
+
OAUTH_REGISTRATION_TIMEOUT: {
|
|
650
|
+
code: 101220,
|
|
651
|
+
message: () => 'OAuth client registration timed out'
|
|
652
|
+
},
|
|
653
|
+
SIDECAR_ENTRY_MISSING: {
|
|
654
|
+
code: 101301,
|
|
655
|
+
message: () => 'sidecar mode needs a stowed bundle entry'
|
|
656
|
+
},
|
|
657
|
+
SIDECAR_EXITED: {
|
|
658
|
+
code: 101302,
|
|
659
|
+
message: (code) => `sidecar exited (${code}) before ready`
|
|
660
|
+
},
|
|
661
|
+
RUN_STREAM_ENDED: {
|
|
662
|
+
code: 101303,
|
|
663
|
+
message: (chatId) => `chunk stream ended before the run settled: ${chatId}`
|
|
664
|
+
},
|
|
665
|
+
ASSISTANT_CLOSING: {
|
|
666
|
+
code: 101304,
|
|
667
|
+
message: () => 'assistant is closing'
|
|
668
|
+
},
|
|
669
|
+
RUN_LOG_NOT_ASSIGNED: {
|
|
670
|
+
code: 101401,
|
|
671
|
+
message: (runId) => `run ${runId} is not one this device runs`
|
|
672
|
+
},
|
|
673
|
+
RUN_LOG_SETTLED: {
|
|
674
|
+
code: 101402,
|
|
675
|
+
message: (runId) => `run ${runId} has settled, so its log cannot be reopened`
|
|
676
|
+
},
|
|
677
|
+
RUN_LOG_STALE_GENERATION: {
|
|
678
|
+
code: 101403,
|
|
679
|
+
message: (runId) => `the log of run ${runId} was reopened by a newer lease`
|
|
680
|
+
},
|
|
681
|
+
RUN_LOG_STEP_OUT_OF_ORDER: {
|
|
682
|
+
code: 101404,
|
|
683
|
+
message: (runId, expected) => `run ${runId} expected step ${expected}: a step is appended once, in order`
|
|
684
|
+
},
|
|
685
|
+
RUN_LOG_STEP_INVALID: {
|
|
686
|
+
code: 101405,
|
|
687
|
+
message: (runId) => `the step for run ${runId} is not a run-log step`
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
export class CoreError extends QvacErrorBase {
|
|
691
|
+
constructor(name, ...[adds, opts]) {
|
|
692
|
+
super({ code: DEFINITIONS[name].code, adds: adds ?? [], cause: opts?.cause });
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
export function coreErrorCode(name) {
|
|
696
|
+
return DEFINITIONS[name].code;
|
|
697
|
+
}
|
|
698
|
+
export function coreErrorCodes() {
|
|
699
|
+
return Object.values(DEFINITIONS).map(({ code }) => code);
|
|
700
|
+
}
|
|
701
|
+
const CODES = new Set(coreErrorCodes());
|
|
702
|
+
export function coreErrorCodeOf(err) {
|
|
703
|
+
const code = isRecord(err) ? Number(err.code) : 0;
|
|
704
|
+
return CODES.has(code) ? code : 0;
|
|
705
|
+
}
|
|
706
|
+
export function coreErrorFrom(code, message) {
|
|
707
|
+
if (!CODES.has(code)) {
|
|
708
|
+
return new Error(message);
|
|
709
|
+
}
|
|
710
|
+
const err = new QvacErrorBase({ code });
|
|
711
|
+
err.message = message;
|
|
712
|
+
return err;
|
|
713
|
+
}
|
|
714
|
+
export function isCoreError(err, name) {
|
|
715
|
+
return isRecord(err) && String(err.code) === String(DEFINITIONS[name].code);
|
|
716
|
+
}
|
|
717
|
+
function register() {
|
|
718
|
+
const codes = {};
|
|
719
|
+
for (const [name, { code, message }] of Object.entries(DEFINITIONS)) {
|
|
720
|
+
codes[code] = { name, message };
|
|
721
|
+
}
|
|
722
|
+
addCodes(codes, { name: '@qvac/core', version: `${Object.keys(codes).length}.0.0` });
|
|
723
|
+
}
|
|
724
|
+
register();
|