( cmd *cobra.Command, client DaemonClient, args []string, queue bool, interrupt bool, steer bool, cancelEntry string, )
| 557 | } |
| 558 | |
| 559 | func 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 | |
| 590 | func newSessionEventsCommand(deps commandDeps) *cobra.Command { |
| 591 | var ( |
no test coverage detected