resources

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package resources is part of the GoFastr harness.

See docs/harness-architecture.md for the architecture this package implements.

Package resources aggregates read-only catalogs (sessions, profiles, providers, tools, skills, mcp servers, slash-commands, runtime stats) for REST and mcpserver to surface.

Per § Control plane → Package map, this layer sits above session/skill/tool/profile and below the transport so transports don't need to back-import everything.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {

	// Tools is the registered tool catalog.
	Tools *tool.Registry

	// Providers is the configured provider list. Order is
	// registration order.
	Providers []provider.Provider

	// Skills returns the loaded skill tier-1 metadata. The
	// composition wires a callable so the catalog stays decoupled
	// from skill.Registry's concrete type.
	Skills func() []skillmd.Tier1
	// contains filtered or unexported fields
}

Catalog is the aggregator. The harness composition layer wires the subsystem references (Engines, Tools, Skills, Providers, etc.) once at boot; transports read from this surface.

func NewCatalog

func NewCatalog() *Catalog

NewCatalog returns an empty Catalog. Wire fields after construction.

func (*Catalog) ClaimNamespace

func (c *Catalog) ClaimNamespace(ns string)

ClaimNamespace adds a plugin-claimed slash-command namespace.

func (*Catalog) Handshake

func (c *Catalog) Handshake(features []string) control.Handshake

Handshake returns the protocol handshake. Provided here so REST and mcpserver share one implementation.

func (*Catalog) ListProviders

func (c *Catalog) ListProviders(ctx context.Context) []ProviderInfo

ListProviders returns the provider catalog with model details.

func (*Catalog) ListSessions

func (c *Catalog) ListSessions() []SessionInfo

ListSessions returns active sessions, sorted by SessionID.

func (*Catalog) ListSkills

func (c *Catalog) ListSkills() []skillmd.Tier1

ListSkills returns the loaded skill tier-1 catalog.

func (*Catalog) ListSlashCommands

func (c *Catalog) ListSlashCommands() []SlashCommandInfo

ListSlashCommands returns the union of built-in and plugin commands.

func (*Catalog) ListTools

func (c *Catalog) ListTools() []ToolInfo

ListTools returns the registered tool catalog.

func (*Catalog) RegisterEngine

func (c *Catalog) RegisterEngine(e *engine.Engine)

RegisterEngine registers a session's engine for inclusion in /v1/sessions listings.

func (*Catalog) UnregisterEngine

func (c *Catalog) UnregisterEngine(s ids.SessionID)

UnregisterEngine removes a session.

type ProviderInfo

type ProviderInfo struct {
	Name   string           `json:"name"`
	Models []provider.Model `json:"models"`
}

ProviderInfo is the shape /v1/providers returns.

type SessionInfo

type SessionInfo struct {
	SessionID ids.SessionID `json:"session"`
	Profile   string        `json:"profile"`
	Model     string        `json:"model"`
	Provider  string        `json:"provider"`
	Turns     int           `json:"turns"`
}

SessionInfo is the shape /v1/sessions and harness/v1://sessions return.

type SlashCommandInfo

type SlashCommandInfo struct {
	Namespace   string `json:"namespace,omitempty"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ArgsHelp    string `json:"args_help,omitempty"`
	IsBuiltin   bool   `json:"is_builtin"`
}

SlashCommandInfo is the shape /v1/slash-commands returns.

type ToolInfo

type ToolInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Mutating    bool   `json:"mutating"`
	Source      string `json:"source"`
	Schema      []byte `json:"schema"`
}

ToolInfo is the shape /v1/tools returns.

Jump to

Keyboard shortcuts

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