@contractspec/module.ai-chat 0.0.0-canary-20260113170453
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/ai-chat.feature.d.ts +12 -0
- package/dist/ai-chat.feature.d.ts.map +1 -0
- package/dist/ai-chat.feature.js +102 -0
- package/dist/ai-chat.feature.js.map +1 -0
- package/dist/ai-chat.operations.d.ts +243 -0
- package/dist/ai-chat.operations.d.ts.map +1 -0
- package/dist/ai-chat.operations.js +172 -0
- package/dist/ai-chat.operations.js.map +1 -0
- package/dist/context/context-builder.d.ts +57 -0
- package/dist/context/context-builder.d.ts.map +1 -0
- package/dist/context/context-builder.js +148 -0
- package/dist/context/context-builder.js.map +1 -0
- package/dist/context/file-operations.d.ts +100 -0
- package/dist/context/file-operations.d.ts.map +1 -0
- package/dist/context/file-operations.js +175 -0
- package/dist/context/file-operations.js.map +1 -0
- package/dist/context/index.d.ts +4 -0
- package/dist/context/index.js +5 -0
- package/dist/context/workspace-context.d.ts +117 -0
- package/dist/context/workspace-context.d.ts.map +1 -0
- package/dist/context/workspace-context.js +124 -0
- package/dist/context/workspace-context.js.map +1 -0
- package/dist/core/chat-service.d.ts +73 -0
- package/dist/core/chat-service.d.ts.map +1 -0
- package/dist/core/chat-service.js +227 -0
- package/dist/core/chat-service.js.map +1 -0
- package/dist/core/conversation-store.d.ts +74 -0
- package/dist/core/conversation-store.d.ts.map +1 -0
- package/dist/core/conversation-store.js +109 -0
- package/dist/core/conversation-store.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +4 -0
- package/dist/core/message-types.d.ts +150 -0
- package/dist/core/message-types.d.ts.map +1 -0
- package/dist/events.d.ts +115 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +98 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +23 -0
- package/dist/presentation/components/ChatContainer.d.ts +21 -0
- package/dist/presentation/components/ChatContainer.d.ts.map +1 -0
- package/dist/presentation/components/ChatContainer.js +63 -0
- package/dist/presentation/components/ChatContainer.js.map +1 -0
- package/dist/presentation/components/ChatInput.d.ts +35 -0
- package/dist/presentation/components/ChatInput.d.ts.map +1 -0
- package/dist/presentation/components/ChatInput.js +149 -0
- package/dist/presentation/components/ChatInput.js.map +1 -0
- package/dist/presentation/components/ChatMessage.d.ts +24 -0
- package/dist/presentation/components/ChatMessage.d.ts.map +1 -0
- package/dist/presentation/components/ChatMessage.js +136 -0
- package/dist/presentation/components/ChatMessage.js.map +1 -0
- package/dist/presentation/components/CodePreview.d.ts +40 -0
- package/dist/presentation/components/CodePreview.d.ts.map +1 -0
- package/dist/presentation/components/CodePreview.js +127 -0
- package/dist/presentation/components/CodePreview.js.map +1 -0
- package/dist/presentation/components/ContextIndicator.d.ts +26 -0
- package/dist/presentation/components/ContextIndicator.d.ts.map +1 -0
- package/dist/presentation/components/ContextIndicator.js +97 -0
- package/dist/presentation/components/ContextIndicator.js.map +1 -0
- package/dist/presentation/components/ModelPicker.d.ts +39 -0
- package/dist/presentation/components/ModelPicker.d.ts.map +1 -0
- package/dist/presentation/components/ModelPicker.js +202 -0
- package/dist/presentation/components/ModelPicker.js.map +1 -0
- package/dist/presentation/components/index.d.ts +7 -0
- package/dist/presentation/components/index.js +8 -0
- package/dist/presentation/hooks/index.d.ts +3 -0
- package/dist/presentation/hooks/index.js +4 -0
- package/dist/presentation/hooks/useChat.d.ts +67 -0
- package/dist/presentation/hooks/useChat.d.ts.map +1 -0
- package/dist/presentation/hooks/useChat.js +172 -0
- package/dist/presentation/hooks/useChat.js.map +1 -0
- package/dist/presentation/hooks/useProviders.d.ts +38 -0
- package/dist/presentation/hooks/useProviders.d.ts.map +1 -0
- package/dist/presentation/hooks/useProviders.js +41 -0
- package/dist/presentation/hooks/useProviders.js.map +1 -0
- package/dist/presentation/index.d.ts +11 -0
- package/dist/presentation/index.js +12 -0
- package/dist/providers/chat-utilities.d.ts +15 -0
- package/dist/providers/chat-utilities.d.ts.map +1 -0
- package/dist/providers/chat-utilities.js +17 -0
- package/dist/providers/chat-utilities.js.map +1 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/providers/index.js +4 -0
- package/dist/schema.d.ts +222 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +100 -0
- package/dist/schema.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProviderName } from "@contractspec/lib.ai-providers";
|
|
2
|
+
|
|
3
|
+
//#region src/providers/chat-utilities.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Check if a provider supports local mode
|
|
7
|
+
*/
|
|
8
|
+
declare function supportsLocalMode(provider: ProviderName): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Check if a provider is available in Studio (cloud only)
|
|
11
|
+
*/
|
|
12
|
+
declare function isStudioAvailable(provider: ProviderName): boolean;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { isStudioAvailable, supportsLocalMode };
|
|
15
|
+
//# sourceMappingURL=chat-utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-utilities.d.ts","names":[],"sources":["../../src/providers/chat-utilities.ts"],"sourcesContent":[],"mappings":";;;;AAeA;;;iBAPgB,iBAAA,WAA4B;;;;iBAO5B,iBAAA,WAA4B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/providers/chat-utilities.ts
|
|
2
|
+
/**
|
|
3
|
+
* Check if a provider supports local mode
|
|
4
|
+
*/
|
|
5
|
+
function supportsLocalMode(provider) {
|
|
6
|
+
return provider === "ollama";
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Check if a provider is available in Studio (cloud only)
|
|
10
|
+
*/
|
|
11
|
+
function isStudioAvailable(provider) {
|
|
12
|
+
return provider !== "ollama";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { isStudioAvailable, supportsLocalMode };
|
|
17
|
+
//# sourceMappingURL=chat-utilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-utilities.js","names":[],"sources":["../../src/providers/chat-utilities.ts"],"sourcesContent":["/**\n * Chat-specific provider utilities\n */\nimport type { ProviderName } from '@contractspec/lib.ai-providers';\n\n/**\n * Check if a provider supports local mode\n */\nexport function supportsLocalMode(provider: ProviderName): boolean {\n return provider === 'ollama';\n}\n\n/**\n * Check if a provider is available in Studio (cloud only)\n */\nexport function isStudioAvailable(provider: ProviderName): boolean {\n return provider !== 'ollama';\n}\n\n/**\n * Get a human-readable provider name\n */\nexport function getProviderDisplayName(provider: ProviderName): string {\n switch (provider) {\n case 'ollama':\n return 'Ollama (Local)';\n case 'openai':\n return 'OpenAI';\n case 'anthropic':\n return 'Anthropic Claude';\n case 'mistral':\n return 'Mistral AI';\n case 'gemini':\n return 'Google Gemini';\n default:\n return provider;\n }\n}\n\n/**\n * Get provider icon name (for Lucide icons)\n */\nexport function getProviderIcon(\n provider: ProviderName\n): 'bot' | 'brain' | 'sparkles' | 'zap' | 'cpu' {\n switch (provider) {\n case 'ollama':\n return 'cpu';\n case 'openai':\n return 'brain';\n case 'anthropic':\n return 'sparkles';\n case 'mistral':\n return 'zap';\n case 'gemini':\n return 'bot';\n default:\n return 'bot';\n }\n}\n\n/**\n * Get provider color class for styling\n */\nexport function getProviderColor(provider: ProviderName): string {\n switch (provider) {\n case 'ollama':\n return 'text-neutral-500';\n case 'openai':\n return 'text-emerald-500';\n case 'anthropic':\n return 'text-orange-500';\n case 'mistral':\n return 'text-blue-500';\n case 'gemini':\n return 'text-purple-500';\n default:\n return 'text-neutral-400';\n }\n}\n"],"mappings":";;;;AAQA,SAAgB,kBAAkB,UAAiC;AACjE,QAAO,aAAa;;;;;AAMtB,SAAgB,kBAAkB,UAAiC;AACjE,QAAO,aAAa"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { isStudioAvailable, supportsLocalMode } from "./chat-utilities.js";
|
|
2
|
+
import { DEFAULT_MODELS, MODELS, ModelCapabilities, ModelInfo as ChatModelInfo, Provider as ChatProvider, ProviderAvailability, ProviderConfig as ChatProviderConfig, ProviderMode as ChatProviderMode, ProviderName as ChatProviderName, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, listOllamaModels, validateProvider } from "@contractspec/lib.ai-providers";
|
|
3
|
+
export { type ChatModelInfo, type ChatProvider, type ChatProviderConfig, type ChatProviderMode, type ChatProviderName, DEFAULT_MODELS, MODELS, type ModelCapabilities, type ProviderAvailability, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, isStudioAvailable, listOllamaModels, supportsLocalMode, validateProvider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { isStudioAvailable, supportsLocalMode } from "./chat-utilities.js";
|
|
2
|
+
import { DEFAULT_MODELS, MODELS, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, listOllamaModels, validateProvider } from "@contractspec/lib.ai-providers";
|
|
3
|
+
|
|
4
|
+
export { DEFAULT_MODELS, MODELS, createProvider, createProviderFromEnv, getAvailableProviders, getDefaultModel, getEnvVarName, getModelInfo, getModelsForProvider, getRecommendedModels, hasCredentials, isOllamaRunning, isStudioAvailable, listOllamaModels, supportsLocalMode, validateProvider };
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as _contractspec_lib_schema28 from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/schema.d.ts
|
|
4
|
+
declare const ChatMessageModel: _contractspec_lib_schema28.SchemaModel<{
|
|
5
|
+
id: {
|
|
6
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
7
|
+
isOptional: false;
|
|
8
|
+
};
|
|
9
|
+
role: {
|
|
10
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
content: {
|
|
14
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
status: {
|
|
18
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
createdAt: {
|
|
22
|
+
type: _contractspec_lib_schema28.FieldType<Date, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
declare const ChatConversationModel: _contractspec_lib_schema28.SchemaModel<{
|
|
27
|
+
id: {
|
|
28
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
29
|
+
isOptional: false;
|
|
30
|
+
};
|
|
31
|
+
title: {
|
|
32
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
33
|
+
isOptional: true;
|
|
34
|
+
};
|
|
35
|
+
status: {
|
|
36
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
37
|
+
isOptional: false;
|
|
38
|
+
};
|
|
39
|
+
messages: {
|
|
40
|
+
type: _contractspec_lib_schema28.SchemaModel<{
|
|
41
|
+
id: {
|
|
42
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
43
|
+
isOptional: false;
|
|
44
|
+
};
|
|
45
|
+
role: {
|
|
46
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
47
|
+
isOptional: false;
|
|
48
|
+
};
|
|
49
|
+
content: {
|
|
50
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
51
|
+
isOptional: false;
|
|
52
|
+
};
|
|
53
|
+
status: {
|
|
54
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
55
|
+
isOptional: false;
|
|
56
|
+
};
|
|
57
|
+
createdAt: {
|
|
58
|
+
type: _contractspec_lib_schema28.FieldType<Date, string>;
|
|
59
|
+
isOptional: false;
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
62
|
+
isArray: true;
|
|
63
|
+
isOptional: false;
|
|
64
|
+
};
|
|
65
|
+
provider: {
|
|
66
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
67
|
+
isOptional: false;
|
|
68
|
+
};
|
|
69
|
+
model: {
|
|
70
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
71
|
+
isOptional: false;
|
|
72
|
+
};
|
|
73
|
+
}>;
|
|
74
|
+
declare const SendMessageInputModel: _contractspec_lib_schema28.SchemaModel<{
|
|
75
|
+
conversationId: {
|
|
76
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
77
|
+
isOptional: true;
|
|
78
|
+
};
|
|
79
|
+
content: {
|
|
80
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
81
|
+
isOptional: false;
|
|
82
|
+
};
|
|
83
|
+
stream: {
|
|
84
|
+
type: _contractspec_lib_schema28.FieldType<boolean, boolean>;
|
|
85
|
+
isOptional: true;
|
|
86
|
+
};
|
|
87
|
+
}>;
|
|
88
|
+
declare const SendMessageOutputModel: _contractspec_lib_schema28.SchemaModel<{
|
|
89
|
+
message: {
|
|
90
|
+
type: _contractspec_lib_schema28.SchemaModel<{
|
|
91
|
+
id: {
|
|
92
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
93
|
+
isOptional: false;
|
|
94
|
+
};
|
|
95
|
+
role: {
|
|
96
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
97
|
+
isOptional: false;
|
|
98
|
+
};
|
|
99
|
+
content: {
|
|
100
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
101
|
+
isOptional: false;
|
|
102
|
+
};
|
|
103
|
+
status: {
|
|
104
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
105
|
+
isOptional: false;
|
|
106
|
+
};
|
|
107
|
+
createdAt: {
|
|
108
|
+
type: _contractspec_lib_schema28.FieldType<Date, string>;
|
|
109
|
+
isOptional: false;
|
|
110
|
+
};
|
|
111
|
+
}>;
|
|
112
|
+
isOptional: false;
|
|
113
|
+
};
|
|
114
|
+
conversation: {
|
|
115
|
+
type: _contractspec_lib_schema28.SchemaModel<{
|
|
116
|
+
id: {
|
|
117
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
118
|
+
isOptional: false;
|
|
119
|
+
};
|
|
120
|
+
title: {
|
|
121
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
122
|
+
isOptional: true;
|
|
123
|
+
};
|
|
124
|
+
status: {
|
|
125
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
126
|
+
isOptional: false;
|
|
127
|
+
};
|
|
128
|
+
messages: {
|
|
129
|
+
type: _contractspec_lib_schema28.SchemaModel<{
|
|
130
|
+
id: {
|
|
131
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
132
|
+
isOptional: false;
|
|
133
|
+
};
|
|
134
|
+
role: {
|
|
135
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
136
|
+
isOptional: false;
|
|
137
|
+
};
|
|
138
|
+
content: {
|
|
139
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
140
|
+
isOptional: false;
|
|
141
|
+
};
|
|
142
|
+
status: {
|
|
143
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
144
|
+
isOptional: false;
|
|
145
|
+
};
|
|
146
|
+
createdAt: {
|
|
147
|
+
type: _contractspec_lib_schema28.FieldType<Date, string>;
|
|
148
|
+
isOptional: false;
|
|
149
|
+
};
|
|
150
|
+
}>;
|
|
151
|
+
isArray: true;
|
|
152
|
+
isOptional: false;
|
|
153
|
+
};
|
|
154
|
+
provider: {
|
|
155
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
156
|
+
isOptional: false;
|
|
157
|
+
};
|
|
158
|
+
model: {
|
|
159
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
160
|
+
isOptional: false;
|
|
161
|
+
};
|
|
162
|
+
}>;
|
|
163
|
+
isOptional: false;
|
|
164
|
+
};
|
|
165
|
+
}>;
|
|
166
|
+
declare const ListConversationsOutputModel: _contractspec_lib_schema28.SchemaModel<{
|
|
167
|
+
conversations: {
|
|
168
|
+
type: _contractspec_lib_schema28.SchemaModel<{
|
|
169
|
+
id: {
|
|
170
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
171
|
+
isOptional: false;
|
|
172
|
+
};
|
|
173
|
+
title: {
|
|
174
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
175
|
+
isOptional: true;
|
|
176
|
+
};
|
|
177
|
+
status: {
|
|
178
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
179
|
+
isOptional: false;
|
|
180
|
+
};
|
|
181
|
+
messages: {
|
|
182
|
+
type: _contractspec_lib_schema28.SchemaModel<{
|
|
183
|
+
id: {
|
|
184
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
185
|
+
isOptional: false;
|
|
186
|
+
};
|
|
187
|
+
role: {
|
|
188
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
189
|
+
isOptional: false;
|
|
190
|
+
};
|
|
191
|
+
content: {
|
|
192
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
193
|
+
isOptional: false;
|
|
194
|
+
};
|
|
195
|
+
status: {
|
|
196
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
197
|
+
isOptional: false;
|
|
198
|
+
};
|
|
199
|
+
createdAt: {
|
|
200
|
+
type: _contractspec_lib_schema28.FieldType<Date, string>;
|
|
201
|
+
isOptional: false;
|
|
202
|
+
};
|
|
203
|
+
}>;
|
|
204
|
+
isArray: true;
|
|
205
|
+
isOptional: false;
|
|
206
|
+
};
|
|
207
|
+
provider: {
|
|
208
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
209
|
+
isOptional: false;
|
|
210
|
+
};
|
|
211
|
+
model: {
|
|
212
|
+
type: _contractspec_lib_schema28.FieldType<string, string>;
|
|
213
|
+
isOptional: false;
|
|
214
|
+
};
|
|
215
|
+
}>;
|
|
216
|
+
isArray: true;
|
|
217
|
+
isOptional: false;
|
|
218
|
+
};
|
|
219
|
+
}>;
|
|
220
|
+
//#endregion
|
|
221
|
+
export { ChatConversationModel, ChatMessageModel, ListConversationsOutputModel, SendMessageInputModel, SendMessageOutputModel };
|
|
222
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","names":[],"sources":["../src/schema.ts"],"sourcesContent":[],"mappings":";;;cAEa,6CAAgB;;UAS3B,0BAAA,CAAA;IATW,UAAA,EAAA,KASX;EAAA,CAAA;;;;;;8CAT2B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAWhB,CAAA;EAUX,MAAA,EAAA;;;;;;;;;cAVW,kDAAqB;;UAUhC,0BAAA,CAAA;;EAVgC,CAAA;EAYrB,KAAA,EAAA;IAUX,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;IAVgC,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAYrB,UAAA,EAAA,KAAA;EAMX,CAAA;;;;;;;;;;;;;;;;;;;;kDANiC,KAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;MAQtB,CAAA;IASX,CAAA,CAAA;;;;;;;;;;;;;cA7BW,qBAoB4B,6BApBP,WAoBO,CAAA;EAAA,cAAA,EAAA;UAVvC,0BAAA,CAAA;;;;;;;;;;;;cAEW,mDAAsB;;;;cAMjC,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,yDAA4B;;;;cASvC,0BAAA,CAAA"}
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
2
|
+
|
|
3
|
+
//#region src/schema.ts
|
|
4
|
+
const ChatMessageModel = defineSchemaModel({
|
|
5
|
+
name: "ChatMessage",
|
|
6
|
+
fields: {
|
|
7
|
+
id: {
|
|
8
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
9
|
+
isOptional: false
|
|
10
|
+
},
|
|
11
|
+
role: {
|
|
12
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
13
|
+
isOptional: false
|
|
14
|
+
},
|
|
15
|
+
content: {
|
|
16
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
+
isOptional: false
|
|
18
|
+
},
|
|
19
|
+
status: {
|
|
20
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
21
|
+
isOptional: false
|
|
22
|
+
},
|
|
23
|
+
createdAt: {
|
|
24
|
+
type: ScalarTypeEnum.DateTime(),
|
|
25
|
+
isOptional: false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const ChatConversationModel = defineSchemaModel({
|
|
30
|
+
name: "ChatConversation",
|
|
31
|
+
fields: {
|
|
32
|
+
id: {
|
|
33
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
34
|
+
isOptional: false
|
|
35
|
+
},
|
|
36
|
+
title: {
|
|
37
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
38
|
+
isOptional: true
|
|
39
|
+
},
|
|
40
|
+
status: {
|
|
41
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
42
|
+
isOptional: false
|
|
43
|
+
},
|
|
44
|
+
messages: {
|
|
45
|
+
type: ChatMessageModel,
|
|
46
|
+
isArray: true,
|
|
47
|
+
isOptional: false
|
|
48
|
+
},
|
|
49
|
+
provider: {
|
|
50
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
51
|
+
isOptional: false
|
|
52
|
+
},
|
|
53
|
+
model: {
|
|
54
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
55
|
+
isOptional: false
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const SendMessageInputModel = defineSchemaModel({
|
|
60
|
+
name: "SendMessageInput",
|
|
61
|
+
fields: {
|
|
62
|
+
conversationId: {
|
|
63
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
64
|
+
isOptional: true
|
|
65
|
+
},
|
|
66
|
+
content: {
|
|
67
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
68
|
+
isOptional: false
|
|
69
|
+
},
|
|
70
|
+
stream: {
|
|
71
|
+
type: ScalarTypeEnum.Boolean(),
|
|
72
|
+
isOptional: true
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
const SendMessageOutputModel = defineSchemaModel({
|
|
77
|
+
name: "SendMessageOutput",
|
|
78
|
+
fields: {
|
|
79
|
+
message: {
|
|
80
|
+
type: ChatMessageModel,
|
|
81
|
+
isOptional: false
|
|
82
|
+
},
|
|
83
|
+
conversation: {
|
|
84
|
+
type: ChatConversationModel,
|
|
85
|
+
isOptional: false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
const ListConversationsOutputModel = defineSchemaModel({
|
|
90
|
+
name: "ListConversationsOutput",
|
|
91
|
+
fields: { conversations: {
|
|
92
|
+
type: ChatConversationModel,
|
|
93
|
+
isArray: true,
|
|
94
|
+
isOptional: false
|
|
95
|
+
} }
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
//#endregion
|
|
99
|
+
export { ChatConversationModel, ChatMessageModel, ListConversationsOutputModel, SendMessageInputModel, SendMessageOutputModel };
|
|
100
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","names":[],"sources":["../src/schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\n\nexport const ChatMessageModel = defineSchemaModel({\n name: 'ChatMessage',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const ChatConversationModel = defineSchemaModel({\n name: 'ChatConversation',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n messages: { type: ChatMessageModel, isArray: true, isOptional: false },\n provider: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n model: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const SendMessageInputModel = defineSchemaModel({\n name: 'SendMessageInput',\n fields: {\n conversationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n content: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n stream: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n});\n\nexport const SendMessageOutputModel = defineSchemaModel({\n name: 'SendMessageOutput',\n fields: {\n message: { type: ChatMessageModel, isOptional: false },\n conversation: { type: ChatConversationModel, isOptional: false },\n },\n});\n\nexport const ListConversationsOutputModel = defineSchemaModel({\n name: 'ListConversationsOutput',\n fields: {\n conversations: {\n type: ChatConversationModel,\n isArray: true,\n isOptional: false,\n },\n },\n});\n"],"mappings":";;;AAEA,MAAa,mBAAmB,kBAAkB;CAChD,MAAM;CACN,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACnE,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE,UAAU;GAAE,MAAM;GAAkB,SAAS;GAAM,YAAY;GAAO;EACtE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACrE;CACF,CAAC;AAEF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,gBAAgB;GACd,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM,eAAe,SAAS;GAAE,YAAY;GAAM;EAC7D;CACF,CAAC;AAEF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM;GAAkB,YAAY;GAAO;EACtD,cAAc;GAAE,MAAM;GAAuB,YAAY;GAAO;EACjE;CACF,CAAC;AAEF,MAAa,+BAA+B,kBAAkB;CAC5D,MAAM;CACN,QAAQ,EACN,eAAe;EACb,MAAM;EACN,SAAS;EACT,YAAY;EACb,EACF;CACF,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@contractspec/module.ai-chat",
|
|
3
|
+
"version": "0.0.0-canary-20260113170453",
|
|
4
|
+
"description": "AI chat interface module",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"contractspec",
|
|
7
|
+
"ai",
|
|
8
|
+
"chat",
|
|
9
|
+
"conversational",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
12
|
+
"type": "module",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
20
|
+
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
21
|
+
"build": "bun build:types && bun build:bundle",
|
|
22
|
+
"build:bundle": "tsdown",
|
|
23
|
+
"build:types": "tsc --noEmit",
|
|
24
|
+
"dev": "bun build:bundle --watch",
|
|
25
|
+
"clean": "rimraf dist .turbo",
|
|
26
|
+
"lint": "bun lint:fix",
|
|
27
|
+
"lint:fix": "eslint src --fix",
|
|
28
|
+
"lint:check": "eslint src",
|
|
29
|
+
"test": "bun test"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@contractspec/lib.ai-agent": "0.0.0-canary-20260113170453",
|
|
33
|
+
"@contractspec/lib.ai-providers": "0.0.0-canary-20260113170453",
|
|
34
|
+
"@contractspec/lib.contracts": "0.0.0-canary-20260113170453",
|
|
35
|
+
"@contractspec/lib.schema": "0.0.0-canary-20260113170453",
|
|
36
|
+
"@contractspec/lib.metering": "0.0.0-canary-20260113170453",
|
|
37
|
+
"@contractspec/lib.cost-tracking": "0.0.0-canary-20260113170453",
|
|
38
|
+
"@contractspec/lib.design-system": "0.0.0-canary-20260113170453",
|
|
39
|
+
"@contractspec/lib.ui-kit-web": "0.0.0-canary-20260113170453",
|
|
40
|
+
"@ai-sdk/react": "3.0.31",
|
|
41
|
+
"ai": "6.0.29",
|
|
42
|
+
"lucide-react": "^0.562.0",
|
|
43
|
+
"react": "19.2.3",
|
|
44
|
+
"zod": "^4.3.5"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@contractspec/tool.tsdown": "0.0.0-canary-20260113170453",
|
|
48
|
+
"@contractspec/tool.typescript": "0.0.0-canary-20260113170453",
|
|
49
|
+
"@types/react": "^19.2.8",
|
|
50
|
+
"tsdown": "^0.19.0",
|
|
51
|
+
"typescript": "^5.9.3"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": ">=18.0.0"
|
|
55
|
+
},
|
|
56
|
+
"exports": {
|
|
57
|
+
".": "./dist/index.js",
|
|
58
|
+
"./context": "./dist/context/index.js",
|
|
59
|
+
"./core": "./dist/core/index.js",
|
|
60
|
+
"./presentation": "./dist/presentation/index.js",
|
|
61
|
+
"./presentation/components": "./dist/presentation/components/index.js",
|
|
62
|
+
"./presentation/hooks": "./dist/presentation/hooks/index.js",
|
|
63
|
+
"./providers": "./dist/providers/index.js",
|
|
64
|
+
"./*": "./*"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public",
|
|
68
|
+
"exports": {
|
|
69
|
+
".": "./dist/index.js",
|
|
70
|
+
"./context": "./dist/context/index.js",
|
|
71
|
+
"./core": "./dist/core/index.js",
|
|
72
|
+
"./presentation": "./dist/presentation/index.js",
|
|
73
|
+
"./presentation/components": "./dist/presentation/components/index.js",
|
|
74
|
+
"./presentation/hooks": "./dist/presentation/hooks/index.js",
|
|
75
|
+
"./providers": "./dist/providers/index.js",
|
|
76
|
+
"./*": "./*"
|
|
77
|
+
},
|
|
78
|
+
"registry": "https://registry.npmjs.org/"
|
|
79
|
+
},
|
|
80
|
+
"license": "MIT",
|
|
81
|
+
"repository": {
|
|
82
|
+
"type": "git",
|
|
83
|
+
"url": "https://github.com/lssm-tech/contractspec.git",
|
|
84
|
+
"directory": "packages/modules/ai-chat"
|
|
85
|
+
},
|
|
86
|
+
"homepage": "https://contractspec.io"
|
|
87
|
+
}
|