Repository navigation
Add the shared project-tool registry (0.3.12) - #19
Merged
Merged
Conversation
Byte-identical copy of the uncommitted codex/agent-messaging working tree in the main checkout (package.json 0.3.11), taken on 2026-10-23 as the base for the shared project-tool registry. It is not new work: when that tree is committed upstream, the commits that follow rebase onto it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Both host plugins present every saved project MCP connection's tools as first-class host tools named ms_<tool>_<hash>, each with its own copy of the name, the definition, the result shape, the catalog refresh and the state directory (ADR 0004). This package now owns that registry: - src/shared/projectTools.ts: projectToolName (FNV-1a, 32-character cut; the CRM vector ms_crm_contacts_list_183f8138 is a frozen test), projectToolDefinition(s) with the 80-tool cap, projectToolResult pinned to both plugins' fixtures, readProjectToolCatalog with bounded concurrency and retention of an unreadable connection's earlier tools, and createProjectToolCatalog: the on-disk catalog (project-tool-catalog.json beside mcp-connections.json) with its lock, atomic writes, modification-time reload, scope-aware listing and dispose(). - mcp-catalog and mcp-tool-call actions for a host that reaches this package only through a worker process; ms-devtools mcp-catalog [--refresh] on the command line. - mainSequenceStateDirectory(env) replaces three copies of the state-directory path. - Project requests get their own budget, projectRequestTimeoutMs (default 120 s), and a tools/call honours _meta["mainsequence.ai/timeout-seconds/v1"] when larger, capped at 300 s. Error messages name the endpoint, method and status, tell a timeout from a connection failure, and keep a JSON-RPC error's own message; the codes are unchanged. - README and docs describe the registry, what stays host-specific and the measured cold-start latency; ADR 0004 records the decisions as implemented. Co-Authored-By: Claude Fable 5.1 <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.
Summary
devtools now owns the "saved project MCP tools as host tools" registry that the Claude Desktop mod and the Codex plugin each implemented by hand. Decision record:
docs/adr/0004-shared-project-tool-registry.md.src/shared/projectTools.ts:projectToolName(the FNV-1ams_<tool>_<hash>scheme, 32-character cut so Codex'smcp__mainsequence__qualification stays under 64 characters; frozen vectorms_crm_contacts_list_183f8138),projectToolDefinition,projectToolResult,readProjectToolCatalog(keeps a connection's earlier tools when its catalog cannot be read),createProjectToolCatalog(project-tool-catalog.jsonbesidemcp-connections.json, lock, atomic write, mtime reload,dispose).src/shared/stateDirectory.ts: onemainSequenceStateDirectory(env)for the connection store and the catalog.mcp-catalogandmcp-tool-call, so a host that cannot import the library (the Claude hook runtime) still gets shared naming and result shaping.projectRequestTimeoutMs(default 120 s; a cold FastAPI release took over 60 s to answerinitialize), honouring a tool's_meta["mainsequence.ai/timeout-seconds/v1"]up to 300 s. Backend requests keep 30 s.Why
A cold CRM call measured 53–71 s. Codex fails MCP tools at its default 60 s while the Claude mod ran the same devtools call with a 30-minute budget, so the CRM "worked in Claude and not in Codex". Fixing the timeout and the error messages in two plugins, and keeping two copies of the naming and result shaping in sync (they had already drifted: Claude pinned 0.3.1, Codex 0.3.11), is what this PR removes.
Consumers
src/hosts/toolCatalog.ts).src/hosts/claudeMcpNames.ts, pin 0.3.1 → 0.3.12).Testing
npm test: 182 tests pass (165 existing + 17 intests/project-tools.test.cjs).npm packofb8abf5fis reproducible:dev-mainsequence-devtools-0.3.12.tgz, 121471 bytes, integritysha512-eHm6KIwgwJeHQOWv2klVHRbasWXshcx9UQCO8zg7zQULtIiF2kDv0h6RrbXScaYAcU4nEAN02tljGk2pSXy67A==. Both consumer lockfiles pin exactly that integrity under the registry URL fordevtools-0.3.12.tgz: publish this pack unchanged, or regenerate their locks after publishing.ms_crm_contacts_list_68ee6e71returned a contact in 15 s over stdio.Review notes
c432cfa"Snapshot the devtools 0.3.11 working tree", is a byte-identical copy of the 0.3.11 working tree that existed only uncommitted in the main checkout; 0.3.12 had to build on it. Once 0.3.11 is committed on its own branch, rebaseb8abf5fonto it and dropc432cfa.npm ciuntil 0.3.12 is published; merge and publish this one first (Register project tools through devtools' shared registry (0.7.9) mainsequence-codex-plugin#4, Register MCP tools through devtools' shared registry (0.4.19) mainsequence-claude-desktop#24).🤖 Generated with Claude Code