@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Chaman Ventures, SASU
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @contractspec/module.ai-chat
|
|
2
|
+
|
|
3
|
+
Website: https://contractspec.io/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
**ContractSpec Vibe Coding Chat** — AI-powered conversational coding assistant for ContractSpec.
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
This module provides a reusable AI chat system that can be integrated into CLI, VSCode extension, and ContractSpec Studio. It supports multiple LLM providers with full workspace context for vibe coding.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Multi-Provider Support**: OpenAI, Anthropic, Mistral, Google Gemini, and local Ollama
|
|
15
|
+
- **Three Provider Modes**: Local (Ollama), BYOK (Bring Your Own Key), Managed (API proxy)
|
|
16
|
+
- **Full Workspace Context**: Access specs, files, and codebase for context-aware assistance
|
|
17
|
+
- **Streaming Responses**: Real-time token streaming for responsive UX
|
|
18
|
+
- **Usage Tracking**: Integrated metering and cost tracking
|
|
19
|
+
- **UI Components**: React components for chat interfaces
|
|
20
|
+
|
|
21
|
+
## Related Packages
|
|
22
|
+
|
|
23
|
+
- `@contractspec/lib.ai-providers` — Shared provider abstraction (types, factory, validation)
|
|
24
|
+
- `@contractspec/lib.ai-agent` — Agent orchestration and tool execution
|
|
25
|
+
|
|
26
|
+
## Providers
|
|
27
|
+
|
|
28
|
+
| Provider | Local | BYOK | Managed |
|
|
29
|
+
|----------|-------|------|---------|
|
|
30
|
+
| Ollama | ✅ | - | - |
|
|
31
|
+
| OpenAI | - | ✅ | ✅ |
|
|
32
|
+
| Anthropic | - | ✅ | ✅ |
|
|
33
|
+
| Mistral | - | ✅ | ✅ |
|
|
34
|
+
| Google Gemini | - | ✅ | ✅ |
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### Basic Chat
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { createProvider } from '@contractspec/lib.ai-providers';
|
|
42
|
+
import { ChatService } from '@contractspec/module.ai-chat';
|
|
43
|
+
|
|
44
|
+
const provider = createProvider({
|
|
45
|
+
provider: 'openai',
|
|
46
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
47
|
+
model: 'gpt-4o',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const chatService = new ChatService({ provider });
|
|
51
|
+
|
|
52
|
+
const response = await chatService.send({
|
|
53
|
+
content: 'Help me create a new API endpoint',
|
|
54
|
+
});
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### With Workspace Context
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
import { createProvider } from '@contractspec/lib.ai-providers';
|
|
61
|
+
import { ChatService, WorkspaceContext } from '@contractspec/module.ai-chat';
|
|
62
|
+
|
|
63
|
+
const context = await WorkspaceContext.fromPath('/path/to/project');
|
|
64
|
+
const provider = createProvider({ provider: 'anthropic', proxyUrl: '/api/chat' });
|
|
65
|
+
|
|
66
|
+
const chatService = new ChatService({ provider, context });
|
|
67
|
+
|
|
68
|
+
// The chat now has access to specs, files, and can suggest code changes
|
|
69
|
+
const response = await chatService.send({
|
|
70
|
+
content: 'Add validation to the user.create command',
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### React Components
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
import { ChatContainer, ChatMessage, ChatInput } from '@contractspec/module.ai-chat/presentation/components';
|
|
78
|
+
import { useChat } from '@contractspec/module.ai-chat/presentation/hooks';
|
|
79
|
+
|
|
80
|
+
function VibeCodingChat() {
|
|
81
|
+
const { messages, sendMessage, isLoading } = useChat({
|
|
82
|
+
provider: 'openai',
|
|
83
|
+
mode: 'managed',
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<ChatContainer>
|
|
88
|
+
{messages.map((msg) => (
|
|
89
|
+
<ChatMessage key={msg.id} message={msg} />
|
|
90
|
+
))}
|
|
91
|
+
<ChatInput onSend={sendMessage} disabled={isLoading} />
|
|
92
|
+
</ChatContainer>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Architecture
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
101
|
+
│ Consumer Surfaces │
|
|
102
|
+
│ ┌─────────┐ ┌──────────────┐ ┌─────────────────┐ │
|
|
103
|
+
│ │ CLI │ │ VSCode │ │ Studio │ │
|
|
104
|
+
│ └────┬────┘ └──────┬───────┘ └────────┬────────┘ │
|
|
105
|
+
└───────┼────────────────┼─────────────────────┼─────────────┘
|
|
106
|
+
│ │ │
|
|
107
|
+
▼ ▼ ▼
|
|
108
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
109
|
+
│ @contractspec/module.ai-chat │
|
|
110
|
+
│ ┌────────────┐ ┌──────────────┐ ┌───────────────────┐ │
|
|
111
|
+
│ │ ChatService│ │ Providers │ │ Workspace Context │ │
|
|
112
|
+
│ │ │ │ (re-exports) │ │ │ │
|
|
113
|
+
│ └────────────┘ └──────┬───────┘ └───────────────────┘ │
|
|
114
|
+
│ │ │
|
|
115
|
+
│ ┌──────────────────────┼───────────────────────────────┐ │
|
|
116
|
+
│ │ UI Components (React) │ │
|
|
117
|
+
│ └──────────────────────────────────────────────────────┘ │
|
|
118
|
+
└─────────────────────────┼───────────────────────────────────┘
|
|
119
|
+
│
|
|
120
|
+
┌─────────────────┴─────────────────┐
|
|
121
|
+
▼ ▼
|
|
122
|
+
┌───────────────────┐ ┌──────────────────────────┐
|
|
123
|
+
│ @contractspec/lib. │ │ @contractspec/lib.ai-agent │
|
|
124
|
+
│ ai-providers │ │ │
|
|
125
|
+
│ ┌───────────────┐ │ │ Agent orchestration, │
|
|
126
|
+
│ │ Provider │ │ │ tool execution, │
|
|
127
|
+
│ │ abstraction │ │ │ memory framework │
|
|
128
|
+
│ └───────────────┘ │ └──────────────────────────┘
|
|
129
|
+
│ ┌───────────────┐ │
|
|
130
|
+
│ │ Model info │ │
|
|
131
|
+
│ │ & validation │ │
|
|
132
|
+
│ └───────────────┘ │
|
|
133
|
+
└───────────────────┘
|
|
134
|
+
│
|
|
135
|
+
▼
|
|
136
|
+
┌───────────────────┐ ┌──────────────────────────┐
|
|
137
|
+
│ Local Providers │ │ API Proxy │
|
|
138
|
+
│ ┌──────────────┐ │ │ ┌──────────────────────┐│
|
|
139
|
+
│ │ Ollama │ │ │ │ Metering + Costing ││
|
|
140
|
+
│ └──────────────┘ │ │ └──────────────────────┘│
|
|
141
|
+
└───────────────────┘ │ ┌──────────────────────┐│
|
|
142
|
+
│ │ Cloud Providers ││
|
|
143
|
+
│ │ OpenAI/Anthropic/etc ││
|
|
144
|
+
│ └──────────────────────┘│
|
|
145
|
+
└──────────────────────────┘
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Metrics
|
|
149
|
+
|
|
150
|
+
The module tracks the following metrics via `@contractspec/lib.metering`:
|
|
151
|
+
|
|
152
|
+
| Metric | Description |
|
|
153
|
+
|--------|-------------|
|
|
154
|
+
| `ai_chat.messages` | Total chat messages sent |
|
|
155
|
+
| `ai_chat.tokens_input` | Input tokens consumed |
|
|
156
|
+
| `ai_chat.tokens_output` | Output tokens generated |
|
|
157
|
+
| `ai_chat.latency_ms` | Response latency |
|
|
158
|
+
| `ai_chat.errors` | Failed completions |
|
|
159
|
+
|
|
160
|
+
## Feature Flags
|
|
161
|
+
|
|
162
|
+
- `ai_chat.enabled` - Master toggle for the chat feature
|
|
163
|
+
- `ai_chat.managed_keys` - Enable managed key mode (API proxy)
|
|
164
|
+
- `ai_chat.workspace_context` - Enable workspace read/write access
|
|
165
|
+
- `ai_chat.code_execution` - Enable code execution (future)
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
MIT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts4 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/ai-chat.feature.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AI Chat feature module that bundles conversational AI assistance
|
|
7
|
+
* for ContractSpec development across CLI, VSCode, and Studio.
|
|
8
|
+
*/
|
|
9
|
+
declare const AiChatFeature: _contractspec_lib_contracts4.FeatureModuleSpec;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { AiChatFeature };
|
|
12
|
+
//# sourceMappingURL=ai-chat.feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.feature.d.ts","names":[],"sources":["../src/ai-chat.feature.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWA;cAAa,eA8CX,4BAAA,CA9CwB"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/ai-chat.feature.ts
|
|
4
|
+
/**
|
|
5
|
+
* AI Chat Feature Module Specification
|
|
6
|
+
*
|
|
7
|
+
* Defines the feature module for AI-powered vibe coding chat.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* AI Chat feature module that bundles conversational AI assistance
|
|
11
|
+
* for ContractSpec development across CLI, VSCode, and Studio.
|
|
12
|
+
*/
|
|
13
|
+
const AiChatFeature = defineFeature({
|
|
14
|
+
meta: {
|
|
15
|
+
key: "ai-chat",
|
|
16
|
+
version: "1.0.0",
|
|
17
|
+
title: "AI Vibe Coding Chat",
|
|
18
|
+
description: "AI-powered conversational coding assistant with full workspace context",
|
|
19
|
+
domain: "platform",
|
|
20
|
+
owners: ["@platform.ai"],
|
|
21
|
+
tags: [
|
|
22
|
+
"ai",
|
|
23
|
+
"chat",
|
|
24
|
+
"llm",
|
|
25
|
+
"vibe-coding",
|
|
26
|
+
"assistant"
|
|
27
|
+
],
|
|
28
|
+
stability: "experimental"
|
|
29
|
+
},
|
|
30
|
+
operations: [
|
|
31
|
+
{
|
|
32
|
+
key: "ai-chat.send",
|
|
33
|
+
version: "1.0.0"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "ai-chat.stream",
|
|
37
|
+
version: "1.0.0"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: "ai-chat.conversations.list",
|
|
41
|
+
version: "1.0.0"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: "ai-chat.conversations.get",
|
|
45
|
+
version: "1.0.0"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: "ai-chat.conversations.delete",
|
|
49
|
+
version: "1.0.0"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "ai-chat.providers.list",
|
|
53
|
+
version: "1.0.0"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "ai-chat.context.scan",
|
|
57
|
+
version: "1.0.0"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
events: [
|
|
61
|
+
{
|
|
62
|
+
key: "ai-chat.message.sent",
|
|
63
|
+
version: "1.0.0"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
key: "ai-chat.message.received",
|
|
67
|
+
version: "1.0.0"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "ai-chat.conversation.created",
|
|
71
|
+
version: "1.0.0"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: "ai-chat.conversation.deleted",
|
|
75
|
+
version: "1.0.0"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "ai-chat.error",
|
|
79
|
+
version: "1.0.0"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
presentations: [],
|
|
83
|
+
opToPresentation: [],
|
|
84
|
+
presentationsTargets: [],
|
|
85
|
+
capabilities: {
|
|
86
|
+
provides: [{
|
|
87
|
+
key: "ai-chat",
|
|
88
|
+
version: "1.0.0"
|
|
89
|
+
}],
|
|
90
|
+
requires: [{
|
|
91
|
+
key: "identity",
|
|
92
|
+
version: "1.0.0"
|
|
93
|
+
}, {
|
|
94
|
+
key: "metering",
|
|
95
|
+
version: "1.0.0"
|
|
96
|
+
}]
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
export { AiChatFeature };
|
|
102
|
+
//# sourceMappingURL=ai-chat.feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.feature.js","names":[],"sources":["../src/ai-chat.feature.ts"],"sourcesContent":["/**\n * AI Chat Feature Module Specification\n *\n * Defines the feature module for AI-powered vibe coding chat.\n */\nimport { defineFeature } from '@contractspec/lib.contracts';\n\n/**\n * AI Chat feature module that bundles conversational AI assistance\n * for ContractSpec development across CLI, VSCode, and Studio.\n */\nexport const AiChatFeature = defineFeature({\n meta: {\n key: 'ai-chat',\n version: '1.0.0',\n title: 'AI Vibe Coding Chat',\n description:\n 'AI-powered conversational coding assistant with full workspace context',\n domain: 'platform',\n owners: ['@platform.ai'],\n tags: ['ai', 'chat', 'llm', 'vibe-coding', 'assistant'],\n stability: 'experimental',\n },\n\n // Contract operations for chat functionality\n operations: [\n { key: 'ai-chat.send', version: '1.0.0' },\n { key: 'ai-chat.stream', version: '1.0.0' },\n { key: 'ai-chat.conversations.list', version: '1.0.0' },\n { key: 'ai-chat.conversations.get', version: '1.0.0' },\n { key: 'ai-chat.conversations.delete', version: '1.0.0' },\n { key: 'ai-chat.providers.list', version: '1.0.0' },\n { key: 'ai-chat.context.scan', version: '1.0.0' },\n ],\n\n // Events emitted by the chat system\n events: [\n { key: 'ai-chat.message.sent', version: '1.0.0' },\n { key: 'ai-chat.message.received', version: '1.0.0' },\n { key: 'ai-chat.conversation.created', version: '1.0.0' },\n { key: 'ai-chat.conversation.deleted', version: '1.0.0' },\n { key: 'ai-chat.error', version: '1.0.0' },\n ],\n\n // No presentations for core module\n presentations: [],\n opToPresentation: [],\n presentationsTargets: [],\n\n // Capability definitions\n capabilities: {\n provides: [{ key: 'ai-chat', version: '1.0.0' }],\n requires: [\n { key: 'identity', version: '1.0.0' },\n { key: 'metering', version: '1.0.0' },\n ],\n },\n});\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,gBAAgB,cAAc;CACzC,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,eAAe;EACxB,MAAM;GAAC;GAAM;GAAQ;GAAO;GAAe;GAAY;EACvD,WAAW;EACZ;CAGD,YAAY;EACV;GAAE,KAAK;GAAgB,SAAS;GAAS;EACzC;GAAE,KAAK;GAAkB,SAAS;GAAS;EAC3C;GAAE,KAAK;GAA8B,SAAS;GAAS;EACvD;GAAE,KAAK;GAA6B,SAAS;GAAS;EACtD;GAAE,KAAK;GAAgC,SAAS;GAAS;EACzD;GAAE,KAAK;GAA0B,SAAS;GAAS;EACnD;GAAE,KAAK;GAAwB,SAAS;GAAS;EAClD;CAGD,QAAQ;EACN;GAAE,KAAK;GAAwB,SAAS;GAAS;EACjD;GAAE,KAAK;GAA4B,SAAS;GAAS;EACrD;GAAE,KAAK;GAAgC,SAAS;GAAS;EACzD;GAAE,KAAK;GAAgC,SAAS;GAAS;EACzD;GAAE,KAAK;GAAiB,SAAS;GAAS;EAC3C;CAGD,eAAe,EAAE;CACjB,kBAAkB,EAAE;CACpB,sBAAsB,EAAE;CAGxB,cAAc;EACZ,UAAU,CAAC;GAAE,KAAK;GAAW,SAAS;GAAS,CAAC;EAChD,UAAU,CACR;GAAE,KAAK;GAAY,SAAS;GAAS,EACrC;GAAE,KAAK;GAAY,SAAS;GAAS,CACtC;EACF;CACF,CAAC"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts5 from "@contractspec/lib.contracts";
|
|
2
|
+
import * as _contractspec_lib_schema82 from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/ai-chat.operations.d.ts
|
|
5
|
+
declare const SendMessageContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
|
|
6
|
+
conversationId: {
|
|
7
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
8
|
+
isOptional: true;
|
|
9
|
+
};
|
|
10
|
+
content: {
|
|
11
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
12
|
+
isOptional: false;
|
|
13
|
+
};
|
|
14
|
+
stream: {
|
|
15
|
+
type: _contractspec_lib_schema82.FieldType<boolean, boolean>;
|
|
16
|
+
isOptional: true;
|
|
17
|
+
};
|
|
18
|
+
}>, _contractspec_lib_schema82.SchemaModel<{
|
|
19
|
+
message: {
|
|
20
|
+
type: _contractspec_lib_schema82.SchemaModel<{
|
|
21
|
+
id: {
|
|
22
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
role: {
|
|
26
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
content: {
|
|
30
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
31
|
+
isOptional: false;
|
|
32
|
+
};
|
|
33
|
+
status: {
|
|
34
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
35
|
+
isOptional: false;
|
|
36
|
+
};
|
|
37
|
+
createdAt: {
|
|
38
|
+
type: _contractspec_lib_schema82.FieldType<Date, string>;
|
|
39
|
+
isOptional: false;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
isOptional: false;
|
|
43
|
+
};
|
|
44
|
+
conversation: {
|
|
45
|
+
type: _contractspec_lib_schema82.SchemaModel<{
|
|
46
|
+
id: {
|
|
47
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
title: {
|
|
51
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
52
|
+
isOptional: true;
|
|
53
|
+
};
|
|
54
|
+
status: {
|
|
55
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
messages: {
|
|
59
|
+
type: _contractspec_lib_schema82.SchemaModel<{
|
|
60
|
+
id: {
|
|
61
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
62
|
+
isOptional: false;
|
|
63
|
+
};
|
|
64
|
+
role: {
|
|
65
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
66
|
+
isOptional: false;
|
|
67
|
+
};
|
|
68
|
+
content: {
|
|
69
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
70
|
+
isOptional: false;
|
|
71
|
+
};
|
|
72
|
+
status: {
|
|
73
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
74
|
+
isOptional: false;
|
|
75
|
+
};
|
|
76
|
+
createdAt: {
|
|
77
|
+
type: _contractspec_lib_schema82.FieldType<Date, string>;
|
|
78
|
+
isOptional: false;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
isArray: true;
|
|
82
|
+
isOptional: false;
|
|
83
|
+
};
|
|
84
|
+
provider: {
|
|
85
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
86
|
+
isOptional: false;
|
|
87
|
+
};
|
|
88
|
+
model: {
|
|
89
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
90
|
+
isOptional: false;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
isOptional: false;
|
|
94
|
+
};
|
|
95
|
+
}>, undefined>;
|
|
96
|
+
declare const StreamMessageContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
|
|
97
|
+
conversationId: {
|
|
98
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
99
|
+
isOptional: true;
|
|
100
|
+
};
|
|
101
|
+
content: {
|
|
102
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
103
|
+
isOptional: false;
|
|
104
|
+
};
|
|
105
|
+
stream: {
|
|
106
|
+
type: _contractspec_lib_schema82.FieldType<boolean, boolean>;
|
|
107
|
+
isOptional: true;
|
|
108
|
+
};
|
|
109
|
+
}>, _contractspec_lib_schema82.SchemaModel<{
|
|
110
|
+
stream: {
|
|
111
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
112
|
+
isOptional: false;
|
|
113
|
+
};
|
|
114
|
+
}>, undefined>;
|
|
115
|
+
declare const ListConversationsContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{}>, _contractspec_lib_schema82.SchemaModel<{
|
|
116
|
+
conversations: {
|
|
117
|
+
type: _contractspec_lib_schema82.SchemaModel<{
|
|
118
|
+
id: {
|
|
119
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
120
|
+
isOptional: false;
|
|
121
|
+
};
|
|
122
|
+
title: {
|
|
123
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
124
|
+
isOptional: true;
|
|
125
|
+
};
|
|
126
|
+
status: {
|
|
127
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
128
|
+
isOptional: false;
|
|
129
|
+
};
|
|
130
|
+
messages: {
|
|
131
|
+
type: _contractspec_lib_schema82.SchemaModel<{
|
|
132
|
+
id: {
|
|
133
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
134
|
+
isOptional: false;
|
|
135
|
+
};
|
|
136
|
+
role: {
|
|
137
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
138
|
+
isOptional: false;
|
|
139
|
+
};
|
|
140
|
+
content: {
|
|
141
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
142
|
+
isOptional: false;
|
|
143
|
+
};
|
|
144
|
+
status: {
|
|
145
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
146
|
+
isOptional: false;
|
|
147
|
+
};
|
|
148
|
+
createdAt: {
|
|
149
|
+
type: _contractspec_lib_schema82.FieldType<Date, string>;
|
|
150
|
+
isOptional: false;
|
|
151
|
+
};
|
|
152
|
+
}>;
|
|
153
|
+
isArray: true;
|
|
154
|
+
isOptional: false;
|
|
155
|
+
};
|
|
156
|
+
provider: {
|
|
157
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
158
|
+
isOptional: false;
|
|
159
|
+
};
|
|
160
|
+
model: {
|
|
161
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
162
|
+
isOptional: false;
|
|
163
|
+
};
|
|
164
|
+
}>;
|
|
165
|
+
isArray: true;
|
|
166
|
+
isOptional: false;
|
|
167
|
+
};
|
|
168
|
+
}>, undefined>;
|
|
169
|
+
declare const GetConversationContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
|
|
170
|
+
id: {
|
|
171
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
172
|
+
isOptional: false;
|
|
173
|
+
};
|
|
174
|
+
}>, _contractspec_lib_schema82.SchemaModel<{
|
|
175
|
+
id: {
|
|
176
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
177
|
+
isOptional: false;
|
|
178
|
+
};
|
|
179
|
+
title: {
|
|
180
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
181
|
+
isOptional: true;
|
|
182
|
+
};
|
|
183
|
+
status: {
|
|
184
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
185
|
+
isOptional: false;
|
|
186
|
+
};
|
|
187
|
+
messages: {
|
|
188
|
+
type: _contractspec_lib_schema82.SchemaModel<{
|
|
189
|
+
id: {
|
|
190
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
191
|
+
isOptional: false;
|
|
192
|
+
};
|
|
193
|
+
role: {
|
|
194
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
195
|
+
isOptional: false;
|
|
196
|
+
};
|
|
197
|
+
content: {
|
|
198
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
199
|
+
isOptional: false;
|
|
200
|
+
};
|
|
201
|
+
status: {
|
|
202
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
203
|
+
isOptional: false;
|
|
204
|
+
};
|
|
205
|
+
createdAt: {
|
|
206
|
+
type: _contractspec_lib_schema82.FieldType<Date, string>;
|
|
207
|
+
isOptional: false;
|
|
208
|
+
};
|
|
209
|
+
}>;
|
|
210
|
+
isArray: true;
|
|
211
|
+
isOptional: false;
|
|
212
|
+
};
|
|
213
|
+
provider: {
|
|
214
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
215
|
+
isOptional: false;
|
|
216
|
+
};
|
|
217
|
+
model: {
|
|
218
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
219
|
+
isOptional: false;
|
|
220
|
+
};
|
|
221
|
+
}>, undefined>;
|
|
222
|
+
declare const DeleteConversationContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
|
|
223
|
+
id: {
|
|
224
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
225
|
+
isOptional: false;
|
|
226
|
+
};
|
|
227
|
+
}>, _contractspec_lib_schema82.SchemaModel<{}>, undefined>;
|
|
228
|
+
declare const ListProvidersContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{}>, _contractspec_lib_schema82.SchemaModel<{
|
|
229
|
+
providers: {
|
|
230
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
231
|
+
isArray: true;
|
|
232
|
+
isOptional: false;
|
|
233
|
+
};
|
|
234
|
+
}>, undefined>;
|
|
235
|
+
declare const ScanContextContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
|
|
236
|
+
path: {
|
|
237
|
+
type: _contractspec_lib_schema82.FieldType<string, string>;
|
|
238
|
+
isOptional: false;
|
|
239
|
+
};
|
|
240
|
+
}>, _contractspec_lib_schema82.SchemaModel<{}>, undefined>;
|
|
241
|
+
//#endregion
|
|
242
|
+
export { DeleteConversationContract, GetConversationContract, ListConversationsContract, ListProvidersContract, ScanContextContract, SendMessageContract, StreamMessageContract };
|
|
243
|
+
//# sourceMappingURL=ai-chat.operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-chat.operations.d.ts","names":[],"sources":["../src/ai-chat.operations.ts"],"sourcesContent":[],"mappings":";;;;cASa,kDAAmB,yCAAA;;UAa9B,0BAAA,CAAA;;EAbW,CAAA;EAaX,OAAA,EAAA;;;;EAb8B,MAAA,EAAA;;;;;;;;cAAA,0BAAA,CAAA;;;;;;;;;;;;;yBAAA;MAAA,CAAA;MAsBnB,SAAA,EAAA;QAaX,IAAA,sCAAA,KAAA,EAAA,MAAA,CAAA;;;;IAbgC,UAAA,EAAA,KAAA;;;IAAA,IAAA,wCAAA,CAAA;MAerB,EAAA,EAAA;QAgBX,IAAA,sCAhBoC,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;gBAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;YAAA,UAAA,EAAA,KAAA;UAAA,CAAA;UAkBzB,IAAA,EAAA;YAqBX,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;sBArBkC,EAAA,KAAA;UAAA,CAAA;;;;;;;;;;;;;;QAAA,OAAA,EAAA,IAAA;QAuBvB,UAAA,EAAA,KAqBX;MAAA,CAAA;;QArBqC,IAAA,sCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;yBAAA;MAAA,CAAA;MAuB1B,KAAA,EAAA;QAyBX,IAAA,sCAzBgC,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,KAAA;;IAAA,CAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EA2BrB,CAAA;CAqBX,CAAA,EAAA,SAAA,CAAA;cA/HW,qBA0GmB,+BA1GE,aA0GF,4BA1GE,WA0GF,CAAA;EAAA,cAAA,EAAA;UA7F9B,0BAAA,CAAA,SA6F8B,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;;;UA1GE,0BAAA,CAAA;;;;cAerB,2BAAyB,4BAAA,CAAA,cAgBpC,0BAAA,CAhBoC,4CAAA;;;;cAAA,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkBzB,sDAAuB,yCAAA;;UAqBlC,0BAAA,CAAA;;;;;UArBkC,0BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBvB,yDAA0B,yCAAA;;UAqBrC,0BAAA,CAAA;;;IArBqC,0BAAA,CAAA;cAuB1B,uBAAqB,4BAAA,CAAA,cAyBhC,0BAAA,CAzBgC,4CAAA;;UAAA,0BAAA,CAAA;;;;;cA2BrB,kDAAmB,yCAAA;;UAqB9B,0BAAA,CAAA;;;IArB8B,0BAAA,CAAA"}
|