PackageRef:scope
methodPackageRef:scope() -> stringOwning scope segment (the scope in @scope/name), without the leading @.
handle22 methods, 2 fields
An opaque, resolved reference to a catalog entry. Read-only; accepted by app.spawn({ package_ref = ref }).
datumhue.packages.list, datumhue.packages.search, datumhue.packages.info, datumhue.packages.installed, datumhue.packages.on_change (in its callback), datumhue.packages.on_install_change (in its callback), App.package_refdatumhue.app.spawnThe examples on this page start from:
local ref = datumhue.packages.info("@datumhue/hello")| Field | Type | Access | Description |
|---|---|---|---|
name | string | read-only | Scoped @scope/name identity. |
title | string | read-only | Read-only. The human name: the manifest title, or one derived from the package name (scope dropped, "_" and "-" become spaces, each word capitalized). Never empty. |
PackageRef:scope() -> stringOwning scope segment (the scope in @scope/name), without the leading @.
PackageRef:publisher() -> stringStable identifier of the entity that published this version, as verified at publish from the publisher's sign-in.
PackageRef:namespace() -> stringNamespace this entry belongs to.
PackageRef:version() -> stringSemVer string from the manifest.
In the guide: List and install packages
PackageRef:kind() -> stringManifest kind: "app", "library", or "asset_pack".
PackageRef:content_type() -> string?The refinement tag on asset packs, or nil when unset.
PackageRef:description() -> string?One-line summary, or nil when unset.
PackageRef:author() -> string?Display name, or nil when unset.
PackageRef:icon() -> Image?Catalog icon, returned at once and populated in the background; nil when the manifest declares no icon. Decoded at up to 256 px on the longest edge.
PackageRef:size() -> integerTotal size of the package's files in bytes.
PackageRef:is_sealed() -> booleanThe sealed flag from the manifest.
PackageRef:is_service() -> booleanThe service flag from the manifest.
PackageRef:requires() -> table<string, string>Map of dependency @scope/name to its SemVer constraint.
for name, constraint in pairs(ref:requires()) do
print(name, constraint)
endPackageRef:capabilities() -> string[]Array of capability grants the manifest declares as required to run, in declaration order; empty when none.
PackageRef:license() -> string?SPDX license id the package declares (e.g. "0BSD"), or nil when unset.
PackageRef:tags() -> string[]Discovery tags from the manifest, in declaration order; empty when none.
PackageRef:screenshots() -> Image[]Screenshot images in manifest order, each populated in the background like icon() and decoded at up to 1024 px on the longest edge. Every call starts one load per screenshot, so call it for the package being viewed rather than across a whole list.
PackageRef:readme() -> BytesFetchStart fetching the package's readme (raw Markdown or plain text); value is its bytes, which bytes:book() renders, or nil when the package ships none. The fetch fails when the readme exceeds 1 MiB, is not valid UTF-8, or can't be fetched.
local readme = ref:readme():ready()
if readme.value then
readme.value:book():mount()
endPackageRef:load() -> PackageDownload the package and return it as a Package handle. Raises if the request fails.
local pkg = ref:load()
datumhue.app.spawn({ package = pkg })PackageRef:installed_version() -> string?Version of this package currently installed from this ref's registry — keyed by name, so a catalog-latest ref answers for the installed copy. nil when not installed; a value differing from version() means an update is available. Reads this workstation's state, without asking the deployment.
In the guide: List and install packages
PackageRef:install() -> OpStart downloading this exact version, with its dependencies, into the local library; the op completes once it is installed. Already complete when this version is installed; installing over a different installed version replaces it. Installs run concurrently. One started while a removal is still clearing local content waits for that to end. Fails when the registry can't be reached and the content is not already on this device, or the download is invalid.
ref:install():ready()
print(ref:installed_version())In the guide: List and install packages
PackageRef:uninstall() -> OpRemove this package from the local library — keyed by name, whatever version is installed. The library entry goes at the call; the op completes when the package's local content is cleared, keeping content shared with other installed packages. Raises when it is not installed or an app is currently running from it.
In the guide: List and install packages