diff --git a/README.md b/README.md index 9ae4ee2..d37ec15 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ What you get out of the box: - **Lifecycle-safe**: a linked worker is torn down cooperatively when its creating instance closes, and every worker is drained when the runtime shuts down. -> **Stability:** experimental (`v0.1.0`). The API may change before `v1.0.0`. +> **Stability:** experimental (`v0.0.0`). The API may change without notice. ## Installation @@ -70,21 +70,35 @@ go get github.com/wago-org/workers ``` The plugin requires two privileged capabilities - `instance.manage` (to fork and manage -worker instances) and `instance.lifecycle` (to observe parent shutdown). Grant them in -your `wago.json`: +worker instances) and `instance.lifecycle` (to observe parent shutdown). Select the +plugin in `wago.json`: ```json { - "dependencies": ["github.com/wago-org/workers"], - "plugins": [ - { - "name": "workers", + "$schema": "https://wago.sh/v0/schema.json", + "plugins": { + "wago-org/workers": "^0.0.0" + } +} +``` + +Exact versions and reviewed authority belong in `wago-lock.json`: + +```json +{ + "plugins": { + "wago-org/workers": { + "version": "0.0.0", + "requiredCapabilities": [ + "instance.manage", + "instance.lifecycle" + ], "capabilities": { "instance.manage": { "maxInstances": 64 }, "instance.lifecycle": true } } - ] + } } ``` @@ -348,8 +362,8 @@ go test -race ./... runtime-close drain). - **`register/`** - a blank-import shim that activates init-time registration for Wago-generated hosts. -- **`wago.json`** - the package manifest declaring the plugin and its required - capabilities. +- **`wago.json`** - the package manifest declaring plugin dependencies and + version constraints; reviewed capabilities live in `wago-lock.json`. Design notes: diff --git a/wago.json b/wago.json index 274822a..d689173 100644 --- a/wago.json +++ b/wago.json @@ -1,8 +1,7 @@ { - "$schema": "https://wago.sh/schema.json", - "schema": "wago/v1", + "$schema": "https://wago.sh/v0/schema.json", "module": "github.com/wago-org/workers", - "version": "0.1.0", + "version": "0.0.0", "name": "Wago Workers", "short": "workers", "description": "Bounded, composable WebAssembly worker primitives for Wago plugins.", @@ -10,11 +9,5 @@ "repository": "https://github.com/wago-org/workers", "homepage": "https://github.com/wago-org/workers#readme", "category": "concurrency", - "tags": ["workers", "concurrency", "webassembly"], - "plugins": [ - { - "name": "workers", - "capabilities": ["instance.manage", "instance.lifecycle"] - } - ] + "tags": ["workers", "concurrency", "webassembly"] } diff --git a/workers.go b/workers.go index ba8d09c..29ef47f 100644 --- a/workers.go +++ b/workers.go @@ -133,7 +133,7 @@ func New(opts ...Option) *Plugin { func (*Plugin) Info() wago.ExtensionInfo { return wago.ExtensionInfo{ - ID: "wago.workers", Name: "Workers", Version: "0.1.0", + ID: "wago.workers", Name: "Workers", Version: "0.0.0", Description: "Bounded, extension-scoped WebAssembly worker primitives", Stability: wago.Experimental, Repository: "https://github.com/wago-org/workers", License: "Apache-2.0", Tags: []string{"workers", "concurrency", "plugin-foundation"},