tools

package
v0.0.0-...-bc78c97 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectoryEntry

type DirectoryEntry struct {
	RelPath string `json:"relpath" jsonschema:"path relative to workspace root"`
	Name    string `json:"name" jsonschema:"directory name"`
	Parent  string `json:"parent" jsonschema:"parent directory relpath"`
	SHA     string `json:"sha,omitempty" jsonschema:"directory content hash"`
}

type FileSearchText

type FileSearchText struct {
	DB *surreal.Client
}

type FileSearchTextInput

type FileSearchTextInput struct {
	WorkspaceID   string `json:"workspaceId" jsonschema:"workspace identifier"`
	RelPath       string `json:"relpath" jsonschema:"file path relative to workspace root"`
	Query         string `json:"query" jsonschema:"exact text snippet to find"`
	CaseSensitive bool   `json:"caseSensitive,omitempty" jsonschema:"if true, match is case-sensitive"`
	Limit         int    `json:"limit,omitempty" jsonschema:"max matches to return (default 20)"`
}

type FileSearchTextOutput

type FileSearchTextOutput struct {
	Matches []TextMatch `json:"matches" jsonschema:"list of matches within the file"`
}

type FileVectorSearch

type FileVectorSearch struct {
	DB       *surreal.Client
	Embedder *embedder.Client
}

type FileVectorSearchInput

type FileVectorSearchInput struct {
	WorkspaceID string `json:"workspaceId" jsonschema:"workspace identifier"`
	RelPath     string `json:"relpath" jsonschema:"file path relative to workspace root"`
	Query       string `json:"query" jsonschema:"natural language query"`
	TopK        int    `json:"topK,omitempty" jsonschema:"number of matches to return (default 5, max 20)"`
	ModelID     string `json:"modelId,omitempty" jsonschema:"override vector model slug"`
}

type FileVectorSearchOutput

type FileVectorSearchOutput struct {
	Matches []VectorMatch `json:"matches" jsonschema:"ranked vector matches"`
}

type FindFile

type FindFile struct {
	DB *surreal.Client
}

func (*FindFile) Search

type FindFileInput

type FindFileInput struct {
	WorkspaceID string `json:"workspaceId" jsonschema:"workspace identifier"`
	Query       string `json:"query" jsonschema:"exact match or substring to look for"`
	MatchType   string `json:"matchType,omitempty" jsonschema:"exact | substring | prefix | suffix"`
	Limit       int    `json:"limit,omitempty" jsonschema:"maximum number of results to return"`
}

type FindFileOutput

type FindFileOutput struct {
	Results []FindFileResult `json:"results" jsonschema:"matching files"`
}

type FindFileResult

type FindFileResult struct {
	RelPath string `json:"relpath" jsonschema:"path relative to workspace root"`
	Lang    string `json:"lang,omitempty" jsonschema:"language hint"`
	Size    int64  `json:"size" jsonschema:"file size in bytes"`
	SHA     string `json:"sha" jsonschema:"content hash"`
}

type IndexWorkspaceInput

type IndexWorkspaceInput struct {
	WorkspaceRoot string `json:"workspaceRoot" jsonschema:"absolute path to the workspace root"`
	WorkspaceID   string `json:"workspaceId" jsonschema:"stable workspace identifier"`
	RunID         string `json:"runId,omitempty" jsonschema:"optional deterministic run id"`
}

IndexWorkspaceInput contains required fields for L1 steps.

type IndexWorkspaceOutput

type IndexWorkspaceOutput struct {
	Run *indexer.RunReport `json:"run,omitempty"`
}

IndexWorkspaceOutput wraps the run report.

type Input

type Input struct {
	Command string   `json:"command" jsonschema:"the command to execute"`
	Args    []string `json:"args,omitempty" jsonschema:"the command arguments in order (optional)"`
}

type L1IndexerTools

type L1IndexerTools struct {
	Engine *indexer.Indexer
}

L1IndexerTools exposes MCP handlers for workspace indexing.

func (*L1IndexerTools) All

All orchestrates the full pipeline.

func (*L1IndexerTools) Embed

Embed handles index.workspace.embed.

func (*L1IndexerTools) Scan

Scan handles index.workspace.scan.

type ListNodes

type ListNodes struct {
	DB *surreal.Client
}

func (*ListNodes) List

type ListNodesInput

type ListNodesInput struct {
	Kind string `json:"kind,omitempty" jsonschema:"OPTIONAL, NOT IMPLEMENTED node kind (pc, vm, etc.)"`
}

type ListNodesOutput

type ListNodesOutput struct {
	Nodes []NodeSummary `json:"nodes" jsonschema:"registered nodes"`
}

type ListWorkspaces

type ListWorkspaces struct {
	DB *surreal.Client
}

type ListWorkspacesInput

type ListWorkspacesInput struct {
	NodeID string `json:"nodeId,omitempty" jsonschema:"optional node identifier to filter by"`
	DenID  string `json:"denId,omitempty" jsonschema:"optional den identifier to filter by"`
}

type ListWorkspacesOutput

type ListWorkspacesOutput struct {
	Workspaces []WorkspaceSummary `json:"workspaces"`
}

type NodeRegister

type NodeRegister struct {
	DB *surreal.Client
}

func (*NodeRegister) Register

type NodeRegisterInput

type NodeRegisterInput struct {
	NodeID string   `json:"nodeId" jsonschema:"stable identifier for node"`
	Name   string   `json:"name,omitempty" jsonschema:"display name; defaults to nodeId"`
	Kind   string   `json:"kind,omitempty" jsonschema:"kind of node (pc, vm, arm, etc.)"`
	OS     string   `json:"os,omitempty" jsonschema:"operating system summary"`
	CPU    string   `json:"cpu,omitempty" jsonschema:"cpu model summary"`
	RAMGB  *int     `json:"ramGb,omitempty" jsonschema:"ram size in GB"`
	Labels []string `json:"labels,omitempty" jsonschema:"optional free-form labels"`
}

type NodeRegisterOutput

type NodeRegisterOutput struct {
	Node string `json:"node"`
}

type NodeSummary

type NodeSummary struct {
	ID     string   `json:"id" jsonschema:"node record id"`
	Name   string   `json:"name" jsonschema:"display name"`
	Kind   string   `json:"kind,omitempty" jsonschema:"node kind (pc, vm, etc.)"`
	OS     string   `json:"os,omitempty" jsonschema:"operating system"`
	CPU    string   `json:"cpu,omitempty" jsonschema:"cpu model"`
	RAMGB  int      `json:"ramGb,omitempty" jsonschema:"RAM in GB"`
	Labels []string `json:"labels,omitempty" jsonschema:"free-form labels"`
}

type Output

type Output struct {
	Stdout   string `json:"stdout" jsonschema:"captured standard output"`
	Stderr   string `json:"stderr,omitempty" jsonschema:"captured standard error"`
	ExitCode int    `json:"exitCode" jsonschema:"process exit code"`
	Error    string `json:"error,omitempty" jsonschema:"error message if execution failed"`
}

func ExecCommand

func ExecCommand(ctx context.Context, _ *mcp.CallToolRequest, input Input) (
	*mcp.CallToolResult, Output, error,
)

type PTYInput

type PTYInput struct {
	Action        string   `` /* 128-byte string literal not displayed */
	SessionID     string   `json:"sessionId,omitempty" jsonschema:"identifier of an existing PTY session"`
	Command       string   `json:"command,omitempty" jsonschema:"optional command to execute when opening a new PTY; prefer default (the host shell)"`
	Args          []string `json:"args,omitempty" jsonschema:"arguments passed to the PTY command on open"`
	Data          string   `json:"data,omitempty" jsonschema:"payload written to the PTY when action=write"`
	AppendNewline *bool    `json:"appendNewline,omitempty" jsonschema:"when writing, append a newline (defaults to true if data present)"`
	Rows          uint16   `json:"rows,omitempty" jsonschema:"terminal rows for open/resize"`
	Cols          uint16   `json:"cols,omitempty" jsonschema:"terminal columns for open/resize"`
	Force         bool     `json:"force,omitempty" jsonschema:"when opening, terminate any existing PTY first"`
}

type PTYOutput

type PTYOutput struct {
	SessionID string `json:"sessionId" jsonschema:"MCP session id controlling this PTY"`
	Output    string `json:"output,omitempty" jsonschema:"new data captured from the PTY since the last call"`
	Plain     string `json:"plain,omitempty" jsonschema:"output with ANSI escape sequences stripped"`
	Started   bool   `json:"started,omitempty" jsonschema:"true if a PTY was started by this call"`
	Closed    bool   `json:"closed,omitempty" jsonschema:"true if the PTY was closed by this call"`
	Exited    bool   `json:"exited,omitempty" jsonschema:"true if the PTY process has exited"`
	ExitCode  int    `json:"exitCode,omitempty" jsonschema:"exit code reported by the PTY process"`
	Error     string `json:"error,omitempty" jsonschema:"error message when the action failed"`
}

type ReadWorkspaceFile

type ReadWorkspaceFile struct {
	DB *surreal.Client
}

type ReadWorkspaceFileInput

type ReadWorkspaceFileInput struct {
	WorkspaceID string `json:"workspaceId" jsonschema:"workspace identifier"`
	RelPath     string `json:"relPath" jsonschema:"file path relative to workspace root"`
	Start       int    `json:"start" jsonschema:"start character offset (0-based)"`
	End         int    `json:"end" jsonschema:"end character offset (exclusive)"`
	Hex         bool   `json:"hex,omitempty" jsonschema:"when true, read as hex-encoded bytes and count hex characters"`
}

type ReadWorkspaceFileOutput

type ReadWorkspaceFileOutput struct {
	RelPath   string `json:"relPath" jsonschema:"file path relative to workspace root"`
	Chunk     string `json:"chunk" jsonschema:"requested slice of the file contents"`
	Hex       bool   `json:"hex" jsonschema:"true if hex mode was used"`
	Truncated bool   `json:"truncated" jsonschema:"true if output was truncated for transport size"`
}

type TextMatch

type TextMatch struct {
	RelPath    string `json:"relpath" jsonschema:"file path relative to workspace root"`
	LineNumber int    `json:"lineNumber" jsonschema:"line number of match"`
	Snippet    string `json:"snippet" jsonschema:"line containing the match"`
}

type VectorMatch

type VectorMatch struct {
	Score      float64 `json:"score" jsonschema:"cosine similarity score"`
	ContentSHA string  `json:"contentSha" jsonschema:"hash of the matched chunk"`
	Start      int     `json:"start" jsonschema:"chunk start byte offset"`
	End        int     `json:"end" jsonschema:"chunk end byte offset"`
	TokenCount int     `json:"tokenCount" jsonschema:"token count for the chunk"`
	Snippet    string  `json:"snippet" jsonschema:"text snippet of the chunk"`
}

type WorkspaceFile

type WorkspaceFile struct {
	RelPath   string    `json:"relpath" jsonschema:"path relative to workspace root"`
	Name      string    `json:"name" jsonschema:"file name"`
	Directory string    `json:"directory" jsonschema:"parent directory relpath"`
	Lang      string    `json:"lang,omitempty" jsonschema:"language hint"`
	Size      int64     `json:"size" jsonschema:"file size in bytes"`
	MTime     time.Time `json:"mtime" jsonschema:"modification time (UTC)"`
	SHA       string    `json:"sha" jsonschema:"content hash"`
}

type WorkspaceRegister

type WorkspaceRegister struct {
	DB *surreal.Client
}

type WorkspaceRegisterInput

type WorkspaceRegisterInput struct {
	WorkspaceID string `json:"workspaceId" jsonschema:"stable identifier for workspace"`
	Path        string `json:"path" jsonschema:"absolute path to workspace root"`
	NodeID      string `json:"nodeId,omitempty" jsonschema:"optional node id to relate via on_node"`
}

type WorkspaceRegisterOutput

type WorkspaceRegisterOutput struct {
	Workspace string `json:"workspace"`
	Node      string `json:"node,omitempty"`
}

type WorkspaceSearchText

type WorkspaceSearchText struct {
	DB *surreal.Client
}

type WorkspaceSearchTextInput

type WorkspaceSearchTextInput struct {
	WorkspaceID   string `json:"workspaceId" jsonschema:"workspace identifier"`
	Query         string `json:"query" jsonschema:"exact text snippet to find"`
	CaseSensitive bool   `json:"caseSensitive,omitempty" jsonschema:"if true, match is case-sensitive"`
	Limit         int    `json:"limit,omitempty" jsonschema:"max number of matches (default 20)"`
	MaxFileBytes  int64  `json:"maxFileBytes,omitempty" jsonschema:"skip files larger than this many bytes (default 1048576)"`
}

type WorkspaceSearchTextOutput

type WorkspaceSearchTextOutput struct {
	Matches []TextMatch `json:"matches" jsonschema:"list of file matches"`
}

type WorkspaceSummary

type WorkspaceSummary struct {
	ID       string `json:"id"`
	Path     string `json:"path"`
	NodeID   string `json:"nodeId"`
	NodeName string `json:"nodeName,omitempty"`
	DenID    string `json:"denId,omitempty"`
	DenName  string `json:"denName,omitempty"`
}

type WorkspaceTree

type WorkspaceTree struct {
	DB *surreal.Client
}

type WorkspaceTreeInput

type WorkspaceTreeInput struct {
	WorkspaceID string `json:"workspaceId" jsonschema:"workspace identifier"`
}

type WorkspaceTreeOutput

type WorkspaceTreeOutput struct {
	WorkspaceID string           `json:"workspaceId" jsonschema:"workspace identifier"`
	Directories []DirectoryEntry `json:"directories" jsonschema:"all directories with parent references"`
	Files       []WorkspaceFile  `json:"files" jsonschema:"all files with directory references"`
}

type WorkspaceVectorMatch

type WorkspaceVectorMatch struct {
	Score      float64 `json:"score" jsonschema:"cosine similarity score"`
	File       string  `json:"file" jsonschema:"file relpath"`
	Start      int     `json:"start" jsonschema:"chunk start byte"`
	End        int     `json:"end" jsonschema:"chunk end byte"`
	TokenCount int     `json:"tokenCount" jsonschema:"chunk token count"`
	ContentSHA string  `json:"contentSha" jsonschema:"chunk content hash"`
}

type WorkspaceVectorSearch

type WorkspaceVectorSearch struct {
	DB       *surreal.Client
	Embedder *embedder.Client
}

type WorkspaceVectorSearchInput

type WorkspaceVectorSearchInput struct {
	WorkspaceID string   `json:"workspaceId" jsonschema:"workspace identifier"`
	Query       string   `json:"query" jsonschema:"natural language query"`
	TopK        int      `json:"topK,omitempty" jsonschema:"number of results (default 5, max 50)"`
	ModelID     string   `json:"modelId,omitempty" jsonschema:"vector model slug override"`
	FileFilter  []string `json:"fileFilter,omitempty" jsonschema:"optional list of file relpaths to include"`
}

type WorkspaceVectorSearchOutput

type WorkspaceVectorSearchOutput struct {
	Matches []WorkspaceVectorMatch `json:"matches" jsonschema:"ranked vector matches across workspace"`
}

Jump to

Keyboard shortcuts

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