feat(spec): Promote LLMAdapter interface to @objectstack/spec/contracts#1012
Merged
Conversation
5 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Created packages/spec/src/contracts/llm-adapter.ts with LLMAdapter interface - Added llm-adapter.test.ts with comprehensive type verification tests - Updated contracts/index.ts to export LLMAdapter - Updated service-ai to import LLMAdapter from @objectstack/spec/contracts - Re-export from service-ai for backward compatibility - Updated ROADMAP.md Contract Implementation Matrix - Updated CHANGELOG.md Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/265b5e7d-7f35-4751-8340-67374fe4ee78 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add LLMAdapter interface to @objectstack/spec/contracts
feat(spec): Promote LLMAdapter interface to @objectstack/spec/contracts
Mar 31, 2026
hotlong
marked this pull request as ready for review
March 31, 2026 07:21
Contributor
There was a problem hiding this comment.
Pull request overview
Promotes the LLMAdapter interface into the canonical protocol layer (@objectstack/spec/contracts) so third-party adapter authors no longer need to depend on @objectstack/service-ai just for the adapter contract.
Changes:
- Added
packages/spec/src/contracts/llm-adapter.tsand exported it viapackages/spec/src/contracts/index.ts. - Updated
@objectstack/service-aito import/re-exportLLMAdapterfrom@objectstack/spec/contracts(backward-compatible surface). - Added contract-level type tests for
LLMAdapterand updated roadmap/changelog notes.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ROADMAP.md | Notes that LLMAdapter contract now lives in spec. |
| packages/spec/src/contracts/llm-adapter.ts | New canonical LLMAdapter contract colocated with other spec contracts. |
| packages/spec/src/contracts/llm-adapter.test.ts | Adds contract/type coverage for minimal/full/optional method shapes. |
| packages/spec/src/contracts/index.ts | Re-exports the new contract from the contracts barrel. |
| packages/services/service-ai/src/plugin.ts | Switches LLMAdapter import to @objectstack/spec/contracts. |
| packages/services/service-ai/src/index.ts | Re-exports LLMAdapter type from spec for compatibility. |
| packages/services/service-ai/src/ai-service.ts | Switches LLMAdapter import to @objectstack/spec/contracts. |
| packages/services/service-ai/src/adapters/types.ts | Re-exports LLMAdapter from spec instead of defining it locally. |
| packages/services/service-ai/src/adapters/memory-adapter.ts | Updates LLMAdapter import source to spec. |
| packages/services/service-ai/src/adapters/index.ts | Re-exports LLMAdapter type from spec. |
| packages/services/service-ai/src/tests/ai-service.test.ts | Updates LLMAdapter import source to spec. |
| CHANGELOG.md | Documents the contract promotion and compatibility re-export. |
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.
LLMAdapterwas the only adapter contract defined inside a service package (service-ai) rather than in@objectstack/spec. This forced third-party adapter authors to depend on@objectstack/service-aifor a single interface.Changes
packages/spec/src/contracts/llm-adapter.ts— identical interface, imports AI types from siblingai-service.tsservice-ai/src/adapters/types.tsnow re-exports from spec instead of defining locallyai-service.ts,plugin.ts,memory-adapter.ts,adapters/index.ts,index.ts, and test file to source from@objectstack/spec/contractsAll 60 service-ai tests and 30 spec contract tests pass.