import type { MigrateSource } from "../migrate/types"; import type { MCPServerConfig } from "../runtime-mcp/types"; export type GjcScope = "project" | "global"; export interface GjcScopePaths { scope: GjcScope; /** Root directory: `/.gjc` or `~/.gjc/agent` */ root: string; /** MCP config: `/mcp.json` */ mcpConfigPath: string; /** Skills directory: `/skills/` */ skillsDir: string; /** Hooks directory: `/hooks/` */ hooksDir: string; } export declare function resolveScopePaths(scope: GjcScope, projectCwd: string): GjcScopePaths; export declare function scopeLabel(scope: GjcScope): string; export type CustomizationSurface = "skills" | "hooks" | "mcps"; export declare const CUSTOMIZATION_SURFACES: readonly CustomizationSurface[]; export declare function surfaceLabel(surface: CustomizationSurface): string; export type ImportProduct = Exclude; export type ImportSourceScope = "project" | "user"; export declare const IMPORT_PRODUCTS: readonly ImportProduct[]; export declare const IMPORT_SOURCE_SCOPES: readonly ImportSourceScope[]; export declare function productLabel(product: ImportProduct): string; export declare function sourceScopeLabel(scope: ImportSourceScope): string; export declare function sourceConfigDir(product: ImportProduct, sourceScope: ImportSourceScope, projectCwd: string, homeDir: string): string; export type InventoryStatus = "enabled" | "disabled" | "invalid" | "shadowed" | "quarantined" | "imported" | "restart-required"; export interface InventoryRow { /** Stable row identity: `::` */ id: string; /** Surface kind */ surface: CustomizationSurface; /** Entry name */ name: string; /** Display name */ displayName: string; /** Effective status */ status: InventoryStatus; /** Provenance — which scope/convention discovered it */ provenance: string; /** Absolute discovered path — the exact identity mutations act on */ path: string; /** Scope that persists this row (project `.gjc` or global `.gjc`) */ scope: GjcScope; /** Short description (no secrets) */ description?: string; /** Diagnostics/remediation detail for invalid/conflicted rows */ diagnostics?: string[]; /** Redacted inspector payload (never contains secret values) */ raw: unknown; } export type ImportCollisionPolicy = "skip" | "rename" | "overwrite"; export type ImportEntryStatus = "add" | "conflict" | "unsupported" | "redacted" | "overwrite"; export interface ImportPreviewEntry { surface: CustomizationSurface; /** Source name in the foreign layout */ sourceName: string; /** Destination name in `.gjc` (may differ under rename policy) */ destinationName: string; status: ImportEntryStatus; /** Source path category (file, section, etc.) */ sourceCategory: string; /** Redacted description for the preview UI */ description: string; /** Reason for conflict/unsupported/redaction if applicable */ reason?: string; } export interface NormalizedPayload { mcp?: { name: string; config: MCPServerConfig; }; skill?: { slug: string; content: string; }; hook?: { phase: "pre" | "post"; fileName: string; content: string; }; } export interface ImportPreview { product: ImportProduct; sourceScope: ImportSourceScope; destinationScope: GjcScope; surfaces: CustomizationSurface[]; entries: ImportPreviewEntry[]; /** Aggregate warnings across all entries */ warnings: string[]; } /** * Validated apply plan produced alongside the redacted preview. `payloads` is * parallel to `preview.entries` (undefined for entries that carry no write). * It is deliberately separate from the preview DTO: the preview is safe to * serialize and display, while the plan holds full file contents and MCP * secret values and is only consumed by the apply transaction. */ export interface ImportPlan { preview: ImportPreview; payloads: readonly (NormalizedPayload | undefined)[]; } export type ImportOutcome = "imported" | "skipped" | "renamed" | "overwritten" | "failed"; export interface ImportResultEntry { surface: CustomizationSurface; sourceName: string; destinationName: string; outcome: ImportOutcome; reason?: string; } export interface ImportResult { entries: ImportResultEntry[]; /** True if all entries succeeded (imported/skipped/renamed/overwritten) */ ok: boolean; }