assets

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package assets embeds the built-in, cross-platform skill payloads that fairpeer ships with its binary. Embedding lets a single downloaded executable carry everything it needs, instead of distributing a separate .fairpeer "tail".

Currently this embeds the ppt-auto skill (SVG → PPTX, pure Python + python-pptx). The heavy, platform-specific Python runtime is intentionally NOT embedded: the released payload expects the user's system Python 3.10+ and installs its pip dependencies on first use (see pptauto/setup_python.*). This keeps the binary lean and the skill genuinely cross-platform (macOS/Linux/Windows).

Index

Constants

View Source
const SkillVersion = "48" // 48: decisions — CJK width is the sole overflow criterion (S-05 enforced), fast mode gains hard content-floor/overflow/overlap checks (region blocks exempt via metadata), config.py dead SVG_CONSTRAINTS removed (rules live in template_config.json)

SkillVersion is bumped whenever the embedded ppt-auto payload changes in a way that should force a refresh of the released copy. Bump this when you update the embedded scripts/templates/SKILL.md and want existing users to get the new version on next launch.

Variables

This section is empty.

Functions

func EnsureHelperScripts added in v0.2.0

func EnsureHelperScripts() error

EnsureHelperScripts releases the embedded helper scripts (scripts/ tree) to ~/.fairpeer/scripts/, writing each file only when missing or content differs (so edits to the embedded copy propagate on upgrade). Best-effort: errors surface to the caller but a missing script just means the Go-side fallback probes (CWD / exe-relative) still apply.

func EnsurePPTAutoSkill

func EnsurePPTAutoSkill() error

EnsurePPTAutoSkill releases the embedded ppt-auto skill to the user's global skills directory (~/.fairpeer/skills/ppt-auto) if it is missing or stale. It is idempotent: when the on-disk .embedded-version matches SkillVersion, it does nothing. On a version bump it overwrites the existing copy.

The release target is the global-scope skill root that the skill store scans (internal/skill: Store.roots → home/.fairpeer/skills), so both the CLI and the desktop app discover the released skill without any discovery-code changes.

A nil error is returned (best-effort): a failure to release is logged but does not abort startup, because the user may already have a working ppt-auto from a previous release or a manual install. The error is still propagated so callers can log it.

func PPTAutoConfigPath

func PPTAutoConfigPath() string

PPTAutoConfigPath returns the released skill's template_config.json path, or "" if it doesn't exist. Used by the settings page to read/update PPT config.

func PPTAutoSkillDir

func PPTAutoSkillDir() (string, error)

PPTAutoSkillDir returns the absolute path where EnsurePPTAutoSkill releases the embedded skill (~/.fairpeer/skills/ppt-auto), regardless of whether it has been released yet. Useful for callers that want the canonical location.

func PPTAutoTemplatesDir

func PPTAutoTemplatesDir() string

PPTAutoTemplatesDir returns the released skill's templates/ directory, or "" if it doesn't exist. Used by the settings page to surface bundled templates.

func SyncPPTMode added in v0.1.5

func SyncPPTMode(pptMode string) error

SyncPPTMode writes the user's ppt_mode setting (from config.toml) into the released template_config.json's "mode" field. This must be called after EnsurePPTAutoSkill at startup, because the embedded config ships with mode="fast" and would overwrite the user's "validate" choice on every SkillVersion bump.

Types

This section is empty.

Jump to

Keyboard shortcuts

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