@undefineds.co/models 0.1.0
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/README.md +578 -0
- package/dist/_drizzle-solid/columns.d.ts +37 -0
- package/dist/_drizzle-solid/columns.js +1 -0
- package/dist/_drizzle-solid/pod-table.d.ts +3 -0
- package/dist/_drizzle-solid/pod-table.js +1 -0
- package/dist/_drizzle-solid/types.d.ts +40 -0
- package/dist/_drizzle-solid/types.js +1 -0
- package/dist/agent.providers.d.ts +13 -0
- package/dist/agent.providers.js +69 -0
- package/dist/agent.repository.d.ts +85 -0
- package/dist/agent.repository.js +7 -0
- package/dist/agent.schema.d.ts +1 -0
- package/dist/agent.schema.js +1 -0
- package/dist/ai-config/index.d.ts +61 -0
- package/dist/ai-config/index.js +294 -0
- package/dist/ai-config.d.ts +1 -0
- package/dist/ai-config.js +1 -0
- package/dist/ai-model.schema.d.ts +1 -0
- package/dist/ai-model.schema.js +1 -0
- package/dist/ai-provider.schema.d.ts +1 -0
- package/dist/ai-provider.schema.js +1 -0
- package/dist/approval.schema.d.ts +1 -0
- package/dist/approval.schema.js +1 -0
- package/dist/audit.schema.d.ts +1 -0
- package/dist/audit.schema.js +1 -0
- package/dist/chat.repository.d.ts +61 -0
- package/dist/chat.repository.js +8 -0
- package/dist/chat.schema.d.ts +1 -0
- package/dist/chat.schema.js +1 -0
- package/dist/chat.utils.d.ts +3 -0
- package/dist/chat.utils.js +30 -0
- package/dist/contact.repository.d.ts +85 -0
- package/dist/contact.repository.js +8 -0
- package/dist/contact.schema.d.ts +1 -0
- package/dist/contact.schema.js +1 -0
- package/dist/core/agent-provider.schema.d.ts +1 -0
- package/dist/core/agent-provider.schema.js +1 -0
- package/dist/core/agent-status.schema.d.ts +12 -0
- package/dist/core/agent-status.schema.js +18 -0
- package/dist/core/agent.schema.d.ts +72 -0
- package/dist/core/agent.schema.js +38 -0
- package/dist/core/ai-config.schema.d.ts +11 -0
- package/dist/core/ai-config.schema.js +18 -0
- package/dist/core/ai-model.schema.d.ts +15 -0
- package/dist/core/ai-model.schema.js +21 -0
- package/dist/core/ai-provider.schema.d.ts +16 -0
- package/dist/core/ai-provider.schema.js +28 -0
- package/dist/core/approval.schema.d.ts +21 -0
- package/dist/core/approval.schema.js +33 -0
- package/dist/core/audit.schema.d.ts +17 -0
- package/dist/core/audit.schema.js +29 -0
- package/dist/core/chat.schema.d.ts +36 -0
- package/dist/core/chat.schema.js +45 -0
- package/dist/core/contact.schema.d.ts +47 -0
- package/dist/core/contact.schema.js +59 -0
- package/dist/core/credential.schema.d.ts +56 -0
- package/dist/core/credential.schema.js +40 -0
- package/dist/core/extension/extension.schema.d.ts +4 -0
- package/dist/core/extension/extension.schema.js +11 -0
- package/dist/core/extension/index.d.ts +1 -0
- package/dist/core/extension/index.js +1 -0
- package/dist/core/extension.d.ts +1 -0
- package/dist/core/extension.js +1 -0
- package/dist/core/favorite/favorite.schema.d.ts +24 -0
- package/dist/core/favorite/favorite.schema.js +34 -0
- package/dist/core/favorite/index.d.ts +1 -0
- package/dist/core/favorite/index.js +1 -0
- package/dist/core/file/file.schema.d.ts +39 -0
- package/dist/core/file/file.schema.js +51 -0
- package/dist/core/file/index.d.ts +1 -0
- package/dist/core/file/index.js +1 -0
- package/dist/core/file.d.ts +1 -0
- package/dist/core/file.js +1 -0
- package/dist/core/grant.schema.d.ts +16 -0
- package/dist/core/grant.schema.js +29 -0
- package/dist/core/import/import-job.schema.d.ts +5 -0
- package/dist/core/import/import-job.schema.js +5 -0
- package/dist/core/import/index.d.ts +1 -0
- package/dist/core/import/index.js +1 -0
- package/dist/core/import.d.ts +1 -0
- package/dist/core/import.js +1 -0
- package/dist/core/inbox-notification.schema.d.ts +9 -0
- package/dist/core/inbox-notification.schema.js +16 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/core/index.js +32 -0
- package/dist/core/knowledge/index.d.ts +1 -0
- package/dist/core/knowledge/index.js +1 -0
- package/dist/core/knowledge/knowledge-folder.schema.d.ts +7 -0
- package/dist/core/knowledge/knowledge-folder.schema.js +6 -0
- package/dist/core/knowledge.d.ts +1 -0
- package/dist/core/knowledge.js +1 -0
- package/dist/core/message.schema.d.ts +33 -0
- package/dist/core/message.schema.js +49 -0
- package/dist/core/namespaces.d.ts +176 -0
- package/dist/core/namespaces.js +289 -0
- package/dist/core/profile.d.ts +16 -0
- package/dist/core/profile.js +19 -0
- package/dist/core/schema.d.ts +304 -0
- package/dist/core/schema.js +46 -0
- package/dist/core/session/index.d.ts +1 -0
- package/dist/core/session/index.js +1 -0
- package/dist/core/session/session.schema.d.ts +6 -0
- package/dist/core/session/session.schema.js +6 -0
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.js +1 -0
- package/dist/core/settings/index.d.ts +1 -0
- package/dist/core/settings/index.js +1 -0
- package/dist/core/settings/settings.schema.d.ts +49 -0
- package/dist/core/settings/settings.schema.js +63 -0
- package/dist/core/settings.d.ts +1 -0
- package/dist/core/settings.js +1 -0
- package/dist/core/thread.schema.d.ts +28 -0
- package/dist/core/thread.schema.js +36 -0
- package/dist/core/types/collaboration-blocks.d.ts +52 -0
- package/dist/core/types/collaboration-blocks.js +7 -0
- package/dist/core/types/message-block.d.ts +270 -0
- package/dist/core/types/message-block.js +125 -0
- package/dist/core/vector-store.schema.d.ts +25 -0
- package/dist/core/vector-store.schema.js +35 -0
- package/dist/core/vocab/_namespaces.d.ts +1 -0
- package/dist/core/vocab/_namespaces.js +3 -0
- package/dist/core/vocab/chat.vocab.d.ts +16 -0
- package/dist/core/vocab/chat.vocab.js +22 -0
- package/dist/core/vocab/contact.vocab.d.ts +21 -0
- package/dist/core/vocab/contact.vocab.js +22 -0
- package/dist/core/vocab/index.d.ts +6 -0
- package/dist/core/vocab/index.js +6 -0
- package/dist/core/vocab/message.vocab.d.ts +20 -0
- package/dist/core/vocab/message.vocab.js +24 -0
- package/dist/core/vocab/sidecar.vocab.d.ts +46 -0
- package/dist/core/vocab/sidecar.vocab.js +47 -0
- package/dist/core/vocab/thread.vocab.d.ts +11 -0
- package/dist/core/vocab/thread.vocab.js +14 -0
- package/dist/core/vocab/workspace.vocab.d.ts +12 -0
- package/dist/core/vocab/workspace.vocab.js +13 -0
- package/dist/core/vocab.d.ts +1 -0
- package/dist/core/vocab.js +1 -0
- package/dist/core/workspace.schema.d.ts +35 -0
- package/dist/core/workspace.schema.js +106 -0
- package/dist/core.d.ts +1 -0
- package/dist/core.js +1 -0
- package/dist/credential.schema.d.ts +1 -0
- package/dist/credential.schema.js +1 -0
- package/dist/discovery/index.d.ts +31 -0
- package/dist/discovery/index.js +147 -0
- package/dist/discovery/models.json +2623 -0
- package/dist/discovery/providers.json +156 -0
- package/dist/discovery/types.d.ts +103 -0
- package/dist/discovery/types.js +12 -0
- package/dist/discovery/vercel.d.ts +25 -0
- package/dist/discovery/vercel.js +95 -0
- package/dist/discovery.d.ts +1 -0
- package/dist/discovery.js +1 -0
- package/dist/extension/extension.schema.d.ts +1 -0
- package/dist/extension/extension.schema.js +1 -0
- package/dist/extension/index.d.ts +1 -0
- package/dist/extension/index.js +1 -0
- package/dist/extension.d.ts +1 -0
- package/dist/extension.js +1 -0
- package/dist/favorite/favorite.schema.d.ts +1 -0
- package/dist/favorite/favorite.schema.js +1 -0
- package/dist/favorite/index.d.ts +2 -0
- package/dist/favorite/index.js +7 -0
- package/dist/favorite/starred-sync.d.ts +66 -0
- package/dist/favorite/starred-sync.js +156 -0
- package/dist/favorite.d.ts +1 -0
- package/dist/favorite.js +1 -0
- package/dist/file/file.schema.d.ts +1 -0
- package/dist/file/file.schema.js +1 -0
- package/dist/file/index.d.ts +1 -0
- package/dist/file/index.js +1 -0
- package/dist/file.d.ts +1 -0
- package/dist/file.js +1 -0
- package/dist/fixtures/contracts-chat-contact.d.ts +13 -0
- package/dist/fixtures/contracts-chat-contact.js +76 -0
- package/dist/grant.schema.d.ts +1 -0
- package/dist/grant.schema.js +1 -0
- package/dist/import/import-job.schema.d.ts +5 -0
- package/dist/import/import-job.schema.js +5 -0
- package/dist/import/index.d.ts +1 -0
- package/dist/import/index.js +1 -0
- package/dist/import.d.ts +1 -0
- package/dist/import.js +1 -0
- package/dist/inbox-notification.schema.d.ts +1 -0
- package/dist/inbox-notification.schema.js +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +83 -0
- package/dist/knowledge/index.d.ts +1 -0
- package/dist/knowledge/index.js +1 -0
- package/dist/knowledge/knowledge-folder.schema.d.ts +1 -0
- package/dist/knowledge/knowledge-folder.schema.js +1 -0
- package/dist/knowledge.d.ts +1 -0
- package/dist/knowledge.js +1 -0
- package/dist/message.repository.d.ts +81 -0
- package/dist/message.repository.js +8 -0
- package/dist/message.schema.d.ts +1 -0
- package/dist/message.schema.js +1 -0
- package/dist/namespaces.d.ts +1 -0
- package/dist/namespaces.js +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/profile.js +1 -0
- package/dist/repository.d.ts +59 -0
- package/dist/repository.js +186 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +1 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/session.schema.d.ts +1 -0
- package/dist/session/session.schema.js +1 -0
- package/dist/session.d.ts +1 -0
- package/dist/session.js +1 -0
- package/dist/settings/index.d.ts +1 -0
- package/dist/settings/index.js +1 -0
- package/dist/settings/settings.schema.d.ts +1 -0
- package/dist/settings/settings.schema.js +1 -0
- package/dist/settings.d.ts +1 -0
- package/dist/settings.js +1 -0
- package/dist/sidecar/index.d.ts +2 -0
- package/dist/sidecar/index.js +2 -0
- package/dist/sidecar/persistence-mapping.d.ts +51 -0
- package/dist/sidecar/persistence-mapping.js +44 -0
- package/dist/sidecar/sidecar-events.d.ts +632 -0
- package/dist/sidecar/sidecar-events.js +133 -0
- package/dist/thread.repository.d.ts +41 -0
- package/dist/thread.repository.js +8 -0
- package/dist/thread.schema.d.ts +1 -0
- package/dist/thread.schema.js +1 -0
- package/dist/types/collaboration-blocks.d.ts +52 -0
- package/dist/types/collaboration-blocks.js +7 -0
- package/dist/types/message-block.d.ts +270 -0
- package/dist/types/message-block.js +125 -0
- package/dist/vocab/_namespaces.d.ts +1 -0
- package/dist/vocab/_namespaces.js +3 -0
- package/dist/vocab/chat.vocab.d.ts +16 -0
- package/dist/vocab/chat.vocab.js +22 -0
- package/dist/vocab/contact.vocab.d.ts +21 -0
- package/dist/vocab/contact.vocab.js +22 -0
- package/dist/vocab/index.d.ts +6 -0
- package/dist/vocab/index.js +6 -0
- package/dist/vocab/message.vocab.d.ts +20 -0
- package/dist/vocab/message.vocab.js +24 -0
- package/dist/vocab/sidecar.vocab.d.ts +46 -0
- package/dist/vocab/sidecar.vocab.js +47 -0
- package/dist/vocab/thread.vocab.d.ts +11 -0
- package/dist/vocab/thread.vocab.js +14 -0
- package/dist/vocab/workspace.vocab.d.ts +12 -0
- package/dist/vocab/workspace.vocab.js +13 -0
- package/dist/vocab.d.ts +1 -0
- package/dist/vocab.js +1 -0
- package/dist/workspace.repository.d.ts +45 -0
- package/dist/workspace.repository.js +8 -0
- package/dist/workspace.schema.d.ts +1 -0
- package/dist/workspace.schema.js +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export const DEFAULT_AGENT_PROVIDERS = [
|
|
2
|
+
{
|
|
3
|
+
slug: 'openai',
|
|
4
|
+
displayName: 'OpenAI',
|
|
5
|
+
homepage: 'https://platform.openai.com',
|
|
6
|
+
logoUrl: 'https://openai.com/favicon.ico',
|
|
7
|
+
models: [
|
|
8
|
+
{ id: 'gpt-4o-mini', displayName: 'GPT-4o mini' },
|
|
9
|
+
{ id: 'gpt-4o', displayName: 'GPT-4o' },
|
|
10
|
+
{ id: 'gpt-4o-realtime', displayName: 'GPT-4o Realtime' },
|
|
11
|
+
],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
slug: 'anthropic',
|
|
15
|
+
displayName: 'Anthropic',
|
|
16
|
+
homepage: 'https://www.anthropic.com',
|
|
17
|
+
logoUrl: 'https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/anthropic.svg',
|
|
18
|
+
models: [
|
|
19
|
+
{ id: 'claude-3-5-sonnet-latest', displayName: 'Claude 3.5 Sonnet' },
|
|
20
|
+
{ id: 'claude-3-opus', displayName: 'Claude 3 Opus' },
|
|
21
|
+
{ id: 'claude-3-haiku', displayName: 'Claude 3 Haiku' },
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
slug: 'google',
|
|
26
|
+
displayName: 'Google (Gemini)',
|
|
27
|
+
homepage: 'https://ai.google.dev',
|
|
28
|
+
logoUrl: 'https://ai.google.dev/favicon.ico',
|
|
29
|
+
models: [
|
|
30
|
+
{ id: 'gemini-1.5-flash', displayName: 'Gemini 1.5 Flash' },
|
|
31
|
+
{ id: 'gemini-1.5-pro', displayName: 'Gemini 1.5 Pro' },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
slug: 'x-ai',
|
|
36
|
+
displayName: 'xAI',
|
|
37
|
+
homepage: 'https://x.ai',
|
|
38
|
+
logoUrl: 'https://x.ai/favicon.ico',
|
|
39
|
+
models: [
|
|
40
|
+
{ id: 'grok-2', displayName: 'Grok-2' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
slug: 'deepseek',
|
|
45
|
+
displayName: 'DeepSeek',
|
|
46
|
+
homepage: 'https://www.deepseek.com',
|
|
47
|
+
logoUrl: 'https://www.deepseek.com/favicon.ico',
|
|
48
|
+
models: [
|
|
49
|
+
{ id: 'deepseek-chat', displayName: 'DeepSeek Chat' },
|
|
50
|
+
{ id: 'deepseek-coder', displayName: 'DeepSeek Coder' },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
slug: 'openrouter',
|
|
55
|
+
displayName: 'OpenRouter',
|
|
56
|
+
homepage: 'https://openrouter.ai',
|
|
57
|
+
logoUrl: 'https://openrouter.ai/favicon.ico',
|
|
58
|
+
models: [
|
|
59
|
+
{ id: 'openai/gpt-4o-mini', displayName: 'GPT-4o mini' },
|
|
60
|
+
{ id: 'openai/gpt-4o', displayName: 'GPT-4o' },
|
|
61
|
+
{ id: 'anthropic/claude-3.5-sonnet', displayName: 'Claude 3.5 Sonnet' },
|
|
62
|
+
{ id: 'anthropic/claude-3-haiku', displayName: 'Claude 3 Haiku' },
|
|
63
|
+
{ id: 'google/gemini-flash-1.5', displayName: 'Gemini 1.5 Flash' },
|
|
64
|
+
{ id: 'deepseek/deepseek-chat', displayName: 'DeepSeek Chat' },
|
|
65
|
+
{ id: 'meta-llama/llama-3.1-8b-instruct', displayName: 'Llama 3.1 8B' },
|
|
66
|
+
{ id: 'qwen/qwen-2.5-72b-instruct', displayName: 'Qwen 2.5 72B' },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
export declare const agentRepository: import("./repository.js").PodRepositoryDescriptor<import("@undefineds.co/models/_drizzle-solid/pod-table").PodTableWithColumns<import("@undefineds.co/models/_drizzle-solid/types").ResolvedColumns<{
|
|
2
|
+
id: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, true, false>;
|
|
3
|
+
name: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
|
|
4
|
+
description: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
|
|
5
|
+
avatarUrl: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
6
|
+
instructions: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
|
|
7
|
+
provider: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
8
|
+
runtimeKind: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
|
|
9
|
+
credential: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
10
|
+
model: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
11
|
+
enabled: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, true>;
|
|
12
|
+
temperature: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"integer", null, false, true>;
|
|
13
|
+
tools: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"array", "string", false, false>;
|
|
14
|
+
contextRound: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"integer", null, false, true>;
|
|
15
|
+
maxTurns: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"integer", null, false, false>;
|
|
16
|
+
timeout: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"integer", null, false, false>;
|
|
17
|
+
ttsModel: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
18
|
+
videoModel: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
19
|
+
createdAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
|
|
20
|
+
updatedAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
|
|
21
|
+
deletedAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, false, false>;
|
|
22
|
+
}>>, {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
avatarUrl: string;
|
|
27
|
+
instructions: string;
|
|
28
|
+
provider: string;
|
|
29
|
+
runtimeKind: string;
|
|
30
|
+
credential: string;
|
|
31
|
+
model: string;
|
|
32
|
+
enabled: string;
|
|
33
|
+
temperature: number;
|
|
34
|
+
tools: string[];
|
|
35
|
+
contextRound: number;
|
|
36
|
+
maxTurns: number;
|
|
37
|
+
timeout: number;
|
|
38
|
+
ttsModel: string;
|
|
39
|
+
videoModel: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
deletedAt: Date;
|
|
43
|
+
}, {
|
|
44
|
+
id: string;
|
|
45
|
+
name?: string | undefined;
|
|
46
|
+
description?: string | undefined;
|
|
47
|
+
avatarUrl?: string | undefined;
|
|
48
|
+
instructions?: string | undefined;
|
|
49
|
+
provider?: string | undefined;
|
|
50
|
+
runtimeKind?: string | undefined;
|
|
51
|
+
credential?: string | undefined;
|
|
52
|
+
model?: string | undefined;
|
|
53
|
+
enabled?: string | undefined;
|
|
54
|
+
temperature?: number | undefined;
|
|
55
|
+
tools?: string[] | undefined;
|
|
56
|
+
contextRound?: number | undefined;
|
|
57
|
+
maxTurns?: number | undefined;
|
|
58
|
+
timeout?: number | undefined;
|
|
59
|
+
ttsModel?: string | undefined;
|
|
60
|
+
videoModel?: string | undefined;
|
|
61
|
+
createdAt?: Date | undefined;
|
|
62
|
+
updatedAt?: Date | undefined;
|
|
63
|
+
deletedAt?: Date | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
id?: string | undefined;
|
|
66
|
+
name?: string | null | undefined;
|
|
67
|
+
description?: string | null | undefined;
|
|
68
|
+
avatarUrl?: string | null | undefined;
|
|
69
|
+
instructions?: string | null | undefined;
|
|
70
|
+
provider?: string | null | undefined;
|
|
71
|
+
runtimeKind?: string | null | undefined;
|
|
72
|
+
credential?: string | null | undefined;
|
|
73
|
+
model?: string | null | undefined;
|
|
74
|
+
enabled?: string | null | undefined;
|
|
75
|
+
temperature?: number | null | undefined;
|
|
76
|
+
tools?: string[] | null | undefined;
|
|
77
|
+
contextRound?: number | null | undefined;
|
|
78
|
+
maxTurns?: number | null | undefined;
|
|
79
|
+
timeout?: number | null | undefined;
|
|
80
|
+
ttsModel?: string | null | undefined;
|
|
81
|
+
videoModel?: string | null | undefined;
|
|
82
|
+
createdAt?: Date | undefined;
|
|
83
|
+
updatedAt?: Date | undefined;
|
|
84
|
+
deletedAt?: Date | null | undefined;
|
|
85
|
+
}, Record<string, unknown>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { definePodRepository } from './repository.js';
|
|
2
|
+
import { agentTable } from './agent.schema.js';
|
|
3
|
+
export const agentRepository = definePodRepository({
|
|
4
|
+
namespace: 'agent',
|
|
5
|
+
table: agentTable,
|
|
6
|
+
searchableFields: ['name', 'description', 'instructions'],
|
|
7
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAgentSchema, agentSchema, agentTable, type AgentRow, type AgentInsert, type AgentUpdate, type CreateAgentSchemaOptions, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAgentSchema, agentSchema, agentTable, } from './core.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { AIModelInsert, AIModelRow } from '../ai-model.schema.js';
|
|
2
|
+
import type { AIProviderInsert, AIProviderRow } from '../ai-provider.schema.js';
|
|
3
|
+
import type { CredentialInsert, CredentialRow } from '../credential.schema.js';
|
|
4
|
+
export interface AIConfigProviderCatalogEntry {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
defaultBaseUrl?: string;
|
|
8
|
+
defaultModels?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface AIConfigModel {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
capabilities: string[];
|
|
15
|
+
isCustom?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface AIConfigProviderState {
|
|
18
|
+
id: string;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
apiKey?: string;
|
|
21
|
+
baseUrl?: string;
|
|
22
|
+
models: AIConfigModel[];
|
|
23
|
+
selectedModelId?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AIConfigUpdate {
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
apiKey?: string;
|
|
28
|
+
baseUrl?: string;
|
|
29
|
+
models?: AIConfigModel[];
|
|
30
|
+
}
|
|
31
|
+
export interface BuildAIConfigProviderStateMapOptions {
|
|
32
|
+
catalog?: readonly AIConfigProviderCatalogEntry[];
|
|
33
|
+
providerRows: Array<Partial<AIProviderRow> & Record<string, unknown>>;
|
|
34
|
+
credentialRows: Array<Partial<CredentialRow> & Record<string, unknown>>;
|
|
35
|
+
modelRows: Array<Partial<AIModelRow> & Record<string, unknown>>;
|
|
36
|
+
fallbackToCatalogModels?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface AIConfigMutationPlan {
|
|
39
|
+
providerId: string;
|
|
40
|
+
providerPayload?: AIProviderInsert;
|
|
41
|
+
credentialPayload?: CredentialInsert;
|
|
42
|
+
modelUpserts: AIModelInsert[];
|
|
43
|
+
modelDeleteIds: string[];
|
|
44
|
+
}
|
|
45
|
+
export declare function getAIConfigProviderCatalog(): readonly AIConfigProviderCatalogEntry[];
|
|
46
|
+
export declare function getAIConfigProviderMetadata(providerId: string): AIConfigProviderCatalogEntry;
|
|
47
|
+
export declare function extractAIConfigResourceId(raw?: string | null): string;
|
|
48
|
+
export declare function extractAIConfigProviderId(raw?: string | null): string;
|
|
49
|
+
export declare function sameAIConfigProviderId(left?: string | null, right?: string | null): boolean;
|
|
50
|
+
export declare function getAIConfigDefaultBaseUrl(providerId: string): string | undefined;
|
|
51
|
+
export declare function getDefaultAIConfigCredentialId(providerId: string): string;
|
|
52
|
+
export declare function aiConfigProviderUri(providerId: string): string;
|
|
53
|
+
export declare function aiConfigModelUri(modelId: string): string;
|
|
54
|
+
export declare function buildAIConfigProviderStateMap(options: BuildAIConfigProviderStateMapOptions): Record<string, AIConfigProviderState>;
|
|
55
|
+
export declare function buildAIConfigMutationPlan(input: {
|
|
56
|
+
providerId: string;
|
|
57
|
+
currentProviderRows: Array<Partial<AIProviderRow> & Record<string, unknown>>;
|
|
58
|
+
currentCredentialRows: Array<Partial<CredentialRow> & Record<string, unknown>>;
|
|
59
|
+
currentModelRows: Array<Partial<AIModelRow> & Record<string, unknown>>;
|
|
60
|
+
updates: AIConfigUpdate;
|
|
61
|
+
}): AIConfigMutationPlan;
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
const AI_CONFIG_PROVIDER_CATALOG = [
|
|
2
|
+
{
|
|
3
|
+
id: 'openai',
|
|
4
|
+
displayName: 'OpenAI',
|
|
5
|
+
defaultBaseUrl: 'https://api.openai.com/v1',
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
id: 'anthropic',
|
|
9
|
+
displayName: 'Anthropic',
|
|
10
|
+
defaultBaseUrl: 'https://api.anthropic.com/v1',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'google',
|
|
14
|
+
displayName: 'Google',
|
|
15
|
+
defaultBaseUrl: 'https://generativelanguage.googleapis.com/v1beta',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'deepseek',
|
|
19
|
+
displayName: 'DeepSeek',
|
|
20
|
+
defaultBaseUrl: 'https://api.deepseek.com/v1',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'ollama',
|
|
24
|
+
displayName: 'Ollama',
|
|
25
|
+
defaultBaseUrl: 'http://localhost:11434/v1',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'x-ai',
|
|
29
|
+
displayName: 'xAI',
|
|
30
|
+
defaultBaseUrl: 'https://api.x.ai/v1',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'openrouter',
|
|
34
|
+
displayName: 'OpenRouter',
|
|
35
|
+
defaultBaseUrl: 'https://openrouter.ai/api/v1',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 'minimax',
|
|
39
|
+
displayName: 'MiniMax',
|
|
40
|
+
defaultBaseUrl: 'https://api.minimax.chat/v1',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: 'mistral',
|
|
44
|
+
displayName: 'Mistral',
|
|
45
|
+
defaultBaseUrl: 'https://api.mistral.ai/v1',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'groq',
|
|
49
|
+
displayName: 'Groq',
|
|
50
|
+
defaultBaseUrl: 'https://api.groq.com/openai/v1',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 'moonshot',
|
|
54
|
+
displayName: 'Moonshot',
|
|
55
|
+
defaultBaseUrl: 'https://api.moonshot.cn/v1',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'zhipu',
|
|
59
|
+
displayName: 'ZhiPu',
|
|
60
|
+
defaultBaseUrl: 'https://open.bigmodel.cn/api/paas/v4',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'codebuddy',
|
|
64
|
+
displayName: 'CodeBuddy',
|
|
65
|
+
defaultBaseUrl: 'https://api.codebuddy.ai/v1',
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
const AI_CONFIG_PROVIDER_MAP = new Map(AI_CONFIG_PROVIDER_CATALOG.map((entry) => [entry.id, entry]));
|
|
69
|
+
function normalizeText(value) {
|
|
70
|
+
return value.trim().toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
function titleizeProviderId(id) {
|
|
73
|
+
return id
|
|
74
|
+
.split(/[-_]/)
|
|
75
|
+
.filter(Boolean)
|
|
76
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
77
|
+
.join(' ');
|
|
78
|
+
}
|
|
79
|
+
function resolveCatalogEntry(id, catalog) {
|
|
80
|
+
return catalog.find((entry) => entry.id === id);
|
|
81
|
+
}
|
|
82
|
+
function collectKnownProviderIds(catalog) {
|
|
83
|
+
const ids = new Set();
|
|
84
|
+
for (const entry of catalog) {
|
|
85
|
+
ids.add(entry.id);
|
|
86
|
+
}
|
|
87
|
+
return ids;
|
|
88
|
+
}
|
|
89
|
+
function preferredSelectedModelId(models) {
|
|
90
|
+
return models.find((model) => model.enabled)?.id ?? models[0]?.id;
|
|
91
|
+
}
|
|
92
|
+
function existingDate(value) {
|
|
93
|
+
return value instanceof Date ? value : undefined;
|
|
94
|
+
}
|
|
95
|
+
export function getAIConfigProviderCatalog() {
|
|
96
|
+
return AI_CONFIG_PROVIDER_CATALOG;
|
|
97
|
+
}
|
|
98
|
+
export function getAIConfigProviderMetadata(providerId) {
|
|
99
|
+
const canonicalId = extractAIConfigProviderId(providerId);
|
|
100
|
+
return AI_CONFIG_PROVIDER_MAP.get(canonicalId) ?? {
|
|
101
|
+
id: canonicalId,
|
|
102
|
+
displayName: titleizeProviderId(canonicalId),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export function extractAIConfigResourceId(raw) {
|
|
106
|
+
if (!raw)
|
|
107
|
+
return '';
|
|
108
|
+
if (raw.includes('#'))
|
|
109
|
+
return raw.split('#').pop() || raw;
|
|
110
|
+
const clean = raw.replace(/\/$/, '');
|
|
111
|
+
const tail = clean.split('/').pop() || clean;
|
|
112
|
+
return tail.endsWith('.ttl') ? tail.slice(0, -4) : tail;
|
|
113
|
+
}
|
|
114
|
+
export function extractAIConfigProviderId(raw) {
|
|
115
|
+
return normalizeText(extractAIConfigResourceId(raw));
|
|
116
|
+
}
|
|
117
|
+
export function sameAIConfigProviderId(left, right) {
|
|
118
|
+
const normalizedLeft = extractAIConfigProviderId(left);
|
|
119
|
+
const normalizedRight = extractAIConfigProviderId(right);
|
|
120
|
+
return Boolean(normalizedLeft) && normalizedLeft === normalizedRight;
|
|
121
|
+
}
|
|
122
|
+
export function getAIConfigDefaultBaseUrl(providerId) {
|
|
123
|
+
return getAIConfigProviderMetadata(providerId).defaultBaseUrl;
|
|
124
|
+
}
|
|
125
|
+
export function getDefaultAIConfigCredentialId(providerId) {
|
|
126
|
+
return `${extractAIConfigProviderId(providerId)}-default`;
|
|
127
|
+
}
|
|
128
|
+
export function aiConfigProviderUri(providerId) {
|
|
129
|
+
return `/settings/ai/providers.ttl#${extractAIConfigProviderId(providerId)}`;
|
|
130
|
+
}
|
|
131
|
+
export function aiConfigModelUri(modelId) {
|
|
132
|
+
return `/settings/ai/models.ttl#${extractAIConfigResourceId(modelId)}`;
|
|
133
|
+
}
|
|
134
|
+
export function buildAIConfigProviderStateMap(options) {
|
|
135
|
+
const catalog = options.catalog ?? AI_CONFIG_PROVIDER_CATALOG;
|
|
136
|
+
const fallbackToCatalogModels = options.fallbackToCatalogModels ?? true;
|
|
137
|
+
const states = {};
|
|
138
|
+
const knownIds = collectKnownProviderIds(catalog);
|
|
139
|
+
const providerMap = new Map();
|
|
140
|
+
for (const row of options.providerRows) {
|
|
141
|
+
const providerId = typeof row.id === 'string' ? row.id : '';
|
|
142
|
+
if (!providerId)
|
|
143
|
+
continue;
|
|
144
|
+
const previous = providerMap.get(providerId) ?? {};
|
|
145
|
+
providerMap.set(providerId, { ...previous, ...row });
|
|
146
|
+
}
|
|
147
|
+
const credentialMap = new Map();
|
|
148
|
+
for (const row of options.credentialRows) {
|
|
149
|
+
const providerId = extractAIConfigProviderId(typeof row.provider === 'string' ? row.provider : '');
|
|
150
|
+
if (!providerId)
|
|
151
|
+
continue;
|
|
152
|
+
const previous = credentialMap.get(providerId) ?? {};
|
|
153
|
+
credentialMap.set(providerId, { ...previous, ...row });
|
|
154
|
+
}
|
|
155
|
+
const modelMap = new Map();
|
|
156
|
+
for (const row of options.modelRows) {
|
|
157
|
+
const providerId = extractAIConfigProviderId(typeof row.isProvidedBy === 'string' ? row.isProvidedBy : '');
|
|
158
|
+
if (!providerId)
|
|
159
|
+
continue;
|
|
160
|
+
const modelId = typeof row.id === 'string' ? row.id : '';
|
|
161
|
+
if (!modelId)
|
|
162
|
+
continue;
|
|
163
|
+
const list = modelMap.get(providerId) ?? [];
|
|
164
|
+
list.push({
|
|
165
|
+
id: modelId,
|
|
166
|
+
name: typeof row.displayName === 'string' && row.displayName.trim() ? row.displayName : modelId,
|
|
167
|
+
enabled: (typeof row.status === 'string' ? row.status : 'active') !== 'inactive',
|
|
168
|
+
capabilities: [],
|
|
169
|
+
isCustom: !(resolveCatalogEntry(providerId, catalog)?.defaultModels ?? []).includes(modelId),
|
|
170
|
+
});
|
|
171
|
+
modelMap.set(providerId, list);
|
|
172
|
+
}
|
|
173
|
+
const providerIds = new Set();
|
|
174
|
+
for (const entry of catalog)
|
|
175
|
+
providerIds.add(entry.id);
|
|
176
|
+
for (const providerId of providerMap.keys())
|
|
177
|
+
providerIds.add(providerId);
|
|
178
|
+
for (const providerId of credentialMap.keys())
|
|
179
|
+
providerIds.add(providerId);
|
|
180
|
+
for (const providerId of modelMap.keys())
|
|
181
|
+
providerIds.add(providerId);
|
|
182
|
+
for (const providerId of providerIds) {
|
|
183
|
+
if (!knownIds.has(providerId) && !providerMap.has(providerId) && !credentialMap.has(providerId) && !modelMap.has(providerId)) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const metadata = resolveCatalogEntry(providerId, catalog) ?? getAIConfigProviderMetadata(providerId);
|
|
187
|
+
const providerRow = providerMap.get(providerId);
|
|
188
|
+
const credentialRow = credentialMap.get(providerId);
|
|
189
|
+
const persistedModels = modelMap.get(providerId) ?? [];
|
|
190
|
+
const models = persistedModels.length > 0 || !fallbackToCatalogModels
|
|
191
|
+
? persistedModels
|
|
192
|
+
: (metadata.defaultModels ?? []).map((modelId) => ({
|
|
193
|
+
id: modelId,
|
|
194
|
+
name: modelId,
|
|
195
|
+
enabled: true,
|
|
196
|
+
capabilities: [],
|
|
197
|
+
}));
|
|
198
|
+
const selectedModelId = extractAIConfigResourceId(typeof providerRow?.hasModel === 'string' ? providerRow.hasModel : '') || preferredSelectedModelId(models);
|
|
199
|
+
states[providerId] = {
|
|
200
|
+
id: providerId,
|
|
201
|
+
enabled: (typeof credentialRow?.status === 'string' ? credentialRow.status : 'inactive') === 'active',
|
|
202
|
+
apiKey: typeof credentialRow?.apiKey === 'string' ? credentialRow.apiKey : undefined,
|
|
203
|
+
baseUrl: (typeof credentialRow?.baseUrl === 'string' && credentialRow.baseUrl) ||
|
|
204
|
+
(typeof providerRow?.baseUrl === 'string' && providerRow.baseUrl) ||
|
|
205
|
+
metadata.defaultBaseUrl,
|
|
206
|
+
models,
|
|
207
|
+
selectedModelId: selectedModelId || undefined,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
return states;
|
|
211
|
+
}
|
|
212
|
+
export function buildAIConfigMutationPlan(input) {
|
|
213
|
+
const providerId = extractAIConfigProviderId(input.providerId);
|
|
214
|
+
const metadata = getAIConfigProviderMetadata(providerId);
|
|
215
|
+
const existingProvider = input.currentProviderRows.find((row) => row.id === providerId);
|
|
216
|
+
const existingCredential = input.currentCredentialRows.find((row) => sameAIConfigProviderId(typeof row.provider === 'string' ? row.provider : '', providerId));
|
|
217
|
+
const existingModels = input.currentModelRows.filter((row) => sameAIConfigProviderId(typeof row.isProvidedBy === 'string' ? row.isProvidedBy : '', providerId));
|
|
218
|
+
const hasConfigUpdate = input.updates.enabled !== undefined || input.updates.apiKey !== undefined || input.updates.baseUrl !== undefined;
|
|
219
|
+
let providerPayload;
|
|
220
|
+
let credentialPayload;
|
|
221
|
+
const modelUpserts = [];
|
|
222
|
+
const modelDeleteIds = [];
|
|
223
|
+
if (hasConfigUpdate || input.updates.models !== undefined) {
|
|
224
|
+
const selectedModelId = input.updates.models
|
|
225
|
+
? preferredSelectedModelId(input.updates.models)
|
|
226
|
+
: extractAIConfigResourceId(typeof existingProvider?.hasModel === 'string' ? existingProvider.hasModel : '');
|
|
227
|
+
providerPayload = {
|
|
228
|
+
id: providerId,
|
|
229
|
+
baseUrl: input.updates.baseUrl ??
|
|
230
|
+
(typeof existingProvider?.baseUrl === 'string' ? existingProvider.baseUrl : undefined) ??
|
|
231
|
+
metadata.defaultBaseUrl,
|
|
232
|
+
proxyUrl: typeof existingProvider?.proxyUrl === 'string' ? existingProvider.proxyUrl : undefined,
|
|
233
|
+
hasModel: selectedModelId ? aiConfigModelUri(selectedModelId) : undefined,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
if (hasConfigUpdate) {
|
|
237
|
+
credentialPayload = {
|
|
238
|
+
id: (typeof existingCredential?.id === 'string' ? existingCredential.id : '') ||
|
|
239
|
+
getDefaultAIConfigCredentialId(providerId),
|
|
240
|
+
provider: aiConfigProviderUri(providerId),
|
|
241
|
+
service: typeof existingCredential?.service === 'string' && existingCredential.service ? existingCredential.service : 'ai',
|
|
242
|
+
status: input.updates.enabled !== undefined
|
|
243
|
+
? input.updates.enabled
|
|
244
|
+
? 'active'
|
|
245
|
+
: 'inactive'
|
|
246
|
+
: typeof existingCredential?.status === 'string' && existingCredential.status
|
|
247
|
+
? existingCredential.status
|
|
248
|
+
: 'active',
|
|
249
|
+
apiKey: input.updates.apiKey ??
|
|
250
|
+
(typeof existingCredential?.apiKey === 'string' ? existingCredential.apiKey : undefined),
|
|
251
|
+
baseUrl: input.updates.baseUrl ??
|
|
252
|
+
(typeof existingCredential?.baseUrl === 'string' ? existingCredential.baseUrl : undefined),
|
|
253
|
+
label: typeof existingCredential?.label === 'string' && existingCredential.label
|
|
254
|
+
? existingCredential.label
|
|
255
|
+
: `${metadata.displayName} Key`,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
if (input.updates.models !== undefined) {
|
|
259
|
+
const existingById = new Map(existingModels.map((row) => [
|
|
260
|
+
typeof row.id === 'string' ? row.id : '',
|
|
261
|
+
row,
|
|
262
|
+
]));
|
|
263
|
+
const nextIds = new Set();
|
|
264
|
+
for (const model of input.updates.models) {
|
|
265
|
+
const modelId = extractAIConfigResourceId(model.id);
|
|
266
|
+
if (!modelId)
|
|
267
|
+
continue;
|
|
268
|
+
nextIds.add(modelId);
|
|
269
|
+
const existing = existingById.get(modelId);
|
|
270
|
+
const now = new Date();
|
|
271
|
+
modelUpserts.push({
|
|
272
|
+
id: modelId,
|
|
273
|
+
displayName: model.name || modelId,
|
|
274
|
+
modelType: 'chat',
|
|
275
|
+
isProvidedBy: aiConfigProviderUri(providerId),
|
|
276
|
+
status: model.enabled ? 'active' : 'inactive',
|
|
277
|
+
createdAt: existingDate(existing?.createdAt) ?? now,
|
|
278
|
+
updatedAt: now,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
for (const modelId of existingById.keys()) {
|
|
282
|
+
if (!nextIds.has(modelId)) {
|
|
283
|
+
modelDeleteIds.push(modelId);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
providerId,
|
|
289
|
+
providerPayload,
|
|
290
|
+
credentialPayload,
|
|
291
|
+
modelUpserts,
|
|
292
|
+
modelDeleteIds,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai-config/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ai-config/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { aiModelTable, type AIModelRow, type AIModelInsert, type AIModelUpdate, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { aiModelTable, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { aiProviderTable, aiProviderRelations, type AIProviderRow, type AIProviderInsert, type AIProviderUpdate, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { aiProviderTable, aiProviderRelations, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { approvalTable, type ApprovalRow, type ApprovalInsert, type ApprovalUpdate, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { approvalTable, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { auditTable, type AuditRow, type AuditInsert, type AuditUpdate, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { auditTable, } from './core.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare const chatRepository: import("./repository.js").PodRepositoryDescriptor<import("@undefineds.co/models/_drizzle-solid/pod-table").PodTableWithColumns<import("@undefineds.co/models/_drizzle-solid/types").ResolvedColumns<{
|
|
2
|
+
id: import("@undefineds.co/models/_drizzle-solid/columns").PodStringColumn<false, false>;
|
|
3
|
+
title: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, true, false>;
|
|
4
|
+
description: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
|
|
5
|
+
avatarUrl: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
6
|
+
starred: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"boolean", null, false, true>;
|
|
7
|
+
muted: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"boolean", null, false, true>;
|
|
8
|
+
unreadCount: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"integer", null, false, true>;
|
|
9
|
+
participants: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"array", "uri", false, false>;
|
|
10
|
+
metadata: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"object", null, false, false>;
|
|
11
|
+
lastActiveAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, false, false>;
|
|
12
|
+
lastMessageId: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
|
|
13
|
+
lastMessagePreview: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
|
|
14
|
+
createdAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
|
|
15
|
+
updatedAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
|
|
16
|
+
}>>, {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
avatarUrl: string;
|
|
21
|
+
starred: boolean;
|
|
22
|
+
muted: boolean;
|
|
23
|
+
unreadCount: number;
|
|
24
|
+
participants: string[];
|
|
25
|
+
metadata: Record<string, unknown>;
|
|
26
|
+
lastActiveAt: Date;
|
|
27
|
+
lastMessageId: string;
|
|
28
|
+
lastMessagePreview: string;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
31
|
+
}, {
|
|
32
|
+
title: string;
|
|
33
|
+
id?: string | undefined;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
avatarUrl?: string | undefined;
|
|
36
|
+
starred?: boolean | undefined;
|
|
37
|
+
muted?: boolean | undefined;
|
|
38
|
+
unreadCount?: number | undefined;
|
|
39
|
+
participants?: string[] | undefined;
|
|
40
|
+
metadata?: Record<string, unknown> | undefined;
|
|
41
|
+
lastActiveAt?: Date | undefined;
|
|
42
|
+
lastMessageId?: string | undefined;
|
|
43
|
+
lastMessagePreview?: string | undefined;
|
|
44
|
+
createdAt?: Date | undefined;
|
|
45
|
+
updatedAt?: Date | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
id?: string | null | undefined;
|
|
48
|
+
title?: string | undefined;
|
|
49
|
+
description?: string | null | undefined;
|
|
50
|
+
avatarUrl?: string | null | undefined;
|
|
51
|
+
starred?: boolean | null | undefined;
|
|
52
|
+
muted?: boolean | null | undefined;
|
|
53
|
+
unreadCount?: number | null | undefined;
|
|
54
|
+
participants?: string[] | null | undefined;
|
|
55
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
56
|
+
lastActiveAt?: Date | null | undefined;
|
|
57
|
+
lastMessageId?: string | null | undefined;
|
|
58
|
+
lastMessagePreview?: string | null | undefined;
|
|
59
|
+
createdAt?: Date | undefined;
|
|
60
|
+
updatedAt?: Date | undefined;
|
|
61
|
+
}, Record<string, unknown>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { definePodRepository } from './repository.js';
|
|
2
|
+
import { chatTable } from './chat.schema.js';
|
|
3
|
+
export const chatRepository = definePodRepository({
|
|
4
|
+
namespace: 'chat',
|
|
5
|
+
table: chatTable,
|
|
6
|
+
searchableFields: ['title', 'description'],
|
|
7
|
+
defaultSort: { field: 'lastActiveAt', direction: 'desc' },
|
|
8
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { chatTable, type ChatMetadata, type ChatMemberRole, type ChatRow, type ChatInsert, type ChatUpdate, } from './core.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { chatTable, } from './core.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const resolveRowId: (row?: Partial<Record<string, unknown>> | null) => string | null;
|
|
2
|
+
export declare const ensureRowId: (row?: Partial<Record<string, unknown>> | null, fallback?: string) => string;
|
|
3
|
+
export declare const toTimestamp: (value: unknown, fallback?: number) => number;
|