@sewdn/registry-publisher
v1.0.1
Published
Pack and check owner releases for the Lemonaid toolkit registry
Downloads
470
Readme
@sewdn/registry-publisher
Create a portable toolkit release from explicit owner inputs and genuine npm tarballs. The CLI and ESM API run in Bun or Node.js 20+.
npm install @sewdn/registry-publishernpx registry-publisher pack scaffold/owner.json .packs/toolkit-1.0.0
npx registry-publisher check .packs/toolkit-1.0.0
npx registry-publisher check .packs/toolkit-1.0.0/release.tgzBuild and pack selected npm packages before running the publisher. Input paths resolve from the current directory, or from the directory given by --root. The publisher writes release.json, content-addressed artifacts/, and release.tgz in the output directory. The archive contains the same manifest and artifacts and can be checked in a different directory after the source checkout is removed. An identical repeat can reuse the output directory. A different release needs a separate output directory.
The API accepts the same owner document as the CLI. The pack result includes the release metadata and relative references to the manifest and archive. Both references include their SHA-256 digests.
import { checkOwnerRelease, packOwnerRelease } from "@sewdn/registry-publisher";
const result = await packOwnerRelease(owner, { root: ".", output: ".packs/toolkit-1.0.0" });
const release = await checkOwnerRelease(".packs/toolkit-1.0.0/release.tgz");Use checkOwnerReleaseArchive(bytes) to verify an in-memory archive with the same checks as checkOwnerRelease(path). The Kit catalog command accepts the publisher's unmodified release.tgz. Registry refresh
Owner document
Use the release fields and item IDs from the registry contract. For a design-stage or unavailable tool, use an empty items array and record availability in the kit's enrollment.
{
"schemaVersion": 1,
"tool": "example",
"version": "1.0.0",
"revision": "7ac9e5d",
"description": "Example access policy tools",
"lifecycle": "active",
"docs": ["https://example.org/guide"],
"migrations": [],
"items": [
{
"kind": "package",
"id": "example/core",
"description": "Evaluate access policies",
"lifecycle": "active",
"role": "runtime",
"archive": ".packs/example-core-2.4.0.tgz",
"source": {
"directory": ".packs/core-source",
"distribution": "local",
"build": [{ "argv": ["bun", "run", "build"] }],
"test": [{ "argv": ["bun", "test", "./src"] }],
"requiredFiles": ["tsconfig.build.json", "src/index.ts"]
}
},
{
"kind": "skillset",
"id": "example/integration",
"version": "1.2.0",
"description": "Use the access policy API",
"lifecycle": "active",
"skillId": "example",
"supports": [{ "id": "example/core", "range": "2.4.0" }],
"files": [{ "path": "SKILL.md", "source": "scaffold/skills/example/SKILL.md" }]
}
]
}- Packages use an
archiveand may includenameandversionassertions. The publisher reads identity, explicit public export subpaths, and peers from the packed manifest. It derives toolkit requirements for dependencies on other packages in the release. For a companion from another tool, adddependencyItemsmapping the npm name to its qualified toolkit item ID. The packed manifest retains ordinary dependencies and complete export conditions. Current private npm archives can be used for local releases. - Recipes and skillsets use the contract's item fields with a root-relative
sourcein each file entry. For example, a recipe file entry can be{ "target": "api", "path": "src/authz/guard.ts", "source": "scaffold/recipes/guard.ts" }. Preserve recipe targets, versions, parameter declarations, validation commands, and skill entrypoints in the owner document. Preset entries use the contract as written. - Package sources use a prepared standalone directory. Include the matching
package.json, source, build configuration, tests, and notices. Npm identity, public export subpaths, effective dependencies, and peers must match the distribution tarball. Build dependencies belong in the source manifest. AddrequiredFilesfor project-specific inputs andcompanionsfor other toolkit packages needed by the source. The source revision defaults to the release revision.
The publisher copies source bytes under package/ and lists conventional license and notice filenames it finds. Supply licenseFiles for notices under other names. Include matching copies of notices shipped in the npm archive. Local bundles can have an empty license list. A redistributable bundle requires an explicit distribution declaration and license files under the owner's redistribution policy.
Verification
Pack and check validate portable paths, artifact SHA-256 digests, npm metadata, and source manifests. Source checks cover declared required files at pack time, local TypeScript configuration inheritance, references and explicit file lists, and package scripts referenced by common package manager commands. Run package, recipe, and source builds and tests as explicit owner steps. The publisher reads metadata and files without running lifecycle or validation commands.
The archive limits come from @sewdn/registry-artifacts. Each archive member can be at most 32 MiB. Use a prepared input tree containing regular files and directories. The resulting archives have stable file ordering and timestamps. Distributed npm tarballs are included byte-for-byte.
From the Kit workspace, run bun run registry:prepare at the root, then bun run typecheck and bun run test from this package.
