Files
WeKnora/pluginsdk/go.mod
wizardchen 39045543d1 feat(pluginsdk): extension protocol v1, Go SDK and conformance suite
A new module, github.com/Tencent/WeKnora/pluginsdk, so plugin authors import
the protocol without WeKnora's dependency tree:

- pluginapi: the protocol (envelope with context and the system / tenant /
  instance config scopes, error codes, NDJSON stream events, web search and
  connector messages, the host handshake line, HMAC request signing) plus
  openapi.yaml describing it for other languages.
- pluginsdk: build a plugin in Go. Register web search providers and
  connectors, then Serve: started by the plugin host it listens on the
  socket it is given, prints the handshake and accepts only the host token;
  run on its own it verifies signed requests. Envelope deadlines reach the
  handler's context, panics become internal errors, and fetches stream
  items and checkpoints.
- client: calls a plugin over a handshake socket or HTTPS, with typed
  transport errors; WeKnora's adapters and the conformance suite share it.
- conformance + cmd/weknora-plugin-conformance: checks a running plugin
  answers discovery, rejects unauthenticated and malformed calls, and
  answers every endpoint it claims with an output or a protocol error.

A test keeps openapi.yaml and the SDK routes in step. A new workflow builds
and tests the module on Linux, macOS and Windows; go-lint lints it.
2026-09-25 22:26:29 +08:00

4 lines
53 B
AMPL

module github.com/Tencent/WeKnora/pluginsdk
go 1.24