Documentation
¶
Overview ¶
Package connview builds the list_connections view: the configured connections across toolkits, each enriched with the canonical knowledge pages that reference it (#634). It lives outside pkg/platform so that package stays within its size budget, and depends only on narrow capabilities (a source resolver and a knowledge-page reverse lookup) rather than on the platform itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Kind string `json:"kind"`
Name string `json:"name"`
Connection string `json:"connection"`
// Reference is the canonical mcp:connection:(kind,name) citation string, so an
// agent can reference this connection from a knowledge page without composing
// it by hand.
Reference string `json:"reference,omitempty"`
Description string `json:"description,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
DataHubSourceName string `json:"datahub_source_name,omitempty"`
CatalogID string `json:"catalog_id,omitempty"`
OperationCount int `json:"operation_count,omitempty"`
Health *toolkit.ConnectionHealthWire `json:"health,omitempty"`
// KnowledgePageCount is the total number of knowledge pages that reference this
// connection; KnowledgePages carries a bounded sample of them (#634).
KnowledgePageCount int `json:"knowledge_page_count,omitempty"`
KnowledgePages []KnowledgePage `json:"knowledge_pages,omitempty"`
}
Entry describes a single toolkit connection. CatalogID and OperationCount are populated only for kinds where they have meaning (today: api).
type KnowledgePage ¶
type KnowledgePage struct {
ID string `json:"id"`
Slug string `json:"slug"`
Title string `json:"title"`
}
KnowledgePage is a brief reference to a knowledge page documenting a connection.
type Output ¶
Output is the JSON response for the list_connections tool.
func Build ¶
func Build(ctx context.Context, toolkits []registry.Toolkit, src SourceResolver, pages PageLookup) Output
Build enumerates connections across the toolkits and enriches each with the knowledge pages that reference it (bounded by maxKnowledgePages). src and pages may be nil; a nil page lookup simply skips the knowledge enrichment.
type PageLookup ¶
type PageLookup interface {
ListPagesReferencing(ctx context.Context, ref knowledgepage.EntityRef) ([]knowledgepage.PageRef, error)
}
PageLookup is the knowledge-page reverse lookup: the pages referencing a target.
type SourceResolver ¶
SourceResolver resolves a connection's DataHub source name (empty when none).