MCPcopy Create free account
hub / github.com/compozy/agh / runSessionPromptAction

Function runSessionPromptAction

internal/cli/session.go:559–588  ·  view source on GitHub ↗
(
	cmd *cobra.Command,
	client DaemonClient,
	args []string,
	queue bool,
	interrupt bool,
	steer bool,
	cancelEntry string,
)

Source from the content-addressed store, hash-verified

557}
558
559func runSessionPromptAction(
560 cmd *cobra.Command,
561 client DaemonClient,
562 args []string,
563 queue bool,
564 interrupt bool,
565 steer bool,
566 cancelEntry string,
567) (SessionPromptRecord, error) {
568 if cmd == nil {
569 return SessionPromptRecord{}, errors.New("cli: command is required")
570 }
571 if client == nil {
572 return SessionPromptRecord{}, errors.New("cli: daemon client is required")
573 }
574 if cmd.Flags().Changed("cancel") {
575 return client.CancelQueuedSessionPrompt(cmd.Context(), args[0], strings.TrimSpace(cancelEntry))
576 }
577 if steer {
578 return client.SteerSessionPrompt(cmd.Context(), args[0], args[1])
579 }
580 request := SessionPromptRequest{Message: args[1]}
581 if queue {
582 request.Mode = contract.PromptModeQueue
583 }
584 if interrupt {
585 request.Mode = contract.PromptModeInterrupt
586 }
587 return client.SendSessionPrompt(cmd.Context(), args[0], request)
588}
589
590func newSessionEventsCommand(deps commandDeps) *cobra.Command {
591 var (

Callers 1

newSessionPromptCommandFunction · 0.85

Calls 3

SteerSessionPromptMethod · 0.65
SendSessionPromptMethod · 0.65

Tested by

no test coverage detected