Expand description
Helper for resolving ext://<id>#component references.
§Resolution flow
- Parse the
ext://<id>#componentref — error if malformed. - Look up
<id>inpack.extensions.jsonviaread_extensions_file. - Acquire the extension’s
.gtxpackfrom its declaredfile://or bare local source. - Read
component.jsonfrom the ZIP to obtain the component asset path and expected digest. - Read the component wasm asset from the ZIP.
- Verify SHA-256 digest — error on mismatch.
- Return the extracted bytes.
§component.json schema (Phase 2 sidecar)
The resolver reads a packc-owned component.json sidecar at the root of the
.gtxpack ZIP. It is written alongside the canonical, store-validated describe.json
(describe-v2) manifest, which itself cannot carry this metadata (its schema root is
additionalProperties: false).
{
"component": {
"id": "greentic.component-http",
"asset": "component.wasm",
"digest": "sha256:<hex>"
}
}Fields:
component.id— the store id; informational (the resolver does not enforceid == extension_id).component.asset— ZIP entry name of the runtime wasm. For aComponentExtensionproducer this iscomponent.wasmat the root; other producers may use arbitrary paths such asassets/component-<name>.wasm.component.digest—sha256:<hex>digest of the wasm bytes.
The Phase-2 producer (greentic-component store publish) must emit exactly this shape.
Structs§
- ExtRef
- Parsed form of
ext://<id>#component. - Gtxpack
Component Entry - Single embedded component entry in
component.json. - Gtxpack
Component Sidecar - Embedded-component descriptor from the
component.jsonsidecar inside a.gtxpackZIP. - Store
Ref - Parsed form of a
store://<name>@<version>extension source ref.
Functions§
- download_
store_ artifact - Download the extension
.gtxpackfromstore_baseforstore_ref, verify the whole-archivex-artifact-sha256(when advertised), cache it undercache_dir, and return the bytes. - extract_
and_ verify_ bytes - Read the
component.jsonsidecar + the component wasm asset from.gtxpackZIPzip_bytes, verify the digest, and return (wasm_bytes, verified_digest). - parse_
ext_ ref - Parse an
ext://<id>#componentreference. - parse_
store_ ref - Parse a
store://<name>@<version>extension source ref. - read_
describe_ from_ gtxpack - Read the
describe.jsonsidecar from a.gtxpackZIP. - resolve_
agent_ tool_ requirements - For each tool extension used by the agents, acquire its
.gtxpack, readdescribe.json, and extract the secret requirements of the used tools. - resolve_
ext_ component - Resolve an
ext://<id>#componentreference by extracting the wasm from the extension’s.gtxpackand verifying the digest against thecomponent.jsonsidecar. - resolve_
ext_ component_ with_ dist - Cache/handle-aware entry point that resolves an
ext://<id>#componentref, acquiring the extension.gtxpackover the network when its declared source isstore://(and, guarded,oci://).file:///bare sources behave exactly asresolve_ext_component. - store_
artifact_ url - Build the store artifact endpoint URL for an extension
(name, version).