import type { Command } from "commander"; import { AihError } from "../errors.js"; import type { CommandSpec, Plan, PlanContext } from "../internals/plan.js"; import { type Runner } from "../internals/proc.js"; import { type Check, VerificationReport } from "../internals/verify.js"; import { type TrustSource } from "../trust/fetch.js"; import { type VerifiedPromotionHandle, type VerifiedPromotionSnapshot } from "./verified-promotion.js"; interface WorkspaceAddDeps { run?: Runner; env?: NodeJS.ProcessEnv; write?: (text: string) => void; now?: () => Date; newRunId?: () => string; } interface TrustSourceBinding { id: string; kind: TrustSource["kind"]; source: string; ref?: string; pinnedSha?: string; } export interface ClearedWorkspaceAddTrustGate { source: TrustSourceBinding; artifactHashes: Array<{ path: string; sha256: string; }>; report: VerificationReport; analyzersRun: string[]; internalScopes: string[]; } export interface WorkspaceAddTrustGate extends ClearedWorkspaceAddTrustGate { blockingChecks: Check[]; } export declare function readVerifiedWorkspacePromotion(candidate: unknown): VerifiedPromotionSnapshot | undefined; export declare class WorkspaceAddTrustGateBlockedError extends AihError { readonly blockingChecks: Check[]; constructor(blockingChecks: Check[]); } export declare const workspaceAddCommand: CommandSpec; export declare function workspaceAddPhase1Plan(ctx: PlanContext, resolvedSource?: TrustSource): Promise; export declare function collectSkillDirs(root: string): string[]; export declare function promotedSkillRel(sourceRoot: string, skillDir: string): string; export declare function assertUniquePromotedSkillNames(sourceRoot: string, skillDirs: readonly string[], selectedNames?: ReadonlySet): void; export declare function captureWorkspaceAddTrustGate(ctx: PlanContext, report: VerificationReport | undefined, resolvedSource?: TrustSource, selectSkills?: ReadonlySet): Promise; export declare function captureClearedWorkspaceAddTrustGate(ctx: PlanContext, report: VerificationReport | undefined, resolvedSource?: TrustSource, selectSkills?: ReadonlySet): Promise; export declare function issueVerifiedWorkspacePromotion(candidate: unknown): Promise; export declare function workspaceAddPhase2Plan(ctx: PlanContext, gate: ClearedWorkspaceAddTrustGate | WorkspaceAddTrustGate | undefined, resolvedSource?: TrustSource, selectSkills?: ReadonlySet): Promise; export declare function runWorkspaceAdd(command: Command, deps?: WorkspaceAddDeps): Promise; export {};