Documentation
¶
Index ¶
- func BudgetForProjectChange(change ProjectChange, links []GlobalSymlink) (map[string]budget.Result, error)
- func DefaultFilesystemToolNames() []string
- func LatestSnapshotPath() (string, error)
- func WriteSnapshot(snapshot Snapshot) (string, error)
- type Discovery
- type DiscoveryOptions
- type GlobalSymlink
- type MigrationPlan
- type MigrationResult
- type ProjectCandidate
- type ProjectChange
- type Snapshot
- type UndoResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BudgetForProjectChange ¶
func BudgetForProjectChange(change ProjectChange, links []GlobalSymlink) (map[string]budget.Result, error)
func DefaultFilesystemToolNames ¶
func DefaultFilesystemToolNames() []string
DefaultFilesystemToolNames are tools with predictable ~/.<tool>/skills directories. Gemini is intentionally absent because its CLI owns storage.
func LatestSnapshotPath ¶
func WriteSnapshot ¶
Types ¶
type Discovery ¶
type Discovery struct {
GlobalSymlinks []GlobalSymlink `json:"global_symlinks"`
Projects []ProjectCandidate `json:"projects"`
Skills []string `json:"skills"`
}
Discovery is the pure discovery result used by both interactive and JSON modes.
func Discover ¶
func Discover(opts DiscoveryOptions) (Discovery, error)
Discover finds legacy global symlinks and candidate project directories.
type DiscoveryOptions ¶
type DiscoveryOptions struct {
HomeDir string
StoreDir string
ToolNames []string
SearchRoots []string
State *state.State
}
DiscoveryOptions configures project migration discovery.
type GlobalSymlink ¶
type GlobalSymlink struct {
Tool string `json:"tool"`
Skill string `json:"skill"`
Path string `json:"path"`
CanonicalPath string `json:"canonical_path"`
}
GlobalSymlink is a Scribe-managed skill link in a tool's legacy global skills directory.
func DiscoverGlobalSymlinks ¶
func DiscoverGlobalSymlinks(homeDir, storeDir string, toolNames []string) ([]GlobalSymlink, error)
DiscoverGlobalSymlinks scans ~/.<tool>/skills for symlinks pointing into the canonical Scribe skill store.
type MigrationPlan ¶
type MigrationPlan struct {
DryRun bool `json:"dry_run"`
GlobalLinks []GlobalSymlink `json:"global_links"`
ProjectFiles []ProjectChange `json:"project_files"`
RemovedLinks []GlobalSymlink `json:"removed_links"`
SkippedLinks []GlobalSymlink `json:"skipped_links,omitempty"`
SelectedPaths []string `json:"selected_paths"`
}
MigrationPlan is the complete set of writes/removals for the migration.
type MigrationResult ¶
type MigrationResult struct {
DryRun bool `json:"dry_run"`
FoundGlobalLinks int `json:"found_global_links"`
FoundSkills int `json:"found_skills"`
SelectedProjects int `json:"selected_projects"`
PlannedProjectFileWrites int `json:"planned_project_file_writes"`
PlannedGlobalLinkRemovals int `json:"planned_global_link_removals"`
WroteProjectFiles int `json:"wrote_project_files"`
RemovedGlobalLinks int `json:"removed_global_links"`
SkippedGlobalLinks int `json:"skipped_global_links"`
ProjectFiles []ProjectChange `json:"project_files"`
RemovedLinks []GlobalSymlink `json:"removed_links"`
SkippedLinks []GlobalSymlink `json:"skipped_links,omitempty"`
CandidateProjects []ProjectCandidate `json:"candidate_projects"`
}
MigrationResult summarizes applied work.
func Apply ¶
func Apply(plan MigrationPlan, candidates []ProjectCandidate) (MigrationResult, error)
Apply executes a migration plan. Dry-run plans return the same summary without mutating the filesystem.
type ProjectCandidate ¶
ProjectCandidate is a directory that can receive a project-local .scribe.yaml.
func DiscoverCandidateProjects ¶
func DiscoverCandidateProjects(searchRoots []string, st *state.State) ([]ProjectCandidate, error)
DiscoverCandidateProjects combines known state projection projects with search roots containing .scribe.yaml. If a search root has no nested project file, the root itself is still a candidate.
type ProjectChange ¶
type ProjectChange struct {
Project string `json:"project"`
File string `json:"file"`
AddedSkills []string `json:"added_skills"`
Skills []string `json:"skills"`
Changed bool `json:"changed"`
SkippedWriteReason string `json:"skipped_write_reason,omitempty"`
BudgetPerAgent map[string]budget.Result `json:"budget_per_agent,omitempty"`
}
ProjectChange describes the .scribe.yaml update for one selected project.
type Snapshot ¶
type Snapshot struct {
Version int `json:"version"`
Timestamp time.Time `json:"timestamp"`
Discovery Discovery `json:"discovery"`
Plan MigrationPlan `json:"plan"`
PreviousProjectFiles map[string][]byte `json:"previous_project_files"`
PreviousProjections map[string][]state.ProjectionEntry `json:"previous_projections"`
StateHash string `json:"state_hash,omitempty"`
}