Documentation
¶
Overview ¶
Package export provides pure logic for building Command platform export envelopes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KnownDevTools = map[string]bool{ "local_shell": true, "local_file_browser": true, "debug_console": true, "test_runner": true, }
KnownDevTools lists tool names that should be filtered in production builds.
Functions ¶
func BuildEnvelope ¶
func BuildEnvelope(spec *agentspec.AgentSpec, allowlistDomains []string, cliVersion string) (map[string]any, error)
BuildEnvelope constructs the export envelope from an AgentSpec. allowlistDomains is the list of domains from egress_allowlist.json (can be nil). cliVersion is the forge CLI version string.
Types ¶
type EgressBlock ¶
type EgressBlock struct {
Profile string `json:"profile"`
Mode string `json:"mode"`
AllowedDomains []string `json:"allowed_domains,omitempty"`
}
EgressBlock represents egress settings in the security block.
type ExportMeta ¶
type ExportMeta struct {
ExportedAt string `json:"exported_at"`
ForgeCLIVersion string `json:"forge_cli_version"`
CompatibleCommandVersions []string `json:"compatible_command_versions"`
ToolCategories map[string]int `json:"tool_categories"`
SkillsCount int `json:"skills_count"`
EgressProfile string `json:"egress_profile,omitempty"`
}
ExportMeta contains metadata added to the export envelope.
type ExportValidation ¶
ExportValidation holds warnings generated during export validation.
func ValidateForExport ¶
func ValidateForExport(spec *agentspec.AgentSpec, devMode bool) *ExportValidation
ValidateForExport checks an AgentSpec for export-specific issues. devMode=true allows dev-category tools.
func ValidateProdConfig ¶
func ValidateProdConfig(egressMode string, toolNames []string) *ExportValidation
ValidateProdConfig checks that a config is valid for production builds.
type NetworkPolicyBlock ¶
type NetworkPolicyBlock struct {
DefaultEgress string `json:"default_egress"`
AllowedDomains []string `json:"allowed_domains,omitempty"`
}
NetworkPolicyBlock represents the network_policy section of the export envelope.
type SecurityBlock ¶
type SecurityBlock struct {
Egress EgressBlock `json:"egress"`
}
SecurityBlock represents the security section of the export envelope.