@moonbooth/protocol
v0.3.0
Published
ACT 0.1 package format library: manifest schema, package build and validation, digests, transfer state machine
Maintainers
Readme
@moonbooth/protocol
The package format library behind Moonbooth. It defines the ACT 0.1 capability package format: the manifest schema, package build and validation, canonical digests, the transfer state machine, receipts, and the lesson profile for packages that carry a lesson.
A capability package is a set of text files (Markdown, plain text, JSON, YAML) plus a manifest (act.json). The library builds a package from a manifest and its files, computes a sha-256 digest over a canonical form of the contents, and validates packages against the format rules: allowed file types, size limits, path rules, and manifest schema.
Install
npm install @moonbooth/protocolExample
import { buildPackage, validatePackage } from "@moonbooth/protocol";
const pkg = buildPackage({
manifest: {
act_version: "0.1",
capability: {
id: "sample-capability",
name: "Sample Capability",
version: "1.0.0",
description: "A sample capability.",
},
artifact: { format: "agent-skills", entrypoint: "SKILL.md" },
requirements: { tools: [], configuration: [] },
requested_permissions: {
network: false,
filesystem_write: false,
external_side_effects: false,
},
verification: { test_manifest: "tests/manifest.json" },
},
files: {
"SKILL.md": "# Sample\n\nDo the sample task.\n",
"tests/manifest.json": "{\"suite_id\":\"sample\",\"version\":\"1.0.0\"}\n",
},
});
console.log(pkg.digest); // canonical digest of the package contents
const result = validatePackage({ manifest: pkg.manifest, files: pkg.files });
if (!result.ok) {
console.error(result.errors);
}Links
- Homepage: https://www.moonbooth.ai
- Repository: https://github.com/moonboothai/moonbooth (this package lives in
packages/protocol) - Issues: https://github.com/moonboothai/moonbooth/issues
License
MIT
