import type { Profile } from '../profiles/types.js'; import type { SupportedTool } from '../types/index.js'; export declare const RUNTIME_ARTIFACT_MANIFEST_PATH = ".setup-agents/artifacts.json"; export declare const RUNTIME_ARTIFACT_MANIFEST_SCHEMA_VERSION = 1; export type RuntimeArtifactKind = 'profile-rule' | 'profile-workflow' | 'skill' | 'playbook' | 'permissions' | 'project-knowledge'; export type RuntimeArtifactAdapter = { tool: SupportedTool; path: string; loading: 'native' | 'pointer' | 'inline'; }; export type RuntimeArtifactEntry = { id: string; kind: RuntimeArtifactKind; path: string; owner: 'setup-agents'; source: string; profileId?: string; adapters: RuntimeArtifactAdapter[]; }; export type RuntimeArtifactManifest = { schemaVersion: number; pluginVersion: string; profiles: string[]; tools: SupportedTool[]; artifacts: RuntimeArtifactEntry[]; }; export type RuntimeArtifactHealth = { healthy: boolean; missingCanonical: string[]; missingAdapters: string[]; }; export declare function canonicalProfileRulePath(profileId: string): string; export declare function canonicalProfileWorkflowPath(profileId: string, filename: string): string; export declare function buildRuntimeArtifactManifest(options: { profiles: Profile[]; tools: SupportedTool[]; version: string; skillPaths: string[]; defaultPlaybooks: string[]; includeProfileWorkflows: boolean; /** * Product profiles that fused into a role this run (product-profile-role-fusion) and therefore * got NO per-tool rule/workflow file of their own — only their (unconditionally-written) * canonical `.setup-agents/profiles//rule.md` exists. Their manifest entry keeps that * canonical `path` (so a later run that drops the profile entirely still purges it correctly) * but reports NO adapters, so `assessRuntimeArtifactManifest` never flags a fused product's * (never-written) per-tool file as a missing adapter, and `findOrphanedArtifacts` correctly * purges a PREVIOUSLY-written standalone adapter path once the profile fuses instead of stays. */ fusedProductIds?: ReadonlySet; }): RuntimeArtifactManifest; /** * Read the manifest a previous generation run wrote, or `null` when none * exists (first run) or it is on an unsupported schema version (never treat * an unreadable/foreign manifest as a signal that everything in it is * orphaned — that would purge files this function cannot actually vouch for). */ export declare function readRuntimeArtifactManifest(cwd: string): RuntimeArtifactManifest | null; /** * Paths a PREVIOUS generation wrote that the CURRENT generation no longer * references at all — e.g. a profile's rule filename changed between plugin * versions, or a profile/tool was dropped from the active set (GH-purge-stale-artifacts). * Every path in a manifest is owned exclusively by setup-agents (the manifest's * own contract — `owner: 'setup-agents'`), so a path this function returns is * always safe to delete once the caller decides to purge; it never reports a * path when `previous` is `null` (first run — nothing to compare against). * * Adapter paths are scoped to `next.tools` before the diff: `resolveTools` returns * exactly the requested `--rules` set when it is passed explicitly, NOT merged with * whatever was previously configured. Without this scoping, running `local --rules * claude` and later `local --rules opencode` would see every claude-runtime adapter * path as "no longer referenced" by the opencode-only run and purge it — deleting a * still-valid tool's entire output just because this particular invocation didn't * mention that tool (GH-artifact-purge-tool-scope). */ export declare function findOrphanedArtifacts(previous: RuntimeArtifactManifest | null, next: RuntimeArtifactManifest): string[]; export declare function assessRuntimeArtifactManifest(cwd: string): RuntimeArtifactHealth;