/**
 * Unified VerticalPack registry.
 *
 * A "vertical" is a use-case domain advertised on the marketing site
 * (`/use-cases`, formerly `/verticals`) and used as the unit of activation.
 * Each `VerticalPack` may bind to:
 *
 *   - a sandbox manifest under `tests/fixtures/sandbox/verticals/<slug>/manifest.json`
 *     replayed when a hosted sandbox session boots with `pack_id=<slug>`.
 *   - a schema manifest under `src/services/verticals/schemas/<slug>.json` that
 *     extends `ENTITY_SCHEMAS` with vertical-specific entity types when the pack
 *     is installed (via `installVerticalPack(slug)` or activation Stage 0.5).
 *
 * Both bindings are optional: `crm` ships with both, while `personal-agent`
 * has only a sandbox manifest because all of its entity types are already
 * baseline (`agent_session`, `agent_task`, `agent_outcome`, `agent_artifact`)
 * plus one new schema (`tool_handoff`) that lives in its schema manifest.
 *
 * ## Naming rules
 *
 * - Slugs are stable, kebab-case, and used in URLs, manifest paths, and
 *   `EntitySchemaMetadata.verticals`. Renaming a slug requires a 301 redirect
 *   and a code-search; prefer adding aliases over renaming.
 * - Chip labels are sentence case (e.g. "Customer development", "Personal life")
 *   matching the public-facing copy on `VerticalsIndexPage`.
 * - The internal vocabulary is "vertical" / `VerticalPack`; the public surface
 *   uses "use case". The split is intentional and matches industry practice
 *   (cf. confirmed trade-off #9 in the v0.8.0 release plan).
 *
 * ## Natural-minimum rule (trade-off #7)
 *
 * Each vertical declares a "natural minimum" entity-type count, not a fixed
 * floor. Six verticals were expanded from 4 to 5 entity types because a fifth
 * is genuinely native to the domain:
 *
 *   - compliance + finding
 *   - diligence + ic_memo
 *   - cases + ruling
 *   - healthcare + medication
 *   - government + appeal
 *   - logistics + exception
 *
 * Six verticals stay at 4 (crm, contracts, portfolio, financial-ops,
 * procurement, customer-ops) because a fifth would be forced. Four verticals
 * already ship 5+ entries (agent-auth, personal-data, trading, crypto-engineering).
 * Future PRs should resist inflating these counts artificially; any expansion
 * MUST justify the new entity type by domain-native usage and not by symmetry.
 *
 * ## Cross-vertical entity sharing
 *
 * Some entity types appear in multiple packs by design — e.g. `interview` and
 * `meeting_transcription` are equally native to `customer-development` and
 * `meetings`. The schema registry de-dupes on `entity_type`, so multiple packs
 * may declare the same type. Their schema definitions MUST be compatible
 * (identical canonical_name_fields, compatible field shapes); install lifecycle
 * trusts the first registration and warns on conflicts during the second.
 *
 * ## Personal-agent meta-vertical
 *
 * The `personal-agent` slug is a meta-vertical: it captures *how* the agent
 * stack itself runs across tools (Claude Code, Cursor, Codex, OpenCode), not
 * *what* the operator works on per domain. It is offered as a Stage 0.5
 * fallback only when filesystem signals show multi-tool agent config but no
 * domain vertical scores above the confidence threshold. It is never installed
 * by default and never installed in enterprise deployments where a specialized
 * vertical was selected.
 */
export const VERTICAL_SLUGS = [
    "compliance",
    "crm",
    "contracts",
    "diligence",
    "portfolio",
    "cases",
    "financial-ops",
    "procurement",
    "agent-auth",
    "healthcare",
    "government",
    "customer-ops",
    "logistics",
    "personal-data",
    "trading",
    "crypto-engineering",
    "engineering",
    "customer-development",
    "content-ops",
    "meetings",
    "personal-agent",
];
const sandboxManifest = (slug) => `tests/fixtures/sandbox/verticals/${slug}/manifest.json`;
const schemaManifest = (slug) => `src/services/verticals/schemas/${slug}.json`;
export const VERTICAL_PACKS = [
    {
        slug: "compliance",
        label: "Compliance",
        title: "Vendor risk & compliance",
        tagline: "Version control for vendor risk profiles",
        entityExamples: ["vendor", "assessment", "screening", "questionnaire", "finding"],
        thenQuestion: "What did we know about this vendor when we approved them?",
        icon: "ShieldCheck",
        accent: "text-amber-600 dark:text-amber-400",
        accentBg: "bg-amber-500/5",
        accentBorder: "border-amber-500/20",
        marketingHref: "/compliance",
        schema_manifest_path: schemaManifest("compliance"),
    },
    {
        slug: "crm",
        label: "CRM",
        title: "Next-generation CRM",
        tagline: "The state layer for AI-native CRM platforms",
        entityExamples: ["contact", "deal", "account", "engagement"],
        thenQuestion: "Who should I loop in on the Meridian renewal?",
        icon: "Building2",
        accent: "text-emerald-600 dark:text-emerald-400",
        accentBg: "bg-emerald-500/5",
        accentBorder: "border-emerald-500/20",
        marketingHref: "/crm",
        sandbox_manifest_path: sandboxManifest("crm"),
        schema_manifest_path: schemaManifest("crm"),
    },
    {
        slug: "contracts",
        label: "Contracts",
        title: "Contract lifecycle management",
        tagline: "Version control for every clause, amendment, and obligation",
        entityExamples: ["contract", "clause", "amendment", "obligation"],
        thenQuestion: "What were the terms when we signed? What changed in amendment 3?",
        icon: "FileText",
        accent: "text-indigo-600 dark:text-indigo-400",
        accentBg: "bg-indigo-500/5",
        accentBorder: "border-indigo-500/20",
        marketingHref: "/contracts",
        schema_manifest_path: schemaManifest("contracts"),
    },
    {
        slug: "diligence",
        label: "Due diligence",
        title: "M&A and investment diligence",
        tagline: "Know exactly what was known when the decision was made",
        entityExamples: ["target_company", "finding", "red_flag", "assessment", "ic_memo"],
        thenQuestion: "What did we know about the target when the IC voted?",
        icon: "Search",
        accent: "text-sky-600 dark:text-sky-400",
        accentBg: "bg-sky-500/5",
        accentBorder: "border-sky-500/20",
        marketingHref: "/diligence",
        schema_manifest_path: schemaManifest("diligence"),
    },
    {
        slug: "portfolio",
        label: "Portfolio",
        title: "Portfolio monitoring",
        tagline: "Versioned state for every portfolio company and LP commitment",
        entityExamples: ["portfolio_company", "valuation", "milestone", "lp_commitment"],
        thenQuestion: "What was the valuation when we made the follow-on?",
        icon: "TrendingUp",
        accent: "text-violet-600 dark:text-violet-400",
        accentBg: "bg-violet-500/5",
        accentBorder: "border-violet-500/20",
        marketingHref: "/portfolio",
        schema_manifest_path: schemaManifest("portfolio"),
    },
    {
        slug: "cases",
        label: "Case management",
        title: "Legal & investigation cases",
        tagline: "Reconstruct what was known at any point in a case timeline",
        entityExamples: ["case", "evidence", "filing", "party", "ruling"],
        thenQuestion: "What evidence was available when we filed the motion?",
        icon: "Gavel",
        accent: "text-cyan-600 dark:text-cyan-400",
        accentBg: "bg-cyan-500/5",
        accentBorder: "border-cyan-500/20",
        marketingHref: "/cases",
        schema_manifest_path: schemaManifest("cases"),
    },
    {
        slug: "financial-ops",
        label: "Financial ops",
        title: "Financial operations & reconciliation",
        tagline: "Deterministic state for every ledger entry and reconciliation",
        entityExamples: ["transaction", "reconciliation", "ledger", "invoice"],
        thenQuestion: "Did this liability exist in our books on the audit date?",
        icon: "DollarSign",
        accent: "text-teal-600 dark:text-teal-400",
        accentBg: "bg-teal-500/5",
        accentBorder: "border-teal-500/20",
        marketingHref: "/financial-ops",
        sandbox_manifest_path: sandboxManifest("financial-ops"),
        schema_manifest_path: schemaManifest("financial-ops"),
    },
    {
        slug: "procurement",
        label: "Procurement",
        title: "Procurement & sourcing",
        tagline: "Full audit trail for bids, approvals, and supplier decisions",
        entityExamples: ["supplier", "bid", "purchase_order", "approval"],
        thenQuestion: "What were the competing bids when we selected this supplier?",
        icon: "Briefcase",
        accent: "text-orange-600 dark:text-orange-400",
        accentBg: "bg-orange-500/5",
        accentBorder: "border-orange-500/20",
        marketingHref: "/procurement",
        schema_manifest_path: schemaManifest("procurement"),
    },
    {
        slug: "agent-auth",
        label: "Agent auth",
        title: "Agent authorization & governance",
        tagline: "Versioned policy state, consent timelines, delegation provenance, and DAO governance lineage",
        entityExamples: [
            "auth_decision",
            "consent_grant",
            "delegation_chain",
            "policy_evaluation",
            "governance_vote",
        ],
        thenQuestion: "Was this agent authorized for this action at this time, and under which policy or governance decision?",
        icon: "Shield",
        accent: "text-blue-600 dark:text-blue-400",
        accentBg: "bg-blue-500/5",
        accentBorder: "border-blue-500/20",
        marketingHref: "/agent-auth",
        sandbox_manifest_path: sandboxManifest("agent-auth"),
        schema_manifest_path: schemaManifest("agent-auth"),
    },
    {
        slug: "healthcare",
        label: "Healthcare",
        title: "Healthcare operations",
        tagline: "Versioned clinical state, authorization lifecycles, and care plan lineage",
        entityExamples: ["patient", "encounter", "care_plan", "authorization", "medication"],
        thenQuestion: "What was known about this patient when the agent recommended the dosage change?",
        icon: "Heart",
        accent: "text-rose-600 dark:text-rose-400",
        accentBg: "bg-rose-500/5",
        accentBorder: "border-rose-500/20",
        marketingHref: "/healthcare",
        schema_manifest_path: schemaManifest("healthcare"),
    },
    {
        slug: "government",
        label: "Government",
        title: "Public sector & GovTech",
        tagline: "Policy-version-bound determinations and inter-agency evidence provenance",
        entityExamples: ["determination", "policy_version", "applicant", "case_record", "appeal"],
        thenQuestion: "Under which policy version was this eligibility determined?",
        icon: "Landmark",
        accent: "text-slate-600 dark:text-slate-400",
        accentBg: "bg-slate-500/5",
        accentBorder: "border-slate-500/20",
        marketingHref: "/government",
        schema_manifest_path: schemaManifest("government"),
    },
    {
        slug: "customer-ops",
        label: "Customer ops",
        title: "Support & CX operations",
        tagline: "Routing rationale, escalation chains, and interaction-level provenance",
        entityExamples: ["ticket", "routing_decision", "interaction", "escalation"],
        thenQuestion: "Why was this ticket routed to billing instead of infrastructure?",
        icon: "Headphones",
        accent: "text-pink-600 dark:text-pink-400",
        accentBg: "bg-pink-500/5",
        accentBorder: "border-pink-500/20",
        marketingHref: "/customer-ops",
        schema_manifest_path: schemaManifest("customer-ops"),
    },
    {
        slug: "logistics",
        label: "Logistics",
        title: "Logistics & supply chain",
        tagline: "Constraint snapshots, routing provenance, and inventory position history",
        entityExamples: ["shipment", "route_decision", "inventory_snapshot", "carrier_commitment", "exception"],
        thenQuestion: "What constraints did the routing agent evaluate when it chose this carrier?",
        icon: "Truck",
        accent: "text-lime-600 dark:text-lime-400",
        accentBg: "bg-lime-500/5",
        accentBorder: "border-lime-500/20",
        marketingHref: "/logistics",
        schema_manifest_path: schemaManifest("logistics"),
    },
    {
        slug: "personal-data",
        label: "Personal life",
        title: "Personal life data",
        tagline: "Versioned memory for health, finance, habits, and goals across every AI tool",
        entityExamples: ["workout", "transaction", "health_metric", "habit", "goal"],
        thenQuestion: "How has my bench press progressed, and what was my spending rate when I bought the car?",
        icon: "User",
        accent: "text-violet-600 dark:text-violet-400",
        accentBg: "bg-violet-500/5",
        accentBorder: "border-violet-500/20",
        marketingHref: "/personal-data",
        sandbox_manifest_path: sandboxManifest("personal-data"),
        schema_manifest_path: schemaManifest("personal-data"),
    },
    {
        slug: "trading",
        label: "Trading",
        title: "Autonomous trading agents",
        tagline: "Reconstructable decision chains for multi-agent trading systems — including the trades the agent passed on",
        entityExamples: [
            "trade_decision",
            "pass_decision",
            "strategy",
            "analysis",
            "risk_state",
            "portfolio_snapshot",
        ],
        thenQuestion: "Why did the agent pass on this trade, and what did each analyst recommend when it did?",
        icon: "TrendingUp",
        accent: "text-emerald-600 dark:text-emerald-400",
        accentBg: "bg-emerald-500/5",
        accentBorder: "border-emerald-500/20",
        marketingHref: "/trading",
        schema_manifest_path: schemaManifest("trading"),
    },
    {
        slug: "crypto-engineering",
        label: "Crypto engineering",
        title: "AI-assisted crypto & security-sensitive engineering",
        tagline: "Agent-session replay, review-cost reduction, and bounty-report provenance for codebases with a real stakes ceiling",
        entityExamples: ["agent_session", "commit", "review", "security_finding", "bounty_report"],
        thenQuestion: "Which agent wrote this commit, what did it verify, what did it skip, and why?",
        icon: "Cpu",
        accent: "text-orange-600 dark:text-orange-400",
        accentBg: "bg-orange-500/5",
        accentBorder: "border-orange-500/20",
        marketingHref: "/crypto-engineering",
        schema_manifest_path: schemaManifest("crypto-engineering"),
    },
    {
        slug: "engineering",
        label: "Product engineering",
        title: "AI-assisted product engineering",
        tagline: "Bug, spec, commit, deploy, and CI provenance for teams shipping faster than review can keep up",
        entityExamples: ["bug_report", "feature_request", "code_change", "deployment", "ci_run"],
        thenQuestion: "What did we know, what was deployed, and which agent or human authored each part — at the moment the bug shipped?",
        icon: "Code2",
        accent: "text-slate-600 dark:text-slate-300",
        accentBg: "bg-slate-500/5",
        accentBorder: "border-slate-500/20",
        marketingHref: "/engineering",
        sandbox_manifest_path: sandboxManifest("engineering"),
        schema_manifest_path: schemaManifest("engineering"),
    },
    {
        slug: "customer-development",
        label: "Customer development",
        title: "Customer development & user research",
        tagline: "Versioned evaluator state, persona-vs-evidence audits, and cross-interview objection clustering",
        entityExamples: ["interview", "feedback_finding", "persona", "objection", "referral"],
        thenQuestion: "What did this evaluator actually believe in February — and which observations changed their mind?",
        icon: "MessageSquareQuote",
        accent: "text-rose-600 dark:text-rose-400",
        accentBg: "bg-rose-500/5",
        accentBorder: "border-rose-500/20",
        marketingHref: "/customer-development",
        sandbox_manifest_path: sandboxManifest("customer-development"),
        schema_manifest_path: schemaManifest("customer-development"),
        aliases: ["research"],
    },
    {
        slug: "content-ops",
        label: "Content ops",
        title: "Content & social-media operations",
        tagline: "Versioned drafts, cross-platform schedule reconciliation, and audience signals wired into the next draft",
        entityExamples: [
            "post_idea",
            "post",
            "social_share_draft",
            "social_share_schedule",
            "audience_signal",
        ],
        thenQuestion: "What was the canonical draft, what versions did we ship to which platforms, and which audience replies should drive the next iteration?",
        icon: "Megaphone",
        accent: "text-pink-600 dark:text-pink-400",
        accentBg: "bg-pink-500/5",
        accentBorder: "border-pink-500/20",
        marketingHref: "/content-ops",
        sandbox_manifest_path: sandboxManifest("content-ops"),
        schema_manifest_path: schemaManifest("content-ops"),
    },
    {
        slug: "meetings",
        label: "Meetings",
        title: "Meeting-driven CRM & agent ingest",
        tagline: "Transcript-to-graph ingest with participant resolution, observation attachment, and follow-up extraction",
        entityExamples: [
            "meeting_transcription",
            "contact",
            "customer_development_note",
            "outreach_interaction",
            "task",
        ],
        thenQuestion: "Who was on this call, what did each of them say, what are the open follow-ups, and what does this update about everyone's state?",
        icon: "Mic2",
        accent: "text-indigo-600 dark:text-indigo-400",
        accentBg: "bg-indigo-500/5",
        accentBorder: "border-indigo-500/20",
        marketingHref: "/meetings",
        sandbox_manifest_path: sandboxManifest("meetings"),
        schema_manifest_path: schemaManifest("meetings"),
        aliases: ["meeting-ingest"],
    },
    {
        slug: "personal-agent",
        label: "Personal agent",
        title: "Personal agent operator",
        tagline: "Cross-tool memory for the agent stack you run on yourself — Claude Code, Cursor, Codex, ChatGPT — without the re-prompting tax",
        entityExamples: ["agent_session", "agent_task", "agent_outcome", "agent_artifact", "tool_handoff"],
        thenQuestion: "What did each of my agents do across tools yesterday, and which decisions are still acting on stale state?",
        icon: "Workflow",
        accent: "text-blue-600 dark:text-blue-400",
        accentBg: "bg-blue-500/5",
        accentBorder: "border-blue-500/20",
        marketingHref: "/personal-agent",
        sandbox_manifest_path: sandboxManifest("personal-agent"),
        schema_manifest_path: schemaManifest("personal-agent"),
        meta_fallback: true,
    },
];
/** Default vertical when no slug is provided. */
export const DEFAULT_VERTICAL_SLUG = "personal-agent";
/** Lookup a pack by slug or alias. Returns null when not found. */
export function findVerticalPack(slug) {
    if (!slug)
        return null;
    const needle = slug.trim().toLowerCase();
    for (const pack of VERTICAL_PACKS) {
        if (pack.slug === needle)
            return pack;
        if (pack.aliases?.includes(needle))
            return pack;
    }
    return null;
}
/** Lookup a pack by slug or alias; throws when not found. */
export function resolveVerticalPack(slug) {
    const pack = findVerticalPack(slug);
    if (!pack) {
        throw new Error(`[verticals] unknown slug '${slug}'`);
    }
    return pack;
}
/** All packs with a `schema_manifest_path` (i.e. installable schema overlays). */
export function listInstallablePacks() {
    return VERTICAL_PACKS.filter((p) => Boolean(p.schema_manifest_path));
}
/** All packs with a `sandbox_manifest_path` (i.e. seedable in the hosted sandbox). */
export function listSeedablePacks() {
    return VERTICAL_PACKS.filter((p) => Boolean(p.sandbox_manifest_path));
}
//# sourceMappingURL=registry.js.map