connview

package
v1.92.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

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

type Output struct {
	Connections []Entry `json:"connections"`
	Count       int     `json:"count"`
}

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

type SourceResolver interface {
	DataHubSourceName(kind, name string) string
}

SourceResolver resolves a connection's DataHub source name (empty when none).

Jump to

Keyboard shortcuts

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