@@ -11,6 +11,7 @@ import (
1111 "sync"
1212 "time"
1313
14+ "github.com/one710/codeye/internal/acp"
1415 "github.com/one710/codeye/internal/client"
1516 "github.com/one710/codeye/internal/queue"
1617 "github.com/one710/codeye/internal/session/persistence"
@@ -59,18 +60,18 @@ func (r *Runtime) CreateSession(ctx context.Context, agent, cwd, name string) (p
5960 return rec , nil
6061}
6162
62- func (r * Runtime ) Prompt (ctx context.Context , rec persistence.Record , prompt string ) (string , error ) {
63- stopReason , _ , err := r .PromptWithOutput (ctx , rec , prompt )
63+ func (r * Runtime ) Prompt (ctx context.Context , rec persistence.Record , parts []acp. PromptPart ) (string , error ) {
64+ stopReason , _ , err := r .PromptWithOutput (ctx , rec , parts )
6465 return stopReason , err
6566}
6667
67- func (r * Runtime ) PromptWithOutput (ctx context.Context , rec persistence.Record , prompt string ) (string , string , error ) {
68- return r .PromptInProcess (ctx , rec , prompt )
68+ func (r * Runtime ) PromptWithOutput (ctx context.Context , rec persistence.Record , parts []acp. PromptPart ) (string , string , error ) {
69+ return r .PromptInProcess (ctx , rec , parts )
6970}
7071
7172// PromptInProcess runs the prompt in the current process with the same client as exec,
7273// so streaming and permission prompts behave identically to exec.
73- func (r * Runtime ) PromptInProcess (ctx context.Context , rec persistence.Record , prompt string ) (string , string , error ) {
74+ func (r * Runtime ) PromptInProcess (ctx context.Context , rec persistence.Record , parts []acp. PromptPart ) (string , string , error ) {
7475 c := r .ClientFactory ()
7576 if err := c .Start (ctx ); err != nil {
7677 return "" , "" , err
@@ -86,7 +87,7 @@ func (r *Runtime) PromptInProcess(ctx context.Context, rec persistence.Record, p
8687 rec .ACPSession = newSid
8788 _ = r .Repo .Save (rec )
8889 }
89- result , err := c .Prompt (ctx , sid , prompt )
90+ result , err := c .Prompt (ctx , sid , parts )
9091 if err != nil {
9192 return "" , "" , err
9293 }
@@ -193,12 +194,12 @@ func (r *Runtime) RunWorkingSession(ctx context.Context, initial persistence.Rec
193194 return server .Run (ctx )
194195}
195196
196- func (r * Runtime ) RunOnce (ctx context.Context , cwd , prompt string ) (string , error ) {
197- stopReason , _ , err := r .RunOnceWithOutput (ctx , cwd , prompt )
197+ func (r * Runtime ) RunOnce (ctx context.Context , cwd string , parts []acp. PromptPart ) (string , error ) {
198+ stopReason , _ , err := r .RunOnceWithOutput (ctx , cwd , parts )
198199 return stopReason , err
199200}
200201
201- func (r * Runtime ) RunOnceWithOutput (ctx context.Context , cwd , prompt string ) (string , string , error ) {
202+ func (r * Runtime ) RunOnceWithOutput (ctx context.Context , cwd string , parts []acp. PromptPart ) (string , string , error ) {
202203 c := r .ClientFactory ()
203204 if err := c .Start (ctx ); err != nil {
204205 return "" , "" , err
@@ -208,7 +209,7 @@ func (r *Runtime) RunOnceWithOutput(ctx context.Context, cwd, prompt string) (st
208209 if err != nil {
209210 return "" , "" , err
210211 }
211- result , err := c .Prompt (ctx , sid , prompt )
212+ result , err := c .Prompt (ctx , sid , parts )
212213 if err != nil {
213214 return "" , "" , err
214215 }
@@ -250,14 +251,14 @@ type workingSessionHandler struct {
250251 fullMessage string // set when we get a non-chunk final message to avoid duplicating chunk content
251252}
252253
253- func (w * workingSessionHandler ) Prompt (ctx context.Context , sessionID , prompt string ) (queue.PromptResult , error ) {
254+ func (w * workingSessionHandler ) Prompt (ctx context.Context , sessionID string , parts []acp. PromptPart ) (queue.PromptResult , error ) {
254255 w .mu .Lock ()
255256 activeSessionID := w .liveSessionID
256257 w .chunks = nil
257258 w .fullMessage = ""
258259 w .mu .Unlock ()
259260
260- result , err := w .client .Prompt (ctx , activeSessionID , prompt )
261+ result , err := w .client .Prompt (ctx , activeSessionID , parts )
261262 if err != nil && shouldRecreateSessionOnPromptError (err ) {
262263 // Agent rejected stale/unknown session; recreate once and retry.
263264 if sid , createErr := w .client .CreateSession (ctx , w .cwd ); createErr == nil {
@@ -268,7 +269,7 @@ func (w *workingSessionHandler) Prompt(ctx context.Context, sessionID, prompt st
268269 _ = w .repo .Save (w .record )
269270 }
270271 w .mu .Unlock ()
271- result , err = w .client .Prompt (ctx , sid , prompt )
272+ result , err = w .client .Prompt (ctx , sid , parts )
272273 }
273274 }
274275 if err != nil {
0 commit comments