tsrender

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tsrender produces TypeScript declarations for agent capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderNestedRoot

func RenderNestedRoot(root string, namespaces []NamespaceRender) string

RenderNestedRoot emits one declaration for a nested MCP or agent root.

func RenderToolDecls

func RenderToolDecls(tools []ToolRender) string

RenderToolDecls emits a TypeScript .d.ts-style block describing each tool. Output is suitable for direct inclusion in an LLM prompt.

Types

type MCPToolRender

type MCPToolRender struct {
	Path        binding.Path
	Name        string
	Description string
	InputSchema json.RawMessage
}

MCPToolRender carries the bits Airlock has cached about an MCP tool. Only the input shape is typed — MCP doesn't define an output schema, so the rendered return type is always `unknown` (caller does runtime parsing).

type NamespaceRender

type NamespaceRender struct {
	Namespace string
	Tools     []MCPToolRender
}

NamespaceRender describes one namespace beneath an external capability root.

type ToolRender

type ToolRender struct {
	Path          binding.Path
	Name          string
	Description   string
	LLMHint       string
	InputSchema   json.RawMessage
	OutputSchema  json.RawMessage
	InputExamples []json.RawMessage
}

ToolRender is the data RenderToolDecls consumes. Airlock builds this from the hydrated DB/sync payload; the agent assembles it from the registered-tool schemas in tests. Both paths go through the same renderer so the LLM sees one format.

LLMHint is optional model-only guidance that pairs with Description (which may also surface in member-facing UIs). When non-empty it's appended to the JSDoc block in `[brackets]` so the LLM gets the extra steer without polluting the user-visible description.

Jump to

Keyboard shortcuts

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