feat: Typed Responses Pipeline, Auth Hardening, and Upload Validation#351
Merged
Conversation
c15eea7 to
d508480
Compare
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.
This PR integrates a complete Typed Responses Pipeline into the SDK codegen, hardens authentication documentation, adds runtime verification tests, and increments the pre-release distribution track to
0.1.2-next.5.What Changed
1. Typed Responses Pipeline (
responses.generated.ts)We updated the code generation engine (
scripts/generate-sdk.ts) to output dedicated response schemas and typescript interfaces for every MCP tool binding.responses.generated.ts: Emits complete structural mappings for all tool method responses (e.g.,CreateProjectResponse,BatchCreateScreensResponse,ListScreensResponse).types.generated.ts: Contains complete underlying property schemas parsed out from tool contracts.any/unknownreturn constraints in generated domain methods (likeStitch.createProject()) with exact, high-fidelity type definitions.2. Authentication Documentation & Verification
upload-handler.ts: Added comprehensive trace documentation regarding direct REST interactions, body transcoder behaviors, and validation paths.client.ts: Hardened documentation aroundhttpPostauthentication priority logic (API Key vs OAuth token selection).live.test.ts: Aligned active integration verification routines to accurately consume the environment-injectedSTITCH_API_KEY.3. Architectural Tests & Utilities
parse-resource-name.test.ts: Adds exhaustive unit coverage for splitting cloud asset URIs into standalone numeric IDs (parseResourceName).screen-factory.test.ts: Introduces robust verification boundaries for domain instance object creation.utils.ts: Houses the structural resource parsing logic.4. Pre-Release Version Stamp
0.1.2-next.5.npm run buildto synchronize the compiled output and ensure the new version constant is embedded intosrc/version.ts.Files Changed
Generator & Pipeline Engine
scripts/generate-sdk.ts— Implemented Stage 2 Response Schema type mapping emissionsscripts/test/generate-sdk.test.ts— Added contract assertions for response payload generationscripts/tool-schema.ts— Integrated schema mapping arraysCodegen Output
packages/sdk/generated/src/responses.generated.ts— New (Typed response interfaces)packages/sdk/generated/src/types.generated.ts— New (Underlying field types)packages/sdk/generated/src/*.ts— Regenerated with exact return signatures mapped to tool response typesSDK Codebase & Infrastructure
packages/sdk/package.json— Incremented version to0.1.2-next.5packages/sdk/src/version.ts— Hardcoded compilation stamp updatedpackages/sdk/src/utils.ts— New (Resource name parser)packages/sdk/src/upload-handler.ts— Enhanced trace logging documentationpackages/sdk/src/client.ts— Added priority resolution comments tohttpPostTest Suites
packages/sdk/test/integration/live.test.ts— Corrected integration credential resolutionpackages/sdk/test/unit/parse-resource-name.test.ts— New (Resource name utility tests)packages/sdk/test/unit/screen-factory.test.ts— New (Domain projection factory tests)Documentation
.agents/skills/stitch-sdk-usage/SKILL.md— Updated usage patternspackages/sdk/README.md— Documented return models