assets

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 7 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 = "2"

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 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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