@kapeta/local-cluster-service 0.53.3 → 0.53.4
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/CHANGELOG.md +7 -0
- package/dist/cjs/src/storm/codegen.js +8 -1
- package/dist/cjs/src/storm/event-parser.js +11 -0
- package/dist/cjs/src/storm/events.d.ts +9 -1
- package/dist/esm/src/storm/codegen.js +8 -1
- package/dist/esm/src/storm/event-parser.js +11 -0
- package/dist/esm/src/storm/events.d.ts +9 -1
- package/package.json +1 -1
- package/src/storm/codegen.ts +8 -1
- package/src/storm/event-parser.ts +11 -0
- package/src/storm/events.ts +11 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.53.4](https://github.com/kapetacom/local-cluster-service/compare/v0.53.3...v0.53.4) (2024-06-13)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* handle API_RETRY and MODEL_RETRY events ([e784047](https://github.com/kapetacom/local-cluster-service/commit/e784047fbc7d851e03c5301506ab5d663db9e989))
|
7
|
+
|
1
8
|
## [0.53.3](https://github.com/kapetacom/local-cluster-service/compare/v0.53.2...v0.53.3) (2024-06-13)
|
2
9
|
|
3
10
|
|
@@ -242,9 +242,16 @@ class StormCodegen {
|
|
242
242
|
const relevantFiles = allFiles.filter((file) => file.type !== codegen_1.AIFileTypes.IGNORE && file.type !== codegen_1.AIFileTypes.WEB_SCREEN);
|
243
243
|
const uiTemplates = allFiles.filter((file) => file.type === codegen_1.AIFileTypes.WEB_SCREEN);
|
244
244
|
const screenFiles = [];
|
245
|
+
let filteredEvents = [];
|
246
|
+
for (const event of this.events) {
|
247
|
+
filteredEvents.push(event);
|
248
|
+
if (event.type === 'PLAN_RETRY') {
|
249
|
+
filteredEvents = [];
|
250
|
+
}
|
251
|
+
}
|
245
252
|
if (uiTemplates.length > 0) {
|
246
253
|
const uiStream = await stormClient_1.stormClient.createUIImplementation({
|
247
|
-
events:
|
254
|
+
events: filteredEvents,
|
248
255
|
templates: uiTemplates,
|
249
256
|
context: relevantFiles,
|
250
257
|
blockName: block.aiName,
|
@@ -210,6 +210,17 @@ class StormEventParser {
|
|
210
210
|
evt.payload.toBlockId = StormEventParser.toInstanceId(handle, evt.payload.toComponent);
|
211
211
|
this.connections.push(evt.payload);
|
212
212
|
break;
|
213
|
+
case 'API_RETRY':
|
214
|
+
Object.values(this.blocks).forEach(block => {
|
215
|
+
block.types = [];
|
216
|
+
block.apis = [];
|
217
|
+
});
|
218
|
+
break;
|
219
|
+
case 'MODEL_RETRY':
|
220
|
+
Object.values(this.blocks).forEach(block => {
|
221
|
+
block.models = [];
|
222
|
+
});
|
223
|
+
break;
|
213
224
|
}
|
214
225
|
return this.toResult(handle);
|
215
226
|
}
|
@@ -92,6 +92,14 @@ export interface StormEventCreateDSLResource extends Omit<StormEventCreateDSL, '
|
|
92
92
|
resourceName?: string;
|
93
93
|
};
|
94
94
|
}
|
95
|
+
export interface StormEventCreateDSLRetry {
|
96
|
+
type: 'API_RETRY' | 'MODEL_RETRY';
|
97
|
+
reason: string;
|
98
|
+
created: number;
|
99
|
+
payload: {
|
100
|
+
error: string[];
|
101
|
+
};
|
102
|
+
}
|
95
103
|
export interface StormEventError {
|
96
104
|
type: 'INVALID_RESPONSE' | 'ERROR_INTERNAL';
|
97
105
|
reason: string;
|
@@ -250,4 +258,4 @@ export interface StormEventPhases {
|
|
250
258
|
phaseType: StormEventPhaseType;
|
251
259
|
};
|
252
260
|
}
|
253
|
-
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus;
|
261
|
+
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus | StormEventCreateDSLRetry;
|
@@ -242,9 +242,16 @@ class StormCodegen {
|
|
242
242
|
const relevantFiles = allFiles.filter((file) => file.type !== codegen_1.AIFileTypes.IGNORE && file.type !== codegen_1.AIFileTypes.WEB_SCREEN);
|
243
243
|
const uiTemplates = allFiles.filter((file) => file.type === codegen_1.AIFileTypes.WEB_SCREEN);
|
244
244
|
const screenFiles = [];
|
245
|
+
let filteredEvents = [];
|
246
|
+
for (const event of this.events) {
|
247
|
+
filteredEvents.push(event);
|
248
|
+
if (event.type === 'PLAN_RETRY') {
|
249
|
+
filteredEvents = [];
|
250
|
+
}
|
251
|
+
}
|
245
252
|
if (uiTemplates.length > 0) {
|
246
253
|
const uiStream = await stormClient_1.stormClient.createUIImplementation({
|
247
|
-
events:
|
254
|
+
events: filteredEvents,
|
248
255
|
templates: uiTemplates,
|
249
256
|
context: relevantFiles,
|
250
257
|
blockName: block.aiName,
|
@@ -210,6 +210,17 @@ class StormEventParser {
|
|
210
210
|
evt.payload.toBlockId = StormEventParser.toInstanceId(handle, evt.payload.toComponent);
|
211
211
|
this.connections.push(evt.payload);
|
212
212
|
break;
|
213
|
+
case 'API_RETRY':
|
214
|
+
Object.values(this.blocks).forEach(block => {
|
215
|
+
block.types = [];
|
216
|
+
block.apis = [];
|
217
|
+
});
|
218
|
+
break;
|
219
|
+
case 'MODEL_RETRY':
|
220
|
+
Object.values(this.blocks).forEach(block => {
|
221
|
+
block.models = [];
|
222
|
+
});
|
223
|
+
break;
|
213
224
|
}
|
214
225
|
return this.toResult(handle);
|
215
226
|
}
|
@@ -92,6 +92,14 @@ export interface StormEventCreateDSLResource extends Omit<StormEventCreateDSL, '
|
|
92
92
|
resourceName?: string;
|
93
93
|
};
|
94
94
|
}
|
95
|
+
export interface StormEventCreateDSLRetry {
|
96
|
+
type: 'API_RETRY' | 'MODEL_RETRY';
|
97
|
+
reason: string;
|
98
|
+
created: number;
|
99
|
+
payload: {
|
100
|
+
error: string[];
|
101
|
+
};
|
102
|
+
}
|
95
103
|
export interface StormEventError {
|
96
104
|
type: 'INVALID_RESPONSE' | 'ERROR_INTERNAL';
|
97
105
|
reason: string;
|
@@ -250,4 +258,4 @@ export interface StormEventPhases {
|
|
250
258
|
phaseType: StormEventPhaseType;
|
251
259
|
};
|
252
260
|
}
|
253
|
-
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus;
|
261
|
+
export type StormEvent = StormEventCreateBlock | StormEventCreateConnection | StormEventCreatePlanProperties | StormEventInvalidResponse | StormEventPlanRetry | StormEventCreateDSL | StormEventCreateDSLResource | StormEventError | StormEventScreen | StormEventScreenCandidate | StormEventFileLogical | StormEventFileState | StormEventFileDone | StormEventFileChunk | StormEventDone | StormEventDefinitionChange | StormEventErrorClassifier | StormEventCodeFix | StormEventErrorDetails | StormEventBlockReady | StormEventPhases | StormEventBlockStatus | StormEventCreateDSLRetry;
|
package/package.json
CHANGED
package/src/storm/codegen.ts
CHANGED
@@ -270,9 +270,16 @@ export class StormCodegen {
|
|
270
270
|
);
|
271
271
|
const uiTemplates: StormFileInfo[] = allFiles.filter((file) => file.type === AIFileTypes.WEB_SCREEN);
|
272
272
|
const screenFiles: StormEventFileDone[] = [];
|
273
|
+
let filteredEvents = [] as StormEvent[];
|
274
|
+
for (const event of this.events) {
|
275
|
+
filteredEvents.push(event);
|
276
|
+
if (event.type === 'PLAN_RETRY') {
|
277
|
+
filteredEvents = [];
|
278
|
+
}
|
279
|
+
}
|
273
280
|
if (uiTemplates.length > 0) {
|
274
281
|
const uiStream = await stormClient.createUIImplementation({
|
275
|
-
events:
|
282
|
+
events: filteredEvents,
|
276
283
|
templates: uiTemplates,
|
277
284
|
context: relevantFiles,
|
278
285
|
blockName: block.aiName,
|
@@ -324,6 +324,17 @@ export class StormEventParser {
|
|
324
324
|
evt.payload.toBlockId = StormEventParser.toInstanceId(handle, evt.payload.toComponent);
|
325
325
|
this.connections.push(evt.payload);
|
326
326
|
break;
|
327
|
+
case 'API_RETRY':
|
328
|
+
Object.values(this.blocks).forEach(block => {
|
329
|
+
block.types = [];
|
330
|
+
block.apis = [];
|
331
|
+
});
|
332
|
+
break;
|
333
|
+
case 'MODEL_RETRY':
|
334
|
+
Object.values(this.blocks).forEach(block => {
|
335
|
+
block.models = [];
|
336
|
+
});
|
337
|
+
break;
|
327
338
|
}
|
328
339
|
|
329
340
|
return this.toResult(handle);
|
package/src/storm/events.ts
CHANGED
@@ -118,6 +118,15 @@ export interface StormEventCreateDSLResource extends Omit<StormEventCreateDSL, '
|
|
118
118
|
};
|
119
119
|
}
|
120
120
|
|
121
|
+
export interface StormEventCreateDSLRetry {
|
122
|
+
type: 'API_RETRY' | 'MODEL_RETRY';
|
123
|
+
reason: string;
|
124
|
+
created: number;
|
125
|
+
payload: {
|
126
|
+
error: string[];
|
127
|
+
};
|
128
|
+
}
|
129
|
+
|
121
130
|
export interface StormEventError {
|
122
131
|
type: 'INVALID_RESPONSE' | 'ERROR_INTERNAL';
|
123
132
|
reason: string;
|
@@ -320,4 +329,5 @@ export type StormEvent =
|
|
320
329
|
| StormEventErrorDetails
|
321
330
|
| StormEventBlockReady
|
322
331
|
| StormEventPhases
|
323
|
-
| StormEventBlockStatus
|
332
|
+
| StormEventBlockStatus
|
333
|
+
| StormEventCreateDSLRetry;
|