Help us shape the future of Go! Take the 2026 Go Developer Survey

agentruntime

package
v0.1.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ListAgentsToolName  = "list_agents"
	SendToAgentToolName = "send_to_agent"
	AdvisorToolName     = "advisor"
)
View Source
const RuntimeSkillToolName = "Skill"

RuntimeSkillToolName is the model-visible dispatcher used to activate a discovered Skill. It is an agent-runtime primitive, not a configurable Mango runtime built-in and never appears in an Agent's public tools array.

Variables

This section is empty.

Functions

func AdvisorRequest

func AdvisorRequest(
	advisorModel string,
	executor model.Request,
	assistant []domain.ContentBlock,
) (model.Request, error)

AdvisorRequest builds a provider-neutral, tool-free reviewer inference. The executor transcript is serialized as quoted JSON in one user text block so provider-native reasoning signatures and dangling tool calls are never replayed as protocol messages to a different model.

func AdvisorToolSchema

func AdvisorToolSchema() model.ToolSchema

AdvisorToolSchema exposes Mango's private consultation capability as an ordinary client tool. The provider only needs normal tool calling support; Mango owns the independent advisor inference and its durable projection.

func AppendMerging

func AppendMerging(base, added []domain.Message) []domain.Message

AppendMerging appends messages while preserving strict role alternation.

func CoordinatorToolSchemas

func CoordinatorToolSchemas() []model.ToolSchema

CoordinatorToolSchemas are the private model-facing tools automatically attached to a Mango coordinator. They are runtime capabilities, not entries in the persisted Agent toolset.

func EnabledSelfHostedToolSchemas

func EnabledSelfHostedToolSchemas(toolSet domain.ToolSet) []model.ToolSchema

EnabledSelfHostedToolSchemas declares the contracts implemented by an external Environment worker while retaining provider-native Web tools.

func EnabledToolSchemas

func EnabledToolSchemas(toolSet domain.ToolSet) []model.ToolSchema

EnabledToolSchemas returns enabled built-ins in canonical order, followed by application-owned custom tools.

func FlattenResultText

func FlattenResultText(content []any) string

func HasThinkingBlocks

func HasThinkingBlocks(blocks []domain.ContentBlock) bool

func IsCoordinatorTool

func IsCoordinatorTool(name string) bool

func LoadedRuntimeSkills

func LoadedRuntimeSkills(messages []domain.Message) map[string]struct{}

LoadedRuntimeSkills returns the Skills whose injected instruction block is still present in model context. Session pins are immutable, so presence of a successful injection is enough to suppress an identical re-load.

func ProjectAdvisorSystemContext

func ProjectAdvisorSystemContext(base string) string

ProjectAdvisorSystemContext teaches the executor when the runtime-owned private tool is useful without making it part of the persisted Agent prompt.

func ProjectCoordinatorSystemContext

func ProjectCoordinatorSystemContext(base string) string

ProjectCoordinatorSystemContext appends the private harness protocol that makes Mango's public cross-Thread events meaningful to the model. It is runtime-owned rather than persisted in the user-configurable Agent system prompt.

func ReattachRuntimeSkillInjections

func ReattachRuntimeSkillInjections(
	full []domain.Message,
	projected []domain.Message,
) []domain.Message

ReattachRuntimeSkillInjections carries invoked Skills across request-time compaction. It starts with the most recent invocation when applying the combined budget, then restores selected blocks in their original order. Complete bodies remain recognizable as loaded. Truncated reattachments are useful context but deliberately allow a later Skill invocation to restore the complete body, matching Claude Code's documented content lifecycle.

func RuntimeSkillInjection

func RuntimeSkillInjection(name string, body []byte) domain.ContentBlock

RuntimeSkillInjection is the CCB-compatible context block appended after the Skill tool result. The main SKILL.md body enters context here; later references remain on disk and are loaded progressively through ordinary sandbox tools.

func RuntimeSkillInjectionAt

func RuntimeSkillInjectionAt(root string, name string, body []byte) domain.ContentBlock

RuntimeSkillInjectionAt records the actual immutable Agent-scope directory so Claude Code-style supporting-file reads stay inside the selected bundle.

func RuntimeSkillName

func RuntimeSkillName(input map[string]any) (string, error)

RuntimeSkillName validates the dispatcher input before it reaches any filesystem operation. Membership in the Session's immutable pins is checked separately by the execution Activity.

func RuntimeSkillReattachmentBudget

func RuntimeSkillReattachmentBudget(messages []domain.Message) int

RuntimeSkillReattachmentBudget returns the CCB-compatible context reserve for the latest invocation of each loaded Skill: at most 5,000 estimated tokens per Skill and 25,000 across the Session.

func RuntimeSkillToolSchema

func RuntimeSkillToolSchema() model.ToolSchema

RuntimeSkillToolSchema describes the private dispatcher offered only when a Session has effective Skills. Discovery metadata remains in the system context; the dispatcher accepts the selected frontmatter name and lets the runtime load the corresponding immutable Session pin.

func TextBlocksToContent

func TextBlocksToContent(blocks []domain.ContentBlock) []any

func ValidateToolCapabilities

func ValidateToolCapabilities(toolSet domain.ToolSet) error

ValidateToolCapabilities rejects permission semantics that a provider-native model tool cannot pause for Mango to approve.

Types

type SendToAgentInput

type SendToAgentInput struct {
	AgentName       string
	Message         string
	SessionThreadID string
}

func ParseSendToAgentInput

func ParseSendToAgentInput(input map[string]any) (SendToAgentInput, error)

Directories

Path Synopsis
Package tools provides the built-in tool executors that an agent runtime runs inside a sandbox, plus the model-facing input schemas that describe them to the model.
Package tools provides the built-in tool executors that an agent runtime runs inside a sandbox, plus the model-facing input schemas that describe them to the model.

Jump to

Keyboard shortcuts

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