发布

  • [OPIK-6947] [FE] feat: pluggable FE plugin system + extract AI Spend to a private plugin

    frostbyte_neo 发布于 2026-06-16 08:01:00 +00:00

    Introduce a manifest-based FE plugin system and move the Cost Intelligence
    (AI Spend) feature out of the public repo into a private plugin that compiles
    into Opik via that system.

    Core (generic, no ai-spend specifics):

    • PluginsStore is the single source of truth: resolves the active plugin list
      (VITE_FE_PLUGINS, falling back to BUILD_MODE), eager-loads + gates plugin
      manifests, and exposes route + sidebar contributions alongside the existing
      component slots.
    • lib/plugins.ts is the contract only: PluginManifest type + definePlugin.
    • Generic LayoutProvider slot (replaces the ai-spend-named provider slot) and a
      sidebar-section registry; SideBar/WorkspaceGuard are ai-spend-agnostic.
    • preserveSymlinks so a symlinked plugin resolves @/ and node_modules against
      the host tree.
    • Leak prevention: .gitignore allowlist + check-public-fe-plugins.sh pre-commit
      guard so private plugin files can never be committed here.
    • dev-runner auto-detects a sibling opik-plugin-ai-spend checkout and symlinks
      it in; Dockerfile passes BUILD_PLUGINS through to VITE_FE_PLUGINS.

    The AI Spend pages, API, shared components, formatters, routes and sidebar now
    live in the private opik-plugin-ai-spend repo and are absent from public builds
    unless the plugin is present. Gating stays in comet via the core AiSpendContext.

    Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

    下载附件