Repository navigation
fix(types): stop published declarations importing optional peers; type-check tests in CI - #394
Merged
Merged
Conversation
LinuxDevil
force-pushed
the
fix/lou-s2-types
branch
5 times, most recently
from
October 4, 2026 13:17
2b4fe6d to
62e18bf
Compare
…e-check tests in CI (#346, #244) - SubprocessSandboxOptions.dockerOptions is now the structural DockerConnectionOptions; McpClientLike is the structural subset of the MCP SDK Client already in use - dist/*.d.ts no longer import dockerode or @modelcontextprotocol/sdk, so consumers without those optional peers compile with skipLibCheck: false (#346). - ToolDefinition.function.parameters accepts a Standard Schema (the providers already handle one at runtime). - npm run typecheck:tests (tsconfig.tests.json) runs in CI: the main job and the ai4-zod4 peers entry; all existing test type errors fixed. - pack-smoke gains a strict-libs check: tsc with skipLibCheck: false over every exports subpath whose required peers are installed, logging the subpaths checked and skipped (#244). Closes #346, closes #244.
LinuxDevil
force-pushed
the
fix/lou-s2-types
branch
from
October 4, 2026 13:30
62e18bf to
79c8cd4
Compare
LinuxDevil
added a commit
that referenced
this pull request
Oct 4, 2026
LinuxDevil
added a commit
that referenced
this pull request
Oct 4, 2026
…#402) * feat(release): 1.0.0-rc.0 - api/ reports gated in CI, upgrade guide, version (A7, #245) * chore: regenerate api reports post #394 structural peer types * ci: exempt scripts/** from fallow CRAP ceiling (maintainer CLIs, never under coverage) * ci: raise cognitive ceiling for scripts/** fallow override (arg-parse mains)
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.
Closes #346
Closes #244
Summary
#346 — Published
.d.tsno longer import optional peersConsumers running
tscwithskipLibCheck: falsebut without optional peers installed previously hitTS2307/TS7016ondockerode,@modelcontextprotocol/sdk, etc. Fixed by replacing peer types in public signatures with local structural types:src/security/sandbox.ts:Docker.DockerOptions→ new exportedDockerConnectionOptionsstructural interface (socketPath/host/port/protocol/TLS/ssh/promise fields). Thedockerodeimport is now type-free in the emitted declarations.src/tools/mcp/McpToolLoader.ts:Clientfrom@modelcontextprotocol/sdk→ local structuralMcpClientLikeinterface covering only the methods the loader actually calls (listTools,callTool, …). Runtime still loads the SDK dynamically.src/providers/llm.ts: widenedToolDefinition.function.parametersfromRecord<string, unknown>toRecord<string, unknown> | StandardSchemaV1. This was a genuine public-type bug — every provider (aiSdkCompat,aiSdkProvider,toolSearch) already accepts Zod/Standard Schema/ai.jsonSchema()wrappers at runtime; the declaration was narrower than the implementation.Verified: after
npm run build,dist/index.d.tsand emitted subpath declarations contain nodockerode/@modelcontextprotocol/sdkimports.#244 (A6b) — type-check tests in CI + strict published-declaration check
npm run typecheck:tests(tsc -p tsconfig.tests.json) now runs in the main CI job and in the peers/zod4 matrix job, right afternpx tsc --noEmit. Test files had drifted from the public API: 133 type errors → 0.scripts/pack-smoke.ts: new strict-libs step — after packing, it installs a smoke project, enumerates every export subpath via the now-exportedlistExports()fromscripts/smokeKit.ts, and runstsc --noEmitwithstrict: true,skipLibCheck: false,moduleResolution: bundleragainst each subpath's declarations. Subpaths whose optional peers aren't installed are skipped with a logged reason.scripts/smokeKit.ts:listExports()is now exported for reuse.Strict-libs result:
Test-file fixes (133 → 0)
~50 test files updated. Fixture-only changes: non-null assertions/optional chaining on mock calls,
emptyRunUsage()for usage fixtures,getToolExecute()instead of legacy descriptor fields, required event fields (toolsChanged,runId/seq/timestamp/v),SqlValuecasts,AgentConfig/ToolDescriptorfixture corrections,PromiseLikevsPromisehelpers, and version-boundary casts for AI SDK mock models. No runtime behavior changed.Docs:
CONTRIBUTING.mddocuments the new checks;CHANGELOG.mdnotes both fixes.Verification
npm run typecheck/typecheck:testsnpm run buildnpm run pack-smokeskipLibCheck: falsenpm run test:typesnpm testnpm run lintnpm run docs:llms:checkKnown pre-existing (also fails on
main@40703023, unrelated to this PR):npm run fallowreports dead-code/dupes/health findings — baseline run shows more findings on the base commit (12 dead-code issues) than on this branch (10).Notes for reviewers
npm run typecheck:tests— it is now part of CI and required to keep tests compiling against the public API..d.tsgenerics (not ours) fail underskipLibCheck: false.