Help us shape the future of Go! Take the 2026 Go Developer Survey

sdk

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package sdk resolves versioned Karty SDK manifests.

Package sdk resolves installed versioned Karty SDK bundles.

Index

Constants

View Source
const MinimumVersion = "0.0.5"

MinimumVersion is the oldest supported development SDK release.

View Source
const ReviewedProjectCodegen = 3

ReviewedProjectCodegen selects explicit setters and authored entity lookup.

Variables

View Source
var ErrNotInstalled = errors.New("SDK is not installed")

ErrNotInstalled distinguishes an absent SDK bundle from a damaged installation.

Functions

func ClientFiles

func ClientFiles(manifest Manifest, compiler string) (map[string][]byte, error)

ClientFiles copies pre-generated SDK bindings; no WIT generator runs in the CLI.

func ClientFilesContext added in v0.0.2

func ClientFilesContext(ctx context.Context, manifest Manifest, compiler string) (map[string][]byte, error)

func InstallBundle

func InstallBundle(version string, data []byte, checksum string) error

InstallBundle installs a bounded, checksummed SDK atomically. This also supports candidate artifacts produced locally by engine contributors.

func InstallBundleContext added in v0.0.2

func InstallBundleContext(ctx context.Context, version string, data []byte, checksum string) error

func InstallPublished

func InstallPublished(ctx context.Context, version string) error

InstallPublished verifies the signed release manifest before trusting its bundle URL.

func Resources

func Resources(manifest Manifest) (fs.FS, error)

Resources exposes only the selected SDK archive's public build inputs.

func ResourcesContext added in v0.0.2

func ResourcesContext(ctx context.Context, manifest Manifest) (fs.FS, error)

func SyncDocs

func SyncDocs(projectDirectory string, manifest Manifest) error

func SyncDocsContext added in v0.0.2

func SyncDocsContext(ctx context.Context, projectDirectory string, manifest Manifest) error

func ValidateMaterialize added in v0.0.2

func ValidateMaterialize(manifest Manifest) error

ValidateMaterialize accepts an absent pin or a complete released tools pin. Keep this contract aligned with the engine's versioned SDK schema.

Types

type AssetProfile

type AssetProfile struct {
	Processor assetcontract.Processor   `toml:"processor"`
	Transform assetcontract.ImageRecipe `toml:"transform"`
}

AssetProfile pins the processor selected for an SDK asset profile.

type Compatibility added in v0.0.2

type Compatibility struct {
	Format         int    `json:"format"          toml:"format"`
	UISchema       uint32 `json:"ui_schema"       toml:"ui_schema"`
	ProjectCodegen int    `json:"project_codegen" toml:"project_codegen"`
}

Compatibility describes supported formats declared by the SDK's bundle.toml (or immutable released format1 metadata). These are format revisions, independent of SDK and API release numbers.

type Manifest

type Manifest struct {
	Compatibility Compatibility `toml:"-"`
	Bundle        ToolArtifact  `toml:"bundle"`
	Version       string        `toml:"version"`
	API           struct {
		Version string `toml:"version"`
	} `toml:"api"`
	Host struct {
		Version string `toml:"version"`
	} `toml:"host"`
	Docs struct {
		Version string `toml:"version"`
	} `toml:"docs"`
	Templates struct {
		Game string `toml:"game"`
	} `toml:"templates"`
	Assets struct {
		Capabilities    assetcontract.Capabilities `toml:"capabilities"`
		TextureProfiles map[string]AssetProfile    `toml:"texture-profiles"`
		SoundProfiles   map[string]SoundProfile    `toml:"sound-profiles"`
	} `toml:"assets"`
	Tools struct {
		// Air preserves historical signed SDK metadata; it is never installed or required.
		Air                 string `toml:"air,omitempty"`
		Go                  string `toml:"go"`
		Materialize         string `toml:"materialize"`
		MaterializeRevision string `toml:"materialize-revision"`
		TinyGo              string `toml:"tinygo"`
		WasmTools           string `toml:"wasm-tools"`
	} `toml:"tools"`
	Artifacts struct {
		// Air preserves historical signed SDK metadata; it is never installed or required.
		Air         map[string]ToolArtifact         `toml:"air,omitempty"`
		Materialize map[string]MaterialToolArtifact `toml:"materialize"`
		TinyGo      map[string]ToolArtifact         `toml:"tinygo"`
		WasmTools   map[string]ToolArtifact         `toml:"wasm-tools"`
		Host        struct {
			Native       map[string]ToolArtifact `toml:"native"`
			Web          ToolArtifact            `toml:"web"`
			WebRuntime   ToolArtifact            `toml:"web-runtime"`
			WebOptimized ToolArtifact            `toml:"web-optimized"`
			WebBrotli    ToolArtifact            `toml:"web-brotli"`
		} `toml:"host"`
	} `toml:"artifacts"`
	// contains filtered or unexported fields
}

Manifest is the subset of an SDK manifest required by the initial CLI.

func Resolve

func Resolve(version string) (Manifest, error)

func ResolveContext added in v0.0.2

func ResolveContext(ctx context.Context, version string) (Manifest, error)

func ResolvePublished

func ResolvePublished(ctx context.Context, version string) (Manifest, error)

ResolvePublished downloads and verifies the SDK manifest attached to the matching Karty release. Callers must use its exact project-pinned version.

func (Manifest) SupportsAuthoredActions added in v0.0.2

func (manifest Manifest) SupportsAuthoredActions() bool

SupportsAuthoredActions reports whether the bundle supplies the action generator contract.

type MaterialToolArtifact added in v0.0.2

type MaterialToolArtifact struct {
	URL        string `toml:"url"`
	SHA256     string `toml:"sha256"`
	Format     string `toml:"format"`
	Executable string `toml:"executable"`
}

MaterialToolArtifact pins a tool archive and its confined executable entry.

type SoundProfile added in v0.0.2

type SoundProfile struct {
	Processor assetcontract.Processor   `toml:"processor"`
	Transform assetcontract.AudioRecipe `toml:"transform"`
}

SoundProfile pins one deterministic WAV-to-QOA processing recipe.

type ToolArtifact

type ToolArtifact struct {
	URL    string `toml:"url"`
	SHA256 string `toml:"sha256"`
}

ToolArtifact identifies a verified tool release archive.

Jump to

Keyboard shortcuts

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