repomap

package
v1.10.7 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package repomap implements the repomap skill, contributing 2 MCP tools for repository structure mapping and task-focused context retrieval.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FallbackDeps

type FallbackDeps struct {
	AcquireFn func(ctx context.Context, lang string) (repomap.SymbolRequester, func(), error)
	Extractor *repomap.FallbackExtractor
}

FallbackDeps holds dependencies for LSP-based fallback tag extraction. Wired by the daemon after kernel creation via SetFallbackDeps.

type RepoMapSkill

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

RepoMapSkill implements skill.ToolProvider, exposing get_repo_map and get_context as MCP tools backed by the repomap graph and PageRank ranking.

func GetRepoMapSkill

func GetRepoMapSkill() *RepoMapSkill

GetRepoMapSkill returns the registered RepoMapSkill instance for post-init wiring. Returns nil if the skill has not been registered.

func (*RepoMapSkill) Cache

func (s *RepoMapSkill) Cache() *repomap.TagCache

Cache returns the underlying TagCache for external consumers (e.g., LSP enrichment).

func (*RepoMapSkill) Description

func (s *RepoMapSkill) Description() string

Description returns a human-readable description.

func (*RepoMapSkill) ExecuteTool

func (s *RepoMapSkill) ExecuteTool(name string, args map[string]interface{}) (string, error)

ExecuteTool runs a repomap tool by name with the given JSON arguments.

func (*RepoMapSkill) Init

func (s *RepoMapSkill) Init(deps skill.SkillDeps) error

Init creates the underlying TagCache and renderers from skill dependencies. Per plan decision: does NOT modify SkillDeps. Creates own dependencies from ProjectDir.

func (*RepoMapSkill) Name

func (s *RepoMapSkill) Name() string

Name returns the skill identifier.

func (*RepoMapSkill) SetEnrichFn

func (s *RepoMapSkill) SetEnrichFn(fn func(graph *repomap.FileGraph))

SetEnrichFn sets the optional LSP enrichment callback. Called by the daemon after kernel creation to enable cross-file LSP references.

func (*RepoMapSkill) SetFallbackDeps

func (s *RepoMapSkill) SetFallbackDeps(deps *FallbackDeps)

SetFallbackDeps sets the fallback extraction dependencies for languages without tree-sitter grammars. Called by the daemon after kernel creation to enable LSP documentSymbol fallback (D-33-01).

func (*RepoMapSkill) SetMetricsSink

func (s *RepoMapSkill) SetMetricsSink(sink repomap.MetricsSink)

SetMetricsSink wires the repomap.MetricsSink for per-extractor latency observation (Q-2 Option 2). Called from internal/daemon/daemon.go post-init (block 12d). Phase 53 D-15. A nil argument is normalized to NoopSink{} so the dispatcher's emission sites never need nil-checks.

Decision (Plan 53-03 setter pattern): adding the sink as a setter rather than a constructor argument matches the existing SetEnrichFn / SetFallbackDeps pattern and keeps daemon post-init wiring uniform.

func (*RepoMapSkill) SetRegistry

func (s *RepoMapSkill) SetRegistry(registry *treesitter.GrammarRegistry)

SetRegistry injects the canonical GrammarRegistry constructed at daemon bootstrap and lazily builds registry-dependent renderers/extractors. Called by the daemon post-init (BUG-04, D-01/D-02/D-03). Idempotent and nil-safe.

func (*RepoMapSkill) SetWorkspaceRoot

func (s *RepoMapSkill) SetWorkspaceRoot(root string)

SetWorkspaceRoot updates the workspace root directory for tag extraction. Called by the daemon when activate_project sets a new workspace. Invalidates the cache so the next tool call re-walks the workspace.

func (*RepoMapSkill) Tools

func (s *RepoMapSkill) Tools() []*mcp.ToolDef

Tools returns the 2 MCP tool definitions for repomap operations.

Jump to

Keyboard shortcuts

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