feat: improve prompt, add ability to abort streaming, improve message parser

This commit is contained in:
Dominic Elm
2024-07-18 11:10:12 +02:00
parent 637ad2b870
commit 012b5bae80
12 changed files with 633 additions and 160 deletions

View File

@@ -19,8 +19,20 @@ const messageParser = new StreamingMessageParser({
workbenchStore.updateArtifact(data, { closed: true });
},
onAction: (data) => {
logger.debug('onAction', data);
onActionOpen: (data) => {
logger.debug('onActionOpen', data.action);
// we only add shell actions when when the close tag got parsed because only then we have the content
if (data.action.type !== 'shell') {
workbenchStore.addAction(data);
}
},
onActionClose: (data) => {
logger.debug('onActionClose', data.action);
if (data.action.type === 'shell') {
workbenchStore.addAction(data);
}
workbenchStore.runAction(data);
},