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>
19 lines
819 B
TypeScript
19 lines
819 B
TypeScript
/**
|
|
* Formats a POST /api/plugins/sync SyncResult into the one-line toast
|
|
* summary the Plugins settings page shows after a sync
|
|
* (docs/specs/plugins/spec.md "Filesystem sideloading & sync"). Errors are
|
|
* surfaced separately (an inline `plugins-sync-errors` region) — they do
|
|
* not affect this summary line.
|
|
*/
|
|
import type { SyncResult } from "@/lib/types/plugins";
|
|
|
|
export function summarizeSyncResult(result: SyncResult): string {
|
|
const parts: string[] = [];
|
|
if (result.added.length > 0) parts.push(`${result.added.length} sideloaded`);
|
|
if (result.installed.length > 0) parts.push(`${result.installed.length} installed`);
|
|
if (result.missing.length > 0) parts.push(`${result.missing.length} missing`);
|
|
|
|
if (parts.length === 0) return "Everything up to date";
|
|
return `Sync: ${parts.join(", ")}`;
|
|
}
|