Documentation
¶
Index ¶
- Constants
- func AllowNonMoltenHubBaseURL() bool
- func ApplyBoundAgentRuntime(runCfg config.Config, initCfg InitConfig) (config.Config, error)
- func BoundAgentRuntime(initCfg InitConfig) (agentruntime.Runtime, error)
- func CanonicalHubBaseURL(baseURL string) (string, error)
- func ClearRuntimeConfigHubSettings(path string, initCfg InitConfig) error
- func HubBaseURLForRegion(region string) string
- func HubRegionFromBaseURL(baseURL string) string
- func IncrementRuntimeConfigLibraryTaskUsage(path string, initCfg InitConfig, taskName string) error
- func NormalizeHubRegion(region string) string
- func NormalizeLogLevel(raw string) string
- func ParseRunConfigJSON(payload []byte) (config.Config, error)
- func ReadRuntimeConfigLibraryTaskUsage(path string) map[string]int
- func ReadRuntimeConfigString(path string, keys ...string) string
- func ResolveRuntimeConfigPath(initPath string) string
- func RunCompletedActivity(runCfg config.Config) string
- func RunStartedActivity(runCfg config.Config) string
- func SaveRuntimeConfig(path string, initCfg InitConfig, token string) error
- func SaveRuntimeConfigAgentRuntime(path string, initCfg InitConfig, harness, command string) error
- func SaveRuntimeConfigClaudeOAuthToken(path string, initCfg InitConfig, oauthToken string) error
- func SaveRuntimeConfigGitHubToken(path string, initCfg InitConfig, gitHubToken string) error
- func SaveRuntimeConfigHubSettings(path string, initCfg InitConfig, resolvedAgentToken string) error
- func ValidateHubBaseURL(baseURL string) error
- func ValidateHubBaseURLStrict(baseURL string) error
- func ValidatePersistedHubBaseURL(baseURL string) error
- func WebsocketURL(baseURL, sessionKey string) (string, error)
- type APIClient
- func (c APIClient) AckRuntimeDelivery(ctx context.Context, token, deliveryID string) error
- func (c APIClient) AgentMetadata(ctx context.Context, token string) (map[string]any, error)
- func (c APIClient) AgentProfile(ctx context.Context, token string) (AgentProfile, error)
- func (c APIClient) Health(ctx context.Context) error
- func (c APIClient) MarkRuntimeOffline(ctx context.Context, token, sessionKey, reason string) error
- func (c APIClient) NackRuntimeDelivery(ctx context.Context, token, deliveryID string) error
- func (c APIClient) Ping(ctx context.Context) error
- func (c APIClient) PublishResult(ctx context.Context, token string, payload map[string]any) error
- func (c APIClient) PullRuntimeMessage(ctx context.Context, token string, timeoutMs int) (PulledRuntimeMessage, bool, error)
- func (c APIClient) RecordActivity(ctx context.Context, token, activity string) error
- func (c APIClient) RecordCodingActivityRunning(ctx context.Context, token string) error
- func (c APIClient) RecordGitHubTaskCompleteActivity(ctx context.Context, token string) error
- func (c APIClient) RecordRunCompletedActivity(ctx context.Context, token string, runCfg config.Config) error
- func (c APIClient) RecordRunStartedActivity(ctx context.Context, token string, runCfg config.Config) error
- func (c APIClient) RegisterRuntime(ctx context.Context, token string, cfg InitConfig, ...) error
- func (c *APIClient) ResolveAgentToken(ctx context.Context, cfg InitConfig) (string, error)
- func (c APIClient) SyncProfile(ctx context.Context, token string, cfg InitConfig) error
- func (c APIClient) UpdateAgentStatus(ctx context.Context, token, status string) error
- type AdaptiveDispatchController
- type AgentProfile
- type AsyncAPIClient
- func (c *AsyncAPIClient) AckRuntimeDelivery(ctx context.Context, deliveryID string) error
- func (c *AsyncAPIClient) AckRuntimeDeliveryAsync(ctx context.Context, deliveryID string) <-chan error
- func (c *AsyncAPIClient) BaseURL() string
- func (c *AsyncAPIClient) MarkRuntimeOffline(ctx context.Context, sessionKey, reason string) error
- func (c *AsyncAPIClient) NackRuntimeDelivery(ctx context.Context, deliveryID string) error
- func (c *AsyncAPIClient) NackRuntimeDeliveryAsync(ctx context.Context, deliveryID string) <-chan error
- func (c *AsyncAPIClient) PublishResult(ctx context.Context, payload map[string]any) error
- func (c *AsyncAPIClient) PublishResultAsync(ctx context.Context, payload map[string]any) <-chan error
- func (c *AsyncAPIClient) PullRuntimeMessage(ctx context.Context, timeoutMs int) (PulledRuntimeMessage, bool, error)
- func (c *AsyncAPIClient) RecordActivity(ctx context.Context, activity string) error
- func (c *AsyncAPIClient) RecordCodingActivityRunning(ctx context.Context) error
- func (c *AsyncAPIClient) RecordGitHubTaskCompleteActivity(ctx context.Context) error
- func (c *AsyncAPIClient) RecordRunCompletedActivity(ctx context.Context, runCfg config.Config) error
- func (c *AsyncAPIClient) RecordRunStartedActivity(ctx context.Context, runCfg config.Config) error
- func (c *AsyncAPIClient) RegisterRuntime(ctx context.Context, cfg InitConfig, libraryTasks []library.TaskSummary) error
- func (c *AsyncAPIClient) ResolveAgentToken(ctx context.Context, cfg InitConfig) (string, error)
- func (c *AsyncAPIClient) SyncProfile(ctx context.Context, cfg InitConfig) error
- func (c *AsyncAPIClient) Token() string
- func (c *AsyncAPIClient) UpdateAgentStatus(ctx context.Context, status string) error
- type Daemon
- type DispatchTaskControl
- type DispatcherConfig
- type InitConfig
- type LogLevel
- type MoltenHubAPI
- type ProfileConfig
- type PulledRuntimeMessage
- type ReviewWatchConfig
- type RuntimeConfig
- type SkillConfig
- type SkillDispatch
- type WSClient
Constants ¶
const DefaultLogLevel = logLevelInfoValue
DefaultLogLevel is used when runtime config omits log_level.
Variables ¶
This section is empty.
Functions ¶
func AllowNonMoltenHubBaseURL ¶
func AllowNonMoltenHubBaseURL() bool
AllowNonMoltenHubBaseURL reports whether non-production hub base URLs are explicitly allowed (for local integration/testing).
func ApplyBoundAgentRuntime ¶
ApplyBoundAgentRuntime enforces single-agent binding for one run request when this runtime already has a bound agent harness. If the runtime is still unbound, the request config is passed through unchanged.
func BoundAgentRuntime ¶
func BoundAgentRuntime(initCfg InitConfig) (agentruntime.Runtime, error)
BoundAgentRuntime resolves the configured one-agent runtime for this app instance.
func CanonicalHubBaseURL ¶
CanonicalHubBaseURL validates and normalizes baseURL according to active policy.
func ClearRuntimeConfigHubSettings ¶
func ClearRuntimeConfigHubSettings(path string, initCfg InitConfig) error
ClearRuntimeConfigHubSettings removes saved Hub identity, credentials, and profile fields while preserving unrelated runtime configuration.
func HubBaseURLForRegion ¶
HubBaseURLForRegion returns the canonical hub API base URL for a region.
func HubRegionFromBaseURL ¶
HubRegionFromBaseURL infers region from a hub base URL.
func IncrementRuntimeConfigLibraryTaskUsage ¶
func IncrementRuntimeConfigLibraryTaskUsage(path string, initCfg InitConfig, taskName string) error
IncrementRuntimeConfigLibraryTaskUsage records one successful local selection of a library task in config.json while preserving unrelated runtime config settings already stored on disk.
func NormalizeHubRegion ¶
NormalizeHubRegion converts region into a supported value.
func NormalizeLogLevel ¶
NormalizeLogLevel canonicalizes supported spellings/aliases.
func ParseRunConfigJSON ¶
ParseRunConfigJSON parses one inline run config JSON object into a validated config.
func ReadRuntimeConfigLibraryTaskUsage ¶
ReadRuntimeConfigLibraryTaskUsage returns normalized per-task usage counts from the persisted runtime config. Invalid or non-positive entries are ignored.
func ReadRuntimeConfigString ¶
ReadRuntimeConfigString returns the first non-empty string for the provided keys from a runtime config file. It returns an empty string when the file cannot be read or parsed.
func RunCompletedActivity ¶
RunCompletedActivity returns the custom task-complete activity for runCfg.
func RunStartedActivity ¶
RunStartedActivity returns the custom task-start activity for runCfg.
func SaveRuntimeConfig ¶
func SaveRuntimeConfig(path string, initCfg InitConfig, token string) error
SaveRuntimeConfig writes a normalized, hub-bootable runtime config JSON file.
func SaveRuntimeConfigAgentRuntime ¶
func SaveRuntimeConfigAgentRuntime(path string, initCfg InitConfig, harness, command string) error
SaveRuntimeConfigAgentRuntime persists agent_harness/agent_command to the runtime config while preserving other configuration fields. Once configured, switching to a different harness or command through this API is rejected.
func SaveRuntimeConfigClaudeOAuthToken ¶
func SaveRuntimeConfigClaudeOAuthToken(path string, initCfg InitConfig, oauthToken string) error
SaveRuntimeConfigClaudeOAuthToken persists claude_code_oauth_token to the runtime config JSON while preserving other configuration fields.
func SaveRuntimeConfigGitHubToken ¶
func SaveRuntimeConfigGitHubToken(path string, initCfg InitConfig, gitHubToken string) error
SaveRuntimeConfigGitHubToken persists github_token to the runtime config JSON while preserving other configuration fields.
func SaveRuntimeConfigHubSettings ¶
func SaveRuntimeConfigHubSettings(path string, initCfg InitConfig, resolvedAgentToken string) error
SaveRuntimeConfigHubSettings persists hub credentials plus handle/profile fields while preserving unrelated runtime config keys already on disk.
func ValidateHubBaseURL ¶
ValidateHubBaseURL validates baseURL according to the active policy.
func ValidateHubBaseURLStrict ¶
ValidateHubBaseURLStrict validates baseURL against production hub constraints.
func ValidatePersistedHubBaseURL ¶
ValidatePersistedHubBaseURL validates hub base URLs that may be written to runtime config. Persisted config must stay on HTTPS Molten Hub domains even when local non-Molten endpoints are allowed for in-process tests.
func WebsocketURL ¶
WebsocketURL builds the canonical runtime websocket endpoint from API base URL.
Types ¶
type APIClient ¶
APIClient wraps hub HTTP interactions.
func NewAPIClient ¶
NewAPIClient returns an API client with defaults.
func (APIClient) AckRuntimeDelivery ¶
AckRuntimeDelivery acknowledges a leased pull delivery.
func (APIClient) AgentMetadata ¶
AgentMetadata loads the current agent metadata for safe merge-style updates.
func (APIClient) AgentProfile ¶
AgentProfile loads the current agent handle/profile for config persistence.
func (APIClient) MarkRuntimeOffline ¶
MarkRuntimeOffline marks this runtime offline for websocket transport.
func (APIClient) NackRuntimeDelivery ¶
NackRuntimeDelivery releases a leased pull delivery back to the queue.
func (APIClient) PublishResult ¶
PublishResult posts a skill result using A2A SendMessage with runtime transport fallback.
func (APIClient) PullRuntimeMessage ¶
func (c APIClient) PullRuntimeMessage(ctx context.Context, token string, timeoutMs int) (PulledRuntimeMessage, bool, error)
PullRuntimeMessage claims the next runtime envelope using long-poll transport.
func (APIClient) RecordActivity ¶
RecordActivity publishes a custom activity entry.
func (APIClient) RecordCodingActivityRunning ¶
RecordCodingActivityRunning publishes a generic active-coding activity.
func (APIClient) RecordGitHubTaskCompleteActivity ¶
RecordGitHubTaskCompleteActivity publishes a minimal completion activity.
func (APIClient) RecordRunCompletedActivity ¶
func (c APIClient) RecordRunCompletedActivity(ctx context.Context, token string, runCfg config.Config) error
RecordRunCompletedActivity publishes the standard activity entry for one completed task run.
func (APIClient) RecordRunStartedActivity ¶
func (c APIClient) RecordRunStartedActivity(ctx context.Context, token string, runCfg config.Config) error
RecordRunStartedActivity publishes the standard activity entry for one task run.
func (APIClient) RegisterRuntime ¶
func (c APIClient) RegisterRuntime(ctx context.Context, token string, cfg InitConfig, libraryTasks []library.TaskSummary) error
RegisterRuntime sends plugin/runtime metadata to hub.
func (*APIClient) ResolveAgentToken ¶
ResolveAgentToken picks a working agent token from init config and bind flow.
func (APIClient) SyncProfile ¶
SyncProfile applies handle/profile updates.
type AdaptiveDispatchController ¶
type AdaptiveDispatchController struct {
// contains filtered or unexported fields
}
AdaptiveDispatchController controls dispatch admission with rolling system load samples. It never preempts running work; when pressure rises, newer tasks stay queued.
func NewAdaptiveDispatchController ¶
func NewAdaptiveDispatchController(cfg DispatcherConfig, logf func(string, ...any)) *AdaptiveDispatchController
NewAdaptiveDispatchController returns a queue-aware, adaptive dispatcher.
func (*AdaptiveDispatchController) Acquire ¶
func (c *AdaptiveDispatchController) Acquire(ctx context.Context, requestID string) (func(), error)
Acquire blocks until the caller is admitted to run. The returned function must be called once when done.
func (*AdaptiveDispatchController) AcquireForce ¶
func (c *AdaptiveDispatchController) AcquireForce(ctx context.Context, requestID string) (func(), error)
AcquireForce admits a caller immediately, even when current running work exceeds allowed capacity. Use this sparingly for explicit operator override actions.
func (*AdaptiveDispatchController) Start ¶
func (c *AdaptiveDispatchController) Start(ctx context.Context)
Start begins background sampling. Safe to call multiple times.
type AgentProfile ¶
type AgentProfile struct {
Handle string
Profile ProfileConfig
}
AgentProfile captures the profile fields this runtime needs to persist locally.
type AsyncAPIClient ¶
type AsyncAPIClient struct {
// contains filtered or unexported fields
}
AsyncAPIClient wraps APIClient with token-bound methods and async helpers.
func NewAsyncAPIClient ¶
func NewAsyncAPIClient(baseURL, token string) *AsyncAPIClient
NewAsyncAPIClient returns a token-bound async hub API wrapper.
func NewAsyncAPIClientFrom ¶
func NewAsyncAPIClientFrom(client APIClient, token string) *AsyncAPIClient
NewAsyncAPIClientFrom wraps an existing transport-level API client.
func (*AsyncAPIClient) AckRuntimeDelivery ¶
func (c *AsyncAPIClient) AckRuntimeDelivery(ctx context.Context, deliveryID string) error
AckRuntimeDelivery acknowledges a leased delivery.
func (*AsyncAPIClient) AckRuntimeDeliveryAsync ¶
func (c *AsyncAPIClient) AckRuntimeDeliveryAsync(ctx context.Context, deliveryID string) <-chan error
AckRuntimeDeliveryAsync acknowledges a delivery on a background goroutine.
func (*AsyncAPIClient) BaseURL ¶
func (c *AsyncAPIClient) BaseURL() string
BaseURL returns the normalized API base URL.
func (*AsyncAPIClient) MarkRuntimeOffline ¶
func (c *AsyncAPIClient) MarkRuntimeOffline(ctx context.Context, sessionKey, reason string) error
MarkRuntimeOffline marks websocket transport offline for the configured token.
func (*AsyncAPIClient) NackRuntimeDelivery ¶
func (c *AsyncAPIClient) NackRuntimeDelivery(ctx context.Context, deliveryID string) error
NackRuntimeDelivery releases a leased delivery back to the queue.
func (*AsyncAPIClient) NackRuntimeDeliveryAsync ¶
func (c *AsyncAPIClient) NackRuntimeDeliveryAsync(ctx context.Context, deliveryID string) <-chan error
NackRuntimeDeliveryAsync releases a delivery on a background goroutine.
func (*AsyncAPIClient) PublishResult ¶
PublishResult publishes a skill result for the configured token.
func (*AsyncAPIClient) PublishResultAsync ¶
func (c *AsyncAPIClient) PublishResultAsync(ctx context.Context, payload map[string]any) <-chan error
PublishResultAsync publishes a result on a background goroutine.
func (*AsyncAPIClient) PullRuntimeMessage ¶
func (c *AsyncAPIClient) PullRuntimeMessage(ctx context.Context, timeoutMs int) (PulledRuntimeMessage, bool, error)
PullRuntimeMessage pulls one inbound transport envelope.
func (*AsyncAPIClient) RecordActivity ¶
func (c *AsyncAPIClient) RecordActivity(ctx context.Context, activity string) error
RecordActivity publishes a custom agent activity.
func (*AsyncAPIClient) RecordCodingActivityRunning ¶
func (c *AsyncAPIClient) RecordCodingActivityRunning(ctx context.Context) error
RecordCodingActivityRunning publishes a generic active-coding activity.
func (*AsyncAPIClient) RecordGitHubTaskCompleteActivity ¶
func (c *AsyncAPIClient) RecordGitHubTaskCompleteActivity(ctx context.Context) error
RecordGitHubTaskCompleteActivity publishes a minimal completion activity.
func (*AsyncAPIClient) RecordRunCompletedActivity ¶
func (c *AsyncAPIClient) RecordRunCompletedActivity(ctx context.Context, runCfg config.Config) error
RecordRunCompletedActivity publishes the standard activity entry for one completed task run.
func (*AsyncAPIClient) RecordRunStartedActivity ¶
RecordRunStartedActivity publishes the standard activity entry for one task run.
func (*AsyncAPIClient) RegisterRuntime ¶
func (c *AsyncAPIClient) RegisterRuntime(ctx context.Context, cfg InitConfig, libraryTasks []library.TaskSummary) error
RegisterRuntime registers runtime metadata for the configured token.
func (*AsyncAPIClient) ResolveAgentToken ¶
func (c *AsyncAPIClient) ResolveAgentToken(ctx context.Context, cfg InitConfig) (string, error)
ResolveAgentToken resolves and stores a working token for subsequent calls.
func (*AsyncAPIClient) SyncProfile ¶
func (c *AsyncAPIClient) SyncProfile(ctx context.Context, cfg InitConfig) error
SyncProfile syncs profile metadata for the configured token.
func (*AsyncAPIClient) Token ¶
func (c *AsyncAPIClient) Token() string
Token returns the currently configured bearer token.
func (*AsyncAPIClient) UpdateAgentStatus ¶
func (c *AsyncAPIClient) UpdateAgentStatus(ctx context.Context, status string) error
UpdateAgentStatus updates agent lifecycle status for the configured token.
type Daemon ¶
type Daemon struct {
Runner execx.Runner
Logf func(string, ...any)
OnDispatchQueued func(requestID string, runCfg config.Config)
OnDispatchFailed func(requestID string, runCfg config.Config, result app.Result)
RegisterTaskControl func(requestID string, cancel context.CancelCauseFunc) DispatchTaskControl
RegisterTaskAliases func(requestID string, aliases ...string)
CancelTaskControl func(taskID string) (requestID string, stopped bool)
CompleteTaskControl func(requestID string)
DispatchController *AdaptiveDispatchController
ReconnectDelay time.Duration
TaskLogRoot string
}
Daemon listens for hub skill dispatches and runs harness jobs.
type DispatchTaskControl ¶
type DispatchTaskControl interface {
WaitUntilRunnable(context.Context) error
SetAcquireCancel(context.CancelFunc)
ClearAcquireCancel(context.CancelFunc)
SetRunning(bool)
ConsumeForceAcquire() bool
HasForceAcquire() bool
IsPaused() bool
IsStopped() bool
}
DispatchTaskControl exposes per-request runtime controls shared with the UI.
type DispatcherConfig ¶
type DispatcherConfig struct {
MaxParallel int `json:"max_parallel"`
MinParallel int `json:"min_parallel"`
SampleWindow int `json:"sample_window"`
SampleIntervalMS int `json:"sample_interval_ms"`
CPUHighWatermark float64 `json:"cpu_high_watermark"`
MemoryHighWatermark float64 `json:"memory_high_watermark"`
DiskIOHighWatermarkMBs float64 `json:"disk_io_high_watermark_mb_s"`
}
DispatcherConfig controls local worker behavior.
type InitConfig ¶
type InitConfig struct {
Version string `json:"version"`
BaseURL string `json:"base_url"`
BindToken string `json:"bind_token"`
AgentToken string `json:"agent_token"`
LogLevel string `json:"log_level,omitempty"`
AgentHarness string `json:"agent_harness,omitempty"`
AgentCommand string `json:"agent_command,omitempty"`
SessionKey string `json:"session_key"`
Handle string `json:"handle"`
Profile ProfileConfig `json:"profile"`
GitHubToken string `json:"github_token,omitempty"`
OpenAIAPIKey string `json:"openai_api_key,omitempty"`
Skill SkillConfig `json:"-"`
RuntimeConfigPath string `json:"-"`
Dispatcher DispatcherConfig `json:"dispatcher"`
ReviewWatch ReviewWatchConfig `json:"review_watch,omitempty"`
}
InitConfig is the init.json contract for hub runtime mode.
func LoadInit ¶
func LoadInit(path string) (InitConfig, error)
LoadInit reads and validates JSON/JSONC init config.
func (*InitConfig) ApplyDefaults ¶
func (c *InitConfig) ApplyDefaults()
ApplyDefaults normalizes and fills optional values.
type LogLevel ¶
type LogLevel int
LogLevel controls log emission severity filtering.
func ParseLogLevel ¶
ParseLogLevel returns a canonical level enum for a configured value.
type MoltenHubAPI ¶
type MoltenHubAPI interface {
BaseURL() string
Token() string
ResolveAgentToken(ctx context.Context, cfg InitConfig) (string, error)
SyncProfile(ctx context.Context, cfg InitConfig) error
UpdateAgentStatus(ctx context.Context, status string) error
MarkRuntimeOffline(ctx context.Context, sessionKey, reason string) error
RecordActivity(ctx context.Context, activity string) error
RecordCodingActivityRunning(ctx context.Context) error
RecordGitHubTaskCompleteActivity(ctx context.Context) error
RecordRunStartedActivity(ctx context.Context, runCfg config.Config) error
RecordRunCompletedActivity(ctx context.Context, runCfg config.Config) error
RegisterRuntime(ctx context.Context, cfg InitConfig, libraryTasks []library.TaskSummary) error
PublishResult(ctx context.Context, payload map[string]any) error
PublishResultAsync(ctx context.Context, payload map[string]any) <-chan error
PullRuntimeMessage(ctx context.Context, timeoutMs int) (PulledRuntimeMessage, bool, error)
AckRuntimeDelivery(ctx context.Context, deliveryID string) error
AckRuntimeDeliveryAsync(ctx context.Context, deliveryID string) <-chan error
NackRuntimeDelivery(ctx context.Context, deliveryID string) error
NackRuntimeDeliveryAsync(ctx context.Context, deliveryID string) <-chan error
}
MoltenHubAPI defines the runtime hub API surface with token-bound calls. Async methods return a buffered channel with one terminal error value.
type ProfileConfig ¶
type ProfileConfig struct {
DisplayName string `json:"display_name"`
Emoji string `json:"emoji"`
ProfileText string `json:"profile"`
LLM string `json:"llm"`
Harness string `json:"harness"`
Skills []string `json:"skills"`
Metadata map[string]any `json:"-"`
}
ProfileConfig controls optional agent profile sync on startup.
func (*ProfileConfig) UnmarshalJSON ¶
func (p *ProfileConfig) UnmarshalJSON(data []byte) error
type PulledRuntimeMessage ¶
PulledRuntimeMessage is one leased inbound message from runtime pull transport.
type ReviewWatchConfig ¶ added in v1.0.10
type ReviewWatchConfig struct {
Enabled *bool `json:"enabled,omitempty"`
PollIntervalMS int `json:"poll_interval_ms,omitempty"`
Writeback string `json:"writeback,omitempty"`
AutoMerge *bool `json:"auto_merge,omitempty"`
MergeMethod string `json:"merge_method,omitempty"`
ResponseMode string `json:"response_mode,omitempty"`
}
ReviewWatchConfig controls local GitHub notification polling for review requests.
func (ReviewWatchConfig) AutoMergeEnabled ¶ added in v1.0.10
func (c ReviewWatchConfig) AutoMergeEnabled() bool
AutoMergeEnabled returns the effective clean-review merge setting.
func (ReviewWatchConfig) EnabledValue ¶ added in v1.0.10
func (c ReviewWatchConfig) EnabledValue() bool
EnabledValue returns the effective local review watcher setting. The watcher defaults on so a GitHub-authenticated hub can respond to review requests without extra config.
type RuntimeConfig ¶
type RuntimeConfig struct {
InitConfig
TimeoutMs int `json:"timeout_ms,omitempty"`
LibraryTaskUsage map[string]int `json:"library_task_usage,omitempty"`
}
RuntimeConfig is persisted after successful hub auth so subsequent runs can start directly from config.json without requiring init.json again.
func LoadRuntimeConfig ¶
func LoadRuntimeConfig(path string) (RuntimeConfig, error)
LoadRuntimeConfig reads and validates a persisted runtime config JSON file.
func (*RuntimeConfig) ApplyDefaults ¶
func (c *RuntimeConfig) ApplyDefaults()
ApplyDefaults normalizes a persisted runtime config.
func (RuntimeConfig) Init ¶
func (c RuntimeConfig) Init() InitConfig
func (*RuntimeConfig) UnmarshalJSON ¶
func (c *RuntimeConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON accepts the current init-style snake_case config and the legacy minimal runtime config shape.
func (RuntimeConfig) Validate ¶
func (c RuntimeConfig) Validate() error
Validate checks required values for hub boot from config.json.
type SkillConfig ¶
type SkillConfig struct {
Name string `json:"name"`
DispatchType string `json:"dispatch_type"`
ResultType string `json:"result_type"`
}
SkillConfig defines the inbound dispatch and outbound result contract.
type SkillDispatch ¶
type SkillDispatch struct {
RequestID string
HubTaskID string
ContextID string
Skill string
ReplyTo string
RouteTo string
Originator string
OriginatorAgentURI string
OriginatorAgentUUID string
OriginatorAgentID string
OriginatorHumanID string
Config config.Config
}
SkillDispatch represents one inbound skill request ready for execution.
func ParseSkillDispatch ¶
func ParseSkillDispatch(msg map[string]any, expectedType, expectedSkill string) (SkillDispatch, bool, error)
ParseSkillDispatch parses an inbound transport JSON message into a runnable dispatch.
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
WSClient is a minimal websocket client for text JSON messages.
func DialWebsocket ¶
DialWebsocket creates an authenticated websocket connection.