Skip to content

Commit

Permalink
feat(runner): add streaming service support in ShireRunner #157
Browse files Browse the repository at this point in the history
Introduce `OnStreamingService` to handle streaming events during execution. Also, update `resize` method in `ShirePanelView` to accept a customizable `maxHeight` parameter for better flexibility.
  • Loading branch information
phodal committed Jan 2, 2025
1 parent 36d261f commit 58124a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ class ShirePanelView(val project: Project, showInput: Boolean = true) : SimpleTo
}
}

fun resize() {
fun resize(maxHeight: Int = 480) {
val height = myList.components.sumOf { it.height }
if (height < 600) {
if (height < maxHeight) {
this.minimumSize = JBUI.size(800, height)
} else {
this.minimumSize = JBUI.size(800, 600)
this.minimumSize = JBUI.size(800, maxHeight)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,11 @@ class ShireRunner(

/// add context
prepareExecute(parsedResult, variables, project, null)

val runnerContext = processTemplateCompile(parsedResult, variables, project, null, null)

val service = project.getService(OnStreamingService::class.java)
service?.onStart(project, runnerContext.finalPrompt)

return runnerContext

}
Expand Down

0 comments on commit 58124a3

Please sign in to comment.