bundle

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package bundle defines the content-bundle serialization format used by pack export/import (file-based CLI) and admin export/import (HTTP). These are wire types, not domain types — they exist to ship Soul / Persona / Rule / Brain / Procedure / Skill content between systems with a stable schema.

Index

Constants

View Source
const SchemaVersion = 1

SchemaVersion is the current ContentBundle schema version. Import rejects bundles whose SchemaVersion does not match.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleBrain

type BundleBrain struct {
	SoulSlug      models.Slug        `json:"soul_slug"`
	PersonaSlug   models.Slug        `json:"persona_slug"`
	RuleSlugs     []models.Slug      `json:"rule_slugs"`
	ProcedureSlug models.Slug        `json:"procedure_slug,omitempty"`
	SkillSlugs    []models.Slug      `json:"skill_slugs,omitempty"`
	ModelPrefs    *models.ModelPrefs `json:"model_prefs,omitempty"`
}

type BundlePersona

type BundlePersona struct {
	Content      string        `json:"content"`
	BundledRules []models.Slug `json:"bundled_rules"`
}

type BundleProcedure added in v0.6.0

type BundleProcedure struct {
	Content string `json:"content"`
}

type BundleRule

type BundleRule struct {
	Entries []models.RuleEntry `json:"entries"`
}

type BundleSkill added in v0.6.0

type BundleSkill struct {
	Description string   `json:"description"`
	Body        string   `json:"body"`
	Triggers    []string `json:"triggers,omitempty"`
	Version     int      `json:"version"`
	Scope       string   `json:"scope"`
}

BundleSkill is the wire form of a workspace skill — full body and metadata so import can reconstruct the row exactly. Triggers and version round-trip cleanly; scope is required.

type BundleSoul

type BundleSoul struct {
	Content string `json:"content"`
}

type BundleState

type BundleState struct {
	Soul      models.Slug   `json:"soul"`
	Persona   models.Slug   `json:"persona"`
	Procedure models.Slug   `json:"procedure,omitempty"`
	Rules     []models.Slug `json:"rules"`
	Skills    []models.Slug `json:"skills,omitempty"`
}

type ContentBundle

type ContentBundle struct {
	SchemaVersion int                             `json:"schema_version"`
	Souls         map[models.Slug]BundleSoul      `json:"souls"`
	Personas      map[models.Slug]BundlePersona   `json:"personas"`
	Rules         map[models.Slug]BundleRule      `json:"rules"`
	Brains        map[models.Slug]BundleBrain     `json:"brains"`
	Procedures    map[models.Slug]BundleProcedure `json:"procedures"`
	Skills        map[models.Slug]BundleSkill     `json:"skills,omitempty"`
	State         *BundleState                    `json:"state,omitempty"`
	// ProjectStates carries per-project layer overrides keyed by project
	// slug. State (above) is the workspace-scope layer; this map is
	// every project-scope layer in the workspace. Either may be empty.
	ProjectStates map[string]*BundleState `json:"project_states,omitempty"`
}

type ImportResult

type ImportResult struct {
	Imported struct {
		Souls         int  `json:"souls"`
		Personas      int  `json:"personas"`
		Rules         int  `json:"rules"`
		Brains        int  `json:"brains"`
		Procedures    int  `json:"procedures"`
		Skills        int  `json:"skills"`
		State         bool `json:"state"`
		ProjectStates int  `json:"project_states"`
	} `json:"imported"`
	Warnings []string `json:"warnings"`
}

Jump to

Keyboard shortcuts

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