Repository navigation
fix: keep money tools off the MCP server by default; release mcp 0.2.1 and cli 0.4.2 - #33
Merged
Merged
Conversation
…1 and cli 0.4.2 @affitor/mcp 0.2.1 - affitor_track_sale and affitor_track_refund create real sales and reverse commissions, and were offered to every agent that loaded the server. They are now registered only with AFFITOR_MCP_WRITE=1; by default the server offers 5 tools, none of which moves money. - Every tool carries MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint); the two money tools are destructive. - testMode: on track_sale it posts the sale with additional_data.test_mode (an is_test sale, no commission; the SDK has no field for it, so the call is made directly like the verification chain); on track_lead it sends a test lead; on track_refund it is a dry run that calls nothing, because the API has no test refunds. affitor 0.4.2: version bump for the fixes on main since the 0.4.1 publish (15/06), including the secrets-file permission fix (#26). CHANGELOG.md added to both packages. npm version also corrected the stale workspace versions in package-lock.json (it still said cli 0.3.1, mcp 0.1.0). Nothing is published by this commit. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review r1 (codex): a test sale sent the real invoiceId as transaction_id, and the API's duplicate check does not skip test rows, so the real sale with that invoice would answer 409 and never create its commission. Test sales now use test_<invoiceId>. Empty invoiceId is refused on sale and refund (the tools declare idempotentHint). affitor_readiness is openWorldHint: the check fetches the brand's site. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review r2 (codex) P2: the stubs threw when called, and runCall turns a throw into isError, so the assertion passed even without the min(1) validation. The tests now count trackSale, trackRefund and trackTestSale calls (with and without testMode) and expect zero; dropping .min(1) fails 4 of them. 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.
Two releases, prepared but not published (publishing to npm is approved separately).
@affitor/mcp 0.2.1 — money tools off by default
affitor_track_salecreates a real sale and commission andaffitor_track_refundreverses one. In 0.2.0 both were offered to every agent that loaded the server, with no annotations, so an agent exploring its tools could move money.AFFITOR_MCP_WRITE=1readOnlyHint,destructiveHint,idempotentHint,openWorldHint; sale/refund destructivetestModeadditional_data.test_mode→is_testsale, no commission (direct POST, the SDK has no field for it); lead: test lead; refund: dry run, no call (the API has no test refunds)Behavior change: an agent that calls
affitor_track_saletoday must addAFFITOR_MCP_WRITE=1to the server'senv. Called out inCHANGELOG.mdand the README.affitor 0.4.2 — publish what main already has
npm still serves the 0.4.1 build from 15/06. Main has since gained the secrets-file permission + safe login URL fix (#26), key-rotation warnings and retired-key errors (#27, #28, #30), exit-code fixes (#29:
whoami --jsonlogged out now exits 1) and docs links (#32). This PR only bumps the version and addsCHANGELOG.md.npm versionalso fixedpackage-lock.json, whose workspace entries were stale (cli0.3.1, mcp0.1.0, recipes spec*).Verification
npm run build|lint|test --workspaces: build ok,tsc --noEmitclean, tests 19 + 113 + 16 passed.affitor_track_sale; with the flag, 7 tools and every tool annotated (sale/refund destructive, readiness/plan read-only);testModesale goes to the test path and never the realtrackSale; refund dry run calls nothing; lead sendstest_mode;postTestSalewire body (snake_case,additional_data.test_mode, no undefined keys) and its error shape.distprobed over stdio: server reports0.2.1; 5 tools by default, 7 withAFFITOR_MCP_WRITE=1.Follow-ups (not here)
One error envelope shared by API, CLI and MCP;
parseAsyncso a failed API call does not print a stack trace; answeringtools/listwithout a key;--dry-runeverywhere (see the CLI/MCP standards research).🤖 Generated with Claude Code