c53f699714
- go plugin backends ship as release tarballs (per-platform binaries, checksums) that kandev installs from url/upload or filesystem sideload+sync, then spawns and supervises via hashicorp/go-plugin (unix socket / loopback tcp+automtls) - strict typed grpc contract (kandev.plugin.v1): DeliverEvent/InvokeTool/HandleWebhook plus a capability-gated host service (state, secrets, emit); author sdk in pkg/pluginsdk; packaging cli in cmd/plugin-pack - native frontend bundles: window.registerKandevPlugin + registry/host loader with dynamic routes, nav items, slots and ws handlers; plugins settings page with install dialog, sync button and enable/disable/uninstall - gated behind the plugins feature flag (prod off, dev/e2e on); covered by unit and integration tests plus playwright e2e against a real packaged fixture plugin Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
30 lines
1001 B
TypeScript
30 lines
1001 B
TypeScript
"use client";
|
|
|
|
import { Badge } from "@kandev/ui/badge";
|
|
import type { PluginStatus } from "@/lib/types/plugins";
|
|
|
|
const STATUS_LABEL: Record<PluginStatus, string> = {
|
|
active: "Active",
|
|
error: "Error",
|
|
disabled: "Disabled",
|
|
registered: "Registered",
|
|
uninstalled: "Uninstalled",
|
|
};
|
|
|
|
// green=active, red=error, gray=disabled, amber=registered, per task-20 acceptance.
|
|
const STATUS_CLASS: Record<PluginStatus, string> = {
|
|
active: "border-green-500/40 bg-green-500/10 text-green-600 dark:text-green-400",
|
|
error: "border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-400",
|
|
disabled: "border-border bg-muted text-muted-foreground",
|
|
registered: "border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-400",
|
|
uninstalled: "border-border bg-muted text-muted-foreground",
|
|
};
|
|
|
|
export function PluginStatusBadge({ status }: { status: PluginStatus }) {
|
|
return (
|
|
<Badge variant="outline" className={STATUS_CLASS[status]}>
|
|
{STATUS_LABEL[status]}
|
|
</Badge>
|
|
);
|
|
}
|