@kapeta/local-cluster-service 0.61.2 → 0.62.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.
@@ -44,6 +44,10 @@ export interface UIPagePrompt {
44
44
  shell_page?: string;
45
45
  }
46
46
 
47
+ export interface UIPageSamplePrompt extends UIPagePrompt {
48
+ variantId: string;
49
+ }
50
+
47
51
  export interface UIPageEditPrompt {
48
52
  planDescription: string;
49
53
  blockDescription: string;
@@ -168,14 +172,28 @@ class StormClient {
168
172
  public createUIShells(prompt: UIShellsPrompt, conversationId?: string) {
169
173
  return this.send('/v2/ui/shells', {
170
174
  prompt: JSON.stringify(prompt),
175
+ });
176
+ }
177
+
178
+ public createUILandingPages(prompt: string, conversationId?: string) {
179
+ return this.send('/v2/ui/landing-pages', {
180
+ prompt: prompt,
171
181
  conversationId,
172
182
  });
173
183
  }
174
184
 
175
- public createUIPage(prompt: UIPagePrompt, conversationId?: string) {
185
+ public createUIPage(prompt: UIPagePrompt, conversationId?: string, history?: ConversationItem[]) {
176
186
  return this.send('/v2/ui/page', {
177
187
  prompt: prompt,
178
188
  conversationId,
189
+ history,
190
+ });
191
+ }
192
+
193
+ public classifyUIReferences(prompt: string, conversationId?: string) {
194
+ return this.send('/v2/ui/references', {
195
+ prompt: prompt,
196
+ conversationId,
179
197
  });
180
198
  }
181
199
 
@@ -234,6 +252,20 @@ class StormClient {
234
252
  conversationId: conversationId,
235
253
  });
236
254
  }
255
+
256
+ async deleteUIPageConversation(conversationId: string) {
257
+ const options = await this.createOptions('/v2/ui/page', 'DELETE', {
258
+ prompt: '',
259
+ conversationId: conversationId,
260
+ });
261
+
262
+ const response = await fetch(options.url, {
263
+ method: options.method,
264
+ headers: options.headers,
265
+ });
266
+
267
+ return response.text();
268
+ }
237
269
  }
238
270
 
239
271
  export const stormClient = new StormClient();
@@ -37,6 +37,7 @@ export class StormStream extends EventEmitter {
37
37
  this.emit('data', event);
38
38
  } catch (e: any) {
39
39
  this.emit('error', e);
40
+ console.warn('Failed to parse JSON line', e, line);
40
41
  }
41
42
  }
42
43
 
@@ -98,6 +99,7 @@ export interface ConversationItem {
98
99
 
99
100
  export interface StormContextRequest<T = string> {
100
101
  conversationId?: string;
102
+ history?: ConversationItem[];
101
103
  prompt: T;
102
104
  }
103
105