instructions

package
v1.87.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package instructions owns the agent-facing instruction text the platform presents through platform_info: the platform-owned "how to operate" baseline (#646), the full instruction composition (baseline beneath the admin business context, persona tuning, and runtime notes), and the platform_info tool's own title and description. Concentrating this text and its layering rules in one package keeps it out of the pkg/platform orchestration code and lets the admin baseline endpoint render the same baseline the agent receives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessibleTools

func AccessibleTools(allTools []string, p *persona.Persona, reg *persona.Registry) []string

AccessibleTools narrows allTools to the names the caller's persona may call, so the baseline names only reachable tools. A nil persona means no persona filtering is in effect (the caller can reach every registered tool); a resolved persona is filtered fail-closed by its allow/deny rules.

func Build

func Build(accessibleTools []string) string

Build returns the platform-owned "how to operate this platform" instruction baseline (#646): the universal operating model that is true for every deployment (discover before acting, reuse what is known, capture what you learn). It is composed beneath the admin-configured business context (server.agent_instructions) rather than re-authored per deployment, and it is versioned with the binary so upgrading the platform updates it everywhere with no per-deployment edits.

It names a tool only when that tool is in accessibleTools, so the baseline never tells an agent to call a tool its persona cannot reach or that the deployment did not enable. accessibleTools is the set of tool names available to the caller: registered on the platform and, for a per-caller baseline, allowed by the caller's persona. A set with none of the baseline's tools yields an empty baseline, since there is nothing to say without a tool to name.

func Compose

func Compose(baseline, rest string) string

Compose joins the platform baseline above the rest of the instruction stack (admin business context + persona tuning + runtime notes). The baseline is always first and is never overridden by the admin or persona layers; either side may be empty.

func ComposeForCaller

func ComposeForCaller(adminLayer string, allTools []string, p *persona.Persona, reg *persona.Registry, notes ...string) string

ComposeForCaller assembles the full agent-instruction stack one caller sees in platform_info, layering it in a fixed order so the rule lives in one place:

  1. the platform baseline (gated to the tools this persona may call),
  2. the admin business/deployment context, with the persona's suffix/override applied to that layer only,
  3. runtime notes (for example the uploaded-resources hint), appended last.

The baseline is always present and is never replaced by the admin or persona layers. p may be nil (no persona filtering or tuning). Blank notes are skipped.

func InfoToolDescription

func InfoToolDescription(serverName, defaultServerName string, tags []string) string

InfoToolDescription builds the platform_info tool's description. It is itself operating-model text (platform_info is the mandatory first call, then search), so it lives here next to the baseline that carries the same guidance. A custom server name and tags are woven in for discovery.

func InfoToolTitle

func InfoToolTitle(serverName, defaultServerName, fallback string) string

InfoToolTitle returns the display name for the platform_info tool. A custom server name is used as the title (so a client shows e.g. "ACME Data Platform" instead of "platform_info"); the default server name falls back to fallback.

Types

This section is empty.

Jump to

Keyboard shortcuts

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