Documentation
¶
Index ¶
- Constants
- func RunStdio(ctx context.Context, server *Server, in io.Reader, out io.Writer) error
- type CredentialContext
- type RPCExecutionResult
- type Server
- func (s *Server) GetActiveWaiterInfo(sessionID string) (bool, *time.Time, int)
- func (s *Server) GetLastKeepaliveTime(sessionID string) *time.Time
- func (s *Server) HandleRPCRequest(ctx context.Context, credCtx *CredentialContext, req *jsonRPCRequest) RPCExecutionResult
- func (s *Server) HasActiveWaiter(sessionID string) bool
- func (s *Server) NotifySessionCompleted(sess *model.FeedbackSession)
- func (s *Server) RecordKeepaliveResponse(sessionID string)
- func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type StdioTransport
- type ToolDefinition
Constants ¶
View Source
const (
// MaxStdioMessageSize sets the upper limit for a single JSON-RPC message line (16MB).
MaxStdioMessageSize = 16 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CredentialContext ¶ added in v1.1.0
type CredentialContext struct {
CredentialID uint
CredentialName string
HostName string
TokenString string
BaseURL string
Permissions model.Permissions
Source string // "db_credential", "env_token", "open_access", "local_stdio"
}
func CredentialFromContext ¶ added in v1.1.0
func CredentialFromContext(ctx context.Context) *CredentialContext
func LocalStdioCredential ¶ added in v1.2.0
func LocalStdioCredential(defaultHost ...string) *CredentialContext
LocalStdioCredential returns the trusted local stdio credential context with full permissions.
type RPCExecutionResult ¶ added in v1.2.0
type RPCExecutionResult struct {
Response *jsonRPCResponse
IsNotification bool
}
RPCExecutionResult represents the outcome of an RPC call.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) GetActiveWaiterInfo ¶
func (*Server) GetLastKeepaliveTime ¶
func (*Server) HandleRPCRequest ¶ added in v1.2.0
func (s *Server) HandleRPCRequest(ctx context.Context, credCtx *CredentialContext, req *jsonRPCRequest) RPCExecutionResult
HandleRPCRequest processes a parsed JSON-RPC request in a transport-neutral manner.
func (*Server) HasActiveWaiter ¶
func (*Server) NotifySessionCompleted ¶
func (s *Server) NotifySessionCompleted(sess *model.FeedbackSession)
func (*Server) RecordKeepaliveResponse ¶
type StdioTransport ¶ added in v1.2.0
type StdioTransport struct {
// contains filtered or unexported fields
}
StdioTransport manages the stdio JSON-RPC loop with concurrent execution, write serialization, and cancellation.
func NewStdioTransport ¶ added in v1.2.0
NewStdioTransport creates a new StdioTransport instance.
type ToolDefinition ¶
type ToolDefinition struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema json.RawMessage `json:"inputSchema"`
}
func GetToolDefinitionsForPermissions ¶ added in v1.1.0
func GetToolDefinitionsForPermissions(perms model.Permissions) []ToolDefinition
Click to show internal directories.
Click to hide internal directories.