Files
kandev/apps/web/e2e/global-setup.ts
T
Kandev Agent c53f699714 feat: add plugin system with grpc runtime and native ui plugins
- 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>
2026-07-16 17:55:45 +01:00

33 lines
1.2 KiB
TypeScript

import fs from "node:fs";
import path from "node:path";
const BACKEND_DIR = path.resolve(__dirname, "../../../apps/backend");
const WEB_DIR = path.resolve(__dirname, "..");
export default function globalSetup() {
const kandevBin = path.join(BACKEND_DIR, "bin", "kandev");
const mockAgentBin = path.join(BACKEND_DIR, "bin", "mock-agent");
for (const bin of [kandevBin, mockAgentBin]) {
if (!fs.existsSync(bin)) {
throw new Error(`Required binary not found: ${bin}\nRun "make build-backend" first.`);
}
}
const spaIndex = path.join(WEB_DIR, "dist", "index.html");
if (!fs.existsSync(spaIndex)) {
throw new Error(`Vite web build not found: ${spaIndex}\nRun "make build-web" first.`);
}
// tests/plugins/plugins.spec.ts installs this package through the real
// upload UI. Like the binaries above, this only checks existence — not
// freshness — so rebuild after touching cmd/plugin-fixture (see
// apps/backend/Makefile's e2e-plugin-package target).
const pluginPackage = path.join(BACKEND_DIR, ".build", "kandev-plugin-e2e-1.0.0.tar.gz");
if (!fs.existsSync(pluginPackage)) {
throw new Error(
`E2E fixture plugin package not found: ${pluginPackage}\nRun "make -C apps/backend e2e-plugin-package" first.`,
);
}
}