Documentation
¶
Overview ¶
Package portal provides the MCP toolkit for saving and managing AI-generated artifacts (JSX dashboards, HTML reports, SVG charts).
Index ¶
- type Config
- type Toolkit
- func (*Toolkit) Close() error
- func (*Toolkit) Connection() string
- func (*Toolkit) Kind() string
- func (t *Toolkit) LinkInsight(ctx context.Context, threadIDs []string, insightID, actorID, actorEmail string) ([]string, error)
- func (t *Toolkit) Name() string
- func (*Toolkit) PromptInfos() []registry.PromptInfo
- func (t *Toolkit) RegisterTools(s *mcp.Server)
- func (t *Toolkit) SetQueryProvider(provider query.Provider)
- func (t *Toolkit) SetSemanticProvider(provider semantic.Provider)
- func (*Toolkit) Tools() []string
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
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 (*Toolkit) Connection ¶
Connection returns the connection name for audit logging.
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) PromptInfos ¶ added in v1.38.0
func (*Toolkit) PromptInfos() []registry.PromptInfo
PromptInfos returns metadata for prompts registered by the portal toolkit.
func (*Toolkit) RegisterTools ¶
RegisterTools registers save_artifact and manage_artifact with the MCP server.
func (*Toolkit) SetQueryProvider ¶
SetQueryProvider sets the query execution provider.
func (*Toolkit) SetSemanticProvider ¶
SetSemanticProvider sets the semantic metadata provider.