Repository navigation
Conversation
Adds affitor_create_coupon, affitor_lock_coupon and affitor_get_coupon (coupon dogfood spec R7, unit G3). They use only AFFITOR_AGENT_KEY and appear only with AFFITOR_MCP_COUPONS=1; the legacy program-key tools and their AFFITOR_MCP_WRITE switch are unchanged, and neither key falls back to the other. The server can start with the agent key alone. Create and lock send the caller's idempotency_key as the Idempotency-Key header; a 202 or held body is returned as pending, errors carry only the status and stable code. registerTools keeps its signature; registerCouponTools is a new export. @affitor/mcp 0.2.4; server.json lists the new env vars and makes the program key optional. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Unit G3 of the BTO coupon dogfood spec (R7, Codex + Claude ĐẠT): three tools in
@affitor/mcpthat call the coupon API.affitor_create_coupon→POST /api/v1/coupons,affitor_lock_coupon→POST /api/v1/coupons/:id/lock,affitor_get_coupon→GET /api/v1/coupons/:id.AFFITOR_AGENT_KEY, only whenAFFITOR_MCP_COUPONS=1. The program-key tools (AFFITOR_API_KEY,AFFITOR_MCP_WRITE) are unchanged. Neither key ever falls back to the other; the server starts with the agent key alone.idempotency_keyis sent only as theIdempotency-Keyheader. Descriptions say to retry with the same key and payload; a 409 is never a reason to try a new key.error.codeand retry info.registerToolskeeps its signature;registerCouponToolsis a new export.package.json,server.jsonpackages[npm].version, CHANGELOG, README.server.jsonlistsAFFITOR_AGENT_KEY(secret) andAFFITOR_MCP_COUPONS, and makesAFFITOR_API_KEYoptional. The top-level registry version is untouched.Only the six G3 files change (plus the lockfile version line). No SDK change, no remote
/mcpchange, no publish.Draft until
The CMS coupon API unit (p492) passes review: these tools call that API. Nothing is published from this PR.
Checks
tsc --noEmit0 errors.tools/list: agent key + COUPONS=1 only → the 3 coupon tools; both keys + both flags → the 10 tools.🤖 Generated with Claude Code