{
  "name": "Cortex",
  "slug": "cortex",
  "description": "Unified workspace for CRM, Support, Community, and Knowledge Base",
  "version": "0.2.27",
  "app_type": "full",
  "route_prefix": "/cortex",
  "required_roles": ["support", "support_admin"],
  "routes": [
    "/",
    "/dashboard",
    "/crm",
    "/crm/accounts",
    "/crm/accounts/:id",
    "/crm/contacts",
    "/crm/deals",
    "/crm/deals/:id",
    "/crm/health",
    "/crm/activity",
    "/support",
    "/support/:id",
    "/support/:id/kb-review",
    "/community",
    "/kb",
    "/kb/editor",
    "/kb/ingestion",
    "/courses",
    "/intelligence",
    "/team",
    "/cil",
    "/cil/search",
    "/cil/agent",
    "/cil/:id/ingest",
    "/cil/:id/graph",
    "/cil/:id/dashboard",
    "/cil/:id/agent",
    "/cil/:id/chunks/:chunkId",
    "/cil/:id/files"
  ],
  "nav_items": [
    {
      "title": "Dashboard",
      "path": "/dashboard",
      "icon": "LayoutDashboard",
      "order": 1
    },
    {
      "title": "CRM",
      "path": "/crm",
      "icon": "Users",
      "order": 2,
      "children": [
        { "title": "Accounts", "path": "/crm/accounts" },
        { "title": "Contacts", "path": "/crm/contacts" },
        { "title": "Deals",    "path": "/crm/deals" },
        { "title": "Health",   "path": "/crm/health" },
        { "title": "Activity", "path": "/crm/activity" }
      ]
    },
    {
      "title": "Support",
      "path": "/support",
      "icon": "Headphones",
      "order": 3
    },
    {
      "title": "Community",
      "path": "/community",
      "icon": "Users",
      "order": 4
    },
    {
      "title": "Knowledge Base",
      "path": "/kb",
      "icon": "BookOpen",
      "order": 5
    },
    {
      "title": "Courses",
      "path": "/courses",
      "icon": "GraduationCap",
      "order": 6
    },
    {
      "title": "Intelligence",
      "path": "/intelligence",
      "icon": "Brain",
      "order": 7
    },
    {
      "title": "Team",
      "path": "/team",
      "icon": "UserPlus",
      "order": 8
    },
    {
      "title": "Code Intelligence",
      "path": "/cil",
      "icon": "FolderGit2",
      "order": 9
    }
  ],
  "features": ["crm", "support", "community", "kb", "courses", "intelligence", "cil"],
  "dependencies": ["items", "accounts", "pipelines", "integrations"],
  "prod_domain": "cortex.spine-framework.com",
  "entry_point": "./index.tsx",
  "sidebar_component": "./components/CortexSidebar.tsx",
  "seed": [
    { "file": "seed/roles.json",            "table": "roles",         "conflict": "app_id,slug" },
    { "file": "seed/types.json",            "table": "types",         "conflict": "app_id,kind,slug" },
    { "file": "seed/link-types.json",       "table": "link_types",    "conflict": "app_id,slug" },
    { "file": "seed/ai-agents.json",        "table": "ai_agents",     "conflict": "app_id,name",    "inject_app_id": true },
    { "file": "seed/prompt-configs.json",   "table": "prompt_configs","conflict": "app_id,slug",    "inject_app_id": true },
    { "file": "seed/pipelines.json",        "table": "pipelines",     "conflict": "app_id,name",    "inject_app_id": true },
    { "file": "seed/type_permissions.json", "table": "types",         "conflict": "kind,slug",      "inject_app_id": false, "permissions_patch": true }
  ],
  "registration": {
    "enabled": true,
    "default_role": "support",
    "redirect_path": "/cortex",
    "account_strategy": "existing",
    "target_account": "spine-system"
  }
}
