portal

package
v1.98.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package portal provides the MCP toolkit for saving and managing AI-generated artifacts (JSX dashboards, HTML reports, SVG charts).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name            string
	AssetStore      portal.AssetStore
	ShareStore      portal.ShareStore
	VersionStore    portal.VersionStore
	CollectionStore portal.CollectionStore
	ThreadStore     portal.ThreadStore
	S3Client        portal.S3Client
	S3Bucket        string
	S3Prefix        string
	BaseURL         string
	MaxContentSize  int // max artifact content size in bytes (0 = no limit)

	// Embedder embeds search queries for the ranked `search` action. When nil
	// or the noop placeholder, search degrades to lexical-only ranking (the
	// store decides via embedding.EmbedForSearch).
	Embedder embedding.Provider
}

Config holds configuration for creating a portal toolkit.

type Toolkit

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

Toolkit implements the portal artifact toolkit.

func New

func New(cfg Config) *Toolkit

New creates a new portal toolkit.

func (*Toolkit) Close

func (*Toolkit) Close() error

Close releases resources.

func (*Toolkit) Connection

func (*Toolkit) Connection() string

Connection returns the connection name for audit logging.

func (*Toolkit) Kind

func (*Toolkit) Kind() string

Kind returns the toolkit kind.

func (*Toolkit) LinkInsight added in v1.84.0

func (t *Toolkit) LinkInsight(ctx context.Context, threadIDs []string, insightID, actorID, actorEmail string) ([]string, error)

LinkInsight implements the knowledge ThreadLinker bridge with authorization. capture_insight calls this with the thread_ids an insight resolves. The agent surface must not be able to resolve a thread it could not resolve through resolve_thread, so each thread is gated through callerCanActOnThread (the same owns-or-edit / author / admin policy) using the caller identity in ctx. Threads the caller may not moderate, that are missing, empty, or duplicated are skipped and surface to the agent as unlinked_thread_ids. Authorized ids are delegated to the thread store, which performs the link transactionally.

func (*Toolkit) Name

func (t *Toolkit) Name() string

Name returns the toolkit instance name.

func (*Toolkit) PromptInfos added in v1.38.0

func (*Toolkit) PromptInfos() []registry.PromptInfo

PromptInfos returns metadata for prompts registered by the portal toolkit.

func (*Toolkit) RegisterTools

func (t *Toolkit) RegisterTools(s *mcp.Server)

RegisterTools registers save_artifact and manage_artifact with the MCP server.

func (*Toolkit) SetQueryProvider

func (t *Toolkit) SetQueryProvider(provider query.Provider)

SetQueryProvider sets the query execution provider.

func (*Toolkit) SetSemanticProvider

func (t *Toolkit) SetSemanticProvider(provider semantic.Provider)

SetSemanticProvider sets the semantic metadata provider.

func (*Toolkit) Tools

func (*Toolkit) Tools() []string

Tools returns the list of tool names provided by this toolkit.

Jump to

Keyboard shortcuts

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