import { type ExecutionGrantRequest, type ResolvedExecutionGrant } from "./execution-grants.js"; import type { ResolvedSkillSelection } from "../types/skill-selection.js"; import type { SkillBundleEntry } from "./skill-bundle.js"; import { type SelectionResolverOptions } from "./selection-resolver.js"; import { type SelectedSecretBindings, type SelectedSecretsClient } from "./execution-secrets.js"; export interface ResolvedSelectedRun { selection: ResolvedSkillSelection; profileId: string; kind: "instruction" | "executable"; entries: SkillBundleEntry[]; manifest: Record; packageJson: Record; cacheDir: string; } export declare function resolveSelectedRun(spec: string, profileId: string, options?: SelectionResolverOptions): Promise; /** * The operation an instruction skill declares, if it declares one. * * An instruction skill is prose-first: agents follow SKILL.md, and `skills run` * refuses it. Its manifest may still declare the one operation it ships — the * first `commands` entry, naming the helper — together with an explicit runtime * contract in `runtime` (`runtime` plus its `version`/`timeout` policy). Such a * skill is runnable through that declared operation, and only through it: the * executed file is exactly the entry the selected command declares, it must be a * regular file in the selected bundle, and a `runtime.entrypoint` that disagrees * with it is an inconsistent declaration that refuses (see * {@link instructionEntrypointMismatch}) rather than quietly running the other * file. An instruction skill that declares no operation — no command, a * non-string or empty entry, or no runtime contract — keeps the prose-only * refusal (`skills load`, never `skills run`), so an instruction bundle is never * mistaken for a runnable stub. */ export declare function declaredOperation(manifest: Record): { entry: string; } | null; /** * The entry the instruction skill's declared command names, when it names one. * The first `commands` entry is the operation: nothing else in the manifest * selects what an instruction skill runs. */ export declare function instructionCommandEntry(manifest: Record): string | null; /** * A declared `runtime.entrypoint` that disagrees with the declared command entry, * for an instruction skill. The command entry is the authority, so a disagreement * is an inconsistent declaration: it refuses, and the disagreeing file never runs. */ export declare function instructionEntrypointMismatch(manifest: Record): string | null; /** * Why an instruction skill cannot run locally, if it cannot. `isBundledFile` says * whether a path is a regular file in the selected bundle, so a declared command * entry that is not there is refused by name instead of being substituted. The * CLI, the MCP tool and the local executor all ask this one function, so the * reason and the code cannot drift between them. A runnable instruction skill * (declared command, agreeing runtime, entry present in the bundle) returns null. */ export declare function instructionRunRefusal(manifest: Record, isBundledFile: (path: string) => boolean): { code: string; message: string; } | null; export interface SelectedLocalRunOptions { args?: string[]; input?: unknown; cwd?: string; timeoutMs?: number; /** Only explicitly supplied environment values are available to declared secret references. */ env?: Record; /** Explicit value-free vault grants; mutually exclusive with env. */ secretBindings?: SelectedSecretBindings; /** SDK injection seam. The default uses the independently configured Secrets SDK. */ createSecretsClient?: () => SelectedSecretsClient; /** Disable network authorization for explicit cached execution; declared secrets then need caller bindings. */ sharedExecutionGrants?: boolean; /** SDK seam for current shared authorization; responses still undergo exact binding validation. */ resolveExecutionGrant?: (request: ExecutionGrantRequest) => Promise; } export declare function prepareSelectedSecretBindings(selected: ResolvedSelectedRun, cwd?: string): Promise; export declare function executeSelectedLocal(selected: ResolvedSelectedRun, options?: SelectedLocalRunOptions): Promise<{ exitCode: number; stdout: string; stderr: string; error?: string; secretBinding?: { schema: "hasna.skills-secret-bindings.v1"; selection: Pick & { profileId: string; }; consumer: { stationId: string; workspaceDirectory: string; }; secretsAuthority: string; bindings: Record; } | undefined; executionGrant?: { policyRevision: string; grantId: string; } | undefined; selection: ResolvedSkillSelection; target: "local"; runtime: any; entrypoint: string; inputDigest: string; runDirectory: string; }>;