feat(sdk): add aigateway runtime wrapper with name registry narrowing - #1625
Merged
Conversation
🦋 Changeset detectedLatest commit: f791cf9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
📖 Docs Quality & Consistency Check
✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.
Checked areas:
packages/sdk/docs/runtime.md- Newaigatewayimport and namespace documented correctlypackages/sdk/docs/services/aigateway.md- Runtime Usage section matches implementation signature and behaviorpackages/sdk/docs/testing.md-mockAigateway()API documented correctly withsetUrls,calls, and error behavior.changeset/aigateway-runtime-wrapper.md- User-facing description accuratepackages/sdk/src/runtime/aigateway.ts- Exported JSDoc appropriate for user audiencepackages/sdk/src/vitest/mock.ts- Mock API implementation matches documented behaviorpackages/sdk/src/configure/types/aigateway-name.ts- Type narrowing behavior documented correctlypackages/sdk/src/cli/shared/type-generator.ts-AIGatewayNameRegistrygeneration matches documented behavior- All
create-sdktemplates correctly include emptyAIGatewayNameRegistryinterface
Verification details:
- Runtime API signature (
aigateway.get(name): Promise<{ url: string }>) matches docs - Type narrowing via
AIGatewayNameRegistryworks as documented - Mock API (
setUrls,calls, error behavior) matches testing docs - No internal RPC names (
dataplane.aigateway.v1.*) or protocol details leaked into user-facing docs - JSDoc on exported symbols appropriately describes user-facing behavior without implementation details
- References to
tailor.aigatewayglobal appropriately explain the wrapper relationship for user understanding
Re-run this check by adding the
docs-checklabel to the PR.
Contributor
|
@toiroakr |
Code Metrics Report (packages/sdk)
Details | | main (31b645b) | #1625 (5fb893d) | +/- |
|--------------------|----------------|-----------------|-------|
+ | Coverage | 71.2% | 71.2% | +0.0% |
| Files | 428 | 429 | +1 |
| Lines | 15737 | 15763 | +26 |
+ | Covered | 11211 | 11234 | +23 |
+ | Code to Test Ratio | 1:0.4 | 1:0.4 | +0.0 |
| Code | 107016 | 107175 | +159 |
+ | Test | 48418 | 48491 | +73 |Code coverage of files in pull request scope (90.6% → 90.4%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
remiposo
approved these changes
Jul 2, 2026
Merged
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.
Summary
aigateway.get(name)to@tailor-platform/sdk/runtime, a thin typed wrapper around the platform'stailor.aigateway.getglobal that resolves an AI Gateway's platform-assigned URL from resolvers, executors, and workflow jobs. Also available as its own subpath,@tailor-platform/sdk/runtime/aigateway, matching every otherruntime/*module.mockAigateway()to@tailor-platform/sdk/vitestfor mockingtailor.aigateway.getin unit tests, following the same pattern as the other platform API mocks.AIGatewayNameRegistry(andAIGatewayNametype) totailor.d.ts, mirroring the existingMachineUserNameRegistry/IdpNameRegistry/ConnectionNameRegistrypattern, soaigateway.get(...)is type-checked and autocompleted against the AI Gateways defined viadefineAIGateway().create-sdktemplatetailor.d.tsfiles and docs (runtime.md,testing.md,services/aigateway.md) accordingly.Notes
tailor.aigateway.get(name): Promise<{ url: string }>, backed by thedataplane.aigateway.v1.AIGatewayService/GetAIGatewayRPC) before adding the wrapper, since the SDK previously had no runtime-side binding for AI Gateway — only thedefineAIGateway()provisioning config existed.