@undefineds.co/xpod 0.2.34 → 0.2.36
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/dist/agents/schema/agent-config.js +1 -1
- package/dist/agents/schema/agent-config.js.map +1 -1
- package/dist/agents/schema/create-agent-schema.js +17 -16
- package/dist/agents/schema/create-agent-schema.js.map +1 -1
- package/dist/agents/schema/tables.js +1 -1
- package/dist/agents/schema/tables.js.map +1 -1
- package/dist/ai/schema/config.js +1 -1
- package/dist/ai/schema/config.js.map +1 -1
- package/dist/ai/schema/model.js +2 -2
- package/dist/ai/schema/model.js.map +1 -1
- package/dist/ai/schema/provider.js +1 -1
- package/dist/ai/schema/provider.js.map +1 -1
- package/dist/ai/schema/vector-store.js +2 -2
- package/dist/ai/schema/vector-store.js.map +1 -1
- package/dist/api/container/local.js +1 -5
- package/dist/api/container/local.js.map +1 -1
- package/dist/api/container/routes.js +16 -1
- package/dist/api/container/routes.js.map +1 -1
- package/dist/api/handlers/PodManagementHandler.d.ts +8 -0
- package/dist/api/handlers/PodManagementHandler.js +5 -3
- package/dist/api/handlers/PodManagementHandler.js.map +1 -1
- package/dist/api/handlers/WebIdProfileHandler.js +64 -6
- package/dist/api/handlers/WebIdProfileHandler.js.map +1 -1
- package/dist/api/runtime.js +11 -6
- package/dist/api/runtime.js.map +1 -1
- package/dist/components/components.jsonld +1 -0
- package/dist/components/context.jsonld +36 -0
- package/dist/credential/schema/tables.js +3 -3
- package/dist/credential/schema/tables.js.map +1 -1
- package/dist/edge/LocalNetworkManager.d.ts +2 -7
- package/dist/edge/LocalNetworkManager.js +7 -34
- package/dist/edge/LocalNetworkManager.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/provision/LocalPodProvisioningService.d.ts +34 -0
- package/dist/provision/LocalPodProvisioningService.js +294 -0
- package/dist/provision/LocalPodProvisioningService.js.map +1 -0
- package/dist/provision/LocalPodProvisioningService.jsonld +142 -0
- package/dist/provision/ProvisionPodCreator.js +3 -4
- package/dist/provision/ProvisionPodCreator.js.map +1 -1
- package/dist/tunnel/LocalTunnelProvider.d.ts +2 -2
- package/dist/tunnel/LocalTunnelProvider.js +12 -14
- package/dist/tunnel/LocalTunnelProvider.js.map +1 -1
- package/dist/tunnel/TunnelProvider.d.ts +2 -0
- package/dist/tunnel/TunnelProvider.js.map +1 -1
- package/dist/tunnel/TunnelProvider.jsonld +4 -0
- package/package.json +2 -2
- package/node_modules/@undefineds.co/models/README.md +0 -578
- package/node_modules/@undefineds.co/models/dist/_drizzle-solid/columns.d.ts +0 -37
- package/node_modules/@undefineds.co/models/dist/_drizzle-solid/columns.js +0 -1
- package/node_modules/@undefineds.co/models/dist/_drizzle-solid/pod-table.d.ts +0 -3
- package/node_modules/@undefineds.co/models/dist/_drizzle-solid/pod-table.js +0 -1
- package/node_modules/@undefineds.co/models/dist/_drizzle-solid/types.d.ts +0 -40
- package/node_modules/@undefineds.co/models/dist/_drizzle-solid/types.js +0 -1
- package/node_modules/@undefineds.co/models/dist/agent.providers.d.ts +0 -13
- package/node_modules/@undefineds.co/models/dist/agent.providers.js +0 -69
- package/node_modules/@undefineds.co/models/dist/agent.repository.d.ts +0 -85
- package/node_modules/@undefineds.co/models/dist/agent.repository.js +0 -7
- package/node_modules/@undefineds.co/models/dist/agent.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/agent.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/ai-config/index.d.ts +0 -61
- package/node_modules/@undefineds.co/models/dist/ai-config/index.js +0 -294
- package/node_modules/@undefineds.co/models/dist/ai-config.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/ai-config.js +0 -1
- package/node_modules/@undefineds.co/models/dist/ai-model.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/ai-model.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/ai-provider.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/ai-provider.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/approval.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/approval.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/audit.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/audit.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/chat.repository.d.ts +0 -61
- package/node_modules/@undefineds.co/models/dist/chat.repository.js +0 -8
- package/node_modules/@undefineds.co/models/dist/chat.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/chat.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/chat.utils.d.ts +0 -3
- package/node_modules/@undefineds.co/models/dist/chat.utils.js +0 -30
- package/node_modules/@undefineds.co/models/dist/contact.repository.d.ts +0 -85
- package/node_modules/@undefineds.co/models/dist/contact.repository.js +0 -8
- package/node_modules/@undefineds.co/models/dist/contact.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/contact.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/agent-provider.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/agent-provider.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/agent-status.schema.d.ts +0 -12
- package/node_modules/@undefineds.co/models/dist/core/agent-status.schema.js +0 -18
- package/node_modules/@undefineds.co/models/dist/core/agent.schema.d.ts +0 -72
- package/node_modules/@undefineds.co/models/dist/core/agent.schema.js +0 -38
- package/node_modules/@undefineds.co/models/dist/core/ai-config.schema.d.ts +0 -11
- package/node_modules/@undefineds.co/models/dist/core/ai-config.schema.js +0 -18
- package/node_modules/@undefineds.co/models/dist/core/ai-model.schema.d.ts +0 -15
- package/node_modules/@undefineds.co/models/dist/core/ai-model.schema.js +0 -21
- package/node_modules/@undefineds.co/models/dist/core/ai-provider.schema.d.ts +0 -16
- package/node_modules/@undefineds.co/models/dist/core/ai-provider.schema.js +0 -28
- package/node_modules/@undefineds.co/models/dist/core/approval.schema.d.ts +0 -21
- package/node_modules/@undefineds.co/models/dist/core/approval.schema.js +0 -33
- package/node_modules/@undefineds.co/models/dist/core/audit.schema.d.ts +0 -17
- package/node_modules/@undefineds.co/models/dist/core/audit.schema.js +0 -29
- package/node_modules/@undefineds.co/models/dist/core/chat.schema.d.ts +0 -36
- package/node_modules/@undefineds.co/models/dist/core/chat.schema.js +0 -45
- package/node_modules/@undefineds.co/models/dist/core/contact.schema.d.ts +0 -47
- package/node_modules/@undefineds.co/models/dist/core/contact.schema.js +0 -59
- package/node_modules/@undefineds.co/models/dist/core/credential.schema.d.ts +0 -56
- package/node_modules/@undefineds.co/models/dist/core/credential.schema.js +0 -40
- package/node_modules/@undefineds.co/models/dist/core/extension/extension.schema.d.ts +0 -4
- package/node_modules/@undefineds.co/models/dist/core/extension/extension.schema.js +0 -11
- package/node_modules/@undefineds.co/models/dist/core/extension/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/extension/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/extension.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/extension.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/favorite/favorite.schema.d.ts +0 -24
- package/node_modules/@undefineds.co/models/dist/core/favorite/favorite.schema.js +0 -34
- package/node_modules/@undefineds.co/models/dist/core/favorite/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/favorite/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/file/file.schema.d.ts +0 -39
- package/node_modules/@undefineds.co/models/dist/core/file/file.schema.js +0 -51
- package/node_modules/@undefineds.co/models/dist/core/file/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/file/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/file.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/file.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/grant.schema.d.ts +0 -16
- package/node_modules/@undefineds.co/models/dist/core/grant.schema.js +0 -29
- package/node_modules/@undefineds.co/models/dist/core/import/import-job.schema.d.ts +0 -5
- package/node_modules/@undefineds.co/models/dist/core/import/import-job.schema.js +0 -5
- package/node_modules/@undefineds.co/models/dist/core/import/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/import/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/import.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/import.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/inbox-notification.schema.d.ts +0 -9
- package/node_modules/@undefineds.co/models/dist/core/inbox-notification.schema.js +0 -16
- package/node_modules/@undefineds.co/models/dist/core/index.d.ts +0 -31
- package/node_modules/@undefineds.co/models/dist/core/index.js +0 -32
- package/node_modules/@undefineds.co/models/dist/core/knowledge/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/knowledge/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/knowledge/knowledge-folder.schema.d.ts +0 -7
- package/node_modules/@undefineds.co/models/dist/core/knowledge/knowledge-folder.schema.js +0 -6
- package/node_modules/@undefineds.co/models/dist/core/knowledge.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/knowledge.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/message.schema.d.ts +0 -33
- package/node_modules/@undefineds.co/models/dist/core/message.schema.js +0 -49
- package/node_modules/@undefineds.co/models/dist/core/namespaces.d.ts +0 -176
- package/node_modules/@undefineds.co/models/dist/core/namespaces.js +0 -289
- package/node_modules/@undefineds.co/models/dist/core/profile.d.ts +0 -16
- package/node_modules/@undefineds.co/models/dist/core/profile.js +0 -19
- package/node_modules/@undefineds.co/models/dist/core/schema.d.ts +0 -304
- package/node_modules/@undefineds.co/models/dist/core/schema.js +0 -46
- package/node_modules/@undefineds.co/models/dist/core/session/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/session/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/session/session.schema.d.ts +0 -6
- package/node_modules/@undefineds.co/models/dist/core/session/session.schema.js +0 -6
- package/node_modules/@undefineds.co/models/dist/core/session.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/session.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/settings/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/settings/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/settings/settings.schema.d.ts +0 -49
- package/node_modules/@undefineds.co/models/dist/core/settings/settings.schema.js +0 -63
- package/node_modules/@undefineds.co/models/dist/core/settings.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/settings.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/thread.schema.d.ts +0 -28
- package/node_modules/@undefineds.co/models/dist/core/thread.schema.js +0 -36
- package/node_modules/@undefineds.co/models/dist/core/types/collaboration-blocks.d.ts +0 -52
- package/node_modules/@undefineds.co/models/dist/core/types/collaboration-blocks.js +0 -7
- package/node_modules/@undefineds.co/models/dist/core/types/message-block.d.ts +0 -270
- package/node_modules/@undefineds.co/models/dist/core/types/message-block.js +0 -125
- package/node_modules/@undefineds.co/models/dist/core/vector-store.schema.d.ts +0 -25
- package/node_modules/@undefineds.co/models/dist/core/vector-store.schema.js +0 -35
- package/node_modules/@undefineds.co/models/dist/core/vocab/_namespaces.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/vocab/_namespaces.js +0 -3
- package/node_modules/@undefineds.co/models/dist/core/vocab/chat.vocab.d.ts +0 -16
- package/node_modules/@undefineds.co/models/dist/core/vocab/chat.vocab.js +0 -22
- package/node_modules/@undefineds.co/models/dist/core/vocab/contact.vocab.d.ts +0 -21
- package/node_modules/@undefineds.co/models/dist/core/vocab/contact.vocab.js +0 -22
- package/node_modules/@undefineds.co/models/dist/core/vocab/index.d.ts +0 -6
- package/node_modules/@undefineds.co/models/dist/core/vocab/index.js +0 -6
- package/node_modules/@undefineds.co/models/dist/core/vocab/message.vocab.d.ts +0 -20
- package/node_modules/@undefineds.co/models/dist/core/vocab/message.vocab.js +0 -24
- package/node_modules/@undefineds.co/models/dist/core/vocab/sidecar.vocab.d.ts +0 -46
- package/node_modules/@undefineds.co/models/dist/core/vocab/sidecar.vocab.js +0 -47
- package/node_modules/@undefineds.co/models/dist/core/vocab/thread.vocab.d.ts +0 -11
- package/node_modules/@undefineds.co/models/dist/core/vocab/thread.vocab.js +0 -14
- package/node_modules/@undefineds.co/models/dist/core/vocab/workspace.vocab.d.ts +0 -12
- package/node_modules/@undefineds.co/models/dist/core/vocab/workspace.vocab.js +0 -13
- package/node_modules/@undefineds.co/models/dist/core/vocab.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core/vocab.js +0 -1
- package/node_modules/@undefineds.co/models/dist/core/workspace.schema.d.ts +0 -35
- package/node_modules/@undefineds.co/models/dist/core/workspace.schema.js +0 -106
- package/node_modules/@undefineds.co/models/dist/core.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/core.js +0 -1
- package/node_modules/@undefineds.co/models/dist/credential.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/credential.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/discovery/index.d.ts +0 -31
- package/node_modules/@undefineds.co/models/dist/discovery/index.js +0 -147
- package/node_modules/@undefineds.co/models/dist/discovery/models.json +0 -2623
- package/node_modules/@undefineds.co/models/dist/discovery/providers.json +0 -156
- package/node_modules/@undefineds.co/models/dist/discovery/types.d.ts +0 -103
- package/node_modules/@undefineds.co/models/dist/discovery/types.js +0 -12
- package/node_modules/@undefineds.co/models/dist/discovery/vercel.d.ts +0 -25
- package/node_modules/@undefineds.co/models/dist/discovery/vercel.js +0 -95
- package/node_modules/@undefineds.co/models/dist/discovery.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/discovery.js +0 -1
- package/node_modules/@undefineds.co/models/dist/extension/extension.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/extension/extension.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/extension/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/extension/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/extension.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/extension.js +0 -1
- package/node_modules/@undefineds.co/models/dist/favorite/favorite.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/favorite/favorite.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/favorite/index.d.ts +0 -2
- package/node_modules/@undefineds.co/models/dist/favorite/index.js +0 -7
- package/node_modules/@undefineds.co/models/dist/favorite/starred-sync.d.ts +0 -66
- package/node_modules/@undefineds.co/models/dist/favorite/starred-sync.js +0 -156
- package/node_modules/@undefineds.co/models/dist/favorite.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/favorite.js +0 -1
- package/node_modules/@undefineds.co/models/dist/file/file.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/file/file.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/file/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/file/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/file.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/file.js +0 -1
- package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.d.ts +0 -13
- package/node_modules/@undefineds.co/models/dist/fixtures/contracts-chat-contact.js +0 -76
- package/node_modules/@undefineds.co/models/dist/grant.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/grant.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/import/import-job.schema.d.ts +0 -5
- package/node_modules/@undefineds.co/models/dist/import/import-job.schema.js +0 -5
- package/node_modules/@undefineds.co/models/dist/import/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/import/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/import.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/import.js +0 -1
- package/node_modules/@undefineds.co/models/dist/inbox-notification.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/inbox-notification.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/index.d.ts +0 -41
- package/node_modules/@undefineds.co/models/dist/index.js +0 -83
- package/node_modules/@undefineds.co/models/dist/knowledge/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/knowledge/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/knowledge/knowledge-folder.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/knowledge/knowledge-folder.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/knowledge.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/knowledge.js +0 -1
- package/node_modules/@undefineds.co/models/dist/message.repository.d.ts +0 -81
- package/node_modules/@undefineds.co/models/dist/message.repository.js +0 -8
- package/node_modules/@undefineds.co/models/dist/message.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/message.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/namespaces.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/namespaces.js +0 -1
- package/node_modules/@undefineds.co/models/dist/profile.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/profile.js +0 -1
- package/node_modules/@undefineds.co/models/dist/repository.d.ts +0 -59
- package/node_modules/@undefineds.co/models/dist/repository.js +0 -186
- package/node_modules/@undefineds.co/models/dist/schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/session/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/session/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/session/session.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/session/session.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/session.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/session.js +0 -1
- package/node_modules/@undefineds.co/models/dist/settings/index.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/settings/index.js +0 -1
- package/node_modules/@undefineds.co/models/dist/settings/settings.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/settings/settings.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/settings.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/settings.js +0 -1
- package/node_modules/@undefineds.co/models/dist/sidecar/index.d.ts +0 -2
- package/node_modules/@undefineds.co/models/dist/sidecar/index.js +0 -2
- package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.d.ts +0 -51
- package/node_modules/@undefineds.co/models/dist/sidecar/persistence-mapping.js +0 -44
- package/node_modules/@undefineds.co/models/dist/sidecar/sidecar-events.d.ts +0 -632
- package/node_modules/@undefineds.co/models/dist/sidecar/sidecar-events.js +0 -133
- package/node_modules/@undefineds.co/models/dist/thread.repository.d.ts +0 -41
- package/node_modules/@undefineds.co/models/dist/thread.repository.js +0 -8
- package/node_modules/@undefineds.co/models/dist/thread.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/thread.schema.js +0 -1
- package/node_modules/@undefineds.co/models/dist/types/collaboration-blocks.d.ts +0 -52
- package/node_modules/@undefineds.co/models/dist/types/collaboration-blocks.js +0 -7
- package/node_modules/@undefineds.co/models/dist/types/message-block.d.ts +0 -270
- package/node_modules/@undefineds.co/models/dist/types/message-block.js +0 -125
- package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/vocab/_namespaces.js +0 -3
- package/node_modules/@undefineds.co/models/dist/vocab/chat.vocab.d.ts +0 -16
- package/node_modules/@undefineds.co/models/dist/vocab/chat.vocab.js +0 -22
- package/node_modules/@undefineds.co/models/dist/vocab/contact.vocab.d.ts +0 -21
- package/node_modules/@undefineds.co/models/dist/vocab/contact.vocab.js +0 -22
- package/node_modules/@undefineds.co/models/dist/vocab/index.d.ts +0 -6
- package/node_modules/@undefineds.co/models/dist/vocab/index.js +0 -6
- package/node_modules/@undefineds.co/models/dist/vocab/message.vocab.d.ts +0 -20
- package/node_modules/@undefineds.co/models/dist/vocab/message.vocab.js +0 -24
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.d.ts +0 -46
- package/node_modules/@undefineds.co/models/dist/vocab/sidecar.vocab.js +0 -47
- package/node_modules/@undefineds.co/models/dist/vocab/thread.vocab.d.ts +0 -11
- package/node_modules/@undefineds.co/models/dist/vocab/thread.vocab.js +0 -14
- package/node_modules/@undefineds.co/models/dist/vocab/workspace.vocab.d.ts +0 -12
- package/node_modules/@undefineds.co/models/dist/vocab/workspace.vocab.js +0 -13
- package/node_modules/@undefineds.co/models/dist/vocab.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/vocab.js +0 -1
- package/node_modules/@undefineds.co/models/dist/workspace.repository.d.ts +0 -45
- package/node_modules/@undefineds.co/models/dist/workspace.repository.js +0 -8
- package/node_modules/@undefineds.co/models/dist/workspace.schema.d.ts +0 -1
- package/node_modules/@undefineds.co/models/dist/workspace.schema.js +0 -1
- package/node_modules/@undefineds.co/models/package.json +0 -67
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.0.0",
|
|
3
|
-
"updatedAt": "2026-03-16",
|
|
4
|
-
"providers": [
|
|
5
|
-
{
|
|
6
|
-
"slug": "openai",
|
|
7
|
-
"displayName": "OpenAI",
|
|
8
|
-
"baseUrl": "https://api.openai.com/v1",
|
|
9
|
-
"homepage": "https://platform.openai.com",
|
|
10
|
-
"logoUrl": "https://openai.com/favicon.ico",
|
|
11
|
-
"description": "OpenAI API - GPT-4, GPT-3.5 系列模型",
|
|
12
|
-
"supportedFeatures": ["chat", "embedding", "image", "audio", "vision", "function-calling"],
|
|
13
|
-
"authType": "bearer"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"slug": "anthropic",
|
|
17
|
-
"displayName": "Anthropic",
|
|
18
|
-
"baseUrl": "https://api.anthropic.com/v1",
|
|
19
|
-
"homepage": "https://www.anthropic.com",
|
|
20
|
-
"logoUrl": "https://www.anthropic.com/favicon.ico",
|
|
21
|
-
"description": "Anthropic Claude 系列模型",
|
|
22
|
-
"supportedFeatures": ["chat", "vision", "function-calling"],
|
|
23
|
-
"authType": "x-api-key"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"slug": "openrouter",
|
|
27
|
-
"displayName": "OpenRouter",
|
|
28
|
-
"baseUrl": "https://openrouter.ai/api/v1",
|
|
29
|
-
"homepage": "https://openrouter.ai",
|
|
30
|
-
"logoUrl": "https://openrouter.ai/favicon.ico",
|
|
31
|
-
"description": "统一接口访问多种 AI 模型",
|
|
32
|
-
"supportedFeatures": ["chat", "vision", "function-calling"],
|
|
33
|
-
"authType": "bearer"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"slug": "deepseek",
|
|
37
|
-
"displayName": "DeepSeek",
|
|
38
|
-
"baseUrl": "https://api.deepseek.com/v1",
|
|
39
|
-
"homepage": "https://www.deepseek.com",
|
|
40
|
-
"logoUrl": "https://www.deepseek.com/favicon.ico",
|
|
41
|
-
"description": "DeepSeek 深度求索 AI 模型",
|
|
42
|
-
"supportedFeatures": ["chat", "function-calling"],
|
|
43
|
-
"authType": "bearer"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"slug": "ollama",
|
|
47
|
-
"displayName": "Ollama",
|
|
48
|
-
"baseUrl": "http://localhost:11434/v1",
|
|
49
|
-
"homepage": "https://ollama.com",
|
|
50
|
-
"logoUrl": "https://ollama.com/public/ollama.png",
|
|
51
|
-
"description": "本地模型运行与管理",
|
|
52
|
-
"supportedFeatures": ["chat", "embedding", "vision"],
|
|
53
|
-
"authType": "none"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"slug": "google",
|
|
57
|
-
"displayName": "Google (Gemini)",
|
|
58
|
-
"baseUrl": "https://generativelanguage.googleapis.com/v1beta",
|
|
59
|
-
"homepage": "https://ai.google.dev",
|
|
60
|
-
"logoUrl": "https://ai.google.dev/favicon.ico",
|
|
61
|
-
"description": "Google Gemini 系列模型",
|
|
62
|
-
"supportedFeatures": ["chat", "vision", "embedding"],
|
|
63
|
-
"authType": "bearer"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"slug": "x-ai",
|
|
67
|
-
"displayName": "xAI (Grok)",
|
|
68
|
-
"baseUrl": "https://api.x.ai/v1",
|
|
69
|
-
"homepage": "https://x.ai",
|
|
70
|
-
"logoUrl": "https://x.ai/favicon.ico",
|
|
71
|
-
"description": "xAI Grok 模型",
|
|
72
|
-
"supportedFeatures": ["chat", "function-calling"],
|
|
73
|
-
"authType": "bearer"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"slug": "qwen",
|
|
77
|
-
"displayName": "通义千问",
|
|
78
|
-
"baseUrl": "https://dashscope.aliyuncs.com/api/v1",
|
|
79
|
-
"homepage": "https://qwen.ai",
|
|
80
|
-
"logoUrl": "https://qwen.ai/favicon.ico",
|
|
81
|
-
"description": "阿里云通义千问系列模型",
|
|
82
|
-
"supportedFeatures": ["chat", "vision", "function-calling"],
|
|
83
|
-
"authType": "bearer"
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"slug": "moonshot",
|
|
87
|
-
"displayName": "Moonshot (Kimi)",
|
|
88
|
-
"baseUrl": "https://api.moonshot.cn/v1",
|
|
89
|
-
"homepage": "https://www.moonshot.cn",
|
|
90
|
-
"logoUrl": "https://www.moonshot.cn/favicon.ico",
|
|
91
|
-
"description": "月之暗面 Kimi 模型",
|
|
92
|
-
"supportedFeatures": ["chat", "function-calling"],
|
|
93
|
-
"authType": "bearer"
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"slug": "minimax",
|
|
97
|
-
"displayName": "MiniMax",
|
|
98
|
-
"baseUrl": "https://api.minimax.chat/v1",
|
|
99
|
-
"homepage": "https://www.minimaxi.com",
|
|
100
|
-
"logoUrl": "https://www.minimaxi.com/favicon.ico",
|
|
101
|
-
"description": "MiniMax 大模型平台",
|
|
102
|
-
"supportedFeatures": ["chat", "vision", "function-calling"],
|
|
103
|
-
"authType": "bearer"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"slug": "mistral",
|
|
107
|
-
"displayName": "Mistral",
|
|
108
|
-
"baseUrl": "https://api.mistral.ai/v1",
|
|
109
|
-
"homepage": "https://mistral.ai",
|
|
110
|
-
"logoUrl": "https://mistral.ai/favicon.ico",
|
|
111
|
-
"description": "Mistral 模型平台",
|
|
112
|
-
"supportedFeatures": ["chat", "embedding", "function-calling"],
|
|
113
|
-
"authType": "bearer"
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"slug": "groq",
|
|
117
|
-
"displayName": "Groq",
|
|
118
|
-
"baseUrl": "https://api.groq.com/openai/v1",
|
|
119
|
-
"homepage": "https://groq.com",
|
|
120
|
-
"logoUrl": "https://groq.com/favicon.ico",
|
|
121
|
-
"description": "Groq 高速推理平台",
|
|
122
|
-
"supportedFeatures": ["chat", "function-calling"],
|
|
123
|
-
"authType": "bearer"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"slug": "together",
|
|
127
|
-
"displayName": "Together AI",
|
|
128
|
-
"baseUrl": "https://api.together.xyz/v1",
|
|
129
|
-
"homepage": "https://together.ai",
|
|
130
|
-
"logoUrl": "https://together.ai/favicon.ico",
|
|
131
|
-
"description": "Together AI 开源模型平台",
|
|
132
|
-
"supportedFeatures": ["chat", "embedding", "image"],
|
|
133
|
-
"authType": "bearer"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"slug": "zhipu",
|
|
137
|
-
"displayName": "ZhiPu",
|
|
138
|
-
"baseUrl": "https://open.bigmodel.cn/api/paas/v4",
|
|
139
|
-
"homepage": "https://open.bigmodel.cn",
|
|
140
|
-
"logoUrl": "https://open.bigmodel.cn/favicon.ico",
|
|
141
|
-
"description": "智谱 GLM 模型平台",
|
|
142
|
-
"supportedFeatures": ["chat", "vision", "function-calling"],
|
|
143
|
-
"authType": "bearer"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"slug": "codebuddy",
|
|
147
|
-
"displayName": "CodeBuddy",
|
|
148
|
-
"baseUrl": "https://api.codebuddy.ai/v1",
|
|
149
|
-
"homepage": "https://codebuddy.ai",
|
|
150
|
-
"logoUrl": "https://codebuddy.ai/favicon.ico",
|
|
151
|
-
"description": "CodeBuddy 开发助手模型平台",
|
|
152
|
-
"supportedFeatures": ["chat", "function-calling"],
|
|
153
|
-
"authType": "bearer"
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Discovery Service Types
|
|
3
|
-
*
|
|
4
|
-
* 可扩展的发现服务体系,用于提供:
|
|
5
|
-
* - Providers (AI 供应商)
|
|
6
|
-
* - Models (模型列表)
|
|
7
|
-
* - Tools (工具/插件)
|
|
8
|
-
* - Agents (预设 Agent 模板)
|
|
9
|
-
* - Prompts (提示词模板)
|
|
10
|
-
* - 未来更多...
|
|
11
|
-
*/
|
|
12
|
-
export interface ProviderMetadata {
|
|
13
|
-
slug: string;
|
|
14
|
-
displayName: string;
|
|
15
|
-
baseUrl: string;
|
|
16
|
-
homepage: string;
|
|
17
|
-
logoUrl?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
supportedFeatures?: ProviderFeature[];
|
|
20
|
-
authType?: 'bearer' | 'x-api-key' | 'query-param' | 'none';
|
|
21
|
-
}
|
|
22
|
-
export type ProviderFeature = 'chat' | 'embedding' | 'image' | 'audio' | 'vision' | 'function-calling';
|
|
23
|
-
export interface ModelMetadata {
|
|
24
|
-
id: string;
|
|
25
|
-
provider: string;
|
|
26
|
-
displayName: string;
|
|
27
|
-
description?: string;
|
|
28
|
-
contextLength?: number;
|
|
29
|
-
maxOutputTokens?: number;
|
|
30
|
-
pricing?: ModelPricing;
|
|
31
|
-
capabilities?: ModelCapability[];
|
|
32
|
-
isDefault?: boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface ModelPricing {
|
|
35
|
-
input: number;
|
|
36
|
-
output: number;
|
|
37
|
-
currency?: string;
|
|
38
|
-
}
|
|
39
|
-
export type ModelCapability = 'chat' | 'vision' | 'function-calling' | 'streaming' | 'json-mode';
|
|
40
|
-
export interface ToolMetadata {
|
|
41
|
-
id: string;
|
|
42
|
-
name: string;
|
|
43
|
-
displayName: string;
|
|
44
|
-
description: string;
|
|
45
|
-
category?: string;
|
|
46
|
-
schema: ToolSchema;
|
|
47
|
-
enabled?: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface ToolSchema {
|
|
50
|
-
type: 'function';
|
|
51
|
-
function: {
|
|
52
|
-
name: string;
|
|
53
|
-
description: string;
|
|
54
|
-
parameters: Record<string, unknown>;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export interface AgentTemplate {
|
|
58
|
-
id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
displayName: string;
|
|
61
|
-
description: string;
|
|
62
|
-
icon?: string;
|
|
63
|
-
provider: string;
|
|
64
|
-
model: string;
|
|
65
|
-
systemPrompt: string;
|
|
66
|
-
tools?: string[];
|
|
67
|
-
tags?: string[];
|
|
68
|
-
}
|
|
69
|
-
export interface PromptTemplate {
|
|
70
|
-
id: string;
|
|
71
|
-
name: string;
|
|
72
|
-
displayName: string;
|
|
73
|
-
description: string;
|
|
74
|
-
category?: string;
|
|
75
|
-
content: string;
|
|
76
|
-
variables?: PromptVariable[];
|
|
77
|
-
tags?: string[];
|
|
78
|
-
}
|
|
79
|
-
export interface PromptVariable {
|
|
80
|
-
name: string;
|
|
81
|
-
description?: string;
|
|
82
|
-
defaultValue?: string;
|
|
83
|
-
required?: boolean;
|
|
84
|
-
}
|
|
85
|
-
export interface DiscoveryRegistry {
|
|
86
|
-
version: string;
|
|
87
|
-
updatedAt: string;
|
|
88
|
-
providers: ProviderMetadata[];
|
|
89
|
-
models: ModelMetadata[];
|
|
90
|
-
tools?: ToolMetadata[];
|
|
91
|
-
agents?: AgentTemplate[];
|
|
92
|
-
prompts?: PromptTemplate[];
|
|
93
|
-
}
|
|
94
|
-
export interface DiscoveryService {
|
|
95
|
-
getProviders(): Promise<ProviderMetadata[]>;
|
|
96
|
-
getProvider(slug: string): Promise<ProviderMetadata | undefined>;
|
|
97
|
-
getModels(provider?: string): Promise<ModelMetadata[]>;
|
|
98
|
-
getModel(provider: string, modelId: string): Promise<ModelMetadata | undefined>;
|
|
99
|
-
getDefaultModel(provider: string): Promise<ModelMetadata | undefined>;
|
|
100
|
-
getTools?(): Promise<ToolMetadata[]>;
|
|
101
|
-
getAgentTemplates?(): Promise<AgentTemplate[]>;
|
|
102
|
-
getPromptTemplates?(): Promise<PromptTemplate[]>;
|
|
103
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { DiscoveryRegistry, ModelMetadata } from './types.js';
|
|
2
|
-
export interface VercelModelPricing {
|
|
3
|
-
input?: string;
|
|
4
|
-
output?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface VercelModelEntry {
|
|
7
|
-
id: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
description?: string;
|
|
10
|
-
owned_by?: string;
|
|
11
|
-
context_window?: number;
|
|
12
|
-
max_tokens?: number;
|
|
13
|
-
type?: string;
|
|
14
|
-
tags?: string[];
|
|
15
|
-
pricing?: VercelModelPricing;
|
|
16
|
-
}
|
|
17
|
-
export interface VercelModelCatalogResponse {
|
|
18
|
-
object?: string;
|
|
19
|
-
data?: VercelModelEntry[];
|
|
20
|
-
}
|
|
21
|
-
export declare const VERCEL_OWNER_PROVIDER_MAP: Record<string, string>;
|
|
22
|
-
export declare function mapVercelOwnerToProviderId(owner?: string | null): string;
|
|
23
|
-
export declare function normalizeVercelModelEntry(entry: VercelModelEntry, defaultModelIds?: Readonly<Record<string, string>>): ModelMetadata | null;
|
|
24
|
-
export declare function mergeVercelModelsIntoDiscovery(currentModels: readonly ModelMetadata[], upstreamModels: readonly VercelModelEntry[], defaultModelIds?: Readonly<Record<string, string>>): ModelMetadata[];
|
|
25
|
-
export declare function updateDiscoveryModelRegistry(currentRegistry: DiscoveryRegistry, upstreamCatalog: VercelModelCatalogResponse, updatedAt: string, defaultModelIds?: Readonly<Record<string, string>>): DiscoveryRegistry;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export const VERCEL_OWNER_PROVIDER_MAP = {
|
|
2
|
-
alibaba: 'qwen',
|
|
3
|
-
anthropic: 'anthropic',
|
|
4
|
-
deepseek: 'deepseek',
|
|
5
|
-
google: 'google',
|
|
6
|
-
minimax: 'minimax',
|
|
7
|
-
mistral: 'mistral',
|
|
8
|
-
moonshotai: 'moonshot',
|
|
9
|
-
openai: 'openai',
|
|
10
|
-
togetherai: 'together',
|
|
11
|
-
xai: 'x-ai',
|
|
12
|
-
zai: 'zhipu',
|
|
13
|
-
};
|
|
14
|
-
const DEFAULT_SYNCED_MODEL_TYPES = new Set(['language']);
|
|
15
|
-
function toNumber(value) {
|
|
16
|
-
if (typeof value !== 'string')
|
|
17
|
-
return undefined;
|
|
18
|
-
const parsed = Number(value);
|
|
19
|
-
return Number.isFinite(parsed) ? parsed : undefined;
|
|
20
|
-
}
|
|
21
|
-
function normalizeCapabilities(entry) {
|
|
22
|
-
const capabilities = new Set();
|
|
23
|
-
const tags = new Set(entry.tags ?? []);
|
|
24
|
-
if (entry.type === 'language') {
|
|
25
|
-
capabilities.add('chat');
|
|
26
|
-
}
|
|
27
|
-
if (tags.has('vision') || tags.has('file-input')) {
|
|
28
|
-
capabilities.add('vision');
|
|
29
|
-
}
|
|
30
|
-
if (tags.has('tool-use')) {
|
|
31
|
-
capabilities.add('function-calling');
|
|
32
|
-
}
|
|
33
|
-
if (entry.type === 'language') {
|
|
34
|
-
capabilities.add('streaming');
|
|
35
|
-
}
|
|
36
|
-
return Array.from(capabilities);
|
|
37
|
-
}
|
|
38
|
-
function compareModels(left, right) {
|
|
39
|
-
if (left.provider !== right.provider) {
|
|
40
|
-
return left.provider.localeCompare(right.provider);
|
|
41
|
-
}
|
|
42
|
-
if (Boolean(left.isDefault) !== Boolean(right.isDefault)) {
|
|
43
|
-
return left.isDefault ? -1 : 1;
|
|
44
|
-
}
|
|
45
|
-
return left.id.localeCompare(right.id);
|
|
46
|
-
}
|
|
47
|
-
export function mapVercelOwnerToProviderId(owner) {
|
|
48
|
-
if (!owner)
|
|
49
|
-
return '';
|
|
50
|
-
return VERCEL_OWNER_PROVIDER_MAP[owner] ?? '';
|
|
51
|
-
}
|
|
52
|
-
export function normalizeVercelModelEntry(entry, defaultModelIds = {}) {
|
|
53
|
-
const provider = mapVercelOwnerToProviderId(entry.owned_by);
|
|
54
|
-
if (!provider)
|
|
55
|
-
return null;
|
|
56
|
-
if (!entry.id || !DEFAULT_SYNCED_MODEL_TYPES.has(String(entry.type ?? 'language'))) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return {
|
|
60
|
-
id: entry.id,
|
|
61
|
-
provider,
|
|
62
|
-
displayName: entry.name || entry.id,
|
|
63
|
-
description: entry.description,
|
|
64
|
-
contextLength: typeof entry.context_window === 'number' ? entry.context_window : undefined,
|
|
65
|
-
maxOutputTokens: typeof entry.max_tokens === 'number' ? entry.max_tokens : undefined,
|
|
66
|
-
capabilities: normalizeCapabilities(entry),
|
|
67
|
-
pricing: {
|
|
68
|
-
input: toNumber(entry.pricing?.input) ?? 0,
|
|
69
|
-
output: toNumber(entry.pricing?.output) ?? 0,
|
|
70
|
-
},
|
|
71
|
-
isDefault: defaultModelIds[provider] === entry.id || undefined,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
export function mergeVercelModelsIntoDiscovery(currentModels, upstreamModels, defaultModelIds = {}) {
|
|
75
|
-
const syncedProviderIds = new Set(upstreamModels
|
|
76
|
-
.map((entry) => mapVercelOwnerToProviderId(entry.owned_by))
|
|
77
|
-
.filter(Boolean));
|
|
78
|
-
const preservedModels = currentModels.filter((model) => !syncedProviderIds.has(model.provider));
|
|
79
|
-
const normalizedModels = upstreamModels
|
|
80
|
-
.map((entry) => normalizeVercelModelEntry(entry, defaultModelIds))
|
|
81
|
-
.filter((model) => Boolean(model));
|
|
82
|
-
const deduped = new Map();
|
|
83
|
-
for (const model of [...preservedModels, ...normalizedModels]) {
|
|
84
|
-
deduped.set(`${model.provider}:${model.id}`, model);
|
|
85
|
-
}
|
|
86
|
-
return Array.from(deduped.values()).sort(compareModels);
|
|
87
|
-
}
|
|
88
|
-
export function updateDiscoveryModelRegistry(currentRegistry, upstreamCatalog, updatedAt, defaultModelIds = {}) {
|
|
89
|
-
const upstreamModels = Array.isArray(upstreamCatalog.data) ? upstreamCatalog.data : [];
|
|
90
|
-
return {
|
|
91
|
-
...currentRegistry,
|
|
92
|
-
updatedAt,
|
|
93
|
-
models: mergeVercelModelsIntoDiscovery(currentRegistry.models ?? [], upstreamModels, defaultModelIds),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './discovery/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './discovery/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { extensionSchema } from '../core.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { extensionSchema } from '../core.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { extensionSchema } from "./extension.schema.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { extensionSchema } from "./extension.schema.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './extension/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './extension/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { favoriteTable, type FavoriteRow, type FavoriteInsert, type FavoriteUpdate, } from '../core.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { favoriteTable, } from '../core.js';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { favoriteTable, type FavoriteRow, type FavoriteInsert, type FavoriteUpdate } from "./favorite.schema.js";
|
|
2
|
-
export { createStarredSyncHook, registerDbForStarredSync, chatStarredSyncHook, threadStarredSyncHook, contactStarredSyncHook, chatSnapshotExtractor, threadSnapshotExtractor, contactSnapshotExtractor, type SnapshotExtractor, type StarredSyncConfig, type SourceModule, } from "./starred-sync.js";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { favoriteTable } from "./favorite.schema.js";
|
|
2
|
-
// Starred Sync Hook
|
|
3
|
-
export { createStarredSyncHook, registerDbForStarredSync,
|
|
4
|
-
// Pre-configured hooks
|
|
5
|
-
chatStarredSyncHook, threadStarredSyncHook, contactStarredSyncHook,
|
|
6
|
-
// Extractors (for custom configuration)
|
|
7
|
-
chatSnapshotExtractor, threadSnapshotExtractor, contactSnapshotExtractor, } from "./starred-sync.js";
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Starred Sync Hook
|
|
3
|
-
*
|
|
4
|
-
* 当实体的 starred 字段变更时,自动同步到 favoriteTable:
|
|
5
|
-
* - starred: true → 创建 Favorite 记录
|
|
6
|
-
* - starred: false → 删除 Favorite 记录
|
|
7
|
-
*
|
|
8
|
-
* 支持的实体类型:Chat, Thread, Contact
|
|
9
|
-
* favoriteType 使用 RDF type URI 标识
|
|
10
|
-
*/
|
|
11
|
-
import type { TableHooks } from '@undefineds.co/drizzle-solid';
|
|
12
|
-
/** V2 来源模块类型 */
|
|
13
|
-
export type SourceModule = 'chat' | 'contacts' | 'files' | 'messages' | 'thread';
|
|
14
|
-
/** 快照数据提取器 */
|
|
15
|
-
export interface SnapshotExtractor<T = Record<string, unknown>> {
|
|
16
|
-
/** 获取收藏标题 */
|
|
17
|
-
getTitle: (record: T) => string;
|
|
18
|
-
/** 获取内容快照(可选) */
|
|
19
|
-
getContent?: (record: T) => string | undefined;
|
|
20
|
-
/** 获取作者快照(可选) */
|
|
21
|
-
getAuthor?: (record: T) => string | undefined;
|
|
22
|
-
/** V2: 获取检索文本(可选,默认用 title) */
|
|
23
|
-
getSearchText?: (record: T) => string | undefined;
|
|
24
|
-
/** V2: 获取快照元数据 JSON(可选) */
|
|
25
|
-
getSnapshotMeta?: (record: T) => string | undefined;
|
|
26
|
-
}
|
|
27
|
-
/** Starred Sync Hook 配置 */
|
|
28
|
-
export interface StarredSyncConfig<T = Record<string, unknown>> {
|
|
29
|
-
/** RDF type URI (e.g., MEETING.LongChat, SIOC.Thread, VCARD.Individual) */
|
|
30
|
-
rdfType: string;
|
|
31
|
-
/** V2: 来源模块标识 */
|
|
32
|
-
sourceModule: SourceModule;
|
|
33
|
-
/** 快照数据提取器 */
|
|
34
|
-
extractor: SnapshotExtractor<T>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* 创建 starred 同步 hook
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* const chatTable = podTable('chats', columns, {
|
|
41
|
-
* hooks: createStarredSyncHook({
|
|
42
|
-
* rdfType: MEETING.LongChat,
|
|
43
|
-
* extractor: {
|
|
44
|
-
* getTitle: (r) => r.title as string,
|
|
45
|
-
* getContent: (r) => r.lastMessagePreview as string,
|
|
46
|
-
* }
|
|
47
|
-
* })
|
|
48
|
-
* })
|
|
49
|
-
*/
|
|
50
|
-
export declare function createStarredSyncHook<T = Record<string, unknown>>(config: StarredSyncConfig<T>): TableHooks;
|
|
51
|
-
/**
|
|
52
|
-
* 注册 db 实例(应用层启动时调用)
|
|
53
|
-
*/
|
|
54
|
-
export declare function registerDbForStarredSync(db: any): void;
|
|
55
|
-
/** Chat 快照提取器 */
|
|
56
|
-
export declare const chatSnapshotExtractor: SnapshotExtractor;
|
|
57
|
-
/** Thread 快照提取器 */
|
|
58
|
-
export declare const threadSnapshotExtractor: SnapshotExtractor;
|
|
59
|
-
/** Contact 快照提取器 */
|
|
60
|
-
export declare const contactSnapshotExtractor: SnapshotExtractor;
|
|
61
|
-
/** Chat starred sync hook */
|
|
62
|
-
export declare const chatStarredSyncHook: TableHooks;
|
|
63
|
-
/** Thread starred sync hook */
|
|
64
|
-
export declare const threadStarredSyncHook: TableHooks;
|
|
65
|
-
/** Contact starred sync hook */
|
|
66
|
-
export declare const contactStarredSyncHook: TableHooks;
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { favoriteTable } from './favorite.schema.js';
|
|
2
|
-
import { MEETING, SIOC } from '../namespaces.js';
|
|
3
|
-
import { VCARD } from '@inrupt/vocab-common-rdf';
|
|
4
|
-
// ============================================================================
|
|
5
|
-
// Core Sync Logic
|
|
6
|
-
// ============================================================================
|
|
7
|
-
/**
|
|
8
|
-
* 创建 Favorite 记录
|
|
9
|
-
*/
|
|
10
|
-
async function createFavorite(_ctx, config, record) {
|
|
11
|
-
const { rdfType, sourceModule, extractor } = config;
|
|
12
|
-
const targetUri = record['@id'] || record.id;
|
|
13
|
-
const sourceId = record.id || targetUri;
|
|
14
|
-
if (!targetUri) {
|
|
15
|
-
console.warn('[StarredSync] Cannot create favorite: missing target URI');
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const title = extractor.getTitle(record);
|
|
19
|
-
const favoriteData = {
|
|
20
|
-
id: crypto.randomUUID(),
|
|
21
|
-
targetType: rdfType,
|
|
22
|
-
targetUri,
|
|
23
|
-
title,
|
|
24
|
-
snapshotContent: extractor.getContent?.(record),
|
|
25
|
-
snapshotAuthor: extractor.getAuthor?.(record),
|
|
26
|
-
// V2 fields
|
|
27
|
-
sourceModule,
|
|
28
|
-
sourceId,
|
|
29
|
-
searchText: extractor.getSearchText?.(record) ?? title,
|
|
30
|
-
snapshotMeta: extractor.getSnapshotMeta?.(record),
|
|
31
|
-
favoredAt: new Date(),
|
|
32
|
-
updatedAt: new Date(),
|
|
33
|
-
};
|
|
34
|
-
try {
|
|
35
|
-
const db = getDbInstance();
|
|
36
|
-
if (db) {
|
|
37
|
-
await db.insert(favoriteTable).values(favoriteData).execute();
|
|
38
|
-
console.log(`[StarredSync] Created favorite: ${rdfType} → ${targetUri}`);
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
console.warn('[StarredSync] No db instance registered');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
console.error('[StarredSync] Failed to create favorite:', error);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 删除 Favorite 记录(通过 targetUri 查找)
|
|
50
|
-
*/
|
|
51
|
-
async function deleteFavorite(_ctx, targetUri) {
|
|
52
|
-
if (!targetUri)
|
|
53
|
-
return;
|
|
54
|
-
try {
|
|
55
|
-
const db = getDbInstance();
|
|
56
|
-
if (db) {
|
|
57
|
-
await db.delete(favoriteTable)
|
|
58
|
-
.where({ targetUri })
|
|
59
|
-
.execute();
|
|
60
|
-
console.log(`[StarredSync] Deleted favorite: ${targetUri}`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
catch (error) {
|
|
64
|
-
console.error('[StarredSync] Failed to delete favorite:', error);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// ============================================================================
|
|
68
|
-
// Hook Factory
|
|
69
|
-
// ============================================================================
|
|
70
|
-
/**
|
|
71
|
-
* 创建 starred 同步 hook
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* const chatTable = podTable('chats', columns, {
|
|
75
|
-
* hooks: createStarredSyncHook({
|
|
76
|
-
* rdfType: MEETING.LongChat,
|
|
77
|
-
* extractor: {
|
|
78
|
-
* getTitle: (r) => r.title as string,
|
|
79
|
-
* getContent: (r) => r.lastMessagePreview as string,
|
|
80
|
-
* }
|
|
81
|
-
* })
|
|
82
|
-
* })
|
|
83
|
-
*/
|
|
84
|
-
export function createStarredSyncHook(config) {
|
|
85
|
-
return {
|
|
86
|
-
afterUpdate: async (ctx, record, changes) => {
|
|
87
|
-
// 只有当 starred 字段发生变化时才处理
|
|
88
|
-
if (!('starred' in changes))
|
|
89
|
-
return;
|
|
90
|
-
const starred = record.starred;
|
|
91
|
-
const targetUri = record['@id'] || record.id;
|
|
92
|
-
if (starred) {
|
|
93
|
-
// 标星 → 创建 Favorite
|
|
94
|
-
await createFavorite(ctx, config, record);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
// 取消标星 → 删除 Favorite
|
|
98
|
-
await deleteFavorite(ctx, targetUri);
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
// ============================================================================
|
|
104
|
-
// DB Instance Registry
|
|
105
|
-
// ============================================================================
|
|
106
|
-
let dbInstance = null;
|
|
107
|
-
/**
|
|
108
|
-
* 注册 db 实例(应用层启动时调用)
|
|
109
|
-
*/
|
|
110
|
-
export function registerDbForStarredSync(db) {
|
|
111
|
-
dbInstance = db;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* 获取 db 实例
|
|
115
|
-
*/
|
|
116
|
-
function getDbInstance() {
|
|
117
|
-
return dbInstance;
|
|
118
|
-
}
|
|
119
|
-
// ============================================================================
|
|
120
|
-
// Pre-configured Extractors
|
|
121
|
-
// ============================================================================
|
|
122
|
-
/** Chat 快照提取器 */
|
|
123
|
-
export const chatSnapshotExtractor = {
|
|
124
|
-
getTitle: (r) => r.title || '未命名对话',
|
|
125
|
-
getContent: (r) => r.lastMessagePreview,
|
|
126
|
-
};
|
|
127
|
-
/** Thread 快照提取器 */
|
|
128
|
-
export const threadSnapshotExtractor = {
|
|
129
|
-
getTitle: (r) => r.title || '未命名话题',
|
|
130
|
-
};
|
|
131
|
-
/** Contact 快照提取器 */
|
|
132
|
-
export const contactSnapshotExtractor = {
|
|
133
|
-
getTitle: (r) => r.name || r.alias || '未命名联系人',
|
|
134
|
-
getContent: (r) => r.note,
|
|
135
|
-
};
|
|
136
|
-
// ============================================================================
|
|
137
|
-
// Pre-configured Hooks (using RDF type URIs)
|
|
138
|
-
// ============================================================================
|
|
139
|
-
/** Chat starred sync hook */
|
|
140
|
-
export const chatStarredSyncHook = createStarredSyncHook({
|
|
141
|
-
rdfType: MEETING.LongChat,
|
|
142
|
-
sourceModule: 'chat',
|
|
143
|
-
extractor: chatSnapshotExtractor,
|
|
144
|
-
});
|
|
145
|
-
/** Thread starred sync hook */
|
|
146
|
-
export const threadStarredSyncHook = createStarredSyncHook({
|
|
147
|
-
rdfType: SIOC.Thread,
|
|
148
|
-
sourceModule: 'thread',
|
|
149
|
-
extractor: threadSnapshotExtractor,
|
|
150
|
-
});
|
|
151
|
-
/** Contact starred sync hook */
|
|
152
|
-
export const contactStarredSyncHook = createStarredSyncHook({
|
|
153
|
-
rdfType: VCARD.Individual,
|
|
154
|
-
sourceModule: 'contacts',
|
|
155
|
-
extractor: contactSnapshotExtractor,
|
|
156
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './favorite/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './favorite/index.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { fileTable, type FileRow, type FileInsert, type FileUpdate, } from '../core.js';
|