/** * Skill dispatcher — routes a parsed invocation to either: * - spawn `python3 --flag value ...` (entry.type === 'python') * - call a TS handler from handlers/ (entry.type === 'http' | 'builtin') * * Authorization happens HERE, once, before either path — see auth/ensure.ts for * why. Python children receive the resolved credential through their environment * and never read the credential store themselves. * * Resolves to the child process's exit code so cli.ts can propagate it. */ import { type SkillDef } from './registry.js'; import type { ParsedArgs } from './argv.js'; export interface RunOptions { /** Override the skills directory (defaults to the package's bundled skills/). */ baseDir?: string; /** Raw argv slice after the skill name (passed verbatim for python; parsed for handlers). */ rawArgs: string[]; /** Parsed argv (for handlers). */ parsedArgs: ParsedArgs; } export declare function runSkill(skillName: string, opts: RunOptions): Promise; /** What this invocation is allowed to do about attribution. */ export type TakeMode = 'create' | 'join' | 'none'; /** * Decide the take mode from the skill's declaration *and* what this particular * invocation was asked to do. * * The manifest flags alone are not enough, because they describe the skill, not * the call: `render-video --help` prints usage and exits, and * `render-video --resolve-only` stops after asset resolution. Both used to run * the full createsTake path, so a help query was enough to mint an empty take * and lazily create 「未分类」 — the exact clutter project/take.ts sets out to * avoid ("an empty VideoProject is worse clutter than an unattributed image"). * * Note that a downgraded run still *joins*: when its own pipeline already * started a take under the same grouping key, assets it generates stay attached. */ export declare function resolveTakeMode(skill: Pick, args: ParsedArgs): TakeMode;