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>
37 lines
968 B
Go
37 lines
968 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
os.Exit(run(os.Args[1:]))
|
|
}
|
|
|
|
// run parses CLI flags and packs -dir into -out. Returns a process exit
|
|
// code (0 success, 1 packaging failure, 2 usage error).
|
|
func run(args []string) int {
|
|
fs := flag.NewFlagSet("plugin-pack", flag.ContinueOnError)
|
|
dir := fs.String("dir", "", "plugin package directory (must contain manifest.yaml)")
|
|
out := fs.String("out", "", "output tar.gz path")
|
|
platformOnly := fs.Bool("platform-only", false,
|
|
"include only the current host platform's server/ executable (smaller test packages)")
|
|
if err := fs.Parse(args); err != nil {
|
|
return 2
|
|
}
|
|
if *dir == "" || *out == "" {
|
|
fmt.Fprintln(os.Stderr, "plugin-pack: -dir and -out are required")
|
|
fs.Usage()
|
|
return 2
|
|
}
|
|
|
|
if err := packToFile(*dir, *out, *platformOnly); err != nil {
|
|
fmt.Fprintln(os.Stderr, "plugin-pack:", err)
|
|
return 1
|
|
}
|
|
_, _ = fmt.Fprintf(os.Stdout, "plugin-pack: wrote %s\n", *out)
|
|
return 0
|
|
}
|