import type { CatalogTemplate, MarketplaceWorkflow } from '../types/workflow.js'; import type { WorkflowDefinition } from './weiroll.js'; export interface BuildWorkflowDefinitionFromCatalogOptions { templates?: Record; } /** Validated, structurally-sound view of a fetched marketplace catalog. */ export interface ParsedMarketplaceCatalog { templates: Record; workflows: Record[]; } /** * Validates the shape of a raw marketplace catalog before it is mapped into * `MarketplaceWorkflow[]`. * * The catalog is untrusted data fetched over the network (IPFS gateway), so we fail * loudly on structural problems rather than coercing with `as any` and silently * producing malformed workflows. A workflow that references a missing template, or * carries a non-object `variables` map or a malformed `workflowId`, is a tampering / * integrity signal — surfacing it here prevents a manager from later being shown (and * signing a policy for) a workflow the SDK could not faithfully reconstruct. * * Accepts either `{ templates, workflows }` or a bare `workflows` array (the two shapes * the SDK already supports). Callback entries (`useTemplate` present) are passed through * without per-field checks since the caller filters them out. */ export declare function parseMarketplaceCatalog(raw: unknown): ParsedMarketplaceCatalog; /** * Converts a MarketplaceWorkflow (from the IPFS catalog) into a WorkflowDefinition * that can be passed to buildScript(). * * Slot classification for each $variable: * - in workflow.variables (strip $) → literal (resolved, pinned in bitmap) * - in MAGIC_VARIABLE_KEYS → magic (resolved from poolContext) * - appears as action.returns → runtime (computed by weiroll during execution) * - anything else → runtime (filled by user before execution) * * Bare `input: []` values are treated as runtime inputs too: * - use catalog `runtimeVariables` when the mapping is unambiguous * - otherwise synthesize a per-input runtime key so the FE can ask the user * for the missing values explicitly * * Only the last category is included in runtimeVariables — the UI shows an * input field for each of those. Computed slots start as empty bytes and are written * by the weiroll VM when the producing action runs. * * Action outputs are set to the corresponding slot index when action.returns is * present, and UNUSED_SLOT otherwise. */ export declare function buildWorkflowDefinitionFromCatalog(workflow: MarketplaceWorkflow, options?: BuildWorkflowDefinitionFromCatalogOptions): WorkflowDefinition; //# sourceMappingURL=catalog.d.ts.map