@contractspec/module.ai-chat 1.56.0 → 1.57.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.
Files changed (37) hide show
  1. package/dist/ai-chat.feature.d.ts +2 -3
  2. package/dist/ai-chat.feature.d.ts.map +1 -1
  3. package/dist/ai-chat.operations.d.ts +66 -66
  4. package/dist/ai-chat.operations.d.ts.map +1 -1
  5. package/dist/context/context-builder.d.ts +0 -1
  6. package/dist/context/context-builder.d.ts.map +1 -1
  7. package/dist/context/file-operations.d.ts.map +1 -1
  8. package/dist/context/workspace-context.d.ts.map +1 -1
  9. package/dist/core/chat-service.d.ts +0 -1
  10. package/dist/core/chat-service.d.ts.map +1 -1
  11. package/dist/core/conversation-store.d.ts +0 -1
  12. package/dist/core/conversation-store.d.ts.map +1 -1
  13. package/dist/core/message-types.d.ts.map +1 -1
  14. package/dist/events.d.ts.map +1 -1
  15. package/dist/presentation/components/ChatContainer.d.ts.map +1 -1
  16. package/dist/presentation/components/ChatInput.d.ts +2 -2
  17. package/dist/presentation/components/ChatInput.d.ts.map +1 -1
  18. package/dist/presentation/components/ChatInput.js +2 -2
  19. package/dist/presentation/components/ChatInput.js.map +1 -1
  20. package/dist/presentation/components/ChatMessage.d.ts +2 -2
  21. package/dist/presentation/components/ChatMessage.d.ts.map +1 -1
  22. package/dist/presentation/components/CodePreview.d.ts.map +1 -1
  23. package/dist/presentation/components/ContextIndicator.d.ts +2 -2
  24. package/dist/presentation/components/ContextIndicator.d.ts.map +1 -1
  25. package/dist/presentation/components/ModelPicker.d.ts +2 -2
  26. package/dist/presentation/components/ModelPicker.d.ts.map +1 -1
  27. package/dist/presentation/hooks/useChat.d.ts +0 -1
  28. package/dist/presentation/hooks/useChat.d.ts.map +1 -1
  29. package/dist/presentation/hooks/useChat.js +3 -3
  30. package/dist/presentation/hooks/useChat.js.map +1 -1
  31. package/dist/presentation/hooks/useProviders.d.ts +0 -1
  32. package/dist/presentation/hooks/useProviders.d.ts.map +1 -1
  33. package/dist/providers/chat-utilities.d.ts +0 -1
  34. package/dist/providers/chat-utilities.d.ts.map +1 -1
  35. package/dist/schema.d.ts +55 -55
  36. package/dist/schema.d.ts.map +1 -1
  37. package/package.json +15 -15
@@ -1,12 +1,11 @@
1
- import * as _contractspec_lib_contracts4 from "@contractspec/lib.contracts";
1
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
2
 
3
3
  //#region src/ai-chat.feature.d.ts
4
-
5
4
  /**
6
5
  * AI Chat feature module that bundles conversational AI assistance
7
6
  * for ContractSpec development across CLI, VSCode, and Studio.
8
7
  */
9
- declare const AiChatFeature: _contractspec_lib_contracts4.FeatureModuleSpec;
8
+ declare const AiChatFeature: _contractspec_lib_contracts0.FeatureModuleSpec;
10
9
  //#endregion
11
10
  export { AiChatFeature };
12
11
  //# sourceMappingURL=ai-chat.feature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-chat.feature.d.ts","names":[],"sources":["../src/ai-chat.feature.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWA;cAAa,eA8CX,4BAAA,CA9CwB"}
1
+ {"version":3,"file":"ai-chat.feature.d.ts","names":[],"sources":["../src/ai-chat.feature.ts"],"mappings":";;;;;;AAWA;cAAa,aAAA,EA8CX,4BAAA,CA9CwB,iBAAA"}
@@ -1,80 +1,80 @@
1
- import * as _contractspec_lib_contracts5 from "@contractspec/lib.contracts";
2
- import * as _contractspec_lib_schema82 from "@contractspec/lib.schema";
1
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
3
3
 
4
4
  //#region src/ai-chat.operations.d.ts
5
- declare const SendMessageContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
5
+ declare const SendMessageContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
6
6
  conversationId: {
7
- type: _contractspec_lib_schema82.FieldType<string, string>;
7
+ type: _contractspec_lib_schema0.FieldType<string, string>;
8
8
  isOptional: true;
9
9
  };
10
10
  content: {
11
- type: _contractspec_lib_schema82.FieldType<string, string>;
11
+ type: _contractspec_lib_schema0.FieldType<string, string>;
12
12
  isOptional: false;
13
13
  };
14
14
  stream: {
15
- type: _contractspec_lib_schema82.FieldType<boolean, boolean>;
15
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
16
16
  isOptional: true;
17
17
  };
18
- }>, _contractspec_lib_schema82.SchemaModel<{
18
+ }>, _contractspec_lib_schema0.SchemaModel<{
19
19
  message: {
20
- type: _contractspec_lib_schema82.SchemaModel<{
20
+ type: _contractspec_lib_schema0.SchemaModel<{
21
21
  id: {
22
- type: _contractspec_lib_schema82.FieldType<string, string>;
22
+ type: _contractspec_lib_schema0.FieldType<string, string>;
23
23
  isOptional: false;
24
24
  };
25
25
  role: {
26
- type: _contractspec_lib_schema82.FieldType<string, string>;
26
+ type: _contractspec_lib_schema0.FieldType<string, string>;
27
27
  isOptional: false;
28
28
  };
29
29
  content: {
30
- type: _contractspec_lib_schema82.FieldType<string, string>;
30
+ type: _contractspec_lib_schema0.FieldType<string, string>;
31
31
  isOptional: false;
32
32
  };
33
33
  status: {
34
- type: _contractspec_lib_schema82.FieldType<string, string>;
34
+ type: _contractspec_lib_schema0.FieldType<string, string>;
35
35
  isOptional: false;
36
36
  };
37
37
  createdAt: {
38
- type: _contractspec_lib_schema82.FieldType<Date, string>;
38
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
39
39
  isOptional: false;
40
40
  };
41
41
  }>;
42
42
  isOptional: false;
43
43
  };
44
44
  conversation: {
45
- type: _contractspec_lib_schema82.SchemaModel<{
45
+ type: _contractspec_lib_schema0.SchemaModel<{
46
46
  id: {
47
- type: _contractspec_lib_schema82.FieldType<string, string>;
47
+ type: _contractspec_lib_schema0.FieldType<string, string>;
48
48
  isOptional: false;
49
49
  };
50
50
  title: {
51
- type: _contractspec_lib_schema82.FieldType<string, string>;
51
+ type: _contractspec_lib_schema0.FieldType<string, string>;
52
52
  isOptional: true;
53
53
  };
54
54
  status: {
55
- type: _contractspec_lib_schema82.FieldType<string, string>;
55
+ type: _contractspec_lib_schema0.FieldType<string, string>;
56
56
  isOptional: false;
57
57
  };
58
58
  messages: {
59
- type: _contractspec_lib_schema82.SchemaModel<{
59
+ type: _contractspec_lib_schema0.SchemaModel<{
60
60
  id: {
61
- type: _contractspec_lib_schema82.FieldType<string, string>;
61
+ type: _contractspec_lib_schema0.FieldType<string, string>;
62
62
  isOptional: false;
63
63
  };
64
64
  role: {
65
- type: _contractspec_lib_schema82.FieldType<string, string>;
65
+ type: _contractspec_lib_schema0.FieldType<string, string>;
66
66
  isOptional: false;
67
67
  };
68
68
  content: {
69
- type: _contractspec_lib_schema82.FieldType<string, string>;
69
+ type: _contractspec_lib_schema0.FieldType<string, string>;
70
70
  isOptional: false;
71
71
  };
72
72
  status: {
73
- type: _contractspec_lib_schema82.FieldType<string, string>;
73
+ type: _contractspec_lib_schema0.FieldType<string, string>;
74
74
  isOptional: false;
75
75
  };
76
76
  createdAt: {
77
- type: _contractspec_lib_schema82.FieldType<Date, string>;
77
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
78
78
  isOptional: false;
79
79
  };
80
80
  }>;
@@ -82,71 +82,71 @@ declare const SendMessageContract: _contractspec_lib_contracts5.OperationSpec<_c
82
82
  isOptional: false;
83
83
  };
84
84
  provider: {
85
- type: _contractspec_lib_schema82.FieldType<string, string>;
85
+ type: _contractspec_lib_schema0.FieldType<string, string>;
86
86
  isOptional: false;
87
87
  };
88
88
  model: {
89
- type: _contractspec_lib_schema82.FieldType<string, string>;
89
+ type: _contractspec_lib_schema0.FieldType<string, string>;
90
90
  isOptional: false;
91
91
  };
92
92
  }>;
93
93
  isOptional: false;
94
94
  };
95
95
  }>, undefined>;
96
- declare const StreamMessageContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
96
+ declare const StreamMessageContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
97
97
  conversationId: {
98
- type: _contractspec_lib_schema82.FieldType<string, string>;
98
+ type: _contractspec_lib_schema0.FieldType<string, string>;
99
99
  isOptional: true;
100
100
  };
101
101
  content: {
102
- type: _contractspec_lib_schema82.FieldType<string, string>;
102
+ type: _contractspec_lib_schema0.FieldType<string, string>;
103
103
  isOptional: false;
104
104
  };
105
105
  stream: {
106
- type: _contractspec_lib_schema82.FieldType<boolean, boolean>;
106
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
107
107
  isOptional: true;
108
108
  };
109
- }>, _contractspec_lib_schema82.SchemaModel<{
109
+ }>, _contractspec_lib_schema0.SchemaModel<{
110
110
  stream: {
111
- type: _contractspec_lib_schema82.FieldType<string, string>;
111
+ type: _contractspec_lib_schema0.FieldType<string, string>;
112
112
  isOptional: false;
113
113
  };
114
114
  }>, undefined>;
115
- declare const ListConversationsContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{}>, _contractspec_lib_schema82.SchemaModel<{
115
+ declare const ListConversationsContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{}>, _contractspec_lib_schema0.SchemaModel<{
116
116
  conversations: {
117
- type: _contractspec_lib_schema82.SchemaModel<{
117
+ type: _contractspec_lib_schema0.SchemaModel<{
118
118
  id: {
119
- type: _contractspec_lib_schema82.FieldType<string, string>;
119
+ type: _contractspec_lib_schema0.FieldType<string, string>;
120
120
  isOptional: false;
121
121
  };
122
122
  title: {
123
- type: _contractspec_lib_schema82.FieldType<string, string>;
123
+ type: _contractspec_lib_schema0.FieldType<string, string>;
124
124
  isOptional: true;
125
125
  };
126
126
  status: {
127
- type: _contractspec_lib_schema82.FieldType<string, string>;
127
+ type: _contractspec_lib_schema0.FieldType<string, string>;
128
128
  isOptional: false;
129
129
  };
130
130
  messages: {
131
- type: _contractspec_lib_schema82.SchemaModel<{
131
+ type: _contractspec_lib_schema0.SchemaModel<{
132
132
  id: {
133
- type: _contractspec_lib_schema82.FieldType<string, string>;
133
+ type: _contractspec_lib_schema0.FieldType<string, string>;
134
134
  isOptional: false;
135
135
  };
136
136
  role: {
137
- type: _contractspec_lib_schema82.FieldType<string, string>;
137
+ type: _contractspec_lib_schema0.FieldType<string, string>;
138
138
  isOptional: false;
139
139
  };
140
140
  content: {
141
- type: _contractspec_lib_schema82.FieldType<string, string>;
141
+ type: _contractspec_lib_schema0.FieldType<string, string>;
142
142
  isOptional: false;
143
143
  };
144
144
  status: {
145
- type: _contractspec_lib_schema82.FieldType<string, string>;
145
+ type: _contractspec_lib_schema0.FieldType<string, string>;
146
146
  isOptional: false;
147
147
  };
148
148
  createdAt: {
149
- type: _contractspec_lib_schema82.FieldType<Date, string>;
149
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
150
150
  isOptional: false;
151
151
  };
152
152
  }>;
@@ -154,11 +154,11 @@ declare const ListConversationsContract: _contractspec_lib_contracts5.OperationS
154
154
  isOptional: false;
155
155
  };
156
156
  provider: {
157
- type: _contractspec_lib_schema82.FieldType<string, string>;
157
+ type: _contractspec_lib_schema0.FieldType<string, string>;
158
158
  isOptional: false;
159
159
  };
160
160
  model: {
161
- type: _contractspec_lib_schema82.FieldType<string, string>;
161
+ type: _contractspec_lib_schema0.FieldType<string, string>;
162
162
  isOptional: false;
163
163
  };
164
164
  }>;
@@ -166,44 +166,44 @@ declare const ListConversationsContract: _contractspec_lib_contracts5.OperationS
166
166
  isOptional: false;
167
167
  };
168
168
  }>, undefined>;
169
- declare const GetConversationContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
169
+ declare const GetConversationContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
170
170
  id: {
171
- type: _contractspec_lib_schema82.FieldType<string, string>;
171
+ type: _contractspec_lib_schema0.FieldType<string, string>;
172
172
  isOptional: false;
173
173
  };
174
- }>, _contractspec_lib_schema82.SchemaModel<{
174
+ }>, _contractspec_lib_schema0.SchemaModel<{
175
175
  id: {
176
- type: _contractspec_lib_schema82.FieldType<string, string>;
176
+ type: _contractspec_lib_schema0.FieldType<string, string>;
177
177
  isOptional: false;
178
178
  };
179
179
  title: {
180
- type: _contractspec_lib_schema82.FieldType<string, string>;
180
+ type: _contractspec_lib_schema0.FieldType<string, string>;
181
181
  isOptional: true;
182
182
  };
183
183
  status: {
184
- type: _contractspec_lib_schema82.FieldType<string, string>;
184
+ type: _contractspec_lib_schema0.FieldType<string, string>;
185
185
  isOptional: false;
186
186
  };
187
187
  messages: {
188
- type: _contractspec_lib_schema82.SchemaModel<{
188
+ type: _contractspec_lib_schema0.SchemaModel<{
189
189
  id: {
190
- type: _contractspec_lib_schema82.FieldType<string, string>;
190
+ type: _contractspec_lib_schema0.FieldType<string, string>;
191
191
  isOptional: false;
192
192
  };
193
193
  role: {
194
- type: _contractspec_lib_schema82.FieldType<string, string>;
194
+ type: _contractspec_lib_schema0.FieldType<string, string>;
195
195
  isOptional: false;
196
196
  };
197
197
  content: {
198
- type: _contractspec_lib_schema82.FieldType<string, string>;
198
+ type: _contractspec_lib_schema0.FieldType<string, string>;
199
199
  isOptional: false;
200
200
  };
201
201
  status: {
202
- type: _contractspec_lib_schema82.FieldType<string, string>;
202
+ type: _contractspec_lib_schema0.FieldType<string, string>;
203
203
  isOptional: false;
204
204
  };
205
205
  createdAt: {
206
- type: _contractspec_lib_schema82.FieldType<Date, string>;
206
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
207
207
  isOptional: false;
208
208
  };
209
209
  }>;
@@ -211,33 +211,33 @@ declare const GetConversationContract: _contractspec_lib_contracts5.OperationSpe
211
211
  isOptional: false;
212
212
  };
213
213
  provider: {
214
- type: _contractspec_lib_schema82.FieldType<string, string>;
214
+ type: _contractspec_lib_schema0.FieldType<string, string>;
215
215
  isOptional: false;
216
216
  };
217
217
  model: {
218
- type: _contractspec_lib_schema82.FieldType<string, string>;
218
+ type: _contractspec_lib_schema0.FieldType<string, string>;
219
219
  isOptional: false;
220
220
  };
221
221
  }>, undefined>;
222
- declare const DeleteConversationContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
222
+ declare const DeleteConversationContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
223
223
  id: {
224
- type: _contractspec_lib_schema82.FieldType<string, string>;
224
+ type: _contractspec_lib_schema0.FieldType<string, string>;
225
225
  isOptional: false;
226
226
  };
227
- }>, _contractspec_lib_schema82.SchemaModel<{}>, undefined>;
228
- declare const ListProvidersContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{}>, _contractspec_lib_schema82.SchemaModel<{
227
+ }>, _contractspec_lib_schema0.SchemaModel<{}>, undefined>;
228
+ declare const ListProvidersContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{}>, _contractspec_lib_schema0.SchemaModel<{
229
229
  providers: {
230
- type: _contractspec_lib_schema82.FieldType<string, string>;
230
+ type: _contractspec_lib_schema0.FieldType<string, string>;
231
231
  isArray: true;
232
232
  isOptional: false;
233
233
  };
234
234
  }>, undefined>;
235
- declare const ScanContextContract: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema82.SchemaModel<{
235
+ declare const ScanContextContract: _contractspec_lib_contracts0.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
236
236
  path: {
237
- type: _contractspec_lib_schema82.FieldType<string, string>;
237
+ type: _contractspec_lib_schema0.FieldType<string, string>;
238
238
  isOptional: false;
239
239
  };
240
- }>, _contractspec_lib_schema82.SchemaModel<{}>, undefined>;
240
+ }>, _contractspec_lib_schema0.SchemaModel<{}>, undefined>;
241
241
  //#endregion
242
242
  export { DeleteConversationContract, GetConversationContract, ListConversationsContract, ListProvidersContract, ScanContextContract, SendMessageContract, StreamMessageContract };
243
243
  //# sourceMappingURL=ai-chat.operations.d.ts.map
@@ -1 +1 @@
1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SAAA;;;IArBqC,yBAAA,CAAA,WAAA;AAAA,cAuB1B,qBAAA,EAAqB,4BAAA,CAAA,aAAA,CAyBhC,yBAAA,CAzBgC,WAAA,gCAAA,WAAA;;UAAA,yBAAA,CAAA,SAAA;;;;;cA2BrB,mBAAA,+BAAmB,aAAA,2BAAA,WAAA;;UAqB9B,yBAAA,CAAA,SAAA;;;IArB8B,yBAAA,CAAA,WAAA"}
@@ -1,7 +1,6 @@
1
1
  import { WorkspaceContext } from "./workspace-context.js";
2
2
 
3
3
  //#region src/context/context-builder.d.ts
4
-
5
4
  /**
6
5
  * Context entry for a file or spec
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"context-builder.d.ts","names":[],"sources":["../../src/context/context-builder.ts"],"sourcesContent":[],"mappings":";;;;AA0GA;;;AAU8C,UA1G7B,YAAA,CA0G6B;EAAY,IAAA,EAAA,MAAA,GAAA,MAAA,GAAA,WAAA;EAwI1C,IAAA,EAAA,MAAA;;;;;;;;UAvOC,YAAA;WACN;;;;;;;UAQM,qBAAA;;;;;;;;;;;;;cA4EJ,cAAA;;uBAGU;;;;kBAON,wBAA6B;;;;;;;;;iBAwI9B,oBAAA,UACL,mBACR"}
1
+ {"version":3,"file":"context-builder.d.ts","names":[],"sources":["../../src/context/context-builder.ts"],"mappings":";;;;;;UAUiB,YAAA;EACf,IAAA;EACA,IAAA;EACA,OAAA;EACA,OAAA;EACA,SAAA;AAAA;;;;UAMe,YAAA;EACf,OAAA,EAAS,YAAA;EACT,OAAA;EACA,mBAAA;AAAA;AAMF;;;AAAA,UAAiB,qBAAA;EAEf;EAAA,SAAA;EAIA;EAFA,KAAA;EAIY;EAFZ,YAAA;EAsEW;EApEX,YAAA;AAAA;;;;cAoEW,cAAA;EAAA,iBACM,OAAA;cAEL,OAAA,EAAS,gBAAA;;;;EAOrB,KAAA,CAAM,OAAA,GAAS,qBAAA,GAA6B,YAAA;EAA7B;;;EAAA,QAkGP,YAAA;AAAA;;AAsCV;;iBAAgB,oBAAA,CACd,OAAA,EAAS,gBAAA,GACR,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"file-operations.d.ts","names":[],"sources":["../../src/context/file-operations.ts"],"sourcesContent":[],"mappings":";;AASA;AAUA;AASA;AASA;AAUA;;;AAcwB,UApDP,cAAA,CAoDO;EAKI,OAAA,EAAA,OAAA;EAQvB,IAAA,EAAA,MAAA;EAAO,OAAA,CAAA,EAAA,MAAA;EAMC,KAAA,CAAA,EAAA,MAAA;;;;;AA4ByC,UAzFrC,eAAA,CAyFqC;EA0B1B,OAAA,EAAA,OAAA;EAA0B,IAAA,EAAA,MAAA;EAAR,KAAA,CAAA,EAAA,MAAA;;AAyF9C;;;UAnMiB,aAAA;;;;;;;;UASA,mBAAA;aACJ;;;;;;;;UASI,UAAA;;;;0BAIS;;;;4CAKkB;;;;wBAKpB;;;;4BAKI;;;;;;;MAQvB;;;;;cAMQ,cAAA;;;;kBAEY;;;;8BAQW,QAAQ;;;;gDAkBU,QAAQ;;;;sBA0BlC,kBAAkB,QAAQ;;;;;;;;;iBAyFtC,wBAAA,gDAGb"}
1
+ {"version":3,"file":"file-operations.d.ts","names":[],"sources":["../../src/context/file-operations.ts"],"mappings":";;AASA;;;;;;;UAAiB,cAAA;EACf,OAAA;EACA,IAAA;EACA,OAAA;EACA,KAAA;AAAA;;;;UAMe,eAAA;EACf,OAAA;EACA,IAAA;EACA,KAAA;AAAA;;;;UAMe,aAAA;EACf,IAAA;EACA,IAAA;EACA,OAAA;AAAA;;;;UAMe,mBAAA;EACf,SAAA,EAAW,aAAA;EACX,OAAA;EACA,OAAA;EACA,KAAA;AAAA;;AAMF;;UAAiB,UAAA;EAIS;;;EAAxB,QAAA,CAAS,IAAA,WAAe,OAAA;EAuBrB;;;EAlBH,SAAA,CAAU,IAAA,UAAc,OAAA,WAAkB,OAAA;EALjC;;;EAUT,MAAA,CAAO,IAAA,WAAe,OAAA;EALE;;;EAUxB,UAAA,CAAW,IAAA,WAAe,OAAA;EALJ;;;EAUtB,SAAA,CACE,SAAA,UACA,OAAA;IAAY,SAAA;IAAqB,OAAA;EAAA,IAChC,OAAA;AAAA;;;;cAMQ,cAAA;EAAA,iBAEQ,EAAA;EAAA,iBACA,aAAA;EAAA,iBACA,WAAA;cAFA,EAAA,EAAI,UAAA,EACJ,aAAA,UACA,WAAA;EAMuB;;;EAApC,IAAA,CAAK,YAAA,WAAuB,OAAA,CAAQ,cAAA;EA4ChB;;;EA1BpB,KAAA,CAAM,YAAA,UAAsB,OAAA,WAAkB,OAAA,CAAQ,eAAA;EA0BT;;;EAA7C,OAAA,CAAQ,UAAA,EAAY,aAAA,KAAkB,OAAA,CAAQ,mBAAA;;;;UA+E5C,WAAA;AAAA;;;;iBAUM,wBAAA,CACd,aAAA,UACA,WAAA,aACC,cAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-context.d.ts","names":[],"sources":["../../src/context/workspace-context.ts"],"sourcesContent":[],"mappings":";;AAUA;AAYA;AAYA;AAoBA;AAgBA;;;;AAkCc,UA9FG,QAAA,CA8FH;EAOI,IAAA,EAAA,MAAA;EAOA,OAAA,EAAA,MAAA;EAOF,IAAA,EAAA,SAAA,GAAA,OAAA,GAAA,OAAA,GAAA,cAAA;EA8DY,IAAA,EAAA,MAAA;EAaA,WAAA,CAAA,EAAA,MAAA;EAAQ,IAAA,CAAA,EAAA,MAAA,EAAA;AAapC;;;;AAGG,UAlMc,QAAA,CAkMd;EAAO,IAAA,EAAA,MAAA;;;;;;;;;;UAtLO,gBAAA;;;;;;;;;;;;;;;;;;;UAoBA,sBAAA;;;;;;;;;;;;;;;cAgBJ,gBAAA;;;;;;sBAQS;;;;gBAQA;;;;cAWR;;;;cAOA;;;;kBAOI;;;;kBAOA;;;;gBAOF;;;;;;;;4BA8DY;;;;4BAaA;;;;;iBAaN,sBAAA,yBAEV,QAAQ,0BACjB,QAAQ"}
1
+ {"version":3,"file":"workspace-context.d.ts","names":[],"sources":["../../src/context/workspace-context.ts"],"mappings":";;AAUA;;;;;;;;UAAiB,QAAA;EACf,IAAA;EACA,OAAA;EACA,IAAA;EACA,IAAA;EACA,WAAA;EACA,IAAA;AAAA;;;;UAMe,QAAA;EACf,IAAA;EACA,YAAA;EACA,IAAA;EACA,SAAA;EACA,IAAA;EACA,MAAA;AAAA;;;;UAMe,gBAAA;EACf,IAAA;EACA,IAAA;EACA,KAAA;IACE,KAAA;IACA,QAAA;IACA,OAAA;IACA,MAAA;IACA,aAAA;EAAA;EAEF,KAAA;IACE,KAAA;IACA,UAAA;IACA,SAAA;EAAA;AAAA;;;;UAOa,sBAAA;EAUf;EARA,aAAA;EAQW;EANX,eAAA;EAY2B;EAV3B,eAAA;EAkBoB;EAhBpB,WAAA;EAmCY;EAjCZ,WAAA;AAAA;;;;cAMW,gBAAA;EAAA,SACF,aAAA;EAAA,SACA,WAAA;EAAA,QAED,KAAA;EAAA,QACA,KAAA;EAAA,QACA,WAAA;cAEI,MAAA,EAAQ,sBAAA;EAFZ;;;EAUF,UAAA,CAAA,GAAc,OAAA;EAAd;;;EAWN,QAAA,CAAA,GAAY,QAAA;EAOZ;;;EAAA,QAAA,CAAA,GAAY,QAAA;EAOH;;;EAAT,QAAA,CAAS,KAAA,EAAO,QAAA;EAchB;;;EAPA,QAAA,CAAS,KAAA,EAAO,QAAA;EAqEN;;;EA9DV,UAAA,CAAA,GAAc,gBAAA;EA2EY;;;EA3C1B,iBAAA,CAAA;EAwD0C;;;EA1B1C,SAAA,CAAU,KAAA,WAAgB,QAAA;EA6BjB;;;EAhBT,SAAA,CAAU,KAAA,WAAgB,QAAA;AAAA;;;;iBAaN,sBAAA,CACpB,IAAA,UACA,OAAA,GAAU,OAAA,CAAQ,sBAAA,IACjB,OAAA,CAAQ,gBAAA"}
@@ -4,7 +4,6 @@ import { ConversationStore } from "./conversation-store.js";
4
4
  import { Provider } from "@contractspec/lib.ai-providers";
5
5
 
6
6
  //#region src/core/chat-service.d.ts
7
-
8
7
  /**
9
8
  * Configuration for ChatService
10
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chat-service.d.ts","names":[],"sources":["../../src/core/chat-service.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAmBA;AAEY,UAFK,iBAAA,CAEL;EAEA;EAEF,QAAA,EAJE,QAIF;EAAiB;EA8Bd,OAAA,CAAA,EAhCD,gBAgCY;EAWF;EAYA,KAAA,CAAA,EArDZ,iBAqDY;EAA6B;EAAR,YAAA,CAAA,EAAA,MAAA;EA6EnB;EAA6B,kBAAA,CAAA,EAAA,MAAA;EAAR;EAqGhC,OAAA,CAAA,EAAA,CAAA,KAAA,EAAA;IAAR,WAAA,EAAA,MAAA;IAUS,YAAA,EAAA,MAAA;EAAR,CAAA,EAAA,GAAA,IAAA;;;AA2DN;;cA9Qa,WAAA;;;;;;;sBAWS;;;;gBAYA,qBAAqB,QAAQ;;;;kBA6E3B,qBAAqB,QAAQ;;;;2CAqGhD,QAAQ;;;;;;;MAUP,QAAQ;;;;8CAUsC;;;;;;;;;iBAiDpC,iBAAA,SAA0B,oBAAoB"}
1
+ {"version":3,"file":"chat-service.d.ts","names":[],"sources":["../../src/core/chat-service.ts"],"mappings":";;;;;;;;AAmBA;UAAiB,iBAAA;;EAEf,QAAA,EAAU,QAAA;EAEA;EAAV,OAAA,GAAU,gBAAA;EAEe;EAAzB,KAAA,GAAQ,iBAAA;EAJR;EAMA,YAAA;EAJA;EAMA,kBAAA;EAJA;EAMA,OAAA,IAAW,KAAA;IAAS,WAAA;IAAqB,YAAA;EAAA;AAAA;;;;cAwB9B,WAAA;EAAA,iBACM,QAAA;EAAA,iBACA,OAAA;EAAA,iBACA,KAAA;EAAA,iBACA,YAAA;EAAA,iBACA,kBAAA;EAAA,iBACA,OAAA;cAKL,MAAA,EAAQ,iBAAA;EAyFE;;;EA7EhB,IAAA,CAAK,OAAA,EAAS,kBAAA,GAAqB,OAAA,CAAQ,iBAAA;EAkL9C;;;EArGG,MAAA,CAAO,OAAA,EAAS,kBAAA,GAAqB,OAAA,CAAQ,mBAAA;EAyHM;;;EAtBnD,eAAA,CACJ,cAAA,WACC,OAAA,CAAQ,gBAAA;EAtMM;;;EA6MX,iBAAA,CAAkB,OAAA;IACtB,KAAA;IACA,MAAA;EAAA,IACE,OAAA,CAAQ,gBAAA;EA5LN;;;EAsMA,kBAAA,CAAmB,cAAA,WAAyB,OAAA;EAtMD;;;EAAA,QA6MzC,WAAA;AAAA;;;;iBA0CM,iBAAA,CAAkB,MAAA,EAAQ,iBAAA,GAAoB,WAAA"}
@@ -1,7 +1,6 @@
1
1
  import { ChatConversation, ChatMessage, ConversationStatus } from "./message-types.js";
2
2
 
3
3
  //#region src/core/conversation-store.d.ts
4
-
5
4
  /**
6
5
  * Interface for conversation persistence
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"conversation-store.d.ts","names":[],"sources":["../../src/core/conversation-store.ts"],"sourcesContent":[],"mappings":";;;;;;;AAsBkB,UAVD,iBAAA,CAUC;EACL;;;EAQP,GAAA,CAAA,cAAA,EAAA,MAAA,CAAA,EAfyB,OAezB,CAfiC,gBAejC,GAAA,IAAA,CAAA;EADO;;;EAWP,MAAA,CAAA,YAAA,EAnBY,IAmBZ,CAnBiB,gBAmBjB,EAAA,IAAA,GAAA,WAAA,GAAA,WAAA,CAAA,CAAA,EAlBD,OAkBC,CAlBO,gBAkBP,CAAA;EADO;;;EAYQ,MAAA,CAAA,cAAA,EAAA,MAAA,EAAA,OAAA,EAtBR,OAsBQ,CArBf,IAqBe,CArBV,gBAqBU,EAAA,OAAA,GAAA,QAAA,GAAA,SAAA,GAAA,UAAA,CAAA,CAAA,CAAA,EAnBhB,OAmBgB,CAnBR,gBAmBQ,GAAA,IAAA,CAAA;EAAR;;;EAMqB,aAAA,CAAA,cAAA,EAAA,MAAA,EAAA,OAAA,EAlBrB,IAkBqB,CAjB5B,WAiB4B,EAAA,IAAA,GAAA,gBAAA,GAAA,WAAA,GAAA,WAAA,CAAA,CAAA,EAd7B,OAc6B,CAdrB,WAcqB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EACG,IAAA,CAAA,EAAA,MAAA;;;;;AAwBI,UAzGA,aAAA,CAyGkB;EAalB,EAAA,EAAA,MAAA;EAYA,QAAA,EAAA,MAAA;EAQA,IAAA,EAAA,MAAA;;;;;;;;UA9HA,YAAA;;;QAGT;;;;;;;;UASS,UAAA;;;;;;;;;;UAWA,WAAA;;;QAGT;;UAEE;aACG;aACA;gBAGG;eACD;cACD;YACF;;;;;;;;;;aAkBC;;;;;KAMD,kBAAA;;;;UAKK,gBAAA;;;UAGP;aACG;aACA;;;;;YAWD;;aAMC;;;;;UAMI,kBAAA;;;gBAGD;;;;;;;;;UAUC,eAAA;;;aAGJ;WACF;;;;;;;;;;;;;UAQM,iBAAA;WACN;gBACK;;;;;UAMC,mBAAA;;;UAGP,cAAc"}
1
+ {"version":3,"file":"message-types.d.ts","names":[],"sources":["../../src/core/message-types.ts"],"mappings":";;AAOA;;;;;KAAY,QAAA;;;;KAKA,aAAA;AAKZ;;;AAAA,UAAiB,cAAA;EACf,EAAA;EACA,IAAA;EACA,IAAA;EACA,OAAA;EACA,QAAA;EACA,IAAA;EACA,IAAA;AAAA;;AAMF;;UAAiB,aAAA;EACf,EAAA;EACA,QAAA;EACA,IAAA;EACA,QAAA;EACA,SAAA;EACA,OAAA;AAAA;;;AAMF;UAAiB,YAAA;EACf,EAAA;EACA,IAAA;EACA,IAAA,EAAM,MAAA;EACN,MAAA;EACA,MAAA;EACA,KAAA;AAAA;;;;UAMe,UAAA;EACf,EAAA;EACA,KAAA;EACA,GAAA;EACA,OAAA;EACA,IAAA;AAAA;;;;UAMe,WAAA;EACf,EAAA;EACA,cAAA;EACA,IAAA,EAAM,QAAA;EACN,OAAA;EACA,MAAA,EAAQ,aAAA;EACR,SAAA,EAAW,IAAA;EACX,SAAA,EAAW,IAAA;EAGX,WAAA,GAAc,cAAA;EACd,UAAA,GAAa,aAAA;EACb,SAAA,GAAY,YAAA;EACZ,OAAA,GAAU,UAAA;EAGV,SAAA;EAGA,KAAA;IACE,WA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AA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;;;;EAVmC,CAAA;EAAA,SAAA,EAAA;IAYxB,IAAA,qCAeX,KAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;CAfmC,CAAA,CAAA;AAAA,cAZxB,wBAYwB,EAZA,4BAAA,CAAA,SAYA,2BAZA,WAYA,CAAA;EAiBxB,EAAA,EAAA;IAgBX,IAAA,EAnCA,yBAAA,CAAA,SAmCA,CAAA,MAAA,EAAA,MAAA,CAAA;;;EAhByB,KAAA,EAAA;IAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAjBd,0BAAwB,4BAAA,CAAA,oCAAA;;UAenC,yBAAA,CAAA;;;;cAEW,gBAAc,4BAAA,CAAA,oCAAA;;UAgBzB,yBAAA,CAAA"}
1
+ {"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"mappings":";;;;cAIa,gBAAA,EAAgB,4BAAA,CAAA,SAAA,2BAAA,WAAA;;UAU3B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAEW,oBAAA,EAAoB,4BAAA,CAAA,SAAA,2BAAA,WAAA;;UAU/B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAEW,wBAAA,EAAwB,4BAAA,CAAA,SAAA,2BAAA,WAAA;;UAUnC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,wBAAA,EAAwB,4BAAA,CAAA,SAAA,2BAAA,WAAA;;UAenC,yBAAA,CAAA,SAAA;;;;cAEW,cAAA,EAAc,4BAAA,CAAA,SAAA,2BAAA,WAAA;;UAgBzB,yBAAA,CAAA,SAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContainer.d.ts","names":[],"sources":["../../../src/presentation/components/ChatContainer.tsx"],"sourcesContent":[],"mappings":";;;;UAMiB,kBAAA;YACL,KAAA,CAAM;;EADD;EAUD,gBAAa,CAAA,EAAA,OAAA;;;;;AAIR,iBAJL,aAAA,CAIK;EAAA,QAAA;EAAA,SAAA;EAAA;AAAA,CAAA,EAAlB,kBAAkB,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ChatContainer.d.ts","names":[],"sources":["../../../src/presentation/components/ChatContainer.tsx"],"mappings":";;;;UAMiB,kBAAA;EACf,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,SAAA;EAFe;EAIf,gBAAA;AAAA;;;;iBAMc,aAAA,CAAA;EACd,QAAA;EACA,SAAA;EACA;AAAA,GACC,kBAAA,GAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ChatAttachment } from "../../core/message-types.js";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/presentation/components/ChatInput.d.ts
5
5
  interface ChatInputProps {
@@ -29,7 +29,7 @@ declare function ChatInput({
29
29
  className,
30
30
  showAttachments,
31
31
  maxAttachments
32
- }: ChatInputProps): react_jsx_runtime2.JSX.Element;
32
+ }: ChatInputProps): react_jsx_runtime0.JSX.Element;
33
33
  //#endregion
34
34
  export { ChatInput };
35
35
  //# sourceMappingURL=ChatInput.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatInput.d.ts","names":[],"sources":["../../../src/presentation/components/ChatInput.tsx"],"sourcesContent":[],"mappings":";;;;UASiB,cAAA;;0CAEyB;EAFzB;EAoBD,QAAA,CAAA,EAAA,OAAS;EACvB;EACA,SAAA,CAAA,EAAA,OAAA;EACA;EACA,WAAA,CAAA,EAAA,MAAA;EACA;EACA,SAAA,CAAA,EAAA,MAAA;EACA;EACC,eAAA,CAAA,EAAA,OAAA;EAAc;EAAA,cAAA,CAAA,EAAA,MAAA;;;;;iBARD,SAAA;;;;;;;;GAQb,iBAAc,kBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"ChatInput.d.ts","names":[],"sources":["../../../src/presentation/components/ChatInput.tsx"],"mappings":";;;;UASiB,cAAA;;EAEf,MAAA,GAAS,OAAA,UAAiB,WAAA,GAAc,cAAA;EAFzB;EAIf,QAAA;;EAEA,SAAA;EAJA;EAMA,WAAA;EANwC;EAQxC,SAAA;EANA;EAQA,eAAA;EAJA;EAMA,cAAA;AAAA;;;;iBAMc,SAAA,CAAA;EACd,MAAA;EACA,QAAA;EACA,SAAA;EACA,WAAA;EACA,SAAA;EACA,eAAA;EACA;AAAA,GACC,cAAA,GAAc,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -43,7 +43,7 @@ function ChatInput({ onSend, disabled = false, isLoading = false, placeholder =
43
43
  const newAttachments = [];
44
44
  for (const file of Array.from(files)) {
45
45
  if (attachments.length + newAttachments.length >= maxAttachments) break;
46
- const content$1 = await file.text();
46
+ const content = await file.text();
47
47
  const extension = file.name.split(".").pop()?.toLowerCase() ?? "";
48
48
  const isCode = [
49
49
  "ts",
@@ -59,7 +59,7 @@ function ChatInput({ onSend, disabled = false, isLoading = false, placeholder =
59
59
  id: `att_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`,
60
60
  type: isCode ? "code" : "file",
61
61
  name: file.name,
62
- content: content$1,
62
+ content,
63
63
  mimeType: file.type,
64
64
  size: file.size
65
65
  });
@@ -1 +1 @@
1
- {"version":3,"file":"ChatInput.js","names":["content"],"sources":["../../../src/presentation/components/ChatInput.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '@contractspec/lib.ui-kit-web/ui/utils';\nimport { Textarea } from '@contractspec/lib.design-system';\nimport { Button } from '@contractspec/lib.design-system';\nimport { Send, Paperclip, X, Loader2, FileText, Code } from 'lucide-react';\nimport type { ChatAttachment } from '../../core/message-types';\n\nexport interface ChatInputProps {\n /** Called when a message is sent */\n onSend: (content: string, attachments?: ChatAttachment[]) => void;\n /** Whether input is disabled (e.g., during streaming) */\n disabled?: boolean;\n /** Whether currently loading/streaming */\n isLoading?: boolean;\n /** Placeholder text */\n placeholder?: string;\n /** Additional class name */\n className?: string;\n /** Show attachment button */\n showAttachments?: boolean;\n /** Max attachments allowed */\n maxAttachments?: number;\n}\n\n/**\n * Chat input component with attachment support\n */\nexport function ChatInput({\n onSend,\n disabled = false,\n isLoading = false,\n placeholder = 'Type a message...',\n className,\n showAttachments = true,\n maxAttachments = 5,\n}: ChatInputProps) {\n const [content, setContent] = React.useState('');\n const [attachments, setAttachments] = React.useState<ChatAttachment[]>([]);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const canSend = content.trim().length > 0 || attachments.length > 0;\n\n const handleSubmit = React.useCallback(\n (e?: React.FormEvent) => {\n e?.preventDefault();\n if (!canSend || disabled || isLoading) return;\n\n onSend(content.trim(), attachments.length > 0 ? attachments : undefined);\n setContent('');\n setAttachments([]);\n\n // Focus back on textarea\n textareaRef.current?.focus();\n },\n [canSend, content, attachments, disabled, isLoading, onSend]\n );\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n // Submit on Enter (without Shift)\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleSubmit();\n }\n },\n [handleSubmit]\n );\n\n const handleFileSelect = React.useCallback(\n async (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n if (!files) return;\n\n const newAttachments: ChatAttachment[] = [];\n\n for (const file of Array.from(files)) {\n if (attachments.length + newAttachments.length >= maxAttachments) break;\n\n const content = await file.text();\n const extension = file.name.split('.').pop()?.toLowerCase() ?? '';\n const isCode = [\n 'ts',\n 'tsx',\n 'js',\n 'jsx',\n 'py',\n 'go',\n 'rs',\n 'java',\n ].includes(extension);\n\n newAttachments.push({\n id: `att_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`,\n type: isCode ? 'code' : 'file',\n name: file.name,\n content,\n mimeType: file.type,\n size: file.size,\n });\n }\n\n setAttachments((prev) => [...prev, ...newAttachments]);\n\n // Reset file input\n e.target.value = '';\n },\n [attachments.length, maxAttachments]\n );\n\n const removeAttachment = React.useCallback((id: string) => {\n setAttachments((prev) => prev.filter((a) => a.id !== id));\n }, []);\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {/* Attachments preview */}\n {attachments.length > 0 && (\n <div className=\"flex flex-wrap gap-2\">\n {attachments.map((attachment) => (\n <div\n key={attachment.id}\n className={cn(\n 'flex items-center gap-1.5 rounded-md px-2 py-1',\n 'bg-muted text-muted-foreground text-sm'\n )}\n >\n {attachment.type === 'code' ? (\n <Code className=\"h-3.5 w-3.5\" />\n ) : (\n <FileText className=\"h-3.5 w-3.5\" />\n )}\n <span className=\"max-w-[150px] truncate\">{attachment.name}</span>\n <button\n type=\"button\"\n onClick={() => removeAttachment(attachment.id)}\n className=\"hover:text-foreground\"\n aria-label={`Remove ${attachment.name}`}\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n ))}\n </div>\n )}\n\n {/* Input form */}\n <form onSubmit={handleSubmit} className=\"flex items-end gap-2\">\n {/* Attachment button */}\n {showAttachments && (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n accept=\".ts,.tsx,.js,.jsx,.json,.md,.txt,.py,.go,.rs,.java,.yaml,.yml\"\n onChange={handleFileSelect}\n className=\"hidden\"\n aria-label=\"Attach files\"\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onPress={() => fileInputRef.current?.click()}\n disabled={disabled || attachments.length >= maxAttachments}\n aria-label=\"Attach files\"\n >\n <Paperclip className=\"h-4 w-4\" />\n </Button>\n </>\n )}\n\n {/* Text input */}\n <div className=\"relative flex-1\">\n <Textarea\n value={content}\n onChange={(e) => setContent(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled}\n className={cn(\n 'max-h-[200px] min-h-[44px] resize-none pr-12',\n 'focus-visible:ring-1'\n )}\n rows={1}\n aria-label=\"Chat message\"\n />\n </div>\n\n {/* Send button */}\n <Button\n type=\"submit\"\n disabled={!canSend || disabled || isLoading}\n size=\"sm\"\n aria-label={isLoading ? 'Sending...' : 'Send message'}\n >\n {isLoading ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Send className=\"h-4 w-4\" />\n )}\n </Button>\n </form>\n\n {/* Helper text */}\n <p className=\"text-muted-foreground text-xs\">\n Press Enter to send, Shift+Enter for new line\n </p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,SAAgB,UAAU,EACxB,QACA,WAAW,OACX,YAAY,OACZ,cAAc,qBACd,WACA,kBAAkB,MAClB,iBAAiB,KACA;CACjB,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,GAAG;CAChD,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAA2B,EAAE,CAAC;CAC1E,MAAM,cAAc,MAAM,OAA4B,KAAK;CAC3D,MAAM,eAAe,MAAM,OAAyB,KAAK;CAEzD,MAAM,UAAU,QAAQ,MAAM,CAAC,SAAS,KAAK,YAAY,SAAS;CAElE,MAAM,eAAe,MAAM,aACxB,MAAwB;AACvB,KAAG,gBAAgB;AACnB,MAAI,CAAC,WAAW,YAAY,UAAW;AAEvC,SAAO,QAAQ,MAAM,EAAE,YAAY,SAAS,IAAI,cAAc,OAAU;AACxE,aAAW,GAAG;AACd,iBAAe,EAAE,CAAC;AAGlB,cAAY,SAAS,OAAO;IAE9B;EAAC;EAAS;EAAS;EAAa;EAAU;EAAW;EAAO,CAC7D;CAED,MAAM,gBAAgB,MAAM,aACzB,MAA2B;AAE1B,MAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACpC,KAAE,gBAAgB;AAClB,iBAAc;;IAGlB,CAAC,aAAa,CACf;CAED,MAAM,mBAAmB,MAAM,YAC7B,OAAO,MAA2C;EAChD,MAAM,QAAQ,EAAE,OAAO;AACvB,MA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N;KACE;GAIR,qBAAC;IAAK,UAAU;IAAc,WAAU;;KAErC,mBACC,4CACE,oBAAC;MACC,KAAK;MACL,MAAK;MACL;MACA,QAAO;MACP,UAAU;MACV,WAAU;MACV,cAAW;OACX,EACF,oBAAC;MACC,MAAK;MACL,SAAQ;MACR,MAAK;MACL,eAAe,aAAa,SAAS,OAAO;MAC5C,UAAU,YAAY,YAAY,UAAU;MAC5C,cAAW;gBAEX,oBAAC,aAAU,WAAU,YAAY;OAC1B,IACR;KAIL,oBAAC;MAAI,WAAU;gBACb,oBAAC;OACC,OAAO;OACP,WAAW,MAAM,WAAW,EAAE,OAAO,MAAM;OAC3C,WAAW;OACE;OACH;OACV,WAAW,GACT,gDACA,uBACD;OACD,MAAM;OACN,cAAW;QACX;OACE;KAGN,oBAAC;MACC,MAAK;MACL,UAAU,CAAC,WAAW,YAAY;MAClC,MAAK;MACL,cAAY,YAAY,eAAe;gBAEtC,YACC,oBAAC,WAAQ,WAAU,yBAAyB,GAE5C,oBAAC,QAAK,WAAU,YAAY;OAEvB;;KACJ;GAGP,oBAAC;IAAE,WAAU;cAAgC;KAEzC;;GACA"}
1
+ {"version":3,"file":"ChatInput.js","names":[],"sources":["../../../src/presentation/components/ChatInput.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '@contractspec/lib.ui-kit-web/ui/utils';\nimport { Textarea } from '@contractspec/lib.design-system';\nimport { Button } from '@contractspec/lib.design-system';\nimport { Send, Paperclip, X, Loader2, FileText, Code } from 'lucide-react';\nimport type { ChatAttachment } from '../../core/message-types';\n\nexport interface ChatInputProps {\n /** Called when a message is sent */\n onSend: (content: string, attachments?: ChatAttachment[]) => void;\n /** Whether input is disabled (e.g., during streaming) */\n disabled?: boolean;\n /** Whether currently loading/streaming */\n isLoading?: boolean;\n /** Placeholder text */\n placeholder?: string;\n /** Additional class name */\n className?: string;\n /** Show attachment button */\n showAttachments?: boolean;\n /** Max attachments allowed */\n maxAttachments?: number;\n}\n\n/**\n * Chat input component with attachment support\n */\nexport function ChatInput({\n onSend,\n disabled = false,\n isLoading = false,\n placeholder = 'Type a message...',\n className,\n showAttachments = true,\n maxAttachments = 5,\n}: ChatInputProps) {\n const [content, setContent] = React.useState('');\n const [attachments, setAttachments] = React.useState<ChatAttachment[]>([]);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const fileInputRef = React.useRef<HTMLInputElement>(null);\n\n const canSend = content.trim().length > 0 || attachments.length > 0;\n\n const handleSubmit = React.useCallback(\n (e?: React.FormEvent) => {\n e?.preventDefault();\n if (!canSend || disabled || isLoading) return;\n\n onSend(content.trim(), attachments.length > 0 ? attachments : undefined);\n setContent('');\n setAttachments([]);\n\n // Focus back on textarea\n textareaRef.current?.focus();\n },\n [canSend, content, attachments, disabled, isLoading, onSend]\n );\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n // Submit on Enter (without Shift)\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleSubmit();\n }\n },\n [handleSubmit]\n );\n\n const handleFileSelect = React.useCallback(\n async (e: React.ChangeEvent<HTMLInputElement>) => {\n const files = e.target.files;\n if (!files) return;\n\n const newAttachments: ChatAttachment[] = [];\n\n for (const file of Array.from(files)) {\n if (attachments.length + newAttachments.length >= maxAttachments) break;\n\n const content = await file.text();\n const extension = file.name.split('.').pop()?.toLowerCase() ?? '';\n const isCode = [\n 'ts',\n 'tsx',\n 'js',\n 'jsx',\n 'py',\n 'go',\n 'rs',\n 'java',\n ].includes(extension);\n\n newAttachments.push({\n id: `att_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`,\n type: isCode ? 'code' : 'file',\n name: file.name,\n content,\n mimeType: file.type,\n size: file.size,\n });\n }\n\n setAttachments((prev) => [...prev, ...newAttachments]);\n\n // Reset file input\n e.target.value = '';\n },\n [attachments.length, maxAttachments]\n );\n\n const removeAttachment = React.useCallback((id: string) => {\n setAttachments((prev) => prev.filter((a) => a.id !== id));\n }, []);\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {/* Attachments preview */}\n {attachments.length > 0 && (\n <div className=\"flex flex-wrap gap-2\">\n {attachments.map((attachment) => (\n <div\n key={attachment.id}\n className={cn(\n 'flex items-center gap-1.5 rounded-md px-2 py-1',\n 'bg-muted text-muted-foreground text-sm'\n )}\n >\n {attachment.type === 'code' ? (\n <Code className=\"h-3.5 w-3.5\" />\n ) : (\n <FileText className=\"h-3.5 w-3.5\" />\n )}\n <span className=\"max-w-[150px] truncate\">{attachment.name}</span>\n <button\n type=\"button\"\n onClick={() => removeAttachment(attachment.id)}\n className=\"hover:text-foreground\"\n aria-label={`Remove ${attachment.name}`}\n >\n <X className=\"h-3.5 w-3.5\" />\n </button>\n </div>\n ))}\n </div>\n )}\n\n {/* Input form */}\n <form onSubmit={handleSubmit} className=\"flex items-end gap-2\">\n {/* Attachment button */}\n {showAttachments && (\n <>\n <input\n ref={fileInputRef}\n type=\"file\"\n multiple\n accept=\".ts,.tsx,.js,.jsx,.json,.md,.txt,.py,.go,.rs,.java,.yaml,.yml\"\n onChange={handleFileSelect}\n className=\"hidden\"\n aria-label=\"Attach files\"\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n onPress={() => fileInputRef.current?.click()}\n disabled={disabled || attachments.length >= maxAttachments}\n aria-label=\"Attach files\"\n >\n <Paperclip className=\"h-4 w-4\" />\n </Button>\n </>\n )}\n\n {/* Text input */}\n <div className=\"relative flex-1\">\n <Textarea\n value={content}\n onChange={(e) => setContent(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled}\n className={cn(\n 'max-h-[200px] min-h-[44px] resize-none pr-12',\n 'focus-visible:ring-1'\n )}\n rows={1}\n aria-label=\"Chat message\"\n />\n </div>\n\n {/* Send button */}\n <Button\n type=\"submit\"\n disabled={!canSend || disabled || isLoading}\n size=\"sm\"\n aria-label={isLoading ? 'Sending...' : 'Send message'}\n >\n {isLoading ? (\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n ) : (\n <Send className=\"h-4 w-4\" />\n )}\n </Button>\n </form>\n\n {/* Helper text */}\n <p className=\"text-muted-foreground text-xs\">\n Press Enter to send, Shift+Enter for new line\n </p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,SAAgB,UAAU,EACxB,QACA,WAAW,OACX,YAAY,OACZ,cAAc,qBACd,WACA,kBAAkB,MAClB,iBAAiB,KACA;CACjB,MAAM,CAAC,SAAS,cAAc,MAAM,SAAS,GAAG;CAChD,MAAM,CAAC,aAAa,kBAAkB,MAAM,SAA2B,EAAE,CAAC;CAC1E,MAAM,cAAc,MAAM,OAA4B,KAAK;CAC3D,MAAM,eAAe,MAAM,OAAyB,KAAK;CAEzD,MAAM,UAAU,QAAQ,MAAM,CAAC,SAAS,KAAK,YAAY,SAAS;CAElE,MAAM,eAAe,MAAM,aACxB,MAAwB;AACvB,KAAG,gBAAgB;AACnB,MAAI,CAAC,WAAW,YAAY,UAAW;AAEvC,SAAO,QAAQ,MAAM,EAAE,YAAY,SAAS,IAAI,cAAc,OAAU;AACxE,aAAW,GAAG;AACd,iBAAe,EAAE,CAAC;AAGlB,cAAY,SAAS,OAAO;IAE9B;EAAC;EAAS;EAAS;EAAa;EAAU;EAAW;EAAO,CAC7D;CAED,MAAM,gBAAgB,MAAM,aACzB,MAA2B;AAE1B,MAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACpC,KAAE,gBAAgB;AAClB,iBAAc;;IAGlB,CAAC,aAAa,CACf;CAED,MAAM,mBAAmB,MAAM,YAC7B,OAAO,MAA2C;EAChD,MAAM,QAAQ,EAAE,OAAO;AACvB,MAAI,CAAC,MAAO;EAEZ,MAAM,iBAAmC,EAAE;AAE3C,OAAK,MAAM,QAAQ,MAAM,KAAK,MAAM,EAAE;AACpC,OAAI,YAAY,SAAS,eAAe,UAAU,eAAgB;GAElE,MAAM,UAAU,MAAM,KAAK,MAAM;GACjC,MAAM,YAAY,KAAK,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Ae,aAAa,SAAS,OAAO;MAC5C,UAAU,YAAY,YAAY,UAAU;MAC5C,cAAW;gBAEX,oBAAC,aAAU,WAAU,YAAY;OAC1B,IACR;KAIL,oBAAC;MAAI,WAAU;gBACb,oBAAC;OACC,OAAO;OACP,WAAW,MAAM,WAAW,EAAE,OAAO,MAAM;OAC3C,WAAW;OACE;OACH;OACV,WAAW,GACT,gDACA,uBACD;OACD,MAAM;OACN,cAAW;QACX;OACE;KAGN,oBAAC;MACC,MAAK;MACL,UAAU,CAAC,WAAW,YAAY;MAClC,MAAK;MACL,cAAY,YAAY,eAAe;gBAEtC,YACC,oBAAC,WAAQ,WAAU,yBAAyB,GAE5C,oBAAC,QAAK,WAAU,YAAY;OAEvB;;KACJ;GAGP,oBAAC;IAAE,WAAU;cAAgC;KAEzC;;GACA"}
@@ -1,5 +1,5 @@
1
1
  import { ChatMessage as ChatMessage$1 } from "../../core/message-types.js";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/presentation/components/ChatMessage.d.ts
5
5
  interface ChatMessageProps {
@@ -18,7 +18,7 @@ declare function ChatMessage({
18
18
  className,
19
19
  showCopy,
20
20
  showAvatar
21
- }: ChatMessageProps): react_jsx_runtime1.JSX.Element;
21
+ }: ChatMessageProps): react_jsx_runtime0.JSX.Element;
22
22
  //#endregion
23
23
  export { ChatMessage };
24
24
  //# sourceMappingURL=ChatMessage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessage.d.ts","names":[],"sources":["../../../src/presentation/components/ChatMessage.tsx"],"sourcesContent":[],"mappings":";;;;UAWiB,gBAAA;WACN;;EADM;EA+ED,QAAA,CAAA,EAAA,OAAW;EACzB;EACA,UAAA,CAAA,EAAA,OAAA;;;;;AAGiB,iBALH,WAAA,CAKG;EAAA,OAAA;EAAA,SAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAAhB,gBAAgB,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ChatMessage.d.ts","names":[],"sources":["../../../src/presentation/components/ChatMessage.tsx"],"mappings":";;;;UAWiB,gBAAA;EACf,OAAA,EAAS,aAAA;EACT,SAAA;EAFe;EAIf,QAAA;;EAEA,UAAA;AAAA;;;;iBAyEc,WAAA,CAAA;EACd,OAAA;EACA,SAAA;EACA,QAAA;EACA;AAAA,GACC,gBAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"CodePreview.d.ts","names":[],"sources":["../../../src/presentation/components/CodePreview.tsx"],"sourcesContent":[],"mappings":";;;UAOiB,gBAAA;;;EAAA;EAgDD,QAAA,CAAA,EAAA,MAAW;EACzB;EACA,QAAA,CAAA,EAAA,MAAA;EACA;EACA,SAAA,CAAA,EAAA,MAAA;EACA;EACA,QAAA,CAAA,EAAA,OAAA;EACA;EACA,WAAA,CAAA,EAAA,OAAA;EACA;EACC,SAAA,CAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAAgB;EAAA,YAAA,CAAA,EAAA,OAAA;;;;;;;iBAVH,WAAA;;;;;;;;;;GAUb,mBAAgB,kBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"CodePreview.d.ts","names":[],"sources":["../../../src/presentation/components/CodePreview.tsx"],"mappings":";;;UAOiB,gBAAA;;EAEf,IAAA;EAFe;EAIf,QAAA;;EAEA,QAAA;EAJA;EAMA,SAAA;EAFA;EAIA,QAAA;EAAA;EAEA,WAAA;EAEA;EAAA,SAAA,IAAa,IAAA;EAEb;EAAA,YAAA;EAES;EAAT,SAAA;AAAA;;;;iBA8Bc,WAAA,CAAA;EACd,IAAA;EACA,QAAA;EACA,QAAA;EACA,SAAA;EACA,QAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;EACA;AAAA,GACC,gBAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,5 +1,5 @@
1
1
  import { WorkspaceSummary } from "../../context/workspace-context.js";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/presentation/components/ContextIndicator.d.ts
5
5
  interface ContextIndicatorProps {
@@ -20,7 +20,7 @@ declare function ContextIndicator({
20
20
  active,
21
21
  className,
22
22
  showDetails
23
- }: ContextIndicatorProps): react_jsx_runtime4.JSX.Element;
23
+ }: ContextIndicatorProps): react_jsx_runtime0.JSX.Element;
24
24
  //#endregion
25
25
  export { ContextIndicator };
26
26
  //# sourceMappingURL=ContextIndicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextIndicator.d.ts","names":[],"sources":["../../../src/presentation/components/ContextIndicator.tsx"],"sourcesContent":[],"mappings":";;;;UAciB,qBAAA;;YAEL;EAFK;EAcD,MAAA,CAAA,EAAA,OAAA;EACd;EACA,SAAA,CAAA,EAAA,MAAA;EACA;EACA,WAAA,CAAA,EAAA,OAAA;;;;;iBAJc,gBAAA;;;;;GAKb,wBAAqB,kBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"ContextIndicator.d.ts","names":[],"sources":["../../../src/presentation/components/ContextIndicator.tsx"],"mappings":";;;;UAciB,qBAAA;;EAEf,OAAA,GAAU,gBAAA;EAFK;EAIf,MAAA;;EAEA,SAAA;EAJA;EAMA,WAAA;AAAA;;;;iBAMc,gBAAA,CAAA;EACd,OAAA;EACA,MAAA;EACA,SAAA;EACA;AAAA,GACC,qBAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import { ProviderMode, ProviderName } from "@contractspec/lib.ai-providers";
3
3
 
4
4
  //#region src/presentation/components/ModelPicker.d.ts
@@ -33,7 +33,7 @@ declare function ModelPicker({
33
33
  availableProviders,
34
34
  className,
35
35
  compact
36
- }: ModelPickerProps): react_jsx_runtime3.JSX.Element;
36
+ }: ModelPickerProps): react_jsx_runtime0.JSX.Element;
37
37
  //#endregion
38
38
  export { ModelPicker };
39
39
  //# sourceMappingURL=ModelPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModelPicker.d.ts","names":[],"sources":["../../../src/presentation/components/ModelPicker.tsx"],"sourcesContent":[],"mappings":";;;;UAsBiB,cAAA;YACL;;EADK,IAAA,EAGT,YAHuB;AAM/B;AAES,UAFQ,gBAAA,CAER;EAEW;EAGN,KAAA,EALL,cAKK;EAEJ;EAAY,QAAA,EAAA,CAAA,KAAA,EALF,cAKE,EAAA,GAAA,IAAA;EAqCN;EACd,kBAAA,CAAA,EAAA;IACA,QAAA,EAzCY,YAyCZ;IACA,SAAA,EAAA,OAAA;IACA,IAAA,EAzCQ,YAyCR;IACA,MAAA,CAAA,EAAA,MAAA;EACC,CAAA,EAAA;EAAgB;EAAA,SAAA,CAAA,EAAA,MAAA;;;;;;;iBANH,WAAA;;;;;;GAMb,mBAAgB,kBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"ModelPicker.d.ts","names":[],"sources":["../../../src/presentation/components/ModelPicker.tsx"],"mappings":";;;;UAsBiB,cAAA;EACf,QAAA,EAAU,YAAA;EACV,KAAA;EACA,IAAA,EAAM,YAAA;AAAA;AAAA,UAGS,gBAAA;EAHG;EAKlB,KAAA,EAAO,cAAA;EAPG;EASV,QAAA,GAAW,KAAA,EAAO,cAAA;EAPlB;EASA,kBAAA;IACE,QAAA,EAAU,YAAA;IACV,SAAA;IACA,IAAA,EAAM,YAAA;IACN,MAAA;EAAA;EARK;EAWP,SAAA;EANY;EAQZ,OAAA;AAAA;;;;iBA+Bc,WAAA,CAAA;EACd,KAAA;EACA,QAAA;EACA,kBAAA;EACA,SAAA;EACA;AAAA,GACC,gBAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -2,7 +2,6 @@ import { ChatAttachment, ChatConversation, ChatMessage } from "../../core/messag
2
2
  import { ProviderMode, ProviderName } from "@contractspec/lib.ai-providers";
3
3
 
4
4
  //#region src/presentation/hooks/useChat.d.ts
5
-
6
5
  /**
7
6
  * Options for useChat hook
8
7
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useChat.d.ts","names":[],"sources":["../../../src/presentation/hooks/useChat.tsx"],"sourcesContent":[],"mappings":";;;;;;;AAkBA;AAEa,UAFI,cAAA,CAEJ;EAEJ;EAcY,QAAA,CAAA,EAhBR,YAgBQ;EAEI;EAEL,IAAA,CAAA,EAlBX,YAkBW;EAAK;EAQR,KAAA,CAAA,EAAA,MAAA;EAEL;EAEI,MAAA,CAAA,EAAA,MAAA;EAIP;EAIS,QAAA,CAAA,EAAA,MAAA;EACX;EAMa,cAAA,CAAA,EAAA,MAAA;EAAO;EAQX,YAAO,CAAA,EAAA,MAAA;;;;qBAvCF;;yBAEI;;oBAEL;;;;;;;;;;UAQH,aAAA;;YAEL;;gBAEI;;;;SAIP;;+CAIS,qBACX;;;;;;oBAMa;;;;;;;iBAQJ,OAAA,WAAiB,iBAAsB"}
1
+ {"version":3,"file":"useChat.d.ts","names":[],"sources":["../../../src/presentation/hooks/useChat.tsx"],"mappings":";;;;;;AAkBA;UAAiB,cAAA;;EAEf,QAAA,GAAW,YAAA;EAEJ;EAAP,IAAA,GAAO,YAAA;EAgBgB;EAdvB,KAAA;EAgBuB;EAdvB,MAAA;EANA;EAQA,QAAA;EANA;EAQA,cAAA;EANA;EAQA,YAAA;EAJA;EAMA,SAAA;EAFA;EAIA,MAAA,IAAU,OAAA,EAAS,WAAA;EAAnB;EAEA,UAAA,IAAc,OAAA,EAAS,WAAA;EAFb;EAIV,OAAA,IAAW,KAAA,EAAO,KAAA;EAFK;EAIvB,OAAA,IAAW,KAAA;IAAS,WAAA;IAAqB,YAAA;EAAA;AAAA;;;;UAM1B,aAAA;EANgD;EAQ/D,QAAA,EAAU,WAAA;EAFkB;EAI5B,YAAA,EAAc,gBAAA;EAFJ;EAIV,SAAA;EAEO;EAAP,KAAA,EAAO,KAAA;EAKF;EAHL,WAAA,GACE,OAAA,UACA,WAAA,GAAc,cAAA,OACX,OAAA;EAMoB;EAJzB,iBAAA;EAbA;EAeA,iBAAA,GAAoB,EAAA;EAbpB;EAeA,UAAA,QAAkB,OAAA;EAblB;EAeA,IAAA;AAAA;;;;iBAMc,OAAA,CAAQ,OAAA,GAAS,cAAA,GAAsB,aAAA"}
@@ -124,9 +124,9 @@ function useChat(options = {}) {
124
124
  onResponse?.(result.message);
125
125
  }
126
126
  } catch (err) {
127
- const error$1 = err instanceof Error ? err : new Error(String(err));
128
- setError(error$1);
129
- onError?.(error$1);
127
+ const error = err instanceof Error ? err : new Error(String(err));
128
+ setError(error);
129
+ onError?.(error);
130
130
  } finally {
131
131
  setIsLoading(false);
132
132
  abortControllerRef.current = null;
@@ -1 +1 @@
1
- {"version":3,"file":"useChat.js","names":["error"],"sources":["../../../src/presentation/hooks/useChat.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type {\n ChatAttachment,\n ChatConversation,\n ChatMessage,\n} from '../../core/message-types';\nimport { ChatService } from '../../core/chat-service';\nimport {\n createProvider,\n type ProviderMode,\n type ProviderName,\n} from '@contractspec/lib.ai-providers';\n\n/**\n * Options for useChat hook\n */\nexport interface UseChatOptions {\n /** Provider to use */\n provider?: ProviderName;\n /** Provider mode */\n mode?: ProviderMode;\n /** Model to use */\n model?: string;\n /** API key for BYOK mode */\n apiKey?: string;\n /** API proxy URL for managed mode */\n proxyUrl?: string;\n /** Initial conversation ID to resume */\n conversationId?: string;\n /** System prompt override */\n systemPrompt?: string;\n /** Enable streaming */\n streaming?: boolean;\n /** Called when a message is sent */\n onSend?: (message: ChatMessage) => void;\n /** Called when a response is received */\n onResponse?: (message: ChatMessage) => void;\n /** Called on error */\n onError?: (error: Error) => void;\n /** Called when usage is recorded */\n onUsage?: (usage: { inputTokens: number; outputTokens: number }) => void;\n}\n\n/**\n * Return type for useChat hook\n */\nexport interface UseChatReturn {\n /** Current messages */\n messages: ChatMessage[];\n /** Current conversation */\n conversation: ChatConversation | null;\n /** Whether currently loading/streaming */\n isLoading: boolean;\n /** Current error */\n error: Error | null;\n /** Send a message */\n sendMessage: (\n content: string,\n attachments?: ChatAttachment[]\n ) => Promise<void>;\n /** Clear conversation and start fresh */\n clearConversation: () => void;\n /** Set conversation ID to resume */\n setConversationId: (id: string | null) => void;\n /** Regenerate last response */\n regenerate: () => Promise<void>;\n /** Stop current generation */\n stop: () => void;\n}\n\n/**\n * Hook for managing AI chat state\n */\nexport function useChat(options: UseChatOptions = {}): UseChatReturn {\n const {\n provider = 'openai',\n mode = 'byok',\n model,\n apiKey,\n proxyUrl,\n conversationId: initialConversationId,\n systemPrompt,\n streaming = true,\n onSend,\n onResponse,\n onError,\n onUsage,\n } = options;\n\n const [messages, setMessages] = React.useState<ChatMessage[]>([]);\n const [conversation, setConversation] =\n React.useState<ChatConversation | null>(null);\n const [isLoading, setIsLoading] = React.useState(false);\n const [error, setError] = React.useState<Error | null>(null);\n const [conversationId, setConversationId] = React.useState<string | null>(\n initialConversationId ?? null\n );\n\n const abortControllerRef = React.useRef<AbortController | null>(null);\n const chatServiceRef = React.useRef<ChatService | null>(null);\n\n // Initialize chat service\n React.useEffect(() => {\n const chatProvider = createProvider({\n provider,\n model,\n apiKey,\n proxyUrl,\n });\n\n chatServiceRef.current = new ChatService({\n provider: chatProvider,\n systemPrompt,\n onUsage,\n });\n }, [provider, mode, model, apiKey, proxyUrl, systemPrompt, onUsage]);\n\n // Load existing conversation\n React.useEffect(() => {\n if (!conversationId || !chatServiceRef.current) return;\n\n const loadConversation = async () => {\n if (!chatServiceRef.current) return;\n\n const conv = await chatServiceRef.current.getConversation(conversationId);\n if (conv) {\n setConversation(conv);\n setMessages(conv.messages);\n }\n };\n\n loadConversation().catch(console.error);\n }, [conversationId]);\n\n const sendMessage = React.useCallback(\n async (content: string, attachments?: ChatAttachment[]) => {\n if (!chatServiceRef.current) {\n throw new Error('Chat service not initialized');\n }\n\n setIsLoading(true);\n setError(null);\n\n // Create abort controller\n abortControllerRef.current = new AbortController();\n\n try {\n // Add user message immediately\n const userMessage: ChatMessage = {\n id: `msg_${Date.now()}`,\n conversationId: conversationId ?? '',\n role: 'user',\n content,\n status: 'completed',\n createdAt: new Date(),\n updatedAt: new Date(),\n attachments,\n };\n setMessages((prev) => [...prev, userMessage]);\n onSend?.(userMessage);\n\n if (streaming) {\n // Streaming mode\n const result = await chatServiceRef.current.stream({\n conversationId: conversationId ?? undefined,\n content,\n attachments,\n });\n\n // Update conversation ID if new\n if (!conversationId) {\n setConversationId(result.conversationId);\n }\n\n // Add placeholder for assistant message\n const assistantMessage: ChatMessage = {\n id: result.messageId,\n conversationId: result.conversationId,\n role: 'assistant',\n content: '',\n status: 'streaming',\n createdAt: new Date(),\n updatedAt: new Date(),\n };\n setMessages((prev) => [...prev, assistantMessage]);\n\n // Process stream\n let fullContent = '';\n for await (const chunk of result.stream) {\n if (chunk.type === 'text' && chunk.content) {\n fullContent += chunk.content;\n setMessages((prev) =>\n prev.map((m) =>\n m.id === result.messageId ? { ...m, content: fullContent } : m\n )\n );\n } else if (chunk.type === 'done') {\n setMessages((prev) =>\n prev.map((m) =>\n m.id === result.messageId\n ? {\n ...m,\n status: 'completed',\n usage: chunk.usage,\n updatedAt: new Date(),\n }\n : m\n )\n );\n onResponse?.(\n messages.find((m) => m.id === result.messageId) ??\n assistantMessage\n );\n } else if (chunk.type === 'error') {\n setMessages((prev) =>\n prev.map((m) =>\n m.id === result.messageId\n ? {\n ...m,\n status: 'error',\n error: chunk.error,\n updatedAt: new Date(),\n }\n : m\n )\n );\n if (chunk.error) {\n const err = new Error(chunk.error.message);\n setError(err);\n onError?.(err);\n }\n }\n }\n } else {\n // Non-streaming mode\n const result = await chatServiceRef.current.send({\n conversationId: conversationId ?? undefined,\n content,\n attachments,\n });\n\n setConversation(result.conversation);\n setMessages(result.conversation.messages);\n\n if (!conversationId) {\n setConversationId(result.conversation.id);\n }\n\n onResponse?.(result.message);\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n onError?.(error);\n } finally {\n setIsLoading(false);\n abortControllerRef.current = null;\n }\n },\n [conversationId, streaming, onSend, onResponse, onError, messages]\n );\n\n const clearConversation = React.useCallback(() => {\n setMessages([]);\n setConversation(null);\n setConversationId(null);\n setError(null);\n }, []);\n\n const regenerate = React.useCallback(async () => {\n // Find the last user message\n const lastUserMessageIndex = messages.findLastIndex(\n (m) => m.role === 'user'\n );\n if (lastUserMessageIndex === -1) return;\n\n const lastUserMessage = messages[lastUserMessageIndex];\n if (!lastUserMessage) return;\n\n // Remove the last assistant message\n setMessages((prev) => prev.slice(0, lastUserMessageIndex + 1));\n\n // Resend\n await sendMessage(lastUserMessage.content, lastUserMessage.attachments);\n }, [messages, sendMessage]);\n\n const stop = React.useCallback(() => {\n abortControllerRef.current?.abort();\n setIsLoading(false);\n }, []);\n\n return {\n messages,\n conversation,\n isLoading,\n error,\n sendMessage,\n clearConversation,\n setConversationId,\n regenerate,\n stop,\n };\n}\n"],"mappings":";;;;;;;;;;AA2EA,SAAgB,QAAQ,UAA0B,EAAE,EAAiB;CACnE,MAAM,EACJ,WAAW,UACX,OAAO,QACP,OACA,QACA,UACA,gBAAgB,uBAChB,cACA,YAAY,MACZ,QACA,YACA,SACA,YACE;CAEJ,MAAM,CAAC,UAAU,eAAe,MAAM,SAAwB,EAAE,CAAC;CACjE,MAAM,CAAC,cAAc,mBACnB,MAAM,SAAkC,KAAK;CAC/C,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,MAAM;CACvD,MAAM,CAAC,OAAO,YAAY,MAAM,SAAuB,KAAK;CAC5D,MAAM,CAAC,gBAAgB,qBAAqB,MAAM,SAChD,yBAAyB,KAC1B;CAED,MAAM,qBAAqB,MAAM,OAA+B,KAAK;CACrE,MAAM,iBAAiB,MAAM,OAA2B,K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QAAO;EACL;EACA;EACA;EACA;EACA;EACA,mBAnCwB,MAAM,kBAAkB;AAChD,eAAY,EAAE,CAAC;AACf,mBAAgB,KAAK;AACrB,qBAAkB,KAAK;AACvB,YAAS,KAAK;KACb,EAAE,CAAC;EA+BJ;EACA,YA9BiB,MAAM,YAAY,YAAY;GAE/C,MAAM,uBAAuB,SAAS,eACnC,MAAM,EAAE,SAAS,OACnB;AACD,OAAI,yBAAyB,GAAI;GAEjC,MAAM,kBAAkB,SAAS;AACjC,OAAI,CAAC,gBAAiB;AAGtB,gBAAa,SAAS,KAAK,MAAM,GAAG,uBAAuB,EAAE,CAAC;AAG9D,SAAM,YAAY,gBAAgB,SAAS,gBAAgB,YAAY;KACtE,CAAC,UAAU,YAAY,CAAC;EAgBzB,MAdW,MAAM,kBAAkB;AACnC,sBAAmB,SAAS,OAAO;AACnC,gBAAa,MAAM;KAClB,EAAE,CAAC;EAYL"}
1
+ {"version":3,"file":"useChat.js","names":[],"sources":["../../../src/presentation/hooks/useChat.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type {\n ChatAttachment,\n ChatConversation,\n ChatMessage,\n} from '../../core/message-types';\nimport { ChatService } from '../../core/chat-service';\nimport {\n createProvider,\n type ProviderMode,\n type ProviderName,\n} from '@contractspec/lib.ai-providers';\n\n/**\n * Options for useChat hook\n */\nexport interface UseChatOptions {\n /** Provider to use */\n provider?: ProviderName;\n /** Provider mode */\n mode?: ProviderMode;\n /** Model to use */\n model?: string;\n /** API key for BYOK mode */\n apiKey?: string;\n /** API proxy URL for managed mode */\n proxyUrl?: string;\n /** Initial conversation ID to resume */\n conversationId?: string;\n /** System prompt override */\n systemPrompt?: string;\n /** Enable streaming */\n streaming?: boolean;\n /** Called when a message is sent */\n onSend?: (message: ChatMessage) => void;\n /** Called when a response is received */\n onResponse?: (message: ChatMessage) => void;\n /** Called on error */\n onError?: (error: Error) => void;\n /** Called when usage is recorded */\n onUsage?: (usage: { inputTokens: number; outputTokens: number }) => void;\n}\n\n/**\n * Return type for useChat hook\n */\nexport interface UseChatReturn {\n /** Current messages */\n messages: ChatMessage[];\n /** Current conversation */\n conversation: ChatConversation | null;\n /** Whether currently loading/streaming */\n isLoading: boolean;\n /** Current error */\n error: Error | null;\n /** Send a message */\n sendMessage: (\n content: string,\n attachments?: ChatAttachment[]\n ) => Promise<void>;\n /** Clear conversation and start fresh */\n clearConversation: () => void;\n /** Set conversation ID to resume */\n setConversationId: (id: string | null) => void;\n /** Regenerate last response */\n regenerate: () => Promise<void>;\n /** Stop current generation */\n stop: () => void;\n}\n\n/**\n * Hook for managing AI chat state\n */\nexport function useChat(options: UseChatOptions = {}): UseChatReturn {\n const {\n provider = 'openai',\n mode = 'byok',\n model,\n apiKey,\n proxyUrl,\n conversationId: initialConversationId,\n systemPrompt,\n streaming = true,\n onSend,\n onResponse,\n onError,\n onUsage,\n } = options;\n\n const [messages, setMessages] = React.useState<ChatMessage[]>([]);\n const [conversation, setConversation] =\n React.useState<ChatConversation | null>(null);\n const [isLoading, setIsLoading] = React.useState(false);\n const [error, setError] = React.useState<Error | null>(null);\n const [conversationId, setConversationId] = React.useState<string | null>(\n initialConversationId ?? null\n );\n\n const abortControllerRef = React.useRef<AbortController | null>(null);\n const chatServiceRef = React.useRef<ChatService | null>(null);\n\n // Initialize chat service\n React.useEffect(() => {\n const chatProvider = createProvider({\n provider,\n model,\n apiKey,\n proxyUrl,\n });\n\n chatServiceRef.current = new ChatService({\n provider: chatProvider,\n systemPrompt,\n onUsage,\n });\n }, [provider, mode, model, apiKey, proxyUrl, systemPrompt, onUsage]);\n\n // Load existing conversation\n React.useEffect(() => {\n if (!conversationId || !chatServiceRef.current) return;\n\n const loadConversation = async () => {\n if (!chatServiceRef.current) return;\n\n const conv = await chatServiceRef.current.getConversation(conversationId);\n if (conv) {\n setConversation(conv);\n setMessages(conv.messages);\n }\n };\n\n loadConversation().catch(console.error);\n }, [conversationId]);\n\n const sendMessage = React.useCallback(\n async (content: string, attachments?: ChatAttachment[]) => {\n if (!chatServiceRef.current) {\n throw new Error('Chat service not initialized');\n }\n\n setIsLoading(true);\n setError(null);\n\n // Create abort controller\n abortControllerRef.current = new AbortController();\n\n try {\n // Add user message immediately\n const userMessage: ChatMessage = {\n id: `msg_${Date.now()}`,\n conversationId: conversationId ?? '',\n role: 'user',\n content,\n status: 'completed',\n createdAt: new Date(),\n updatedAt: new Date(),\n attachments,\n };\n setMessages((prev) => [...prev, userMessage]);\n onSend?.(userMessage);\n\n if (streaming) {\n // Streaming mode\n const result = await chatServiceRef.current.stream({\n conversationId: conversationId ?? undefined,\n content,\n attachments,\n });\n\n // Update conversation ID if new\n if (!conversationId) {\n setConversationId(result.conversationId);\n }\n\n // Add placeholder for assistant message\n const assistantMessage: ChatMessage = {\n id: result.messageId,\n conversationId: result.conversationId,\n role: 'assistant',\n content: '',\n status: 'streaming',\n createdAt: new Date(),\n updatedAt: new Date(),\n };\n setMessages((prev) => [...prev, assistantMessage]);\n\n // Process stream\n let fullContent = '';\n for await (const chunk of result.stream) {\n if (chunk.type === 'text' && chunk.content) {\n fullContent += chunk.content;\n setMessages((prev) =>\n prev.map((m) =>\n m.id === result.messageId ? { ...m, content: fullContent } : m\n )\n );\n } else if (chunk.type === 'done') {\n setMessages((prev) =>\n prev.map((m) =>\n m.id === result.messageId\n ? {\n ...m,\n status: 'completed',\n usage: chunk.usage,\n updatedAt: new Date(),\n }\n : m\n )\n );\n onResponse?.(\n messages.find((m) => m.id === result.messageId) ??\n assistantMessage\n );\n } else if (chunk.type === 'error') {\n setMessages((prev) =>\n prev.map((m) =>\n m.id === result.messageId\n ? {\n ...m,\n status: 'error',\n error: chunk.error,\n updatedAt: new Date(),\n }\n : m\n )\n );\n if (chunk.error) {\n const err = new Error(chunk.error.message);\n setError(err);\n onError?.(err);\n }\n }\n }\n } else {\n // Non-streaming mode\n const result = await chatServiceRef.current.send({\n conversationId: conversationId ?? undefined,\n content,\n attachments,\n });\n\n setConversation(result.conversation);\n setMessages(result.conversation.messages);\n\n if (!conversationId) {\n setConversationId(result.conversation.id);\n }\n\n onResponse?.(result.message);\n }\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n setError(error);\n onError?.(error);\n } finally {\n setIsLoading(false);\n abortControllerRef.current = null;\n }\n },\n [conversationId, streaming, onSend, onResponse, onError, messages]\n );\n\n const clearConversation = React.useCallback(() => {\n setMessages([]);\n setConversation(null);\n setConversationId(null);\n setError(null);\n }, []);\n\n const regenerate = React.useCallback(async () => {\n // Find the last user message\n const lastUserMessageIndex = messages.findLastIndex(\n (m) => m.role === 'user'\n );\n if (lastUserMessageIndex === -1) return;\n\n const lastUserMessage = messages[lastUserMessageIndex];\n if (!lastUserMessage) return;\n\n // Remove the last assistant message\n setMessages((prev) => prev.slice(0, lastUserMessageIndex + 1));\n\n // Resend\n await sendMessage(lastUserMessage.content, lastUserMessage.attachments);\n }, [messages, sendMessage]);\n\n const stop = React.useCallback(() => {\n abortControllerRef.current?.abort();\n setIsLoading(false);\n }, []);\n\n return {\n messages,\n conversation,\n isLoading,\n error,\n sendMessage,\n clearConversation,\n setConversationId,\n regenerate,\n stop,\n };\n}\n"],"mappings":";;;;;;;;;;AA2EA,SAAgB,QAAQ,UAA0B,EAAE,EAAiB;CACnE,MAAM,EACJ,WAAW,UACX,OAAO,QACP,OACA,QACA,UACA,gBAAgB,uBAChB,cACA,YAAY,MACZ,QACA,YACA,SACA,YACE;CAEJ,MAAM,CAAC,UAAU,eAAe,MAAM,SAAwB,EAAE,CAAC;CACjE,MAAM,CAAC,cAAc,mBACnB,MAAM,SAAkC,KAAK;CAC/C,MAAM,CAAC,WAAW,gBAAgB,MAAM,SAAS,MAAM;CACvD,MAAM,CAAC,OAAO,YAAY,MAAM,SAAuB,KAAK;CAC5D,MAAM,CAAC,gBAAgB,qBAAqB,MAAM,SAChD,yBAAyB,KAC1B;CAED,MAAM,qBAAqB,MAAM,OAA+B,KAAK;CACrE,MAAM,iBAAiB,MAAM,OAA2B,KAAK;A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L;EACA;EACA;EACA;EACA;EACA,mBAnCwB,MAAM,kBAAkB;AAChD,eAAY,EAAE,CAAC;AACf,mBAAgB,KAAK;AACrB,qBAAkB,KAAK;AACvB,YAAS,KAAK;KACb,EAAE,CAAC;EA+BJ;EACA,YA9BiB,MAAM,YAAY,YAAY;GAE/C,MAAM,uBAAuB,SAAS,eACnC,MAAM,EAAE,SAAS,OACnB;AACD,OAAI,yBAAyB,GAAI;GAEjC,MAAM,kBAAkB,SAAS;AACjC,OAAI,CAAC,gBAAiB;AAGtB,gBAAa,SAAS,KAAK,MAAM,GAAG,uBAAuB,EAAE,CAAC;AAG9D,SAAM,YAAY,gBAAgB,SAAS,gBAAgB,YAAY;KACtE,CAAC,UAAU,YAAY,CAAC;EAgBzB,MAdW,MAAM,kBAAkB;AACnC,sBAAmB,SAAS,OAAO;AACnC,gBAAa,MAAM;KAClB,EAAE,CAAC;EAYL"}
@@ -1,7 +1,6 @@
1
1
  import { ModelInfo, ProviderMode, ProviderName } from "@contractspec/lib.ai-providers";
2
2
 
3
3
  //#region src/presentation/hooks/useProviders.d.ts
4
-
5
4
  /**
6
5
  * Provider availability info
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useProviders.d.ts","names":[],"sources":["../../../src/presentation/hooks/useProviders.tsx"],"sourcesContent":[],"mappings":";;;;;;AAcA;AACY,UADK,YAAA,CACL;EAEJ,QAAA,EAFI,YAEJ;EAEE,SAAA,EAAA,OAAA;EAAS,IAAA,EAFX,YAEW;EAMF,MAAA,CAAA,EAAA,MAAA;EAEJ,MAAA,EARH,SAQG,EAAA;;;;;AAUI,UAZA,kBAAA,CAYA;EAAO;EAMR,SAAA,EAhBH,YAgBe,EAAA;;sBAdN;;0BAEI;;wBAEF,iBAAiB;;;;iBAIxB;;;;;iBAMD,YAAA,CAAA,GAAgB"}
1
+ {"version":3,"file":"useProviders.d.ts","names":[],"sources":["../../../src/presentation/hooks/useProviders.tsx"],"mappings":";;;;;AAcA;UAAiB,YAAA;EACf,QAAA,EAAU,YAAA;EACV,SAAA;EACA,IAAA,EAAM,YAAA;EACN,MAAA;EACA,MAAA,EAAQ,SAAA;AAAA;;;;UAMO,kBAAA;EART;EAUN,SAAA,EAAW,YAAA;EARX;EAUA,kBAAA,EAAoB,YAAA;EAVH;EAYjB,WAAA,GAAc,QAAA,EAAU,YAAA;EANT;EAQf,SAAA,GAAY,QAAA,EAAU,YAAA,KAAiB,SAAA;;EAEvC,SAAA;EANoB;EAQpB,OAAA,QAAe,OAAA;AAAA;;;;iBAMD,YAAA,CAAA,GAAgB,kBAAA"}
@@ -1,7 +1,6 @@
1
1
  import { ProviderName } from "@contractspec/lib.ai-providers";
2
2
 
3
3
  //#region src/providers/chat-utilities.d.ts
4
-
5
4
  /**
6
5
  * Check if a provider supports local mode
7
6
  */
@@ -1 +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"}
1
+ {"version":3,"file":"chat-utilities.d.ts","names":[],"sources":["../../src/providers/chat-utilities.ts"],"mappings":";;;;;;iBAQgB,iBAAA,CAAkB,QAAA,EAAU,YAAA;AAO5C;;;AAAA,iBAAgB,iBAAA,CAAkB,QAAA,EAAU,YAAA"}
package/dist/schema.d.ts CHANGED
@@ -1,61 +1,61 @@
1
- import * as _contractspec_lib_schema28 from "@contractspec/lib.schema";
1
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
2
2
 
3
3
  //#region src/schema.d.ts
4
- declare const ChatMessageModel: _contractspec_lib_schema28.SchemaModel<{
4
+ declare const ChatMessageModel: _contractspec_lib_schema0.SchemaModel<{
5
5
  id: {
6
- type: _contractspec_lib_schema28.FieldType<string, string>;
6
+ type: _contractspec_lib_schema0.FieldType<string, string>;
7
7
  isOptional: false;
8
8
  };
9
9
  role: {
10
- type: _contractspec_lib_schema28.FieldType<string, string>;
10
+ type: _contractspec_lib_schema0.FieldType<string, string>;
11
11
  isOptional: false;
12
12
  };
13
13
  content: {
14
- type: _contractspec_lib_schema28.FieldType<string, string>;
14
+ type: _contractspec_lib_schema0.FieldType<string, string>;
15
15
  isOptional: false;
16
16
  };
17
17
  status: {
18
- type: _contractspec_lib_schema28.FieldType<string, string>;
18
+ type: _contractspec_lib_schema0.FieldType<string, string>;
19
19
  isOptional: false;
20
20
  };
21
21
  createdAt: {
22
- type: _contractspec_lib_schema28.FieldType<Date, string>;
22
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
23
23
  isOptional: false;
24
24
  };
25
25
  }>;
26
- declare const ChatConversationModel: _contractspec_lib_schema28.SchemaModel<{
26
+ declare const ChatConversationModel: _contractspec_lib_schema0.SchemaModel<{
27
27
  id: {
28
- type: _contractspec_lib_schema28.FieldType<string, string>;
28
+ type: _contractspec_lib_schema0.FieldType<string, string>;
29
29
  isOptional: false;
30
30
  };
31
31
  title: {
32
- type: _contractspec_lib_schema28.FieldType<string, string>;
32
+ type: _contractspec_lib_schema0.FieldType<string, string>;
33
33
  isOptional: true;
34
34
  };
35
35
  status: {
36
- type: _contractspec_lib_schema28.FieldType<string, string>;
36
+ type: _contractspec_lib_schema0.FieldType<string, string>;
37
37
  isOptional: false;
38
38
  };
39
39
  messages: {
40
- type: _contractspec_lib_schema28.SchemaModel<{
40
+ type: _contractspec_lib_schema0.SchemaModel<{
41
41
  id: {
42
- type: _contractspec_lib_schema28.FieldType<string, string>;
42
+ type: _contractspec_lib_schema0.FieldType<string, string>;
43
43
  isOptional: false;
44
44
  };
45
45
  role: {
46
- type: _contractspec_lib_schema28.FieldType<string, string>;
46
+ type: _contractspec_lib_schema0.FieldType<string, string>;
47
47
  isOptional: false;
48
48
  };
49
49
  content: {
50
- type: _contractspec_lib_schema28.FieldType<string, string>;
50
+ type: _contractspec_lib_schema0.FieldType<string, string>;
51
51
  isOptional: false;
52
52
  };
53
53
  status: {
54
- type: _contractspec_lib_schema28.FieldType<string, string>;
54
+ type: _contractspec_lib_schema0.FieldType<string, string>;
55
55
  isOptional: false;
56
56
  };
57
57
  createdAt: {
58
- type: _contractspec_lib_schema28.FieldType<Date, string>;
58
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
59
59
  isOptional: false;
60
60
  };
61
61
  }>;
@@ -63,88 +63,88 @@ declare const ChatConversationModel: _contractspec_lib_schema28.SchemaModel<{
63
63
  isOptional: false;
64
64
  };
65
65
  provider: {
66
- type: _contractspec_lib_schema28.FieldType<string, string>;
66
+ type: _contractspec_lib_schema0.FieldType<string, string>;
67
67
  isOptional: false;
68
68
  };
69
69
  model: {
70
- type: _contractspec_lib_schema28.FieldType<string, string>;
70
+ type: _contractspec_lib_schema0.FieldType<string, string>;
71
71
  isOptional: false;
72
72
  };
73
73
  }>;
74
- declare const SendMessageInputModel: _contractspec_lib_schema28.SchemaModel<{
74
+ declare const SendMessageInputModel: _contractspec_lib_schema0.SchemaModel<{
75
75
  conversationId: {
76
- type: _contractspec_lib_schema28.FieldType<string, string>;
76
+ type: _contractspec_lib_schema0.FieldType<string, string>;
77
77
  isOptional: true;
78
78
  };
79
79
  content: {
80
- type: _contractspec_lib_schema28.FieldType<string, string>;
80
+ type: _contractspec_lib_schema0.FieldType<string, string>;
81
81
  isOptional: false;
82
82
  };
83
83
  stream: {
84
- type: _contractspec_lib_schema28.FieldType<boolean, boolean>;
84
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
85
85
  isOptional: true;
86
86
  };
87
87
  }>;
88
- declare const SendMessageOutputModel: _contractspec_lib_schema28.SchemaModel<{
88
+ declare const SendMessageOutputModel: _contractspec_lib_schema0.SchemaModel<{
89
89
  message: {
90
- type: _contractspec_lib_schema28.SchemaModel<{
90
+ type: _contractspec_lib_schema0.SchemaModel<{
91
91
  id: {
92
- type: _contractspec_lib_schema28.FieldType<string, string>;
92
+ type: _contractspec_lib_schema0.FieldType<string, string>;
93
93
  isOptional: false;
94
94
  };
95
95
  role: {
96
- type: _contractspec_lib_schema28.FieldType<string, string>;
96
+ type: _contractspec_lib_schema0.FieldType<string, string>;
97
97
  isOptional: false;
98
98
  };
99
99
  content: {
100
- type: _contractspec_lib_schema28.FieldType<string, string>;
100
+ type: _contractspec_lib_schema0.FieldType<string, string>;
101
101
  isOptional: false;
102
102
  };
103
103
  status: {
104
- type: _contractspec_lib_schema28.FieldType<string, string>;
104
+ type: _contractspec_lib_schema0.FieldType<string, string>;
105
105
  isOptional: false;
106
106
  };
107
107
  createdAt: {
108
- type: _contractspec_lib_schema28.FieldType<Date, string>;
108
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
109
109
  isOptional: false;
110
110
  };
111
111
  }>;
112
112
  isOptional: false;
113
113
  };
114
114
  conversation: {
115
- type: _contractspec_lib_schema28.SchemaModel<{
115
+ type: _contractspec_lib_schema0.SchemaModel<{
116
116
  id: {
117
- type: _contractspec_lib_schema28.FieldType<string, string>;
117
+ type: _contractspec_lib_schema0.FieldType<string, string>;
118
118
  isOptional: false;
119
119
  };
120
120
  title: {
121
- type: _contractspec_lib_schema28.FieldType<string, string>;
121
+ type: _contractspec_lib_schema0.FieldType<string, string>;
122
122
  isOptional: true;
123
123
  };
124
124
  status: {
125
- type: _contractspec_lib_schema28.FieldType<string, string>;
125
+ type: _contractspec_lib_schema0.FieldType<string, string>;
126
126
  isOptional: false;
127
127
  };
128
128
  messages: {
129
- type: _contractspec_lib_schema28.SchemaModel<{
129
+ type: _contractspec_lib_schema0.SchemaModel<{
130
130
  id: {
131
- type: _contractspec_lib_schema28.FieldType<string, string>;
131
+ type: _contractspec_lib_schema0.FieldType<string, string>;
132
132
  isOptional: false;
133
133
  };
134
134
  role: {
135
- type: _contractspec_lib_schema28.FieldType<string, string>;
135
+ type: _contractspec_lib_schema0.FieldType<string, string>;
136
136
  isOptional: false;
137
137
  };
138
138
  content: {
139
- type: _contractspec_lib_schema28.FieldType<string, string>;
139
+ type: _contractspec_lib_schema0.FieldType<string, string>;
140
140
  isOptional: false;
141
141
  };
142
142
  status: {
143
- type: _contractspec_lib_schema28.FieldType<string, string>;
143
+ type: _contractspec_lib_schema0.FieldType<string, string>;
144
144
  isOptional: false;
145
145
  };
146
146
  createdAt: {
147
- type: _contractspec_lib_schema28.FieldType<Date, string>;
147
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
148
148
  isOptional: false;
149
149
  };
150
150
  }>;
@@ -152,52 +152,52 @@ declare const SendMessageOutputModel: _contractspec_lib_schema28.SchemaModel<{
152
152
  isOptional: false;
153
153
  };
154
154
  provider: {
155
- type: _contractspec_lib_schema28.FieldType<string, string>;
155
+ type: _contractspec_lib_schema0.FieldType<string, string>;
156
156
  isOptional: false;
157
157
  };
158
158
  model: {
159
- type: _contractspec_lib_schema28.FieldType<string, string>;
159
+ type: _contractspec_lib_schema0.FieldType<string, string>;
160
160
  isOptional: false;
161
161
  };
162
162
  }>;
163
163
  isOptional: false;
164
164
  };
165
165
  }>;
166
- declare const ListConversationsOutputModel: _contractspec_lib_schema28.SchemaModel<{
166
+ declare const ListConversationsOutputModel: _contractspec_lib_schema0.SchemaModel<{
167
167
  conversations: {
168
- type: _contractspec_lib_schema28.SchemaModel<{
168
+ type: _contractspec_lib_schema0.SchemaModel<{
169
169
  id: {
170
- type: _contractspec_lib_schema28.FieldType<string, string>;
170
+ type: _contractspec_lib_schema0.FieldType<string, string>;
171
171
  isOptional: false;
172
172
  };
173
173
  title: {
174
- type: _contractspec_lib_schema28.FieldType<string, string>;
174
+ type: _contractspec_lib_schema0.FieldType<string, string>;
175
175
  isOptional: true;
176
176
  };
177
177
  status: {
178
- type: _contractspec_lib_schema28.FieldType<string, string>;
178
+ type: _contractspec_lib_schema0.FieldType<string, string>;
179
179
  isOptional: false;
180
180
  };
181
181
  messages: {
182
- type: _contractspec_lib_schema28.SchemaModel<{
182
+ type: _contractspec_lib_schema0.SchemaModel<{
183
183
  id: {
184
- type: _contractspec_lib_schema28.FieldType<string, string>;
184
+ type: _contractspec_lib_schema0.FieldType<string, string>;
185
185
  isOptional: false;
186
186
  };
187
187
  role: {
188
- type: _contractspec_lib_schema28.FieldType<string, string>;
188
+ type: _contractspec_lib_schema0.FieldType<string, string>;
189
189
  isOptional: false;
190
190
  };
191
191
  content: {
192
- type: _contractspec_lib_schema28.FieldType<string, string>;
192
+ type: _contractspec_lib_schema0.FieldType<string, string>;
193
193
  isOptional: false;
194
194
  };
195
195
  status: {
196
- type: _contractspec_lib_schema28.FieldType<string, string>;
196
+ type: _contractspec_lib_schema0.FieldType<string, string>;
197
197
  isOptional: false;
198
198
  };
199
199
  createdAt: {
200
- type: _contractspec_lib_schema28.FieldType<Date, string>;
200
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
201
201
  isOptional: false;
202
202
  };
203
203
  }>;
@@ -205,11 +205,11 @@ declare const ListConversationsOutputModel: _contractspec_lib_schema28.SchemaMod
205
205
  isOptional: false;
206
206
  };
207
207
  provider: {
208
- type: _contractspec_lib_schema28.FieldType<string, string>;
208
+ type: _contractspec_lib_schema0.FieldType<string, string>;
209
209
  isOptional: false;
210
210
  };
211
211
  model: {
212
- type: _contractspec_lib_schema28.FieldType<string, string>;
212
+ type: _contractspec_lib_schema0.FieldType<string, string>;
213
213
  isOptional: false;
214
214
  };
215
215
  }>;
@@ -1 +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"}
1
+ {"version":3,"file":"schema.d.ts","names":[],"sources":["../src/schema.ts"],"mappings":";;;cAEa,gBAAA,4BAAgB,WAAA;;UAS3B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAEW,qBAAA,4BAAqB,WAAA;;UAUhC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,qBAAA,4BAAqB,WAAA;;UAUhC,yBAAA,CAAA,SAAA;;;;;;;;;;;;cAEW,sBAAA,4BAAsB,WAAA;;;;cAMjC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEW,4BAAA,4BAA4B,WAAA;;;;cASvC,yBAAA,CAAA,SAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/module.ai-chat",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
4
4
  "description": "AI chat interface module",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -29,25 +29,25 @@
29
29
  "test": "bun test"
30
30
  },
31
31
  "dependencies": {
32
- "@contractspec/lib.ai-agent": "1.56.0",
33
- "@contractspec/lib.ai-providers": "1.56.0",
34
- "@contractspec/lib.contracts": "1.56.0",
35
- "@contractspec/lib.schema": "1.56.0",
36
- "@contractspec/lib.metering": "1.56.0",
37
- "@contractspec/lib.cost-tracking": "1.56.0",
38
- "@contractspec/lib.design-system": "1.56.0",
39
- "@contractspec/lib.ui-kit-web": "1.56.0",
40
- "@ai-sdk/react": "3.0.69",
41
- "ai": "6.0.67",
32
+ "@contractspec/lib.ai-agent": "1.57.0",
33
+ "@contractspec/lib.ai-providers": "1.57.0",
34
+ "@contractspec/lib.contracts": "1.57.0",
35
+ "@contractspec/lib.schema": "1.57.0",
36
+ "@contractspec/lib.metering": "1.57.0",
37
+ "@contractspec/lib.cost-tracking": "1.57.0",
38
+ "@contractspec/lib.design-system": "1.57.0",
39
+ "@contractspec/lib.ui-kit-web": "1.57.0",
40
+ "@ai-sdk/react": "3.0.75",
41
+ "ai": "6.0.73",
42
42
  "lucide-react": "^0.563.0",
43
43
  "react": "19.2.4",
44
44
  "zod": "^4.3.5"
45
45
  },
46
46
  "devDependencies": {
47
- "@contractspec/tool.tsdown": "1.56.0",
48
- "@contractspec/tool.typescript": "1.56.0",
49
- "@types/react": "^19.2.8",
50
- "tsdown": "^0.19.0",
47
+ "@contractspec/tool.tsdown": "1.57.0",
48
+ "@contractspec/tool.typescript": "1.57.0",
49
+ "@types/react": "^19.2.13",
50
+ "tsdown": "^0.20.3",
51
51
  "typescript": "^5.9.3"
52
52
  },
53
53
  "peerDependencies": {