migrate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: GPL-3.0 Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package migrate runs printer migration operations.

Index

Constants

View Source
const (
	BoxClockGuardInstallSchema = "qidi-plus4-box-output-clock-guard-install/v1"
	BoxClockGuardInstallAction = "INSTALL-BOX-OUTPUT-CLOCK-GUARD"
	BoxClockGuardAccount       = "mks"
	BoxClockGuardTargetPath    = "/home/mks/klipper/klippy/extras/box_output_clock_guard.py"
	BoxClockGuardTargetMode    = "0644"
	BoxClockGuardConfigSection = "[box_output_clock_guard]"
)
View Source
const (
	BoxMotionGuardSchema  = "qidi-plus4-box-motion-template-guard/v1"
	BoxMotionGuardAction  = "HARDEN-BOX-MOTION-TEMPLATE"
	BoxMotionVendorAction = "RESTORE-BOX-MOTION-VENDOR"
)
View Source
const (
	KlippeeAgentRefreshSchema = "qidi-plus4-klippee-agent-refresh/v1"
	KlippeeAgentService       = "klippee-moonraker.service"
	KlippeeAgentRefreshAction = "REFRESH-KLIPPEE-AGENT"
)
View Source
const (
	KlippeeAgentUpgradeSchema  = "qidi-plus4-klippee-agent-upgrade/v1"
	KlippeeAgentUpgradeAction  = "UPGRADE-KLIPPEE-AGENT"
	KlippeeAgentAccount        = "mks"
	KlippeeAgentCLIPath        = "/home/mks/.local/bin/klippee"
	KlippeeAgentOfficialSource = "https://klippee.xyz/install/klippee.py"
)
View Source
const (
	KlippeeVariableSetSchema = "qidi-plus4-klippee-variable-set/v1"
	KlippeeVariableSetAction = "SET-KLIPPEE-VARIABLE"
	KlippeeVariableCLIPath   = "/home/mks/.local/bin/klippee"
)
View Source
const (
	PLRDeploymentSchema = "qidi-plus4-plr-deployment/v1"
	KlipperStartSchema  = "qidi-plus4-klipper-start/v1"
	PLRRollbackSchema   = "qidi-plus4-plr-rollback/v1"
	KlipperService      = "klipper.service"

	PLRTransactionNotStarted     = "not_started"
	PLRTransactionApplied        = "applied"
	PLRTransactionAutoRolledBack = "auto_rolled_back"
	PLRTransactionRolledBack     = "rolled_back"
	PLRTransactionSafetyRestored = "safety_restored"
	PLRTransactionPartial        = "partial"
	PLRTransactionIndeterminate  = "indeterminate"
)
View Source
const (
	KlipperRef   = "214fdb2877ff4640e9316a663c1b8b2e232c86fd"
	MoonrakerRef = "1cfb0c41e468645951a371621f06d32777b6107c"
	KatapultRef  = "ec59b9bb9ad6c2ec8d4dc6831fbc77f0b308e29e"
)
View Source
const (
	MainboardImage        = "plus4-mainboard-klipper.bin"
	ToolheadImage         = "plus4-toolhead-klipper.bin"
	ToolheadKatapultImage = "plus4-toolhead-katapult.bin"
)

Image file names written by the native backend's build stage. An artifact directory is enough to locate every image without further configuration.

View Source
const KlipperServiceRestartSchema = "printerlab-klipper-service-restart/v1"
View Source
const KlipperUpdateAction = "UPDATE-KLIPPER"
View Source
const QIDIFixesAction = "APPLY-QIDI-FIXES"
View Source
const QIDIUpdateAction = "UPDATE-QIDI-FIRMWARE"

Variables

This section is empty.

Functions

func BootstrapConnectionArgs

func BootstrapConnectionArgs(printer inventory.Printer) []string

BootstrapConnectionArgs explicitly opts setup-ssh into the one-time password path. Every ordinary connection uses ConnectionArgs and therefore cannot inherit a bootstrap secret from inventory by accident.

func ConnectionArgs

func ConnectionArgs(printer inventory.Printer) []string

func KlippeeVariableValueSHA256

func KlippeeVariableValueSHA256(value string) string

func MaybeRunAskpass

func MaybeRunAskpass(args []string, writer io.Writer) (handled bool, exitCode int)

MaybeRunAskpass handles the private OpenSSH password callback. It validates the request token and returns passwords only for authorized requests.

func MaybeRunBackend

func MaybeRunBackend(ctx context.Context, args []string, out, errOut io.Writer) (bool, int)

MaybeRunBackend handles the migration subprocess entry point. The internal environment flag authorizes this mode.

func RequirePlus4

func RequirePlus4(printer inventory.Printer) error

func SafeDiagnosticSummary

func SafeDiagnosticSummary(raw []byte) string

SafeDiagnosticSummary bounds subprocess diagnostics and removes terminal controls.

func ValidateBootstrapConnection

func ValidateBootstrapConnection(printer inventory.Printer) error

ValidateBootstrapConnection checks SSH settings before setup-ssh starts. The password value is supplied through the gated OpenSSH askpass callback.

func ValidateConnectionArguments

func ValidateConnectionArguments(printer inventory.Printer, args []string) error

ValidateConnectionArguments lets orchestration reject any attempt to attach a bootstrap secret to an ordinary stage before recording or spawning it.

func ValidatePLRBackupManifest

func ValidatePLRBackupManifest(manifest, account string) error

ValidatePLRBackupManifest rejects a caller-supplied handle unless it names an exact installer manifest under the effective printer account's canonical scripts directory. Callers can therefore fail before any network request.

func ValidatePLRLifecycle

func ValidatePLRLifecycle(result PLROperationResult) error

ValidatePLRLifecycle checks successful stop/apply/verify results. Failed results retain their rollback instructions for display.

func ValidatePLRTarget

func ValidatePLRTarget(result PLROperationResult, expectedAccount string) error

ValidatePLRTarget binds a parsed deploy/rollback result to the effective printer account from inventory and validates every canonical remote path and recovery handle. It performs no printer discovery.

func ValidatePasswordEnvironmentName

func ValidatePasswordEnvironmentName(name string) error

ValidatePasswordEnvironmentName accepts portable process environment names while rejecting the variables that control the askpass boundary itself.

func ValidateSSHConnection added in v0.2.0

func ValidateSSHConnection(printer inventory.Printer) error

ValidateSSHConnection checks target syntax without connecting or changing it. The same rules apply to inventory entries and transient firmware targets.

Types

type BoxClockGuardFile

type BoxClockGuardFile struct {
	Path   string `json:"path" yaml:"path"`
	SHA256 string `json:"sha256,omitempty" yaml:"sha256,omitempty"`
	Owner  string `json:"owner,omitempty" yaml:"owner,omitempty"`
	Group  string `json:"group,omitempty" yaml:"group,omitempty"`
	Mode   string `json:"mode,omitempty" yaml:"mode,omitempty"`
}

type BoxClockGuardInstallResult

type BoxClockGuardInstallResult struct {
	Schema                 string             `json:"schema" yaml:"schema"`
	OK                     *bool              `json:"ok" yaml:"ok"`
	Changed                *bool              `json:"changed,omitempty" yaml:"changed,omitempty"`
	Applied                *bool              `json:"applied,omitempty" yaml:"applied,omitempty"`
	Verified               *bool              `json:"verified" yaml:"verified"`
	Account                string             `json:"account" yaml:"account"`
	TransactionID          string             `json:"transaction_id" yaml:"transaction_id"`
	SourceSHA256           string             `json:"source_sha256" yaml:"source_sha256"`
	Target                 BoxClockGuardFile  `json:"target" yaml:"target"`
	Backup                 *BoxClockGuardFile `json:"backup" yaml:"backup"`
	KlipperServiceAction   string             `json:"klipper_service_action" yaml:"klipper_service_action"`
	KlipperRestarted       *bool              `json:"klipper_restarted" yaml:"klipper_restarted"`
	ConfigChanged          *bool              `json:"config_changed" yaml:"config_changed"`
	ActivationRequired     *bool              `json:"activation_required" yaml:"activation_required"`
	RequiredConfigSection  string             `json:"required_config_section" yaml:"required_config_section"`
	StagingCleanupVerified *bool              `json:"staging_cleanup_verified" yaml:"staging_cleanup_verified"`
	Phase                  string             `json:"phase,omitempty" yaml:"phase,omitempty"`
	Error                  string             `json:"error,omitempty" yaml:"error,omitempty"`
	StagingCleanupError    string             `json:"staging_cleanup_error,omitempty" yaml:"staging_cleanup_error,omitempty"`
}

BoxClockGuardInstallResult is the narrow structured contract returned by qidi-plus4-firmware's fixed-purpose installer. Pointer booleans distinguish explicit safety proofs from omitted zero values.

func ParseBoxClockGuardInstall

func ParseBoxClockGuardInstall(raw []byte) (BoxClockGuardInstallResult, error)

ParseBoxClockGuardInstall validates a bounded v1 installation result. It rejects duplicate fields and accepts additional diagnostic fields.

func (BoxClockGuardInstallResult) DiagnosticSummary

func (result BoxClockGuardInstallResult) DiagnosticSummary() string

func (BoxClockGuardInstallResult) DidChange

func (result BoxClockGuardInstallResult) DidChange() bool

func (BoxClockGuardInstallResult) Succeeded

func (result BoxClockGuardInstallResult) Succeeded() bool

type BoxMotionGuardBackup

type BoxMotionGuardBackup struct {
	Path   string `json:"path" yaml:"path"`
	SHA256 string `json:"sha256" yaml:"sha256"`
}

type BoxMotionGuardResult

type BoxMotionGuardResult struct {
	Schema               string                `json:"schema" yaml:"schema"`
	OK                   *bool                 `json:"ok" yaml:"ok"`
	Changed              *bool                 `json:"changed" yaml:"changed"`
	Verified             *bool                 `json:"verified" yaml:"verified"`
	BoxCount             int                   `json:"box_count" yaml:"box_count"`
	TransactionID        string                `json:"transaction_id" yaml:"transaction_id"`
	Target               BoxMotionGuardTarget  `json:"target" yaml:"target"`
	Backup               *BoxMotionGuardBackup `json:"backup" yaml:"backup"`
	UseIRQ               *bool                 `json:"use_irq" yaml:"use_irq"`
	DebounceUSPresent    *bool                 `json:"debounce_us_present" yaml:"debounce_us_present"`
	ActiveConfigChanged  *bool                 `json:"active_config_changed" yaml:"active_config_changed"`
	KlipperServiceAction string                `json:"klipper_service_action" yaml:"klipper_service_action"`
	KlipperRestarted     *bool                 `json:"klipper_restarted" yaml:"klipper_restarted"`
	ActivationRequired   *bool                 `json:"activation_required" yaml:"activation_required"`
	Error                string                `json:"error,omitempty" yaml:"error,omitempty"`
}

func ParseBoxMotionGuard

func ParseBoxMotionGuard(raw []byte) (BoxMotionGuardResult, error)

func ParseBoxMotionVendorRestore

func ParseBoxMotionVendorRestore(raw []byte) (BoxMotionGuardResult, error)

func (BoxMotionGuardResult) DidChange

func (result BoxMotionGuardResult) DidChange() bool

func (BoxMotionGuardResult) Succeeded

func (result BoxMotionGuardResult) Succeeded() bool

type BoxMotionGuardTarget

type BoxMotionGuardTarget struct {
	Path         string `json:"path" yaml:"path"`
	BeforeSHA256 string `json:"before_sha256" yaml:"before_sha256"`
	AfterSHA256  string `json:"after_sha256" yaml:"after_sha256"`
	Mode         string `json:"mode" yaml:"mode"`
	UID          int    `json:"uid" yaml:"uid"`
	GID          int    `json:"gid" yaml:"gid"`
}

type EMMCDisk

type EMMCDisk struct {
	Device            string `json:"device"`
	Number            int    `json:"number"`
	FriendlyName      string `json:"friendlyName"`
	SerialNumber      string `json:"serialNumber"`
	UniqueID          string `json:"uniqueId"`
	BusType           string `json:"busType"`
	Size              int64  `json:"size"`
	LogicalSectorSize int64  `json:"logicalSectorSize"`
	IsBoot            bool   `json:"isBoot"`
	IsSystem          bool   `json:"isSystem"`
	IsReadOnly        bool   `json:"isReadOnly"`
	IsOffline         bool   `json:"isOffline"`
}

EMMCDisk is the identity shown before approval, rechecked before offlining, and checked against the opened raw handle before any image bytes are written.

type EMMCWritePlan

type EMMCWritePlan struct {
	Schema      string   `json:"schema"`
	Manifest    string   `json:"manifest"`
	Image       string   `json:"image"`
	ImageSHA256 string   `json:"imageSha256"`
	RawImage    string   `json:"rawImage"`
	RawSHA256   string   `json:"rawSha256"`
	Bytes       int64    `json:"bytes"`
	Disk        EMMCDisk `json:"disk"`
	CreatedAt   string   `json:"createdAt"`
}

type KlippeeAgentArtifact

type KlippeeAgentArtifact struct {
	Version string `json:"version" yaml:"version"`
	SHA256  string `json:"sha256" yaml:"sha256"`
}

type KlippeeAgentRefreshResult

type KlippeeAgentRefreshResult struct {
	Schema                    string `json:"schema" yaml:"schema"`
	OK                        bool   `json:"ok" yaml:"ok"`
	Service                   string `json:"service" yaml:"service"`
	Scope                     string `json:"scope" yaml:"scope"`
	Account                   string `json:"account" yaml:"account"`
	ObservedState             string `json:"observed_state" yaml:"observed_state"`
	RestartExit               *int   `json:"restart_exit" yaml:"restart_exit"`
	StateExit                 *int   `json:"state_exit" yaml:"state_exit"`
	KlipperActionsPerformed   *bool  `json:"klipper_actions_performed" yaml:"klipper_actions_performed"`
	ConfigDeploymentPerformed *bool  `json:"config_deployment_performed" yaml:"config_deployment_performed"`
	Error                     string `json:"error,omitempty" yaml:"error,omitempty"`
}

func ParseKlippeeAgentRefresh

func ParseKlippeeAgentRefresh(raw []byte) (KlippeeAgentRefreshResult, error)

type KlippeeAgentUpgradeResult

type KlippeeAgentUpgradeResult struct {
	Schema                    string               `json:"schema" yaml:"schema"`
	OK                        *bool                `json:"ok" yaml:"ok"`
	Changed                   *bool                `json:"changed" yaml:"changed"`
	Account                   string               `json:"account" yaml:"account"`
	CLIPath                   string               `json:"cli_path" yaml:"cli_path"`
	SourceURL                 string               `json:"source_url" yaml:"source_url"`
	Before                    KlippeeAgentArtifact `json:"before" yaml:"before"`
	After                     KlippeeAgentArtifact `json:"after" yaml:"after"`
	Service                   string               `json:"service" yaml:"service"`
	Scope                     string               `json:"scope" yaml:"scope"`
	ObservedState             string               `json:"observed_state" yaml:"observed_state"`
	BeforePID                 *int                 `json:"before_pid" yaml:"before_pid"`
	AfterPID                  *int                 `json:"after_pid" yaml:"after_pid"`
	UpgradeExit               *int                 `json:"upgrade_exit" yaml:"upgrade_exit"`
	StateExit                 *int                 `json:"state_exit" yaml:"state_exit"`
	UpgradeReportedSuccess    *bool                `json:"upgrade_reported_success" yaml:"upgrade_reported_success"`
	AgentRestartPerformed     *bool                `json:"agent_restart_performed" yaml:"agent_restart_performed"`
	KlipperActionsPerformed   *bool                `json:"klipper_actions_performed" yaml:"klipper_actions_performed"`
	ConfigDeploymentPerformed *bool                `json:"config_deployment_performed" yaml:"config_deployment_performed"`
	Error                     string               `json:"error,omitempty" yaml:"error,omitempty"`
}

func ParseKlippeeAgentUpgrade

func ParseKlippeeAgentUpgrade(raw []byte) (KlippeeAgentUpgradeResult, error)

ParseKlippeeAgentUpgrade consumes the exact bounded v1 proof emitted by the reviewed firmware operation. Unknown, duplicate, case-aliased, missing, or trailing fields fail closed before any lifecycle claim is trusted.

func (KlippeeAgentUpgradeResult) DiagnosticSummary

func (result KlippeeAgentUpgradeResult) DiagnosticSummary() string

func (KlippeeAgentUpgradeResult) DidChange

func (result KlippeeAgentUpgradeResult) DidChange() bool

func (KlippeeAgentUpgradeResult) Succeeded

func (result KlippeeAgentUpgradeResult) Succeeded() bool

type KlippeeVariableSetResult

type KlippeeVariableSetResult struct {
	Schema           string `json:"schema" yaml:"schema"`
	OK               *bool  `json:"ok" yaml:"ok"`
	Account          string `json:"account" yaml:"account"`
	CLIPath          string `json:"cli_path" yaml:"cli_path"`
	Name             string `json:"name" yaml:"name"`
	ValueSHA256      string `json:"value_sha256" yaml:"value_sha256"`
	SetReturnCode    int    `json:"set_return_code" yaml:"set_return_code"`
	DoctorReturnCode *int   `json:"doctor_return_code" yaml:"doctor_return_code"`
	Verified         *bool  `json:"verified" yaml:"verified"`
	ConfigDeployed   *bool  `json:"config_deployed" yaml:"config_deployed"`
	KlipperAction    string `json:"klipper_action" yaml:"klipper_action"`
	Error            string `json:"error" yaml:"error"`
}

func ParseKlippeeVariableSet

func ParseKlippeeVariableSet(raw []byte) (KlippeeVariableSetResult, error)

func (KlippeeVariableSetResult) Succeeded

func (result KlippeeVariableSetResult) Succeeded() bool

type KlipperServiceRestartResult

type KlipperServiceRestartResult struct {
	Schema      string `json:"schema" yaml:"schema"`
	Service     string `json:"service" yaml:"service"`
	State       string `json:"state" yaml:"state"`
	PreviousPID int    `json:"previous_pid" yaml:"previous_pid"`
	CurrentPID  int    `json:"current_pid" yaml:"current_pid"`
}

func ParseKlipperServiceRestart

func ParseKlipperServiceRestart(raw []byte) (KlipperServiceRestartResult, error)

func (KlipperServiceRestartResult) Validate

func (result KlipperServiceRestartResult) Validate() error

type KlipperUpdateResult

type KlipperUpdateResult struct {
	Schema        int    `json:"schema" yaml:"schema"`
	OK            bool   `json:"ok" yaml:"ok"`
	Status        string `json:"status" yaml:"status"`
	Account       string `json:"account" yaml:"account"`
	CheckOnly     bool   `json:"check_only" yaml:"check_only"`
	Before        string `json:"before" yaml:"before"`
	Target        string `json:"target" yaml:"target"`
	After         string `json:"after" yaml:"after"`
	Version       string `json:"version" yaml:"version"`
	Backup        string `json:"backup" yaml:"backup"`
	Error         string `json:"error" yaml:"error"`
	RollbackError string `json:"rollback_error" yaml:"rollback_error"`
}

KlipperUpdateResult describes a host-only update and its startup verification.

func ParseKlipperUpdate

func ParseKlipperUpdate(raw []byte) (KlipperUpdateResult, error)

type PLROperationResult

type PLROperationResult struct {
	Schema             string               `json:"schema" yaml:"schema"`
	OK                 *bool                `json:"ok" yaml:"ok"`
	Account            string               `json:"account,omitempty" yaml:"account,omitempty"`
	Paths              PLRPaths             `json:"paths,omitempty" yaml:"paths,omitempty"`
	TransactionState   string               `json:"transaction_state,omitempty" yaml:"transaction_state,omitempty"`
	Changed            *bool                `json:"changed,omitempty" yaml:"changed,omitempty"`
	Applied            *bool                `json:"applied,omitempty" yaml:"applied,omitempty"`
	Verified           *bool                `json:"verified,omitempty" yaml:"verified,omitempty"`
	KlipperLeftStopped *bool                `json:"klipper_left_stopped,omitempty" yaml:"klipper_left_stopped,omitempty"`
	BackupManifest     string               `json:"backup_manifest,omitempty" yaml:"backup_manifest,omitempty"`
	SafetyManifest     string               `json:"safety_manifest,omitempty" yaml:"safety_manifest,omitempty"`
	RollbackManifest   string               `json:"rollback_manifest,omitempty" yaml:"rollback_manifest,omitempty"`
	Service            string               `json:"service,omitempty" yaml:"service,omitempty"`
	ObservedState      string               `json:"observed_state,omitempty" yaml:"observed_state,omitempty"`
	Phase              string               `json:"phase,omitempty" yaml:"phase,omitempty"`
	Error              string               `json:"error,omitempty" yaml:"error,omitempty"`
	NextCommand        string               `json:"next_command,omitempty" yaml:"next_command,omitempty"`
	StartExit          *int                 `json:"start_exit,omitempty" yaml:"start_exit,omitempty"`
	StateExit          *int                 `json:"state_exit,omitempty" yaml:"state_exit,omitempty"`
	StabilityChecks    int                  `json:"stability_checks_required,omitempty" yaml:"stability_checks_required,omitempty"`
	StabilityInterval  float64              `json:"stability_interval_seconds,omitempty" yaml:"stability_interval_seconds,omitempty"`
	StabilitySamples   []PLRStabilitySample `json:"stability_samples,omitempty" yaml:"stability_samples,omitempty"`
	Plan               plrNestedResult      `json:"plan,omitempty" yaml:"-"`
	Installation       plrNestedResult      `json:"installation,omitempty" yaml:"-"`
	Rollback           plrNestedResult      `json:"rollback,omitempty" yaml:"-"`
	Verification       plrNestedResult      `json:"verification,omitempty" yaml:"-"`
	// contains filtered or unexported fields
}

PLROperationResult contains lifecycle status, recovery handles, and diagnostics. Detailed installer results are retained in the utility's JSON output.

func ParsePLROperation

func ParsePLROperation(raw []byte, expectedSchema string) (PLROperationResult, error)

ParsePLROperation accepts exactly one JSON document and validates its schema. It never searches printer files or guesses a backup path.

func (PLROperationResult) DiagnosticSummary

func (result PLROperationResult) DiagnosticSummary() string

DiagnosticSummary combines and deduplicates wrapper and remote installer errors.

func (PLROperationResult) DidChange

func (result PLROperationResult) DidChange() bool

func (PLROperationResult) Succeeded

func (result PLROperationResult) Succeeded() bool

func (*PLROperationResult) UnmarshalJSON

func (result *PLROperationResult) UnmarshalJSON(raw []byte) error

type PLRPaths

type PLRPaths struct {
	Home        string `json:"home" yaml:"home"`
	KlipperDir  string `json:"klipper_dir" yaml:"klipper_dir"`
	PrinterData string `json:"printer_data" yaml:"printer_data"`
	ScriptsDir  string `json:"scripts_dir" yaml:"scripts_dir"`
	Python      string `json:"python" yaml:"python"`
	GCodeRoot   string `json:"gcode_root" yaml:"gcode_root"`
	Checkpoint  string `json:"checkpoint" yaml:"checkpoint"`
	Record      string `json:"record" yaml:"record"`
	Output      string `json:"output" yaml:"output"`
}

PLRPaths identifies the Klipper account and paths for a recovery operation. The v1 result requires the complete field set.

func CanonicalPLRPaths

func CanonicalPLRPaths(account string) (PLRPaths, error)

CanonicalPLRPaths returns the only remote layout accepted by the reviewed QIDI PLR wrapper. It validates the account before constructing any path.

func (*PLRPaths) UnmarshalJSON

func (paths *PLRPaths) UnmarshalJSON(raw []byte) error

type PLRStabilitySample

type PLRStabilitySample struct {
	State string `json:"state" yaml:"state"`
	Exit  *int   `json:"exit" yaml:"exit"`
}

type QIDIArtifact added in v0.2.0

type QIDIArtifact struct {
	URL    string `json:"url" yaml:"url"`
	SHA256 string `json:"sha256" yaml:"sha256"`
	Bytes  int64  `json:"bytes" yaml:"bytes"`
}

type QIDIFixesResult added in v0.2.0

type QIDIFixesResult struct {
	Schema          int      `json:"schema" yaml:"schema"`
	OK              bool     `json:"ok" yaml:"ok"`
	Status          string   `json:"status" yaml:"status"`
	Model           string   `json:"model" yaml:"model"`
	Version         string   `json:"version" yaml:"version"`
	CheckOnly       bool     `json:"check_only" yaml:"check_only"`
	Polling         bool     `json:"polling" yaml:"polling"`
	Backup          string   `json:"backup" yaml:"backup"`
	BackupSHA256    string   `json:"backup_sha256" yaml:"backup_sha256"`
	LocalBackup     string   `json:"local_backup" yaml:"local_backup"`
	StartupVerified bool     `json:"startup_verified" yaml:"startup_verified"`
	Changes         []string `json:"changes" yaml:"changes"`
	Notes           []string `json:"notes" yaml:"notes"`
	Error           string   `json:"error" yaml:"error"`
}

func ParseQIDIFixes added in v0.2.0

func ParseQIDIFixes(raw []byte) (QIDIFixesResult, error)

type QIDIRelease added in v0.2.0

type QIDIRelease struct {
	Model          string       `json:"model" yaml:"model"`
	Version        string       `json:"version" yaml:"version"`
	DeviceMarker   string       `json:"device_marker" yaml:"device_marker"`
	Account        string       `json:"account" yaml:"account"`
	Architecture   string       `json:"architecture" yaml:"architecture"`
	PackageName    string       `json:"package_name" yaml:"package_name"`
	PackageArch    string       `json:"package_arch" yaml:"package_arch"`
	VersionFile    string       `json:"version_file" yaml:"version_file"`
	ScreenDevice   string       `json:"screen_device" yaml:"screen_device"`
	ScreenVersion  string       `json:"screen_version" yaml:"screen_version"`
	MinimumVersion string       `json:"minimum_version" yaml:"minimum_version"`
	Source         string       `json:"source" yaml:"source"`
	Host           QIDIArtifact `json:"host" yaml:"host"`
	Screen         QIDIArtifact `json:"screen" yaml:"screen"`
	PreservePaths  []string     `json:"preserve_paths" yaml:"preserve_paths"`
	RemovedGlobs   []string     `json:"removed_globs" yaml:"removed_globs"`
}

QIDIRelease is a reviewed installation profile, not a general-purpose package URL. Add models/releases only after inspecting their installer and hardware layout.

func QIDIReleaseFor added in v0.2.0

func QIDIReleaseFor(model, version string) (QIDIRelease, error)

func QIDIReleases added in v0.2.0

func QIDIReleases() ([]QIDIRelease, error)

func SelectQIDIRelease added in v0.2.0

func SelectQIDIRelease(model, version string) (QIDIRelease, error)

SelectQIDIRelease resolves standalone CLI defaults only from the reviewed catalogue. Ambiguous models require an explicit selection; live preflight still verifies the printer's actual device marker against this profile.

type QIDIUpdateResult added in v0.2.0

type QIDIUpdateResult struct {
	Schema          int    `json:"schema" yaml:"schema"`
	OK              bool   `json:"ok" yaml:"ok"`
	Status          string `json:"status" yaml:"status"`
	Model           string `json:"model" yaml:"model"`
	Target          string `json:"target" yaml:"target"`
	Before          string `json:"before" yaml:"before"`
	After           string `json:"after" yaml:"after"`
	CheckOnly       bool   `json:"check_only" yaml:"check_only"`
	HostOnly        bool   `json:"host_only" yaml:"host_only"`
	ConfigPolicy    string `json:"config_policy" yaml:"config_policy"`
	ScreenStatus    string `json:"screen_status" yaml:"screen_status"`
	Backup          string `json:"backup" yaml:"backup"`
	BackupSHA256    string `json:"backup_sha256" yaml:"backup_sha256"`
	LocalBackup     string `json:"local_backup" yaml:"local_backup"`
	ConfigVerified  bool   `json:"config_verified" yaml:"config_verified"`
	StartupVerified bool   `json:"startup_verified" yaml:"startup_verified"`
	Error           string `json:"error" yaml:"error"`
}

func ParseQIDIUpdate added in v0.2.0

func ParseQIDIUpdate(raw []byte) (QIDIUpdateResult, error)

type Runner

type Runner struct {
	Repo string

	Home string

	Out                           io.Writer
	ErrOut                        io.Writer
	BootstrapPasswordEnvironments []string
	// contains filtered or unexported fields
}

func (Runner) KlippeeDiagnosticsSSHOutput

func (r Runner) KlippeeDiagnosticsSSHOutput(
	ctx context.Context,
	printer inventory.Printer,
	connectTimeout time.Duration,
) ([]byte, error)

KlippeeDiagnosticsSSHOutput runs the printer's upload-diagnostics command through SSH. It returns bounded output.

func (Runner) KlippeeDiffSSHOutput

func (r Runner) KlippeeDiffSSHOutput(
	ctx context.Context,
	printer inventory.Printer,
	connectTimeout time.Duration,
) ([]byte, error)

KlippeeDiffSSHOutput runs only the installed physical printer account's read-only Klippee check --diff command and returns bounded output.

func (Runner) KlippeeForceApplySSHOutput

func (r Runner) KlippeeForceApplySSHOutput(
	ctx context.Context,
	printer inventory.Printer,
	connectTimeout time.Duration,
) ([]byte, error)

KlippeeForceApplySSHOutput is the explicit fallback for a physical workspace whose reviewed local changes have already been merged into desired state. The remote operation is fixed to `klippee pull --force`.

func (Runner) KlippeePreviousDiagnosticsSSHOutput

func (r Runner) KlippeePreviousDiagnosticsSSHOutput(
	ctx context.Context,
	printer inventory.Printer,
	connectTimeout time.Duration,
) ([]byte, error)

KlippeePreviousDiagnosticsSSHOutput uploads the newest rotated klippy.log through the installed Klippee client. The remote command is fixed: callers cannot supply a path, glob, or shell fragment, and Printerlab never receives the log contents.

func (Runner) KlipperServiceRestartSSHOutput

func (r Runner) KlipperServiceRestartSSHOutput(
	ctx context.Context,
	printer inventory.Printer,
	connectTimeout time.Duration,
) ([]byte, error)

func (Runner) Output

func (r Runner) Output(ctx context.Context, args ...string) ([]byte, error)

Output captures stage stdout and streams diagnostics to stderr.

func (Runner) Run

func (r Runner) Run(ctx context.Context, args ...string) error

func (Runner) ToolRoot

func (r Runner) ToolRoot() (string, error)

ToolRoot uses the embedded backend unless a custom checkout was selected.

func (Runner) Validate

func (r Runner) Validate() error

Jump to

Keyboard shortcuts

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