Skip to content

The agent that grows with you

1.7 KB
Raw Blame
import { atom } from 'nanostores'

/** Which plugin component(s) a legacy deeplink pre-selects after probe. */
export type PluginInstallLegacyHint = 'agent' | 'desktop' | null

/** Future metrics (opt-in): install count + success/failure, per repo. */
export interface PluginInstallRequest {
  /** Empty opens repository entry; a supplied repo goes straight to inspection. */
  repo: string
  enable?: boolean
  force?: boolean
  legacyHint?: PluginInstallLegacyHint
  /** Curated-catalog pick: install the agent half by catalog name so the
   *  backend pins the reviewed SHA and records sidecar provenance. */
  catalogName?: string
  /** Catalog tier (official / verified / community), display only: an
   *  official pick is badged Official rather than Verified. */
  tier?: string
  /** The catalog pin (display only — the backend resolves it itself). */
  sha?: string
  /** Display name for the dialog heading (the catalog card's title); falls back to the catalog name. */
  title?: string
  /** One line on what the plugin does (the catalog description's first sentence). */
  summary?: string
  /** Capabilities profile scope the pick was made under; the agent half
   *  installs into THIS profile (null/undefined = active profile). */
  profile?: string | null
  /** The caller keeps the user where they are after a successful install (the setup chat's plugins card). */
  stayAfterInstall?: boolean
}

export const $pluginInstallRequest = atom<PluginInstallRequest | null>(null)

export function openPluginInstallRequest(request: PluginInstallRequest): void {
  $pluginInstallRequest.set(request)
}

export function closePluginInstallRequest(): void {
  $pluginInstallRequest.set(null)
}