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

Method handleSessionsPrompt

internal/extension/host_api.go:951–972  ·  view source on GitHub ↗
(ctx context.Context, raw json.RawMessage)

Source from the content-addressed store, hash-verified

949}
950
951func (h *HostAPIHandler) handleSessionsPrompt(ctx context.Context, raw json.RawMessage) (any, error) {
952 var params hostAPISessionPromptParams
953 if err := decodeHostAPIParams(raw, &params); 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
974func (h *HostAPIHandler) handleSessionsStop(ctx context.Context, raw json.RawMessage) (any, error) {
975 var params hostAPISessionTargetParams

Callers

nothing calls this directly

Calls 4

submitPromptMethod · 0.95
decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85

Tested by

no test coverage detected