Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

1.0 KB
Raw Blame
// Where a Model Hub route lands, by capability. Pure so the redirect contract can be
// asserted without mounting the router (see ModelHubCapabilityGate.test.tsx).

import { SETTINGS_LANDING_PATH } from '@/lib/adminNavigation';

export const MODEL_HUB_SETTINGS_PATH = '/settings/models';
export const MODEL_HUB_DISABLED_REDIRECT = '/settings/backends';

export const modelHubDisabledRedirect = (overSetup: boolean): string =>
  overSetup ? SETTINGS_LANDING_PATH : MODEL_HUB_DISABLED_REDIRECT;

export const modelHubRouteTarget = (
  requestedPath: string,
  enabled: boolean,
  overSetup = false,
): string => enabled ? requestedPath : modelHubDisabledRedirect(overSetup);

// Opens the Model Hub with one backend's model catalog dialog in front, so a
// model picker can send the user straight to where its list is edited.
export const MODEL_HUB_MANAGE_PARAM = 'manage';

export const modelHubCatalogPath = (backend: string): string =>
  `${MODEL_HUB_SETTINGS_PATH}?${MODEL_HUB_MANAGE_PARAM}=${encodeURIComponent(backend)}`;