build(deps): upgrade to TOON v4 - #130
Merged
Merged
Conversation
Replace @modelcontextprotocol/sdk with @modelcontextprotocol/server and @modelcontextprotocol/client, and serve stdio through the serveStdio factory. The factory runs once per connection, after the opening exchange chooses the protocol era, so the process-level signal handlers and the error callback move out of the ApexLogServer constructor into a new exported runStdioServer. legacy: "serve" is the SDK default and is stated explicitly, because dropping the 2025-era clients would be a second breaking change. The SDK no longer emits execution.taskSupport on a tool definition, so every definition costs 9 tokens less. No response changed. Closes certinia#103
ApexLogServer was a constructor plus one private registerTools, and the SDK v2 factory made its server field public just to reach it through a throwaway instance. createApexLogServer returns the McpServer directly. classificationCache moves to module scope. The factory builds one server per connection, so as an instance field the cache no longer had the process lifetime it is documented to have. runStdioServer returns void: no caller read the handle. Refs certinia#103
v4 removes key folding and path expansion. Every encode() call here passes no options, so no response changed and no golden moved. The other v4 encode forms were measured and none pay: keyed tabular costs a character per row, a tab or pipe delimiter saves 2 tokens on a 9,365-token response, nested field groups have nothing left to fold, and indentSize 1 saves 2.4% but decode rejects it. Recorded in DEVELOPING.md. Closes certinia#121
# Conflicts: # CHANGELOG.md
lcottercertinia
approved these changes
Aug 13, 2026
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.
Upgrades
@toon-format/toonfrom 2.3.1 to 4.1.1. There is no v3.v4 removes key folding and path expansion. Every
encode()call in this repopasses no options, so neither was in use: no response changed, and no golden
moved.
Measured, and rejected
The other v4 encode forms were each measured against all five tables:
indentSize: 1decoderejects itNone pays, so the default form stays. The reasoning is recorded in
DEVELOPING.mdso the next reader does not repeat the measurement.Verification
pnpm run build,pnpm run lint,pnpm test(256 tests) andpnpm run evalall pass. Response token counts and the ~1,093-token definition budget are
unmoved, and no golden was re-recorded.
Only
pnpm run evalcan see this change —jest.config.jsmaps@toon-format/toonto a JSON stand-in.Supersedes #105.
Stacked on #128. Until that merges, the diff here also shows its commits.
Closes #121