From cda6098db2e10151809194dbac0c2bbe5bd8e27d Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Mon, 1 Jun 2026 14:10:13 -0400 Subject: [PATCH 1/4] chore: apply plugin version discipline --- .github/workflows/release.yml | 25 +++++++++++++++++++++++++ .goreleaser.yml | 28 +++++++++++++++++++++++++++- cmd/workflow-plugin-agent/main.go | 12 ++++++++++++ plugin.go | 21 ++++++++++++++++----- plugin.json | 11 ++++++++--- version.go | 4 ++++ 6 files changed, 92 insertions(+), 9 deletions(-) create mode 100644 cmd/workflow-plugin-agent/main.go create mode 100644 version.go diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 963cc4c..98f4af4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,15 @@ jobs: - name: Configure git for private modules run: git config --global url."https://${{ secrets.RELEASES_TOKEN }}@github.com/".insteadOf "https://github.com/" + - name: Install wfctl v0.63.2 + run: | + mkdir -p "${RUNNER_TEMP}/wfctl-bin" + curl -sSfL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -o "${RUNNER_TEMP}/wfctl-bin/wfctl" \ + "https://github.com/GoCodeAlone/workflow/releases/download/v0.63.2/wfctl-linux-amd64" + chmod +x "${RUNNER_TEMP}/wfctl-bin/wfctl" + - name: Validate plugin contract for publish (pre-build) + run: "${{ runner.temp }}/wfctl-bin/wfctl plugin validate-contract --for-publish --tag ${{ github.ref_name }} ." - name: Run GoReleaser uses: goreleaser/goreleaser-action@v7 with: @@ -34,6 +43,22 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.RELEASES_TOKEN }} + # workflow#765: runtime truth-check via plugin verify-capabilities. + - name: Verify capabilities (runtime truth-check) + run: | + RUNNER_ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/') + BIN=$(jq -r --arg arch "$RUNNER_ARCH" \ + '[.[] | select(.type=="Binary" and .goos=="linux" and .goarch==$arch and (.name|startswith("workflow-plugin-agent")))] | .[0].path // ""' \ + dist/artifacts.json) + if [ -z "$BIN" ] || [ "$BIN" = "null" ]; then + echo "::warning::No matching linux/$RUNNER_ARCH binary in dist/artifacts.json; skipping verify-capabilities" + jq '.[] | {name, type, goos, goarch, path}' dist/artifacts.json + exit 0 + fi + "${{ runner.temp }}/wfctl-bin/wfctl" plugin verify-capabilities --binary "$BIN" . + - name: Verify shipped plugin.json carries tag (post-build) + run: | + "${{ runner.temp }}/wfctl-bin/wfctl" plugin validate-contract --for-publish --tag ${{ github.ref_name }} --release-dir . . publish-release: if: startsWith(github.ref, 'refs/tags/v') diff --git a/.goreleaser.yml b/.goreleaser.yml index 914cb7a..d2f5f80 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,7 +1,33 @@ version: 2 +before: + hooks: + - go mod tidy + - "sed -i.bak 's/\"version\": \".*\"/\"version\": \"{{ .Version }}\"/' plugin.json && rm -f plugin.json.bak" + builds: - - skip: true + - id: workflow-plugin-agent + main: ./cmd/workflow-plugin-agent + binary: workflow-plugin-agent + env: + - CGO_ENABLED=0 + - GOPRIVATE=github.com/GoCodeAlone/* + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + ldflags: + - -s -w -X github.com/GoCodeAlone/workflow-plugin-agent.Version={{.Version}} + +archives: + - formats: [tar.gz] + name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}" + files: + - plugin.json + - plugin.contracts.json + - LICENSE changelog: sort: asc diff --git a/cmd/workflow-plugin-agent/main.go b/cmd/workflow-plugin-agent/main.go new file mode 100644 index 0000000..853ccfa --- /dev/null +++ b/cmd/workflow-plugin-agent/main.go @@ -0,0 +1,12 @@ +// Command workflow-plugin-agent hosts the agent plugin over the workflow +// external-plugin protocol. +package main + +import ( + agent "github.com/GoCodeAlone/workflow-plugin-agent" + sdk "github.com/GoCodeAlone/workflow/plugin/external/sdk" +) + +func main() { + sdk.Serve(agent.New(), sdk.WithBuildVersion(sdk.ResolveBuildVersion(agent.Version))) +} diff --git a/plugin.go b/plugin.go index 644f21a..0c54f23 100644 --- a/plugin.go +++ b/plugin.go @@ -10,6 +10,7 @@ package agent import ( "github.com/GoCodeAlone/workflow/capability" "github.com/GoCodeAlone/workflow/plugin" + sdk "github.com/GoCodeAlone/workflow/plugin/external/sdk" "github.com/GoCodeAlone/workflow/schema" ) @@ -57,9 +58,9 @@ func agentStepSchemas() []*schema.StepSchema { ReadKeys: []string{"alias"}, }, { - Type: "step.provider_models", - Plugin: "workflow-plugin-agent", - Description: "Lists available models from an AI provider API, accepting provider credentials from the pipeline context.", + Type: "step.provider_models", + Plugin: "workflow-plugin-agent", + Description: "Lists available models from an AI provider API, accepting provider credentials from the pipeline context.", ConfigFields: []schema.ConfigFieldDef{}, Outputs: []schema.StepOutputDef{ {Key: "success", Type: "boolean", Description: "true when model listing succeeded"}, @@ -101,12 +102,12 @@ func New() *AgentPlugin { BaseEnginePlugin: plugin.BaseEnginePlugin{ BaseNativePlugin: plugin.BaseNativePlugin{ PluginName: "agent", - PluginVersion: "0.1.0", + PluginVersion: "0.0.0", PluginDescription: "AI agent primitives for workflow apps", }, Manifest: plugin.PluginManifest{ Name: "workflow-plugin-agent", - Version: "0.1.0", + Version: "0.0.0", Author: "GoCodeAlone", Description: "AI agent primitives for workflow apps", ModuleTypes: []string{"agent.provider"}, @@ -118,6 +119,16 @@ func New() *AgentPlugin { } } +// Manifest implements sdk.PluginProvider for external plugin hosting. +func (p *AgentPlugin) Manifest() sdk.PluginManifest { + return sdk.PluginManifest{ + Name: "workflow-plugin-agent", + Version: "0.0.0", + Author: "GoCodeAlone", + Description: "AI agent primitives for workflow apps", + } +} + // Capabilities returns the capability contracts for this plugin. func (p *AgentPlugin) Capabilities() []capability.Contract { return nil diff --git a/plugin.json b/plugin.json index 2f2ac3d..c17f11f 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "workflow-plugin-agent", - "version": "0.9.2", + "version": "0.0.0", "description": "AI agent primitives for workflow apps", "author": "GoCodeAlone", "license": "Proprietary", @@ -10,8 +10,13 @@ "private": true, "capabilities": { "configProvider": false, - "moduleTypes": ["agent.provider"], - "stepTypes": ["step.provider_models", "step.model_pull"], + "moduleTypes": [ + "agent.provider" + ], + "stepTypes": [ + "step.provider_models", + "step.model_pull" + ], "triggerTypes": [] }, "strictContracts": { diff --git a/version.go b/version.go new file mode 100644 index 0000000..7ec439a --- /dev/null +++ b/version.go @@ -0,0 +1,4 @@ +package agent + +// Version is injected by GoReleaser for release builds. +var Version = "dev" From d743e8bba90f1f63ff47f022aaddce23252cdddc Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Mon, 1 Jun 2026 14:17:52 -0400 Subject: [PATCH 2/4] fix: harden release validation quoting --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 98f4af4..04faf8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: "https://github.com/GoCodeAlone/workflow/releases/download/v0.63.2/wfctl-linux-amd64" chmod +x "${RUNNER_TEMP}/wfctl-bin/wfctl" - name: Validate plugin contract for publish (pre-build) - run: "${{ runner.temp }}/wfctl-bin/wfctl plugin validate-contract --for-publish --tag ${{ github.ref_name }} ." + run: "${{ runner.temp }}/wfctl-bin/wfctl plugin validate-contract --for-publish --tag "${{ github.ref_name }}" ." - name: Run GoReleaser uses: goreleaser/goreleaser-action@v7 with: @@ -58,7 +58,7 @@ jobs: "${{ runner.temp }}/wfctl-bin/wfctl" plugin verify-capabilities --binary "$BIN" . - name: Verify shipped plugin.json carries tag (post-build) run: | - "${{ runner.temp }}/wfctl-bin/wfctl" plugin validate-contract --for-publish --tag ${{ github.ref_name }} --release-dir . . + "${{ runner.temp }}/wfctl-bin/wfctl" plugin validate-contract --for-publish --tag "${{ github.ref_name }}" --release-dir . . publish-release: if: startsWith(github.ref, 'refs/tags/v') From 8cf70ec559db977e6891ed3f812d7895acf99236 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Mon, 1 Jun 2026 14:19:47 -0400 Subject: [PATCH 3/4] fix: share agent release version sentinel --- plugin.go | 6 +++--- version.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin.go b/plugin.go index 0c54f23..0e7283b 100644 --- a/plugin.go +++ b/plugin.go @@ -102,12 +102,12 @@ func New() *AgentPlugin { BaseEnginePlugin: plugin.BaseEnginePlugin{ BaseNativePlugin: plugin.BaseNativePlugin{ PluginName: "agent", - PluginVersion: "0.0.0", + PluginVersion: Version, PluginDescription: "AI agent primitives for workflow apps", }, Manifest: plugin.PluginManifest{ Name: "workflow-plugin-agent", - Version: "0.0.0", + Version: Version, Author: "GoCodeAlone", Description: "AI agent primitives for workflow apps", ModuleTypes: []string{"agent.provider"}, @@ -123,7 +123,7 @@ func New() *AgentPlugin { func (p *AgentPlugin) Manifest() sdk.PluginManifest { return sdk.PluginManifest{ Name: "workflow-plugin-agent", - Version: "0.0.0", + Version: Version, Author: "GoCodeAlone", Description: "AI agent primitives for workflow apps", } diff --git a/version.go b/version.go index 7ec439a..1fb35f2 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package agent -// Version is injected by GoReleaser for release builds. -var Version = "dev" +// Version is the source-tree sentinel and is injected by GoReleaser for release builds. +var Version = "0.0.0" From f5763812992d0481503af09645166855041b7e20 Mon Sep 17 00:00:00 2001 From: Jon Langevin Date: Mon, 1 Jun 2026 14:22:54 -0400 Subject: [PATCH 4/4] fix: use block release validation command --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04faf8c..1add625 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,8 @@ jobs: "https://github.com/GoCodeAlone/workflow/releases/download/v0.63.2/wfctl-linux-amd64" chmod +x "${RUNNER_TEMP}/wfctl-bin/wfctl" - name: Validate plugin contract for publish (pre-build) - run: "${{ runner.temp }}/wfctl-bin/wfctl plugin validate-contract --for-publish --tag "${{ github.ref_name }}" ." + run: | + "${{ runner.temp }}/wfctl-bin/wfctl" plugin validate-contract --for-publish --tag "${{ github.ref_name }}" . - name: Run GoReleaser uses: goreleaser/goreleaser-action@v7 with: