plugin

package
v0.0.77 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FabrikPlugin embed.FS

FabrikPlugin holds the embedded fabrik-workflows plugin files (the worker-side plugin loaded into the Claude Code workers the Fabrik engine spawns to execute pipeline stages).

`fabrik init` extracts these files to .fabrik/plugin/ in the current project, and `fabrik upgrade` overwrites that directory from the embedded copy. The engine then passes `--plugin-dir .fabrik/plugin/` to every worker invocation. This is distinct from the user-facing `fabrik` plugin (plugin/fabrik/) which is installed via Claude Code's plugin marketplace, not embedded.

View Source
var KnownEmbeddedVersions = []string{
	"80638a6ed85feb0e1b1516886e13cc3c803eea4ebcf77a24d537a9c977ea4ef0",
	"72e9c60393cc1c0015c6823fde643b83da246b13585cf17604c6c8636b77aefc",
	"5ae111702183b79c8a65b73df120d0f84e4fb84e5fcc225706adf169db5d74cd",
	"e8184ed9a28deb5199c8e3e20bca8c645969a503393080871b52c1168ad64eb2",
	"abada32a31455ffe95cc222ca5cd40286b55c7580253e1c2c59c4e902c69c5b8",
	"68d43ba01c4fdd8dad52d37000df4b52fb43cdbfcc8b9065949ff4683341a4c2",
	"ad8659bb7559f437bd0bbd6d369e2f4ec21d8988848287085388d24380f6c509",
}

KnownEmbeddedVersions is the list of all plugin fingerprints ever legitimately written to .installed-version by a release binary. A fingerprint appears here only when it was computed from embedded content at release time.

The list grows by one entry when the embedded plugin fingerprint changes between releases (via scripts/cut-release.sh; releases without plugin changes reuse the same hash and add no new entry). It is used by CheckPluginState to distinguish a legitimate installedVer (always an embedded hash) from one written by the buggy v0.0.64 migration (a customised disk hash that is not any known embedded hash).

Historical bootstrapping:

v0.0.64–v0.0.65: 80638a6ed85feb0e1b1516886e13cc3c803eea4ebcf77a24d537a9c977ea4ef0
v0.0.66–current: 72e9c60393cc1c0015c6823fde643b83da246b13585cf17604c6c8636b77aefc

Functions

func CheckPluginState

func CheckPluginState(pluginDir string, isDevBuild bool) (customWorkflow, upgradeNeeded bool, err error)

CheckPluginState performs a three-way comparison (embedded vs installedVer vs disk) and determines whether the operator has local customizations or whether an auto-refresh is needed. It delegates to checkPluginState with the global KnownEmbeddedVersions list. isDevBuild identifies whether the calling binary is a dev build (see checkPluginState for why this matters).

func ComputeDiskVersion

func ComputeDiskVersion(pluginDir string) (string, error)

ComputeDiskVersion computes the same fingerprint over on-disk files in pluginDir, skipping .installed-version. Returns ("", nil) if pluginDir does not exist or contains no plugin files.

func ComputeEmbeddedVersion

func ComputeEmbeddedVersion() string

ComputeEmbeddedVersion returns a deterministic fingerprint of the embedded FabrikPlugin FS. It is a pure function — no disk I/O beyond embed.FS reads.

func ReadInstalledVersion

func ReadInstalledVersion(pluginDir string) (string, error)

ReadInstalledVersion reads the hash from pluginDir/.installed-version. Returns ("", nil) if the file does not exist (first-run / pre-migration case).

func RefreshPlugin

func RefreshPlugin() (int, error)

RefreshPlugin overwrites .fabrik/plugin/ with the embedded plugin files. Returns the number of files written.

func WriteInstalledVersion

func WriteInstalledVersion(pluginDir string) error

WriteInstalledVersion writes the embedded plugin fingerprint to pluginDir/.installed-version. Call after RefreshPlugin() to record the last known-good installed state.

func WriteVersionHash

func WriteVersionHash(pluginDir, hash string) error

WriteVersionHash writes hash to pluginDir/.installed-version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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