@@ -288,6 +288,7 @@ type simpleRunner struct {
288288func newSimpleRunner (cache * cache.Client , rm engine.RuntimeManager , env []string ) (* simpleRunner , error ) {
289289 runner , err := runner .New (noopModel {}, credentials.NoopStore {}, runner.Options {
290290 RuntimeManager : rm ,
291+ MonitorFactory : simpleMonitorFactory {},
291292 })
292293 if err != nil {
293294 return nil , err
@@ -319,3 +320,33 @@ func (n noopModel) Call(_ context.Context, _ types.CompletionRequest, _ []string
319320func (n noopModel ) ProxyInfo () (string , string , error ) {
320321 return "" , "" , errors .New ("unsupported" )
321322}
323+
324+ type simpleMonitorFactory struct {
325+ }
326+
327+ func (s simpleMonitorFactory ) Start (ctx context.Context , prg * types.Program , env []string , input string ) (runner.Monitor , error ) {
328+ return simpleMonitor {}, nil
329+ }
330+
331+ func (s simpleMonitorFactory ) Pause () func () {
332+ //TODO implement me
333+ panic ("implement me" )
334+ }
335+
336+ type simpleMonitor struct {
337+ }
338+
339+ func (s simpleMonitor ) Stop (ctx context.Context , output string , err error ) {
340+ }
341+
342+ func (s simpleMonitor ) Event (event runner.Event ) {
343+ if event .Type == runner .EventTypeCallProgress {
344+ if ! strings .HasPrefix (event .Content , "{" ) {
345+ fmt .Println (event .Content )
346+ }
347+ }
348+ }
349+
350+ func (s simpleMonitor ) Pause () func () {
351+ return func () {}
352+ }
0 commit comments