Documentation
¶
Overview ¶
Package agentinit renders the files "init" writes into a project: app.yaml, AGENTS.md and .mcp.json. All product and binary names come from Names, so nothing here hardcodes a brand.
Index ¶
Constants ¶
const ( ModeReadOnly = "read-only" ModeStandard = "standard" ModeFull = "full" ModeAgentCore = "agent-core" )
MCP modes init accepts. ModeAgentCore selects the small tool profile rather than a class mode.
const TokenEnvVar = "APP_API_TOKEN" //nolint:gosec // env var name, not a credential
TokenEnvVar is the env var the MCP config references for the API token.
const URLEnvVar = "APP_API_URL"
URLEnvVar is the env var that overrides the API URL.
Variables ¶
This section is empty.
Functions ¶
func AppYAML ¶
func AppYAML(st stackdetect.Stack) (string, error)
AppYAML renders an app.yaml for st and validates it with the platform's own spec parser before returning it.
func Diff ¶
Diff returns a line diff from old to next ("-" removed, "+" added, " " unchanged context omitted), empty when they are equal. It is a plain LCS diff, good enough for the small files init writes.
Types ¶
type Names ¶
type Names struct {
// Product is the display name.
Product string
// CLI is the command name (os.Args[0]).
CLI string
// MCPBinary is the MCP server binary name.
MCPBinary string
// ServerKey is the key under mcpServers in .mcp.json.
ServerKey string
}
Names carries every user-visible name, resolved by the caller.
type Options ¶
type Options struct {
Names
// APIURL is the control plane URL, empty when unknown.
APIURL string
// Mode is one of the Mode constants; empty means ModeAgentCore.
Mode string
// App is the service name to use in AGENTS.md examples.
App string
}
Options is everything the renderers need.