export

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Overview

Package export provides pure logic for building Command platform export envelopes.

Index

Constants

This section is empty.

Variables

View Source
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

type ExportValidation struct {
	Warnings []string
	Errors   []string
}

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.

Jump to

Keyboard shortcuts

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