Skip to content

[EPIC-D][LOU-D40] dockerode, MCP SDK and prompts become optional peers with install hints - #88

Merged
LinuxDevil merged 2 commits into
mainfrom
lou-d40-optional-heavy-deps
Oct 1, 2026
Merged

LinuxDevil merged 2 commits into
mainfrom
lou-d40-optional-heavy-deps

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

What

  • dockerode, @modelcontextprotocol/sdk and prompts move from dependencies to peerDependencies, marked optional in peerDependenciesMeta. They stay in devDependencies, so the repo's own tests still run. package-lock.json was regenerated with npx npm@11 install --package-lock-only (+105/-4, almost all "dev": true flags).
  • The optional-peer helper (src/providers/optionalPeer.ts) is generalized with a FEATURE_PEERS table. MissingPeerDependencyError now carries feature, 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.
  • prompts is now loaded lazily on first ask in loushy init (it was a static import). dockerode and the MCP SDK were already lazy (LOU-D19).
  • loushy doctor lists the three peers and what each enables. A missing dockerode is a failure when the spec uses a sandboxed tool, otherwise a warning. The Docker ping returns "unreachable" instead of crashing when dockerode is absent.
  • Doctor fix: resolveVersion returned undefined for packages whose exports map sends <pkg>/package.json to a nested manifest (the MCP SDK does). It now walks up to the manifest named after the package.
  • undici and yaml evaluated (see Why).
  • create-loushy-agent declares prompts as a dependency, so npm create loushy-agent interactive mode keeps working.
  • tsup.config.ts externals list the three peers explicitly. .fallowrc.json ignoreDependencies gains prompts, which the wrapper declares without importing.
  • Docs: docs/installation.md gains an "Optional peers" table plus the undici/yaml note. docs/guardrails.md and docs/deployment.md are 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 undici and yaml:

  • undici: it was only used for the per-request TLS dispatcher. With TLS verification on (the default), the http tool now uses the global fetch, so undici is not loaded. It is loaded only for validateSSL: false, which the global fetch cannot express per request without the global NODE_TLS_REJECT_UNAUTHORIZED race. I kept it as a regular dependency because that one option still needs it. Making it an optional peer would break validateSSL: false for existing users. Documented in the CHANGELOG and docs/installation.md.
  • yaml: kept as a dependency. Specs, agent.yaml, skills, readConfig and the spec generators all need a YAML parser, and Node has no built-in one. Agent Forge also uses it directly.

Acceptance criteria

  • Three packages are optional peers, kept in devDependencies, lock diff small
  • Loaded lazily through the optional-peer helper; importGraph.test.ts extended with prompts (it already listed dockerode and the MCP SDK); missing-peer error names the feature and the exact npm install command
  • undici / yaml evaluated: undici loaded only for validateSSL: false with global fetch otherwise; yaml kept (reasons above)
  • loushy doctor lists the three peers with what they enable
  • Agent Forge, the scaffolder and the deploy/Worker bundle builds and tests still pass; tsup.config.ts and .fallowrc.json updated
  • docs/installation.md "Optional peers" table; CHANGELOG with migration note; llms regenerated

How verified

  • npx tsc --noEmit: clean
  • npm run lint: 0 errors, 420 warnings. None are in code I added; the eslint warnings in touched files are pre-existing anys in http.test.ts.
  • npm run test:types: 24 passed, no type errors
  • npm run build && npm run build --workspace=packages/create-loushy-agent: success
  • npx 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. Forge test:server: 105 passed. Forge test: 108 passed.
  • npm run docs:verify-snippets -- --skip-build: all 102 snippets type-check
  • npm run docs:llms:check: passes
  • npm run test:coverage: 146 files / 2115 tests passed
  • npm run fallow: "No issues found"

🤖 Generated with Claude Code

https://claude.ai/code/session_016bY29ibQgv3MDdjAbUT4YR


Generated by Claude Code

claude added 2 commits October 1, 2026 14:33
…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
@LinuxDevil
LinuxDevil merged commit 3ac9cff into main Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants