workspace

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(svc *service.Service) http.Handler

Handler exposes CRUD operations for any workspace repository kind (agents, models, workflows, mcp …).

Routes (all under /v1/workspace/):

GET    /{kind}            -> JSON []string
GET    /{kind}/{name}     -> raw YAML/JSON (as stored)
PUT    /{kind}/{name}     -> create/overwrite
DELETE /{kind}/{name}     -> delete

It is intentionally stateless; repositories are resolved via service.Service.

Types

type A2AAuthMeta added in v0.2.10

type A2AAuthMeta struct {
	Enabled       bool     `json:"enabled"`
	Resource      string   `json:"resource,omitempty"`
	Scopes        []string `json:"scopes,omitempty"`
	UseIDToken    bool     `json:"useIDToken,omitempty"`
	ExcludePrefix string   `json:"excludePrefix,omitempty"`
}

type A2AMeta added in v0.2.10

type A2AMeta struct {
	Configured bool         `json:"configured"`
	Enabled    bool         `json:"enabled"`
	Port       int          `json:"port,omitempty"`
	Streaming  bool         `json:"streaming"`
	Addr       string       `json:"addr,omitempty"` // e.g. localhost:8091
	URLs       *A2AURLs     `json:"urls,omitempty"` // common entry points
	Auth       *A2AAuthMeta `json:"auth,omitempty"`
	State      string       `json:"state,omitempty"` // unknown|configured
}

A2AMeta summarizes agent A2A exposure configuration for UI status.

type A2AURLs added in v0.2.10

type A2AURLs struct {
	Base      string `json:"base,omitempty"`      // http://localhost:port/
	AgentCard string `json:"agentCard,omitempty"` // /.well-known/agent-card.json
	SSEBase   string `json:"sseBase,omitempty"`   // /v1
	Streaming string `json:"streaming,omitempty"` // /a2a
}

type AgentAuthoringMeta added in v0.2.10

type AgentAuthoringMeta struct {
	Source        SourceMeta         `json:"source"`
	Prompts       PromptMeta         `json:"prompts"`
	Knowledge     KnowledgeMeta      `json:"knowledge"`
	Capabilities  CapabilitiesMeta   `json:"capabilities"`
	ContextInputs *ContextInputsMeta `json:"contextInputs,omitempty"`
	A2A           *A2AMeta           `json:"a2a,omitempty"`
	Assets        []AssetMeta        `json:"assets,omitempty"`
}

type AgentEditView added in v0.2.10

type AgentEditView struct {
	Agent *agentmdl.Agent     `json:"agent"`
	Meta  *AgentAuthoringMeta `json:"meta"`
}

AgentEditView provides authoring-oriented metadata for the Agents UI. It is read-only and computed on demand; the stored YAML remains unchanged.

type AssetMeta added in v0.2.10

type AssetMeta struct {
	Path string `json:"path"`
	Type string `json:"type"` // file|dir
	Size int64  `json:"size,omitempty"`
}

AssetMeta represents a non‑YAML asset under the agent folder.

type CapabilitiesMeta added in v0.2.10

type CapabilitiesMeta struct {
	SupportsChains            bool `json:"supportsChains"`
	SupportsParallelToolCalls bool `json:"supportsParallelToolCalls"`
	SupportsAttachments       bool `json:"supportsAttachments"`
}

type ContextInputsMeta added in v0.2.10

type ContextInputsMeta struct {
	Enabled         bool                   `json:"enabled"`
	Message         string                 `json:"message,omitempty"`
	RequestedSchema map[string]interface{} `json:"requestedSchema,omitempty"`
	Fields          []InputFieldMeta       `json:"fields,omitempty"`
	Validation      InputValidationMeta    `json:"validation"`
}

ContextInputsMeta surfaces authored elicitation (aux inputs) with a derived list of fields and basic validation hints.

type InputFieldMeta added in v0.2.10

type InputFieldMeta struct {
	Name        string      `json:"name"`
	Type        string      `json:"type,omitempty"`
	Description string      `json:"description,omitempty"`
	Default     interface{} `json:"default,omitempty"`
	Required    bool        `json:"required"`
}

type InputValidationMeta added in v0.2.10

type InputValidationMeta struct {
	SchemaValid     bool     `json:"schemaValid"`
	MissingRequired []string `json:"missingRequired,omitempty"`
}

type KnowledgeMeta added in v0.2.10

type KnowledgeMeta struct {
	Roots []KnowledgeRoot `json:"roots"`
}

type KnowledgeRoot added in v0.2.10

type KnowledgeRoot struct {
	Scope     string `json:"scope"` // user|system
	Index     int    `json:"index"`
	Display   string `json:"display"`
	Resolved  string `json:"resolved"`
	Exists    bool   `json:"exists"`
	Browsable bool   `json:"browsable"`
}

type PathMeta added in v0.2.10

type PathMeta struct {
	Display  string `json:"display"`
	Resolved string `json:"resolved"`
	Exists   bool   `json:"exists"`
	// Content preview (best-effort), truncated when large.
	Content     string `json:"content,omitempty"`
	ContentSize int    `json:"contentSize,omitempty"`
	Truncated   bool   `json:"truncated,omitempty"`
}

type PromptMeta added in v0.2.10

type PromptMeta struct {
	User   PathMeta `json:"user"`
	System PathMeta `json:"system"`
}

type SourceMeta added in v0.2.10

type SourceMeta struct {
	URL     string `json:"url"`
	BaseDir string `json:"baseDir"`
}

Jump to

Keyboard shortcuts

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