// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

// This file was generated by jsonschemagen. DO NOT EDIT.

package genkit

import (
	"encoding/json"
)

// ReflectionCancelActionParams is the payload for the "cancelAction" request
// sent by the CLI manager to cancel a running action.
type ReflectionCancelActionParams struct {
	// Trace ID of the action to cancel.
	TraceID string `json:"traceId,omitempty"`
}

// ReflectionCancelActionResponse is the result of a successful "cancelAction" request.
type ReflectionCancelActionResponse struct {
	Message string `json:"message,omitempty"`
}

// ReflectionConfigureParams is the payload for the "configure" notification
// sent by the CLI manager to push configuration to the runtime.
type ReflectionConfigureParams struct {
	// URL of the telemetry server to send traces to (optional).
	TelemetryServerURL string `json:"telemetryServerUrl,omitempty"`
}

// ReflectionEndInputStreamParams is the payload for the "endInputStream"
// notification (bidirectional streaming, not yet implemented).
type ReflectionEndInputStreamParams struct {
	RequestID string `json:"requestId,omitempty"`
}

// ReflectionListValuesParams is the payload for the "listValues" request.
type ReflectionListValuesParams struct {
	// The type of values to list (e.g. "model", "prompt", "schema").
	Type string `json:"type,omitempty"`
}

// ReflectionListValuesResponse is the result of a "listValues" request,
// mapping value names to their definitions.
type ReflectionListValuesResponse struct {
	Values map[string]any `json:"values,omitempty"`
}

// ReflectionRegisterParams is the payload for the "register" request
// sent by the runtime to the CLI manager on connection.
type ReflectionRegisterParams struct {
	// Configured environments (e.g. "dev").
	Envs []string `json:"envs,omitempty"`
	// Genkit library version, e.g. "go/1.4.0".
	GenkitVersion string `json:"genkitVersion,omitempty"`
	// Unique runtime identifier.
	ID string `json:"id,omitempty"`
	// Application name (optional, defaults to the runtime ID).
	Name string `json:"name,omitempty"`
	// Process ID of the runtime.
	PID int `json:"pid,omitempty"`
	// Protocol version for payload compatibility checking.
	ReflectionApiSpecVersion int `json:"reflectionApiSpecVersion,omitempty"`
}

// ReflectionRunActionParams is the payload for the "runAction" request
// sent by the CLI manager to execute an action on the runtime.
type ReflectionRunActionParams struct {
	// Additional runtime context data (ex. auth context data).
	Context json.RawMessage `json:"context,omitempty"`
	// Initialization parameters to establish long running session states.
	Init json.RawMessage `json:"init,omitempty"`
	// An input with the type that this action expects.
	Input json.RawMessage `json:"input,omitempty"`
	// Action key that consists of the action type and ID.
	Key string `json:"key,omitempty"`
	// ID of the Genkit runtime to run the action on. Typically $pid-$port.
	RuntimeID string `json:"runtimeId,omitempty"`
	// Whether to stream results via streamChunk notifications.
	Stream bool `json:"stream,omitempty"`
	// Whether to stream input to the action (for bidirectional actions).
	StreamInput bool `json:"streamInput,omitempty"`
	// Labels to be applied to telemetry data.
	TelemetryLabels json.RawMessage `json:"telemetryLabels,omitempty"`
}

// ReflectionRunActionStateParams is the payload for the "runActionState"
// notification sent by the runtime to provide early status updates
// (e.g. trace ID) before the action result is ready.
type ReflectionRunActionStateParams struct {
	// ID of the JSON-RPC request this notification relates to.
	RequestID string                               `json:"requestId,omitempty"`
	State     *ReflectionRunActionStateParamsState `json:"state,omitempty"`
}

// ReflectionRunActionStateParamsState holds the state data in a
// runActionState notification.
type ReflectionRunActionStateParamsState struct {
	// Trace ID for the action execution.
	TraceID string `json:"traceId,omitempty"`
}

// ReflectionSendInputStreamChunkParams is the payload for the
// "sendInputStreamChunk" notification used to deliver one inbound chunk
// to a running bidirectional action.
type ReflectionSendInputStreamChunkParams struct {
	Chunk     json.RawMessage `json:"chunk,omitempty"`
	RequestID string          `json:"requestId,omitempty"`
}

// ReflectionStreamChunkParams is the payload for the "streamChunk"
// notification sent by the runtime during a streaming runAction request.
type ReflectionStreamChunkParams struct {
	// The streamed data chunk.
	Chunk json.RawMessage `json:"chunk,omitempty"`
	// ID of the JSON-RPC request this chunk belongs to.
	RequestID string `json:"requestId,omitempty"`
}
