app

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyArgs

type ApplyArgs struct {
	Patch string
	Write bool
}

type BenchArgs

type BenchArgs struct {
	Task string
}

type BenchMetricPayload

type BenchMetricPayload struct {
	Bytes       int     `json:"bytes"`
	Tokens      int     `json:"tokens"`
	Ratio       float64 `json:"ratio"`
	SavedTokens int     `json:"saved_tokens"`
}

type BenchPayload

type BenchPayload struct {
	RawBytes    int                 `json:"raw_bytes"`
	RawTokens   int                 `json:"raw_tokens"`
	Summarize   BenchMetricPayload  `json:"summarize"`
	ContextPack *BenchMetricPayload `json:"context_pack,omitempty"`
}

type BenchResult

type BenchResult struct {
	core.Result
	Bench *BenchPayload `json:"bench,omitempty"`
}

type ChangeEdit

type ChangeEdit struct {
	Kind   string `json:"kind"`
	FileID int64  `json:"file_id"`
	Type   string `json:"type"`
}

type ChangesPayload

type ChangesPayload struct {
	Backup  string       `json:"backup"`
	Added   int          `json:"added"`
	Removed int          `json:"removed"`
	Changed int          `json:"changed"`
	Edits   []ChangeEdit `json:"edits"`
}

type ChangesResult

type ChangesResult struct {
	core.Result
	Changes *ChangesPayload `json:"changes,omitempty"`
}

type CheckArgs

type CheckArgs struct {
	Manifest    string
	Prefab      string
	HasPosition bool
	Position    [3]float64
}

type ContextPackArgs

type ContextPackArgs struct {
	Task      string
	Focus     string
	MaxTokens int
}

type DepEdge

type DepEdge struct {
	GUID     string `json:"guid"`
	Path     string `json:"path,omitempty"`
	Resolved bool   `json:"resolved"`
}

type DepsArgs

type DepsArgs struct {
	Project string
	Out     string
}

type DepsPayload

type DepsPayload struct {
	Project      string    `json:"project"`
	Refs         int       `json:"refs"`
	Resolved     int       `json:"resolved"`
	Unresolved   int       `json:"unresolved"`
	Dependencies []DepEdge `json:"dependencies"`
}

type DepsResult

type DepsResult struct {
	core.Result
	Deps *DepsPayload `json:"deps,omitempty"`
}

type DiffArgs

type DiffArgs struct {
	Patch string
}

type GetArgs

type GetArgs struct {
	HasID     bool
	HasName   bool
	ID        int64
	Name      string
	Component string
	Field     string
}

type ImpactArgs

type ImpactArgs struct {
	Project string
	Scenes  string
}

type ImpactFileHit

type ImpactFileHit struct {
	Path       string  `json:"path"`
	References int     `json:"references"`
	FileIDs    []int64 `json:"file_ids"`
}

type ImpactPayload

type ImpactPayload struct {
	Status         string          `json:"status"`
	PrefabPath     string          `json:"prefab_path"`
	PrefabGUID     string          `json:"prefab_guid"`
	SceneHits      []ImpactFileHit `json:"scene_hits"`
	PrefabHits     []ImpactFileHit `json:"prefab_hits"`
	DepthLimitHit  bool            `json:"depth_limit_hit"`
	MaxNestedDepth int             `json:"max_nested_depth"`
}

type ImpactResult

type ImpactResult struct {
	core.Result
	Impact *ImpactPayload `json:"impact,omitempty"`
}

type IndexArgs

type IndexArgs struct {
	Out string
}

type InspectArgs

type InspectArgs struct {
	HasID     bool
	HasName   bool
	ID        int64
	Name      string
	Component string
}

type PatchArgs

type PatchArgs struct {
	Op          string
	Manifest    string
	Prefab      string
	PrefabGUID  string
	Project     string
	HasPosition bool
	Position    [3]float64
}

type PatchResult

type PatchResult struct {
	SchemaVersion int `json:"schema_version,omitempty"`
	core.Result
	PatchPlan *scenepatch.PlacePrefabPlan `json:"patch_plan,omitempty"`
	Safety    *SafetyPayload              `json:"safety,omitempty"`
}

type QueryArgs

type QueryArgs struct {
	HasID   bool
	HasName bool
	HasType bool
	ID      int64
	Name    string
	Type    string
}

type RefsPayload

type RefsPayload struct {
	References []RefsPayloadReference `json:"references"`
	Warnings   int                    `json:"warnings"`
	Issues     []RefsPayloadIssue     `json:"issues"`
}

type RefsPayloadIssue

type RefsPayloadIssue struct {
	Severity string `json:"severity"`
	Code     string `json:"code"`
	FileID   int64  `json:"file_id,omitempty"`
	Message  string `json:"message,omitempty"`
}

type RefsPayloadReference

type RefsPayloadReference struct {
	BlockFileID int64  `json:"block_file_id"`
	Class       string `json:"class"`
	Field       string `json:"field"`
	FileID      int64  `json:"file_id"`
	GUID        string `json:"guid,omitempty"`
	Type        *int   `json:"type,omitempty"`
}

type RefsResult

type RefsResult struct {
	core.Result
	Refs *RefsPayload `json:"refs,omitempty"`
}

type RestorePayload

type RestorePayload struct {
	Backup string `json:"backup"`
	Bytes  int    `json:"bytes"`
	Check  string `json:"check"`
}

type RestoreResult

type RestoreResult struct {
	core.Result
	Restore *RestorePayload `json:"restore,omitempty"`
}

type SafetyFinding

type SafetyFinding struct {
	Phase    string `json:"phase"`
	Severity string `json:"severity"`
	Code     string `json:"code"`
	Detail   string `json:"detail,omitempty"`
}

type SafetyPayload

type SafetyPayload struct {
	PreCheck   string          `json:"pre_check,omitempty"`
	TempCheck  string          `json:"temp_check,omitempty"`
	FinalCheck string          `json:"final_check,omitempty"`
	Findings   []SafetyFinding `json:"findings,omitempty"`
}

type ScanArgs

type ScanArgs struct {
	Mode    string
	Project string
	Out     string
	Prefabs string
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New() *Service

func NewWithScanRunner

func NewWithScanRunner(runner scan.Runner) *Service

func (*Service) Apply

func (s *Service) Apply(namespace, path string, view core.View, jsonOut bool, args ApplyArgs) (PatchResult, int)

func (*Service) Bench

func (s *Service) Bench(namespace, path string, view core.View, jsonOut bool, args BenchArgs) (BenchResult, int)

func (*Service) Changes

func (s *Service) Changes(namespace, path string, view core.View, jsonOut bool) (ChangesResult, int)

Changes reports the structural difference between a file and its sibling <file>.bak — i.e. what the last committed write changed — by matching blocks on fileID. Read-only; pairs with restore for inspecting/recovering an edit.

func (*Service) Check

func (s *Service) Check(namespace, path string, view core.View, jsonOut bool, args CheckArgs) (core.Result, int)

func (*Service) ContextPack

func (s *Service) ContextPack(namespace, path string, view core.View, jsonOut bool, args ContextPackArgs) (core.Result, int)

func (*Service) Deps

func (s *Service) Deps(namespace, path string, view core.View, jsonOut bool, args DepsArgs) (DepsResult, int)

Deps reports the external asset dependencies of a file: the GUIDs it references (via the safety kernel) resolved to asset paths within --project. Text by default, --json for a structured payload, --out writes a Graphviz DOT graph. Read-only.

func (*Service) Diff

func (s *Service) Diff(namespace, path string, view core.View, jsonOut bool, args DiffArgs) (PatchResult, int)

func (*Service) Get

func (s *Service) Get(namespace, path string, view core.View, jsonOut bool, args GetArgs) (core.Result, int)

func (*Service) Impact

func (s *Service) Impact(namespace, path string, view core.View, jsonOut bool, args ImpactArgs) (ImpactResult, int)

func (*Service) Index

func (s *Service) Index(namespace, path string, view core.View, jsonOut bool, args IndexArgs) (core.Result, int)

func (*Service) Inspect

func (s *Service) Inspect(namespace, path string, view core.View, jsonOut bool, args InspectArgs) (core.Result, int)

func (*Service) MetaGUID

func (s *Service) MetaGUID(path string, project string, jsonOut bool) (core.Result, int)

MetaGUID resolves the GUID of an asset from its sibling .meta file. It never guesses: a missing .meta or guid entry yields NEED_PREFAB_GUID (exit 0) so callers can ask the user instead of proceeding.

func (*Service) Patch

func (s *Service) Patch(namespace, path string, view core.View, jsonOut bool, args PatchArgs) (PatchResult, int)

func (*Service) Query

func (s *Service) Query(namespace, path string, view core.View, jsonOut bool, args QueryArgs) (core.Result, int)

func (*Service) Refs

func (s *Service) Refs(namespace, path string, view core.View, jsonOut bool) (RefsResult, int)

Refs surfaces the safety kernel's PPtr/GUID reference evidence so agents can trace what a file points at without reading raw YAML.

func (*Service) Restore

func (s *Service) Restore(namespace, path string, view core.View, jsonOut bool) (RestoreResult, int)

Restore overwrites a file with its sibling <file>.bak, recovering the pre-write state left by the last committed mutation. It reports the integrity status of the restored content so an agent knows what state it recovered to.

func (*Service) Scan

func (s *Service) Scan(namespace, path string, view core.View, jsonOut bool, args ScanArgs) (core.Result, int)

func (*Service) Set

func (s *Service) Set(namespace, path string, view core.View, jsonOut bool, args SetArgs) (SetResult, int)

func (*Service) Suggest

func (s *Service) Suggest(namespace, path string, view core.View, jsonOut bool, args SuggestArgs) (SuggestResult, int)

func (*Service) Summarize

func (s *Service) Summarize(namespace, path string, view core.View, jsonOut bool) (core.Result, int)

func (*Service) Validate

func (s *Service) Validate(namespace, path string, view core.View, jsonOut bool) (ValidateResult, int)

Validate runs the unity-fileid-graph integrity check over a file and reports the result without mutating anything. It is the read-only form of the check that gates every write path, so agents can confirm a file is structurally sound before editing it. OK/WARN exit 0; ERROR (broken graph) exits 1.

type SetArgs

type SetArgs struct {
	HasID     bool
	HasValue  bool
	ID        int64
	Field     string
	Value     string
	Project   string
	AckImpact bool
	Write     bool
}

type SetResult

type SetResult struct {
	core.Result
	Impact *ImpactPayload `json:"impact,omitempty"`
	Safety *SafetyPayload `json:"safety,omitempty"`
}

type SuggestAnchorPayload

type SuggestAnchorPayload struct {
	FileID int64  `json:"id"`
	Name   string `json:"name"`
}

type SuggestArgs

type SuggestArgs struct {
	Manifest   string
	Prefab     string
	Near       string
	Count      int
	Align      string
	PatchOut   string
	Pick       int
	PrefabGUID string
	Project    string
}

type SuggestCandidatePayload

type SuggestCandidatePayload struct {
	Rank       int         `json:"rank"`
	Direction  string      `json:"direction"`
	Position   bounds.Vec3 `json:"position"`
	Status     string      `json:"status"`
	OverlapIDs []int64     `json:"overlap_ids"`
}

type SuggestPayload

type SuggestPayload struct {
	Status     string                    `json:"status"`
	Manifest   string                    `json:"manifest"`
	PrefabPath string                    `json:"prefab"`
	Near       SuggestAnchorPayload      `json:"anchor"`
	Align      string                    `json:"align"`
	Count      int                       `json:"count"`
	Candidates []SuggestCandidatePayload `json:"candidates"`
}

type SuggestResult

type SuggestResult struct {
	core.Result
	Suggest *SuggestPayload `json:"suggest,omitempty"`
}

type ValidateFinding

type ValidateFinding struct {
	Severity string `json:"severity"`
	Code     string `json:"code"`
	Detail   string `json:"detail,omitempty"`
}

type ValidatePayload

type ValidatePayload struct {
	Blocks      int               `json:"blocks"`
	GameObjects int               `json:"gameobjects"`
	Components  int               `json:"components"`
	Transforms  int               `json:"transforms"`
	Errors      int               `json:"errors"`
	Warnings    int               `json:"warnings"`
	Findings    []ValidateFinding `json:"findings"`
}

type ValidateResult

type ValidateResult struct {
	core.Result
	Validate *ValidatePayload `json:"validate,omitempty"`
}

Jump to

Keyboard shortcuts

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