Documentation
¶
Index ¶
- Constants
- func ComposeAgenticSystemPrompt(ac ActionContext, catalogRoot string) string
- func ComposeFixerAppendPrompt(platform string) string
- func CoreAgenticToolsList() []string
- func DefaultAgenticTools() []string
- func DetectProjectBuildHints(projectDir string) (platform string, platforms []string, watchProjectShape string)
- func EnsureProjectConfigsExternal(projectDir string)
- func ExtractJSON(s string) string
- func FilterRuleKeysForPlatform(platform string, keys []string) ([]string, []string)
- func HasPlatform(platforms []string, platform string) bool
- func IsMacOS(platform string) bool
- func IsTvOS(platform string) bool
- func IsVisionOS(platform string) bool
- func IsWatchOS(platform string) bool
- func ListAvailableSkillKeys() []string
- func LoadSkillContent(key string) string
- func NewProgressCallbackExported(progress *terminal.ProgressDisplay) func(agentruntime.StreamEvent)
- func PlatformBuildDestination(platform string) string
- func PlatformDeploymentTargetKey(platform string) string
- func PlatformDisplayName(platform string) string
- func PlatformSimulatorDestination(platform string) string
- func PlatformSourceDirSuffix(platform string) string
- func PlatformXcodegenValue(platform string) string
- func ReadProjectAppName(projectDir string) string
- func ReadProjectBundleID(projectDir string) string
- func RunXcodeGenExternal(projectDir string) error
- func ScaffoldProjectExternal(projectDir, appName string, plan *PlannerResult) error
- func SetupIntegrationExternal(ctx context.Context, providerID, appName, projectDir string) (map[string]any, error)
- func ValidateExtensionsForPlatform(platform string, extensions []ExtensionPlan) error
- func ValidatePlatform(platform string) error
- func ValidatePlatforms(platforms []string) []string
- func ValidateWatchShape(shape string) error
- func WriteMCPConfigExternal(projectDir string) error
- func WriteMCPConfigWithIntegrationsExternal(projectDir string, reg *mcpregistry.Registry, ...) error
- func WriteSettingsSharedExternal(projectDir string) error
- func WriteSettingsWithIntegrationsExternal(projectDir string, reg *mcpregistry.Registry, integrationTools []string) error
- func WriteSkillsForRuntimeExternal(projectDir, platform string, ruleKeys []string, packages []PackagePlan, ...) error
- type ActionContext
- type AnalysisResult
- type BackendNeeds
- type BuildResult
- type CuratedPackage
- type DesignSystem
- type ExtensionPlan
- type Feature
- type FileCompletionReport
- type FilePlan
- type IntentDecision
- type ModelPlan
- type MonetizationPlan
- type PackageCategory
- type PackagePlan
- type Palette
- type Permission
- type Pipeline
- func (p *Pipeline) ASCFull(ctx context.Context, prompt, projectDir, sessionID string) (*asc.Result, error)
- func (p *Pipeline) ComposeASCSystemPrompt(projectDir string, preflight *asc.PreflightResult) string
- func (p *Pipeline) SetManager(m *integrations.Manager)
- func (p *Pipeline) SetStreamHook(hook func(agentruntime.StreamEvent))
- type PlannedFileStatus
- type PlannerResult
- type ProductPlan
- type PromptDiagnostics
- type PropertyPlan
Constants ¶
const ( RuntimeClaude = agentruntime.KindClaude RuntimeCodex = agentruntime.KindCodex RuntimeOpenCode = agentruntime.KindOpenCode )
Re-export agentruntime.Kind constants for external callers.
const ( PlatformIOS = "ios" PlatformWatchOS = "watchos" PlatformTvOS = "tvos" PlatformVisionOS = "visionos" PlatformMacOS = "macos" )
Platform constants.
const ( WatchShapeStandalone = "watch_only" WatchShapePaired = "paired_ios_watch" )
Watch project shape constants.
Variables ¶
This section is empty.
Functions ¶
func ComposeAgenticSystemPrompt ¶
func ComposeAgenticSystemPrompt(ac ActionContext, catalogRoot string) string
ComposeAgenticSystemPrompt assembles a single system prompt for agentic mode.
func ComposeFixerAppendPrompt ¶
ComposeFixerAppendPrompt exposes the coder prompt for CLI flows that repair existing projects outside the full orchestration pipeline.
func CoreAgenticToolsList ¶
func CoreAgenticToolsList() []string
CoreAgenticToolsList returns the core non-MCP tools used by agent runtimes.
func DefaultAgenticTools ¶
func DefaultAgenticTools() []string
DefaultAgenticTools returns the core Claude tools plus all registered MCP tools.
func DetectProjectBuildHints ¶
func DetectProjectBuildHints(projectDir string) (platform string, platforms []string, watchProjectShape string)
DetectProjectBuildHints reads project_config.json and extracts build-relevant hints. Returns ("ios", nil, "") when missing or unreadable (backward compat).
func EnsureProjectConfigsExternal ¶
func EnsureProjectConfigsExternal(projectDir string)
EnsureProjectConfigsExternal writes .mcp.json, settings.json, and settings.local.json if missing.
func ExtractJSON ¶
ExtractJSON finds and extracts the first JSON object from a string.
func FilterRuleKeysForPlatform ¶
FilterRuleKeysForPlatform filters rule_keys for a given platform. Returns the filtered keys and any validation warnings for unsupported keys.
func HasPlatform ¶
HasPlatform returns true if the given platform is in the list.
func IsVisionOS ¶
IsVisionOS returns true if the platform is visionOS.
func ListAvailableSkillKeys ¶
func ListAvailableSkillKeys() []string
ListAvailableSkillKeys returns all available skill keys from the embedded FS.
func LoadSkillContent ¶
LoadSkillContent loads skill/rule content by key for any runtime.
func NewProgressCallbackExported ¶
func NewProgressCallbackExported(progress *terminal.ProgressDisplay) func(agentruntime.StreamEvent)
NewProgressCallbackExported wraps newProgressCallback for use outside orchestration.
func PlatformBuildDestination ¶
PlatformBuildDestination returns the device build destination for a single platform. Device builds are the default — they catch entitlement, architecture, and API issues.
func PlatformDeploymentTargetKey ¶
PlatformDeploymentTargetKey returns the XcodeGen deployment target key.
func PlatformDisplayName ¶
PlatformDisplayName returns a human-friendly name for a platform constant.
func PlatformSimulatorDestination ¶
PlatformSimulatorDestination returns the simulator build destination for a single platform. Used for Run() launching and secondary validation.
func PlatformSourceDirSuffix ¶
PlatformSourceDirSuffix returns the source directory suffix for a platform in a multi-platform project. iOS uses "" (the app name dir), watchOS uses "Watch", tvOS uses "TV".
func PlatformXcodegenValue ¶
PlatformXcodegenValue returns the XcodeGen platform value.
func ReadProjectAppName ¶
ReadProjectAppName returns the Xcode app name for an existing project. It reads app_name from project_config.json (the canonical source of truth written at build time). Falls back to filepath.Base(projectDir) for projects predating the suffixed-dir feature.
func ReadProjectBundleID ¶
ReadProjectBundleID reads bundle_id from project_config.json. Returns empty string if not found.
func RunXcodeGenExternal ¶
RunXcodeGenExternal runs xcodegen generate in the project directory.
func ScaffoldProjectExternal ¶
func ScaffoldProjectExternal(projectDir, appName string, plan *PlannerResult) error
ScaffoldProjectExternal scaffolds the Xcode project: config, yml, assets, dirs, xcodegen.
func SetupIntegrationExternal ¶
func SetupIntegrationExternal(ctx context.Context, providerID, appName, projectDir string) (map[string]any, error)
SetupIntegrationExternal runs the interactive setup flow for a single integration provider. Returns a result map with provider config details on success.
func ValidateExtensionsForPlatform ¶
func ValidateExtensionsForPlatform(platform string, extensions []ExtensionPlan) error
ValidateExtensionsForPlatform validates that extension kinds are supported on the given platform.
func ValidatePlatform ¶
ValidatePlatform checks that the platform string is a known value.
func ValidatePlatforms ¶
ValidatePlatforms validates a list of platform strings. Invalid entries are dropped. Returns only valid platforms. If all are invalid, returns nil (caller should fall back to defaults).
func ValidateWatchShape ¶
ValidateWatchShape checks that the watch project shape is valid.
func WriteMCPConfigExternal ¶
WriteMCPConfigExternal writes .mcp.json for the project using the standard MCP registry.
func WriteMCPConfigWithIntegrationsExternal ¶
func WriteMCPConfigWithIntegrationsExternal(projectDir string, reg *mcpregistry.Registry, integrationConfigs []integrations.MCPServerConfig) error
WriteMCPConfigWithIntegrationsExternal writes .mcp.json including integration MCP servers.
func WriteSettingsSharedExternal ¶
WriteSettingsSharedExternal writes .claude/settings.json for the project using the standard MCP registry.
func WriteSettingsWithIntegrationsExternal ¶
func WriteSettingsWithIntegrationsExternal(projectDir string, reg *mcpregistry.Registry, integrationTools []string) error
WriteSettingsWithIntegrationsExternal writes .claude/settings.json including integration tool permissions.
func WriteSkillsForRuntimeExternal ¶
func WriteSkillsForRuntimeExternal(projectDir, platform string, ruleKeys []string, packages []PackagePlan, runtimeKind agentruntime.Kind) error
WriteSkillsForRuntimeExternal writes skill files in the native format for the given runtime.
Types ¶
type ActionContext ¶
type ActionContext struct {
ProjectDir string // empty for new builds
AppName string // empty for new builds (analyzer will name it)
SessionID string // for conversation continuity
Platform string // detected from existing project_config.json
Platforms []string // detected from existing project_config.json
WatchProjectShape string // detected from existing project_config.json
ActiveIntegrations []string // provider IDs with valid configs (e.g. ["supabase", "revenuecat"])
}
ActionContext provides context for the unified pipeline. For new builds, all fields are zero-valued. For edits to existing projects, fields carry existing project info.
func (ActionContext) IsEdit ¶
func (ac ActionContext) IsEdit() bool
IsEdit returns true when acting on an existing project.
type AnalysisResult ¶
type AnalysisResult struct {
AppName string `json:"app_name"`
Description string `json:"description"`
Features []Feature `json:"features"`
CoreFlow string `json:"core_flow"`
Deferred []string `json:"deferred"`
BackendNeeds *BackendNeeds `json:"backend_needs,omitempty"`
}
AnalysisResult is the parsed output from the analyzer phase.
type BackendNeeds ¶
type BackendNeeds struct {
Auth bool `json:"auth"`
AuthMethods []string `json:"auth_methods,omitempty"` // "email", "apple", "google", "anonymous"
DB bool `json:"db"`
Storage bool `json:"storage"`
Realtime bool `json:"realtime,omitempty"` // enable Supabase Realtime on tables
Monetization bool `json:"monetization,omitempty"` // in-app purchases / subscriptions needed
MonetizationType string `json:"monetization_type,omitempty"` // "subscription", "consumable", "hybrid"
}
BackendNeeds indicates which backend capabilities an app requires.
func (*BackendNeeds) NeedsBackend ¶
func (b *BackendNeeds) NeedsBackend() bool
NeedsBackend returns true if any backend capability is required.
type BuildResult ¶
type BuildResult struct {
AppName string
Description string
ProjectDir string
BundleID string
DeviceFamily string
Platform string
Platforms []string
WatchProjectShape string
Features []Feature
FileCount int
PlannedFiles int
CompletedFiles int
CompletionPasses int
SessionID string
TotalCostUSD float64
InputTokens int
OutputTokens int
CacheRead int
CacheCreated int
}
BuildResult is the final output of a successful Build pipeline.
type CuratedPackage ¶
type CuratedPackage struct {
Key string // lookup key, e.g. "kingfisher"
Name string // display name, e.g. "Kingfisher"
Category string // category key matching PackageCategory.Key
Description string // what it enables beyond native frameworks
RepoURL string // full GitHub URL
RepoName string // last path component of URL (XcodeGen packages: key)
Products []string // SPM product names from Package.swift (import + product: in XcodeGen)
MinVersion string // minimum version to use with from:
}
CuratedPackage describes a pre-validated SPM package in the registry.
func AllPackages ¶
func AllPackages() []CuratedPackage
AllPackages returns a copy of the full curated package list.
func LookupPackage ¶
func LookupPackage(key string) *CuratedPackage
LookupPackage returns the curated package for a given key, or nil if not found.
func LookupPackageByName ¶
func LookupPackageByName(name string) *CuratedPackage
LookupPackageByName tries to find a curated package by its display name (case-insensitive). This is used when the planner outputs a name like "Kingfisher" instead of the key "kingfisher".
func PackagesByCategory ¶
func PackagesByCategory(category string) []*CuratedPackage
PackagesByCategory returns all curated packages in a category.
type DesignSystem ¶
type DesignSystem struct {
Palette Palette `json:"palette"`
FontDesign string `json:"font_design"`
CornerRadius int `json:"corner_radius"`
Density string `json:"density"`
Surfaces string `json:"surfaces"`
AppMood string `json:"app_mood"`
}
DesignSystem holds the visual design specification.
type ExtensionPlan ¶
type ExtensionPlan struct {
Kind string `json:"kind"`
Name string `json:"name"`
Purpose string `json:"purpose"`
Platform string `json:"platform,omitempty"`
InfoPlist map[string]any `json:"info_plist,omitempty"`
Entitlements map[string]any `json:"entitlements,omitempty"`
Settings map[string]string `json:"settings,omitempty"`
}
ExtensionPlan describes a secondary Xcode target (widget, live activity, etc.)
type FileCompletionReport ¶
type FileCompletionReport struct {
TotalPlanned int
ValidCount int
Missing []PlannedFileStatus
Invalid []PlannedFileStatus
Complete bool
}
FileCompletionReport summarizes completion coverage for planned files.
func VerifyPlannedFilesExternal ¶
func VerifyPlannedFilesExternal(projectDir, appName string, plan *PlannerResult) (*FileCompletionReport, error)
VerifyPlannedFilesExternal checks whether all planned files exist and are valid.
type FilePlan ¶
type FilePlan struct {
Path string `json:"path"`
TypeName string `json:"type_name"`
Purpose string `json:"purpose"`
Platform string `json:"platform,omitempty"`
Components string `json:"components"`
DataAccess string `json:"data_access"`
DependsOn []string `json:"depends_on"`
}
FilePlan describes a single file in the build plan.
func (*FilePlan) UnmarshalJSON ¶
UnmarshalJSON accepts small planner-output variations (e.g. components as []string) and normalizes them into the canonical FilePlan schema used by the pipeline.
type IntentDecision ¶
type IntentDecision struct {
Operation string `json:"operation"`
PlatformHint string `json:"platform_hint"`
PlatformHints []string `json:"platform_hints"`
DeviceFamilyHint string `json:"device_family_hint"`
WatchProjectShapeHint string `json:"watch_project_shape_hint"`
HasASCIntent bool `json:"has_asc_intent"`
Confidence float64 `json:"confidence"`
Reason string `json:"reason"`
UsedLLM bool `json:"used_llm"`
}
IntentDecision is the parsed output from the pre-analysis intent router. Hints are advisory only; analyzer/planner may override based on explicit user intent.
type ModelPlan ¶
type ModelPlan struct {
Name string `json:"name"`
Storage string `json:"storage"`
Properties []PropertyPlan `json:"properties"`
}
ModelPlan describes a data model in the build plan.
func (*ModelPlan) UnmarshalJSON ¶
UnmarshalJSON handles both object form {"name":"Foo",...} and bare string "Foo".
type MonetizationPlan ¶
type MonetizationPlan struct {
Model string `json:"model"` // "subscription", "consumable", "hybrid"
Products []ProductPlan `json:"products"`
Entitlement string `json:"entitlement"` // e.g., "premium"
FreeCredits int `json:"free_credits"` // initial free amount (0 = none)
}
MonetizationPlan describes the in-app purchase / subscription setup.
type PackageCategory ¶
type PackageCategory struct {
Key string // e.g. "images"
Label string // e.g. "Image Loading & Caching"
Description string // when to use this category
}
PackageCategory groups packages under a human-readable label.
func AllCategories ¶
func AllCategories() []PackageCategory
AllCategories returns the category definitions in display order.
type PackagePlan ¶
PackagePlan describes an SPM package suggested by the planner.
type Palette ¶
type Palette struct {
Primary string `json:"primary"`
Secondary string `json:"secondary"`
Accent string `json:"accent"`
Background string `json:"background"`
Surface string `json:"surface"`
}
Palette holds the 5-color hex palette.
type Permission ¶
type Permission struct {
Key string `json:"key"`
Description string `json:"description"`
Framework string `json:"framework"`
}
Permission describes a required iOS permission.
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline orchestrates the multi-phase app generation process.
func NewPipeline ¶
func NewPipeline(runtimeClient agentruntime.Runtime, runtimeKind agentruntime.Kind, cfg *config.Config, model string) *Pipeline
NewPipeline creates a new pipeline orchestrator.
func (*Pipeline) ASCFull ¶
func (p *Pipeline) ASCFull(ctx context.Context, prompt, projectDir, sessionID string) (*asc.Result, error)
ASCFull runs a full App Store Connect operation with pre-flight checks, guided auth setup, agreement verification, app selection, and HITL confirmations for destructive actions.
func (*Pipeline) ComposeASCSystemPrompt ¶
func (p *Pipeline) ComposeASCSystemPrompt(projectDir string, preflight *asc.PreflightResult) string
ComposeASCSystemPrompt builds the system prompt for ASC operations by composing from embedded skill files. Only the core role, safety rules, and pre-flight context are inline — all workflow knowledge lives in skills.
func (*Pipeline) SetManager ¶
func (p *Pipeline) SetManager(m *integrations.Manager)
SetManager sets the integration manager for provider-based integrations.
func (*Pipeline) SetStreamHook ¶
func (p *Pipeline) SetStreamHook(hook func(agentruntime.StreamEvent))
SetStreamHook sets an optional callback invoked for every streaming event. Used by the web UI to mirror CLI progress in the browser.
type PlannedFileStatus ¶
type PlannedFileStatus struct {
PlannedPath string
ResolvedPath string
ExpectedType string
Exists bool
Valid bool
Reason string
}
PlannedFileStatus tracks validation state for a planned file.
type PlannerResult ¶
type PlannerResult struct {
Design DesignSystem `json:"design"`
DeviceFamily string `json:"device_family"`
Platform string `json:"platform"`
Platforms []string `json:"platforms"`
WatchProjectShape string `json:"watch_project_shape"`
Files []FilePlan `json:"files"`
Models []ModelPlan `json:"models"`
Permissions []Permission `json:"permissions"`
Extensions []ExtensionPlan `json:"extensions"`
Localizations []string `json:"localizations"`
RuleKeys []string `json:"rule_keys"`
Packages []PackagePlan `json:"packages"`
Integrations []string `json:"integrations,omitempty"`
MonetizationPlan *MonetizationPlan `json:"monetization_plan,omitempty"`
BuildOrder []string `json:"build_order"`
}
PlannerResult is the parsed output from the planner phase.
func (*PlannerResult) GetDeviceFamily ¶
func (p *PlannerResult) GetDeviceFamily() string
GetDeviceFamily returns the device family, defaulting to "iphone" for iOS. Non-iOS platforms (macOS, tvOS, visionOS, watchOS) return "" when unset.
func (*PlannerResult) GetPlatform ¶
func (p *PlannerResult) GetPlatform() string
GetPlatform returns the target platform, defaulting to "ios".
func (*PlannerResult) GetPlatforms ¶
func (p *PlannerResult) GetPlatforms() []string
GetPlatforms returns the list of target platforms. Falls back to [Platform] if Platforms is empty.
func (*PlannerResult) GetWatchProjectShape ¶
func (p *PlannerResult) GetWatchProjectShape() string
GetWatchProjectShape returns the watch project shape, defaulting to "watch_only" when watchOS.
func (*PlannerResult) HasRuleKey ¶
func (p *PlannerResult) HasRuleKey(key string) bool
HasRuleKey returns true if the plan includes the given rule key.
func (*PlannerResult) IsMultiPlatform ¶
func (p *PlannerResult) IsMultiPlatform() bool
IsMultiPlatform returns true when the plan targets more than one platform.
type ProductPlan ¶
type ProductPlan struct {
Identifier string `json:"identifier"` // e.g., "premium_monthly", "credits_50"
Type string `json:"type"` // "subscription", "consumable"
DisplayName string `json:"display_name"`
Price string `json:"price"` // e.g., "9.99"
Credits int `json:"credits,omitempty"` // for consumable credit packs
Duration string `json:"duration,omitempty"` // ISO 8601: "P1M", "P1Y", "P1W"
}
ProductPlan describes a single in-app purchase product.
type PromptDiagnostics ¶
type PromptDiagnostics struct {
CoreRulesLoaded int // rules from data/core/
AlwaysRulesLoaded int // rules from data/always/
PlatformRulesLoaded int // rules from data/always-{platform}/
CoreRulesChars int // total chars from all rules
Platform string
}
PromptDiagnostics reports what was injected into the agentic system prompt.
func LoadCoreRulesDiagnostics ¶
func LoadCoreRulesDiagnostics(platform string) PromptDiagnostics
LoadCoreRulesDiagnostics returns diagnostics about what rules would be injected for the given platform, without building the full content string.
type PropertyPlan ¶
type PropertyPlan struct {
Name string `json:"name"`
Type string `json:"type"`
DefaultValue string `json:"default_value"`
}
PropertyPlan describes a single property on a model.
Source Files
¶
- exports.go
- fix_support.go
- helpers.go
- icon_upload.go
- integration_setup.go
- package_registry.go
- phase_prompts.go
- pipeline.go
- pipeline_asc.go
- pipeline_integration_v2.go
- pipeline_provision.go
- pipeline_scaffold.go
- platform_features.go
- prompts.go
- screenshot_upload.go
- setup.go
- setup_config.go
- setup_skills.go
- types.go
- verify.go
- watch_shape_intent.go
- xcodegen.go
- xcodegen_builder.go