rpc

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeParams

func DecodeParams(raw json.RawMessage, target interface{}) error

func RegisterJSON

func RegisterJSON[T any](r *Registry, method string, handler func(context.Context, T) (interface{}, *Error))

Types

type ArtifactContentRef

type ArtifactContentRef struct {
	Data map[string]interface{} `json:"data"`
}

type ArtifactDeleteResult

type ArtifactDeleteResult struct {
	ID           string `json:"id"`
	DeletedFile  bool   `json:"deleted_file"`
	DeletedAudit bool   `json:"deleted_audit"`
}

type ArtifactPruneResult

type ArtifactPruneResult struct {
	Pruned       int `json:"pruned"`
	DeletedFiles int `json:"deleted_files"`
	Kept         int `json:"kept"`
}

type ArtifactSummary

type ArtifactSummary struct {
	Data map[string]interface{} `json:"data"`
}

type ConfigSaveRequest

type ConfigSaveRequest struct {
	Mode         string                 `json:"mode,omitempty"`
	ConfirmRisky bool                   `json:"confirm_risky,omitempty"`
	Config       map[string]interface{} `json:"config"`
}

type ConfigSaveResponse

type ConfigSaveResponse struct {
	Saved           bool        `json:"saved"`
	RequiresConfirm bool        `json:"requires_confirm,omitempty"`
	ChangedFields   []string    `json:"changed_fields,omitempty"`
	Details         interface{} `json:"details,omitempty"`
}

type ConfigViewRequest

type ConfigViewRequest struct {
	Mode                 string `json:"mode,omitempty"`
	IncludeHotReloadInfo bool   `json:"include_hot_reload_info,omitempty"`
}

type ConfigViewResponse

type ConfigViewResponse struct {
	Config                interface{}              `json:"config,omitempty"`
	RawConfig             interface{}              `json:"raw_config,omitempty"`
	PrettyText            string                   `json:"pretty_text,omitempty"`
	HotReloadFields       []string                 `json:"hot_reload_fields,omitempty"`
	HotReloadFieldDetails []map[string]interface{} `json:"hot_reload_field_details,omitempty"`
}

type DeleteNodeArtifactRequest

type DeleteNodeArtifactRequest struct {
	ID string `json:"id"`
}

type DeleteNodeArtifactResponse

type DeleteNodeArtifactResponse struct {
	ArtifactDeleteResult
}

type DeleteWorkspaceFileRequest

type DeleteWorkspaceFileRequest struct {
	Scope string `json:"scope,omitempty"`
	Path  string `json:"path"`
}

type DeleteWorkspaceFileResponse

type DeleteWorkspaceFileResponse struct {
	Path    string `json:"path,omitempty"`
	Deleted bool   `json:"deleted"`
}

type DispatchNodeRequest

type DispatchNodeRequest struct {
	Node   string                 `json:"node"`
	Action string                 `json:"action"`
	Mode   string                 `json:"mode,omitempty"`
	Task   string                 `json:"task,omitempty"`
	Model  string                 `json:"model,omitempty"`
	Args   map[string]interface{} `json:"args,omitempty"`
}

type DispatchNodeResponse

type DispatchNodeResponse struct {
	Result nodes.Response `json:"result"`
}

type Error

type Error struct {
	Code      string      `json:"code"`
	Message   string      `json:"message"`
	Details   interface{} `json:"details,omitempty"`
	Retryable bool        `json:"retryable,omitempty"`
}

type GetCronJobRequest

type GetCronJobRequest struct {
	ID string `json:"id"`
}

type GetCronJobResponse

type GetCronJobResponse struct {
	Job interface{} `json:"job,omitempty"`
}

type GetNodeArtifactRequest

type GetNodeArtifactRequest struct {
	ID string `json:"id"`
}

type GetNodeArtifactResponse

type GetNodeArtifactResponse struct {
	Found    bool                   `json:"found"`
	Artifact map[string]interface{} `json:"artifact,omitempty"`
}

type HeartbeatNodeRequest

type HeartbeatNodeRequest struct {
	ID string `json:"id"`
}

type HeartbeatNodeResponse

type HeartbeatNodeResponse struct {
	ID string `json:"id"`
}

type ListCronJobsRequest

type ListCronJobsRequest struct{}

type ListCronJobsResponse

type ListCronJobsResponse struct {
	Jobs []interface{} `json:"jobs"`
}

type ListNodeArtifactsRequest

type ListNodeArtifactsRequest struct {
	Node   string `json:"node,omitempty"`
	Action string `json:"action,omitempty"`
	Kind   string `json:"kind,omitempty"`
	Limit  int    `json:"limit,omitempty"`
}

type ListNodeArtifactsResponse

type ListNodeArtifactsResponse struct {
	Items             []map[string]interface{} `json:"items"`
	ArtifactRetention map[string]interface{}   `json:"artifact_retention,omitempty"`
}

type ListProviderModelsRequest

type ListProviderModelsRequest struct {
	Provider string `json:"provider"`
}

type ListProviderModelsResponse

type ListProviderModelsResponse struct {
	Provider string   `json:"provider"`
	Models   []string `json:"models,omitempty"`
	Default  string   `json:"default_model,omitempty"`
}

type ListWorkspaceFilesRequest

type ListWorkspaceFilesRequest struct {
	Scope string `json:"scope,omitempty"`
}

type ListWorkspaceFilesResponse

type ListWorkspaceFilesResponse struct {
	Files []string `json:"files"`
}

type MethodHandler

type MethodHandler func(context.Context, json.RawMessage) (interface{}, *Error)

type MutateCronJobRequest

type MutateCronJobRequest struct {
	Action string                 `json:"action"`
	Args   map[string]interface{} `json:"args,omitempty"`
}

type MutateCronJobResponse

type MutateCronJobResponse struct {
	Result interface{} `json:"result,omitempty"`
}

type ProviderChatRequest

type ProviderChatRequest struct {
	Provider string                   `json:"provider"`
	Model    string                   `json:"model,omitempty"`
	Messages []map[string]interface{} `json:"messages"`
	Tools    []map[string]interface{} `json:"tools,omitempty"`
	Options  map[string]interface{}   `json:"options,omitempty"`
}

type ProviderChatResponse

type ProviderChatResponse struct {
	Content      string                   `json:"content,omitempty"`
	ToolCalls    []map[string]interface{} `json:"tool_calls,omitempty"`
	FinishReason string                   `json:"finish_reason,omitempty"`
	Usage        map[string]interface{}   `json:"usage,omitempty"`
}

type ProviderCountTokensRequest

type ProviderCountTokensRequest struct {
	Provider string                   `json:"provider"`
	Model    string                   `json:"model,omitempty"`
	Messages []map[string]interface{} `json:"messages"`
	Tools    []map[string]interface{} `json:"tools,omitempty"`
	Options  map[string]interface{}   `json:"options,omitempty"`
}

type ProviderCountTokensResponse

type ProviderCountTokensResponse struct {
	Usage map[string]interface{} `json:"usage,omitempty"`
}

type ProviderRuntimeActionRequest

type ProviderRuntimeActionRequest struct {
	Provider     string `json:"provider,omitempty"`
	Action       string `json:"action"`
	OnlyExpiring bool   `json:"only_expiring,omitempty"`
}

type ProviderRuntimeActionResponse

type ProviderRuntimeActionResponse struct {
	Result map[string]interface{} `json:"result"`
}

type ProviderRuntimeViewRequest

type ProviderRuntimeViewRequest struct {
	Provider               string `json:"provider,omitempty"`
	Kind                   string `json:"kind,omitempty"`
	Reason                 string `json:"reason,omitempty"`
	Target                 string `json:"target,omitempty"`
	Sort                   string `json:"sort,omitempty"`
	ChangesOnly            bool   `json:"changes_only,omitempty"`
	WindowSec              int    `json:"window_sec,omitempty"`
	Limit                  int    `json:"limit,omitempty"`
	Cursor                 int    `json:"cursor,omitempty"`
	HealthBelow            int    `json:"health_below,omitempty"`
	CooldownUntilBeforeSec int    `json:"cooldown_until_before_sec,omitempty"`
}

type ProviderRuntimeViewResponse

type ProviderRuntimeViewResponse struct {
	View map[string]interface{} `json:"view"`
}

type PruneNodeArtifactsRequest

type PruneNodeArtifactsRequest struct {
	Node       string `json:"node,omitempty"`
	Action     string `json:"action,omitempty"`
	Kind       string `json:"kind,omitempty"`
	KeepLatest int    `json:"keep_latest,omitempty"`
	Limit      int    `json:"limit,omitempty"`
}

type PruneNodeArtifactsResponse

type PruneNodeArtifactsResponse struct {
	ArtifactPruneResult
}

type ReadWorkspaceFileRequest

type ReadWorkspaceFileRequest struct {
	Scope string `json:"scope,omitempty"`
	Path  string `json:"path"`
}

type ReadWorkspaceFileResponse

type ReadWorkspaceFileResponse struct {
	Path    string `json:"path,omitempty"`
	Found   bool   `json:"found,omitempty"`
	Content string `json:"content,omitempty"`
}

type RegisterNodeRequest

type RegisterNodeRequest struct {
	Node nodes.NodeInfo `json:"node"`
}

type RegisterNodeResponse

type RegisterNodeResponse struct {
	ID string `json:"id"`
}

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Handle

func (r *Registry) Handle(ctx context.Context, req Request) (interface{}, *Error)

func (*Registry) Register

func (r *Registry) Register(method string, handler MethodHandler)

type Request

type Request struct {
	Method    string          `json:"method"`
	Params    json.RawMessage `json:"params,omitempty"`
	RequestID string          `json:"request_id,omitempty"`
}

func (Request) NormalizedMethod

func (r Request) NormalizedMethod() string

type Response

type Response struct {
	OK        bool        `json:"ok"`
	Result    interface{} `json:"result,omitempty"`
	Error     *Error      `json:"error,omitempty"`
	RequestID string      `json:"request_id,omitempty"`
}

type SkillsMutateRequest

type SkillsMutateRequest struct {
	Action           string   `json:"action"`
	ID               string   `json:"id,omitempty"`
	Name             string   `json:"name,omitempty"`
	Description      string   `json:"description,omitempty"`
	SystemPrompt     string   `json:"system_prompt,omitempty"`
	Tools            []string `json:"tools,omitempty"`
	IgnoreSuspicious bool     `json:"ignore_suspicious,omitempty"`
	File             string   `json:"file,omitempty"`
	Content          string   `json:"content,omitempty"`
}

type SkillsMutateResponse

type SkillsMutateResponse struct {
	Installed   string   `json:"installed,omitempty"`
	InstalledOK bool     `json:"installed_ok,omitempty"`
	Output      string   `json:"output,omitempty"`
	ClawhubPath string   `json:"clawhub_path,omitempty"`
	Name        string   `json:"name,omitempty"`
	File        string   `json:"file,omitempty"`
	Deleted     bool     `json:"deleted,omitempty"`
	ID          string   `json:"id,omitempty"`
	Imported    []string `json:"imported,omitempty"`
}

type SkillsViewItem

type SkillsViewItem struct {
	ID            string   `json:"id"`
	Name          string   `json:"name"`
	Description   string   `json:"description"`
	Tools         []string `json:"tools"`
	SystemPrompt  string   `json:"system_prompt,omitempty"`
	Enabled       bool     `json:"enabled"`
	UpdateChecked bool     `json:"update_checked"`
	RemoteFound   bool     `json:"remote_found,omitempty"`
	RemoteVersion string   `json:"remote_version,omitempty"`
	CheckError    string   `json:"check_error,omitempty"`
	Source        string   `json:"source,omitempty"`
}

type SkillsViewRequest

type SkillsViewRequest struct {
	ID           string `json:"id,omitempty"`
	File         string `json:"file,omitempty"`
	Files        bool   `json:"files,omitempty"`
	CheckUpdates bool   `json:"check_updates,omitempty"`
}

type SkillsViewResponse

type SkillsViewResponse struct {
	ID               string           `json:"id,omitempty"`
	File             string           `json:"file,omitempty"`
	Content          string           `json:"content,omitempty"`
	FilesList        []string         `json:"files,omitempty"`
	Skills           []SkillsViewItem `json:"skills,omitempty"`
	Source           string           `json:"source,omitempty"`
	ClawhubInstalled bool             `json:"clawhub_installed,omitempty"`
	ClawhubPath      string           `json:"clawhub_path,omitempty"`
}

type UpdateProviderModelsRequest

type UpdateProviderModelsRequest struct {
	Provider string   `json:"provider"`
	Model    string   `json:"model,omitempty"`
	Models   []string `json:"models,omitempty"`
}

type UpdateProviderModelsResponse

type UpdateProviderModelsResponse struct {
	Provider string   `json:"provider"`
	Models   []string `json:"models,omitempty"`
}

type WriteWorkspaceFileRequest

type WriteWorkspaceFileRequest struct {
	Scope   string `json:"scope,omitempty"`
	Path    string `json:"path"`
	Content string `json:"content"`
}

type WriteWorkspaceFileResponse

type WriteWorkspaceFileResponse struct {
	Path  string `json:"path,omitempty"`
	Saved bool   `json:"saved,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL