@daftarai/sdk
v3.0.0
Published
Plugin manifest schema, validator, error types, and v2-compat wrapper for the Daftarai plugin SDK v3.
Downloads
116
Maintainers
Readme
@daftarai/sdk
Plugin manifest schema, validator, error types, and v2-compat wrapper for the Daftarai plugin SDK v3.
This is the primary SDK package plugin developers depend on. It exports the canonical v3 plugin manifest schema (pluginManifestV3Schema), the runtime validator, and a v2-to-v3 wrapper adapter for migrating existing v2 plugins.
Install
pnpm add @daftarai/sdk @daftarai/capabilities zodMost developers scaffold via npm create daftarai-plugin@latest <id> instead — the scaffolder pre-wires these deps in the generated plugin's package.json.
Quick start
import { pluginManifestV3Schema, validateManifest } from "@daftarai/sdk";
import { ALL_CAPABILITIES } from "@daftarai/capabilities";
const myManifest = {
pluginId: "my-plugin",
pluginVersion: "0.1.0",
manifestVersion: 3,
capabilities: ["read:ledger.balance"],
// ... see schema for full surface
};
const result = validateManifest(myManifest);
if (!result.ok) {
console.error(result.errors);
}What's exported
import {
pluginManifestV3Schema, // zod schema
validateManifest, // validator
type PluginManifestV3, // inferred type
type ValidationResult, // validator result
ManifestValidationError, // thrown on hard-validate
PluginError, // base error class
PluginRuntimeError,
CapabilityFrozenError,
CapabilityDeniedError,
CapabilityNotDeclaredError,
MethodologyDisclaimerError,
} from "@daftarai/sdk";
// v2 → v3 migration helpers
import {
wrapV2Handler,
buildV3ManifestFromV2,
wrapperConfigSchema,
type V2Handler,
type V2ManifestSubset,
type V3WrappedHandler,
type WrapperConfig,
} from "@daftarai/sdk";Versioning
This package is published in lockstep with @daftarai/capabilities. The major version corresponds to the Plugin SDK major version (3.x.x = Plugin SDK v3).
Changes to the manifest schema, error types, or validator semantics that break existing manifests are major.
License
MIT — see LICENSE.
