feat(sdk): operate-verb parity with the MCP server (vault, env-patch, presign, pause/resume, wake)#23
Merged
Conversation
…ch, presign, pause/resume, wake
MCP PR #41 shipped 9 operate tools; the SDK covered only 3 of the 11
operate-verb surfaces (RotateCredentials, Capabilities, DeploymentEvents).
This adds the missing 8 methods, each verified against the MCP client and
api openapi.go/handlers for exact endpoint, payload, and envelope:
- SetVaultKey / RotateVaultKey PUT /api/v1/vault/:env/:key (+/rotate)
- UpdateDeployEnv PATCH /deploy/:id/env
- UpdateStackEnv PATCH /stacks/:slug/env
- PresignStorage POST /storage/:token/presign (broker mode,
token-as-credential, no bearer required)
- PauseResource / ResumeResource POST /api/v1/resources/:id/{pause,resume}
- WakeDeployment POST /deploy/:id/wake (surfaces the 501
scale_to_zero_disabled flag gate)
All 8 are quick mutations, so they run on the 30s read-path client (none
are synchronous provisions — the 120s provisioning deadline from #21 stays
scoped to the /*/new + deploy/stack create endpoints). Path segments are
url.PathEscape'd so vault keys with unusual characters round-trip. New
putJSON/patchJSON client helpers carry the same retry + APIError-envelope
semantics as the existing verbs.
Tests: httptest-based per-method suites asserting method, path, body wire
shape, response decode, validation branches, and one APIError branch each
(402 tier gate, 409 not_paused, 410 resource_inactive, 501 flag gate).
100% statement coverage on every new function; package total 98.5%.
README method tables + CHANGELOG updated; vault/env-patch removed from the
"not covered" list (also added the missing ProvisionStorage /
ProvisionWebhook rows).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mastermanas805
enabled auto-merge (squash)
June 10, 2026 19:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brings the Go SDK to operate-verb parity with the MCP server. MCP PR #41 shipped 9 operate tools; the SDK covered only 3 of the 11 operate-verb surfaces. This PR adds the missing 8 methods.
Every endpoint, payload, and response envelope was verified against the MCP client source (
mcp/src/client.ts@ origin/master) and cross-checked againstapi/internal/handlers/openapi.go+ the live handlers (vault.go,deploy.goUpdateEnv,deploy_wake.go,resource.goPause/Resume,storage_presign.go, stack UpdateEnv) — no guessed endpoints.Parity table
set_vault_keyPUT /api/v1/vault/:env/:keySetVaultKey✅rotate_vault_keyPOST /api/v1/vault/:env/:key/rotateRotateVaultKey✅update_deploy_envPATCH /deploy/:id/envUpdateDeployEnv✅update_stack_envPATCH /stacks/:slug/envUpdateStackEnv✅presign_storagePOST /storage/:token/presignPresignStorage✅pause_resourcePOST /api/v1/resources/:id/pausePauseResource✅resume_resourcePOST /api/v1/resources/:id/resumeResumeResource✅rotate_credentialsPOST /api/v1/resources/:id/rotate-credentialsRotateCredentials(pre-existing)wake_deploymentPOST /deploy/:id/wakeWakeDeployment✅get_capabilitiesGET /api/v1/capabilitiesCapabilities(#20)get_deployment_eventsGET /api/v1/deployments/:id/eventsDeploymentEvents(#22)src/index.ts@ origin/master)Design notes
/*/new+ deploy/stack create endpoints.*APIErrorfrom fix(errors): full agent-native APIError envelope + Capabilities() + live prod integration test #20, so callers can branch on the 402 pause tier-gate (withupgrade_url/agent_action), 409already_paused/not_paused/stack_deleting, 410resource_inactive, and 501scale_to_zero_disabled.url.PathEscape'd (a vault key containing/stays one segment — pinned by test).PresignStoragedeliberately works without an API key — broker mode, the token in the URL is the credential (matches MCP, which marks it not-requireAuth).putJSON/patchJSONclient helpers reuse the existing retry + envelope core (doWithHeaders).ProvisionStorage/ProvisionWebhookrows and pruned now-covered endpoints from the "not covered" list).Tests / coverage
go test ./... -race -count=1green locally.go tool cover -func);instantpackage total 98.5% (≥95% floor).putJSON/patchJSONmarshal-error branches pinned by direct internal tests so the diff-cover 100%-patch gate holds.🤖 Generated with Claude Code