@undefineds.co/xpod 0.2.35 → 0.2.37
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/credential/schema/tables.js +3 -3
- package/dist/credential/schema/tables.js.map +1 -1
- package/dist/runtime/Proxy.d.ts +1 -0
- package/dist/runtime/Proxy.js +9 -0
- package/dist/runtime/Proxy.js.map +1 -1
- 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,578 +0,0 @@
|
|
|
1
|
-
# LinX 数据模型
|
|
2
|
-
|
|
3
|
-
> 基于 Solid Pod 标准的 LinX 核心数据模型定义
|
|
4
|
-
>
|
|
5
|
-
> 使用 `drizzle-solid` ORM,兼容标准 RDF 词汇表(VCARD, FOAF, SIOC, DCTerms 等)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 📋 目录
|
|
10
|
-
|
|
11
|
-
- [概述](#概述)
|
|
12
|
-
- [标准词汇表](#标准词汇表)
|
|
13
|
-
- [核心模型](#核心模型)
|
|
14
|
-
- [使用示例](#使用示例)
|
|
15
|
-
- [设计原则](#设计原则)
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## 概述
|
|
20
|
-
|
|
21
|
-
LinX 的所有数据存储在 Solid Pod 中,使用标准的 RDF 格式。本包定义了所有核心业务实体的数据模型,包括:
|
|
22
|
-
|
|
23
|
-
### 核心功能模型
|
|
24
|
-
|
|
25
|
-
1. **Profile** - 用户资料
|
|
26
|
-
2. **Contact** - 联系人管理(支持自然人和 AI)
|
|
27
|
-
3. **Chat & Message** - 聊天会话和消息
|
|
28
|
-
4. **File** - 文件管理
|
|
29
|
-
5. **Favorite** - 收藏夹
|
|
30
|
-
6. **Settings** - 用户设置
|
|
31
|
-
7. **AI Assistant** - AI 助手配置
|
|
32
|
-
|
|
33
|
-
### 其他模型
|
|
34
|
-
|
|
35
|
-
- **Session** - 会话管理
|
|
36
|
-
- **Knowledge Folder** - 知识库文件夹
|
|
37
|
-
- **Extension** - 扩展
|
|
38
|
-
- **Model Credential** - 模型凭证
|
|
39
|
-
- **Import Job** - 导入任务
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## 标准词汇表
|
|
44
|
-
|
|
45
|
-
LinX 遵循 Solid 生态的最佳实践,优先使用标准 RDF 词汇表:
|
|
46
|
-
|
|
47
|
-
### 已集成的标准词汇表
|
|
48
|
-
|
|
49
|
-
| 词汇表 | 用途 | 规范 |
|
|
50
|
-
|--------|------|------|
|
|
51
|
-
| **VCARD** | 联系人信息 | [RFC 6350](https://www.w3.org/TR/vcard-rdf/) |
|
|
52
|
-
| **FOAF** | 人和社交关系 | [FOAF Vocabulary](http://xmlns.com/foaf/spec/) |
|
|
53
|
-
| **SIOC** | 社交内容和讨论 | [SIOC Ontology](http://rdfs.org/sioc/spec/) |
|
|
54
|
-
| **DCTerms** | 元数据(创建时间、作者等) | [Dublin Core](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/) |
|
|
55
|
-
| **Schema.org** | 结构化数据 | [Schema.org](https://schema.org/) |
|
|
56
|
-
| **LDP** | Linked Data Platform | [LDP Spec](https://www.w3.org/TR/ldp/) |
|
|
57
|
-
|
|
58
|
-
### LinX 自定义词汇表
|
|
59
|
-
|
|
60
|
-
命名空间:`https://linx.ai/ns#`
|
|
61
|
-
|
|
62
|
-
用于标准词汇表未覆盖的 LinX 特有功能(如 AI 助手配置、同步状态等)。
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 核心模型
|
|
67
|
-
|
|
68
|
-
### 1. Profile(用户资料)
|
|
69
|
-
|
|
70
|
-
**文件路径**: `src/profile.ts`
|
|
71
|
-
|
|
72
|
-
**RDF 类**: `foaf:Person`
|
|
73
|
-
|
|
74
|
-
**字段**:
|
|
75
|
-
```typescript
|
|
76
|
-
{
|
|
77
|
-
displayName: string; // vcard:fn
|
|
78
|
-
nickname: string; // foaf:nick
|
|
79
|
-
avatarUrl: string; // vcard:hasPhoto
|
|
80
|
-
note: string; // vcard:note
|
|
81
|
-
region: string; // vcard:region
|
|
82
|
-
gender: string; // vcard:gender
|
|
83
|
-
favorite: string; // linx:favorite
|
|
84
|
-
inbox: string; // ldp:inbox
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
### 2. Contact(联系人)
|
|
91
|
-
|
|
92
|
-
**文件路径**: `src/contact/contact.schema.ts`
|
|
93
|
-
|
|
94
|
-
**RDF 类**: `vcard:Individual`
|
|
95
|
-
|
|
96
|
-
**支持类型**: `person`, `ai`, `organization`, `group`
|
|
97
|
-
|
|
98
|
-
**核心字段**:
|
|
99
|
-
```typescript
|
|
100
|
-
{
|
|
101
|
-
// 姓名
|
|
102
|
-
fullName: string; // vcard:fn ⭐ 必需
|
|
103
|
-
givenName: string; // vcard:givenName
|
|
104
|
-
familyName: string; // vcard:familyName
|
|
105
|
-
nickname: string; // foaf:nick
|
|
106
|
-
|
|
107
|
-
// 联系方式
|
|
108
|
-
email: string; // vcard:hasEmail
|
|
109
|
-
telephone: string; // vcard:hasTelephone
|
|
110
|
-
mobile: string;
|
|
111
|
-
|
|
112
|
-
// 地址
|
|
113
|
-
homeAddress: string; // vcard:hasAddress (JSON)
|
|
114
|
-
workAddress: string;
|
|
115
|
-
|
|
116
|
-
// 组织
|
|
117
|
-
organization: string; // vcard:organizationName
|
|
118
|
-
title: string; // vcard:title
|
|
119
|
-
|
|
120
|
-
// Solid 身份
|
|
121
|
-
webId: string; // foaf:weblog
|
|
122
|
-
|
|
123
|
-
// AI 联系人
|
|
124
|
-
aiAssistantId: string; // linx:aiAssistant
|
|
125
|
-
|
|
126
|
-
// 关系和标签
|
|
127
|
-
relationship: string; // vcard:hasRelated
|
|
128
|
-
tags: string; // dcterms:subject (JSON)
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**常量**:
|
|
133
|
-
- `CONTACT_TYPES`: `person`, `ai`, `organization`, `group`
|
|
134
|
-
- `RELATIONSHIP_TYPES`: `friend`, `family`, `colleague`, `acquaintance`, `other`
|
|
135
|
-
|
|
136
|
-
---
|
|
137
|
-
|
|
138
|
-
### 3. Chat(聊天会话)
|
|
139
|
-
|
|
140
|
-
**文件路径**: `src/chat/chat.schema.ts`
|
|
141
|
-
|
|
142
|
-
**RDF 类**: `schema:ConversationThread`
|
|
143
|
-
|
|
144
|
-
**字段**:
|
|
145
|
-
```typescript
|
|
146
|
-
{
|
|
147
|
-
title: string; // dcterms:title ⭐ 必需
|
|
148
|
-
description: string; // dcterms:description
|
|
149
|
-
conversationType: string; // linx:conversationType (direct, group, ai)
|
|
150
|
-
status: string; // linx:status (active, archived, deleted)
|
|
151
|
-
participants: array; // linx:participants (WebID 数组)
|
|
152
|
-
creator: string; // dcterms:creator
|
|
153
|
-
createdAt: timestamp; // dcterms:created
|
|
154
|
-
modifiedAt: timestamp; // dcterms:modified
|
|
155
|
-
lastMessage: string; // linx:lastMessage
|
|
156
|
-
lastMessageAt: timestamp; // linx:lastMessageAt
|
|
157
|
-
pinnedAt: timestamp; // linx:pinnedAt
|
|
158
|
-
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
### 4. Message(聊天消息)
|
|
164
|
-
|
|
165
|
-
**文件路径**: `src/chat/message.schema.ts`
|
|
166
|
-
|
|
167
|
-
**RDF 类**: `schema:Message`
|
|
168
|
-
|
|
169
|
-
**字段**:
|
|
170
|
-
```typescript
|
|
171
|
-
{
|
|
172
|
-
content: string; // sioc:content ⭐ 必需 (支持 Markdown)
|
|
173
|
-
messageType: string; // linx:messageType (text, image, file, system)
|
|
174
|
-
messageStatus: string; // linx:messageStatus (sending, sent, delivered, read, failed)
|
|
175
|
-
conversationId: string; // linx:conversation
|
|
176
|
-
replyTo: string; // sioc:replyOf
|
|
177
|
-
sender: string; // dcterms:creator (WebID)
|
|
178
|
-
senderName: string; // foaf:name
|
|
179
|
-
createdAt: timestamp; // dcterms:created
|
|
180
|
-
modifiedAt: timestamp; // dcterms:modified (编辑时间)
|
|
181
|
-
deletedAt: timestamp; // linx:deletedAt (软删除)
|
|
182
|
-
readBy: string; // linx:readBy (JSON)
|
|
183
|
-
|
|
184
|
-
// 附件(如果是文件/图片消息)
|
|
185
|
-
attachmentUri: string; // schema:about
|
|
186
|
-
attachmentName: string; // schema:name
|
|
187
|
-
attachmentSize: integer; // schema:fileSize
|
|
188
|
-
attachmentMime: string; // schema:encodingFormat
|
|
189
|
-
}
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
### 5. File(文件管理)
|
|
195
|
-
|
|
196
|
-
**文件路径**: `src/file/file.schema.ts`
|
|
197
|
-
|
|
198
|
-
**RDF 类**: `schema:MediaObject`
|
|
199
|
-
|
|
200
|
-
**字段**:
|
|
201
|
-
```typescript
|
|
202
|
-
{
|
|
203
|
-
name: string; // schema:name ⭐ 必需
|
|
204
|
-
description: string; // schema:description
|
|
205
|
-
mimeType: string; // schema:encodingFormat
|
|
206
|
-
size: integer; // schema:fileSize
|
|
207
|
-
hash: string; // linx:fileHash (SHA-256)
|
|
208
|
-
podUri: string; // dcterms:identifier (Pod 中的 URI)
|
|
209
|
-
localPath: string; // linx:localPath (本地路径)
|
|
210
|
-
syncStatus: string; // linx:syncStatus (synced, pending, conflict, error)
|
|
211
|
-
owner: string; // dcterms:creator
|
|
212
|
-
sharedWith: string; // linx:participants (JSON)
|
|
213
|
-
folder: string; // linx:conversation
|
|
214
|
-
tags: string; // dcterms:subject (JSON)
|
|
215
|
-
starred: boolean; // linx:favorite
|
|
216
|
-
createdAt: timestamp; // dcterms:created
|
|
217
|
-
modifiedAt: timestamp; // dcterms:modified
|
|
218
|
-
}
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
---
|
|
222
|
-
|
|
223
|
-
### 6. Favorite(收藏)
|
|
224
|
-
|
|
225
|
-
**文件路径**: `src/favorite/favorite.schema.ts`
|
|
226
|
-
|
|
227
|
-
**RDF 类**: `schema:CreativeWork`
|
|
228
|
-
|
|
229
|
-
**支持收藏类型**: `message`, `file`, `contact`, `link`, `note`
|
|
230
|
-
|
|
231
|
-
**字段**:
|
|
232
|
-
```typescript
|
|
233
|
-
{
|
|
234
|
-
title: string; // dcterms:title ⭐ 必需
|
|
235
|
-
description: string; // dcterms:description
|
|
236
|
-
favoriteType: string; // linx:favoriteType
|
|
237
|
-
targetUri: string; // linx:favoriteTarget ⭐ 必需
|
|
238
|
-
|
|
239
|
-
// 快照(避免查询原始资源)
|
|
240
|
-
snapshotContent: string; // schema:text
|
|
241
|
-
snapshotAuthor: string; // schema:author
|
|
242
|
-
snapshotCreatedAt: timestamp; // schema:dateCreated
|
|
243
|
-
|
|
244
|
-
owner: string; // dcterms:creator
|
|
245
|
-
folder: string; // linx:conversation
|
|
246
|
-
tags: string; // dcterms:subject (JSON)
|
|
247
|
-
favoredAt: timestamp; // linx:favoredAt
|
|
248
|
-
createdAt: timestamp; // dcterms:created
|
|
249
|
-
modifiedAt: timestamp; // dcterms:modified
|
|
250
|
-
pinnedAt: timestamp; // linx:pinnedAt
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
### 7. Settings(用户设置)
|
|
257
|
-
|
|
258
|
-
**文件路径**: `src/settings/settings.schema.ts`
|
|
259
|
-
|
|
260
|
-
**RDF 类**: `schema:PropertyValue`
|
|
261
|
-
|
|
262
|
-
**字段**:
|
|
263
|
-
```typescript
|
|
264
|
-
{
|
|
265
|
-
key: string; // linx:settingKey ⭐ 必需(唯一)
|
|
266
|
-
value: string; // linx:settingValue (JSON 字符串)
|
|
267
|
-
valueType: string; // linx:settingType (string, number, boolean, json)
|
|
268
|
-
category: string; // dcterms:type (ui, ai, sync, privacy, notifications)
|
|
269
|
-
label: string; // dcterms:title
|
|
270
|
-
description: string; // dcterms:description
|
|
271
|
-
owner: string; // dcterms:creator
|
|
272
|
-
isSensitive: boolean; // linx:status (是否加密)
|
|
273
|
-
createdAt: timestamp; // dcterms:created
|
|
274
|
-
modifiedAt: timestamp; // dcterms:modified
|
|
275
|
-
}
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
**预定义设置键** (`SETTING_KEYS`):
|
|
279
|
-
```typescript
|
|
280
|
-
// UI 设置
|
|
281
|
-
UI_THEME: "ui.theme"
|
|
282
|
-
UI_LANGUAGE: "ui.language"
|
|
283
|
-
UI_SIDEBAR_WIDTH: "ui.sidebar.width"
|
|
284
|
-
UI_LIST_PANEL_WIDTH: "ui.listPanel.width"
|
|
285
|
-
|
|
286
|
-
// AI 设置
|
|
287
|
-
AI_DEFAULT_ASSISTANT: "ai.defaultAssistant"
|
|
288
|
-
AI_AUTO_REPLY: "ai.autoReply"
|
|
289
|
-
AI_STREAMING: "ai.streaming"
|
|
290
|
-
|
|
291
|
-
// 同步设置
|
|
292
|
-
SYNC_AUTO: "sync.auto"
|
|
293
|
-
SYNC_INTERVAL: "sync.interval"
|
|
294
|
-
SYNC_WIFI_ONLY: "sync.wifiOnly"
|
|
295
|
-
|
|
296
|
-
// 隐私设置
|
|
297
|
-
PRIVACY_READ_RECEIPTS: "privacy.readReceipts"
|
|
298
|
-
PRIVACY_ONLINE_STATUS: "privacy.onlineStatus"
|
|
299
|
-
PRIVACY_TYPING_INDICATOR: "privacy.typingIndicator"
|
|
300
|
-
|
|
301
|
-
// 通知设置
|
|
302
|
-
NOTIFICATIONS_ENABLED: "notifications.enabled"
|
|
303
|
-
NOTIFICATIONS_SOUND: "notifications.sound"
|
|
304
|
-
NOTIFICATIONS_DESKTOP: "notifications.desktop"
|
|
305
|
-
|
|
306
|
-
// Pod 设置
|
|
307
|
-
POD_AUTO_CONNECT: "pod.autoConnect"
|
|
308
|
-
POD_CACHE_SIZE: "pod.cacheSize"
|
|
309
|
-
```
|
|
310
|
-
|
|
311
|
-
---
|
|
312
|
-
|
|
313
|
-
### 8. AI Assistant(AI 助手配置)
|
|
314
|
-
|
|
315
|
-
**文件路径**: `src/agent.schema.ts`
|
|
316
|
-
|
|
317
|
-
**RDF 类**: `foaf:Agent`
|
|
318
|
-
|
|
319
|
-
**字段**:
|
|
320
|
-
```typescript
|
|
321
|
-
{
|
|
322
|
-
// 基础信息
|
|
323
|
-
name: string; // foaf:name ⭐ 必需
|
|
324
|
-
nickname: string; // foaf:nick
|
|
325
|
-
description: string; // dcterms:description
|
|
326
|
-
avatarUrl: string; // foaf:depiction
|
|
327
|
-
assistantType: string; // dcterms:type (system, custom, shared)
|
|
328
|
-
|
|
329
|
-
// 模型配置
|
|
330
|
-
provider: string; // linx:aiProvider (openai, anthropic, ollama, custom)
|
|
331
|
-
modelId: string; // linx:aiModel (gpt-4, claude-3, llama2)
|
|
332
|
-
systemPrompt: string; // linx:systemPrompt
|
|
333
|
-
|
|
334
|
-
// 模型参数
|
|
335
|
-
temperature: float; // linx:temperature (0-2)
|
|
336
|
-
maxTokens: integer; // linx:maxTokens
|
|
337
|
-
topP: float;
|
|
338
|
-
frequencyPenalty: float;
|
|
339
|
-
presencePenalty: float;
|
|
340
|
-
|
|
341
|
-
// 功能配置
|
|
342
|
-
enableStreaming: boolean;
|
|
343
|
-
enableFunctionCalling: boolean;
|
|
344
|
-
allowedFunctions: string; // JSON 数组
|
|
345
|
-
|
|
346
|
-
// Pod 访问权限
|
|
347
|
-
podAccessLevel: string; // linx:status (read, write, full)
|
|
348
|
-
allowedContainers: string; // JSON 数组
|
|
349
|
-
|
|
350
|
-
// 共享
|
|
351
|
-
owner: string; // dcterms:creator
|
|
352
|
-
isPublic: boolean;
|
|
353
|
-
sharedWith: string; // JSON
|
|
354
|
-
|
|
355
|
-
// 统计
|
|
356
|
-
messageCount: integer;
|
|
357
|
-
lastUsedAt: timestamp;
|
|
358
|
-
|
|
359
|
-
status: string; // linx:status (active, disabled, archived)
|
|
360
|
-
createdAt: timestamp;
|
|
361
|
-
modifiedAt: timestamp;
|
|
362
|
-
}
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
**常量**:
|
|
366
|
-
- `AI_PROVIDERS`: `openai`, `anthropic`, `google`, `ollama`, `custom`
|
|
367
|
-
- `AI_MODELS`: 包含常见模型 ID(GPT-4, Claude-3, Gemini, Llama2 等)
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
## 使用示例
|
|
372
|
-
|
|
373
|
-
### 安装
|
|
374
|
-
|
|
375
|
-
```bash
|
|
376
|
-
yarn workspace @linq/models install
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
### 导入模型
|
|
380
|
-
|
|
381
|
-
```typescript
|
|
382
|
-
import {
|
|
383
|
-
// 词汇表
|
|
384
|
-
LINQ, SIOC, DCTerms, SCHEMA,
|
|
385
|
-
|
|
386
|
-
// 模型表
|
|
387
|
-
contactTable,
|
|
388
|
-
chatTable,
|
|
389
|
-
messageTable,
|
|
390
|
-
fileTable,
|
|
391
|
-
favoriteTable,
|
|
392
|
-
settingsTable,
|
|
393
|
-
aiAssistantTable,
|
|
394
|
-
|
|
395
|
-
// 类型
|
|
396
|
-
type ContactRow,
|
|
397
|
-
type ChatRow,
|
|
398
|
-
type MessageRow,
|
|
399
|
-
|
|
400
|
-
// 常量
|
|
401
|
-
CONTACT_TYPES,
|
|
402
|
-
SETTING_KEYS,
|
|
403
|
-
AI_PROVIDERS,
|
|
404
|
-
} from "@linq/models";
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
### 查询示例
|
|
408
|
-
|
|
409
|
-
```typescript
|
|
410
|
-
// 查询联系人
|
|
411
|
-
const contacts = await db
|
|
412
|
-
.select()
|
|
413
|
-
.from(contactTable)
|
|
414
|
-
.where(eq(contactTable.contactType, CONTACT_TYPES.PERSON));
|
|
415
|
-
|
|
416
|
-
// 创建聊天会话
|
|
417
|
-
const newChat = await db
|
|
418
|
-
.insert(chatTable)
|
|
419
|
-
.values({
|
|
420
|
-
title: "与 Alice 的对话",
|
|
421
|
-
conversationType: "direct",
|
|
422
|
-
participants: ["https://alice.solidcommunity.net/profile/card#me"],
|
|
423
|
-
creator: session.webId,
|
|
424
|
-
status: "active",
|
|
425
|
-
});
|
|
426
|
-
|
|
427
|
-
// 发送消息
|
|
428
|
-
const newMessage = await db
|
|
429
|
-
.insert(messageTable)
|
|
430
|
-
.values({
|
|
431
|
-
content: "你好,Alice!",
|
|
432
|
-
messageType: "text",
|
|
433
|
-
conversationId: chatId,
|
|
434
|
-
sender: session.webId,
|
|
435
|
-
senderName: "Bob",
|
|
436
|
-
messageStatus: "sent",
|
|
437
|
-
});
|
|
438
|
-
|
|
439
|
-
// 查询设置
|
|
440
|
-
const theme = await db
|
|
441
|
-
.select()
|
|
442
|
-
.from(settingsTable)
|
|
443
|
-
.where(eq(settingsTable.key, SETTING_KEYS.UI_THEME))
|
|
444
|
-
.limit(1);
|
|
445
|
-
|
|
446
|
-
// 创建 AI 助手
|
|
447
|
-
const assistant = await db
|
|
448
|
-
.insert(aiAssistantTable)
|
|
449
|
-
.values({
|
|
450
|
-
name: "LinX 助手",
|
|
451
|
-
provider: AI_PROVIDERS.OPENAI,
|
|
452
|
-
modelId: AI_MODELS.GPT_4,
|
|
453
|
-
systemPrompt: "你是 LinX 的智能助手...",
|
|
454
|
-
temperature: 0.7,
|
|
455
|
-
maxTokens: 2048,
|
|
456
|
-
owner: session.webId,
|
|
457
|
-
});
|
|
458
|
-
```
|
|
459
|
-
|
|
460
|
-
---
|
|
461
|
-
|
|
462
|
-
## 设计原则
|
|
463
|
-
|
|
464
|
-
### 1. 遵循 Solid 标准
|
|
465
|
-
|
|
466
|
-
- ✅ 优先使用标准 RDF 词汇表(VCARD, FOAF, SIOC, DCTerms)
|
|
467
|
-
- ✅ 仅在必要时使用自定义词汇表(`linx:` 命名空间)
|
|
468
|
-
- ✅ 所有数据存储在 Pod 的 LDP 容器中
|
|
469
|
-
- ✅ 使用标准 RDF 类(`vcard:Individual`, `schema:Message` 等)
|
|
470
|
-
|
|
471
|
-
### 2. 类型安全
|
|
472
|
-
|
|
473
|
-
- ✅ 使用 `drizzle-solid` 提供的类型推断
|
|
474
|
-
- ✅ 导出 `Row`, `Insert`, `Update` 类型
|
|
475
|
-
- ✅ 定义常量枚举(`CONTACT_TYPES`, `SETTING_KEYS` 等)
|
|
476
|
-
|
|
477
|
-
### 3. 可扩展性
|
|
478
|
-
|
|
479
|
-
- ✅ 支持软删除(`deletedAt` 字段)
|
|
480
|
-
- ✅ 支持 JSON 字段存储复杂数据(标签、数组等)
|
|
481
|
-
- ✅ 预留扩展字段(`tags`, `metadata`)
|
|
482
|
-
|
|
483
|
-
### 4. 互操作性
|
|
484
|
-
|
|
485
|
-
- ✅ 与其他 Solid 应用兼容
|
|
486
|
-
- ✅ 使用标准的 RDF 谓词
|
|
487
|
-
- ✅ 遵循 SolidOS 的数据规范
|
|
488
|
-
|
|
489
|
-
### 5. 性能优化
|
|
490
|
-
|
|
491
|
-
- ✅ 快照字段避免频繁查询(如 `Favorite.snapshotContent`)
|
|
492
|
-
- ✅ 冗余字段提升列表显示性能(如 `Message.senderName`)
|
|
493
|
-
- ✅ 索引常用查询字段
|
|
494
|
-
|
|
495
|
-
---
|
|
496
|
-
|
|
497
|
-
## 开发指南
|
|
498
|
-
|
|
499
|
-
### 添加新模型
|
|
500
|
-
|
|
501
|
-
1. 在 `src/<entity>/` 创建 `<entity>.schema.ts`
|
|
502
|
-
2. 使用 `podTable` 定义表结构
|
|
503
|
-
3. 选择合适的 RDF 类和谓词
|
|
504
|
-
4. 导出类型:`Row`, `Insert`, `Update`
|
|
505
|
-
5. 在 `src/<entity>/index.ts` 导出
|
|
506
|
-
6. 在 `src/index.ts` 添加导出
|
|
507
|
-
7. 更新本 README
|
|
508
|
-
|
|
509
|
-
### 修改现有模型
|
|
510
|
-
|
|
511
|
-
⚠️ **注意**:修改模型可能影响现有数据!
|
|
512
|
-
|
|
513
|
-
- 添加字段:安全(向后兼容)
|
|
514
|
-
- 删除字段:危险(需要数据迁移)
|
|
515
|
-
- 重命名字段:危险(需要数据迁移)
|
|
516
|
-
- 修改类型:危险(需要数据迁移)
|
|
517
|
-
|
|
518
|
-
### 测试
|
|
519
|
-
|
|
520
|
-
```bash
|
|
521
|
-
# 运行测试(待添加)
|
|
522
|
-
yarn workspace @linq/models test
|
|
523
|
-
|
|
524
|
-
# 类型检查
|
|
525
|
-
yarn workspace @linq/models typecheck
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
---
|
|
529
|
-
|
|
530
|
-
## 参考资料
|
|
531
|
-
|
|
532
|
-
### Solid 规范
|
|
533
|
-
- [Solid Protocol](https://solidproject.org/TR/protocol)
|
|
534
|
-
- [Linked Data Platform (LDP)](https://www.w3.org/TR/ldp/)
|
|
535
|
-
- [WebID Profile](https://www.w3.org/2005/Incubator/webid/spec/)
|
|
536
|
-
|
|
537
|
-
### RDF 词汇表
|
|
538
|
-
- [VCARD Ontology](https://www.w3.org/TR/vcard-rdf/)
|
|
539
|
-
- [FOAF Vocabulary](http://xmlns.com/foaf/spec/)
|
|
540
|
-
- [SIOC Ontology](http://rdfs.org/sioc/spec/)
|
|
541
|
-
- [Dublin Core Terms](https://www.dublincore.org/specifications/dublin-core/dcmi-terms/)
|
|
542
|
-
- [Schema.org](https://schema.org/)
|
|
543
|
-
|
|
544
|
-
### 工具
|
|
545
|
-
- [Drizzle ORM](https://orm.drizzle.team/)
|
|
546
|
-
- [Inrupt Solid Client](https://docs.inrupt.com/developer-tools/javascript/client-libraries/)
|
|
547
|
-
|
|
548
|
-
---
|
|
549
|
-
|
|
550
|
-
## 更新日志
|
|
551
|
-
|
|
552
|
-
| 日期 | 版本 | 更新内容 |
|
|
553
|
-
|------|------|---------|
|
|
554
|
-
| 2025-11-06 | 1.0.0 | 初始版本 - 创建所有核心模型 |
|
|
555
|
-
| | | - 扩展 namespaces.ts(SIOC, DCTerms, SCHEMA, RDF) |
|
|
556
|
-
| | | - 完善 Contact 模型(完整 VCARD 字段) |
|
|
557
|
-
| | | - 创建 Chat & Message 模型 |
|
|
558
|
-
| | | - 创建 File 模型 |
|
|
559
|
-
| | | - 创建 Favorite 模型 |
|
|
560
|
-
| | | - 创建 Settings 模型 |
|
|
561
|
-
| | | - 创建 AI Assistant 模型 |
|
|
562
|
-
| | | - 重组 index.ts 导出 |
|
|
563
|
-
|
|
564
|
-
---
|
|
565
|
-
|
|
566
|
-
## 许可证
|
|
567
|
-
|
|
568
|
-
MIT License
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { PodColumn as DrizzlePodColumn } from '@undefineds.co/drizzle-solid';
|
|
2
|
-
export type ColumnBuilderDataType = 'string' | 'integer' | 'boolean' | 'datetime' | 'json' | 'object' | 'uri' | 'array';
|
|
3
|
-
export interface PodColumnOptions {
|
|
4
|
-
primaryKey?: boolean;
|
|
5
|
-
notNull?: boolean;
|
|
6
|
-
hasDefault?: boolean;
|
|
7
|
-
default?: unknown;
|
|
8
|
-
predicate?: string;
|
|
9
|
-
inverse?: boolean;
|
|
10
|
-
isLink?: boolean;
|
|
11
|
-
linkTarget?: string;
|
|
12
|
-
baseType?: ColumnBuilderDataType;
|
|
13
|
-
}
|
|
14
|
-
export declare class ColumnBuilder<TType extends ColumnBuilderDataType, TElement extends ColumnBuilderDataType | null = null, TNotNull extends boolean = false, THasDefault extends boolean = false> {
|
|
15
|
-
readonly name: string;
|
|
16
|
-
readonly dataType: TType;
|
|
17
|
-
readonly elementType: TElement;
|
|
18
|
-
options: PodColumnOptions;
|
|
19
|
-
constructor(name: string, dataType: TType, options?: PodColumnOptions, predicate?: string, elementType?: TElement);
|
|
20
|
-
primaryKey(): ColumnBuilder<TType, TElement, true, THasDefault>;
|
|
21
|
-
notNull(): ColumnBuilder<TType, TElement, true, THasDefault>;
|
|
22
|
-
predicate(uri: unknown): ColumnBuilder<TType, TElement, TNotNull, THasDefault>;
|
|
23
|
-
default(value: unknown): ColumnBuilder<TType, TElement, TNotNull, true>;
|
|
24
|
-
defaultNow(): ColumnBuilder<TType, TElement, TNotNull, true>;
|
|
25
|
-
inverse(value?: boolean): ColumnBuilder<TType, TElement, TNotNull, THasDefault>;
|
|
26
|
-
link(target: string | unknown): ColumnBuilder<TType, TElement, TNotNull, THasDefault>;
|
|
27
|
-
array(): ColumnBuilder<'array', TType, TNotNull, THasDefault>;
|
|
28
|
-
}
|
|
29
|
-
export type PodColumnBase<TType extends ColumnBuilderDataType = ColumnBuilderDataType, TNotNull extends boolean = false, THasDefault extends boolean = false, TElement extends ColumnBuilderDataType | null = null> = DrizzlePodColumn<TType, TNotNull, THasDefault, TElement>;
|
|
30
|
-
export type PodStringColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'string', TNotNull, THasDefault, null>;
|
|
31
|
-
export type PodIntegerColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'integer', TNotNull, THasDefault, null>;
|
|
32
|
-
export type PodBooleanColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'boolean', TNotNull, THasDefault, null>;
|
|
33
|
-
export type PodDateTimeColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'datetime', TNotNull, THasDefault, null>;
|
|
34
|
-
export type PodJsonColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'json', TNotNull, THasDefault, null>;
|
|
35
|
-
export type PodObjectColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'object', TNotNull, THasDefault, null>;
|
|
36
|
-
export type PodUriColumn<TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'uri', TNotNull, THasDefault, null>;
|
|
37
|
-
export type PodArrayColumn<TElement extends ColumnBuilderDataType = ColumnBuilderDataType, TNotNull extends boolean = false, THasDefault extends boolean = false> = DrizzlePodColumn<'array', TNotNull, THasDefault, TElement>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { ColumnBuilder, ColumnBuilderDataType, PodArrayColumn, PodBooleanColumn, PodColumnBase, PodDateTimeColumn, PodIntegerColumn, PodJsonColumn, PodObjectColumn, PodStringColumn, PodUriColumn } from './columns.js';
|
|
2
|
-
export type ColumnValueType<T extends ColumnBuilderDataType> = T extends 'string' ? string : T extends 'integer' ? number : T extends 'boolean' ? boolean : T extends 'datetime' ? Date : T extends 'json' ? unknown : T extends 'object' ? Record<string, unknown> : T extends 'uri' ? string : T extends 'array' ? unknown[] : unknown;
|
|
3
|
-
type ExtractNotNull<T extends PodColumnBase> = T extends PodColumnBase<any, infer TNotNull, any, any> ? TNotNull : false;
|
|
4
|
-
type ExtractHasDefault<T extends PodColumnBase> = T extends PodColumnBase<any, any, infer THasDefault, any> ? THasDefault : false;
|
|
5
|
-
type ColumnIsRequiredForInsert<T extends PodColumnBase> = ExtractNotNull<T> extends true ? ExtractHasDefault<T> extends true ? false : true : false;
|
|
6
|
-
type ColumnAllowsNull<T extends PodColumnBase> = ExtractNotNull<T> extends true ? false : true;
|
|
7
|
-
export type InferColumnType<T extends PodColumnBase> = T extends PodArrayColumn<infer ElementType, any, any> ? ColumnValueType<ElementType>[] : ColumnValueType<T['dataType']>;
|
|
8
|
-
export type Simplify<T> = {
|
|
9
|
-
[K in keyof T]: T[K];
|
|
10
|
-
} & {};
|
|
11
|
-
export type InferTableData<TTable extends {
|
|
12
|
-
columns: Record<string, PodColumnBase<any, any, any, any>>;
|
|
13
|
-
}> = Simplify<{
|
|
14
|
-
[K in keyof TTable['columns']]: InferColumnType<TTable['columns'][K]>;
|
|
15
|
-
}>;
|
|
16
|
-
type InsertRequiredColumns<TTable extends {
|
|
17
|
-
columns: Record<string, PodColumnBase<any, any, any, any>>;
|
|
18
|
-
}> = {
|
|
19
|
-
[K in keyof TTable['columns'] as ColumnIsRequiredForInsert<TTable['columns'][K]> extends true ? K : never]: InferColumnType<TTable['columns'][K]>;
|
|
20
|
-
};
|
|
21
|
-
type InsertOptionalColumns<TTable extends {
|
|
22
|
-
columns: Record<string, PodColumnBase<any, any, any, any>>;
|
|
23
|
-
}> = {
|
|
24
|
-
[K in keyof TTable['columns'] as ColumnIsRequiredForInsert<TTable['columns'][K]> extends true ? never : K]?: InferColumnType<TTable['columns'][K]>;
|
|
25
|
-
};
|
|
26
|
-
export type InferInsertData<TTable extends {
|
|
27
|
-
columns: Record<string, PodColumnBase<any, any, any, any>>;
|
|
28
|
-
}> = Simplify<InsertRequiredColumns<TTable> & InsertOptionalColumns<TTable>>;
|
|
29
|
-
type UpdateColumnValue<T extends PodColumnBase<any, any, any, any>> = ColumnAllowsNull<T> extends true ? InferColumnType<T> | null : InferColumnType<T>;
|
|
30
|
-
export type InferUpdateData<TTable extends {
|
|
31
|
-
columns: Record<string, PodColumnBase<any, any, any, any>>;
|
|
32
|
-
}> = Simplify<{
|
|
33
|
-
[K in keyof TTable['columns']]?: UpdateColumnValue<TTable['columns'][K]>;
|
|
34
|
-
}>;
|
|
35
|
-
export type ColumnInput = PodColumnBase | ColumnBuilder<ColumnBuilderDataType, ColumnBuilderDataType | null, boolean, boolean>;
|
|
36
|
-
export type ResolveColumn<T> = T extends ColumnBuilder<'string', any, infer TNotNull, infer THasDefault> ? PodStringColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'integer', any, infer TNotNull, infer THasDefault> ? PodIntegerColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'boolean', any, infer TNotNull, infer THasDefault> ? PodBooleanColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'datetime', any, infer TNotNull, infer THasDefault> ? PodDateTimeColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'json', any, infer TNotNull, infer THasDefault> ? PodJsonColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'object', any, infer TNotNull, infer THasDefault> ? PodObjectColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'uri', any, infer TNotNull, infer THasDefault> ? PodUriColumn<TNotNull, THasDefault> : T extends ColumnBuilder<'array', infer TElement, infer TNotNull, infer THasDefault> ? PodArrayColumn<TElement extends ColumnBuilderDataType ? TElement : ColumnBuilderDataType, TNotNull, THasDefault> : T extends PodColumnBase ? T : PodColumnBase;
|
|
37
|
-
export type ResolvedColumns<T extends Record<string, ColumnInput>> = {
|
|
38
|
-
[K in keyof T]: ResolveColumn<T[K]>;
|
|
39
|
-
};
|
|
40
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface AgentModelOption {
|
|
2
|
-
id: string;
|
|
3
|
-
displayName: string;
|
|
4
|
-
}
|
|
5
|
-
export interface AgentProviderMetadata {
|
|
6
|
-
slug: string;
|
|
7
|
-
displayName: string;
|
|
8
|
-
baseUrl?: string;
|
|
9
|
-
homepage?: string;
|
|
10
|
-
logoUrl?: string;
|
|
11
|
-
models: AgentModelOption[];
|
|
12
|
-
}
|
|
13
|
-
export declare const DEFAULT_AGENT_PROVIDERS: AgentProviderMetadata[];
|