prompt

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package prompt provides template rendering for agent system prompts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderAgentPrompt

func RenderAgentPrompt(data AgentData) (string, error)

RenderAgentPrompt renders the execution agent system prompt with the given data.

func RenderExtras

func RenderExtras(raw []byte, access agentsdk.Access) string

RenderExtras filters the agent's registered extra prompt fragments by the caller's resolved access and joins the visible ones with "\n\n". Returns an empty string when raw is unset or contains no visible specs.

Types

type AgentData

type AgentData struct {
	AgentDashboardURL string // e.g., "https://airlock.example.com/agents/{id}"
	AgentRouteURL     string // e.g., "https://myagent.dev.airlock.run"; required (always non-empty)
	Tools             []ToolInfo
	Connections       []ConnInfo
	Topics            []TopicInfo
	Webhooks          []WebhookInfo
	Crons             []CronInfo
	Routes            []RouteInfo
	MCPServers        []MCPServerStatus
}

AgentData is the template data for rendering the execution agent system prompt.

type ConnInfo

type ConnInfo struct {
	Slug        string
	Name        string
	Description string
	LLMHint     string
	BaseURL     string
}

type CronInfo

type CronInfo struct {
	Name        string
	Schedule    string
	Description string
}

type MCPServerStatus

type MCPServerStatus struct {
	Slug   string
	Name   string
	Status string // e.g. "connected, 5 tools" or "requires authentication"
	// Tools is empty when the server isn't authorized or discovery hasn't run.
	// When populated, the template renders a typed `declare const mcp_{slug}: {...}`
	// block alongside the status line.
	Tools []ToolInfo
}

type RouteInfo

type RouteInfo struct {
	Method      string
	Path        string
	Access      string
	Description string
}

type ToolInfo

type ToolInfo struct {
	Name         string
	Description  string
	LLMHint      string
	InputSchema  json.RawMessage
	OutputSchema json.RawMessage
}

ToolInfo carries the hydrated tool record for prompt rendering. InputSchema and OutputSchema are JSON-encoded JSON Schemas. LLMHint is optional model-only guidance that pairs with Description (which surfaces in the dashboard's Tools tab); see agentsdk.Tool.LLMHint.

type TopicInfo

type TopicInfo struct {
	Slug        string
	Description string
	LLMHint     string
}

type WebhookInfo

type WebhookInfo struct {
	Path        string
	Description string
}

Jump to

Keyboard shortcuts

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