messages

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package messages centralizes user-facing text used by the CLI and workflows.

Index

Constants

View Source
const (
	// RootUse is the CLI command name.
	RootUse = "al"
	// RootShort is the short description for the root command.
	RootShort             = "Agent Layer CLI"
	RootVersionFlag       = "Print version and exit"
	RootMissingAgentLayer = "agent layer isn't initialized in this repository (missing .agent-layer); run 'al init' to initialize"

	// VersionCommitFmt formats the commit hash for version display.
	VersionCommitFmt  = "commit %s"
	VersionBuildFmt   = "built %s"
	VersionFullFmt    = "%s (%s)"
	VersionTemplate   = "{{.Version}}\n"
	VersionRequired   = "version is required"
	VersionInvalidFmt = "version %q must be in the form vX.Y.Z or X.Y.Z"

	// InitUse is the init command name.
	InitUse   = "init"
	InitShort = "Initialize Agent Layer in this repository"
	// InitAlreadyInitialized is returned when init is invoked on an already-initialized repo.
	InitAlreadyInitialized = "" /* 129-byte string literal not displayed */
	InitRunWizardPrompt    = "Run the setup wizard now? (recommended)"

	InitFlagNoWizard = "Skip prompting to run the setup wizard after init"
	InitFlagVersion  = "Pin the repo to a specific Agent Layer version (vX.Y.Z or X.Y.Z) or latest"

	UpgradeUse                            = "upgrade"
	UpgradeShort                          = "Apply template-managed updates and update the repo pin"
	UpgradePlanUse                        = "plan"
	UpgradePlanShort                      = "Show a dry-run upgrade plan without writing files"
	UpgradePrefetchUse                    = "prefetch"
	UpgradePrefetchShort                  = "Download and cache an Agent Layer release binary"
	UpgradePrefetchVersionFlag            = "Version to prefetch (vX.Y.Z, X.Y.Z, or latest)"
	UpgradePrefetchVersionRequired        = "prefetch requires a release version; pass --version X.Y.Z when running a dev build"
	UpgradePrefetchDoneFmt                = "Prefetched Agent Layer version %s into the local cache.\n"
	UpgradeRepairGitignoreUse             = "repair-gitignore-block"
	UpgradeRepairGitignoreShort           = "Restore `.agent-layer/gitignore.block` and reapply the root `.gitignore` managed block"
	UpgradeRepairGitignoreDone            = "Repaired `.agent-layer/gitignore.block` and updated root `.gitignore`.\n"
	UpgradeRollbackUse                    = "rollback <snapshot-id>"
	UpgradeRollbackShort                  = "Restore a managed-file upgrade snapshot"
	UpgradeRollbackRequiresSnapshotID     = "rollback requires a snapshot id: `al upgrade rollback <snapshot-id>`"
	UpgradeRollbackSuccessFmt             = "Restored snapshot %s.\n"
	UpgradeRequiresTerminal               = "" /* 149-byte string literal not displayed */
	UpgradeNonInteractiveRequiresYesApply = "" /* 142-byte string literal not displayed */
	UpgradeYesRequiresApply               = "`--yes` requires one or more apply flags: `--apply-managed-updates`, `--apply-memory-updates`, `--apply-deletions`"
	UpgradeFlagDiffLines                  = "Max number of diff lines shown per file in upgrade previews"
	UpgradeDiffLinesInvalidFmt            = "invalid value for --diff-lines: %d (must be > 0)"
	UpgradeFlagYes                        = "Run non-interactively when used with apply flags"
	UpgradeFlagApplyManagedUpdates        = "Apply managed template updates without prompts"
	UpgradeFlagApplyMemoryUpdates         = "Apply memory file updates without prompts"
	UpgradeFlagApplyDeletions             = "Apply unknown file deletions (requires explicit confirmation unless combined with --yes)"

	UpgradeOverwritePromptFmt       = "Overwrite %s with the template version?"
	UpgradeOverwriteAllPrompt       = "Overwrite all existing managed files with template versions and update the pin if needed?"
	UpgradeOverwriteManagedHeader   = "Existing managed files (and pin) that differ from templates:"
	UpgradeOverwriteMemoryHeader    = "Existing memory files in docs/agent-layer that differ from templates:"
	UpgradeOverwriteMemoryAllPrompt = "Overwrite all existing memory files in docs/agent-layer with template versions?"
	UpgradeDeleteUnknownAllPrompt   = "Delete all unknown files under .agent-layer?"
	UpgradeDeleteUnknownPromptFmt   = "Delete %s?"
	UpgradeSkipManagedUpdatesInfo   = "Info: skipping managed template updates (pass --apply-managed-updates to include them)."
	UpgradeSkipMemoryUpdatesInfo    = "Info: skipping memory file updates (pass --apply-memory-updates to include them)."
	UpgradeSkipDeletionsInfo        = "Info: skipping unknown file deletions (pass --apply-deletions to include them)."

	InitWarnUpdateCheckFailedFmt = "Warning: failed to check for updates: %v\n"
	InitWarnDevBuildFmt          = "Warning: running dev build; latest release is %s\n"
	InitResolveLatestVersionFmt  = "resolve latest version: %w"
	InitLatestVersionMissing     = "latest release check returned an empty version"

	InitCreateReleaseValidationRequestFmt = "create release validation request: %w"
	InitValidateReleaseVersionRequestFmt  = "validate requested release v%s: %w"
	InitValidateReleaseVersionStatusFmt   = "validate requested release v%s: unexpected status %s"
	InitReleaseVersionNotFoundFmt         = "requested release v%s not found; check available versions at %s"

	UpdateUpgradeBlock         = "" /* 270-byte string literal not displayed */
	UpdateSafetyBlock          = "" /* 409-byte string literal not displayed */
	InitWarnUpdateAvailableFmt = "Warning: agent-layer update available: %s (current %s)\n\n" + UpdateUpgradeBlock + "\n\n" + UpdateSafetyBlock + "\n"

	// CompletionUse is the completion command usage.
	CompletionUse                 = "completion [bash|zsh|fish]"
	CompletionShort               = "Generate shell completion scripts"
	CompletionInstall             = "Install the completion script for the specified shell"
	CompletionUnsupportedShellFmt = "unsupported shell %q (supported: bash, zsh, fish)"

	CompletionCreateDirErrFmt   = "create completion dir: %w"
	CompletionWriteFileErrFmt   = "write completion file: %w"
	CompletionInstalledFmt      = "Installed %s completion to %s\n"
	CompletionBashNote          = "Bash completion requires bash-completion to be enabled in your shell."
	CompletionFishNote          = "Restart fish or open a new terminal to enable completions."
	CompletionZshNoteFmt        = "Add this to your .zshrc before compinit:\n  fpath=(%s $fpath)"
	CompletionResolveHomeErrFmt = "resolve home dir: %w"

	// PromptYesDefaultFmt formats yes/no prompts with yes as default.
	PromptYesDefaultFmt   = "%s [Y/n]: "
	PromptNoDefaultFmt    = "%s [y/N]: "
	PromptInvalidResponse = "invalid response %q"
	PromptRetryYesNo      = "Please enter y or n."

	// WizardUse is the wizard command name.
	WizardUse                    = "wizard"
	WizardShort                  = "Interactive setup wizard"
	WizardLong                   = "Run the interactive setup wizard for this repository."
	WizardRequiresTerminal       = "wizard requires an interactive terminal"
	WizardProfileFlagHelp        = "Run wizard in non-interactive profile mode using a profile config TOML file"
	WizardProfileYesFlagHelp     = "Apply profile-mode changes; without this flag profile mode prints a rewrite preview only"
	WizardCleanupBackupsFlagHelp = "Delete wizard backup files (.agent-layer/config.toml.bak and .agent-layer/.env.bak)"
	WizardCleanupBackupsHeader   = "Removed wizard backup files:"
	WizardCleanupBackupsPathFmt  = "  - %s\n"
	WizardCleanupBackupsNone     = "No wizard backup files found."

	// GeminiUse is the gemini command name.
	GeminiUse   = "gemini"
	GeminiShort = "Sync and launch Gemini CLI"

	ClaudeUse   = "claude"
	ClaudeShort = "Sync and launch Claude Code CLI"

	CodexUse   = "codex"
	CodexShort = "Sync and launch Codex CLI"

	VSCodeUse              = "vscode"
	VSCodeShort            = "Sync and launch VS Code with CODEX_HOME configured"
	VSCodeNoSyncInvalidFmt = "invalid value for --no-sync: %q"

	AntigravityUse   = "antigravity"
	AntigravityShort = "Sync and launch Antigravity"

	// ClientsGeminiExitErrorFmt formats gemini exit errors.
	ClientsGeminiExitErrorFmt            = "gemini exited with error: %w"
	ClientsClaudeExitErrorFmt            = "claude exited with error: %w"
	ClientsCodexExitErrorFmt             = "codex exited with error: %w"
	ClientsAntigravityExitErrorFmt       = "antigravity exited with error: %w"
	ClientsVSCodeExitErrorFmt            = "vscode exited with error: %w"
	ClientsVSCodeCodeNotFoundFmt         = "vscode preflight failed: 'code' command not found on PATH: %w"
	ClientsVSCodeManagedBlockConflictFmt = "vscode preflight failed: managed settings block conflict in %s (%s); run `al sync` to repair `.vscode/settings.json`"
	ClientsCodexHomeWarningFmt           = "Warning: CODEX_HOME is set to %s; expected %s\n"

	// StubShortFmt formats stub command descriptions.
	StubShortFmt          = "%s (not implemented yet)"
	StubNotImplementedFmt = "%s is not implemented in this phase"

	// McpPromptsUse is the mcp-prompts command name.
	McpPromptsUse   = "mcp-prompts"
	McpPromptsShort = "Run the internal MCP prompt server over stdio"
)

CLI messages for user-facing commands and prompts.

View Source
const (
	// ConfigMissingFileFmt formats missing config file errors.
	ConfigMissingFileFmt        = "missing config file %s: %w"
	ConfigFailedReadTemplateFmt = "failed to read template config.toml: %w"
	ConfigMissingEnvFileFmt     = "missing env file %s: %w"
	ConfigInvalidEnvFileFmt     = "invalid env file %s: %w"
	ConfigInvalidConfigFmt      = "invalid config %s: %w"
	ConfigFSRequired            = "config filesystem is required"
	ConfigRootRequired          = "config root path is required"
	ConfigPathOutsideRootFmt    = "path %s is outside repo root %s"

	ConfigMissingCommandsAllowlistFmt    = "missing commands allowlist %s: %w"
	ConfigFailedReadCommandsAllowlistFmt = "failed to read commands allowlist %s: %w"

	ConfigApprovalsModeInvalidFmt             = "%s: approvals.mode must be one of all, mcp, commands, none"
	ConfigGeminiEnabledRequiredFmt            = "%s: agents.gemini.enabled is required"
	ConfigClaudeEnabledRequiredFmt            = "%s: agents.claude.enabled is required"
	ConfigCodexEnabledRequiredFmt             = "%s: agents.codex.enabled is required"
	ConfigVSCodeEnabledRequiredFmt            = "%s: agents.vscode.enabled is required"
	ConfigAntigravityEnabledRequiredFmt       = "%s: agents.antigravity.enabled is required"
	ConfigMcpServerIDRequiredFmt              = "%s: mcp.servers[%d].id is required"
	ConfigMcpServerIDReservedFmt              = "%s: mcp.servers[%d].id is reserved for the internal prompt server"
	ConfigMcpServerIDDuplicateFmt             = "%s: mcp.servers[%d].id %q duplicates mcp.servers[%d].id"
	ConfigMcpServerEnabledRequiredFmt         = "%s: mcp.servers[%d].enabled is required"
	ConfigMcpServerURLRequiredFmt             = "%s: mcp.servers[%d].url is required for http transport"
	ConfigMcpServerCommandNotAllowedFmt       = "%s: mcp.servers[%d].command/args are not allowed for http transport"
	ConfigMcpServerEnvNotAllowedFmt           = "%s: mcp.servers[%d].env is not allowed for http transport"
	ConfigMcpServerHTTPTransportInvalidFmt    = "%s: mcp.servers[%d].http_transport must be sse or streamable"
	ConfigMcpServerHTTPTransportNotAllowedFmt = "%s: mcp.servers[%d].http_transport is only valid for http transport"
	ConfigMcpServerCommandRequiredFmt         = "%s: mcp.servers[%d].command is required for stdio transport"
	ConfigMcpServerURLNotAllowedFmt           = "%s: mcp.servers[%d].url is not allowed for stdio transport"
	ConfigMcpServerHeadersNotAllowedFmt       = "%s: mcp.servers[%d].headers are not allowed for stdio transport"
	ConfigMcpServerTransportInvalidFmt        = "%s: mcp.servers[%d].transport must be http or stdio"
	ConfigMcpServerClientInvalidFmt           = "%s: mcp.servers[%d].clients contains invalid client %q"
	ConfigWarningNoiseModeInvalidFmt          = "%s: warnings.noise_mode %q is invalid (allowed: default, reduce)"
	ConfigWarningThresholdInvalidFmt          = "%s: %s must be greater than zero"

	ConfigMissingSlashCommandsDirFmt          = "missing slash commands directory %s: %w"
	ConfigFailedReadSlashCommandFmt           = "failed to read slash command %s: %w"
	ConfigInvalidSlashCommandFmt              = "invalid slash command %s: %w"
	ConfigSlashCommandMissingContent          = "missing content"
	ConfigSlashCommandMissingFrontMatter      = "missing front matter"
	ConfigSlashCommandUnterminatedFrontMatter = "unterminated front matter"
	ConfigSlashCommandFailedReadContentFmt    = "failed to read content: %w"
	ConfigSlashCommandDescriptionEmpty        = "description is empty"
	ConfigSlashCommandMissingDescription      = "missing description in front matter"

	ConfigMissingInstructionsDirFmt = "missing instructions directory %s: %w"
	ConfigNoInstructionFilesFmt     = "no instruction files found in %s"
	ConfigFailedReadInstructionFmt  = "failed to read instruction %s: %w"

	ConfigMissingEnvVarsFmt = "missing environment variables: %s"
)

Config messages for configuration loading and validation.

Naming convention: Config* messages validate configuration inputs (filesystem, root path, file contents) rather than a unified System interface, so they use descriptive names like ConfigFSRequired and ConfigRootRequired instead of ConfigSystemRequired.

View Source
const (
	// DoctorUse is the doctor command name.
	DoctorUse   = "doctor"
	DoctorShort = "Check for missing secrets, disabled servers, and common misconfigurations"

	DoctorHealthCheckFmt = "🏥 Checking Agent Layer health in %s...\n"

	DoctorCheckNameStructure  = "Structure"
	DoctorCheckNameConfig     = "Config"
	DoctorCheckNameSecrets    = "Secrets"
	DoctorCheckNameSecretRisk = "SecretRisk"
	DoctorCheckNameAgents     = "Agents"
	DoctorCheckNameUpdate     = "Update"

	DoctorMissingRequiredDirFmt       = "Missing required directory: %s"
	DoctorMissingRequiredDirRecommend = "Run `al init` to initialize this repository."
	DoctorPathNotDirFmt               = "%s exists but is not a directory"
	DoctorPathNotDirRecommend         = "Ensure the path is a directory, then run `al init` (fresh repo) or `al upgrade` (existing repo)."
	DoctorDirExistsFmt                = "Directory exists: %s"

	DoctorConfigLoadFailedFmt = "Failed to load configuration: %v"
	DoctorConfigLoadRecommend = "Check .agent-layer/config.toml for syntax errors."
	DoctorConfigLoaded        = "Configuration loaded successfully"

	DoctorMissingSecretFmt          = "Missing secret: %s"
	DoctorMissingSecretRecommendFmt = "Add %s to .agent-layer/.env or your environment."
	DoctorSecretFoundEnvFmt         = "Secret found in environment: %s"
	DoctorSecretFoundEnvFileFmt     = "Secret found in .agent-layer/.env: %s"
	DoctorNoRequiredSecrets         = "No required secrets found in configuration."
	DoctorSecretRiskDetectedFmt     = "Potential secret literal detected in %s"
	DoctorSecretRiskReadFailedFmt   = "Could not inspect %s for secret literals: %v"
	DoctorSecretRiskRecommend       = "" /* 143-byte string literal not displayed */
	DoctorSecretRiskReadRecommend   = "Ensure the file is readable, then rerun `al doctor`."
	DoctorSecretRiskNone            = "No obvious secret literals detected in generated artifact surfaces."

	DoctorAgentEnabledFmt  = "Agent enabled: %s"
	DoctorAgentDisabledFmt = "Agent disabled: %s"

	DoctorUpdateSkippedFmt          = "Update check skipped because %s is set"
	DoctorUpdateSkippedRecommendFmt = "Unset %s to check for updates."
	DoctorUpdateRateLimited         = "Update check skipped due to GitHub API rate limit (HTTP 403/429)"
	DoctorUpdateFailedFmt           = "Failed to check for updates: %v"
	DoctorUpdateFailedRecommend     = "Verify network access and try again."
	DoctorUpdateDevBuildFmt         = "Running dev build; latest release is %s"
	DoctorUpdateDevBuildRecommend   = "Install a release build to use version pinning and dispatch."
	DoctorUpdateAvailableFmt        = "Agent Layer update available: %s (current %s)"
	DoctorUpdateAvailableRecommend  = UpdateUpgradeBlock + "\n\n" + UpdateSafetyBlock
	DoctorUpToDateFmt               = "Agent Layer is up to date (%s)"

	DoctorWarningSystemHeader        = "\n🔍 Running warning checks..."
	DoctorMCPCheckStartFmt           = "⏳ Checking MCP servers (%d enabled)"
	DoctorMCPCheckDone               = " done"
	DoctorInstructionsCheckFailedFmt = "Failed to check instructions: %v"
	DoctorMCPCheckFailedFmt          = "Failed to check MCP servers: %v"
	DoctorFailureSummary             = "❌ Some checks failed or triggered warnings. Please address the items above."
	DoctorFailureError               = "doctor checks failed"
	DoctorSuccessSummary             = "✅ All systems go. Agent Layer is ready."

	DoctorStatusOKLabel        = "[OK]  "
	DoctorStatusWarnLabel      = "[WARN]"
	DoctorStatusFailLabel      = "[FAIL]"
	DoctorResultLineFmt        = "%s %-10s %s\n"
	DoctorRecommendationPrefix = "       💡 "
	DoctorRecommendationIndent = "         "
)

Doctor messages for the doctor command.

View Source
const (
	// InstallRootRequired indicates root path is required for install.
	InstallRootRequired = "root path is required"
	// InstallSystemRequired indicates system is required for install.
	InstallSystemRequired = "install system is required"
	// InstallOverwritePromptRequired indicates overwrite prompts need a handler.
	InstallOverwritePromptRequired                   = "" /* 126-byte string literal not displayed */
	InstallInvalidPinVersionFmt                      = "invalid pin version: %w"
	InstallCreateDirFailedFmt                        = "failed to create directory %s: %w"
	InstallAutoRepairPinWarningFmt                   = "Auto-repairing invalid pin file %s (was %q, now %s)\n"
	InstallFailedReadFmt                             = "failed to read %s: %w"
	InstallFailedReadTemplateFmt                     = "failed to read template %s: %w"
	InstallFailedCreateDirForFmt                     = "failed to create directory for %s: %w"
	InstallFailedWriteFmt                            = "failed to write %s: %w"
	InstallFailedStatFmt                             = "failed to stat %s: %w"
	InstallFailedReadGitignoreBlockFmt               = "failed to read gitignore block %s: %w"
	InstallInvalidGitignoreBlockFmt                  = "gitignore block %s must not include managed markers or template hash; run `al upgrade` to review regenerating it"
	InstallUnexpectedTemplatePathFmt                 = "unexpected template path %s"
	InstallDiffHeader                                = "Found existing files that differ from the templates:"
	InstallDiffLineFmt                               = "  - %s\n"
	InstallDiffFooter                                = "Run `al upgrade` to review each file. Non-interactive managed apply: `al upgrade --yes --apply-managed-updates`."
	InstallUnknownHeader                             = "Found files in .agent-layer not tracked by Agent Layer:"
	InstallUnknownFooter                             = "Run `al upgrade` to review deleting them. Non-interactive deletion apply: `al upgrade --yes --apply-deletions`."
	InstallDeleteUnknownPromptRequired               = "" /* 138-byte string literal not displayed */
	InstallDeleteUnknownFailedFmt                    = "failed to delete %s: %w"
	InstallUpgradeSnapshotCreatedFmt                 = "Created upgrade snapshot: %s\nIf the upgrade completes, restore with: al upgrade rollback %s\n"
	InstallUpgradeSnapshotRolledBackFmt              = "Upgrade failed during %s. Changes were rolled back using snapshot %s.\n"
	InstallUpgradeSnapshotRollbackFailedFmt          = "Upgrade failed during %s. Rollback using snapshot %s failed: %v\n"
	InstallUpgradeRollbackSnapshotIDRequired         = "upgrade rollback requires a snapshot id"
	InstallUpgradeRollbackSnapshotIDInvalid          = "invalid snapshot id %q: must not contain path separators"
	InstallUpgradeRollbackSnapshotNotFoundFmt        = "upgrade snapshot %s not found under %s"
	InstallUpgradeRollbackSnapshotNotRollbackableFmt = "" /* 138-byte string literal not displayed */
	InstallUpgradeRollbackFailedFmt                  = "rollback snapshot %s failed: %w"
	InstallDiffPreviewPathRequired                   = "diff preview path is required"
	InstallMissingTemplatePathMappingFmt             = "missing template path mapping for %s"
	InstallSectionAwareMarkerDuplicateFmt            = "section-aware marker %q appears multiple times in %s"
	InstallSectionAwareMarkerMissingFmt              = "section-aware marker %q missing in %s"
	InstallUnknownPlanDiffModeFmt                    = "unknown plan diff mode %q"

	// UpdateCreateRequestErrFmt formats request creation errors.
	UpdateCreateRequestErrFmt         = "create latest release request: %w"
	UpdateFetchLatestReleaseErrFmt    = "fetch latest release: %w"
	UpdateFetchLatestReleaseStatusFmt = "fetch latest release: unexpected status %s"
	UpdateDecodeLatestReleaseErrFmt   = "decode latest release: %w"
	UpdateLatestReleaseMissingTag     = "latest release missing tag_name"
	UpdateInvalidLatestReleaseTagFmt  = "invalid latest release tag %q: %w"
	UpdateInvalidCurrentVersionFmt    = "invalid current version %q: %w"
	UpdateInvalidVersionFmt           = "invalid version %q"
	UpdateInvalidVersionSegmentFmt    = "invalid version segment %q: %w"
)

Install and update messages.

View Source
const (
	// SyncUse is the sync command name.
	SyncUse                                         = "sync"
	SyncShort                                       = "Regenerate client outputs from .agent-layer"
	SyncCompletedWithWarnings                       = "sync completed with warnings"
	SyncAgentEnabledFlagMissingFmt                  = "agent %s is missing enabled flag in config"
	SyncAgentDisabledFmt                            = "agent %s is disabled in config"
	SyncMarshalMCPConfigFailedFmt                   = "failed to marshal mcp config: %w"
	SyncCreateDirFailedFmt                          = "failed to create %s: %w"
	SyncWriteFileFailedFmt                          = "failed to write %s: %w"
	SyncMarshalClaudeSettingsFailedFmt              = "failed to marshal claude settings: %w"
	SyncMarshalGeminiSettingsFailedFmt              = "failed to marshal gemini settings: %w"
	SyncMarshalVSCodeSettingsFailedFmt              = "failed to marshal vscode settings: %w"
	SyncMarshalVSCodeMCPConfigFailedFmt             = "failed to marshal vscode mcp config: %w"
	SyncInvalidVSCodeSettingsFmt                    = "invalid vscode settings %s: %w"
	SyncMissingPromptServerNoRoot                   = "al not found on PATH and no repo root available for go run"
	SyncMissingPromptServerSourceFmt                = "missing prompt server source at %s"
	SyncCheckPathFmt                                = "check %s: %w"
	SyncPromptServerNotDirFmt                       = "prompt server source path %s is not a directory"
	SyncMissingGoForPromptServerFmt                 = "missing go on PATH for prompt server: %w"
	SyncReadTemplateFailedFmt                       = "failed to read template %s: %w"
	SyncReadFailedFmt                               = "failed to read %s: %w"
	SyncRemoveFailedFmt                             = "failed to remove %s: %w"
	SyncMCPServerErrorFmt                           = "mcp server %s: %w"
	SyncMCPServerArgFailedFmt                       = "mcp server %s arg: %w"
	SyncCodexHeaderPlaceholderUnsupportedFmt        = "codex header %s must be literal or use ${VAR}"
	SyncCodexAuthorizationPlaceholderUnsupportedFmt = "authorization header must be literal, ${VAR}, or Bearer ${VAR}"
	SyncSystemRequired                              = "sync system is required"
	SyncConfigFSRequired                            = "sync config filesystem is required"
	SyncFailedReadGitignoreBlockFmt                 = "failed to read gitignore block %s: %w"

	MCPServerResolveFmt              = "mcp server %s: %w"
	MCPServerURLFmt                  = "mcp server %s url: %w"
	MCPServerHeaderFmt               = "mcp server %s header %s: %w"
	MCPServerCommandFmt              = "mcp server %s command: %w"
	MCPServerArgFmt                  = "mcp server %s arg %s: %w"
	MCPServerEnvFmt                  = "mcp server %s env %s: %w"
	MCPUnsupportedTransportFmt       = "unsupported transport %s"
	MCPServerUnsupportedTransportFmt = "mcp server %s: unsupported transport %s"
)

Sync messages for the sync command.

View Source
const (
	// DispatchErrDispatched indicates dispatch was executed.
	DispatchErrDispatched = "dispatch executed"
	// DispatchMissingArgv0 indicates argv[0] is missing.
	DispatchMissingArgv0            = "missing argv[0]"
	DispatchWorkingDirRequired      = "working directory is required"
	DispatchExitHandlerRequired     = "exit handler is required"
	DispatchSystemRequired          = "dispatch system is required"
	DispatchAlreadyActiveFmt        = "version dispatch already active (current %s, requested %s)"
	DispatchDevVersionNotAllowedFmt = "cannot dispatch to dev version; set %s to a release version"
	DispatchInvalidBuildVersionFmt  = "invalid build version %q: %w"
	DispatchInvalidEnvVersionFmt    = "invalid %s: %w"
	DispatchResolveUserCacheDirFmt  = "resolve user cache dir: %w"

	DispatchCheckCachedBinaryFmt        = "check cached binary %s: %w"
	DispatchVersionNotCachedFmt         = "version %s is not cached (expected at %s); network access disabled via %s"
	DispatchCreateCacheDirFmt           = "create cache dir: %w"
	DispatchCreateTempFileFmt           = "create temp file: %w"
	DispatchSyncTempFileFmt             = "sync temp file: %w"
	DispatchCloseTempFileFmt            = "close temp file: %w"
	DispatchTruncateTempFileFmt         = "truncate temp file: %w"
	DispatchResetTempFileOffsetFmt      = "reset temp file offset: %w"
	DispatchChmodCachedBinaryFmt        = "chmod cached binary: %w"
	DispatchMoveCachedBinaryFmt         = "move cached binary into place: %w"
	DispatchUnsupportedOSFmt            = "unsupported OS %q"
	DispatchUnsupportedArchFmt          = "unsupported architecture %q"
	DispatchDownloadFailedFmt           = "download %s: %w"
	DispatchDownloadUnexpectedStatusFmt = "download %s: unexpected status %s"
	DispatchDownloadTooLargeFmt         = "download %s: response too large (%d bytes > limit %d bytes)"
	DispatchReadFailedFmt               = "read %s: %w"
	DispatchChecksumNotFoundFmt         = "checksum for %s not found in %s"
	DispatchOpenFileFmt                 = "open %s: %w"
	DispatchHashFileFmt                 = "hash %s: %w"
	DispatchChecksumMismatchFmt         = "checksum mismatch for %s (expected %s, got %s)"

	DispatchDownload404Fmt     = "" /* 316-byte string literal not displayed */
	DispatchDownloadTimeoutFmt = "" /* 242-byte string literal not displayed */

	DispatchDownloadingFmt = "Downloading al v%s...\n"
	DispatchDownloadedFmt  = "Downloaded al v%s\n"

	DispatchOpenLockFmt      = "open lock %s: %w"
	DispatchLockFmt          = "lock %s: %w"
	DispatchLockTimeoutFmt   = "timed out waiting for lock after %s"
	DispatchReadPinFailedFmt = "read %s: %w"

	DispatchPinFileEmptyWarningFmt         = "warning: pin file %s is empty; ignoring (run al upgrade to repair)\n"
	DispatchInvalidPinnedVersionWarningFmt = "warning: invalid pinned version in %s: %v; ignoring (run al upgrade to repair)\n"
	DispatchVersionSourceFmt               = "Agent Layer version source: %s (%s)\n"
	DispatchVersionOverrideWarningFmt      = "warning: %s overrides repo pin %s from .agent-layer/al.version\n"

	// RootStartPathRequired indicates start path is required for root resolution.
	RootStartPathRequired   = "start path is required"
	RootResolvePathFmt      = "resolve path %s: %w"
	RootPathNotDirFmt       = "%s exists but is not a directory; move or remove it and retry"
	RootCheckPathFmt        = "check %s: %w"
	RootPathNotDirOrFileFmt = "%s exists but is not a directory or file"

	// RunRootPathRequired indicates root path is required for run metadata.
	RunRootPathRequired    = "root path is required"
	RunGenerateIDFailedFmt = "failed to generate run id: %w"
	RunCreateDirFailedFmt  = "failed to create run dir %s: %w"

	// EnvfileLineErrorFmt formats envfile line errors.
	EnvfileLineErrorFmt     = "line %d: %w"
	EnvfileReadFailedFmt    = "failed to read env content: %w"
	EnvfileExpectedKeyValue = "expected KEY=VALUE"

	// FsutilCreateTempFileFmt formats temp file creation errors.
	FsutilCreateTempFileFmt = "create temp file for %s: %w"
	FsutilSetPermissionsFmt = "set permissions for %s: %w"
	FsutilWriteTempFileFmt  = "write temp file for %s: %w"
	FsutilSyncTempFileFmt   = "sync temp file for %s: %w"
	FsutilCloseTempFileFmt  = "close temp file for %s: %w"
	FsutilRenameTempFileFmt = "rename temp file for %s: %w"
	FsutilOpenDirFmt        = "open dir %s: %w"
	FsutilSyncDirFmt        = "sync dir %s: %w"

	// WarningsResolveConfigFailedFmt formats config resolution failures.
	WarningsResolveConfigFailedFmt        = "Failed to resolve configuration: %v"
	WarningsResolveConfigFix              = "Correct URL/command/auth or environment variables."
	WarningsTooManyServersFmt             = "enabled server count > %d (%d > %d)"
	WarningsTooManyServersFix             = "disable rarely used servers; consolidate."
	WarningsMCPConnectFailedFmt           = "cannot connect, initialize, or list tools: %v"
	WarningsMCPConnectFix                 = "correct URL/command/auth; or disable the server."
	WarningsMCPServerTooManyToolsFmt      = "server has > %d tools (%d > %d)"
	WarningsMCPServerTooManyToolsFix      = "split the server by domain or reduce exported tools."
	WarningsMCPSchemaBloatServerFmt       = "estimated tokens for tool definitions > %d (%d > %d)"
	WarningsMCPSchemaBloatFix             = "reduce schema verbosity; shorten descriptions; remove huge enums/oneOf; reduce tools."
	WarningsMCPTooManyToolsTotalFmt       = "total discovered tools > %d (%d > %d)"
	WarningsMCPTooManyToolsTotalFix       = "disable servers; reduce tool surface."
	WarningsMCPSchemaBloatTotalFmt        = "estimated tokens for all tool definitions > %d (%d > %d)"
	WarningsMCPToolNameCollisionFmt       = "same tool name appears in more than one server: %v"
	WarningsMCPToolNameCollisionFix       = "namespace tool names per server (recommended pattern: <server>__<action>)."
	WarningsInstructionsTooLargeFmt       = "estimated tokens of the combined instruction payload > %d (%d > %d)"
	WarningsInstructionsTooLargeFix       = "reduce always-on instructions; move reference material into docs/ and link to it; remove repetition."
	WarningsPolicySecretInURL             = "mcp server URL appears to contain a literal secret-like value"
	WarningsPolicySecretInURLFix          = "Move secrets out of URL query/userinfo. Use .agent-layer/.env AL_* keys and projected headers/env placeholders instead."
	WarningsPolicyCodexHeaderForm         = "one or more MCP header values are incompatible with Codex header projection"
	WarningsPolicyCodexHeaderFormFix      = "For Codex-targeted servers, use literal values, ${VAR}, or Authorization: Bearer ${VAR} only."
	WarningsPolicyAntigravityMCP          = "MCP server targets antigravity, but antigravity does not support MCP."
	WarningsPolicyAntigravityMCPFix       = "Remove antigravity from mcp.servers[].clients and keep MCP-targeted clients to gemini/claude/codex/vscode."
	WarningsPolicyAntigravityApprovalsFmt = "approvals.mode=%q has no effect for antigravity"
	WarningsPolicyAntigravityApprovalsFix = "Keep approvals.mode for supported clients, but do not expect antigravity to honor approvals settings."
	WarningsNoiseModeInvalidFmt           = "unknown warnings noise mode %q; expected one of: %s, %s"
	WarningsNoiseModeInvalidFix           = "Set warnings.noise_mode to default or reduce."

	WarningsUnsupportedTransportFmt     = "unsupported transport: %s"
	WarningsUnsupportedHTTPTransportFmt = "unsupported http transport: %s"
	WarningsConnectionFailedFmt         = "connection failed: %w"
	WarningsListToolsFailedFmt          = "list tools failed: %w"
	WarningsTooManyTools                = "too many tools or infinite loop"

	// CoverReportProfileFlagUsage describes the profile flag.
	CoverReportProfileFlagUsage      = "path to coverage profile"
	CoverReportThresholdFlagUsage    = "required coverage threshold (optional)"
	CoverReportMissingProfileFlag    = "missing required -profile flag"
	CoverReportParseFailedFmt        = "failed to parse coverage profile: %v\n"
	CoverReportWriteTableFailedFmt   = "failed to write summary table: %v\n"
	CoverReportWriteSummaryFailedFmt = "failed to write coverage summary: %v\n"
	CoverReportTableHeader           = "file\tcover%\tlines_missed"
	CoverReportTableRowFmt           = "%s\t%.2f\t%d\n"
	CoverReportTotalWithThresholdFmt = "total coverage: %.2f%% (threshold %.2f%%) %s\n"
	CoverReportTotalFmt              = "total coverage: %.2f%%\n"
	CoverReportStatusPass            = "PASS"
	CoverReportStatusFail            = "FAIL"

	// ExtractChecksumUsageFmt formats extract-checksum usage.
	ExtractChecksumUsageFmt       = "Usage: %s <checksums-file> <target-filename>\n"
	ExtractChecksumFileMissingFmt = "Error: %s not found\n"
	ExtractChecksumReadFailedFmt  = "Error: failed to read %s: %v\n"
	ExtractChecksumNotFoundFmt    = "Error: %s not found in %s\n"

	UpdateFormulaUsageFmt       = "Usage: %s <formula-file> <new-url> <new-sha256>\n"
	UpdateFormulaFileMissingFmt = "Error: %s not found\n"
	UpdateFormulaStatFailedFmt  = "Error: failed to stat %s: %v\n"
	UpdateFormulaReadFailedFmt  = "Error: failed to read %s: %v\n"
	UpdateFormulaWriteFailedFmt = "Error: failed to write %s: %v\n"
	UpdateFormulaURLCountFmt    = "Error: expected 1 url line, found %d\n"
	UpdateFormulaSHACountFmt    = "Error: expected 1 sha256 line, found %d\n"

	// McpRunPromptServerFailedFmt formats MCP prompt server failures.
	McpRunPromptServerFailedFmt = "failed to run MCP prompt server: %w"
)

System messages for internal operations.

View Source
const (
	WizardInstallFailedFmt                = "install failed: %w"
	WizardLoadConfigFailedFmt             = "failed to load config: %w"
	WizardLoadDefaultMCPServersFailedFmt  = "failed to load default MCP servers: %w"
	WizardLoadWarningDefaultsFailedFmt    = "failed to load warning defaults: %w"
	WizardUnknownApprovalModeFmt          = "unknown approval mode: %q"
	WizardUnknownApprovalModeSelectionFmt = "unknown approval mode selection: %q"
	WizardInvalidEnvFileFmt               = "invalid env file %s: %w"
	WizardBackupConfigFailedFmt           = "failed to backup config: %w"
	WizardPatchConfigFailedFmt            = "failed to patch config: %w"
	WizardBackupEnvFailedFmt              = "failed to backup .env: %w"
	WizardWriteConfigFailedFmt            = "failed to write config: %w"
	WizardWriteEnvFailedFmt               = "failed to write .env: %w"
	WizardWriteEnvRollbackConfigFailedFmt = "failed to write .env: %v (also failed to rollback config: %w)"
	WizardProfilePathRequired             = "profile mode requires --profile <path-to-config.toml>"
	WizardProfileReadFailedFmt            = "failed to read profile %s: %w"
	WizardProfileInvalidFmt               = "invalid profile config: %w"
	WizardCustomValueRequiredFmt          = "custom value required for %s"
	WizardPositiveIntRequiredFmt          = "%s must be a positive integer"
	WizardParseConfigFailedFmt            = "parse config: %w"
	WizardDefaultMCPServersRequired       = "default MCP servers are required to patch config"
	WizardRenderConfigFailedFmt           = "render config: %w"
	WizardFormatConfigFailedFmt           = "format config: %w"
	WizardTOMLUnterminatedMultiline       = "unterminated multiline string in TOML output"
)

Wizard error messages and validation text.

View Source
const (
	WizardApprovalModeHelpIntro       = "Approval modes control what runs without prompts:"
	WizardApprovalModeHelpLineFmt     = "- %s: %s"
	WizardApprovalModeHelpSupportNote = "Support varies by client; Agent Layer applies the closest available behavior."
	WizardPreviewModelWarningText     = "Preview models are pre-release and can change or be removed without notice."
	WizardApprovalAllDescription      = "Auto-approve shell commands and MCP tool calls (where supported)."
	WizardApprovalMCPDescription      = "Auto-approve MCP tool calls only; commands still prompt."
	WizardApprovalCommandsDescription = "Auto-approve shell commands only; MCP tools still prompt."
	WizardApprovalNoneDescription     = "Prompt for everything."
)

Wizard help and descriptive text.

View Source
const (
	// WizardInstallPrompt prompts to install Agent Layer.
	WizardInstallPrompt                       = "Agent Layer isn't installed in this repository. Run `al init` now? (recommended)"
	WizardExitWithoutChanges                  = "No changes made."
	WizardInstallComplete                     = "Installation complete. Continuing the wizard..."
	WizardApprovalModeTitle                   = "Approval Mode"
	WizardEnableAgentsTitle                   = "Enable Agents"
	WizardPreviewModelWarningTitle            = "Preview Model Warning"
	WizardGeminiModelTitle                    = "Gemini Model"
	WizardClaudeModelTitle                    = "Claude Model"
	WizardCodexModelTitle                     = "Codex Model"
	WizardCodexReasoningEffortTitle           = "Codex Reasoning Effort"
	WizardMissingDefaultMCPServersPromptFmt   = "Default MCP server entries are missing from config.toml: %s. Restore them before continuing?"
	WizardEnableDefaultMCPServersTitle        = "Enable Default MCP Servers"
	WizardSecretAlreadySetPromptFmt           = "Secret %s is already set. Overwrite?"
	WizardEnvSecretFoundPromptFmt             = "Found %s in your environment. Write it to .agent-layer/.env?"
	WizardSecretInputPromptFmt                = "Enter %s (leave blank to skip)"
	WizardSecretMissingDisablePromptFmt       = "No value provided for %s. Disable MCP server %s?"
	WizardEnableWarningsPrompt                = "Enable warnings for performance and usage issues?"
	WizardInstructionTokenThresholdTitle      = "Instruction token threshold"
	WizardMCPServerThresholdTitle             = "MCP server threshold"
	WizardMCPToolsTotalThresholdTitle         = "MCP tools total threshold"
	WizardMCPServerToolsThresholdTitle        = "MCP server tools threshold"
	WizardMCPSchemaTokensTotalThresholdTitle  = "MCP schema tokens total threshold"
	WizardMCPSchemaTokensServerThresholdTitle = "MCP schema tokens server threshold"
	WizardSummaryTitle                        = "Summary of Changes"
	WizardRewritePreviewTitle                 = "Rewrite Preview"
	WizardApplyChangesPrompt                  = "Save changes to .agent-layer/config.toml and .agent-layer/.env?"
	WizardCompleted                           = "Wizard completed."
	WizardRunningSync                         = "Running sync..."
	WizardWarningFmt                          = "Warning: %s\n"
	WizardProfilePreviewHeader                = "Profile rewrite preview (.agent-layer/config.toml):"
	WizardProfilePreviewOnly                  = "Profile preview only. Re-run with --yes to apply."
	WizardProfileNoConfigChanges              = "Profile matches current config; no config changes are required."
	WizardLeaveBlankOption                    = "Leave blank (use client default)"
	WizardCustomOption                        = "Custom..."
	WizardCustomPromptFmt                     = "Custom %s"
	WizardMultiSelectDescription              = "Arrow keys to navigate, Space to toggle, Enter to continue, Esc to cancel."
)

Wizard prompt and UI text.

View Source
const (
	WizardSummaryApprovalsFmt                    = "Approval mode: %s\n"
	WizardSummaryEnabledAgentsHeader             = "\nEnabled Agents:\n"
	WizardSummaryEnabledMCPServersHeader         = "\nEnabled MCP Servers:\n"
	WizardSummaryNoneLoaded                      = "(none loaded)\n"
	WizardSummaryNone                            = "(none)\n"
	WizardSummaryRestoredMCPServersHeader        = "\nRestored Default MCP Servers:\n"
	WizardSummaryDisabledMCPServersHeader        = "\nDisabled MCP Servers (missing secrets):\n"
	WizardSummarySecretsHeader                   = "\nSecrets to Update:\n"
	WizardSummaryWarningsHeader                  = "\nWarnings:\n"
	WizardSummaryWarningsDisabled                = "(disabled)\n"
	WizardSummaryListItemFmt                     = "- %s\n"
	WizardSummaryWarningInstructionTokenFmt      = "- instruction_token_threshold = %d\n"
	WizardSummaryWarningMCPServerFmt             = "- mcp_server_threshold = %d\n"
	WizardSummaryWarningMCPToolsTotalFmt         = "- mcp_tools_total_threshold = %d\n"
	WizardSummaryWarningMCPServerToolsFmt        = "- mcp_server_tools_threshold = %d\n"
	WizardSummaryWarningMCPSchemaTokensTotalFmt  = "- mcp_schema_tokens_total_threshold = %d\n"
	WizardSummaryWarningMCPSchemaTokensServerFmt = "- mcp_schema_tokens_server_threshold = %d\n"
	WizardSummaryAgentFmt                        = "- %s"
	WizardSummaryAgentModelFmt                   = "- %s: %s"
	WizardSummaryCodexModelReasoningFmt          = "%s (%s)"
	WizardSummaryCodexReasoningFmt               = "reasoning: %s"
)

Wizard summary output strings.

View Source
const (
	WizardTemplateNoMCPServers               = "template config contains no MCP servers"
	WizardMissingDefaultMCPServerTemplateFmt = "missing default MCP server template for %q"
	WizardMCPServersUnexpectedTypeFmt        = "mcp.servers has unexpected type %T"
	WizardReadConfigTemplateFailedFmt        = "failed to read config template: %w"
	WizardParseConfigTemplateFailedFmt       = "failed to parse config template: %w"
	WizardNoMCPServerBlocksFound             = "no MCP server blocks found in template"
	WizardMissingMCPServerIDInTemplate       = "missing MCP server id in template block"
	WizardDuplicateMCPServerIDInTemplateFmt  = "duplicate MCP server id %q in template"
	WizardTemplateWarningsDefaultsIncomplete = "template config warnings defaults are incomplete"
)

Wizard template parsing and validation errors.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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