Repository navigation
[EPIC-D][LOU-D40] dockerode, MCP SDK and prompts become optional peers with install hints - #88
Merged
Merged
Conversation
…s with install hints Move dockerode, @modelcontextprotocol/sdk and prompts from dependencies to optional peerDependencies (kept in devDependencies). The missing-peer error now names the feature and the exact npm install command; loushy doctor lists the three with what they enable; the http tool uses the global fetch unless validateSSL is false, so undici loads only then. yaml stays a dependency. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
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
dockerode,@modelcontextprotocol/sdkandpromptsmove fromdependenciestopeerDependencies, marked optional inpeerDependenciesMeta. They stay indevDependencies, so the repo's own tests still run.package-lock.jsonwas regenerated withnpx npm@11 install --package-lock-only(+105/-4, almost all"dev": trueflags).src/providers/optionalPeer.ts) is generalized with aFEATURE_PEERStable.MissingPeerDependencyErrornow carriesfeature, and its message names the feature and the exact command, e.g.The optional package 'dockerode' is not installed, but Docker sandboxing (SubprocessSandbox) needs it. Run: npm install dockerode@^5.0.1. A test keeps the table's ranges equal to package.json.promptsis now loaded lazily on first ask inloushy init(it was a static import).dockerodeand the MCP SDK were already lazy (LOU-D19).loushy doctorlists the three peers and what each enables. A missingdockerodeis a failure when the spec uses a sandboxed tool, otherwise a warning. The Docker ping returns "unreachable" instead of crashing whendockerodeis absent.resolveVersionreturnedundefinedfor packages whoseexportsmap sends<pkg>/package.jsonto a nested manifest (the MCP SDK does). It now walks up to the manifest named after the package.undiciandyamlevaluated (see Why).create-loushy-agentdeclarespromptsas a dependency, sonpm create loushy-agentinteractive mode keeps working.tsup.config.tsexternals list the three peers explicitly..fallowrc.jsonignoreDependenciesgainsprompts, which the wrapper declares without importing.docs/installation.mdgains an "Optional peers" table plus theundici/yamlnote.docs/guardrails.mdanddocs/deployment.mdare adjusted. CHANGELOG has a Changed entry with a migration note. llms files regenerated.Why
Every consumer installed Docker and MCP client code even for a hello world. The SDK already had a lazy optional-peer mechanism; this extends it.
Evaluation of
undiciandyaml:undici: it was only used for the per-request TLS dispatcher. With TLS verification on (the default), thehttptool now uses the globalfetch, so undici is not loaded. It is loaded only forvalidateSSL: false, which the globalfetchcannot express per request without the globalNODE_TLS_REJECT_UNAUTHORIZEDrace. I kept it as a regular dependency because that one option still needs it. Making it an optional peer would breakvalidateSSL: falsefor existing users. Documented in the CHANGELOG and docs/installation.md.yaml: kept as a dependency. Specs,agent.yaml, skills,readConfigand the spec generators all need a YAML parser, and Node has no built-in one. Agent Forge also uses it directly.Acceptance criteria
importGraph.test.tsextended withprompts(it already listeddockerodeand the MCP SDK); missing-peer error names the feature and the exactnpm installcommandundici/yamlevaluated: undici loaded only forvalidateSSL: falsewith globalfetchotherwise; yaml kept (reasons above)loushy doctorlists the three peers with what they enabletsup.config.tsand.fallowrc.jsonupdatedHow verified
npx tsc --noEmit: cleannpm run lint: 0 errors, 420 warnings. None are in code I added; the eslint warnings in touched files are pre-existinganys inhttp.test.ts.npm run test:types: 24 passed, no type errorsnpm run build && npm run build --workspace=packages/create-loushy-agent: successnpx vitest run(after build): 146 files passed, 2115 tests passed, 3 skipped. This includes the scaffolder e2e,importGraph,missingPeer, doctor, http and deploy adapter tests.npm run build:studio(Agent Forge): success. Forgetest:server: 105 passed. Forgetest: 108 passed.npm run docs:verify-snippets -- --skip-build: all 102 snippets type-checknpm run docs:llms:check: passesnpm run test:coverage: 146 files / 2115 tests passednpm run fallow: "No issues found"🤖 Generated with Claude Code
https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR
Generated by Claude Code