trigger.dev
Version:
A Command-Line Interface for Trigger.dev projects
52 lines (51 loc) • 2.3 kB
TypeScript
import type { BuildManifest, SkillManifest } from "@trigger.dev/core/v3/schemas";
import { type BuildLogger } from "@trigger.dev/core/v3/build";
export type BundleSkillsOptions = {
buildManifest: BuildManifest;
buildManifestPath: string;
workingDir: string;
env: Record<string, string | undefined>;
logger: BuildLogger;
};
export type BundleSkillsResult = {
/** The input manifest, annotated with `skills` on return. */
buildManifest: BuildManifest;
/** Discovered skills, in deterministic order. */
skills: SkillManifest[];
};
export type CopySkillFoldersOptions = {
skills: SkillManifest[];
/** Root where `{destinationRoot}/{id}/` folders will be created. */
destinationRoot: string;
/** Used to resolve relative `filePath` references in skill manifests. */
workingDir: string;
/** Only `debug` is used. `BuildLogger` and the cli `logger` both satisfy this shape. */
logger: {
debug: (...args: unknown[]) => void;
};
};
/**
* Copy each skill's source folder to `{destinationRoot}/{id}/`. Validates
* that `SKILL.md` exists and has the required frontmatter. Pure file IO —
* no indexer subprocess, no env handling.
*
* Used by the dev path (driven by the main worker indexer's skills list)
* and indirectly by the deploy path (via `bundleSkills` which discovers
* skills via its own indexer pass first, then delegates here).
*/
export declare function copySkillFolders(options: CopySkillFoldersOptions): Promise<SkillManifest[]>;
/**
* Built-in skill bundler — not an extension. Runs the indexer locally
* against the bundled worker output to discover `skills.define(...)`
* registrations, validates each skill's `SKILL.md`, and copies the
* folder into `{outputPath}/.trigger/skills/{id}/` so the deploy image
* picks it up via the existing Dockerfile `COPY`.
*
* Used by the deploy path. The dev path uses `copySkillFolders` directly,
* driven by the main worker indexer that already runs in `BackgroundWorker.initialize` —
* no duplicate indexer pass needed there.
*
* No `trigger.config.ts` changes required — discovery is side-effect
* based, same mechanism as task/prompt registration.
*/
export declare function bundleSkills(options: BundleSkillsOptions): Promise<BundleSkillsResult>;