(ctx context.Context, raw json.RawMessage)
| 949 | } |
| 950 | |
| 951 | func (h *HostAPIHandler) handleSessionsPrompt(ctx context.Context, raw json.RawMessage) (any, error) { |
| 952 | var params hostAPISessionPromptParams |
| 953 | if err := decodeHostAPIParams(raw, ¶ms); err != nil { |
| 954 | return nil, err |
| 955 | } |
| 956 | if strings.TrimSpace(params.SessionID) == "" { |
| 957 | return nil, invalidParamsRPCError(errors.New("session_id is required")) |
| 958 | } |
| 959 | if strings.TrimSpace(params.Message) == "" { |
| 960 | return nil, invalidParamsRPCError(errors.New("message is required")) |
| 961 | } |
| 962 | if _, err := h.requireHostAPISessionWorkspace(ctx, params.WorkspaceID, params.SessionID); err != nil { |
| 963 | return nil, err |
| 964 | } |
| 965 | |
| 966 | submission, err := h.submitPrompt(ctx, params.SessionID, params.Message) |
| 967 | if err != nil { |
| 968 | return nil, err |
| 969 | } |
| 970 | |
| 971 | return hostAPISessionPromptResult{TurnID: submission.TurnID}, nil |
| 972 | } |
| 973 | |
| 974 | func (h *HostAPIHandler) handleSessionsStop(ctx context.Context, raw json.RawMessage) (any, error) { |
| 975 | var params hostAPISessionTargetParams |
nothing calls this directly
no test coverage detected