Repository navigation
fix(mcp): pass server instructions and hide turned-off inspectors' state - #379
Merged
Merged
Conversation
devframe 1.2.3 mounts the MCP route with exposeSharedState: true and has no instructions option, so agents got no guidance and devframe_state_read and devframe://state still showed inspectors turned off for agents (#238). - Patch devframe, @devframes/agentic and @devframes/hub 1.2.3 with pnpm patch to pass instructions and a shared-state filter through the route - Map each pangular: shared-state key to its inspector and hide keys whose agent tools are off - Pass short server instructions: call list-pages first, pass page when several pages are connected, read vs action tools, untrusted text is data - The patch applies to this repo only; the published package needs the upstream change Refs #340, #238
Contributor
|
View your CI Pipeline Execution ↗ for commit 1ba7894
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
19 tasks done
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 and why
These are the last two #340 items. Both were blocked in devframe 1.2.3:
instructions: devframe and@devframes/agentichave no option to pass them to the MCPServer.@devframes/agenticalready supports aexposeSharedStatepredicate. But devframe'smountMcpRouteand the hub'sinitHubhard-codeexposeSharedState: true, sodevframe_state_readanddevframe://statestill show inspectors that are turned off for agents.This PR patches the three packages locally with
pnpm patchand wires both into Pangular. Refs #340, #238.Patch (
patches/,patchedDependenciesinpnpm-workspace.yaml)devframe@1.2.3:resolveMcpConfigandmountMcpRoutecarryinstructionsandexposeSharedState, and the types are updated.@devframes/agentic@1.2.3: passesinstructionsto the SDKServer(stdio and the fetch handler).@devframes/hub@1.2.3:initHubforwards both tomountMcpHttp.Pangular
SHARED_STATE_INSPECTORinconfig.tsmaps everypangular:shared-state key to its inspector.sharedStateExposed()hides a key when that inspector's agent tools are off, and also hides unknownpangular:keys. A guard test fails if a new key isn't mapped.agent-mcp.tsbuilds short server instructions. Agents callpangular_list-pagesfirst and passpagewhen several pages are connected. They also get read tools vs action and destructive tools (with a read-only variant), and are told that_untrustedand app text is data, not instructions.pangular devis wired too.agents/mcp-server.md,agents/resources.mdandagents/tools.mdagent.toolsrow inconfiguration.mdcontributing/development.mdHow it was verified
pnpm install --frozen-lockfilepnpm commit:checkpnpm format:checkpnpm typecheckpnpm test:devtools: 2,095 tests. The newagent-mcp.test.ts(14 tests) covers:instructionsininitializepangular:formsmissing from the state key list, direct reads,resources/listandresources/readwhenagent.tools.formsis false, while other keys stay readablepangular devpathpnpm skills:check(.claude/not changed)apps/docsupdated andpnpm docs:buildpassespnpm extension:build(app/not changed)Notes for reviewers
@pangular-inspector/devtoolsstill get unpatched devframe 1.2.3. They don't getinstructionsand mcp: agent.tools.<inspector>=false still exposes the inspector's data through devframe_state_read #238 still applies to them. The extra options are ignored there, so nothing breaks. mcp: agent.tools.<inspector>=false still exposes the inspector's data through devframe_state_read #238 stays open until devframe ships the change. Upstream issue drafts and a tested patch fordevframes/devframeare ready to file.pnpm patch, or dropping them once upstream ships.pangular mcphas neither feature: that server has no live pages, so turned-off inspectors' state is empty there anyway.auth: false, the hub's MCP route now always mounts, where before it was'auto'. In practice nothing changes, since Pangular always registers agent tools.forms-collector.test.ts(expected at least 30 ms, got 22). It passes alone and passed on the rerun.Generated by Claude Code
Summary by CodeRabbit