import type { OrchestrationTypes } from "@cargo-ai/types"; import { type Token } from "../core.js"; import { type FolderRef } from "../refs.js"; import type { FolderHandle } from "./folder.js"; /** A cron trigger for the tool (the only trigger kind tools support). */ export type ToolTriggerSpec = { cron: string; name?: string; description?: string; data?: Record; }; export type WorkflowDefinition = { readonly nodes: unknown[]; readonly formFields: unknown[]; readonly __input?: I; readonly __output?: O; }; export type ToolSpec = { /** The workflow that backs this tool — a `defineWorkflow(...)` result. */ workflow: WorkflowDefinition; name?: string; description?: string; /** Emoji slug for the tool's icon (e.g. "wrench", "mag"). */ emojiSlug?: string; folder?: FolderHandle | FolderRef; /** Cron triggers (applied via tool update — create doesn't take them). */ triggers?: ToolTriggerSpec[]; /** Public form config (applied via tool update). */ publicForm?: OrchestrationTypes.ToolPublicForm; }; export type ToolHandle = { readonly slug: string; readonly uuid: Token; /** The backing workflow's uuid — spans/runs are keyed by this, not the tool uuid. */ readonly workflowUuid: Token; /** Discriminator so a tool handle can be passed to a workflow's `uses`. */ readonly resource: "tool"; readonly __input?: I; readonly __output?: O; }; export declare function defineTool(slug: string, spec: ToolSpec): ToolHandle; //# sourceMappingURL=tool.d.ts.map